public class DefaultContextInformationLoader extends java.lang.Object implements ContextInformationLoader
| Constructor and Description |
|---|
DefaultContextInformationLoader() |
| Modifier and Type | Method and Description |
|---|---|
ActivateBaseSiteInSessionStrategy |
getActivateBaseSiteInSessionStrategy() |
java.util.Set<java.lang.String> |
getBaseSiteResourceExceptions() |
BaseSiteService |
getBaseSiteService() |
BaseStoreService |
getBaseStoreService() |
CalculationService |
getCalculationService() |
CartService |
getCartService() |
CommerceCommonI18NService |
getCommerceCommonI18NService() |
CommonI18NService |
getCommonI18NService() |
ConfigurationService |
getConfigurationService() |
protected java.lang.String |
getRequestMapping(java.lang.String queryString) |
protected java.lang.String[] |
getSpecialUrlCharacters() |
protected java.util.Collection<LanguageModel> |
getStoresLanguages(BaseStoreModel currentBaseStore) |
BaseSiteModel |
initializeSiteFromRequest(HttpServletRequest request)
Method resolves base site uid from request URL and set it as current site i.e
/rest/v1/mysite/cart, or /rest/v1/mysite/customers/current would try to set base site with uid=mysite as a current site. One should define the path which is expected to be before the site resource in the project properties file (commercewebservices.rootcontext). Default and fallback value equals to /rest/v1/ Method uses also a comma separated list of url special characters that are used to parse the site id resource. |
protected boolean |
isNotBaseSiteResource(java.lang.String requestMapping) |
protected java.lang.String |
parseBaseSiteId(java.lang.String requestMapping) |
protected void |
recalculateCart(java.lang.String currencyString)
Recalculates cart when currency has changed
|
void |
setActivateBaseSiteInSessionStrategy(ActivateBaseSiteInSessionStrategy activateBaseSiteInSessionStrategy) |
void |
setBaseSiteResourceExceptions(java.util.Set<java.lang.String> baseSiteResourceExceptions) |
void |
setBaseSiteService(BaseSiteService baseSiteService) |
void |
setBaseStoreService(BaseStoreService baseStoreService) |
void |
setCalculationService(CalculationService calculationService) |
void |
setCartService(CartService cartService) |
void |
setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService) |
void |
setCommonI18NService(CommonI18NService commonI18NService) |
void |
setConfigurationService(ConfigurationService configurationService) |
CurrencyModel |
setCurrencyFromRequest(HttpServletRequest request)
Method set current currency based on information from request and recalculate cart for current session
|
protected void |
setCurrentBaseSite(BaseSiteModel baseSiteModel) |
LanguageModel |
setLanguageFromRequest(HttpServletRequest request)
Method set current language base on information from request
|
public LanguageModel setLanguageFromRequest(HttpServletRequest request) throws UnsupportedLanguageException
ContextInformationLoadersetLanguageFromRequest in interface ContextInformationLoaderrequest - - request from which we should get language informationUnsupportedLanguageExceptionprotected java.util.Collection<LanguageModel> getStoresLanguages(BaseStoreModel currentBaseStore)
public CurrencyModel setCurrencyFromRequest(HttpServletRequest request) throws UnsupportedCurrencyException, RecalculationException
ContextInformationLoadersetCurrencyFromRequest in interface ContextInformationLoaderrequest - - request from which we should get currency informationUnsupportedCurrencyExceptionRecalculationExceptionprotected void recalculateCart(java.lang.String currencyString)
throws RecalculationException
RecalculationExceptionpublic BaseSiteModel initializeSiteFromRequest(HttpServletRequest request) throws InvalidResourceException
InvalidResourceException if it fails to find the site which is in the resource url.initializeSiteFromRequest in interface ContextInformationLoaderrequest - - request from which we should get base site uidInvalidResourceExceptionprotected java.lang.String getRequestMapping(java.lang.String queryString)
protected boolean isNotBaseSiteResource(java.lang.String requestMapping)
protected java.lang.String parseBaseSiteId(java.lang.String requestMapping)
protected java.lang.String[] getSpecialUrlCharacters()
protected void setCurrentBaseSite(BaseSiteModel baseSiteModel)
public ConfigurationService getConfigurationService()
public void setConfigurationService(ConfigurationService configurationService)
public java.util.Set<java.lang.String> getBaseSiteResourceExceptions()
public void setBaseSiteResourceExceptions(java.util.Set<java.lang.String> baseSiteResourceExceptions)
public BaseSiteService getBaseSiteService()
public void setBaseSiteService(BaseSiteService baseSiteService)
public ActivateBaseSiteInSessionStrategy getActivateBaseSiteInSessionStrategy()
public void setActivateBaseSiteInSessionStrategy(ActivateBaseSiteInSessionStrategy activateBaseSiteInSessionStrategy)
public CommonI18NService getCommonI18NService()
public void setCommonI18NService(CommonI18NService commonI18NService)
public CommerceCommonI18NService getCommerceCommonI18NService()
public void setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)
public BaseStoreService getBaseStoreService()
public void setBaseStoreService(BaseStoreService baseStoreService)
public CartService getCartService()
public void setCartService(CartService cartService)
public CalculationService getCalculationService()
public void setCalculationService(CalculationService calculationService)
Copyright © 2018 SAP SE. All Rights Reserved.