public interface Product
Product
interface reflects resources that represent products and
their variants in an e-commerce system.
Products have properties. Properties which drive product variation are known as
"variant axes". Note that this does not include properties which change as a
result of variation, such as "shipping-weight" or "price".
Each product variation must have a unique resource. Hierarchy above those leaf
resources may or may not be present, depending on the PIM architecture, but if
present should also be modelled by the Product interface.Modifier and Type | Field and Description |
---|---|
static String |
RESOURCE_TYPE_PRODUCT
Base resource type for products.
|
Modifier and Type | Method and Description |
---|---|
boolean |
axisIsVariant(String axis)
Tests a single axis (property) for variation.
|
Product |
getBaseProduct()
Returns the product which forms the base of a set of variations.
|
String |
getDescription()
Returns the product's description.
|
ImageResource |
getImage()
Get the primary image for this product, or
null if no image was found. |
String |
getImagePath()
Deprecated.
since 5.6.1; use
getImage() instead. |
List<ImageResource> |
getImages()
Get all the images for this product.
|
String |
getImageUrl()
Deprecated.
since 5.6.1; use
getImage() instead. |
String |
getPagePath()
Get the path of the parent page which renders the product/variation.
|
String |
getPath()
Get the underlying resource's path.
|
Product |
getPIMProduct()
Returns the PIM Product (under /etc/commerce/products) which stores this product's
data.
|
<T> T |
getProperty(String name,
Class<T> type)
Returns a product property.
|
String |
getSKU()
Get a unique identifier for a product variation.
|
ImageResource |
getThumbnail()
Get a thumbnail for this product, or
null if no thumbnail was found. |
String |
getThumbnailUrl()
Deprecated.
since 5.6.1; use
getThumbnail() instead. |
String |
getThumbnailUrl(int width)
Deprecated.
since 5.6.1; use
getThumbnail() instead. |
String |
getTitle()
Returns the product's title.
|
Iterator<String> |
getVariantAxes()
Returns an iterator over the property names of the variant axes.
|
Iterator<Product> |
getVariants()
Returns an iterator over the list of all product variations to which this
particular product/variant belongs.
|
Iterator<Product> |
getVariants(VariantFilter filter)
Returns an iterator over the list of product variants for this product filtered by
the
VariantFilter . |
static final String RESOURCE_TYPE_PRODUCT
String getPath()
String getPagePath()
String getSKU()
String getTitle()
String getDescription()
@Deprecated String getImageUrl()
getImage()
instead.@Deprecated String getImagePath()
getImage()
instead.@Deprecated String getThumbnailUrl()
getThumbnail()
instead.@Deprecated String getThumbnailUrl(int width)
getThumbnail()
instead.ImageResource getImage()
null
if no image was found.List<ImageResource> getImages()
ImageResource getThumbnail()
null
if no thumbnail was found.Iterator<String> getVariantAxes()
["color", "size"]
.boolean axisIsVariant(String axis)
axis
- The name of the propertytrue
if the given axis is variantIterator<Product> getVariants() throws CommerceException
coat/ coat-blue/ coat-blue-S coat-blue-M coat-green/ coat-green-Sit must return
[coat-blue-S, coat-blue-M, coat-green-S]
whether called
from the Product
representing coat
or coat-green-S
.CommerceException
Iterator<Product> getVariants(VariantFilter filter) throws CommerceException
VariantFilter
.
Example usages:
To get the complete list of sizes, irrespective of color:
Iteratoriter = product.getVariants(new EnumerateAxisFilter("size"));
To get the list of sub-variants of the color "blue":
Iteratoriter = product.getVariants(new AxisFilter("color", "blue"));
CommerceException
VariantFilter
,
EnumerateAxisFilter
,
AxisFilter
Product getBaseProduct() throws CommerceException
Product
which is already the base, will return this
.Product
CommerceException
Product getPIMProduct() throws CommerceException
Product
CommerceException
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"