Class MCMUtil


  • public class MCMUtil
    extends Object
    Utility methods for MCM.
    • Constructor Detail

      • MCMUtil

        public MCMUtil()
    • Method Detail

      • removePossibleJcrContent

        public static String removePossibleJcrContent​(String path)
      • getSegmentName

        public static String getSegmentName​(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.
        Parameters:
        resolver -
        path -
        Returns:
      • getAuthorizedUser

        public static User getAuthorizedUser​(ResourceResolver rr,
                                             String userId)
        API to get authorizable user for the given Id
        Parameters:
        rr -
        userId -
        Returns:
      • getUserId

        public static String getUserId​(ResourceResolver rr,
                                       String userId)
        Fetch user name from the given id
        Parameters:
        rr -
        userId -
        Returns:
      • isAnExperience

        public static boolean isAnExperience​(Resource resource)
        Checks if the resource is of an experience type (cq/personalization/components/teaserpage, cq/personalization/components/offerpage, mcm/components/newsletter/page, mcm/campaign/components/campaign_newsletterpage).
        Parameters:
        resource -
        Returns:
        true if type is an experience type, false otherwise.