Class ResourceCollectionUtil


  • public class ResourceCollectionUtil
    extends java.lang.Object
    The ResourceCollectionUtil class provides some public utility methods...
    • Constructor Detail

      • ResourceCollectionUtil

        public ResourceCollectionUtil()
    • Method Detail

      • getResourceCollection

        public static ResourceCollection getResourceCollection​(javax.jcr.Node node,
                                                               ResourceCollectionManager manager)
                                                        throws javax.jcr.RepositoryException
        The method returns the ResourceCollection which is either represented by the given node or one of its children. This is useful in case the ResourceCollection is somewhere placed on a cq page (e.g.: /aPage/jcr:content/cq:collection/...
        Parameters:
        node - possible resource collection node.
        manager - the ResourceCollectionManager
        Returns:
        the ResourceCollection if such a collection found otherwise null
        Throws:
        javax.jcr.RepositoryException - RepositoryException in case an error occurs while fetching collection.
      • getContainingPage

        public static javax.jcr.Node getContainingPage​(ResourceCollection collection,
                                                       javax.jcr.Session session)
                                                throws javax.jcr.RepositoryException
        A ResourceCollection can be part of a cq page. This method returns the containing cq page.
        Parameters:
        collection - the ResourceCollection
        session - the user Session
        Returns:
        The page node if found otherwise the node which represents the collection.
        Throws:
        javax.jcr.RepositoryException - RepositoryException in case an error occurs while fetching node page.