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 Details

    • ACTIONS

      protected static final String[] 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:
      beforeView in interface BeforeViewHandlerAdaptee
      Throws:
      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 - the Session of 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 - the Session to add the tenant to.
    • storeCurrentlyViewedProductCode

      protected void storeCurrentlyViewedProductCode(org.springframework.ui.ModelMap model)
      Retrieves the currently viewed product code from the ModelMap if present and stores in the context repository for rendering to page.
      Parameters:
      model - the ModelMap representing 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(List<Breadcrumb> breadcrumbs)
      Parameters:
      breadcrumbs - - list of Breadcrumb
      Returns:
      current breadcrumb trail.
    • storeFacets

      protected void storeFacets(Session currentSession, org.springframework.ui.ModelMap model)
    • getFacetBreadcrumbs

      protected <STATE> Map<String,Facet> getFacetBreadcrumbs(List<BreadcrumbData<STATE>> breadcrumbs)
      getFacetBreadcrumbs is a method for retrieving breadcrumb values for facets.
      Parameters:
      breadcrumbs - the list of BreadcrumbData to 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

      protected RequestContextData getRequestContextData(javax.servlet.http.HttpServletRequest request)
    • 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 request
      beanName - the name of the bean to lookup
      beanType - 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)