java.lang.Object
de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController
Direct Known Subclasses:
AbstractCartPageController, AbstractCheckoutController, AbstractRegisterPageController, AbstractSearchPageController, ProductPageController, TmaEntryGroupEditPageController, TmaProcessTypeSelectionController

public abstract class AbstractPageController extends AbstractController
Base controller for all page controllers. Provides common functionality for all page controllers.
  • Field Details

  • Constructor Details

    • AbstractPageController

      public AbstractPageController()
  • Method Details

    • getSiteConfigService

      protected de.hybris.platform.acceleratorservices.config.SiteConfigService getSiteConfigService()
    • getCmsSiteService

      protected de.hybris.platform.cms2.servicelayer.services.CMSSiteService getCmsSiteService()
    • getCmsPageService

      protected de.hybris.platform.cms2.servicelayer.services.CMSPageService getCmsPageService()
    • getStoreSessionFacade

      protected de.hybris.platform.commercefacades.storesession.StoreSessionFacade getStoreSessionFacade()
    • getCustomerFacade

      protected de.hybris.platform.commercefacades.customer.CustomerFacade getCustomerFacade()
    • getSessionService

      protected de.hybris.platform.servicelayer.session.SessionService getSessionService()
    • getHostConfigService

      protected de.hybris.platform.acceleratorservices.config.HostConfigService getHostConfigService()
    • getMessageSource

      protected org.springframework.context.MessageSource getMessageSource()
    • getI18nService

      protected de.hybris.platform.servicelayer.i18n.I18NService getI18nService()
    • getUserFacade

      protected de.hybris.platform.commercefacades.user.UserFacade getUserFacade()
    • getConfigurationService

      protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()
    • getBaseSiteService

      protected de.hybris.platform.site.BaseSiteService getBaseSiteService()
    • getConsentFacade

      protected de.hybris.platform.commercefacades.consent.ConsentFacade getConsentFacade()
    • getCmsPreviewService

      protected de.hybris.platform.cms2.servicelayer.services.CMSPreviewService getCmsPreviewService()
    • getLanguages

      @ModelAttribute("languages") public Collection<LanguageData> getLanguages()
    • getCurrencies

      @ModelAttribute("currencies") public Collection<CurrencyData> getCurrencies()
    • getCurrentLanguage

      @ModelAttribute("currentLanguage") public LanguageData getCurrentLanguage()
    • getCurrentCurrency

      @ModelAttribute("currentCurrency") public CurrencyData getCurrentCurrency()
    • getSiteName

      @ModelAttribute("siteName") public String getSiteName()
    • getSiteUid

      @ModelAttribute("siteUid") public String getSiteUid()
    • getUser

      @ModelAttribute("user") public CustomerData getUser()
    • storeCmsPageInModel

      protected void storeCmsPageInModel(org.springframework.ui.Model model, AbstractPageModel cmsPage)
    • storeContentPageTitleInModel

      protected void storeContentPageTitleInModel(org.springframework.ui.Model model, String title)
    • getViewForPage

      protected String getViewForPage(org.springframework.ui.Model model)
    • getViewForPage

      protected String getViewForPage(AbstractPageModel page)
    • checkRequestUrl

      protected String checkRequestUrl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String resolvedUrlPath) throws UnsupportedEncodingException
      Checks request URL against properly resolved URL and returns null if url is proper or redirection string if not.
      Parameters:
      request - - request that contains current URL
      response - - response to write "301 Moved Permanently" status to if redirected
      resolvedUrlPath - - properly resolved URL
      Returns:
      null if url is properly resolved or redirection string if not
      Throws:
      UnsupportedEncodingException
    • getContentPageForLabelOrId

      protected ContentPageModel getContentPageForLabelOrId(String labelOrId) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Finds a content page by label or id and evaluates the cms restrictions associated to the page and components on the page.
      Parameters:
      labelOrId - the label or id used for the look-up
      Returns:
      a content page
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException - when no page is found for the provided label or id
    • getPageTitleResolver

      protected de.hybris.platform.acceleratorservices.storefront.util.PageTitleResolver getPageTitleResolver()
    • storeContinueUrl

      protected void storeContinueUrl(javax.servlet.http.HttpServletRequest request)
    • setUpMetaData

      protected void setUpMetaData(org.springframework.ui.Model model, String metaKeywords, String metaDescription)
    • createMetaElement

      protected MetaElementData createMetaElement(String name, String content)
    • setUpMetaDataForContentPage

      protected void setUpMetaDataForContentPage(org.springframework.ui.Model model, ContentPageModel contentPage)
    • getRequestContextData

      protected RequestContextData getRequestContextData(javax.servlet.http.HttpServletRequest request)
    • urlEncode

      protected String urlEncode(String url)
      Url encode.
      Parameters:
      url - the url
      Returns:
      the encoded string
      Throws:
      IllegalArgumentException - if url is null
    • prepareNotFoundPage

      protected void prepareNotFoundPage(org.springframework.ui.Model model, javax.servlet.http.HttpServletResponse response) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Prepares Not Found (404) Page
      Parameters:
      model - The model to pass with the page
      response - object represents http response needed for setting not found status.
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException - when cannot find ContentPage with "notFound" id
    • getCheckoutRedirectUrl

      protected String getCheckoutRedirectUrl()
      Method used to determine the checkout redirect URL that will handle the checkout process.
      Returns:
      A String object of the URL to redirect to.
    • addRegistrationConsentDataToModel

      protected void addRegistrationConsentDataToModel(org.springframework.ui.Model model)
    • decodeWithScheme

      protected String decodeWithScheme(String source, String enc)
      Decodes a string with encoding using a specific encoding scheme.
      Parameters:
      source - A string to decode
      enc - The name of a supported character encoding. Default value is UTF-8 if no value is provided.
      Returns:
      A decoded string