Class HybrisMerchandisingBeforeViewHandlerAdaptee
- java.lang.Object
-
- com.hybris.merchandising.interceptors.HybrisMerchandisingBeforeViewHandlerAdaptee
-
- All Implemented Interfaces:
BeforeViewHandlerAdaptee
public class HybrisMerchandisingBeforeViewHandlerAdaptee extends java.lang.Object implements BeforeViewHandlerAdaptee
ImplementsBeforeViewHandlerAdapteeand intercepts the view request.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String[]ACTIONS
-
Constructor Summary
Constructors Constructor Description HybrisMerchandisingBeforeViewHandlerAdaptee()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringbeforeView(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.ModelMap model, java.lang.String viewName)protected <T> TgetBean(javax.servlet.http.HttpServletRequest request, java.lang.String beanName, java.lang.Class<T> beanType)Helper method to lookup a spring bean in the context of a request.protected BreadcrumbsgetBreadcrumbs(java.util.List<Breadcrumb> breadcrumbs)protected <STATE> java.util.Map<java.lang.String,Facet>getFacetBreadcrumbs(java.util.List<BreadcrumbData<STATE>> breadcrumbs)getFacetBreadcrumbs is a method for retrieving breadcrumb values for facets.protected RequestContextDatagetRequestContextData(javax.servlet.http.HttpServletRequest request)protected voidpopulateJSAddOnVariables(org.springframework.ui.ModelMap model)protected java.util.List<JavaScriptVariableData>retrieveHybrisConvertJSAddOnVariables(org.springframework.ui.ModelMap model)Retrieves the HybrisConvert AddOn JS variables from the model.voidsetBaseSiteService(BaseSiteService baseSiteService)voidsetConsumedDestinationLocatorStrategy(ConsumedDestinationLocatorStrategy consumedDestinationLocatorStrategy)voidsetContextService(ContextService contextService)voidsetSessionService(SessionService sessionService)protected voidstoreBaseSite()Retrieves the current base site in use and outputs it as add on variables.protected voidstoreBreadcrumbs(Session currentSession, org.springframework.ui.ModelMap model)protected voidstoreCategory(RequestContextData requestContextData, Session currentSession, org.springframework.ui.ModelMap model)protected voidstoreCurrentlyViewedProductCode(org.springframework.ui.ModelMap model)Retrieves the currently viewed product code from theModelMapif present and stores in the context repository for rendering to page.protected voidstoreFacets(Session currentSession, org.springframework.ui.ModelMap model)protected voidstoreLanguage(Session currentSession)Retrieves the current language from the session and outputs it as an add on variable.protected voidstoreTenant(Session currentSession)Store tenant retrieves the configured YaaS tenant for us to use with Merchandising and stores it in the local session.
-
-
-
Method Detail
-
beforeView
public java.lang.String beforeView(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.ModelMap model, java.lang.String viewName) throws java.lang.Exception- Specified by:
beforeViewin interfaceBeforeViewHandlerAdaptee- Throws:
java.lang.Exception
-
storeBaseSite
protected void storeBaseSite()
Retrieves the current base site in use and outputs it as add on variables.
-
storeLanguage
protected void storeLanguage(Session currentSession)
Retrieves the current language from the session and outputs it as an add on variable.- Parameters:
currentSession- theSessionof the current user.
-
storeTenant
protected void storeTenant(Session currentSession)
Store tenant retrieves the configured YaaS tenant for us to use with Merchandising and stores it in the local session.- Parameters:
currentSession- theSessionto add the tenant to.
-
storeCurrentlyViewedProductCode
protected void storeCurrentlyViewedProductCode(org.springframework.ui.ModelMap model)
Retrieves the currently viewed product code from theModelMapif present and stores in the context repository for rendering to page.- Parameters:
model- theModelMaprepresenting the current view.
-
storeCategory
protected void storeCategory(RequestContextData requestContextData, Session currentSession, org.springframework.ui.ModelMap model)
-
storeBreadcrumbs
protected void storeBreadcrumbs(Session currentSession, org.springframework.ui.ModelMap model)
- Parameters:
requestContextData-currentSession-model-
-
getBreadcrumbs
protected Breadcrumbs getBreadcrumbs(java.util.List<Breadcrumb> breadcrumbs)
- Parameters:
breadcrumbs- - list ofBreadcrumb- Returns:
- current breadcrumb trail.
-
storeFacets
protected void storeFacets(Session currentSession, org.springframework.ui.ModelMap model)
-
getFacetBreadcrumbs
protected <STATE> java.util.Map<java.lang.String,Facet> getFacetBreadcrumbs(java.util.List<BreadcrumbData<STATE>> breadcrumbs)
getFacetBreadcrumbs is a method for retrieving breadcrumb values for facets.- Parameters:
breadcrumbs- the list ofBreadcrumbDatato use.- Returns:
- a Map containing this.
-
populateJSAddOnVariables
protected void populateJSAddOnVariables(org.springframework.ui.ModelMap model)
-
retrieveHybrisConvertJSAddOnVariables
protected java.util.List<JavaScriptVariableData> retrieveHybrisConvertJSAddOnVariables(org.springframework.ui.ModelMap model)
Retrieves the HybrisConvert AddOn JS variables from the model.- Parameters:
model-- Returns:
-
getRequestContextData
protected RequestContextData getRequestContextData(javax.servlet.http.HttpServletRequest request)
-
getBean
protected <T> T getBean(javax.servlet.http.HttpServletRequest request, java.lang.String beanName, java.lang.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
-
setSessionService
public void setSessionService(SessionService sessionService)
-
setContextService
public void setContextService(ContextService contextService)
-
setConsumedDestinationLocatorStrategy
public void setConsumedDestinationLocatorStrategy(ConsumedDestinationLocatorStrategy consumedDestinationLocatorStrategy)
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
-
-