Home > Contents > Index >
FilterAssetsByDate.filter
Filters the given list of assets based on the input date and returns the result as a new list of assets
Syntax
public static int filter(IList inputList, String outputListName, String date, ICS ics)Parameters
inputList
- Input parameter. IList that represents the input set of assets. This list must contain columns with the names 'assetid' and 'assettype'
outputListName
- Output parameter. String that represents the name of the output list to be created after filtering the assets given by the inputList parameter
date
- Input parameter. String that represents the filter criteria. The start and end dates of input assets are compared with this parameter to decide if the asset will appear in the output list. If this parameter is null or empty, the current date on the Server is considered as the input date.
ics
- Input parameter. ICS object reference.
Important note about caching
It must be noted that when this method is invoked from within a template to render a set of assets selectively based on date, the resulting page is cached or not depending on an attribute called 'cs.sitepreview'. This property is specified in futuretense.ini and can have three possible values: contentmanagement, delivery and disabled. It must be set to
If the 'cs.sitepreview' property is set tocontentmanagement
for Content management installations anddelivery
for production installations.contentmanagement
this method performs the filtering operation on the given list of assets using the date specified in the date attribute. If no value is specified for the date attribute, the method uses the current Server date. Also, the method disables caching of the the current page and all of its parent pages.When 'cs.sitepreview' property is set to
delivery
, the 'date' input parameter is IGNORED and the current Server date is considered for filtering. This behaviour ensures that on production installations Sites renders only assets that are valid for the current date/time. Also in this case the expiry time for the cached pages will be dependent on the start/end date attributes of the asset being filtered.When 'cs.sitepreview' property is set to
disabled
, the method does not perform any filtering. It simply returns the input list as the output. Also in this case, caching of pages is not affected by this method.Returns
Creates a new IList with the name specified by the outputListName parameter. This list contains the set of assets that pass the filter test based on the input date.
The method also returns an integer representing the errno after the filter operation.
Example
The following example illustrates the use of
FilterAssetsByDate.filter
import COM.FutureTense.Interfaces.FTValList; import COM.FutureTense.Interfaces.FTVAL; import com.openmarket.basic.interfaces.IListObject; import com.openmarket.basic.interfaces.ListObjectFactory; import COM.FutureTense.Interfaces.ICS; import COM.FutureTense.Interfaces.IList; //Create a list object that will hold the input set of assets to be passed to the filter method IList listObject = ListObjectFactory.newListObject(); //Set the column names as expected by the filter method listObject.setColumns("assetid,assettype"); while(some input list not empty) { assetId = //Read from list assetType = // Read from list listObject.startNewRow(); listObject.setColumnValue(ASSETID, assetId); listObject.setColumnValue(ASSETTYPE, assetType); } int retVal = FilterAssetsByDate.filter(listObject,"filteredOutputList", your-date-value, ics); //Code to read from output list "filteredOutputList" and render them ...
Home > Contents > Index > Oracle JAVA Reference
Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.