com.fatwire.gst.foundation.facade.runtag.asset
Class FilterAssetsByDate

java.lang.Object
  extended by com.fatwire.gst.foundation.facade.runtag.asset.FilterAssetsByDate

public final class FilterAssetsByDate
extends Object

Filters assets via startdate/enddate.

NOTE: This class calls a public yet internal function inside the JSP tag. No guarantees can therefore exist as to its compatibility across patch versions. The core function, however, is exceptionally slow to begin with, so caution should be exercised when using this function.

Since:
Jun 23, 2010
Author:
Tony Field, Dolf Dijkstra

Constructor Summary
FilterAssetsByDate()
           
 
Method Summary
static com.fatwire.assetapi.data.AssetId[] filter(COM.FutureTense.Interfaces.ICS ics, Date date, com.fatwire.assetapi.data.AssetId... id)
          Filter a array of asset, checking to see if they're valid on the given date.
static Collection<com.fatwire.assetapi.data.AssetId> filter(COM.FutureTense.Interfaces.ICS ics, Date date, Collection<com.fatwire.assetapi.data.AssetId> list)
          Filter a collection of assets, checking to see if they're valid on the given date.
static boolean isDateWithinRange(Date startDate, Date effectiveDate, Date endDate)
          Method to check to see if a date falls between two dates.
static boolean isDateWithinRange(String startDateJdbc, Date effectiveDate, String endDateJdbc)
          Method to check to see if a date falls between two dates.
static boolean isValidOnDate(COM.FutureTense.Interfaces.ICS ics, com.fatwire.assetapi.data.AssetId id, Date date)
          Filter a single asset, checking to see if it's valid on the given date.
static Date parseJdbcDate(String string)
          Given an input string in JDBC form, parse it and return a date object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterAssetsByDate

public FilterAssetsByDate()
Method Detail

isValidOnDate

public static boolean isValidOnDate(COM.FutureTense.Interfaces.ICS ics,
                                    com.fatwire.assetapi.data.AssetId id,
                                    Date date)
Filter a single asset, checking to see if it's valid on the given date. If no date is specified, then the date used is the one used by the FilterAssetsByDate tag when no parameter is specified

Parameters:
ics - context
id - input asset
date - override date
Returns:
true if the asset is valid, false otherwise.

filter

public static com.fatwire.assetapi.data.AssetId[] filter(COM.FutureTense.Interfaces.ICS ics,
                                                         Date date,
                                                         com.fatwire.assetapi.data.AssetId... id)
Filter a array of asset, checking to see if they're valid on the given date. If no date is specified, then the date used is the one used by the FilterAssetsByDate tag when no parameter is specified

Parameters:
ics - context
date - override date
id - array of assetids
Returns:
the array of asset filtered for the date.

filter

public static Collection<com.fatwire.assetapi.data.AssetId> filter(COM.FutureTense.Interfaces.ICS ics,
                                                                   Date date,
                                                                   Collection<com.fatwire.assetapi.data.AssetId> list)
Filter a collection of assets, checking to see if they're valid on the given date. If no date is specified, then the date used is the one used by the FilterAssetsByDate tag when no parameter is specified

Parameters:
ics - ics context
date - override date
list - Collection of assetids.
Returns:
the Collection of asset filtered for the date.

isDateWithinRange

public static boolean isDateWithinRange(String startDateJdbc,
                                        Date effectiveDate,
                                        String endDateJdbc)
Method to check to see if a date falls between two dates. The comparison date is a Date object, or null, in which case the current date is used. The boundary dates are JDBC format dates, and can be null, indication the dates aren't boudned.

Parameters:
startDateJdbc - start date in jdbc format or null
effectiveDate - comparison date or null to use current date
endDateJdbc - end date in jdbc format
Returns:
true if the date is in the valid range; false otherwise.

isDateWithinRange

public static boolean isDateWithinRange(Date startDate,
                                        Date effectiveDate,
                                        Date endDate)
Method to check to see if a date falls between two dates. The comparison date is a Date object, or null, in which case the current date is used. The boundary dates can be null, indication the dates aren't bounded.

Parameters:
startDate - start date or null
effectiveDate - comparison date or null to use current date
endDate - end date or null
Returns:
true if the date is in the valid range; false otherwise.

parseJdbcDate

public static Date parseJdbcDate(String string)
Given an input string in JDBC form, parse it and return a date object.

Parameters:
string - jdbc date string in the form yyyy-MM-dd HH:mm:ss
Returns:
Date
Throws:
IllegalArgumentException - on failure


Copyright © 2010-2013 Oracle Corporation. All Rights Reserved.