Class HybrisMerchandisingBeforeViewHandlerAdaptee
java.lang.Object
com.hybris.merchandising.interceptors.HybrisMerchandisingBeforeViewHandlerAdaptee
- All Implemented Interfaces:
BeforeViewHandlerAdaptee
public class HybrisMerchandisingBeforeViewHandlerAdaptee
extends Object
implements BeforeViewHandlerAdaptee
Implements
BeforeViewHandlerAdaptee and intercepts the view request.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeforeView(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.ui.ModelMap model, String viewName) protected <T> THelper method to lookup a spring bean in the context of a request.protected BreadcrumbsgetBreadcrumbs(List<Breadcrumb> breadcrumbs) getFacetBreadcrumbs(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 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 voidRetrieves 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.
-
Field Details
-
ACTIONS
-
-
Constructor Details
-
HybrisMerchandisingBeforeViewHandlerAdaptee
public HybrisMerchandisingBeforeViewHandlerAdaptee()
-
-
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
-
storeBaseSite
protected void storeBaseSite()Retrieves the current base site in use and outputs it as add on variables. -
storeLanguage
Retrieves the current language from the session and outputs it as an add on variable.- Parameters:
currentSession- theSessionof the current user.
-
storeTenant
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
- Parameters:
requestContextData-currentSession-model-
-
getBreadcrumbs
- Parameters:
breadcrumbs- - list ofBreadcrumb- Returns:
- current breadcrumb trail.
-
storeFacets
-
getFacetBreadcrumbs
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 List<JavaScriptVariableData> retrieveHybrisConvertJSAddOnVariables(org.springframework.ui.ModelMap model) Retrieves the HybrisConvert AddOn JS variables from the model.- Parameters:
model-- Returns:
-
getRequestContextData
-
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
-
setSessionService
-
setContextService
-
setConsumedDestinationLocatorStrategy
public void setConsumedDestinationLocatorStrategy(ConsumedDestinationLocatorStrategy consumedDestinationLocatorStrategy) -
setBaseSiteService
-