Class A_CmsTreeTabDataPreloader<T extends I_CmsGalleryTreeEntry<T>>

  • Type Parameters:
    T - the type of tree entry bean produced by this class

    public abstract class A_CmsTreeTabDataPreloader<T extends I_CmsGalleryTreeEntry<T>>
    extends java.lang.Object
    Abstract class which is used to generate the data for showing an already opened tree in the gallery dialog.

    • Method Detail

      • preloadData

        public T preloadData​(CmsObject cms,
                             java.util.Set<CmsResource> openResources,
                             java.util.Set<CmsResource> selectedResources)
                      throws CmsException
        Creates the preload data for a collection of resources which correspond to "opened" tree items.

        Parameters:
        cms - the CMS context to use
        openResources - the resources which correspond to opened tree items
        selectedResources - resources which should be part of the tree, but not opened
        Returns:
        the root tree entry bean which was created
        Throws:
        CmsException - if something goes wrong
      • createEntry

        protected abstract T createEntry​(CmsObject cms,
                                         CmsResource resource)
                                  throws CmsException
        Creates a tree entry bean from a resource.

        Parameters:
        cms - the current CMS context
        resource - the resource for which to create the tree entry bean
        Returns:
        the created tree entry bean
        Throws:
        CmsException - if something goes wrong
      • findRoot

        protected void findRoot​(java.util.Collection<CmsResource> resources)
                         throws CmsException
        Finds the common root folder for a collection of resources.

        Parameters:
        resources - the collection of resources
        Throws:
        CmsException - if something goes wrong
      • getChildren

        protected java.util.List<CmsResourcegetChildren​(CmsResource resource)
                                                   throws CmsException
        Gets the children of a resource.

        Parameters:
        resource - the resource for which the children should be read
        Returns:
        the children of the resource
        Throws:
        CmsException - if something goes wrong
      • getCommonSite

        protected java.lang.String getCommonSite​(java.util.Collection<CmsResource> resourceSet)
        Gets the common site root of a set of resources.

        Parameters:
        resourceSet - the resources
        Returns:
        the common site root (may also be the shared folder or root folder)