Interface I_CmsResourceCollector
-
- All Superinterfaces:
java.lang.Comparable<I_CmsResourceCollector>
,I_CmsCollectorPublishListProvider
- All Known Implementing Classes:
A_CmsResourceCollector
,CmsCategoryResourceCollector
,CmsChangedResourceCollector
,CmsDateResourceCollector
,CmsDefaultResourceCollector
,CmsPriorityResourceCollector
,CmsSolrCollector
,CmsSubscriptionCollector
,CmsTimeFrameCategoryCollector
public interface I_CmsResourceCollector extends java.lang.Comparable<I_CmsResourceCollector>, I_CmsCollectorPublishListProvider
A collector that generates list ofCmsResource
objects from the VFS.- Since:
- 6.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_LIMIT
The default limit for collector results.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<java.lang.String>
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 thegetCreateLink(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 thegetCreateLink(CmsObject, String, String)
method.int
getCreateTypeId(CmsObject cms, java.lang.String collectorName, java.lang.String param)
Returns the id of the resource type for new collector items.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<CmsResource>
getResults(CmsObject cms)
Returns a list ofCmsResource
Objects that are gathered in the VFS using the default collector name and parameter.java.util.List<CmsResource>
getResults(CmsObject cms, java.lang.String collectorName, java.lang.String param)
Returns a list ofCmsResource
Objects that are gathered in the VFS using the named collector.java.util.List<CmsResource>
getResults(CmsObject cms, java.lang.String collectorName, java.lang.String params, int numResults)
Returns a list ofCmsResource
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 interface org.opencms.file.collectors.I_CmsCollectorPublishListProvider
getPublishResources
-
-
-
-
Field Detail
-
DEFAULT_LIMIT
static final int DEFAULT_LIMIT
The default limit for collector results.- See Also:
- Constant Field Values
-
-
Method Detail
-
getCollectorNames
java.util.List<java.lang.String> 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
java.lang.String getCreateLink(CmsObject cms) 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 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.- Parameters:
cms
- the current CmsObject- Returns:
- the link to execute after a "new" button was clicked
- Throws:
CmsException
- if something goes wrongCmsDataAccessException
- if the parameter attribute of the corresponding collector tag is invalid- See Also:
getCreateParam(CmsObject, String, String)
-
getCreateLink
java.lang.String getCreateLink(CmsObject cms, java.lang.String collectorName, java.lang.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 CmsObjectcollectorName
- the name of the collector to useparam
- an optional collector parameter- Returns:
- the link to execute after a "new" button was clicked
- Throws:
CmsException
- if something goes wrongCmsDataAccessException
- if the parameter attribute of the corresponding collector tag is invalid- See Also:
getCreateParam(CmsObject, String, String)
-
getCreateParam
java.lang.String getCreateParam(CmsObject cms) throws CmsDataAccessException
Returns the default parameter that must be passed to thegetCreateLink(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- 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)
-
getCreateParam
java.lang.String getCreateParam(CmsObject cms, java.lang.String collectorName, java.lang.String param) throws CmsDataAccessException
Returns the parameter that must be passed to thegetCreateLink(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 CmsObjectcollectorName
- the name of the collector to useparam
- 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 parameter attribute of the corresponding collector tag is invalid- See Also:
getCreateLink(CmsObject, String, String)
-
getCreateTypeId
int getCreateTypeId(CmsObject cms, java.lang.String collectorName, java.lang.String param) throws CmsException
Returns the id of the resource type for new collector items.Returns -1 if creation of new items is not supported.
- Parameters:
cms
- the current CmsObjectcollectorName
- the name of the collector to useparam
- an optional collector parameter- Returns:
- the resource type id
- Throws:
CmsException
- if something goes wrong
-
getDefaultCollectorName
java.lang.String getDefaultCollectorName()
Returns the default collector name to use for collecting resources.- Returns:
- the default collector name
-
getDefaultCollectorParam
java.lang.String getDefaultCollectorParam()
Returns the default collector parameter to use for collecting resources.- Returns:
- the default collector parameter
-
getOrder
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 class.
- Returns:
- the "order weight" of this collector
-
getResults
java.util.List<CmsResource> getResults(CmsObject cms) throws CmsDataAccessException, CmsException
Returns a list ofCmsResource
Objects that are gathered in the VFS using the default collector name and parameter.- Parameters:
cms
- the current CmsObject- Returns:
- a list of CmsXmlContent objects
- Throws:
CmsException
- if something goes wrongCmsDataAccessException
- if the parameter attribute of the corresponding collector tag is invalid
-
getResults
java.util.List<CmsResource> getResults(CmsObject cms, java.lang.String collectorName, java.lang.String param) throws CmsDataAccessException, CmsException
Returns a list ofCmsResource
Objects that are gathered in the VFS using the named collector.- Parameters:
cms
- the current CmsObjectcollectorName
- the name of the collector to useparam
- an optional collector parameter- Returns:
- a list of CmsXmlContent objects
- Throws:
CmsException
- if something goes wrongCmsDataAccessException
- if the parameter attribute of the corresponding collector tag is invalid
-
getResults
java.util.List<CmsResource> getResults(CmsObject cms, java.lang.String collectorName, java.lang.String params, int numResults) throws CmsException
Returns a list ofCmsResource
Objects that are gathered in the VFS using the named collector.This method takes as a parameter the desired number of results. If this number is -1, the number of results will only depend on the collector parameters. If it is positive, any given result number in the collector parameter string will not be used.
- Parameters:
cms
- the current CmsObjectcollectorName
- the name of the collector to useparams
- an optional collector parameternumResults
- the desired number of results (overrides result number possibl- Returns:
- a list of CmsXmlContent objects
- Throws:
CmsException
- if something goes wrongCmsDataAccessException
- if the parameter attribute of the corresponding collector tag is invalid
-
setDefaultCollectorName
void setDefaultCollectorName(java.lang.String collectorName)
Sets the default collector name to use for collecting resources.- Parameters:
collectorName
- the default collector name
-
setDefaultCollectorParam
void setDefaultCollectorParam(java.lang.String param)
Sets the default collector parameter to use for collecting resources.- Parameters:
param
- the default collector parameter
-
setOrder
void setOrder(int order)
Sets the "order weight" of this collector.- Parameters:
order
- the order weight to set- See Also:
getOrder()
-
-