|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Product
Implementations of this interface are used to hold data for a 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.
You should implement this class if you want to make significant changes to how the
Product is persisted. If you just want to add additional fields then you should extend ProductImpl.
ProductImpl},{@link Sku}, {@link Category}| Method Summary | |
|---|---|
void |
clearDynamicPrices()
Removes any currently stored dynamic pricing |
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 getDefaultSku() as well as all the media in the Skus represented by
getAdditionalSkus() |
List<Sku> |
getAllSkus()
Returns all the Skus that are associated with this Product (including 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 getAdditionalSkus(), it is filtered out
so that only a single instance of getDefaultSku() is contained in the resulting list |
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 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 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 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 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 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 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 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 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 getDefaultSku() |
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 |
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 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 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 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 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 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 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 url)
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 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 getDefaultSku() |
| Method Detail |
|---|
Long getId()
void setId(Long id)
id - - the id of the productString getName()
getDefaultSku()
void setName(String name)
getDefaultSku()
name - - the name of the ProductString getDescription()
getDefaultSku()
void setDescription(String description)
getDefaultSku()
description - - a brief description of the productString getLongDescription()
getDefaultSku()
void setLongDescription(String longDescription)
getDefaultSku()
longDescription - the long descriptionDate getActiveStartDate()
getDefaultSku()
void setActiveStartDate(Date activeStartDate)
getDefaultSku()
activeStartDate - - the first day the product is availableDate getActiveEndDate()
getDefaultSku()
void setActiveEndDate(Date activeEndDate)
getDefaultSku()
activeEndDate - - the last day the product is availableboolean isActive()
getDefaultSku()
Sku getDefaultSku()
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.
ProductOptions. For instance, a large, blue shirt. For more information on
that relationship see getAdditionalSkus().
void setDefaultSku(Sku defaultSku)
defaultSku - - the Sku that should be the default for this ProductBoolean getCanSellWithoutOptions()
void setCanSellWithoutOptions(Boolean canSellWithoutOptions)
canSellWithoutOptions - List<Sku> getSkus()
Skus filtered by whether the Skus are active or not.
This list does not contain the getDefaultSku() and filters by Sku.isActive().
getAdditionalSkus() for this ProductList<Sku> getAdditionalSkus()
ProductOption (like "small", "medium", "large") this would return 3 Skus
if you had different inventory or price constraints on each ProductOptionValue.
getDefaultSku() for this Product. For this functionality, see
getSkus() and getAllSkus(), respectively.
ProductOption}, {@link ProductOptionValue}void setAdditionalSkus(List<Sku> skus)
ProductOptionValues and are used in instance where you need to track inventory
or change pricing on a per-option value basis.
skus - - a List of Skus to associate with this Product, usually based off of ProductOptions#getAdditionalSkus()}, {@link ProductOption}, {@link ProductOptionValue}List<Sku> getAllSkus()
Skus that are associated with this Product (including getDefaultSku())
regardless of whether or not the Skus are active or not
getAdditionalSkus(), it is filtered out
so that only a single instance of getDefaultSku() is contained in the resulting list
Map<String,Media> getMedia()
getDefaultSku() media
Skuvoid setMedia(Map<String,Media> media)
getDefaultSku() media
media - Media map to set on the default Sku associated with this ProductSkuMap<String,Media> getAllSkuMedia()
getDefaultSku() as well as all the media in the Skus represented by
getAdditionalSkus()
List<Category> getAllParentCategories()
Category(s) this product is associated with.
void setAllParentCategories(List<Category> allParentCategories)
Categorys this product is associated with.
allParentCategories - - a List of all parent Category(s) to associate this product withCategory getDefaultCategory()
Category this product is associated with.
void setDefaultCategory(Category defaultCategory)
Category to associate this product with.
defaultCategory - - the default Category to associate this product withString getModel()
void setModel(String model)
model - String getManufacturer()
void setManufacturer(String manufacturer)
manufacturer - Dimension getDimension()
Dimension for this product
getDefaultSku()
void setDimension(Dimension dimension)
Dimension for this product
getDefaultSku()
dimension - BigDecimal getWidth()
getDefaultSku()
void setWidth(BigDecimal width)
getDefaultSku()
width - BigDecimal getHeight()
getDefaultSku()
void setHeight(BigDecimal height)
getDefaultSku()
height - BigDecimal getDepth()
getDefaultSku()
void setDepth(BigDecimal depth)
getDefaultSku()
depth - BigDecimal getGirth()
getDefaultSku()
void setGirth(BigDecimal girth)
getDefaultSku()
girth - ContainerSizeType getSize()
getDefaultSku()
void setSize(ContainerSizeType size)
getDefaultSku()
size - ContainerShapeType getContainer()
getDefaultSku()
void setContainer(ContainerShapeType container)
getDefaultSku()
container - String getDimensionString()
getDefaultSku()
Weight getWeight()
getDefaultSku()
void setWeight(Weight weight)
getDefaultSku()
weight - List<RelatedProduct> getCrossSaleProducts()
void setCrossSaleProducts(List<RelatedProduct> crossSaleProducts)
crossSaleProducts - List<RelatedProduct> getUpSaleProducts()
void setUpSaleProducts(List<RelatedProduct> upSaleProducts)
upSaleProducts - boolean isFeaturedProduct()
void setFeaturedProduct(boolean isFeaturedProduct)
isFeaturedProduct - List<ProductAttribute> getProductAttributes()
void setProductAttributes(List<ProductAttribute> productAttributes)
productAttributes - String getPromoMessage()
void setPromoMessage(String promoMessage)
promoMessage - List<ProductOption> getProductOptions()
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
ProductOptions for this ProductProduct#getAdditionalSkus(), {@link ProductOption}, {@link ProductOptionValue}void setProductOptions(List<ProductOption> productOptions)
productOptions - String getUrl()
getDisplayTemplate().
Alternatively, most sites will rely on the getGeneratedUrl() to define the
url for a product page.
org.broadleafcommerce.core.web.catalog.ProductHandlerMappingvoid setUrl(String url)
url - String getUrlKey()
Product.getName() and removing special characters and replacing
dashes with spaces.
void setUrlKey(String url)
Product.getName() and removing special characters and replacing
dashes with spaces.
String getDisplayTemplate()
void setDisplayTemplate(String displayTemplate)
displayTemplate - String getGeneratedUrl()
ProductAttribute getProductAttributeByName(String name)
name - the name of the attribute
Map<String,ProductAttribute> getMappedProductAttributes()
List<RelatedProduct> getCumulativeCrossSaleProducts()
List<RelatedProduct> getCumulativeUpSaleProducts()
void clearDynamicPrices()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||