Class CmsSubscriptionCollector
- All Implemented Interfaces:
Comparable<I_CmsResourceCollector>
,I_CmsCollectorPublishListProvider
,I_CmsResourceCollector
The configuration of the collectors can be done in the parameter String using key value pairs,
separated by the |
(pipe) symbol. The following configuration options are available:
- currentuser: determines if the current user should be used to read visited or subscribed resources
(not considered if the
user
parameter is used) - daysfrom: the number of days subtracted from the current day specifying the start point in time from which a resource was visited
- daysto: the number of days subtracted from the current day specifying the end point in time to which a resource was visited
- groups: the users group names, separated by comma, to read subscribed resources for
- includegroups: the include groups flag to read subscribed resources also for the given or current users groups
(not considered if the
groups
parameter is used) - includesubfolders: the include subfolders flag to read subscribed resources also for the subfolders of the given parent folder
(not considered if the
resource
parameter is not used) - mode: the subscription read mode, can be
all
,visited
orunvisited
(default) - resource: the resource, i.e. the parent folder from which the subscribed or visited resources should be read from
- user:<the user to read subscribed or visited resources for/li>
currentuser=true|daysfrom=14|includegroups=true|mode=unvisited|resource=/demo_en/|includesubfolders=true
- Since:
- 8.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The collector parameter key for the current user flag (to set the user in the filters to the current user).static final String
The collector parameter key for the number of days subtracted from the current day specifying the start point in time from which a resource was visited.static final String
The collector parameter key for the number of days subtracted from the current day specifying the end point in time to which a resource was visited.static final String
The collector parameter key for the users group names, separated by comma, to read subscribed resources for.static final String
The collector parameter key for the include groups flag to read subscribed resources also for the given or current users groups.static final String
The collector parameter key for the include subfolders flag to read subscribed resources also for the subfolders of the given parent folder.static final String
The collector parameter key for the subscription read mode.static final String
The collector parameter key for the resource, i.e.static final String
The collector parameter key for the user to read subscribed or visited resources for.Fields inherited from class org.opencms.file.collectors.A_CmsResourceCollector
m_order, SEPARATOR_TEMPLATEFILE
Fields inherited from interface org.opencms.file.collectors.I_CmsResourceCollector
DEFAULT_LIMIT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of all collector names (Strings) this collector implementation supports.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.getCreateParam
(CmsObject cms, String collectorName, String param) Returns the parameter that must be passed to theI_CmsResourceCollector.getCreateLink(CmsObject, String, String)
method.getResults
(CmsObject cms, String collectorName, String param) Returns a list ofCmsResource
Objects that are gathered in the VFS using the named collector.getResults
(CmsObject cms, String collectorName, String param, int numResults) Returns a list ofCmsResource
Objects that are gathered in the VFS using the named collector.protected List<CmsResource>
getSubscribedDeletedResources
(CmsObject cms, String param, int numResults) Returns the subscribed deleted resources according to the collector parameter.protected List<CmsResource>
getSubscribedResources
(CmsObject cms, String param, int numResults) Returns the subscribed resources according to the collector parameter.protected CmsSubscriptionFilter
getSubscriptionFilter
(CmsObject cms, String param) Returns the configured subscription filter to use.protected CmsSubscriptionFilter
getSubscriptionFilter
(CmsObject cms, Map<String, String> params) Returns the configured subscription filter to use.protected CmsVisitedByFilter
getVisitedByFilter
(CmsObject cms, String param) Returns the configured visited by filter to use.protected List<CmsResource>
getVisitedResources
(CmsObject cms, String param, int numResults) Returns the visited resources according to the collector parameter.Methods inherited from class org.opencms.file.collectors.A_CmsResourceCollector
checkParams, compareTo, createResourceForCollector, equals, getCreateInFolder, getCreateInFolder, getCreateLink, getCreateParam, getCreateTypeId, getDefaultCollectorName, getDefaultCollectorParam, getOrder, getPostCreateHandler, getPublishResources, getResults, hashCode, setDefaultCollectorName, setDefaultCollectorParam, setOrder, shrinkToFit, shrinkToFit
-
Field Details
-
PARAM_KEY_CURRENTUSER
The collector parameter key for the current user flag (to set the user in the filters to the current user).- See Also:
-
PARAM_KEY_DAYSFROM
The collector parameter key for the number of days subtracted from the current day specifying the start point in time from which a resource was visited.- See Also:
-
PARAM_KEY_DAYSTO
The collector parameter key for the number of days subtracted from the current day specifying the end point in time to which a resource was visited.If the parameter
PARAM_KEY_DAYSFROM
is also used, the value of this key should be less than the value set asPARAM_KEY_DAYSFROM
parameter.- See Also:
-
PARAM_KEY_GROUPS
The collector parameter key for the users group names, separated by comma, to read subscribed resources for.- See Also:
-
PARAM_KEY_INCLUDEGROUPS
The collector parameter key for the include groups flag to read subscribed resources also for the given or current users groups.- See Also:
-
PARAM_KEY_INCLUDESUBFOLDERS
The collector parameter key for the include subfolders flag to read subscribed resources also for the subfolders of the given parent folder.- See Also:
-
PARAM_KEY_MODE
The collector parameter key for the subscription read mode.- See Also:
-
PARAM_KEY_RESOURCE
The collector parameter key for the resource, i.e. the parent folder from which the subscribed or visited resources should be read from.- See Also:
-
PARAM_KEY_USER
The collector parameter key for the user to read subscribed or visited resources for.- See Also:
-
-
Constructor Details
-
CmsSubscriptionCollector
public CmsSubscriptionCollector()
-
-
Method Details
-
getCollectorNames
Description copied from interface:I_CmsResourceCollector
Returns a list of all collector names (Strings) this collector implementation supports.- Returns:
- a list of all collector names this collector implementation supports
- See Also:
-
getCreateLink
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.- 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
- See Also:
-
getCreateParam
Description copied from interface:I_CmsResourceCollector
Returns the parameter that must be passed to theI_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.- 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
I_CmsResourceCollector.getCreateLink(CmsObject, String, String)
method, or null - See Also:
-
getResults
public List<CmsResource> getResults(CmsObject cms, String collectorName, String param) throws CmsDataAccessException, CmsException Description copied from interface:I_CmsResourceCollector
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:
CmsDataAccessException
- if the parameter attribute of the corresponding collector tag is invalidCmsException
- if something goes wrong- See Also:
-
getResults
public List<CmsResource> getResults(CmsObject cms, String collectorName, String param, int numResults) throws CmsDataAccessException, CmsException Description copied from interface:I_CmsResourceCollector
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 useparam
- an optional collector parameternumResults
- the desired number of results (overrides result number possibl- Returns:
- a list of CmsXmlContent objects
- Throws:
CmsDataAccessException
- if the parameter attribute of the corresponding collector tag is invalidCmsException
- if something goes wrong- See Also:
-
getSubscribedDeletedResources
protected List<CmsResource> getSubscribedDeletedResources(CmsObject cms, String param, int numResults) throws CmsException Returns the subscribed deleted resources according to the collector parameter.- Parameters:
cms
- the current users contextparam
- an optional collector parameternumResults
- the number of results- Returns:
- the subscribed deleted resources according to the collector parameter
- Throws:
CmsException
- if something goes wrong
-
getSubscribedResources
protected List<CmsResource> getSubscribedResources(CmsObject cms, String param, int numResults) throws CmsException Returns the subscribed resources according to the collector parameter.- Parameters:
cms
- the current users contextparam
- an optional collector parameternumResults
- the number of results- Returns:
- the subscribed resources according to the collector parameter
- Throws:
CmsException
- if something goes wrong
-
getSubscriptionFilter
protected CmsSubscriptionFilter getSubscriptionFilter(CmsObject cms, Map<String, String> params) throws CmsExceptionReturns the configured subscription filter to use.- Parameters:
cms
- the current users contextparams
- the optional collector parameters- Returns:
- the configured subscription filter to use
- Throws:
CmsException
- if something goes wrong
-
getSubscriptionFilter
protected CmsSubscriptionFilter getSubscriptionFilter(CmsObject cms, String param) throws CmsException Returns the configured subscription filter to use.- Parameters:
cms
- the current users contextparam
- an optional collector parameter- Returns:
- the configured subscription filter to use
- Throws:
CmsException
- if something goes wrong
-
getVisitedByFilter
Returns the configured visited by filter to use.- Parameters:
cms
- the current users contextparam
- an optional collector parameter- Returns:
- the configured visited by filter to use
- Throws:
CmsException
- if something goes wrong
-
getVisitedResources
protected List<CmsResource> getVisitedResources(CmsObject cms, String param, int numResults) throws CmsException Returns the visited resources according to the collector parameter.- Parameters:
cms
- the current users contextparam
- an optional collector parameternumResults
- the number of results- Returns:
- the visited resources according to the collector parameter
- Throws:
CmsException
- if something goes wrong
-