public class QueryBasedContentExtractor extends Object implements ContentExtractor<Map,Object>
ContentExtractor
to extract Content using any custom definition Query with input as paramsContentExtractor
we need a reliable key for the toString() on the location parameter.
In such cases one may provide a default "toString" key/value to identify this for the Cache. "toString" is removed before sending it to the underlying query Transformer
.
ResourceContentExtractor
.
ContentFacet
. The expected return type would be a List of Content.CONTENT_PUBLISH_CACHE_NAME, PRODUCT_LOOKUP_CACHE_NAME, PRODUCT_SEARCH_CACHE_NAME, TEMPLATEPAGE_MAPPING_CACHE_NAME
Constructor and Description |
---|
QueryBasedContentExtractor() |
Modifier and Type | Method and Description |
---|---|
Object |
getContent(Map location,
ContentContext context)
Get Content.
|
org.apache.commons.collections.Transformer |
getContentTransformer()
Apply this
Transformer over the extracted content, before passing it back |
org.apache.commons.collections.Transformer |
getQueryTransformer() |
void |
setContentTransformer(org.apache.commons.collections.Transformer contentTransformer)
Apply this
Transformer over the extracted content, before passing it back |
void |
setQueryTransformer(org.apache.commons.collections.Transformer queryTransformer) |
protected Object |
transformContent(Object rawContent)
Using
contentTransformer Transform the Content values, be it in a Map, List or raw String type format |
@Cacheable(key="#location.toString()", condition="(#location!=null and #context!=null and T(com.neurosys.content.domain.Status).PUBLISH == #context.status)", value="publishContent") public Object getContent(Map location, ContentContext context)
ContentExtractor
ExecutionPreventedException
if for some environmental reason
publishing was explicitly prevented.getContent
in interface ContentExtractor<Map,Object>
Cacheable}(key="#location.toString()",
condition="(#location!=null and #context!=null and T(com.neurosys.content.domain.Status).PUBLISH == #context.status)",
value="publishContent")
public org.apache.commons.collections.Transformer getQueryTransformer()
public void setQueryTransformer(org.apache.commons.collections.Transformer queryTransformer)
protected Object transformContent(Object rawContent)
contentTransformer
Transform the Content values, be it in a Map, List or raw String type formatpublic org.apache.commons.collections.Transformer getContentTransformer()
Transformer
over the extracted content, before passing it backpublic void setContentTransformer(org.apache.commons.collections.Transformer contentTransformer)
Transformer
over the extracted content, before passing it backCopyright © 2018. All rights reserved.