com.autotrader.rhythmyx
Class ATFolderPrecedenceFilter

java.lang.Object
  extended by com.percussion.services.filter.impl.PSBaseFilter
      extended by com.autotrader.rhythmyx.ATFolderPrecedenceFilter
All Implemented Interfaces:
com.percussion.extension.IPSExtension, com.percussion.services.filter.IPSItemFilterRule

public class ATFolderPrecedenceFilter
extends com.percussion.services.filter.impl.PSBaseFilter
implements com.percussion.services.filter.IPSItemFilterRule

Filters the incoming list of items such that items that are allowed to pass through meet the item filter rule's criteria as defined in the params.

Expected parameters:

sys_keyFields
This should be a comma separated list of field names which, when taken together, ensure item uniqueness. Items that have the same value of these key fields in an overriding folder will cause the original item to be excluded.
example: directory,filename
sys_precedenceFolderDepth
This should be the depth of the folder hierarchy on which the precedence folders will be checked. For example: If the base site folder is //Sites/ATC/ and the folders under this are our precedence-controlled folders [Prod, QA, Prod], then this parameter's value should be 3.
sys_folderPrecedence
This should be a list of folder names separated by semicolons in order of desired precedence. Items not in any of the listed folders will be excluded. Items that are in a low-precedence folder may be excluded if an item in a higher-precedence folder has matching key fields.
example: Dev;QA;Prod
In this example, items in the Dev folder override items in the QA and Prod folders and items in the QA folder override items in the Prod folder.

Rules for exclusion of items:

  1. Item must be located in one of the specified folders or be a descendant of one.
  2. Item may be overridden by objects that are in higher-precedence paths and have matching key fields.

Expected usage:

Givens: Solution:


Field Summary
 
Fields inherited from interface com.percussion.services.filter.IPSItemFilterRule
FOLDERPATHS, VALIDSTATES
 
Fields inherited from interface com.percussion.extension.IPSExtension
BINARY_ASSEMBLER, DATABASE_ASSEMBLER, DEBUG_ASSEMBLER, DISPATCH_ASSEMBLER, ERROR_INVALID_PARAMETER, KNOWN_ASSEMBLERS, LEGACY_ASSEMBLER, NOT_INITIALIZED, VELOCITY_ASSEMBLER
 
Constructor Summary
ATFolderPrecedenceFilter()
           
 
Method Summary
 java.util.List<com.percussion.services.filter.IPSFilterItem> filter(java.util.List<com.percussion.services.filter.IPSFilterItem> items, java.util.Map<java.lang.String,java.lang.String> params)
          Conforms to the Item Filter Rule contract: takes a set of references to content items and returns a new set of items that match the filter.
 
Methods inherited from class com.percussion.services.filter.impl.PSBaseFilter
getPriority, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.percussion.services.filter.IPSItemFilterRule
getPriority
 
Methods inherited from interface com.percussion.extension.IPSExtension
init
 

Constructor Detail

ATFolderPrecedenceFilter

public ATFolderPrecedenceFilter()
Method Detail

filter

public java.util.List<com.percussion.services.filter.IPSFilterItem> filter(java.util.List<com.percussion.services.filter.IPSFilterItem> items,
                                                                           java.util.Map<java.lang.String,java.lang.String> params)
                                                                    throws com.percussion.services.filter.PSFilterException
Conforms to the Item Filter Rule contract: takes a set of references to content items and returns a new set of items that match the filter.

Specified by:
filter in interface com.percussion.services.filter.IPSItemFilterRule
Specified by:
filter in class com.percussion.services.filter.impl.PSBaseFilter
Parameters:
items - a list of items to filter, never null
params - a map of parameter values, may be empty but never null
Returns:
a list of IPSFilterItem, never null but may be empty if no items match the filter.
Throws:
com.percussion.services.filter.PSFilterException - if there is an error while filtering the content.