Home > Contents > Index >
asset:filterassetsbydate
This tag takes an input list of assets, compares the start and end date attributes of each of those assets with a specified date and constructs an output list consisting of assets whose start/end dates contain the given date. See description below for more specific use-cases. Note: When this tag is used in a JSP page on production environment, it ignores any date attribute that is passed to the tag and considers the current SERVER date for the filtering process. Also see the Important note section for related information regarding a related property setting.
Syntax
<asset:filterassetsbydate inputList="inputListName" outputList="outputListName" [date="date value specified in either yyyy-MM-dd HH:mm:ss OR yyyy-MM-dd format"] />Parameters
inputListName (required)
- Name of the input list that contains the set of assets to be filtered. This list must contain two columns which are named 'assetid' and 'assettype'.
outputList (required)
- Name of the output list to be created. This list will contain the assets for which the input date falls between the start and end dates of the asset. This list will contain two columns 'assetid' and 'assettype' just like the input list.
date (optional)
- The input date value to be used as the filter criteria. This input value must be of the format yyyy-MM-dd HH:mm:ss OR yyyy-MM-dd. If the date parameter is not specified the current Server date will be used for the filtering criteria.
Description
This tag is used to filter a given set of assets by comparing the start/end date of the assets with the given input date.
If the asset has no start or end dates specified, it is considered to be a valid forever and will be part of the output list.
If the asset has no start date specified but only an end date, then the asset will be part of the output list ONLY if the end date of the asset occurs later than the given input date.
If the asset has no end date specified but only and start date, then the asset will be part of the output list ONLY if the start date of the asset occurs earlier than the given input date.
Important Note
The proper functioning of this tag depends on the value of a property 'cs.sitepreview' that is set in futuretense.ini. This property can have three possible values:
If the 'cs.sitepreview' property is set tocontentmanagement
,delivery
anddisabled
.contentmanagement
this tag 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 tag uses the current Server date. Also, the tag implementation disables caching of the the current page and all of its parent pages. The property must be set tocontentmanagement
when previewing templates with InSite. Please refer to the "Writing Templates for Site Preview" section in the Developer's Guide for more information regarding the usage of this tag and InSite.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 tag 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 tag.Example
<listobject:create name="inputListName" columns="assetid,assettype" /> <listobject:addrow name="inputListName"> <listobject:argument name="assetid" value='<%=ics.getvar("assetidvariable")%>' /> <listobject:argument name="assettype" value='<%=ics.getvar("assettypevariable")%>' /> </listobject:addrow> <listobject:tolist name="inputListName" listvarname="assetInputList" /> <asset:filterassetsbydate inputList="assetInputList" outputList="assetOutputList" date='<%=ics.getvar("datevaluevariable")%>' /> %=ics.getvar("datevaluevariable")%>%=ics.getvar("assettypevariable")%>%=ics.getvar("assetidvariable")%>
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.