Class CmsTimeFrameCategoryCollector

java.lang.Object
org.opencms.file.collectors.A_CmsResourceCollector
org.opencms.file.collectors.CmsTimeFrameCategoryCollector
All Implemented Interfaces:
Comparable<I_CmsResourceCollector>, I_CmsCollectorPublishListProvider, I_CmsResourceCollector

A collector that allows to collect resources within a time range based upon a configurable property that contains a time stamp.

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:

  • resource
    The value defines the folder / single file for collection of results.
  • resourceType
    The value defines the name of the type of resource that is required for the result as defined in opencms-modules.xml, opencms-workplace.xml.
  • resultLimit
    The value defines the maximum amount of results to return.
  • sortDescending
    The value defines if the result is sorted in descending ("true") or ascending (anything else than "true") order.
  • excludeTimeRange
    The value defines if the result should exclude the time range in an offline project.
  • timeStart
    The value defines the start time in the format 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.
  • timeEnd
    The value defines the end time in the format 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.
  • propertyTime
    The value defines the name of the property that is inspected for a time stamp in System.currentTimeMillis() syntax for the validity time frame check.
  • propertyCategories
    The value defines the name of the property that is inspected for a pipe separated list of category strings.
  • categories
    The value defines a list of comma separated category Strings used to filter result candidates by. If this parameter is missing completely no category filtering will be done and also resources with empty category property will be accepted.

All other key - value pairs are ignored.

Since:
7.0.3