com.autotrader.rhythmyx
Class ATFolderPrecedenceFilter
java.lang.Object
com.percussion.services.filter.impl.PSBaseFilter
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:
- Item must be located in one of the specified folders or be a descendant of one.
- Item may be overridden by objects that are in higher-precedence paths and have matching key fields.
Expected usage:
Givens:
- Content Explorer paths //.../A/, //.../B/ and //.../C/, and
- Publishing target paths /publish/a/, /publish/b/ and /publish/c/,
- We want public items in A to publish to a, b and c. in B to b and c. and in C to c.
- Items in A should not publish to b if an item in B overrides it, or to c if an item in B or C overrides it.
- Items in B should not publish to c if an item in C overrides it.
Solution:
- Create 3 Item Filters.
- Precedence for content lists for the context that publishes content to a is "//.../A/"
- Precedence for content lists for the context that publishes content to b is "//.../B/;//.../A/"
- Precedence for content lists for the context that publishes content to c is "//.../C/;//.../B/;//.../A/"
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 |
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 |
ATFolderPrecedenceFilter
public ATFolderPrecedenceFilter()
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 nullparams
- 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.