org.opencms.ade.galleries
Class A_CmsTreeTabDataPreloader<T extends I_CmsGalleryTreeEntry<T>>

java.lang.Object
  extended by org.opencms.ade.galleries.A_CmsTreeTabDataPreloader<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.


Constructor Summary
A_CmsTreeTabDataPreloader()
           
 
Method Summary
protected abstract  T createEntry(CmsObject cms, CmsResource resource)
          Creates a tree entry bean from a resource.
protected  void findRoot(java.util.Collection<CmsResource> openResources)
          Finds the common root folder for a collection of resources.
protected  java.util.List<CmsResource> getChildren(CmsResource resource)
          Gets the children of a resource.
 T preloadData(CmsObject cms, java.util.Collection<CmsResource> openResources)
          Creates the preload data for a collection of resources which correspond to "opened" tree items.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

A_CmsTreeTabDataPreloader

public A_CmsTreeTabDataPreloader()
Method Detail

preloadData

public T preloadData(CmsObject cms,
                     java.util.Collection<CmsResource> openResources)
                                               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
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> openResources)
                 throws CmsException
Finds the common root folder for a collection of resources.

Parameters:
openResources - the collection of open resources
Throws:
CmsException - if something goes wrong

getChildren

protected java.util.List<CmsResource> getChildren(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