Class AbstractTaggingProcessor
java.lang.Object
org.craftercms.core.processors.impl.AbstractTaggingProcessor
- All Implemented Interfaces:
ItemProcessor
- Direct Known Subclasses:
TaggingByFieldValueProcessor,TaggingByPathProcessor
Base
ItemProcessor to add a new field to documents.- Author:
- joseross
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddNewField(Item item, String values) Tags the item adding the new field with the specified values.protected abstract StringgetTagValues(Item item) If this method returns null or an empty string the item will not be tagged.process(Context context, CachingOptions cachingOptions, Item item) Processes anItem.voidsetDefaultValue(String defaultValue) voidsetNewField(String newField) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.craftercms.core.processors.ItemProcessor
isExclusive
-
Field Details
-
newField
Name of the new field to add. -
defaultValue
Optional default value for the new field.
-
-
Constructor Details
-
AbstractTaggingProcessor
public AbstractTaggingProcessor()
-
-
Method Details
-
setNewField
-
setDefaultValue
-
getTagValues
If this method returns null or an empty string the item will not be tagged.- Parameters:
item-- Returns:
- values to use for tagging the item
-
addNewField
Tags the item adding the new field with the specified values.- Parameters:
item-values-
-
process
public Item process(Context context, CachingOptions cachingOptions, Item item) throws ItemProcessingException Description copied from interface:ItemProcessorProcesses anItem.- Specified by:
processin interfaceItemProcessor- Parameters:
context- the current contextcachingOptions- caching options in case you need access to itemsitem- the item to process- Returns:
- the modified item or a new item.
- Throws:
ItemProcessingException- if an error occurred while processing the item
-