public class IncludeDescriptorsProcessor extends Object implements ItemProcessor
ItemProcessor that finds special "include" tags found in a descriptor
document and inserts there the document tree of descriptors specified in these "include" tags.| Modifier and Type | Field and Description |
|---|---|
protected ContentStoreService |
contentStoreService
The content store service, used to retrieve the descriptors to include.
|
protected String |
disabledIncludeNodeXPathQuery
XPath query relative to include elements for nodes tha specify if the include is disabled or not.
|
protected ItemProcessor |
includedItemsProcessor
Processor to use for included items.
|
protected static ThreadLocal<Stack<String>> |
includedItemsStack |
protected String |
includeElementXPathQuery
XPath query for the include element.
|
protected boolean |
removeIncludeElement
Flag to indicate if the include element should be removed (false by default).
|
| Constructor and Description |
|---|
IncludeDescriptorsProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInclude(Item item,
org.dom4j.Element includeElement,
Item itemToInclude) |
boolean |
equals(Object o)
Returns true if the specified
IncludeDescriptorsProcessor's and this instance's fields are equal. |
protected Item |
getItemToInclude(Context context,
CachingOptions cachingOptions,
String includeSrcPath) |
int |
hashCode()
Returns the hash code for this instance, which is basically the combination of the hash code of each field.
|
protected void |
includeDescriptors(Context context,
CachingOptions cachingOptions,
Item item) |
protected boolean |
isIncludeDisabled(org.dom4j.Element includeElement) |
Item |
process(Context context,
CachingOptions cachingOptions,
Item item)
Replaces special include tags found in a descriptor document with the document tree of descriptors specified in
these include tags.
|
void |
setContentStoreService(ContentStoreService contentStoreService)
Sets the content store service, used to retrieve the descriptors to include.
|
void |
setDisabledIncludeNodeXPathQuery(String disabledIncludeNodeXPathQuery)
Sets the XPath query relative to include elements for nodes tha specify if the include is disabled or not.
|
void |
setIncludedItemsProcessor(ItemProcessor includedItemsProcessor)
Sets the processor to use for included items.
|
void |
setIncludeElementXPathQuery(String includeElementXPathQuery)
Sets the XPath query used to retrieve the include elements.
|
void |
setRemoveIncludeElement(boolean removeIncludeElement)
Sets the flag to indicate if the include element should be removed (false by default).
|
String |
toString() |
protected static final ThreadLocal<Stack<String>> includedItemsStack
protected String includeElementXPathQuery
protected boolean removeIncludeElement
protected String disabledIncludeNodeXPathQuery
protected ContentStoreService contentStoreService
protected ItemProcessor includedItemsProcessor
public void setIncludeElementXPathQuery(String includeElementXPathQuery)
public void setRemoveIncludeElement(boolean removeIncludeElement)
public void setDisabledIncludeNodeXPathQuery(String disabledIncludeNodeXPathQuery)
public void setContentStoreService(ContentStoreService contentStoreService)
public void setIncludedItemsProcessor(ItemProcessor includedItemsProcessor)
public Item process(Context context, CachingOptions cachingOptions, Item item) throws ItemProcessingException
process in interface ItemProcessorcontext - the current contextcachingOptions - caching options in case you need access to itemsitem - the item to processItemProcessingException - if there was an error while trying to perform an
includeprotected void includeDescriptors(Context context, CachingOptions cachingOptions, Item item) throws ItemProcessingException
ItemProcessingExceptionprotected boolean isIncludeDisabled(org.dom4j.Element includeElement)
protected Item getItemToInclude(Context context, CachingOptions cachingOptions, String includeSrcPath) throws ItemProcessingException
ItemProcessingExceptionprotected void doInclude(Item item, org.dom4j.Element includeElement, Item itemToInclude) throws ItemProcessingException
ItemProcessingExceptionpublic boolean equals(Object o)
IncludeDescriptorsProcessor's and this instance's fields are equal.public int hashCode()
ItemProcessor, this method is defined because any processor which is passed in the
method call of a ContentStoreService can be used as part of a
key for caching.Copyright © 2018 CrafterCMS. All rights reserved.