Class ProductManager

  • All Implemented Interfaces:
    ItemLifecycleListener, java.io.Serializable

    @Deprecated
    public class ProductManager
    extends Manager
    Deprecated.
    since ages - as of release 4.3, please useProductService

    The ProductManager is used to create and find Products, Bundles, Variants and Units.

    See Also:
    Serialized Form
    • Field Detail

      • BEAN_NAME

        @Deprecated
        public static final java.lang.String BEAN_NAME
        Deprecated.
        since ages - as of release 4.3, please useProductService instead
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProductManager

        public ProductManager()
        Deprecated.
    • Method Detail

      • getInstance

        @Deprecated
        public static ProductManager getInstance()
        Deprecated.
        since ages - as of release 4.3, please useProductService instead
        Returns:
        instance of this manager
      • notifyItemRemoval

        @Deprecated
        protected void notifyItemRemoval​(SessionContext ctx,
                                         Item item)
        Deprecated.
        since ages - as of release 4.3, no replacement

        Superclass method overridden to avoid call to EJB layer

        Description copied from class: Manager
        TODO improve API doc Is called just before a item is being removed. No exception should be thrown here. Use Manager.checkBeforeItemRemoval(SessionContext, Item) instead.

        This method does nothing and may be overridden.

        Overrides:
        notifyItemRemoval in class Manager
        Parameters:
        ctx - the currency session context
        item - the item which is going to be removed
        Since:
        2.10
      • getProductTypeCode

        @Deprecated
        protected java.lang.String getProductTypeCode()
        Deprecated.
        since ages - as of release 4.3, please useProductModel._TYPECODE
      • getUnitTypeCode

        @Deprecated
        protected java.lang.String getUnitTypeCode()
        Deprecated.
        since ages - as of release 4.3, please useUnitModel._TYPECODE
      • createProduct

        @Deprecated
        public Product createProduct​(SessionContext ctx,
                                     java.lang.String code)
        Deprecated.
        since ages - as of release 4.3, no replacement, please create ProductModel using ModelService.create(Class)

        Creates a new Product.

        Parameters:
        ctx - the session context
        code - the code of the new product (not unique)
        Returns:
        the new Product
      • createProduct

        @Deprecated
        public Product createProduct​(SessionContext ctx,
                                     PK pk,
                                     java.lang.String code)
        Deprecated.
        since ages - as of release 4.3, no replacement, please create ProductModel using ModelService.create(Class)

        Creates a new Product.

        Parameters:
        ctx - the session context
        pk - the pk for the new item; it will be equipped with type code additionally (-)
        code - the code of the new product (not unique)
        Returns:
        the new Product
      • createProduct

        @Deprecated
        public Product createProduct​(SessionContext ctx,
                                     java.lang.String code,
                                     ComposedType type)
        Deprecated.
        since ages - as of release 4.3, no replacement, please create ProductModel using ModelService.create(Class)

        Creates a new Product with a specified type.

        Please note that this does not include setting any attribute declared by this type! use ComposedType.newInstance(Map) instead.

        Parameters:
        ctx - the SessionContext
        code - the code of the new product
        type - the type of the new product
        Returns:
        the new Product
      • createProduct

        @Deprecated
        public Product createProduct​(SessionContext ctx,
                                     PK pkBase,
                                     java.lang.String code,
                                     ComposedType type)
        Deprecated.
        since ages - as of release 4.3, no replacement, please create ProductModel using ModelService.create(Class)

        Creates a new Product with a specified type.

        Parameters:
        ctx - the SessionContext
        pkBase - the pk for the new item; it will be equipped with type code additionally (-)
        code - the code of the new product
        type - the type of the new product
        Returns:
        the new Product
      • getAllProducts

        @Deprecated
        public java.util.Collection<Product> getAllProducts()
        Deprecated.
        since ages - as of release 4.3, please write your own flexible search query

        Returns a Collection of all Products.

        Returns:
        a Collection containing all Products.
      • getProductsByCode

        @Deprecated
        public java.util.Collection getProductsByCode​(java.lang.String filter)
        Deprecated.
        since ages - as of release 4.3, no replacement, instead please use ProductService.getProduct(String) or ProductService.getProduct(de.hybris.platform.catalog.model.CatalogVersionModel, String)

        Returns all products whose code match the given string. It will be performed a search with equal sign (WHERE code='filter') except you use the wildcard sign '%' or '_', then a like query will be used (WHERE code LIKE 'filter').
        If you use wildcards be aware of a lower performance!

        Parameters:
        filter - the searched code. The String can contain % characters as wildcard. Using %hybris% as the filter would return all Products whose code contains hybris. Be aware of lower performance if using wildcards
        Returns:
        a Collection of all Products whose code matches the given filter.
      • getQuantityOfProducts

        @Deprecated
        public int getQuantityOfProducts()
        Deprecated.
        since ages - as of release 4.3, no replacement because products are catalog aware, please write your own flexible search query.

        Returns the total number of products.

        Returns:
        the total number of products.
      • createProduct

        @Deprecated
        public Product createProduct​(java.lang.String code)
        Deprecated.
        since ages - as of release 4.3, no replacement, please create ProductModel using ModelService.create(Class)

        Creates a new Product.

        Parameters:
        code - the code of the new product (not unique)
        Returns:
        the new Product
      • searchUnits

        @Deprecated
        public java.util.Collection searchUnits​(java.lang.String code,
                                                java.lang.String type)
        Deprecated.
        as of release 4.3, since code is unique it's useless

        Searches units by code and type.

        Parameters:
        code - the unit code (null ignores the field)
        type - the unit type (null ignores the field)
        Returns:
        a Collection of all units matching the given code and type.
      • createUnit

        @Deprecated
        public Unit createUnit​(java.lang.String type,
                               java.lang.String code)
        Deprecated.
        since ages
        * @deprecated as of release 4.3, no replacement, please create UnitModel using ModelService.create(Class)

        Create a new Unit with the given type and code

        Parameters:
        type - the type of the new Unit
        code - the code of the new Unit
        Returns:
        the new Unit
      • createUnit

        @Deprecated
        public Unit createUnit​(PK pkBase,
                               java.lang.String type,
                               java.lang.String code)
        Deprecated.
        since ages - as of release 4.3, no replacement, please create UnitModel using ModelService.create(Class)

        Create a new Unit with the given type and code

        Parameters:
        pkBase - the pk for the new item; it will be equipped with type code additionally (-)
        type - the type of the new Unit
        code - the code of the new Unit
        Returns:
        the new Unit
      • getAllUnits

        @Deprecated
        public java.util.Collection getAllUnits()
        Deprecated.
        since ages - as of release 4.3, please useUnitService.getAllUnits()

        Returns all Units.

        Returns:
        a Collection containing all units.
      • getUnitsByUnitType

        @Deprecated
        public java.util.Collection<Unit> getUnitsByUnitType​(java.lang.String type)
        Deprecated.
        since ages - as of release 4.3, please use UnitService.getUnitsForUnitType(String)

        Returns a Collection of all units of one type (e.g. 'weight' ).

        Parameters:
        type - the type of the searches units.
        Returns:
        a Collection of all units of one type (e.g. 'weight' ).
      • getUnit

        @Deprecated
        public Unit getUnit​(java.lang.String code)
        Deprecated.
        since ages - as of release 4.3, please useUnitService.getUnitForCode(String)

        Convernience method for fetching one unit provided that the given unit code is unique.

        Parameters:
        code - the unit code
        Returns:
        the unit or null if no such unit exists
        Throws:
        JaloInvalidParameterException - if the unit code is not unique
      • getUnitsByCode

        @Deprecated
        public java.util.Collection<Unit> getUnitsByCode​(java.lang.String code)
        Deprecated.
        since ages - as of release 4.3, please useUnitService.getUnitForCode(String) as code is unique it returns single value
      • getUnit

        @Deprecated
        public Unit getUnit​(java.lang.String type,
                            java.lang.String code)
        Deprecated.
        since ages - as of release 4.3, please useUnitService.getUnitForCode(String) as code is unique, type is not useful

        Convenience method for fetching one unit provided that the given unit code and type combination is unique.

        Parameters:
        type - the unit type
        code - the unit code
        Returns:
        the unit or null if no such unit exists
        Throws:
        JaloInvalidParameterException - if the unit code and type combination is not unique
      • getUnitsByTypeAndCode

        @Deprecated
        public java.util.Collection<Unit> getUnitsByTypeAndCode​(java.lang.String type,
                                                                java.lang.String code)
        Deprecated.
        since ages - as of release 4.3, please useUnitService.getUnitForCode(String) as code is unique, type is not useful
      • getAllUnitTypes

        @Deprecated
        public java.util.Collection getAllUnitTypes()
        Deprecated.
        since ages - as of release 4.3, please useUnitService.getAllUnitTypes()

        Finds all unit types (e.g. 'weight', 'size' ).

        Returns:
        a collection of type strings
      • getAllProductsChangedAfter

        @Deprecated
        public java.util.Collection getAllProductsChangedAfter​(java.util.Date date)
        Deprecated.
        since ages - as of release 4.3, please write your own flexible search query

        Get all products that have been modified since the given time

        Parameters:
        date - the date
        Returns:
        a collection of Products
      • writeReplace

        @Deprecated
        public java.lang.Object writeReplace()
                                      throws java.io.ObjectStreamException
        Deprecated.
        since ages - as of release 4.3, no replacement
        Specified by:
        writeReplace in class Manager
        Throws:
        java.io.ObjectStreamException