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

com.adobe.cq.social.enablement.resource.model.api.EnablementResourceModel 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.social.enablement.resource.model.api;

import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.jcr.RepositoryException;

import org.apache.jackrabbit.api.security.user.Group;
import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.commons.json.JSONArray;

import com.adobe.cq.social.enablement.exceptions.EnablementException;
import com.adobe.cq.social.scf.SocialComponent;
import com.day.cq.commons.jcr.JcrConstants;

public interface EnablementResourceModel extends SocialComponent {

    public static final String RESOURCE_TYPE = "social/enablement/components/hbs/model/resource";
    public static final String ENABLEMENT_TYPE_VALUE = "resource";
    String ENABLEMENT_TYPE_DISPLAY_NAME = "Resource";

    public static final String JCR_TITLE = JcrConstants.JCR_TITLE;
    public static final String RESOURCE_NAME = "se_resource-name";
    public static final String DESCRIPTION = "se_description";
    public static final String RESOURCE_ID = "se_resource-id";
    public static final String RESOURCE_UID = "se_resource-uid";
    public static final String RESOURCE_TAGS = "se_resource-tags";
    public static final String ENABLEMENT_TYPE = "se_enablement-type";
    public static final String COVER_IMAGE = "se_cover-image";
    public static final String SITE = "se_site";
    public static final String DUE_DATE = "se_due-date";
    public static final String PUBLISHED = "se_published";
    public static final String FIRST_PUBLISHED_BY = "se_first-published-by";
    public static final String ALLOW_COMMENTS = "se_allow-comments";
    public static final String ALLOW_RATINGS = "se_allow-ratings";
    public static final String SHOW_IN_CATALOG = "se_show-in-catalog";
    public static final String ANONYMOUS_ACCESS = "se_anonymous-access";
    public static final String AUTHORS = "se_authors";
    public static final String CONTACTS = "se_contacts";
    public static final String EXPERTS = "se_experts";
    public static final String ASSIGNEES = "se_assignees";
    public static final String DATE_MODIFIED = "se_date-modified";
    public static final String DATE_CREATED = "se_date-created";
    public static final String DATE_PUBLISHED = "se_date-published";
    public static final String CARD_IMAGE_PATH = "se_card-image";
    public static final String ENROLLMENT_RESOURCE_NAME = "se_enrollment";
    public static final String ENROLLED_USERS = "se_enrolled_users";
    public static final String SEND_ENROLLMENT_EMAIL = "se_send-enrollment-email";
    public static final String REPLICATION_ACTION = "se_replication-action";
    public static final String APPLY_TO_LIST = "se_:applyTo";
    public static final String DIRECT_ENROLLMENT_QUERY_PROPERTY = "directly-enrolled";

    // From the site resource
    public static final String TAG_NAMESPACES = "tagNameSpaces";

    // the group of users who are directly enrolled in the resource
    public static final String DIRECT_ENROLLEE_GROUP_ID = "direct-enrollees";

    // the group of users who are indirectly enrolled in the resource
    public static final String INDIRECT_ENROLLEE_GROUP_ID = "indirect-enrollees";

    // the group of users who have a report record (some might have interacted with the resource though not enrolled)
    public static final String REPORT_USERS_GROUP_ID = "report-users";

    /**
     * @return resource title
     */
    public String getTitle();

    /**
     * @return resource name
     */
    public String getName();

    /**
     * updates resource name
     * @param name - name of resource
     * @throws PersistenceException thrown if exception occurs while persisting data
     * @throws EnablementException thrown if exception occurs while setting name
     */
    public void setName(String name) throws PersistenceException, EnablementException;

    /**
     * @return resource description
     */
    public String getDescription();

    /**
     * updates resource description
     * @param description - description of resource
     * @throws PersistenceException thrown if exception occurs while persisting data
     * @throws EnablementException thrown if exception occurs while setting description
     */
    public void setDescription(String description) throws PersistenceException, EnablementException;

    /**
     * @return resource enablement type
     */
    public String getEnablementType();

    /**
     * @return resource cover image
     */
    public String getCoverImage();

    /**
     * @return resource site path
     */
    public String getSite();

    /**
     * @return resource site id
     */
    public String getSiteId();

    /**
     * @return resource site unique id
     */
    public String getSiteUID();

    /**
     * @return resource site language
     */
    public String getLanguage();

    /**
     * @return resource date
     */
    public String getFriendlyDueDate();

    /**
     * @return resource date as a string
     */
    public String getDueDateAsString();

    /**
     * @return resource date as a calendar
     */
    public Calendar getDueDateAsCalendar();

    /**
     * @return resource date
     */
    public Date getDueDate();

    /**
     * @return resource id
     */
    public String getResourceId();

    /**
     * @return resource id
     */
    public String getResourceUID();

    /**
     * Gets the list of tagIds associated with the given Enablement content.
     * @return list of tagIds
     * @throws RepositoryException on failure
     */
    public String[] getResourceTags() throws RepositoryException;

