public interface ProductAssetManager
ProductAssetManager
provides methods to retrieve, update, create and update product assets.
A product asset is a resource in the repository and has properties that define its rendering, e.g. the path
to the referenced asset, the resource type to render it, a width, a height, ...Modifier and Type | Method and Description |
---|---|
Resource |
addAsset(Product product,
Map<String,Object> productAssetProperties)
Adds a product asset to the product.
|
Resource |
addAsset(Product product,
String assetReference)
Adds a product asset to the product.
|
Resource |
getAsset(Product product)
Returns the product asset that best represents the product.
|
List<Resource> |
getAssets(Product product)
Returns the product assets belonging to the product.
|
String |
getReferencedAsset(String productAssetPath)
Returns the path to the referenced asset.
|
String |
getThumbnailUrl(Product product,
String selectorString)
Returns the URL to the product's thumbnail image, based on the given selector string.
|
String |
getThumbnailUrl(String productAssetPath,
String selectorString)
Returns the URL to the product's thumbnail image, based on the given selector string.
|
boolean |
isSupportedAsset(String productAssetPath)
Indicates whether the product asset at path
productAssetPath is supported. |
boolean |
isSupportedReferencedAsset(String assetReference)
Indicates whether the asset referenced by
assetReference is supported. |
void |
removeAsset(String productAssetPath)
Removes the product asset.
|
Resource |
updateAsset(String productAssetPath,
Map<String,Object> productAssetProperties)
Updates the address.
|
Resource |
updateAsset(String productAssetPath,
String assetReference)
Updates the address.
|
boolean isSupportedReferencedAsset(String assetReference)
assetReference
is supported.assetReference
- the asset path in the repositorytrue
if the asset is supported, false
otherwiseboolean isSupportedAsset(String productAssetPath)
productAssetPath
is supported.productAssetPath
- the path of the product assettrue
if the product asset is supported, false
otherwiseString getReferencedAsset(String productAssetPath)
productAssetPath
- the path of the product assetResource getAsset(Product product)
product
- The productnull
if there is noneList<Resource> getAssets(Product product)
product
- The productnull
if there are noneString getThumbnailUrl(Product product, String selectorString)
product
- The productselectorString
- The selector stringnull
if there is noneString getThumbnailUrl(String productAssetPath, String selectorString)
productAssetPath
- The path to the product assetselectorString
- The selector stringnull
if there are noneResource addAsset(Product product, String assetReference) throws CommerceException
product
- The productassetReference
- The path to the referenced assetCommerceException
- when the operation fails.Resource addAsset(Product product, Map<String,Object> productAssetProperties) throws CommerceException
product
- The productproductAssetProperties
- The rendering properties of the product assetCommerceException
- when the operation fails.Resource updateAsset(String productAssetPath, String assetReference) throws CommerceException
productAssetPath
- The path of the product assetassetReference
- The path to the referenced assetCommerceException
- when the operation fails.Resource updateAsset(String productAssetPath, Map<String,Object> productAssetProperties) throws CommerceException
productAssetPath
- The path of the product assetproductAssetProperties
- The rendering properties of the product assetCommerceException
- when the operation fails.void removeAsset(String productAssetPath) throws CommerceException
productAssetPath
- The path of the product assetCommerceException
- when the operation fails."Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"