Class AbstractPageController
- java.lang.Object
-
- de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
-
- de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController
-
- Direct Known Subclasses:
AbstractCartPageController,AbstractCheckoutController,AbstractProductConfigController,AbstractRegisterPageController,AbstractSearchPageController,AccountSupportTicketsPageController,AnonymousConsentController,ChineseBusinessUnitManagementPageController,ChineseMobileBindingController,ConfigureController,CustomerReviewController,DefaultPageController,DefaultPunchOutController,EmailPageController,GigyaAccountPageController,GuestOrderController,HomePageController,ImportCSVPageController,MyCartPageController,NotificationPreferencePageController,PasswordResetPageController,PreviewContentPageController,ProductPageController,ProductQrPageController,ProductTextfieldConfiguratorController,QuickOrderPageController,StockNotificationPageController,StorePageController,VerificationCodeController,WeChatPayController
public abstract class AbstractPageController extends AbstractController
Base controller for all page controllers. Provides common functionality for all page controllers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
AbstractController.HttpNotFoundException
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCMS_PAGE_MODELstatic java.lang.StringCMS_PAGE_TITLEstatic java.lang.StringPAGE_ROOTstatic java.lang.StringREDIRECT_TO_LOGIN_FOR_CHECKOUTstatic java.lang.StringREDIRECT_TO_MULTISTEP_CHECKOUTstatic java.lang.StringREGISTRATION_CONSENT_IDstatic java.lang.StringUTF_8-
Fields inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
FORWARD_PREFIX, REDIRECT_PREFIX, ROOT
-
-
Constructor Summary
Constructors Constructor Description AbstractPageController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddRegistrationConsentDataToModel(org.springframework.ui.Model model)protected java.lang.StringcheckRequestUrl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String resolvedUrlPath)Checks request URL against properly resolved URL and returns null if url is proper or redirection string if not.protected MetaElementDatacreateMetaElement(java.lang.String name, java.lang.String content)protected java.lang.StringdecodeWithScheme(java.lang.String source, java.lang.String enc)Decodes a string with encoding using a specific encoding scheme.protected BaseSiteServicegetBaseSiteService()protected java.lang.StringgetCheckoutRedirectUrl()Method used to determine the checkout redirect URL that will handle the checkout process.protected CMSPageServicegetCmsPageService()protected CMSPreviewServicegetCmsPreviewService()protected CMSSiteServicegetCmsSiteService()protected ConfigurationServicegetConfigurationService()protected ConsentFacadegetConsentFacade()protected ContentPageModelgetContentPageForLabelOrId(java.lang.String labelOrId)Finds a content page by label or id and evaluates the cms restrictions associated to the page and components on the page.java.util.Collection<CurrencyData>getCurrencies()CurrencyDatagetCurrentCurrency()LanguageDatagetCurrentLanguage()protected CustomerFacadegetCustomerFacade()protected HostConfigServicegetHostConfigService()protected I18NServicegetI18nService()java.util.Collection<LanguageData>getLanguages()protected org.springframework.context.MessageSourcegetMessageSource()protected PageTitleResolvergetPageTitleResolver()protected RequestContextDatagetRequestContextData(javax.servlet.http.HttpServletRequest request)protected SessionServicegetSessionService()protected SiteConfigServicegetSiteConfigService()java.lang.StringgetSiteName()java.lang.StringgetSiteUid()protected StoreSessionFacadegetStoreSessionFacade()CustomerDatagetUser()protected UserFacadegetUserFacade()protected java.lang.StringgetViewForPage(AbstractPageModel page)protected java.lang.StringgetViewForPage(org.springframework.ui.Model model)protected voidprepareNotFoundPage(org.springframework.ui.Model model, javax.servlet.http.HttpServletResponse response)Prepares Not Found (404) Pageprotected voidsetUpMetaData(org.springframework.ui.Model model, java.lang.String metaKeywords, java.lang.String metaDescription)protected voidsetUpMetaDataForContentPage(org.springframework.ui.Model model, ContentPageModel contentPage)protected voidstoreCmsPageInModel(org.springframework.ui.Model model, AbstractPageModel cmsPage)protected voidstoreContentPageTitleInModel(org.springframework.ui.Model model, java.lang.String title)protected voidstoreContinueUrl(javax.servlet.http.HttpServletRequest request)protected java.lang.StringurlEncode(java.lang.String url)Url encode.-
Methods inherited from class de.hybris.platform.acceleratorstorefrontcommons.controllers.AbstractController
addRequestToModel, getBean
-
-
-
-
Field Detail
-
PAGE_ROOT
public static final java.lang.String PAGE_ROOT
- See Also:
- Constant Field Values
-
CMS_PAGE_MODEL
public static final java.lang.String CMS_PAGE_MODEL
- See Also:
- Constant Field Values
-
CMS_PAGE_TITLE
public static final java.lang.String CMS_PAGE_TITLE
- See Also:
- Constant Field Values
-
REDIRECT_TO_LOGIN_FOR_CHECKOUT
public static final java.lang.String REDIRECT_TO_LOGIN_FOR_CHECKOUT
- See Also:
- Constant Field Values
-
REDIRECT_TO_MULTISTEP_CHECKOUT
public static final java.lang.String REDIRECT_TO_MULTISTEP_CHECKOUT
- See Also:
- Constant Field Values
-
REGISTRATION_CONSENT_ID
public static final java.lang.String REGISTRATION_CONSENT_ID
- See Also:
- Constant Field Values
-
UTF_8
public static final java.lang.String UTF_8
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSiteConfigService
protected SiteConfigService getSiteConfigService()
-
getCmsSiteService
protected CMSSiteService getCmsSiteService()
-
getCmsPageService
protected CMSPageService getCmsPageService()
-
getStoreSessionFacade
protected StoreSessionFacade getStoreSessionFacade()
-
getCustomerFacade
protected CustomerFacade getCustomerFacade()
-
getSessionService
protected SessionService getSessionService()
-
getHostConfigService
protected HostConfigService getHostConfigService()
-
getMessageSource
protected org.springframework.context.MessageSource getMessageSource()
-
getI18nService
protected I18NService getI18nService()
-
getUserFacade
protected UserFacade getUserFacade()
-
getConfigurationService
protected ConfigurationService getConfigurationService()
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
-
getConsentFacade
protected ConsentFacade getConsentFacade()
-
getCmsPreviewService
protected CMSPreviewService getCmsPreviewService()
-
getLanguages
@ModelAttribute("languages") public java.util.Collection<LanguageData> getLanguages()
-
getCurrencies
@ModelAttribute("currencies") public java.util.Collection<CurrencyData> getCurrencies()
-
getCurrentLanguage
@ModelAttribute("currentLanguage") public LanguageData getCurrentLanguage()
-
getCurrentCurrency
@ModelAttribute("currentCurrency") public CurrencyData getCurrentCurrency()
-
getSiteName
@ModelAttribute("siteName") public java.lang.String getSiteName()
-
getSiteUid
@ModelAttribute("siteUid") public java.lang.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, java.lang.String title)
-
getViewForPage
protected java.lang.String getViewForPage(org.springframework.ui.Model model)
-
getViewForPage
protected java.lang.String getViewForPage(AbstractPageModel page)
-
checkRequestUrl
protected java.lang.String checkRequestUrl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String resolvedUrlPath) throws java.io.UnsupportedEncodingExceptionChecks request URL against properly resolved URL and returns null if url is proper or redirection string if not.- Parameters:
request- - request that contains current URLresponse- - response to write "301 Moved Permanently" status to if redirectedresolvedUrlPath- - properly resolved URL- Returns:
- null if url is properly resolved or redirection string if not
- Throws:
java.io.UnsupportedEncodingException
-
getContentPageForLabelOrId
protected ContentPageModel getContentPageForLabelOrId(java.lang.String labelOrId) throws 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:
CMSItemNotFoundException- when no page is found for the provided label or id
-
getPageTitleResolver
protected PageTitleResolver getPageTitleResolver()
-
storeContinueUrl
protected void storeContinueUrl(javax.servlet.http.HttpServletRequest request)
-
setUpMetaData
protected void setUpMetaData(org.springframework.ui.Model model, java.lang.String metaKeywords, java.lang.String metaDescription)
-
createMetaElement
protected MetaElementData createMetaElement(java.lang.String name, java.lang.String content)
-
setUpMetaDataForContentPage
protected void setUpMetaDataForContentPage(org.springframework.ui.Model model, ContentPageModel contentPage)
-
getRequestContextData
protected RequestContextData getRequestContextData(javax.servlet.http.HttpServletRequest request)
-
urlEncode
protected java.lang.String urlEncode(java.lang.String url)
Url encode.- Parameters:
url- the url- Returns:
- the encoded string
- Throws:
java.lang.IllegalArgumentException- if url is null
-
prepareNotFoundPage
protected void prepareNotFoundPage(org.springframework.ui.Model model, javax.servlet.http.HttpServletResponse response) throws CMSItemNotFoundExceptionPrepares Not Found (404) Page- Parameters:
model- The model to pass with the pageresponse- object represents http response needed for setting not found status.- Throws:
CMSItemNotFoundException- when cannot find ContentPage with "notFound" id
-
getCheckoutRedirectUrl
protected java.lang.String getCheckoutRedirectUrl()
Method used to determine the checkout redirect URL that will handle the checkout process.- Returns:
- A
Stringobject of the URL to redirect to.
-
addRegistrationConsentDataToModel
protected void addRegistrationConsentDataToModel(org.springframework.ui.Model model)
-
decodeWithScheme
protected java.lang.String decodeWithScheme(java.lang.String source, java.lang.String enc)Decodes a string with encoding using a specific encoding scheme.- Parameters:
source- A string to decodeenc- The name of a supported character encoding. Default value is UTF-8 if no value is provided.- Returns:
- A decoded string
-
-