All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.cq.msm.ui.models.alllivecopies.LiveCopiesRow Maven / Gradle / Ivy

There is a newer version: 2024.11.18751.20241128T090041Z-241100
Show newest version
/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * __________________
 *
 *  Copyright 2016 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/

package com.adobe.cq.msm.ui.models.alllivecopies;


import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class LiveCopiesRow {
    private String rowPath;
    private String rowTitle;
    private List cells;
    private Map rowAttrs;


    private boolean isPage;

    private String thumbnailPath;

    private String actionRels;

    private String relPath;

    public LiveCopiesRow(String resourcePath, String resourceName, String relPath) {
        this.isPage = false;
        this.cells = Collections.emptyList();
        this.rowPath = resourcePath;
        this.rowTitle = resourceName;
        this.rowAttrs = setRowAttributes(rowPath);
        this.thumbnailPath = "";
        this.actionRels = "";
        this.relPath = relPath;


    }

    public LiveCopiesRow(Boolean isPage, String rowPath, String rowTitle, List cells, String thumbnailPath, String actionRels, String relPath) {
        this.isPage = isPage;
        this.cells = cells;
        this.rowPath = rowPath;
        this.rowTitle = rowTitle;
        this.rowAttrs = setRowAttributes(rowPath);
        this.thumbnailPath = thumbnailPath;
        this.actionRels = actionRels;
        this.relPath = relPath;
    }

    public boolean isPage() {
        return isPage;
    }

    public String getRowPath() {
        return rowPath;
    }

    public String getRowTitle() {
        return rowTitle;
    }

    public List getCells() {
        return cells;
    }

    public Map getRowAttrs() {
        return rowAttrs;
    }

    public String getThumbnailPath() {
        if (isPage) {
            return thumbnailPath;
        }
        return null;
    }

    public String getActionRels() {
        return actionRels;
    }

    public String getRelPath() {
        return relPath;
    }

    public boolean isRolloutHierarchicalResource() {
        return isPage;
    }

    private Map setRowAttributes(String rowPath) {
        Map rowAttrs = new HashMap();
        rowAttrs.put("is", "coral-table-row");
        rowAttrs.put("data-foundation-collection-item-id", rowPath);
        if (isRolloutHierarchicalResource()) {
            rowAttrs.put("selectable", "selectable");
        }
        rowAttrs.put("data-path", rowPath);
        return rowAttrs;
    }




}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy