Package io.meeds.social.cms.service
Interface CMSService
public interface CMSService
-
Method Summary
Modifier and TypeMethodDescriptiongetSetting(String settingType, String settingName) getSettingsByType(String settingType) getSettingsByTypeAndPageReference(String settingType, String pageReference) Retrieves only theCMSSettings of the given content type bound to the given page — unlikegetSettingsByType(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.booleanhasAccessPermission(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 usingPageKeyand usingSpaceidentifier.booleanhasAccessPermission(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 correspondingSpaceidentifier.booleanhasEditPermission(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 itsPageKeyand usingSpaceidentifier.booleanhasEditPermission(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 usingPageKeyand usingSpaceidentifier.booleanisSettingNameExists(String settingType, String settingName) voidsaveSettingName(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 usingPageKeyand usingSpaceidentifier. 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-Identityuser ACL identity to checkpageReference-PageKey.format()of format TYPE::OWNER::NAMEspaceId-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 correspondingSpaceidentifier. 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-Identityuser ACL identity to checksettingType- 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 itsPageKeyand usingSpaceidentifier. 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-Identityuser ACL identity to checkpageReference-PageKey.format()of format TYPE::OWNER::NAMEspaceId-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 usingPageKeyand usingSpaceidentifier. 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-Identityuser ACL identity to checksettingType- 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 namepageReference-PageKey.format()of format TYPE::OWNER::NAMEspaceId-Space.getId()technical identifieruserCreatorId- identifier of the identity that created the setting- Throws:
org.exoplatform.commons.ObjectAlreadyExistsException- when the setting already exists
-
isSettingNameExists
- Parameters:
settingType- Setting content type (notes, attachment, links...)settingName- Setting content name- Returns:
- true is setting name for corresponding type exists, else false
-
getSetting
- Parameters:
settingType- Setting content type (notes, attachment, links...)settingName- Setting content name- Returns:
CMSSettingif exists elase null
-
getSettingsByType
- Parameters:
settingType- Setting content type (notes, attachment, links...)- Returns:
- all
CMSSettingregistered for the given content type
-
getSettingsByTypeAndPageReference
Retrieves only theCMSSettings of the given content type bound to the given page — unlikegetSettingsByType(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
-