org.broadleafcommerce.core.catalog.domain
Class ProductImpl

java.lang.Object
  extended by org.broadleafcommerce.core.catalog.domain.ProductImpl
All Implemented Interfaces:
Serializable, Status, Product
Direct Known Subclasses:
ProductBundleImpl

@Entity
public class ProductImpl
extends Object
implements Product, Status

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:
Product}, {@link SkuImpl}, {@link CategoryImpl}, Serialized Form

Field Summary
protected  List<Sku> additionalSkus
          The all skus.
protected  List<Category> allParentCategories
           
protected  ArchiveStatus archiveStatus
           
protected  Boolean canSellWithoutOptions
           
protected  List<RelatedProduct> crossSaleProducts
           
protected  Category defaultCategory
          The default category.
protected  Sku defaultSku
           
protected  String displayTemplate
           
protected  Long id
          The id.
protected  Boolean isFeaturedProduct
           
protected  String manufacturer
          The manufacture name
protected  String model
          The product model number
protected  List<ProductAttribute> productAttributes
           
protected  List<ProductOption> productOptions
           
protected  String promoMessage
           
protected  List<Sku> skus
          The skus.
protected  List<RelatedProduct> upSaleProducts
           
protected  String url
           
protected  String urlKey
           
 
Constructor Summary
ProductImpl()
           
 
Method Summary
 boolean equals(Object obj)
           
 Date getActiveEndDate()
          Returns the last date a product will be available that is used to determine whether to display the product.
 Date getActiveStartDate()
          Returns the first date a product will be available that is used to determine whether to display the product.
 List<Sku> getAdditionalSkus()
          Gets all the additional Skus associated with this Product.
 List<Category> getAllParentCategories()
          Returns all parent Category(s) this product is associated with.
 Map<String,Media> getAllSkuMedia()
          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()
 List<Sku> getAllSkus()
          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
 Character getArchived()
           
 Boolean getCanSellWithoutOptions()
           
 ContainerShapeType getContainer()
          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()
 List<RelatedProduct> getCrossSaleProducts()
          Returns a List of this product's related Cross Sales
 List<RelatedProduct> getCumulativeCrossSaleProducts()
          Returns a list of the cross sale products for this product as well all cross sale products in all parent categories of this product.
 List<RelatedProduct> getCumulativeUpSaleProducts()
          Returns a list of the upsale products for this product as well as all upsale products in all parent categories of this product.
 Category getDefaultCategory()
          Returns the default Category this product is associated with.
 Sku getDefaultSku()
          Gets the default Sku associated with this Product.
 BigDecimal getDepth()
          Returns the dimension depth

Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
 String getDescription()
          Returns a brief description of the product that is used for display.
 Dimension getDimension()
          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()
 String getDimensionString()
          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()
 String getDisplayTemplate()
          Returns the name of a display template that is used to render this product.
 String getGeneratedUrl()
          Generates a URL that can be used to access the product.
 BigDecimal getGirth()
          Gets the dimension girth

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

Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
 Long getId()
          The id of the Product.
 String getLongDescription()
          Returns a long description of the product that is used for display.
 String getManufacturer()
          Returns the manufacture name for this product
 Map<String,ProductAttribute> getMappedProductAttributes()
           
 Map<String,Media> getMedia()
          Gets the media for this product.
 String getModel()
          Returns the model number of the product
 String getName()
          Returns the name of the product that is used for display purposes.
 ProductAttribute getProductAttributeByName(String name)
          Looks at all ProductAttributes for this product and returns the attribute that matches the given name
 List<ProductAttribute> getProductAttributes()
          Generic key-value pair of attributes to associate to this Product for maximum extensibility.
 List<ProductOption> getProductOptions()
          The available ProductOptions for this Product.
 String getPromoMessage()
          Gets the promotional message for this Product.
 ContainerSizeType getSize()
          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()
 List<Sku> getSkus()
          Returns a list of Skus filtered by whether the Skus are active or not.
 List<RelatedProduct> getUpSaleProducts()
          Returns a List of this product's related Up Sales
 String getUrl()
          A product can have a designated URL.
 String getUrlKey()
          Sets a url-fragment.
 Weight getWeight()
          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()
 BigDecimal getWidth()
          Returns the dimension width

Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
 int hashCode()
           
 boolean isActive()
          Returns a boolean that indicates if the product is currently active.
 boolean isFeaturedProduct()
          Returns whether or not the product is featured
 void setActiveEndDate(Date activeEndDate)
          Sets the last date a product will be available that is used to determine whether to display the product.
 void setActiveStartDate(Date activeStartDate)
          Sets the first date a product will be available that is used to determine whether to display the product.
 void setAdditionalSkus(List<Sku> skus)
          Sets the additional Skus associated to this Product.
 void setAllParentCategories(List<Category> allParentCategories)
          Sets all parent Categorys this product is associated with.
 void setArchived(Character archived)
           
 void setCanSellWithoutOptions(Boolean canSellWithoutOptions)
          Sets whether or not the default sku can be sold in the case that no product options are specified.
 void setContainer(ContainerShapeType container)
          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()
 void setCrossSaleProducts(List<RelatedProduct> crossSaleProducts)
          Sets the related Cross Sales
 void setDefaultCategory(Category defaultCategory)
          Sets the default Category to associate this product with.
 void setDefaultSku(Sku defaultSku)
          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.
 void setDepth(BigDecimal depth)
          Sets the dimension depth

Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
 void setDescription(String description)
          Sets a brief description of the product that is used for display.
 void setDimension(Dimension dimension)
          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()
 void setDisplayTemplate(String displayTemplate)
          Sets the name of a display template that is used to render this product.
 void setFeaturedProduct(boolean isFeaturedProduct)
          Sets whether or not the product is featured
 void setGirth(BigDecimal girth)
          Sets the dimension girth

Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
 void setHeight(BigDecimal height)
          Sets the dimension height

Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
 void setId(Long id)
          Sets the id of the Product.
 void setLongDescription(String longDescription)
          Sets a long description of the product that is used for display.
 void setManufacturer(String manufacturer)
          Sets the manufacture for this product
 void setMedia(Map<String,Media> media)
          Gets the media for this product.
 void setModel(String model)
          Sets the model number of the product
 void setName(String name)
          Sets the name of the product that is used for display purposes.
 void setProductAttributes(List<ProductAttribute> productAttributes)
          Sets a generic list of key-value pairs for Product
 void setProductOptions(List<ProductOption> productOptions)
          Sets the list of available ProductOptions for this Product
 void setPromoMessage(String promoMessage)
          Sets the promotional message for this Product
 void setSize(ContainerSizeType size)
          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()
 void setUpSaleProducts(List<RelatedProduct> upSaleProducts)
          Sets the related Up Sales
 void setUrl(String url)
          Sets the URL that a customer could type in to reach this product.
 void setUrlKey(String urlKey)
          Sets a url-fragment to be used with this product.
 void setWeight(Weight weight)
          Sets the product weight

Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
 void setWidth(BigDecimal width)
          Sets the dimension width

