Class C2LManager

    • Constructor Detail

      • C2LManager

        public C2LManager()
    • Method Detail

      • getInstance

        public static C2LManager getInstance()
        Returns:
        instance of this manager
      • init

        public void init()
        Description copied from class: Manager
        called once for each tenant, so this method fits best to perform some initialization stuff
        Overrides:
        init in class Manager
      • checkBeforeItemRemoval

        @Deprecated(since="ages",
                    forRemoval=false)
        protected void checkBeforeItemRemoval​(SessionContext ctx,
                                              Item item)
                                       throws ConsistencyCheckException
        Deprecated.
        since ages - useRemoveInterceptor instead.
        Superclass method overridden to avoid call to EJB layer. Disallows removal of:
        • the last active currency,
        • the base currency,
        • any active language.
        Overrides:
        checkBeforeItemRemoval in class Manager
        Parameters:
        ctx - the current session context
        item - the item which should be removed
        Throws:
        ConsistencyCheckException - thrown to abort removal due to consistency errors
        Since:
        2.10
      • createLanguage

        @Deprecated(since="ages",
                    forRemoval=false)
        public Language createLanguage​(java.lang.String isoCode)
                                throws ConsistencyCheckException
        Deprecated.
        since ages - use plainLanguageModel creation instead :
         
         final LanguageModel lmodel = modelService.create(LanguageModel.class);
         lmodel.setIsocode("tinyRed");
         modelService.save(lmodel);
         
         

        see also model saving example.

        Creates a new Language with the specified iso code.
        Parameters:
        isoCode - the iso code of the new Language
        Returns:
        the Language with the specified iso code
        Throws:
        ConsistencyCheckException - if there already exists a language with the specified iso code
      • createLanguage

        @Deprecated(since="ages",
                    forRemoval=false)
        public Language createLanguage​(PK pk,
                                       java.lang.String isoCode)
                                throws ConsistencyCheckException
        Deprecated.
        since ages - use plainLanguageModel creation see createLanguage(String) see also model saving example.
        Creates a new Language with the specified iso code and pk.
        Parameters:
        pk - the primary key of the new Language
        isoCode - the iso code of the new Language
        Returns:
        the Language with the specified iso code
        Throws:
        ConsistencyCheckException - if there already exists a language with the specified iso code
      • getAllLanguages

        @Deprecated(since="ages",
                    forRemoval=false)
        public java.util.Set<Language> getAllLanguages()
        Deprecated.
        since ages - useCommonI18NService.getAllLanguages() instead.
        Returns a Set of all languages.
        Returns:
        a Set of all languages
      • getActiveLanguages

        @Deprecated(since="ages",
                    forRemoval=false)
        public java.util.Set<Language> getActiveLanguages()
        Deprecated.
        since ages - useCommonI18NService.getAllLanguages() instead.
        Returns a Collection of 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 Collection of all active languages
      • getDefaultLanguageForTenant

        public Language getDefaultLanguageForTenant​(Tenant t)
      • getDefaultCurrencyForTenant

        public Currency getDefaultCurrencyForTenant​(Tenant t)
      • createCurrency

        @Deprecated(since="ages",
                    forRemoval=false)
        public Currency createCurrency​(java.lang.String isoCode)
                                throws ConsistencyCheckException
        Deprecated.
        since ages - use plainCurrencyModel creation instead :
         
         final CurrencyModel model = modelService.create(CurrencyModel.class);
         model.setIsocode("tinyRed");
         modelService.save(model);
         
         

        see also model saving example

        Creates a new Currency with the specified iso code.
        Parameters:
        isoCode - the iso code of the new Currency
        Returns:
        the new Currency
        Throws:
        ConsistencyCheckException - if there already exists a Currency with this iso code
      • getAllCurrencies

        @Deprecated(since="ages",
                    forRemoval=false)
        public java.util.Set<Currency> getAllCurrencies()
        Deprecated.
        since ages - useCommonI18NService.getAllCurrencies() instead.
        Returns a Collection of all currencies.
        Returns:
        a Collection of all currencies
      • getActiveCurrencies

        @Deprecated(since="ages",
                    forRemoval=false)
        public java.util.Set<Currency> getActiveCurrencies()
        Deprecated.
        since ages - useCommonI18NService.getAllCurrencies() instead.
        Returns a Collection of 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 Collection of all active currencies
      • getBaseCurrency

        @Deprecated(since="ages",
                    forRemoval=false)
        public Currency getBaseCurrency()
        Deprecated.
        since ages - useCommonI18NService.getBaseCurrency() instead.
        Returns the base currency (GeneratedCurrency.isBase()) of this system or Null if no base currency is set. There should be always one such Currency in the hybris Platform. The base currency should be the most likely-to-us currency.
        Returns:
        the base Currency or Null if no base currency is set
      • setBaseCurrency

        @Deprecated(since="ages",
                    forRemoval=false)
        public void setBaseCurrency​(Currency currency)
        Deprecated.
        since ages - use {Currency#setBase()} instead.
        Sets the specified Currency as the base currency of this system.
        Parameters:
        currency - the new base currency
        See Also:
        getBaseCurrency()
      • getCountryByIsoCode

        @Deprecated(since="ages",
                    forRemoval=false)
        public Country getCountryByIsoCode​(java.lang.String iso)
                                    throws JaloItemNotFoundException
        Deprecated.
        since ages - useCommonI18NService.getCountry(String) instead.
        Returns the Country with the specified isocode.
        Parameters:
        iso - the isocode of the searched Country
        Returns:
        the Country with the specified isocode
        Throws:
        JaloItemNotFoundException - if no Country with the specified isocode exists
      • createCountry

        @Deprecated(since="ages",
                    forRemoval=false)
        public Country createCountry​(java.lang.String isoCode)
                              throws ConsistencyCheckException
        Deprecated.
        since ages - use plainCountryModel creation instead :
         
         final CountryModel model = modelService.create(CountryModel.class);
         model.setIsocode("tinyRed");
         modelService.save(model);
         
         

        see also model saving example.

        Creates a new Country with the specified isocode. The isocode of the Country must 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(since="ages",
                    forRemoval=false)
        public Country createCountry​(PK pkBase,
                                     java.lang.String isoCode)
                              throws ConsistencyCheckException
        Deprecated.
        since ages - use plainCountryModel creation instead see createCountry(String), see also model saving example
        Creates a new Country with the specified isocode. The isocode of the Country must be unique within the countries.
        Parameters:
        pkBase - the primary key of the new Country
        isoCode - the isocode of the new country
        Returns:
        the new Country
        Throws:
        ConsistencyCheckException - if the isocode is not unique within the countries
      • getAllCountries

        @Deprecated(since="ages",
                    forRemoval=false)
        public java.util.Set<Country> getAllCountries()
        Deprecated.
        since ages - useCommonI18NService.getAllCountries() instead.
        Returns a Collection of all countries.
        Returns:
        a Collection of all countries
      • getActiveCountries

        @Deprecated(since="ages",
                    forRemoval=false)
        public java.util.Set<Country> getActiveCountries()
        Deprecated.
        since ages - useCommonI18NService.getAllCountries() instead.
        Returns a Collection of all active countries.
        Returns:
        a Collection of all active countries.
      • getRegionsByCode

        @Deprecated(since="ages",
                    forRemoval=false)
        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 use CommonI18NService.getRegion(de.hybris.platform.core.model.c2l.CountryModel, String) instead.
        Returns a Collection of regions which match the specified code code.
        Parameters:
        code - the code of the searched regions
        Returns:
        a Collection of regions which match the specified code code
      • createRegion

        @Deprecated(since="ages",
                    forRemoval=false)
        public Region createRegion​(java.lang.String code,
                                   Country country)
                            throws ConsistencyCheckException
        Deprecated.
        since ages - please useCountry.addNewRegion(String) instead
        Creates a new region for the specified Country with the given code.
        Parameters:
        code - the code of the new Region
        country - the Country the new Region belongs to
        Returns:
        the new Region
        Throws:
        ConsistencyCheckException - if a Region with the specified code already exists for the specified Country
      • createRegion

        @Deprecated(since="ages",
                    forRemoval=false)
        public Region createRegion​(PK pkBase,
                                   java.lang.String code,
                                   Country country)
                            throws ConsistencyCheckException
        Deprecated.
        since ages - use plainRegionModel creation instead see also model saving example.
        Creates a new region for the specified Country with the given code.
        Parameters:
        pkBase - the primary key of the new region. Must be unique.
        code - the code of the new Region
        country - the Country the new Region belongs to
        Returns:
        the new Region
        Throws:
        ConsistencyCheckException - if a Region with the specified code already exists for the specified Country
      • getRegions

        @Deprecated(since="ages",
                    forRemoval=false)
        public java.util.Collection<Region> getRegions​(Country country)
        Deprecated.
        since ages - useCountryModel.getRegions() instead.
        Returns a Collection of all regions which are assigned to the specified Country.
        Parameters:
        country - the Country whose regions should be returned
        Returns:
        a Collection of all regions which are assigned to the specified Country
      • getAllRegions

        @Deprecated(since="ages",
                    forRemoval=false)
        public java.util.Set<Region> getAllRegions()
        Deprecated.
        since ages - useCommonI18NService.getAllRegions() instead.
        Returns a Collection of all regions, regardless which Country they belong to.
        Returns:
        a Collection of all regions, regardless which Country they belong to
      • getActiveRegions

        @Deprecated(since="ages",
                    forRemoval=false)
        public java.util.Set<Region> getActiveRegions()
        Deprecated.
        since ages - useCommonI18NService.getAllRegions() instead.
        Returns a Collection of all active regions, regardless which Country they belong to.
        Returns:
        a Collection of all active regions, regardless which Country they belong to
      • writeReplace

        public java.lang.Object writeReplace()
                                      throws java.io.ObjectStreamException
        Specified by:
        writeReplace in class Manager
        Throws:
        java.io.ObjectStreamException