org.opencms.file.collectors
Interface I_CmsResourceCollector

All Superinterfaces:
Comparable
All Known Implementing Classes:
A_CmsResourceCollector

public interface I_CmsResourceCollector
extends Comparable

A collector that generates list of CmsResource objects from the VFS.

Since:
6.0.0
Version:
$Revision: 1.6 $
Author:
Alexander Kandzior

Method Summary
 List getCollectorNames()
          Returns a list of all collector names (Strings) this collector implementation supports.
 String getCreateLink(CmsObject cms, String collectorName, String param)
          Returns the link that must be executed when a user clicks on the direct edit "new" button on a list created by the named collector.
 String getCreateParam(CmsObject cms, String collectorName, String param)
          Returns the parameter that must be passed to the getCreateLink(CmsObject, String, String) method.
 int getOrder()
          Returns the "order weight" of this collector.
 List getResults(CmsObject cms, String collectorName, String param)
          Returns a list of CmsResource Objects that are gathered in the VFS using the named collector.
 void setOrder(int order)
          Sets the "order weight" of this collector.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getCollectorNames

public List getCollectorNames()
Returns a list of all collector names (Strings) this collector implementation supports.

Returns:
a list of all collector names this collector implementation supports

getCreateLink

public String getCreateLink(CmsObject cms,
                            String collectorName,
                            String param)
                     throws CmsException,
                            CmsDataAccessException
Returns the link that must be executed when a user clicks on the direct edit "new" button on a list created by the named collector.

If this method returns null, it indicated that the selected collector implementation does not support a "create link", and so no "new" button will should shown on lists generated with this collector.

Parameters:
cms - the current CmsObject
collectorName - the name of the collector to use
param - an optional collector parameter
Returns:
the link to execute after a "new" button was clicked
Throws:
CmsException - if something goes wrong
CmsDataAccessException - if the param attrib of the corresponding collector tag is invalid
See Also:
getCreateParam(CmsObject, String, String)

getCreateParam

public String getCreateParam(CmsObject cms,
                             String collectorName,
                             String param)
                      throws CmsDataAccessException
Returns the parameter that must be passed to the getCreateLink(CmsObject, String, String) method.

If this method returns null, it indicates that the selected collector implementation does not support a "create link", and so no "new" button will should shown on lists generated with this collector.

Parameters:
cms - the current CmsObject
collectorName - the name of the collector to use
param - an optional collector parameter from the current page context
Returns:
the parameter that will be passed to the getCreateLink(CmsObject, String, String) method, or null
Throws:
CmsDataAccessException - if the param attrib of the corresponding collector tag is invalid
See Also:
getCreateLink(CmsObject, String, String)

getOrder

public int getOrder()
Returns the "order weight" of this collector.

The "order weight" is important because two collector classes may provide a collector with the same name. If this is the case, the collector implementation with the higher order number "overrules" the lower order number classs.

Returns:
the "order weight" of this collector

getResults

public List getResults(CmsObject cms,
                       String collectorName,
                       String param)
                throws CmsDataAccessException,
                       CmsException
Returns a list of CmsResource Objects that are gathered in the VFS using the named collector.

Parameters:
cms - the current CmsObject
collectorName - the name of the collector to use
param - an optional collector parameter
Returns:
a list of CmsXmlContent objects
Throws:
CmsException - if something goes wrong
CmsDataAccessException - if the param attrib of the corresponding collector tag is invalid

setOrder

public void setOrder(int order)
Sets the "order weight" of this collector.

Parameters:
order - the order weight to set
See Also:
getOrder()