Note: this is a convenience method that merely serves as a pass-through to the same method via Product.getDefaultSku()
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected Long id
The id.


url

protected String url

urlKey

protected String urlKey

displayTemplate

protected String displayTemplate

model

protected String model
The product model number


manufacturer

protected String manufacturer
The manufacture name


isFeaturedProduct

protected Boolean isFeaturedProduct

defaultSku

protected Sku defaultSku

canSellWithoutOptions

protected Boolean canSellWithoutOptions

skus

protected List<Sku> skus
The skus.


promoMessage

protected String promoMessage

crossSaleProducts

protected List<RelatedProduct> crossSaleProducts

upSaleProducts

protected List<RelatedProduct> upSaleProducts

additionalSkus

protected List<Sku> additionalSkus
The all skus.


defaultCategory

protected Category defaultCategory
The default category.


allParentCategories

protected List<Category> allParentCategories

productAttributes

protected List<ProductAttribute> productAttributes

productOptions

protected List<ProductOption> productOptions

archiveStatus

protected ArchiveStatus archiveStatus
Constructor Detail

ProductImpl

public ProductImpl()
Method Detail

getId

public Long getId()
Description copied from interface: Product
The id of the Product.

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 Status
Specified by:
isActive in interface Product
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

isFeaturedProduct

public boolean isFeaturedProduct()
Description copied from interface: Product
Returns whether or not the product is featured

Specified by:
isFeaturedProduct in interface Product
Returns:
isFeaturedProduct as Boolean

setFeaturedProduct

public void setFeaturedProduct(boolean isFeaturedProduct)
Description copied from interface: Product
Sets whether or not the product is featured

Specified by:
setFeaturedProduct in interface Product

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

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

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

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

getSkus

public List<Sku> getSkus()
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
See Also:
ProductOption}, {@link ProductOptionValue}

setAdditionalSkus

public void setAdditionalSkus(List<Sku> skus)
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
See Also:
#getAdditionalSkus()}, {@link ProductOption}, {@link ProductOptionValue}

getDefaultCategory

public Category getDefaultCategory()
Description copied from interface: Product
Returns the default Category this product is associated with.

Specified by:
getDefaultCategory 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:
Sku

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:
Sku

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

setDefaultCategory

public void setDefaultCategory(Category defaultCategory)
Description copied from interface: Product
Sets the default Category to associate this product with.

Specified by:
setDefaultCategory in interface Product
Parameters:
defaultCategory - - the default Category to associate this product with

getAllParentCategories

public List<Category> getAllParentCategories()
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

public void setAllParentCategories(List<Category> allParentCategories)
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

public List<ProductAttribute> getProductAttributes()
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(List<ProductAttribute> productAttributes)
Description copied from interface: Product
Sets a generic list of key-value pairs for Product

Specified by:
setProductAttributes 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
See Also:
Product#getAdditionalSkus(), {@link ProductOption}, {@link ProductOptionValue}

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

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
Returns:

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

getProductAttributeByName

public ProductAttribute getProductAttributeByName(String name)
Description copied from interface: Product
Looks at all ProductAttributes for this product and returns the attribute that matches the given name

Specified by:
getProductAttributeByName in interface Product
Parameters:
name - the name of the attribute
Returns:
the matching ProductAttribute (null if no match)

getMappedProductAttributes

public Map<String,ProductAttribute> getMappedProductAttributes()
Specified by:
getMappedProductAttributes in interface Product
Returns:
a Map of all the product attributes on this product keyed by the attribute name

getArchived

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

setArchived

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

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 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 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


Copyright © 2012. All Rights Reserved.