Class ProductImpl

java.lang.Object
org.broadleafcommerce.core.catalog.domain.ProductImpl
All Implemented Interfaces:
Serializable, AdminMainEntity, MultiTenantCloneable<Product>, Status, TemplatePathContainer, Locatable, Indexable, Product, ProductAdminPresentation
Direct Known Subclasses:
ProductBundleImpl

@Entity public class ProductImpl extends Object implements Product, ProductAdminPresentation, Status, AdminMainEntity, Locatable, TemplatePathContainer
The Class ProductImpl is the default implementation of Product. A product is a general description of an item that can be sold (for example: a hat). Products are not sold or added to a cart. Skus which are specific items (for example: a XL Blue Hat) are sold or added to a cart.

If you want to add fields specific to your implementation of BroadLeafCommerce you should extend this class and add your fields. If you need to make significant changes to the ProductImpl then you should implement your own version of Product.

This implementation uses a Hibernate implementation of JPA configured through annotations. The Entity references the following tables: BLC_PRODUCT, BLC_PRODUCT_SKU_XREF, BLC_PRODUCT_IMAGE
Author:
btaylor
See Also:
  • Field Details

    • EXCLUDE_PRODUCT_CODE_COPY_HINT

      public static final String EXCLUDE_PRODUCT_CODE_COPY_HINT
      See Also:
    • id

      protected Long id
      The id.
    • url

      protected String url
    • overrideGeneratedUrl

      protected Boolean overrideGeneratedUrl
    • urlKey

      protected String urlKey
    • displayTemplate

      protected String displayTemplate
    • model

      protected String model
    • manufacturer

      protected String manufacturer
    • defaultSku

      protected Sku defaultSku
    • canSellWithoutOptions

      protected Boolean canSellWithoutOptions
    • metaTitle

      protected String metaTitle
    • metaDescription

      protected String metaDescription
    • canonicalUrl

      protected String canonicalUrl
    • skus

      protected List<Sku> skus
    • promoMessage

      protected String promoMessage
    • crossSaleProducts

      protected List<RelatedProduct> crossSaleProducts
    • upSaleProducts

      protected List<RelatedProduct> upSaleProducts
    • additionalSkus

      protected List<Sku> additionalSkus
    • defaultCategory

      @Deprecated protected Category defaultCategory
      Deprecated.
    • allParentCategoryXrefs

      protected List<CategoryProductXref> allParentCategoryXrefs
    • productAttributes

      protected List<ProductAttribute> productAttributes
    • productOptions

      protected List<ProductOptionXref> productOptions
    • enableDefaultSkuInventory

      protected Boolean enableDefaultSkuInventory
    • productOptionMap

      protected Map<String,Set<String>> productOptionMap
    • allParentCategoryIds

      protected List<String> allParentCategoryIds
    • archiveStatus

      protected ArchiveStatus archiveStatus
  • Constructor Details

    • ProductImpl

      public ProductImpl()
  • Method Details

    • getEnableDefaultSkuInInventory

      public Boolean getEnableDefaultSkuInInventory()
      Specified by:
      getEnableDefaultSkuInInventory in interface Product
    • setEnableDefaultSkuInInventory

      public void setEnableDefaultSkuInInventory(Boolean enableDefaultSkuInventory)
      Description copied from interface: Product
      enables or disables that inventory will be tracked by default sku instead of alt sku in case of alt sku existence
      Specified by:
      setEnableDefaultSkuInInventory in interface Product
    • getId

      public Long getId()
      Description copied from interface: Product
      The id of the Product.
      Specified by:
      getId in interface Indexable
      Specified by:
      getId in interface Product
      Returns:
      the id of the Product
    • setId

      public void setId(Long id)
      Description copied from interface: Product
      Sets the id of the Product.
      Specified by:
      setId in interface Product
      Parameters:
      id - - the id of the product
    • getName

      public String getName()
      Description copied from interface: Product
      Returns the name of the product that is used for display purposes.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getName in interface Product
      Returns:
      the name of the product
    • setName

      public void setName(String name)
      Description copied from interface: Product
      Sets the name of the product that is used for display purposes.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setName in interface Product
      Parameters:
      name - - the name of the Product
    • getDescription

      public String getDescription()
      Description copied from interface: Product
      Returns a brief description of the product that is used for display.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getDescription in interface Product
      Returns:
      a brief description of the product
    • setDescription

      public void setDescription(String description)
      Description copied from interface: Product
      Sets a brief description of the product that is used for display.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setDescription in interface Product
      Parameters:
      description - - a brief description of the product
    • getLongDescription

      public String getLongDescription()
      Description copied from interface: Product
      Returns a long description of the product that is used for display.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getLongDescription in interface Product
      Returns:
      a long description of the product
    • setLongDescription

      public void setLongDescription(String longDescription)
      Description copied from interface: Product
      Sets a long description of the product that is used for display.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setLongDescription in interface Product
      Parameters:
      longDescription - the long description
    • getActiveStartDate

      public Date getActiveStartDate()
      Description copied from interface: Product
      Returns the first date a product will be available that is used to determine whether to display the product.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getActiveStartDate in interface Product
      Returns:
      the first date the product will be available
    • setActiveStartDate

      public void setActiveStartDate(Date activeStartDate)
      Description copied from interface: Product
      Sets the first date a product will be available that is used to determine whether to display the product.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setActiveStartDate in interface Product
      Parameters:
      activeStartDate - - the first day the product is available
    • getActiveEndDate

      public Date getActiveEndDate()
      Description copied from interface: Product
      Returns the last date a product will be available that is used to determine whether to display the product.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getActiveEndDate in interface Product
      Returns:
      the last day the product is available
    • setActiveEndDate

      public void setActiveEndDate(Date activeEndDate)
      Description copied from interface: Product
      Sets the last date a product will be available that is used to determine whether to display the product.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setActiveEndDate in interface Product
      Parameters:
      activeEndDate - - the last day the product is available
    • isActive

      public boolean isActive()
      Description copied from interface: Product
      Returns a boolean that indicates if the product is currently active.

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      isActive in interface Product
      Specified by:
      isActive in interface Status
      Returns:
      a boolean indicates if the product is active.
    • getModel

      public String getModel()
      Description copied from interface: Product
      Returns the model number of the product
      Specified by:
      getModel in interface Product
      Returns:
      the model number
    • setModel

      public void setModel(String model)
      Description copied from interface: Product
      Sets the model number of the product
      Specified by:
      setModel in interface Product
    • getManufacturer

      public String getManufacturer()
      Description copied from interface: Product
      Returns the manufacture name for this product
      Specified by:
      getManufacturer in interface Product
      Returns:
      the manufacture name
    • setManufacturer

      public void setManufacturer(String manufacturer)
      Description copied from interface: Product
      Sets the manufacture for this product
      Specified by:
      setManufacturer in interface Product
    • hasRetailPrice

      public boolean hasRetailPrice()
      Description copied from interface: Product
      In most implementations, including the default Broadleaf demo store, if a product doesn't have a retail price, it can't be sold. This method returns true if in the current context, the product has a price. The current context may be different when accessed in an entperise context like one using PriceLists or MultiTentant.
      Specified by:
      hasRetailPrice in interface Product
      Returns:
    • getRetailPrice

      public Money getRetailPrice()
      Description copied from interface: Product
      Convenience method, references to defaultSku.retailPrice
      Specified by:
      getRetailPrice in interface Product
      Returns:
    • getSalePrice

      public Money getSalePrice()
      Description copied from interface: Product
      Convenience method, references defaultSku.salePrice
      Specified by:
      getSalePrice in interface Product
      Returns:
    • getRetailPriceInternal

      protected Money getRetailPriceInternal()
    • getSalePriceInternal

      protected Money getSalePriceInternal()
    • getPrice

      public Money getPrice()
      Description copied from interface: Product
      Convenience method, references defaultSku.price
      Specified by:
      getPrice in interface Product
      Returns:
    • isOnSale

      public boolean isOnSale()
      Description copied from interface: Product
      Convenience method, references defaultSku.onSale
      Specified by:
      isOnSale in interface Product
      Returns:
    • getMargin

      public Money getMargin()
      Description copied from interface: Product
      added just for convenience, references defaultSku.margin
      Specified by:
      getMargin in interface Product
      Returns:
    • getDefaultSku

      public Sku getDefaultSku()
      Description copied from interface: Product
      Gets the default Sku associated with this Product. A Product is required to have a default Sku which holds specific information about the Product like weight, dimensions, price, etc. Many of the Product attributes that have getters and setters on Product are actually pass-through to the default Sku.

      Products can also have multiple Skus associated with it that are represented by ProductOptions. For instance, a large, blue shirt. For more information on that relationship see Product.getAdditionalSkus().
      Specified by:
      getDefaultSku in interface Product
      Returns:
      the default Sku for this Product
    • setDefaultSku

      public void setDefaultSku(Sku defaultSku)
      Description copied from interface: Product
      Sets the default Sku for this Product

      Note: this operation is cascaded with CascadeType.ALL which saves from having to persist the Product in 2 operations: first persist the Sku and then take the merged Sku, set it as this Product's default Sku, and then persist this Product.
      Specified by:
      setDefaultSku in interface Product
      Parameters:
      defaultSku - - the Sku that should be the default for this Product
    • getExternalId

      public String getExternalId()
      Specified by:
      getExternalId in interface Product
    • getCanSellWithoutOptions

      public Boolean getCanSellWithoutOptions()
      Specified by:
      getCanSellWithoutOptions in interface Product
      Returns:
      whether or not the default sku can be used for a multi-sku product in the case that no product options are set. Defaults to false if not specified. Note that this only affects multi-sku products.
    • setCanSellWithoutOptions

      public void setCanSellWithoutOptions(Boolean canSellWithoutOptions)
      Description copied from interface: Product
      Sets whether or not the default sku can be sold in the case that no product options are specified. Note that this only affects multi-sku products.
      Specified by:
      setCanSellWithoutOptions in interface Product
    • getMetaTitle

      public String getMetaTitle()
      Description copied from interface: Product
      Gets the meta data title of the product
      Specified by:
      getMetaTitle in interface Product
      Returns:
    • setMetaTitle

      public void setMetaTitle(String metaTitle)
      Description copied from interface: Product
      Sets the meta data title of the product
      Specified by:
      setMetaTitle in interface Product
    • getMetaDescription

      public String getMetaDescription()
      Description copied from interface: Product
      Gets the meta data description of the product
      Specified by:
      getMetaDescription in interface Product
      Returns:
    • setMetaDescription

      public void setMetaDescription(String metaDescription)
      Description copied from interface: Product
      Sets the meta data description of the product
      Specified by:
      setMetaDescription in interface Product
    • getCanonicalUrl

      public String getCanonicalUrl()
      Description copied from interface: Product
      Gets the canonical URL of the product
      Specified by:
      getCanonicalUrl in interface Product
      Returns:
    • setCanonicalUrl

      public void setCanonicalUrl(String canonicalUrl)
      Description copied from interface: Product
      Sets the canonical URL of the product
      Specified by:
      setCanonicalUrl in interface Product
    • getPromoMessage

      public String getPromoMessage()
      Description copied from interface: Product
      Gets the promotional message for this Product. For instance, this could be a limited-time Product
      Specified by:
      getPromoMessage in interface Product
      Returns:
      the Product's promotional message
    • setPromoMessage

      public void setPromoMessage(String promoMessage)
      Description copied from interface: Product
      Sets the promotional message for this Product
      Specified by:
      setPromoMessage in interface Product
    • getAllSkus

      public List<Sku> getAllSkus()
      Description copied from interface: Product
      Returns all the Skus that are associated with this Product (including Product.getDefaultSku()) regardless of whether or not the Skus are active or not

      Note: in the event that the default Sku was added to the list of Product.getAdditionalSkus(), it is filtered out so that only a single instance of Product.getDefaultSku() is contained in the resulting list
      Specified by:
      getAllSkus in interface Product
      Returns:
      all the Skus associated to this Product
    • getAllSellableSkus

      public List<Sku> getAllSellableSkus()
      Description copied from interface: Product
      Returns all skus that are sellable. If the product `canSellWithoutOptions` is true, the `defaultSku` is included in the list. Otherwise, the `defaultSku` is ignored.
      Specified by:
      getAllSellableSkus in interface Product
      Returns:
      all the sellable Skus associated to this Product
    • getAllSkus

      protected List<Sku> getAllSkus(boolean includeDefaultSku)
    • getSkus

      @Deprecated public List<Sku> getSkus()
      Deprecated.
      Description copied from interface: Product
      Returns a list of Skus filtered by whether the Skus are active or not. This list does not contain the Product.getDefaultSku() and filters by Sku.isActive().
      Specified by:
      getSkus in interface Product
      Returns:
      a list of active Skus from Product.getAdditionalSkus() for this Product
    • getAdditionalSkus

      public List<Sku> getAdditionalSkus()
      Description copied from interface: Product
      Gets all the additional Skus associated with this Product. For instance, if this Product represented a T-shirt and you could pick the size of the T-shirt as a ProductOption (like "small", "medium", "large") this would return 3 Skus if you had different inventory or price constraints on each ProductOptionValue.

      This list does not take into account whether any of these additional Skus are active or not, nor does it contain the Product.getDefaultSku() for this Product. For this functionality, see Product.getSkus() and Product.getAllSkus(), respectively.
      Specified by:
      getAdditionalSkus in interface Product
      Returns:
      the additional Skus for this Product
    • setAdditionalSkus

      @Deprecated public void setAdditionalSkus(List<Sku> skus)
      Deprecated.
      Description copied from interface: Product
      Sets the additional Skus associated to this Product. These additional Skus should come from ProductOptionValues and are used in instance where you need to track inventory or change pricing on a per-option value basis.
      Specified by:
      setAdditionalSkus in interface Product
      Parameters:
      skus - - a List of Skus to associate with this Product, usually based off of ProductOptions
    • getDefaultCategory

      @Deprecated public Category getDefaultCategory()
      Deprecated.
      Description copied from interface: Product
      Returns the default Category this product is associated with. This method will delegate to Product.getCategory() by default, unless the "use.legacy.default.category.mode" property is set to true in the implementation's property file. If set to true, this method will use legacy behavior, which is to return the deprecated defaultCategory field.
      Specified by:
      getDefaultCategory in interface Product
    • setDefaultCategory

      @Deprecated public void setDefaultCategory(Category defaultCategory)
      Deprecated.
      Description copied from interface: Product
      Sets the default Category to associate this product with. This method will delegate to Product.setCategory(Category) by default, unless the "use.legacy.default.category.mode" property is set to true in the implementation's property file. If set to true, this method will use legacy behavior, which is to set the deprecated defaultCategory field.
      Specified by:
      setDefaultCategory in interface Product
      Parameters:
      defaultCategory - - the default Category to associate this product with
    • getCategory

      public Category getCategory()
      Description copied from interface: Product
      Return the Category that contains this product
      Specified by:
      getCategory in interface Product
      Returns:
    • setCategory

      public void setCategory(Category category)
      Description copied from interface: Product
      Set the Category that contains this product
      Specified by:
      setCategory in interface Product
    • getMedia

      public Map<String,Media> getMedia()
      Description copied from interface: Product
      Gets the media for this product. This serves as a pass-through to the Product.getDefaultSku() media
      Specified by:
      getMedia in interface Product
      Returns:
      the Media for the default Sku associated with this Product
      See Also:
    • setMedia

      public void setMedia(Map<String,Media> media)
      Description copied from interface: Product
      Gets the media for this product. This serves as a pass-through to the Product.getDefaultSku() media
      Specified by:
      setMedia in interface Product
      Parameters:
      media - Media map to set on the default Sku associated with this Product
      See Also:
    • getAllSkuMedia

      public Map<String,Media> getAllSkuMedia()
      Description copied from interface: Product
      Convenience method for returning all of the media associated with this Product by adding all the media in Product.getDefaultSku() as well as all the media in the Skus represented by Product.getAdditionalSkus()
      Specified by:
      getAllSkuMedia in interface Product
      Returns:
      all of the Media for all of the Skus for this Product
    • getAllParentCategoryXrefs

      public List<CategoryProductXref> getAllParentCategoryXrefs()
      Description copied from interface: Product
      Retrieve all the xref entities linking this product to parent categories
      Specified by:
      getAllParentCategoryXrefs in interface Product
    • setAllParentCategoryXrefs

      public void setAllParentCategoryXrefs(List<CategoryProductXref> allParentCategories)
      Description copied from interface: Product
      Set all the xref entities linking this product to parent categories
      Specified by:
      setAllParentCategoryXrefs in interface Product
    • getParentCategoryHierarchyIds

      public List<Long> getParentCategoryHierarchyIds()
      Description copied from interface: Product
      The specified PromotionMessages for this Product that will override the Offer's default PromotionMessage.
      Specified by:
      getParentCategoryHierarchyIds in interface Product
      Returns:
      the Category Ids for this Product's parent Category hierarchy
    • getAllParentCategoryIds

      public List<String> getAllParentCategoryIds()
      Description copied from interface: Product
      Returns all parent Category ids this product is associated with.
      Specified by:
      getAllParentCategoryIds in interface Product
      Returns:
      the all parent category ids for this product
    • getAllParentCategories

      @Deprecated public List<Category> getAllParentCategories()
      Deprecated.
      Description copied from interface: Product
      Returns all parent Category(s) this product is associated with.
      Specified by:
      getAllParentCategories in interface Product
      Returns:
      the all parent categories for this product
    • setAllParentCategories

      @Deprecated public void setAllParentCategories(List<Category> allParentCategories)
      Deprecated.
      Description copied from interface: Product
      Sets all parent Categorys this product is associated with.
      Specified by:
      setAllParentCategories in interface Product
      Parameters:
      allParentCategories - - a List of all parent Category(s) to associate this product with
    • getDimension

      public Dimension getDimension()
      Description copied from interface: Product
      Returns the Dimension for this product

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getDimension in interface Product
      Returns:
      a ProductDimensions object
    • setDimension

      public void setDimension(Dimension dimension)
      Description copied from interface: Product
      Sets the Dimension for this product

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setDimension in interface Product
    • getWidth

      public BigDecimal getWidth()
      Description copied from interface: Product
      Returns the dimension width

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getWidth in interface Product
      Returns:
      width dimension of the product
    • setWidth

      public void setWidth(BigDecimal width)
      Description copied from interface: Product
      Sets the dimension width

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setWidth in interface Product
    • getHeight

      public BigDecimal getHeight()
      Description copied from interface: Product
      Returns the dimension height

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getHeight in interface Product
      Returns:
      height dimension of the product
    • setHeight

      public void setHeight(BigDecimal height)
      Description copied from interface: Product
      Sets the dimension height

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setHeight in interface Product
    • getDepth

      public BigDecimal getDepth()
      Description copied from interface: Product
      Returns the dimension depth

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getDepth in interface Product
      Returns:
      width depth of the product
    • setDepth

      public void setDepth(BigDecimal depth)
      Description copied from interface: Product
      Sets the dimension depth

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setDepth in interface Product
    • getGirth

      public BigDecimal getGirth()
      Description copied from interface: Product
      Gets the dimension girth

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getGirth in interface Product
      Returns:
      the dimension girth
    • setGirth

      public void setGirth(BigDecimal girth)
      Description copied from interface: Product
      Sets the dimension girth

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setGirth in interface Product
    • getSize

      public ContainerSizeType getSize()
      Description copied from interface: Product
      Returns the dimension container size



      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()

      Specified by:
      getSize in interface Product
      Returns:
      dimension container size
    • setSize

      public void setSize(ContainerSizeType size)
      Description copied from interface: Product
      Sets the dimension container size

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setSize in interface Product
    • getContainer

      public ContainerShapeType getContainer()
      Description copied from interface: Product
      Gets the dimension container shape

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getContainer in interface Product
      Returns:
      dimension container shape
    • setContainer

      public void setContainer(ContainerShapeType container)
      Description copied from interface: Product
      Sets the dimension container shape

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setContainer in interface Product
    • getDimensionString

      public String getDimensionString()
      Description copied from interface: Product
      Returns a String representation of the dimension

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getDimensionString in interface Product
      Returns:
      a dimension String
    • getWeight

      public Weight getWeight()
      Description copied from interface: Product
      Returns the weight of the product

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      getWeight in interface Product
      Returns:
      weight of product
    • setWeight

      public void setWeight(Weight weight)
      Description copied from interface: Product
      Sets the product weight

      Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
      Specified by:
      setWeight in interface Product
    • getCrossSaleProducts

      public List<RelatedProduct> getCrossSaleProducts()
      Description copied from interface: Product
      Returns a List of this product's related Cross Sales
      Specified by:
      getCrossSaleProducts in interface Product
      Returns:
    • setCrossSaleProducts

      public void setCrossSaleProducts(List<RelatedProduct> crossSaleProducts)
      Description copied from interface: Product
      Sets the related Cross Sales
      Specified by:
      setCrossSaleProducts in interface Product
    • getUpSaleProducts

      public List<RelatedProduct> getUpSaleProducts()
      Description copied from interface: Product
      Returns a List of this product's related Up Sales
      Specified by:
      getUpSaleProducts in interface Product
      Returns:
    • setUpSaleProducts

      public void setUpSaleProducts(List<RelatedProduct> upSaleProducts)
      Description copied from interface: Product
      Sets the related Up Sales
      Specified by:
      setUpSaleProducts in interface Product
    • getCumulativeCrossSaleProducts

      public List<RelatedProduct> getCumulativeCrossSaleProducts()
      Description copied from interface: Product
      Returns a list of the cross sale products for this product as well all cross sale products in all parent categories of this product.
      Specified by:
      getCumulativeCrossSaleProducts in interface Product
      Returns:
      the cumulative cross sale products
    • getCumulativeUpSaleProducts

      public List<RelatedProduct> getCumulativeUpSaleProducts()
      Description copied from interface: Product
      Returns a list of the upsale products for this product as well as all upsale products in all parent categories of this product.
      Specified by:
      getCumulativeUpSaleProducts in interface Product
      Returns:
      the cumulative upsale products
    • getProductAttributes

      @Deprecated public Map<String,ProductAttribute> getProductAttributes()
      Deprecated.
      Description copied from interface: Product
      Generic key-value pair of attributes to associate to this Product for maximum extensibility.
      Specified by:
      getProductAttributes in interface Product
      Returns:
      the attributes for this Product
    • setProductAttributes

      public void setProductAttributes(Map<String,ProductAttribute> productAttributes)
      Description copied from interface: Product
      Sets a generic list of key-value pairs for Product
      Specified by:
      setProductAttributes in interface Product
    • getMultiValueProductAttributes

      public Map<String,ProductAttribute> getMultiValueProductAttributes()
      Specified by:
      getMultiValueProductAttributes in interface Product
    • getProductOptionXrefs

      public List<ProductOptionXref> getProductOptionXrefs()
      Specified by:
      getProductOptionXrefs in interface Product
    • setProductOptionXrefs

      public void setProductOptionXrefs(List<ProductOptionXref> productOptions)
      Specified by:
      setProductOptionXrefs in interface Product
    • getProductOptions

      public List<ProductOption> getProductOptions()
      Description copied from interface: Product
      The available ProductOptions for this Product. For instance, if this Product is a T-Shirt, you might be able to specify a size and color. This would be modeled by 2 ProductOptions, each that could have multiple ProductOptionValues (which could be "small" "medium" "large", "blue", "yellow", "green"). For specific pricing or inventory needs on a per-value basis, multiple Skus can be associated to this Product based off of the ProductOptionValues
      Specified by:
      getProductOptions in interface Product
      Returns:
      the ProductOptions for this Product
    • setProductOptions

      public void setProductOptions(List<ProductOption> productOptions)
      Description copied from interface: Product
      Sets the list of available ProductOptions for this Product
      Specified by:
      setProductOptions in interface Product
    • getUrl

      public String getUrl()
      Description copied from interface: Product
      A product can have a designated URL. When set, the ProductHandlerMapping will check for this URL and forward this user to the Product.getDisplayTemplate().

      Alternatively, most sites will rely on the Product.getGeneratedUrl() to define the url for a product page.

      Specified by:
      getUrl in interface Product
      Returns:
      See Also:
      • org.broadleafcommerce.core.web.catalog.ProductHandlerMapping
    • setUrl

      public void setUrl(String url)
      Description copied from interface: Product
      Sets the URL that a customer could type in to reach this product.
      Specified by:
      setUrl in interface Product
    • getOverrideGeneratedUrl

      public Boolean getOverrideGeneratedUrl()
      Specified by:
      getOverrideGeneratedUrl in interface Product
      Returns:
      the flag for whether or not the URL should not be generated in the admin
    • setOverrideGeneratedUrl

      public void setOverrideGeneratedUrl(Boolean overrideGeneratedUrl)
      Description copied from interface: Product
      Sets the flag for whether or not the URL should not be generated in the admin
      Specified by:
      setOverrideGeneratedUrl in interface Product
    • getDisplayTemplate

      public String getDisplayTemplate()
      Description copied from interface: Product
      Returns the name of a display template that is used to render this product. Most implementations have a default template for all products. This allows for the user to define a specific template to be used by this product.
      Specified by:
      getDisplayTemplate in interface Product
      Specified by:
      getDisplayTemplate in interface TemplatePathContainer
    • setDisplayTemplate

      public void setDisplayTemplate(String displayTemplate)
      Description copied from interface: Product
      Sets the name of a display template that is used to render this product. Most implementations have a default template for all products. This allows for the user to define a specific template to be used by this product.
      Specified by:
      setDisplayTemplate in interface Product
    • getArchived

      public Character getArchived()
      Specified by:
      getArchived in interface Status
    • setArchived

      public void setArchived(Character archived)
      Specified by:
      setArchived in interface Status
    • getProductOptionValuesMap

      public Map<String,Set<String>> getProductOptionValuesMap()
      Description copied from interface: Product
      Returns a Map of product option values, keyed by the product option name. E.g. "color":["red","green","black"]
      Specified by:
      getProductOptionValuesMap in interface Product
      Returns:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getUrlKey

      public String getUrlKey()
      Description copied from interface: Product
      Sets a url-fragment. By default, the system will attempt to create a unique url-fragment for this product by taking the {@link Product.getName()} and removing special characters and replacing dashes with spaces.
      Specified by:
      getUrlKey in interface Product
    • setUrlKey

      public void setUrlKey(String urlKey)
      Description copied from interface: Product
      Sets a url-fragment to be used with this product. By default, the system will attempt to create a unique url-fragment for this product by taking the {@link Product.getName()} and removing special characters and replacing dashes with spaces.
      Specified by:
      setUrlKey in interface Product
    • getGeneratedUrl

      public String getGeneratedUrl()
      Description copied from interface: Product
      Generates a URL that can be used to access the product. Builds the url by combining the url of the default category with the getUrlKey() of this product.
      Specified by:
      getGeneratedUrl in interface Product
    • clearDynamicPrices

      public void clearDynamicPrices()
      Description copied from interface: Product
      Removes any currently stored dynamic pricing
      Specified by:
      clearDynamicPrices in interface Product
    • getMainEntityName

      public String getMainEntityName()
      Specified by:
      getMainEntityName in interface AdminMainEntity
    • createOrRetrieveCopyInstance

      public <G extends Product> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
      Specified by:
      createOrRetrieveCopyInstance in interface MultiTenantCloneable<Product>
      Throws:
      CloneNotSupportedException
    • getTaxCode

      public String getTaxCode()
      Description copied from interface: Product
      Returns the tax code of the product. If the tax code is null, then returns the tax code of this products category.
      Specified by:
      getTaxCode in interface Product
      Returns:
      taxCode
    • setTaxCode

      public void setTaxCode(String taxCode)
      Description copied from interface: Product
      Sets the tax code for this product.
      Specified by:
      setTaxCode in interface Product
    • getLocation

      public String getLocation()
      Specified by:
      getLocation in interface Locatable
    • getFieldEntityType

      public FieldEntity getFieldEntityType()
      Description copied from interface: Indexable
      Which type of Field should be queried for when looking up database-driven search fields to store in the search index
      Specified by:
      getFieldEntityType in interface Indexable
      See Also: