org.broadleafcommerce.cms.web.processor
Class ContentProcessor

java.lang.Object
  extended by org.thymeleaf.processor.AbstractProcessor
      extended by org.thymeleaf.processor.element.AbstractElementProcessor
          extended by org.broadleafcommerce.common.web.dialect.AbstractModelVariableModifierProcessor
              extended by org.broadleafcommerce.cms.web.processor.ContentProcessor
All Implemented Interfaces:
Comparable<org.thymeleaf.processor.IProcessor>, org.thymeleaf.processor.IProcessor

public class ContentProcessor
extends AbstractModelVariableModifierProcessor

Processor used to display structured content that is maintained with the Broadleaf CMS. Usage based on the following attributes:


Field Summary
static String BLC_RULE_MAP_PARAM
           
protected  ContentDeepLinkServiceImpl contentDeepLinkService
           
protected  ContentProcessorExtensionManager extensionManager
           
protected  org.apache.commons.logging.Log LOG
           
static String REQUEST_DTO
           
protected  StaticAssetService staticAssetService
           
protected  StructuredContentService structuredContentService
           
 
Constructor Summary
ContentProcessor()
          Sets the name of this processor to be used in Thymeleaf template
ContentProcessor(String elementName)
           
 
Method Summary
protected  Map<String,Object> buildMvelParameters(javax.servlet.http.HttpServletRequest request, org.thymeleaf.Arguments arguments, org.thymeleaf.dom.Element element)
          MVEL is used to process the content targeting rules.
protected  String getAttributeValue(org.thymeleaf.dom.Element element, String valueName, String defaultValue)
          Returns a default name
protected  List<StructuredContentDTO> getContentItems(String contentName, Integer maxResults, javax.servlet.http.HttpServletRequest request, Map<String,Object> mvelParameters, SandBox currentSandbox, StructuredContentType structuredContentType, Locale locale, org.thymeleaf.Arguments arguments, org.thymeleaf.dom.Element element)
           
 int getPrecedence()
           
 boolean isSecure(javax.servlet.http.HttpServletRequest request)
           
protected  void modifyModelAttributes(org.thymeleaf.Arguments arguments, org.thymeleaf.dom.Element element)
           
 
Methods inherited from class org.broadleafcommerce.common.web.dialect.AbstractModelVariableModifierProcessor
addToModel, processElement
 
Methods inherited from class org.thymeleaf.processor.element.AbstractElementProcessor
doProcess, getMatcher
 
Methods inherited from class org.thymeleaf.processor.AbstractProcessor
compareTo, getMessage, getMessageForProcessor, getMessageForTemplate, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected final org.apache.commons.logging.Log LOG

REQUEST_DTO

public static final String REQUEST_DTO
See Also:
Constant Field Values

BLC_RULE_MAP_PARAM

public static final String BLC_RULE_MAP_PARAM
See Also:
Constant Field Values

structuredContentService

protected StructuredContentService structuredContentService

staticAssetService

protected StaticAssetService staticAssetService

extensionManager

protected ContentProcessorExtensionManager extensionManager

contentDeepLinkService

protected ContentDeepLinkServiceImpl contentDeepLinkService
Constructor Detail

ContentProcessor

public ContentProcessor()
Sets the name of this processor to be used in Thymeleaf template


ContentProcessor

public ContentProcessor(String elementName)
Method Detail

getPrecedence

public int getPrecedence()
Specified by:
getPrecedence in class org.thymeleaf.processor.AbstractProcessor

getAttributeValue

protected String getAttributeValue(org.thymeleaf.dom.Element element,
                                   String valueName,
                                   String defaultValue)
Returns a default name

Parameters:
element -
valueName -
Returns:

modifyModelAttributes

protected void modifyModelAttributes(org.thymeleaf.Arguments arguments,
                                     org.thymeleaf.dom.Element element)
Specified by:
modifyModelAttributes in class AbstractModelVariableModifierProcessor

getContentItems

protected List<StructuredContentDTO> getContentItems(String contentName,
                                                     Integer maxResults,
                                                     javax.servlet.http.HttpServletRequest request,
                                                     Map<String,Object> mvelParameters,
                                                     SandBox currentSandbox,
                                                     StructuredContentType structuredContentType,
                                                     Locale locale,
                                                     org.thymeleaf.Arguments arguments,
                                                     org.thymeleaf.dom.Element element)
Parameters:
contentName - name of the content to be looked up (can be null)
maxResults - maximum results to return
request - servlet request
mvelParameters - values that should be considered when filtering the content list by rules
structuredContentType - the type of content that should be returned
locale - current locale
arguments - Thymeleaf Arguments passed into the tag
element - element context that this Thymeleaf processor is being executed in
Returns:

buildMvelParameters

protected Map<String,Object> buildMvelParameters(javax.servlet.http.HttpServletRequest request,
                                                 org.thymeleaf.Arguments arguments,
                                                 org.thymeleaf.dom.Element element)
MVEL is used to process the content targeting rules.

Parameters:
request -
Returns:

isSecure

public boolean isSecure(javax.servlet.http.HttpServletRequest request)


Copyright © 2013. All Rights Reserved.