@Entity public class ProductImpl extends Object implements Product, Status, AdminMainEntity, Locatable
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. Product. Product}, {@link SkuImpl}, {@link CategoryImpl},
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
ProductImpl.Presentation |
| Modifier and Type | Field and Description |
|---|---|
protected List<Sku> |
additionalSkus |
protected List<CategoryProductXref> |
allParentCategoryXrefs |
protected ArchiveStatus |
archiveStatus |
protected Boolean |
canSellWithoutOptions |
protected List<RelatedProduct> |
crossSaleProducts |
protected Category |
defaultCategory |
protected Sku |
defaultSku |
protected String |
displayTemplate |
protected Long |
id
The id.
|
protected Boolean |
isFeaturedProduct |
protected String |
manufacturer |
protected String |
model |
protected Map<String,ProductAttribute> |
productAttributes |
protected List<ProductOptionXref> |
productOptions |
protected String |
promoMessage |
protected List<Sku> |
skus |
protected List<RelatedProduct> |
upSaleProducts |
protected String |
url |
protected String |
urlKey |
MAIN_ENTITY_NAME_PROPERTY| Constructor and Description |
|---|
ProductImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearDynamicPrices()
Removes any currently stored dynamic pricing
|
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()
Deprecated.
|
List<CategoryProductXref> |
getAllParentCategoryXrefs() |
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 |
getLocation() |
String |
getLongDescription()
Returns a long description of the product that is used for display.
|
String |
getMainEntityName() |
String |
getManufacturer()
Returns the manufacture name for this product
|
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.
|
Map<String,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. |
List<ProductOptionXref> |
getProductOptionXrefs() |
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. |
String |
getTaxCode()
Returns the tax code of the product.
|
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)
Deprecated.
|
void |
setAllParentCategoryXrefs(List<CategoryProductXref> allParentCategories) |
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(Map<String,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 |
setProductOptionXrefs(List<ProductOptionXref> productOptions) |
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 |
setTaxCode(String taxCode)
Sets the tax code for this product.
|
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() |
protected Long id
protected String url
protected String urlKey
protected String displayTemplate
protected String model
protected String manufacturer
protected Boolean isFeaturedProduct
protected Sku defaultSku
protected Boolean canSellWithoutOptions
protected String promoMessage
protected List<RelatedProduct> crossSaleProducts
protected List<RelatedProduct> upSaleProducts
protected Category defaultCategory
protected List<CategoryProductXref> allParentCategoryXrefs
protected Map<String,ProductAttribute> productAttributes
protected List<ProductOptionXref> productOptions
protected ArchiveStatus archiveStatus
public void setId(Long id)
Productpublic String getName()
ProductProduct.getDefaultSku()public void setName(String name)
ProductProduct.getDefaultSku()public String getDescription()
ProductProduct.getDefaultSku()getDescription in interface Productpublic void setDescription(String description)
ProductProduct.getDefaultSku()setDescription in interface Productdescription - - a brief description of the productpublic String getLongDescription()
ProductProduct.getDefaultSku()getLongDescription in interface Productpublic void setLongDescription(String longDescription)
ProductProduct.getDefaultSku()setLongDescription in interface ProductlongDescription - the long descriptionpublic Date getActiveStartDate()
ProductProduct.getDefaultSku()getActiveStartDate in interface Productpublic void setActiveStartDate(Date activeStartDate)
ProductProduct.getDefaultSku()setActiveStartDate in interface ProductactiveStartDate - - the first day the product is availablepublic Date getActiveEndDate()
ProductProduct.getDefaultSku()getActiveEndDate in interface Productpublic void setActiveEndDate(Date activeEndDate)
ProductProduct.getDefaultSku()setActiveEndDate in interface ProductactiveEndDate - - the last day the product is availablepublic boolean isActive()
ProductProduct.getDefaultSku()public String getModel()
Productpublic void setModel(String model)
Productpublic String getManufacturer()
ProductgetManufacturer in interface Productpublic void setManufacturer(String manufacturer)
ProductsetManufacturer in interface Productpublic boolean isFeaturedProduct()
ProductisFeaturedProduct in interface Productpublic void setFeaturedProduct(boolean isFeaturedProduct)
ProductsetFeaturedProduct in interface Productpublic Sku getDefaultSku()
ProductSku 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 Product.getAdditionalSkus().getDefaultSku in interface Productpublic Boolean getCanSellWithoutOptions()
getCanSellWithoutOptions in interface Productpublic void setCanSellWithoutOptions(Boolean canSellWithoutOptions)
ProductsetCanSellWithoutOptions in interface Productpublic void setDefaultSku(Sku defaultSku)
ProductsetDefaultSku in interface ProductdefaultSku - - the Sku that should be the default for this Productpublic String getPromoMessage()
ProductgetPromoMessage in interface Productpublic void setPromoMessage(String promoMessage)
ProductsetPromoMessage in interface Productpublic List<Sku> getAllSkus()
ProductSkus that are associated with this Product (including Product.getDefaultSku())
regardless of whether or not the Skus are active or not
Product.getAdditionalSkus(), it is filtered out
so that only a single instance of Product.getDefaultSku() is contained in the resulting listgetAllSkus in interface Productpublic List<Sku> getSkus()
ProductSkus filtered by whether the Skus are active or not.
This list does not contain the Product.getDefaultSku() and filters by Sku.isActive().getSkus in interface ProductProduct.getAdditionalSkus() for this Productpublic List<Sku> getAdditionalSkus()
ProductProductOption (like "small", "medium", "large") this would return 3 Skus
if you had different inventory or price constraints on each ProductOptionValue.
Product.getDefaultSku() for this Product. For this functionality, see
Product.getSkus() and Product.getAllSkus(), respectively.getAdditionalSkus in interface ProductProductOption}, {@link ProductOptionValue}public void setAdditionalSkus(List<Sku> skus)
ProductProductOptionValues and are used in instance where you need to track inventory
or change pricing on a per-option value basis.setAdditionalSkus in interface Productskus - - a List of Skus to associate with this Product, usually based off of ProductOptions#getAdditionalSkus()}, {@link ProductOption}, {@link ProductOptionValue}public Category getDefaultCategory()
ProductCategory this product is associated with.getDefaultCategory in interface Productpublic Map<String,Media> getMedia()
ProductProduct.getDefaultSku() mediapublic void setMedia(Map<String,Media> media)
ProductProduct.getDefaultSku() mediapublic Map<String,Media> getAllSkuMedia()
ProductProduct.getDefaultSku() as well as all the media in the Skus represented by
Product.getAdditionalSkus()getAllSkuMedia in interface Productpublic void setDefaultCategory(Category defaultCategory)
ProductCategory to associate this product with.setDefaultCategory in interface ProductdefaultCategory - - the default Category to associate this product withpublic List<CategoryProductXref> getAllParentCategoryXrefs()
getAllParentCategoryXrefs in interface Productpublic void setAllParentCategoryXrefs(List<CategoryProductXref> allParentCategories)
setAllParentCategoryXrefs in interface Product@Deprecated public List<Category> getAllParentCategories()
ProductCategory(s) this product is associated with.getAllParentCategories in interface Product@Deprecated public void setAllParentCategories(List<Category> allParentCategories)
ProductCategorys this product is associated with.setAllParentCategories in interface ProductallParentCategories - - a List of all parent Category(s) to associate this product withpublic Dimension getDimension()
ProductDimension for this product
Product.getDefaultSku()getDimension in interface Productpublic void setDimension(Dimension dimension)
ProductDimension for this product
Product.getDefaultSku()setDimension in interface Productpublic BigDecimal getWidth()
ProductProduct.getDefaultSku()public void setWidth(BigDecimal width)
ProductProduct.getDefaultSku()public BigDecimal getHeight()
ProductProduct.getDefaultSku()public void setHeight(BigDecimal height)
ProductProduct.getDefaultSku()public BigDecimal getDepth()
ProductProduct.getDefaultSku()public void setDepth(BigDecimal depth)
ProductProduct.getDefaultSku()public BigDecimal getGirth()
ProductProduct.getDefaultSku()public void setGirth(BigDecimal girth)
ProductProduct.getDefaultSku()public ContainerSizeType getSize()
ProductProduct.getDefaultSku()public void setSize(ContainerSizeType size)
ProductProduct.getDefaultSku()public ContainerShapeType getContainer()
ProductProduct.getDefaultSku()getContainer in interface Productpublic void setContainer(ContainerShapeType container)
ProductProduct.getDefaultSku()setContainer in interface Productpublic String getDimensionString()
ProductProduct.getDefaultSku()getDimensionString in interface Productpublic Weight getWeight()
ProductProduct.getDefaultSku()public void setWeight(Weight weight)
ProductProduct.getDefaultSku()public List<RelatedProduct> getCrossSaleProducts()
ProductgetCrossSaleProducts in interface Productpublic void setCrossSaleProducts(List<RelatedProduct> crossSaleProducts)
ProductsetCrossSaleProducts in interface Productpublic List<RelatedProduct> getUpSaleProducts()
ProductgetUpSaleProducts in interface Productpublic void setUpSaleProducts(List<RelatedProduct> upSaleProducts)
ProductsetUpSaleProducts in interface Productpublic List<RelatedProduct> getCumulativeCrossSaleProducts()
ProductgetCumulativeCrossSaleProducts in interface Productpublic List<RelatedProduct> getCumulativeUpSaleProducts()
ProductgetCumulativeUpSaleProducts in interface Productpublic Map<String,ProductAttribute> getProductAttributes()
ProductgetProductAttributes in interface Productpublic void setProductAttributes(Map<String,ProductAttribute> productAttributes)
ProductsetProductAttributes in interface Productpublic List<ProductOptionXref> getProductOptionXrefs()
getProductOptionXrefs in interface Productpublic void setProductOptionXrefs(List<ProductOptionXref> productOptions)
setProductOptionXrefs in interface Productpublic List<ProductOption> getProductOptions()
ProductProductOptions 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 ProductOptionValuesgetProductOptions in interface ProductProductOptions for this ProductProduct#getAdditionalSkus(), {@link ProductOption}, {@link ProductOptionValue}public void setProductOptions(List<ProductOption> productOptions)
ProductsetProductOptions in interface Productpublic String getUrl()
ProductProduct.getDisplayTemplate().
Alternatively, most sites will rely on the Product.getGeneratedUrl() to define the
url for a product page.public void setUrl(String url)
Productpublic String getDisplayTemplate()
ProductgetDisplayTemplate in interface Productpublic void setDisplayTemplate(String displayTemplate)
ProductsetDisplayTemplate in interface Productpublic Character getArchived()
getArchived in interface Statuspublic void setArchived(Character archived)
setArchived in interface Statuspublic String getUrlKey()
ProductProduct.getName() and removing special characters and replacing
dashes with spaces.public void setUrlKey(String urlKey)
ProductProduct.getName() and removing special characters and replacing
dashes with spaces.public String getGeneratedUrl()
ProductgetGeneratedUrl in interface Productpublic void clearDynamicPrices()
ProductclearDynamicPrices in interface Productpublic String getMainEntityName()
getMainEntityName in interface AdminMainEntitypublic String getTaxCode()
ProductgetTaxCode in interface Productpublic void setTaxCode(String taxCode)
ProductsetTaxCode in interface Productpublic String getLocation()
getLocation in interface LocatableCopyright © 2015. All Rights Reserved.