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

com.adobe.cq.xf.ui.ExperienceFragmentConsoleItem Maven / Gradle / Ivy

/*******************************************************************************
 * 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.xf.ui;

import aQute.bnd.annotation.ProviderType;
import com.day.cq.wcm.api.Page;

import javax.annotation.Nullable;
import javax.jcr.RepositoryException;
import java.util.Calendar;
import java.util.Set;

/**
 * The administration console item for experience fragments.
 */
@ProviderType
public interface ExperienceFragmentConsoleItem {

    /**
     * Returns the path of the experience fragment.
     *
     * @return the path of the experience fragment
     */
    String getPath();

    /**
     * Returns the resource type of the experience fragment. Can be the original cq/experience-fragments/components/xfpage or an overlay.
     *
     * @return the resource type of the experience fragment
     */
    String getResourceType();

    /**
     * Returns the title of the experience fragment page.
     *
     * @return the title of the experience fragment page
     */
    String getTitle();

    /**
     * Returns the last modification date of the resource.
     *
     * @return a {@link Calendar} object representing the last modification date.
     */
    Calendar getLastModified();

    /**
     * Returns the name of the user that modified this resource.
     *
     * @return the name of the user that modified this resource.
     */
    String getLastModifiedBy();

    /**
     * Returns the date that this resource was published (activated).
     *
     * @return a {@link Calendar} object or null if the page is not published
     */
    Calendar getPublishedDate();

    /**
     * Returns a set of relation identifiers for the quick actions.
     *
     * @return Set of relation identifiers
     * @throws RepositoryException if errors occur during repository operations
     */
    Set getQuickactionsRel() throws RepositoryException;

    /**
     * Returns the URL for the "Properties" action. This URL is determined according to the resource type.
     *
     * @return the "href" property for the "Properties" action.
     */
    String getViewPropertiesHref();

    /**
     * Checks whether the current item is a folder or not.
     *
     * @return true if the resource of this item is a folder, and false otherwise.
     */
    boolean isFolder();

    /**
     * Checks whether the current resource is a live-copy or not.
     *
     * @return true if the page is a live-copy, and false otherwise.
     */
    boolean isLiveCopy();

    /**
     * Checks whether the page represented by this item was created in the last 24hrs.
     *
     * @return true if the page was created in the last 24hrs, false otherwise
     */
    boolean isNew();

    /**
     * Checks whether this resource is an experience fragment "root" page and not a variation.
     *
     * @return true if the item represents a root page (cq/experience-fragments/components/experiencefragment), false otherwise
     */
    boolean isExperienceFragmentRoot();

    /**
     * Returns the parent Experience Fragment for this variation
     *
     * @return the {@link Page} which is the Experience Fragment if the current page is a variation or {@code null} otherwise
     */
    Page getParentXf();

    /**
     * Determines the URL that the user navigates when clicking the item.
     *
     * @return A valid URL, or an empty string if the item represents an experience fragment variant.
     */
    String getNavigatorHref();

    /**
     * Returns 'true' if the page is a social variation.
     *
     * @return true if the page is a social variation (Facebook, Pinterest etc)
     */
    boolean isSocial();

    /**
     * Returns master variation path for XFs and the resource path for other resources.
     *
     * @return the path of the master variation
     */
    String getMasterVariationPath();

    /**
     * Returns the preview link for SM variations.
     *
     * @return a String representing the preview link
     */
    String getViewPreviewHref();

    /**
     * Returns true if a variation is a master variation.
     *
     * @return {@code true} if this is a master variation, {@code false} otherwise
     */
    boolean isMaster();

    /**
     * Indicates the last social media action status.
     *
     * @return the social media status which can be one of 'Not Posted', 'Posted' or 'Deleted'
     */
    String getSocialActionStatus();

    /**
     * Returns the date of the last social media action.
     *
     * @return the date that the last social media action was performed
     */
    Calendar getSocialActionDate();

    /**
     * Checks if the experience fragment is exported as an Adobe Target offer.
     *
     * @return {@code true} if the variation is exported to Adobe Target, {@code false} otherwise
     */
    boolean isExportedToAdobeTarget();

    /**
     * Returns the status in Adobe Target (where applicable).
     *
     * @return a {@link String} representing the status. Possbile values are: 'Not Synchronized', 'Synchronized', 'Out Of Sync'
     */
    String getAdobeTargetStatus();

    /**
     * Returns the ID of the Adobe Target offer (where applicable).
     *
     * @return a {@link Long} representing Adobe Target offer ID
     */
    @Nullable Long getAdobeTargetId();

    /**
     * Checks if the current user has the "write" access on the resource {@link javax.jcr.security.Privilege#JCR_MODIFY_PROPERTIES} 
     * and {@link javax.jcr.security.Privilege#JCR_ADD_CHILD_NODES}
     *
     * @return true if the user has the write access, false otherwise
     * @throws RepositoryException if errors occur during repository operations
     */
    boolean hasWriteAccess() throws RepositoryException;

    /**
     * Checks if the current user has the "delete" access on the resource {@link javax.jcr.security.Privilege#JCR_REMOVE_CHILD_NODES} 
     * and {@link javax.jcr.security.Privilege#JCR_REMOVE_NODE}
     *
     * @return true if the user has the delete access, false otherwise
     * @throws RepositoryException if errors occur during repository operations
     */
    boolean hasDeleteAccess() throws RepositoryException;

    /**
     * Checks if the current user has the "replicate" access on the resource ("crx:replicate").
     *
     * @return true if the user has the "replicate" access, false otherwise
     * @throws RepositoryException if errors occur during repository operations
     */
    boolean hasReplicateAccess() throws RepositoryException;

    /**
     * Returns the type of this console item.
     *
     * @return one of the possible values: {@code variation}, {@code experiencefragment}, or {@code folder}
     */
    String getItemType();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy