Package org.opencms.ade.galleries
Class A_CmsTreeTabDataPreloader<T extends I_CmsGalleryTreeEntry<T>>
java.lang.Object
org.opencms.ade.galleries.A_CmsTreeTabDataPreloader<T>
- Type Parameters:
T- the type of tree entry bean produced by this class
Abstract class which is used to generate the data for showing an already opened tree in the gallery dialog.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TcreateEntry(CmsObject cms, CmsResource resource) Creates a tree entry bean from a resource.protected voidfindRoot(Collection<CmsResource> resources) Finds the common root folder for a collection of resources.protected List<CmsResource> getChildren(CmsResource resource) Gets the children of a resource.protected StringgetCommonSite(Collection<CmsResource> resourceSet) Gets the common site root of a set of resources.preloadData(CmsObject cms, Set<CmsResource> openResources, Set<CmsResource> selectedResources) Creates the preload data for a collection of resources which correspond to "opened" tree items.
-
Constructor Details
-
A_CmsTreeTabDataPreloader
public A_CmsTreeTabDataPreloader()
-
-
Method Details
-
preloadData
public T preloadData(CmsObject cms, Set<CmsResource> openResources, 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 useopenResources- the resources which correspond to opened tree itemsselectedResources- 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
Creates a tree entry bean from a resource.- Parameters:
cms- the current CMS contextresource- the resource for which to create the tree entry bean- Returns:
- the created tree entry bean
- Throws:
CmsException- if something goes wrong
-
findRoot
Finds the common root folder for a collection of resources.- Parameters:
resources- the collection of resources- Throws:
CmsException- if something goes wrong
-
getChildren
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
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)
-