org.opencms.workplace.list
Class CmsListResourcesCollector

java.lang.Object
  extended byorg.opencms.workplace.list.CmsListResourcesCollector
All Implemented Interfaces:
java.lang.Comparable, I_CmsResourceCollector

public class CmsListResourcesCollector
extends java.lang.Object
implements I_CmsResourceCollector

Collector for receiving CmsResource from a A_CmsListExplorerDialog.

Since:
6.1.2
Version:
$Revision: 1.4 $
Author:
Michael Moossen

Field Summary
static java.lang.String LIST_COLLECTOR_NAME
          Parameter of the default collector name.
 
Constructor Summary
CmsListResourcesCollector(java.util.List resources)
          Constructor, creates a new CmsListResourcesCollector.
 
Method Summary
 int compareTo(java.lang.Object arg0)
           
 java.util.List getCollectorNames()
          Returns a list of all collector names (Strings) this collector implementation supports.
 java.lang.String getCreateLink(CmsObject cms)
          Returns the link that must be executed when a user clicks on the direct edit "new" button on a list created by the default collector.
 java.lang.String getCreateLink(CmsObject cms, java.lang.String collectorName, java.lang.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.
 java.lang.String getCreateParam(CmsObject cms)
          Returns the default parameter that must be passed to the getCreateLink(CmsObject, String, String) method.
 java.lang.String getCreateParam(CmsObject cms, java.lang.String collectorName, java.lang.String param)
          Returns the parameter that must be passed to the getCreateLink(CmsObject, String, String) method.
 java.lang.String getDefaultCollectorName()
          Returns the default collector name to use for collecting resources.
 java.lang.String getDefaultCollectorParam()
          Returns the default collector parameter to use for collecting resources.
 int getOrder()
          Returns the "order weight" of this collector.
 java.util.List getResults(CmsObject cms)
          Returns a list of CmsResource Objects that are gathered in the VFS using the default collector name and parameter.
 java.util.List getResults(CmsObject cms, java.lang.String collectorName, java.lang.String param)
          Returns a list of CmsResource Objects that are gathered in the VFS using the named collector.
 void setDefaultCollectorName(java.lang.String collectorName)
          Sets the default collector name to use for collecting resources.
 void setDefaultCollectorParam(java.lang.String param)
          Sets the default collector parameter to use for collecting resources.
 void setOrder(int order)
          Sets the "order weight" of this collector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST_COLLECTOR_NAME

public static final java.lang.String LIST_COLLECTOR_NAME
Parameter of the default collector name.

See Also:
Constant Field Values
Constructor Detail

CmsListResourcesCollector

public CmsListResourcesCollector(java.util.List resources)
Constructor, creates a new CmsListResourcesCollector.

Parameters:
resources - a list of CmsResource objects.
Method Detail

compareTo

public int compareTo(java.lang.Object arg0)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

getCollectorNames

public java.util.List getCollectorNames()
Description copied from interface: I_CmsResourceCollector
Returns a list of all collector names (Strings) this collector implementation supports.

Specified by:
getCollectorNames in interface I_CmsResourceCollector
Returns:
a list of all collector names this collector implementation supports
See Also:
I_CmsResourceCollector.getCollectorNames()

getCreateLink

public java.lang.String getCreateLink(CmsObject cms)
Description copied from interface: I_CmsResourceCollector
Returns the link that must be executed when a user clicks on the direct edit "new" button on a list created by the default 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.

Specified by:
getCreateLink in interface I_CmsResourceCollector
Parameters:
cms - the current CmsObject
Returns:
the link to execute after a "new" button was clicked
See Also:
I_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject)

getCreateLink

public java.lang.String getCreateLink(CmsObject cms,
                                      java.lang.String collectorName,
                                      java.lang.String param)
Description copied from interface: I_CmsResourceCollector
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.

Specified by:
getCreateLink in interface I_CmsResourceCollector
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
See Also:
I_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject, java.lang.String, java.lang.String)

getCreateParam

public java.lang.String getCreateParam(CmsObject cms)
Description copied from interface: I_CmsResourceCollector
Returns the default parameter that must be passed to the I_CmsResourceCollector.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.

