Interface CMSService


public interface CMSService
  • Method Summary

    Modifier and Type
    Method
    Description
    getSetting(String settingType, String settingName)
     
     
    getSettingsByTypeAndPageReference(String settingType, String pageReference)
    Retrieves only the CMSSettings of the given content type bound to the given page — unlike getSettingsByType(java.lang.String), this doesn't scan every setting of the content type, since the page reference is itself the metadata name settings are indexed by.
    boolean
    hasAccessPermission(org.exoplatform.services.security.Identity identity, String pageReference, long spaceId)
    Checks whether the user has access permission or not to an application content referenced inside a page using PageKey and using Space identifier.
    boolean
    hasAccessPermission(org.exoplatform.services.security.Identity identity, String settingType, String settingName)
    Checks whether the user has access permission or not to an application content referenced using its setting type and name in order to retrieve its page reference and corresponding Space identifier.
    boolean
    hasEditPermission(org.exoplatform.services.security.Identity identity, String pageReference, long spaceId)
    Checks whether the user has edit permission or not to an application content referenced using its setting type and name in order to retrieve its PageKey and using Space identifier.
    boolean
    hasEditPermission(org.exoplatform.services.security.Identity identity, String settingType, String settingName)
    Checks whether the user has edit permission or not to an application content referenced inside a page using PageKey and using Space identifier.
    boolean
    isSettingNameExists(String settingType, String settingName)
     
    void
    saveSettingName(String settingType, String settingName, String pageReference, long spaceId, long userCreatorId)
    Saves the Page reference and corresponding space identifier to the setting content type and name.
  • Method Details

    • hasAccessPermission

      boolean hasAccessPermission(org.exoplatform.services.security.Identity identity, String pageReference, long spaceId)
      Checks whether the user has access permission or not to an application content referenced inside a page using PageKey and using Space identifier. If the user has access to the page or is member of the designated space (if id > 0), then this will return true, else return false.
      Parameters:
      identity - Identity user ACL identity to check
      pageReference - PageKey.format() of format TYPE::OWNER::NAME
      spaceId - Space.getId() technical identifier
      Returns:
      true if has access else false
    • hasAccessPermission

      boolean hasAccessPermission(org.exoplatform.services.security.Identity identity, String settingType, String settingName)
      Checks whether the user has access permission or not to an application content referenced using its setting type and name in order to retrieve its page reference and corresponding Space identifier. If the user has access to the page or is member of the designated space (if id > 0), then this will return true, else return false.
      Parameters:
      identity - Identity user ACL identity to check
      settingType - Setting content type (notes, attachment, links...)
      settingName - Setting content name
      Returns:
      true if has access else false
    • hasEditPermission

      boolean hasEditPermission(org.exoplatform.services.security.Identity identity, String pageReference, long spaceId)
      Checks whether the user has edit permission or not to an application content referenced using its setting type and name in order to retrieve its PageKey and using Space identifier. If the user has edit permission to the page (member of /platform/administrators or publisher:/platform/web-contibutors) or is manager|publisher of the designated space (if id > 0), then this will return true, else return false.
      Parameters:
      identity - Identity user ACL identity to check
      pageReference - PageKey.format() of format TYPE::OWNER::NAME
      spaceId - Space.getId() technical identifier
      Returns:
      true if has edit access else false
    • hasEditPermission

      boolean hasEditPermission(org.exoplatform.services.security.Identity identity, String settingType, String settingName)
      Checks whether the user has edit permission or not to an application content referenced inside a page using PageKey and using Space identifier. If the user has edit permission to the page (member of /platform/administrators or publisher:/platform/web-contibutors) or is manager|publisher of the designated space (if id > 0), then this will return true, else return false.
      Parameters:
      identity - Identity user ACL identity to check
      settingType - Setting content type (notes, attachment, links...)
      settingName - Setting content name
      Returns:
      true if has edit access else false
    • saveSettingName

      void saveSettingName(String settingType, String settingName, String pageReference, long spaceId, long userCreatorId) throws org.exoplatform.commons.ObjectAlreadyExistsException
      Saves the Page reference and corresponding space identifier to the setting content type and name.
      Parameters:
      settingType - Setting content type (notes, attachment, links...)
      settingName - Setting content name
      pageReference - PageKey.format() of format TYPE::OWNER::NAME
      spaceId - Space.getId() technical identifier
      userCreatorId - identifier of the identity that created the setting
      Throws:
      org.exoplatform.commons.ObjectAlreadyExistsException - when the setting already exists
    • isSettingNameExists

      boolean isSettingNameExists(String settingType, String settingName)
      Parameters:
      settingType - Setting content type (notes, attachment, links...)
      settingName - Setting content name
      Returns:
      true is setting name for corresponding type exists, else false
    • getSetting

      CMSSetting getSetting(String settingType, String settingName)
      Parameters:
      settingType - Setting content type (notes, attachment, links...)
      settingName - Setting content name
      Returns:
      CMSSetting if exists elase null
    • getSettingsByType

      List<CMSSetting> getSettingsByType(String settingType)
      Parameters:
      settingType - Setting content type (notes, attachment, links...)
      Returns:
      all CMSSetting registered for the given content type
    • getSettingsByTypeAndPageReference

      List<CMSSetting> getSettingsByTypeAndPageReference(String settingType, String pageReference)
      Retrieves only the CMSSettings of the given content type bound to the given page — unlike getSettingsByType(java.lang.String), this doesn't scan every setting of the content type, since the page reference is itself the metadata name settings are indexed by.
      Parameters:
      settingType - Setting content type (notes, attachment, links...)
      pageReference - PageKey.format() of format TYPE::OWNER::NAME
      Returns:
      the CMSSettings of the given content type bound to the given page