Package de.hybris.platform.jalo.c2l
Class C2LManager
- java.lang.Object
-
- de.hybris.platform.jalo.Manager
-
- de.hybris.platform.jalo.c2l.C2LManager
-
- All Implemented Interfaces:
ItemLifecycleListener,java.io.Serializable
public class C2LManager extends Manager
The manager for all items of this package, which offers methods to create and getItems of this package.- See Also:
JaloSession,Cart,Order,Address, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classC2LManager.C2LCacheKeyprotected static classC2LManager.C2LManagerSerializableDTO-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBEAN_NAME
-
Constructor Summary
Constructors Constructor Description C2LManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcheckBeforeItemRemoval(SessionContext ctx, Item item)Deprecated.since ages - useRemoveInterceptorinstead.CountrycreateCountry(PK pkBase, java.lang.String isoCode)Deprecated.since ages - use plainCountryModelcreation instead seecreateCountry(String), see also model saving exampleCountrycreateCountry(java.lang.String isoCode)Deprecated.since ages - use plainCountryModelcreation instead :CurrencycreateCurrency(PK pkBase, java.lang.String isoCode)Deprecated.since ages - use plainCurrencyModelcreation instead seecreateCurrency(String)see also model saving example.CurrencycreateCurrency(java.lang.String isoCode)Deprecated.since ages - use plainCurrencyModelcreation instead :LanguagecreateLanguage(PK pk, java.lang.String isoCode)Deprecated.since ages - use plainLanguageModelcreation seecreateLanguage(String)see also model saving example.LanguagecreateLanguage(java.lang.String isoCode)Deprecated.since ages - use plainLanguageModelcreation instead :RegioncreateRegion(PK pkBase, java.lang.String code, Country country)Deprecated.since ages - use plainRegionModelcreation instead see also model saving example.RegioncreateRegion(java.lang.String code, Country country)Deprecated.since ages - please useCountry.addNewRegion(String)insteadjava.util.Set<Country>getActiveCountries()Deprecated.since ages - useCommonI18NService.getAllCountries()instead.java.util.Set<Currency>getActiveCurrencies()Deprecated.since ages - useCommonI18NService.getAllCurrencies()instead.java.util.Set<Language>getActiveLanguages()Deprecated.since ages - useCommonI18NService.getAllLanguages()instead.java.util.Set<Region>getActiveRegions()Deprecated.since ages - useCommonI18NService.getAllRegions()instead.java.util.Set<Country>getAllCountries()Deprecated.since ages - useCommonI18NService.getAllCountries()instead.java.util.Set<Currency>getAllCurrencies()Deprecated.since ages - useCommonI18NService.getAllCurrencies()instead.java.util.Set<Language>getAllLanguages()Deprecated.since ages - useCommonI18NService.getAllLanguages()instead.java.util.Set<Region>getAllRegions()Deprecated.since ages - useCommonI18NService.getAllRegions()instead.CurrencygetBaseCurrency()Deprecated.since ages - useCommonI18NService.getBaseCurrency()instead.CountrygetCountryByIsoCode(java.lang.String iso)Deprecated.since ages - useCommonI18NService.getCountry(String)instead.CurrencygetCurrencyByIsoCode(java.lang.String iso)Deprecated.since ages - useCommonI18NService.getCurrency(String)instead.CurrencygetDefaultCurrencyForTenant(Tenant t)LanguagegetDefaultLanguageForTenant(Tenant t)static C2LManagergetInstance()LanguagegetLanguageByIsoCode(java.lang.String iso)Deprecated.since ages - useCommonI18NService.getLanguage(String)instead.RegiongetRegionByCode(Country country, java.lang.String code)Deprecated.since ages - useCommonI18NService.getRegion(de.hybris.platform.core.model.c2l.CountryModel, String)instead.RegiongetRegionByCode(java.lang.String code)Deprecated.since ages - You should consider not using region data without its country context , in that case useCommonI18NService.getRegion(de.hybris.platform.core.model.c2l.CountryModel, String)instead.java.util.Collection<Region>getRegions(Country country)Deprecated.since ages - useCountryModel.getRegions()instead.java.util.Collection<Region>getRegionsByCode(java.lang.String code)Deprecated.since ages - You should consider not using region data without its country context, in that useCommonI18NService.getRegion(de.hybris.platform.core.model.c2l.CountryModel, String)instead.voidinit()called once for each tenant, so this method fits best to perform some initialization stuffprotected voidnotifyItemRemoval(SessionContext ctx, Item item)TODO improve API doc Is called just before a item is being removed.voidsetBaseCurrency(Currency currency)Deprecated.since ages - use {Currency#setBase()} instead.java.lang.ObjectwriteReplace()-
Methods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemote, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, setAttribute, setTenant, setTransientObject, wrap
-
-
-
-
Field Detail
-
BEAN_NAME
public static final java.lang.String BEAN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static C2LManager getInstance()
- Returns:
- instance of this manager
-
init
public void init()
Description copied from class:Managercalled once for each tenant, so this method fits best to perform some initialization stuff
-
checkBeforeItemRemoval
@Deprecated protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException
Deprecated.since ages - useRemoveInterceptorinstead.Superclass method overridden to avoid call to EJB layer. Disallows removal of:- the last active currency,
- the base currency,
- any active language.
- Overrides:
checkBeforeItemRemovalin classManager- Parameters:
ctx- the current session contextitem- the item which should be removed- Throws:
ConsistencyCheckException- thrown to abort removal due to consistency errors- Since:
- 2.10
-
getLanguageByIsoCode
@Deprecated public Language getLanguageByIsoCode(java.lang.String iso) throws JaloItemNotFoundException
Deprecated.since ages - useCommonI18NService.getLanguage(String)instead.Returns theLanguagewith the specified iso code. If there exists noLanguagewith the specified iso code aJaloItemNotFoundExceptionis thrown.- Parameters:
iso- the isocode of the searchedLanguage- Returns:
- the
Languagewith the specified isocode - Throws:
JaloItemNotFoundException- if there exists noLanguagewith the specified iso code
-
createLanguage
@Deprecated public Language createLanguage(java.lang.String isoCode) throws ConsistencyCheckException
Deprecated.since ages - use plainLanguageModelcreation instead :final LanguageModel lmodel = modelService.create(LanguageModel.class); lmodel.setIsocode("tinyRed"); modelService.save(lmodel);see also model saving example.
Creates a newLanguagewith the specified iso code.- Parameters:
isoCode- the iso code of the newLanguage- Returns:
- the
Languagewith the specified iso code - Throws:
ConsistencyCheckException- if there already exists a language with the specified iso code
-
createLanguage
@Deprecated public Language createLanguage(PK pk, java.lang.String isoCode) throws ConsistencyCheckException
Deprecated.since ages - use plainLanguageModelcreation seecreateLanguage(String)see also model saving example.Creates a newLanguagewith the specified iso code and pk.- Parameters:
pk- the primary key of the newLanguageisoCode- the iso code of the newLanguage- Returns:
- the
Languagewith the specified iso code - Throws:
ConsistencyCheckException- if there already exists a language with the specified iso code
-
getAllLanguages
@Deprecated public java.util.Set<Language> getAllLanguages()
Deprecated.since ages - useCommonI18NService.getAllLanguages()instead.Returns aSetof all languages.- Returns:
- a
Setof all languages
-
getActiveLanguages
@Deprecated public java.util.Set<Language> getActiveLanguages()
Deprecated.since ages - useCommonI18NService.getAllLanguages()instead.Returns aCollectionof all active languages (GeneratedC2LItem.isActive()== true ). This is meant to provide a way to select only the languages which are to be shown in applications ( web ) even though a large number of them exists.- Returns:
- a
Collectionof all active languages
-
getCurrencyByIsoCode
@Deprecated public Currency getCurrencyByIsoCode(java.lang.String iso) throws JaloItemNotFoundException
Deprecated.since ages - useCommonI18NService.getCurrency(String)instead.Returns theCurrencywith the specified iso code. If there exists noCurrencywith the specified iso code aJaloItemNotFoundExceptionis thrown.- Parameters:
iso- the iso code of the searchedCurrency- Returns:
- the
Currencywith the specified iso code - Throws:
JaloItemNotFoundException- if there exists noCurrencywith the specified iso code
-
createCurrency
@Deprecated public Currency createCurrency(java.lang.String isoCode) throws ConsistencyCheckException
Deprecated.since ages - use plainCurrencyModelcreation instead :final CurrencyModel model = modelService.create(CurrencyModel.class); model.setIsocode("tinyRed"); modelService.save(model);see also model saving example
Creates a newCurrencywith the specified iso code.- Parameters:
isoCode- the iso code of the newCurrency- Returns:
- the new
Currency - Throws:
ConsistencyCheckException- if there already exists aCurrencywith this iso code
-
createCurrency
@Deprecated public Currency createCurrency(PK pkBase, java.lang.String isoCode) throws ConsistencyCheckException
Deprecated.since ages - use plainCurrencyModelcreation instead seecreateCurrency(String)see also model saving example.Creates a newCurrencywith the specified iso code.- Parameters:
pkBase- thePKof the newCurrencyisoCode- the iso code of the newCurrency- Returns:
- the new
Currency - Throws:
ConsistencyCheckException- if there already exists aCurrencywith this iso code
-
getAllCurrencies
@Deprecated public java.util.Set<Currency> getAllCurrencies()
Deprecated.since ages - useCommonI18NService.getAllCurrencies()instead.Returns aCollectionof all currencies.- Returns:
- a
Collectionof all currencies
-
getActiveCurrencies
@Deprecated public java.util.Set<Currency> getActiveCurrencies()
Deprecated.since ages - useCommonI18NService.getAllCurrencies()instead.Returns aCollectionof all active currencies (GeneratedC2LItem.isActive()== true ). This is meant to provide a way to select only the currencies which should be shown in applications ( web ) even though a larger number of them exists.- Returns:
- a
Collectionof all active currencies
-
getBaseCurrency
@Deprecated public Currency getBaseCurrency()
Deprecated.since ages - useCommonI18NService.getBaseCurrency()instead.Returns the base currency (GeneratedCurrency.isBase()) of this system orNullif no base currency is set. There should be always one suchCurrencyin the hybris Platform. The base currency should be the most likely-to-us currency.- Returns:
- the base
CurrencyorNullif no base currency is set
-
setBaseCurrency
@Deprecated public void setBaseCurrency(Currency currency)
Deprecated.since ages - use {Currency#setBase()} instead.Sets the specifiedCurrencyas the base currency of this system.- Parameters:
currency- the new base currency- See Also:
getBaseCurrency()
-
getCountryByIsoCode
@Deprecated public Country getCountryByIsoCode(java.lang.String iso) throws JaloItemNotFoundException
Deprecated.since ages - useCommonI18NService.getCountry(String)instead.Returns theCountrywith the specified isocode.- Parameters:
iso- the isocode of the searchedCountry- Returns:
- the
Countrywith the specified isocode - Throws:
JaloItemNotFoundException- if noCountrywith the specified isocode exists
-
createCountry
@Deprecated public Country createCountry(java.lang.String isoCode) throws ConsistencyCheckException
Deprecated.since ages - use plainCountryModelcreation instead :final CountryModel model = modelService.create(CountryModel.class); model.setIsocode("tinyRed"); modelService.save(model);see also model saving example.
Creates a newCountrywith the specified isocode. The isocode of theCountrymust be unique within the countries.- Parameters:
isoCode- the isocode of the new country- Returns:
- the new
Country - Throws:
ConsistencyCheckException- if the isocode is not unique within the countries
-
createCountry
@Deprecated public Country createCountry(PK pkBase, java.lang.String isoCode) throws ConsistencyCheckException
Deprecated.since ages - use plainCountryModelcreation instead seecreateCountry(String), see also model saving exampleCreates a newCountrywith the specified isocode. The isocode of theCountrymust be unique within the countries.- Parameters:
pkBase- the primary key of the newCountryisoCode- the isocode of the new country- Returns:
- the new
Country - Throws:
ConsistencyCheckException- if the isocode is not unique within the countries
-
getAllCountries
@Deprecated public java.util.Set<Country> getAllCountries()
Deprecated.since ages - useCommonI18NService.getAllCountries()instead.Returns aCollectionof all countries.- Returns:
- a
Collectionof all countries
-
getActiveCountries
@Deprecated public java.util.Set<Country> getActiveCountries()
Deprecated.since ages - useCommonI18NService.getAllCountries()instead.Returns aCollectionof all active countries.- Returns:
- a
Collectionof all active countries.
-
getRegionByCode
@Deprecated public Region getRegionByCode(java.lang.String code) throws JaloItemNotFoundException, JaloSystemException
Deprecated.since ages - You should consider not using region data without its country context , in that case useCommonI18NService.getRegion(de.hybris.platform.core.model.c2l.CountryModel, String)instead.Returns theRegionwith the specified code. If there exists noRegionwith the specified code, aJaloItemNotFoundException is thrown. If there are more than oneRegionwith the specified code, aJaloSystemExceptionis thrown.- Parameters:
code- the code of the searchedRegion- Returns:
- the
Regionwith the specified code - Throws:
JaloItemNotFoundException- if there exists noRegionwith the specified codeJaloSystemException- if there are more than oneRegionwith the specified code
-
getRegionsByCode
@Deprecated public java.util.Collection<Region> getRegionsByCode(java.lang.String code)
Deprecated.since ages - You should consider not using region data without its country context, in that useCommonI18NService.getRegion(de.hybris.platform.core.model.c2l.CountryModel, String)instead.Returns aCollectionof regions which match the specified code code.- Parameters:
code- the code of the searched regions- Returns:
- a
Collectionof regions which match the specified code code
-
getRegionByCode
@Deprecated public Region getRegionByCode(Country country, java.lang.String code) throws JaloItemNotFoundException
Deprecated.since ages - useCommonI18NService.getRegion(de.hybris.platform.core.model.c2l.CountryModel, String)instead.Returns theRegionwith the specified code which is assigned to the specifiedCountry. Throws aJaloItemNotFoundExceptionif no matchingRegion is found.- Parameters:
country- theCountry, theRegionshould belong tocode- the code of the searched region- Returns:
- the
Regionwith the specified code which is assigned to the specifiedCountry. - Throws:
JaloItemNotFoundException- if no matchingRegion is found
-
createRegion
@Deprecated public Region createRegion(java.lang.String code, Country country) throws ConsistencyCheckException
Deprecated.since ages - please useCountry.addNewRegion(String)insteadCreates a new region for the specifiedCountrywith the given code.- Parameters:
code- the code of the newRegioncountry- theCountrythe newRegionbelongs to- Returns:
- the new
Region - Throws:
ConsistencyCheckException- if aRegionwith the specified code already exists for the specifiedCountry
-
createRegion
@Deprecated public Region createRegion(PK pkBase, java.lang.String code, Country country) throws ConsistencyCheckException
Deprecated.since ages - use plainRegionModelcreation instead see also model saving example.Creates a new region for the specifiedCountrywith the given code.- Parameters:
pkBase- the primary key of the newregion. Must be unique.code- the code of the newRegioncountry- theCountrythe newRegionbelongs to- Returns:
- the new
Region - Throws:
ConsistencyCheckException- if aRegionwith the specified code already exists for the specifiedCountry
-
getRegions
@Deprecated public java.util.Collection<Region> getRegions(Country country)
Deprecated.since ages - useCountryModel.getRegions()instead.Returns aCollectionof all regions which are assigned to the specifiedCountry.- Parameters:
country- theCountrywhose regions should be returned- Returns:
- a
Collectionof all regions which are assigned to the specifiedCountry
-
getAllRegions
@Deprecated public java.util.Set<Region> getAllRegions()
Deprecated.since ages - useCommonI18NService.getAllRegions()instead.Returns aCollectionof all regions, regardless whichCountrythey belong to.- Returns:
- a
Collectionof all regions, regardless whichCountrythey belong to
-
getActiveRegions
@Deprecated public java.util.Set<Region> getActiveRegions()
Deprecated.since ages - useCommonI18NService.getAllRegions()instead.Returns aCollection of all active regions, regardless whichCountrythey belong to.- Returns:
- a
Collection of all active regions, regardless whichCountrythey belong to
-
writeReplace
public java.lang.Object writeReplace() throws java.io.ObjectStreamException- Specified by:
writeReplacein classManager- Throws:
java.io.ObjectStreamException
-
notifyItemRemoval
protected void notifyItemRemoval(SessionContext ctx, Item item)
Description copied from class:ManagerTODO improve API doc Is called just before a item is being removed. No exception should be thrown here. UseManager.checkBeforeItemRemoval(SessionContext, Item)instead.This method does nothing and may be overridden.
- Overrides:
notifyItemRemovalin classManager- Parameters:
ctx- the currency session contextitem- the item which is going to be removed
-
-