Class VariantsManager


  • @Deprecated
    public class VariantsManager
    extends java.lang.Object
    Deprecated.
    since ages - please use {see de.hybris.platform.product.VariantsService} instead

    This is the extension manager of the Variants extension.
    The UML diagram:
    TODO remove Foo - merge test

    • Constructor Detail

      • VariantsManager

        public VariantsManager()
        Deprecated.
    • Method Detail

      • getInstance

        public static VariantsManager getInstance()
        Deprecated.
        Returns:
        instance of this manager
      • createVariantType

        @Deprecated
        public VariantType createVariantType​(java.lang.String code)
        Deprecated.
        since ages - please use {see de.hybris.platform.servicelayer.model.ModelService} instead
        Creates a new variant type with the specified code.
        Parameters:
        code -
        Returns:
        the created variant type
      • getProductAttributes

        @Deprecated
        public java.util.Map<AttributeDescriptor,​java.lang.Object> getProductAttributes​(Product product,
                                                                                              java.util.Collection ignoreAttributes)
        Deprecated.
        since ages
        Returns all attributes of the specified product.

         Collection ignoreAttributes = Arrays.asList(
         new String[]
            {
               Item.TYPE,
               Product.NAME,
               VariantsConstants.Attributes.Product.VARIANTS,
               VariantsConstants.Attributes.Product.VARIANTTYPE,
               VariantsConstants.Attributes.VariantProduct.BASEPRODUCT
            }
         );
         VariantsManager vm = (VariantsManager) jaloSession.getExtensionManager(  ).getExtension( VariantsConstants.EXTENSIONNAME )
         Product product = jaloSession.getProductManager().getProductsByCode("dummy");
         Map attributes = vm.getProductAttributes( product, ignoreAttributes);
         

        Parameters:
        product - the product
        ignoreAttributes - the attributes to be ignored (optional)
        Returns:
        the attributes of the specified product
      • getAssignedAttributeValues

        @Deprecated
        public java.util.Collection getAssignedAttributeValues​(SessionContext ctx,
                                                               VariantType vt,
                                                               java.lang.String qualifier)
        Deprecated.
        since ages
        Searches all assigned values of the assigned variant type.
        Parameters:
        ctx -
        vt -
        qualifier -
        Returns:
        the assigned values
      • getAttributeValueClass

        @Deprecated
        public java.lang.Class getAttributeValueClass​(VariantType vt,
                                                      java.lang.String qualifier)
        Deprecated.
        since ages
        Returns the class of the specified variant type attribute.
        Parameters:
        vt -
        qualifier -
        Returns:
        the attribute value class
      • getVariantTypesByAttributes

        @Deprecated
        public java.util.Collection<VariantType> getVariantTypesByAttributes​(java.util.Map<java.lang.String,​Type> attributeMap,
                                                                             boolean matchExact)
        Deprecated.
        since ages
        Searches variant types which attributes match the specified attribute names. and types.

                Map attributeMap = new HashMap();
                attributeMap.put( "color" , jaloSession.getTypeManager().getType( "java.lang.String" ) );
                attributeMap.put( "unit" , jaloSession.getTypeManager().getComposedType( Unit.class ) );
         <p/>
                VariantsManager vm = (VariantsManager)jaloSession.getExtension(VariantsConstants.EXTENSIONNAME);
                Collection matchingVariantTypes = vm.getVariantTypesByAttributes( attributeMap );
         
        Parameters:
        attributeMap - the requested attributes as Map { String -> Type
        matchExact - if

                                                           true
                                                           

        only types which do not have additional variant attributes are returned, otherwise all types whith the requested attribute are returned

      • getVariantProductByAttributeValues

        @Deprecated
        public java.util.Collection getVariantProductByAttributeValues​(java.util.Map attributeValuesMap)
        Deprecated.
        Searches variant products which values match the specified values.

                Map valuesMap = new HashMap();
                valuesMap.put(getSession().getTypeManager().getComposedType("Shoe").getAttributeDescriptor("color")
                , "Camel/Rot");
         <p/>
                VariantsManager vm = (VariantsManager)getSession()..getExtension(VariantsConstants.EXTENSIONNAME);
                Collection matchingVariantProducts = vm..getVariantProductByAttributeValues( valuesMap);
         
        Parameters:
        attributeValuesMap - the requested values as Map { AttributeDescriptor -> {Object} }
      • getVariantProductByAttributeValues

        @Deprecated
        public java.util.Collection<VariantProduct> getVariantProductByAttributeValues​(java.util.Map<AttributeDescriptor,​java.lang.Object> attributeValuesMap,
                                                                                       java.lang.String variantTypeCode)
        Deprecated.
        since ages - please use {see de.hybris.platform.product.VariantsService.getVariantProductByAttributeValues()} instead
        Searches variant products which values match the specified values and variant typecode.

                Map valuesMap = new HashMap();
                valuesMap.put(getSession().getTypeManager().getComposedType("Trousers").getAttributeDescriptor("
                color"), "light broken-in");
         <p/>
                VariantsManager vm = (VariantsManager)getSession()..getExtension(VariantsConstants.EXTENSIONNAME);
                Collection matchingVariantProducts = vm..getVariantProductByAttributeValues( valuesMap, "Trousers");
         
        Parameters:
        attributeValuesMap - the requested values as Map { AttributeDescriptor -> {Object} }
        variantTypeCode - the requested variant typecode
      • getVariantProductByAttributeValues

        @Deprecated
        public java.util.Collection<VariantProduct> getVariantProductByAttributeValues​(Product base,
                                                                                       java.util.Map values)
        Deprecated.
        since ages - please use {see de.hybris.platform.product.VariantsService.getVariantProductByAttributeValues()} instead
        Filters a range of variants from a given base product according to the given variant attribute value map. If not all available attributes are specified the method is likely to return more than one variant - if all attributes are specified there should be only one variant which matches them.
        Parameters:
        base - the base product to get variants for
        values - the variant attribute values to match
      • isCreatorDisabled

        public boolean isCreatorDisabled()
        Deprecated.
        Part of DataCreator interface. Returns false.
        Returns:
        false
      • createEssentialData

        @Deprecated
        public void createEssentialData​(java.util.Map params,
                                        JspContext jspc)
                                 throws java.lang.Exception
        Deprecated.
        since ages
        Throws:
        java.lang.Exception
      • createBaseProductsSearch

        @Deprecated
        public SavedQuery createBaseProductsSearch()
        Deprecated.
        since ages
      • createBaseProduct

        @Deprecated
        public Product createBaseProduct​(java.lang.String code,
                                         java.lang.String variantTypeCode)
        Deprecated.
        since ages - please use {see de.hybris.platform.servicelayer.model.ModelService} instead
        Creates a typed base product with a specified variants type.
        Parameters:
        code - the code of the new base product
        variantTypeCode - the code of the variants type
      • setVariants

        @Deprecated
        public void setVariants​(SessionContext ctx,
                                Product baseProduct,
                                java.util.Collection variants)
        Deprecated.
        since ages
      • getAllBaseProducts

        @Deprecated
        public java.util.Collection<Product> getAllBaseProducts​(SessionContext ctx)
        Deprecated.
        since ages - shouldn't be use because of performance problems.
        Searches all existing base products.
        Parameters:
        ctx -
        Returns:
        the base products
      • isBaseProduct

        @Deprecated
        public boolean isBaseProduct​(Product product)
        Deprecated.
        since ages - covered by ProductModel
        Checks if the assigned product is a base product. (owns the attribute 'varianttype')
        Parameters:
        product -
        Returns:
        true if the assigned product is a base
      • getVariants

        @Deprecated
        public java.util.Collection<VariantProduct> getVariants​(SessionContext ctx,
                                                                Product baseProduct)
        Deprecated.
        since ages - covered by ProductModel
        Searches the variants of the assigned product.
        Parameters:
        ctx -
        baseProduct -
        Returns:
        the variants of the assigned product
      • removeVariants

        @Deprecated
        public void removeVariants​(java.util.Collection<VariantProduct> variants,
                                   Product baseProduct)
        Deprecated.
        since ages - covered by ProductModel
        Removes the specified variants from the assigned product.
        Parameters:
        variants -
        baseProduct -
      • removeVariants

        @Deprecated
        public void removeVariants​(SessionContext ctx,
                                   java.util.Collection<VariantProduct> variants,
                                   Product baseProduct)
        Deprecated.
        since ages - covered by ProductModel
        Removes the specified variants from the assigned product.
        Parameters:
        ctx -
        variants -
        baseProduct -
      • setVariantType

        @Deprecated
        public void setVariantType​(SessionContext ctx,
                                   Product item,
                                   VariantType param)
        Deprecated.
        since ages - covered by ProductModel
        Sets a new variant type for the assigned product. Note: You will get an error if the product has already an assigned variant type, which owns instances.
        Parameters:
        ctx -
        item -
        param -
      • setVariantType

        @Deprecated
        public void setVariantType​(Product item,
                                   VariantType param)
        Deprecated.
        since ages - covered by ProductModel
        Sets a new variant type for the assigned product. Note: You will get an error if the product has already an assigned variant type, which owns instances
        Parameters:
        item -
        param -
      • createVariantAttributeDescriptor

        public VariantAttributeDescriptor createVariantAttributeDescriptor​(SessionContext ctx,
                                                                           java.util.Map attributeValues)
        Deprecated.
        Generated methods from old GeneratedVariantsManager starts
      • createVariantAttributeDescriptor

        public VariantAttributeDescriptor createVariantAttributeDescriptor​(java.util.Map attributeValues)
        Deprecated.
      • createVariantType

        public VariantType createVariantType​(SessionContext ctx,
                                             java.util.Map attributeValues)
        Deprecated.
      • createVariantType

        public VariantType createVariantType​(java.util.Map attributeValues)
        Deprecated.
      • getName

        public java.lang.String getName()
        Deprecated.
      • setVariants

        public void setVariants​(Product item,
                                java.util.Collection<VariantProduct> value)
        Deprecated.