Class DefaultStoreSessionFacade
java.lang.Object
de.hybris.platform.commercefacades.storesession.impl.DefaultStoreSessionFacade
- All Implemented Interfaces:
StoreSessionFacade
Store session facade implementation. The main purpose is to load currency and language data from existing services.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LanguageDatafindBestLanguage(Collection<LanguageData> availableLanguages, List<Locale> preferredLocales) protected LanguageDatafindMatchingLanguageByIsoCode(String languageIsoCode, Collection<LanguageData> availableLanguages) protected LanguageDatafindMatchingLanguageByLocale(Locale locale, Collection<LanguageData> availableLanguages) protected BaseStoreServiceprotected CartServiceprotected CommerceCartServiceprotected CommerceCommonI18NServiceprotected CommonI18NServiceprotected Converter<CurrencyModel,CurrencyData> Gets current currency stored in session.Gets current language stored in session.Gets default currency for current store.Gets default language for current store.protected Converter<LanguageModel,LanguageData> protected SessionServiceprotected StoreSessionServicevoidinitializeSession(List<Locale> preferredLocales) Initialize the sessionprotected voidprotected voidinitializeSessionLanguage(List<Locale> preferredLocales) protected voidprotected voidDeprecated, for removal: This API element is subject to removal in a future version.Since 5.0.voidsetBaseStoreService(BaseStoreService service) voidsetCartService(CartService cartService) voidsetCommerceCartService(CommerceCartService commerceCartService) voidsetCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetCurrencyConverter(Converter<CurrencyModel, CurrencyData> currencyConverter) voidsetCurrentCurrency(String isocode) Sets the current currency and validates, if currency chosen is supported for current currency.voidsetCurrentLanguage(String isocode) Sets the current language and validates, if language chosen is supported for current store.voidsetLanguageConverter(Converter<LanguageModel, LanguageData> languageConverter) voidsetSessionService(SessionService sessionService) voidsetStoreSessionService(StoreSessionService storeSessionService)
-
Constructor Details
-
DefaultStoreSessionFacade
public DefaultStoreSessionFacade()
-
-
Method Details
-
initializeSession
Description copied from interface:StoreSessionFacadeInitialize the session- Specified by:
initializeSessionin interfaceStoreSessionFacade- Parameters:
preferredLocales- the preferred locales from which to initialize session language
-
removeSessionCart
Deprecated, for removal: This API element is subject to removal in a future version.Since 5.0. -
initializeSessionTaxGroup
protected void initializeSessionTaxGroup() -
initializeSessionLanguage
-
findBestLanguage
protected LanguageData findBestLanguage(Collection<LanguageData> availableLanguages, List<Locale> preferredLocales) -
findMatchingLanguageByLocale
protected LanguageData findMatchingLanguageByLocale(Locale locale, Collection<LanguageData> availableLanguages) -
findMatchingLanguageByIsoCode
protected LanguageData findMatchingLanguageByIsoCode(String languageIsoCode, Collection<LanguageData> availableLanguages) -
initializeSessionCurrency
protected void initializeSessionCurrency() -
getCurrentLanguage
Description copied from interface:StoreSessionFacadeGets current language stored in session.- Specified by:
getCurrentLanguagein interfaceStoreSessionFacade- Returns:
- current language for the current store.
-
getDefaultLanguage
Description copied from interface:StoreSessionFacadeGets default language for current store.- Specified by:
getDefaultLanguagein interfaceStoreSessionFacade- Returns:
- default language for current store.
-
getCurrentCurrency
Description copied from interface:StoreSessionFacadeGets current currency stored in session.- Specified by:
getCurrentCurrencyin interfaceStoreSessionFacade- Returns:
- current currency for the current store.
-
getDefaultCurrency
Description copied from interface:StoreSessionFacadeGets default currency for current store.- Specified by:
getDefaultCurrencyin interfaceStoreSessionFacade- Returns:
- default currency for current store.
-
getAllLanguages
- Specified by:
getAllLanguagesin interfaceStoreSessionFacade- Returns:
- all usable languages for the current catalog versions. In case of empty list of languages for versions, list of all languages in the system should be returned.
-
getAllCurrencies
- Specified by:
getAllCurrenciesin interfaceStoreSessionFacade- Returns:
- all usable currencies for the current store. In case of empty list of currencies for stores, list of all currencies in the system should be returned.
-
setCurrentLanguage
Description copied from interface:StoreSessionFacadeSets the current language and validates, if language chosen is supported for current store.- Specified by:
setCurrentLanguagein interfaceStoreSessionFacade- Parameters:
isocode- language iso
-
setCurrentCurrency
Description copied from interface:StoreSessionFacadeSets the current currency and validates, if currency chosen is supported for current currency.- Specified by:
setCurrentCurrencyin interfaceStoreSessionFacade- Parameters:
isocode- currency iso
-
getCommerceCommonI18NService
- Returns:
- the commerceCommonI18NService
-
setCommerceCommonI18NService
- Parameters:
commerceCommonI18NService- the commerceCommonI18NService to set
-
getCommonI18NService
- Returns:
- the commonI18NService
-
setCommonI18NService
- Parameters:
commonI18NService- the commonI18NService to set
-
getCartService
-
setCartService
-
getCommerceCartService
-
setCommerceCartService
-
getSessionService
-
setSessionService
-
getBaseStoreService
-
setBaseStoreService
-
getCurrencyConverter
-
setCurrencyConverter
-
getLanguageConverter
-
setLanguageConverter
-
getStoreSessionService
-
setStoreSessionService
-