Specified by:
getCreateParam in interface I_CmsResourceCollector
Parameters:
cms - the current CmsObject
Returns:
the parameter that will be passed to the I_CmsResourceCollector.getCreateLink(CmsObject, String, String) method, or null
See Also:
I_CmsResourceCollector.getCreateParam(org.opencms.file.CmsObject)

getCreateParam

public java.lang.String getCreateParam(CmsObject cms,
                                       java.lang.String collectorName,
                                       java.lang.String param)
Description copied from interface: I_CmsResourceCollector
Returns the parameter that must be passed to the I_CmsResourceCollector.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.

Specified by:
getCreateParam in interface I_CmsResourceCollector
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 I_CmsResourceCollector.getCreateLink(CmsObject, String, String) method, or null
See Also:
I_CmsResourceCollector.getCreateParam(org.opencms.file.CmsObject, java.lang.String, java.lang.String)

getDefaultCollectorName

public java.lang.String getDefaultCollectorName()
Description copied from interface: I_CmsResourceCollector
Returns the default collector name to use for collecting resources.

Specified by:
getDefaultCollectorName in interface I_CmsResourceCollector
Returns:
the default collector name
See Also:
I_CmsResourceCollector.getDefaultCollectorName()

getDefaultCollectorParam

public java.lang.String getDefaultCollectorParam()
Description copied from interface: I_CmsResourceCollector
Returns the default collector parameter to use for collecting resources.

Specified by:
getDefaultCollectorParam in interface I_CmsResourceCollector
Returns:
the default collector parameter
See Also:
I_CmsResourceCollector.getDefaultCollectorParam()

getOrder

public int getOrder()
Description copied from interface: I_CmsResourceCollector
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.

Specified by:
getOrder in interface I_CmsResourceCollector
Returns:
the "order weight" of this collector
See Also:
I_CmsResourceCollector.getOrder()

getResults

public java.util.List getResults(CmsObject cms)
Description copied from interface: I_CmsResourceCollector
Returns a list of CmsResource Objects that are gathered in the VFS using the default collector name and parameter.

Specified by:
getResults in interface I_CmsResourceCollector
Parameters:
cms - the current CmsObject
Returns:
a list of CmsXmlContent objects
See Also:
I_CmsResourceCollector.getResults(org.opencms.file.CmsObject)

getResults

public java.util.List getResults(CmsObject cms,
                                 java.lang.String collectorName,
                                 java.lang.String param)
Description copied from interface: I_CmsResourceCollector
Returns a list of CmsResource Objects that are gathered in the VFS using the named collector.

Specified by:
getResults in interface I_CmsResourceCollector
Parameters:
cms - the current CmsObject
collectorName - the name of the collector to use
param - an optional collector parameter
Returns:
a list of CmsXmlContent objects
See Also:
I_CmsResourceCollector.getResults(org.opencms.file.CmsObject, java.lang.String, java.lang.String)

setDefaultCollectorName

public void setDefaultCollectorName(java.lang.String collectorName)
Description copied from interface: I_CmsResourceCollector
Sets the default collector name to use for collecting resources.

Specified by:
setDefaultCollectorName in interface I_CmsResourceCollector
Parameters:
collectorName - the default collector name
See Also:
I_CmsResourceCollector.setDefaultCollectorName(java.lang.String)

setDefaultCollectorParam

public void setDefaultCollectorParam(java.lang.String param)
Description copied from interface: I_CmsResourceCollector
Sets the default collector parameter to use for collecting resources.

Specified by:
setDefaultCollectorParam in interface I_CmsResourceCollector
Parameters:
param - the default collector parameter
See Also:
I_CmsResourceCollector.setDefaultCollectorParam(java.lang.String)

setOrder

public void setOrder(int order)
Description copied from interface: I_CmsResourceCollector
Sets the "order weight" of this collector.

Specified by:
setOrder in interface I_CmsResourceCollector
Parameters:
order - the order weight to set
See Also:
I_CmsResourceCollector.setOrder(int)