    /**
     * @return resource allow comments
     */
    public Boolean getAllowComments();

    /**
     * @return resource allow ratings
     */
    public Boolean getAllowRatings();

    /**
     * @return resource is published
     */
    public Boolean getIsPublished();

    /**
     * @return resource allow anonymous
     */
    public Boolean getAllowAnonymous();

    /**
     * @return allow catalog visibility
     */
    Boolean getAllowCatalogVisibility();

    /**
     * @param key - key to be fetch data from map
     * @param assetMap - map
     * @throws PersistenceException thrown if exception occurs while persisting data
     * @throws EnablementException thrown if exception occurs while creating named asset
     */
    public void createNamedAsset(String key, Map assetMap) throws PersistenceException,
        EnablementException;

    /**
     * Create social resource endpoints.
     * @param displayName - name to be displayed
     * @param allowComments - boolean to allow comments
     * @param allowRatings - boolean to allow ratings
     * @throws PersistenceException thrown if exception occurs while persisting data
     * @throws EnablementException thrown if exception occurs while setting social resources
     */
    public void setSocialResources(final String displayName, final Boolean allowComments, final Boolean allowRatings)
        throws PersistenceException, EnablementException;

    /**
     * @param key - authorizable key
     * @param authorizableMap - map
     * @throws PersistenceException thrown if exception occurs while persisting data
     * @throws EnablementException thrown if exception occurs while setting authorizables
     */
    public void setAuthorizables(String key, Map authorizableMap) throws PersistenceException,
        EnablementException;

    /**
     * Returns an array of resource assets.
     * @return list of assets
     */
    public List getAssets();

    /**
     * @return the resource assets path where resources will be persisted in the DAM
     */
    public String getResourceAssetsPath();

    /**
     * Returns an object representing the primary resource asset.
     * @return primary asset
     */
    public EnablementAssetModel getPrimaryAsset();

    /**
     * Returns an object representing the primary resource asset.
     * @return small asset
     */
    public EnablementAssetModel getSmallAsset();

    /**
     * Returns an object representing the primary resource asset.
     * @return large asset
     */
    public EnablementAssetModel getLargeAsset();

    /**
     * Returns an object representing the primary resource asset.
     * @return fragment asset
     */
    public EnablementAssetModel getFragmentAsset();

    /**
     * @return get the enablement card image
     */
    public EnablementCardImage getEnablementCardImage();

    /**
     * @param coverImagePath - path of cover image
     * @throws EnablementException thrown if exception occurs while setting cover image path
     */
    void setCoverImagePath(final String coverImagePath) throws EnablementException;

    /**
     * @param cardImageTmpPath - path of card image
     * @throws PersistenceException thrown if exception occurs while persisting data
     * @throws EnablementException thrown if exception occurs while setting card image
     */
    public void setCardImage(final String cardImageTmpPath) throws PersistenceException, EnablementException;

    /**
     * Set due date for a resourse
     * @param dueDate - due date for resource to complete
     * @throws EnablementException thrown if exception occurs while setting dude date
     */
    public void setDueDate(final Calendar dueDate) throws EnablementException;

    /**
     * @return an object representing the social resource endpoints
     */
    public EnablementSocialModel getSocial();

    /**
     * Returns an object representing the contacts
     * @return contacts related to resource
     */
    public EnablementAuthorizables getContacts();

    /**
     * Returns an object representing the authors
     * @return authors related to resource
     */
    public EnablementAuthorizables getAuthors();

    /**
     * Returns an object representing the experts
     * @return experts related to resource
     */
    public EnablementAuthorizables getExperts();

    /**
     * Returns an object representing the assignees
     * @return assignees for resource
     */
    public EnablementAuthorizables getAssignees();

    /**
     * Returns a the primary asset type
     * @return primary asset type
     */
    public String getPrimaryAssetType();

    /**
     * Returns the first published date
     * @return publish date
     */
    public Date getFirstPublishedDate();

    /**
     * @param groupId - id of group
     * @return the authorizable group for the resource with the corresponding group id
     */
    public Group getResourceGroup(final String groupId);

    /**
     * @param name - name of asset
     * @param primaryAssetArray - array of primary assets
     */
    void importNamedAsset(String name, JSONArray primaryAssetArray);

    /**
     * @param tags - tags
     * @throws EnablementException thrown if exception occurs while setting tags
     */
    public void setTags(String[] tags) throws EnablementException;

    /**
     * @param showInCatalog - boolean to show resource in catalog
     * @throws EnablementException thrown if exception occurs while setting show in catalog
     */
    public void setShowInCatalog(Boolean showInCatalog) throws EnablementException;

    /**
     * @param allowAnonymousAccess - boolean to allow anonymous access
     * @throws EnablementException thrown if exception occurs while setting anonymous access
     */
    public void setAnonymousAccess(Boolean allowAnonymousAccess) throws EnablementException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy