public class CmsTimeFrameCategoryCollector extends A_CmsResourceCollector
Additionally a property may be specified that contains a comma separated list of category Strings that have to match the specified list of categories to allow.
Demo usage:
<cms:contentload collector="timeFrameAndCategories" param=" resource=/de/events/| resourceType=xmlcontent| resultLimit=10| sortDescending=true| excludeTimerange=true| timeStart=2007-08-01 14:22:12| timeEnd=2007-08-01 14:22:12| propertyTime=collector.time| propertyCategories=collector.categories| categories=sports,action,lifestyle" >
The param attribute supports a key - value syntax for collector params.
All parameters are specified as follows:
key=value
Many key - value pairs may exist:
key=value|key2=value2|key3=value3
The following keys are reserved:
yyyy-MM-dd HH:mm:ss
as
known by the description of SimpleDateFormat
that will be used for the validity time frame of result candidates.
yyyy-MM-dd HH:mm:ss
as
known by the description of SimpleDateFormat
that will be used for the validity time frame of result candidates.
System.currentTimeMillis()
syntax for the validity time frame
check.
All other key - value pairs are ignored.
限定符和类型 | 字段和说明 |
---|---|
static java.text.DateFormat |
DATEFORMAT_SQL
SQL Standard date format: "yyyy-MM-dd HH:mm:ss".
|
m_order, SEPARATOR_TEMPLATEFILE
构造器和说明 |
---|
CmsTimeFrameCategoryCollector()
Public constructor.
|
限定符和类型 | 方法和说明 |
---|---|
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,
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,
java.lang.String collectorName,
java.lang.String param)
Returns the parameter that must be passed to the
I_CmsResourceCollector.getCreateLink(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.util.List<CmsResource> |
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. |
checkParams, compareTo, createResourceForCollector, equals, getCreateInFolder, getCreateInFolder, getCreateLink, getCreateParam, getDefaultCollectorName, getDefaultCollectorParam, getOrder, getResults, hashCode, setDefaultCollectorName, setDefaultCollectorParam, setOrder, shrinkToFit
public static final java.text.DateFormat DATEFORMAT_SQL
public java.util.List<java.lang.String> getCollectorNames()
I_CmsResourceCollector
I_CmsResourceCollector.getCollectorNames()
public java.lang.String getCreateLink(CmsObject cms, java.lang.String collectorName, java.lang.String param) throws CmsException, CmsDataAccessException
I_CmsResourceCollector
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.
cms
- the current CmsObjectcollectorName
- the name of the collector to useparam
- an optional collector parameterCmsException
- if something goes wrongCmsDataAccessException
- if the parameter attribute of the corresponding collector tag is invalidI_CmsResourceCollector.getCreateLink(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
public java.lang.String getCreateParam(CmsObject cms, java.lang.String collectorName, java.lang.String param)
I_CmsResourceCollector
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.
cms
- the current CmsObjectcollectorName
- the name of the collector to useparam
- an optional collector parameter from the current page contextI_CmsResourceCollector.getCreateLink(CmsObject, String, String)
method, or nullI_CmsResourceCollector.getCreateParam(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
public int getCreateTypeId(CmsObject cms, java.lang.String collectorName, java.lang.String param) throws CmsException
I_CmsResourceCollector
Returns -1 if creation of new items is not supported.
getCreateTypeId
在接口中 I_CmsResourceCollector
getCreateTypeId
在类中 A_CmsResourceCollector
cms
- the current CmsObjectcollectorName
- the name of the collector to useparam
- an optional collector parameterCmsException
- if something goes wrongA_CmsResourceCollector.getCreateTypeId(org.opencms.file.CmsObject, java.lang.String, java.lang.String)
public java.util.List<CmsResource> getResults(CmsObject cms, java.lang.String collectorName, java.lang.String param) throws CmsDataAccessException, CmsException
I_CmsResourceCollector
CmsResource
Objects that are
gathered in the VFS using the named collector.cms
- the current CmsObjectcollectorName
- the name of the collector to useparam
- an optional collector parameterCmsDataAccessException
- if the parameter attribute of the corresponding collector tag is invalidCmsException
- if something goes wrongI_CmsResourceCollector.getResults(org.opencms.file.CmsObject, java.lang.String, java.lang.String)