Class AbstractConditionalResourceBeforeHandler
java.lang.Object
de.hybris.platform.addonsupport.interceptors.AbstractConditionalResourceBeforeHandler
- All Implemented Interfaces:
BeforeViewHandlerAdaptee
public abstract class AbstractConditionalResourceBeforeHandler
extends Object
implements BeforeViewHandlerAdaptee
Allows an AddOn to Include Java Script and CSS conditionally.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddOrAppendListAttribute(org.springframework.ui.ModelMap model, String key, List newVals) protected voidaddResourcePaths(String contextPath, List<String> addOnResourcePaths, String addon, String propertyName) beforeView(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.ModelMap model, String viewName) protected ListgetAddOnCommonCSSPaths(String contextPath, String uiExperience, List<String> addOnNames) protected Listprotected ListgetAddOnResourcePaths(String contextPath, List<String> addOnNames, String[] propertyNames) protected ListgetAddOnThemeCSSPaths(String contextPath, String themeName, String uiExperience, List<String> addOnNames) protected <T> THelper method to lookup a spring bean in the context of a request.protected Stringprotected Stringprotected Stringabstract Stringprotected RequestContextDatagetRequestContextData(javax.servlet.http.HttpServletRequest request) protected Stringprotected Stringprotected abstract booleanisIncludeResource(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.ModelMap model, String viewName) voidsetDefaultThemeName(String defaultThemeName)
-
Field Details
-
COMMON
- See Also:
-
SHARED
- See Also:
-
RESOURCE_TYPE_JAVASCRIPT
- See Also:
-
RESOURCE_TYPE_CSS
- See Also:
-
-
Constructor Details
-
AbstractConditionalResourceBeforeHandler
public AbstractConditionalResourceBeforeHandler()
-
-
Method Details
-
beforeView
public String beforeView(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.ModelMap model, String viewName) throws Exception - Specified by:
beforeViewin interfaceBeforeViewHandlerAdaptee- Throws:
Exception
-
addOrAppendListAttribute
-
getCommonCssPathKey
-
getThemeCssPathKey
-
getJavaScriptPathsKey
-
isIncludeResource
protected abstract boolean isIncludeResource(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.ModelMap model, String viewName) -
getAddOnResourcePaths
-
addResourcePaths
-
getAddOnCommonCSSPaths
-
getAddOnThemeCSSPaths
-
getAddOnJSPaths
-
getThemeNameForSite
-
getBean
protected <T> T getBean(javax.servlet.http.HttpServletRequest request, String beanName, Class<T> beanType) Helper method to lookup a spring bean in the context of a request. This should only be used to lookup beans that are request scoped. The looked up bean is cached in the request attributes so it should not have a narrower scope than request scope. This method should not be used for beans that could be injected into this bean.- Type Parameters:
T- the expected type of the bean- Parameters:
request- the current requestbeanName- the name of the bean to lookupbeanType- the expected type of the bean- Returns:
- the bean found or null
-
getRequestContextData
-
getDefaultThemeName
-
setDefaultThemeName
-
getPathPropertyPrefix
-