Package com.day.cq.mcm.api
Class MCMUtil
java.lang.Object
com.day.cq.mcm.api.MCMUtil
Utility methods for MCM.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddPossibleSegmentsToValues(ValueMap content, Map<String, Object> values, ResourceResolver resourceResolver) static voidaddPossibleTagsToValues(Page aPage, Map<String, Object> values) static UsergetAuthorizedUser(ResourceResolver rr, String userId) API to get authorizable user for the given Idstatic StringgetSegmentName(ResourceResolver resolver, String path) Retrieves the title of the page under path or returns the path if the path doesn't lead to a page.static StringgetUserId(ResourceResolver rr, String userId) Fetch user name from the given idstatic booleanisAnExperience(Resource resource) Checks if theresourceis of an experience type (cq/personalization/components/teaserpage, cq/personalization/components/offerpage, mcm/components/newsletter/page, mcm/campaign/components/campaign_newsletterpage).static Stringstatic <T> voidwriteMapAsJsonObject(JSONWriter out, Map<String, T> m)
-
Constructor Details
-
MCMUtil
public MCMUtil()
-
-
Method Details
-
removePossibleJcrContent
-
writeMapAsJsonObject
- Parameters:
out-m-- Throws:
JSONException
-
addPossibleTagsToValues
public static void addPossibleTagsToValues(Page aPage, Map<String, Object> values) throws JSONException- Throws:
JSONException
-
addPossibleSegmentsToValues
public static void addPossibleSegmentsToValues(ValueMap content, Map<String, Object> values, ResourceResolver resourceResolver) throws JSONException- Throws:
JSONException
-
getSegmentName
Retrieves the title of the page under path or returns the path if the path doesn't lead to a page.- Parameters:
resolver-path-- Returns:
-
getAuthorizedUser
API to get authorizable user for the given Id- Parameters:
rr-userId-- Returns:
-
getUserId
Fetch user name from the given id- Parameters:
rr-userId-- Returns:
-
isAnExperience
Checks if theresourceis of an experience type (cq/personalization/components/teaserpage, cq/personalization/components/offerpage, mcm/components/newsletter/page, mcm/campaign/components/campaign_newsletterpage).- Parameters:
resource-- Returns:
trueif type is an experience type,falseotherwise.
-