Class VariantsManager

java.lang.Object
de.hybris.platform.variants.jalo.VariantsManager

@Deprecated(since="ages", forRemoval=false) public class VariantsManager extends 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 Details

    • VariantsManager

      public VariantsManager()
      Deprecated.
  • Method Details

    • beforeItemCreation

      @Deprecated(since="ages", forRemoval=false) public void beforeItemCreation(SessionContext ctx, ComposedType type, Item.ItemAttributeMap attributes) throws JaloBusinessException
      Deprecated.
      since ages
      Overwritten to ensure Product.variantType and VariantProduct.baseProduct attributes are stored as initial attributes.
      Throws:
      JaloBusinessException
    • getInstance

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

      @Deprecated(since="ages", forRemoval=false) public VariantType createVariantType(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(since="ages", forRemoval=false) public Map<AttributeDescriptor,Object> getProductAttributes(Product product, 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(since="ages", forRemoval=false) public Collection getAssignedAttributeValues(SessionContext ctx, VariantType vt, String qualifier)
      Deprecated.
      since ages
      Searches all assigned values of the assigned variant type.
      Parameters:
      ctx -
      vt -
      qualifier -
      Returns:
      the assigned values
    • getAssignedVariantAttributes

      @Deprecated(since="ages", forRemoval=false) public Map<String,Collection> getAssignedVariantAttributes(Product baseProduct) throws JaloInvalidParameterException, JaloSecurityException
      Deprecated.
      since ages - please use {see de.hybris.platform.product.VariantsService.getAssignedVariantAttributes()} instead
      Throws:
      JaloInvalidParameterException
      JaloSecurityException
    • getAttributeValueClass

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

      @Deprecated(since="ages", forRemoval=false) public Collection<VariantType> getVariantTypesByAttributes(Map<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(since="ages", forRemoval=false) public Collection getVariantProductByAttributeValues(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(since="ages", forRemoval=false) public Collection<VariantProduct> getVariantProductByAttributeValues(Map<AttributeDescriptor,Object> attributeValuesMap, 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(since="ages", forRemoval=false) public Collection<VariantProduct> getVariantProductByAttributeValues(Product base, 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(since="ages", forRemoval=false) public void createEssentialData(Map params, JspContext jspc) throws Exception
      Deprecated.
      since ages
      Throws:
      Exception
    • createBaseProductsSearch

      @Deprecated(since="ages", forRemoval=false) public SavedQuery createBaseProductsSearch()
      Deprecated.
      since ages
    • createBaseProduct

      @Deprecated(since="ages", forRemoval=false) public Product createBaseProduct(String code, 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(since="ages", forRemoval=false) public void setVariants(SessionContext ctx, Product baseProduct, Collection variants)
      Deprecated.
      since ages
    • getAllBaseProducts

      @Deprecated(since="ages", forRemoval=false) public 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(since="ages", forRemoval=false) 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(since="ages", forRemoval=false) public 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(since="ages", forRemoval=false) public void removeVariants(Collection<VariantProduct> variants, Product baseProduct)
      Deprecated.
      since ages - covered by ProductModel
      Removes the specified variants from the assigned product.
      Parameters:
      variants -
      baseProduct -
    • removeVariants

      @Deprecated(since="ages", forRemoval=false) public void removeVariants(SessionContext ctx, 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(since="ages", forRemoval=false) 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(since="ages", forRemoval=false) 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, Map attributeValues)
      Deprecated.
      Generated methods from old GeneratedVariantsManager starts
    • createVariantAttributeDescriptor

      public VariantAttributeDescriptor createVariantAttributeDescriptor(Map attributeValues)
      Deprecated.
    • createVariantType

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

      public VariantType createVariantType(Map attributeValues)
      Deprecated.
    • getName

      public String getName()
      Deprecated.
    • getVariants

      public Collection<VariantProduct> getVariants(Product item)
      Deprecated.
    • setVariants

      public void setVariants(Product item, Collection<VariantProduct> value)
      Deprecated.
    • getVariantType

      public VariantType getVariantType(SessionContext ctx, Product item)
      Deprecated.
    • getVariantType

      public VariantType getVariantType(Product item)
      Deprecated.