@ProviderType
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,
java.util.Map<java.lang.String,java.lang.Object> productAssetProperties)
Adds a product asset to the product.
|
Resource |
addAsset(Product product,
java.lang.String assetReference)
Adds a product asset to the product.
|
Resource |
getAsset(Product product)
Returns the product asset that best represents the product.
|
java.util.List<Resource> |
getAssets(Product product)
Returns the product assets belonging to the product.
|
java.lang.String |
getReferencedAsset(java.lang.String productAssetPath)
Returns the path to the referenced asset.
|
java.lang.String |
getThumbnailUrl(Product product,
java.lang.String selectorString)
Returns the URL to the product's thumbnail image, based on the given selector string.
|
java.lang.String |
getThumbnailUrl(java.lang.String productAssetPath,
java.lang.String selectorString)
Returns the URL to the product's thumbnail image, based on the given selector string.
|
boolean |
isSupportedAsset(java.lang.String productAssetPath)
Indicates whether the product asset at path
productAssetPath is supported. |
boolean |
isSupportedReferencedAsset(java.lang.String assetReference)
Indicates whether the asset referenced by
assetReference is supported. |
void |
removeAsset(java.lang.String productAssetPath)
Removes the product asset.
|
Resource |
updateAsset(java.lang.String productAssetPath,
java.util.Map<java.lang.String,java.lang.Object> productAssetProperties)
Updates the address.
|
Resource |
updateAsset(java.lang.String productAssetPath,
java.lang.String assetReference)
Updates the address.
|
boolean isSupportedReferencedAsset(java.lang.String assetReference)
assetReference is supported.assetReference - the asset path in the repositorytrue if the asset is supported, false otherwiseboolean isSupportedAsset(java.lang.String productAssetPath)
productAssetPath is supported.productAssetPath - the path of the product assettrue if the product asset is supported, false otherwisejava.lang.String getReferencedAsset(java.lang.String productAssetPath)
productAssetPath - the path of the product assetResource getAsset(Product product)
product - The productnull if there is nonejava.util.List<Resource> getAssets(Product product)
product - The productnull if there are nonejava.lang.String getThumbnailUrl(Product product, java.lang.String selectorString)
product - The productselectorString - The selector stringnull if there is nonejava.lang.String getThumbnailUrl(java.lang.String productAssetPath,
java.lang.String selectorString)
productAssetPath - The path to the product assetselectorString - The selector stringnull if there are noneResource addAsset(Product product, java.lang.String assetReference) throws CommerceException
product - The productassetReference - The path to the referenced assetCommerceException - when the operation fails.Resource addAsset(Product product, java.util.Map<java.lang.String,java.lang.Object> productAssetProperties) throws CommerceException
product - The productproductAssetProperties - The rendering properties of the product assetCommerceException - when the operation fails.Resource updateAsset(java.lang.String productAssetPath, java.lang.String assetReference) throws CommerceException
productAssetPath - The path of the product assetassetReference - The path to the referenced assetCommerceException - when the operation fails.Resource updateAsset(java.lang.String productAssetPath, java.util.Map<java.lang.String,java.lang.Object> productAssetProperties) throws CommerceException
productAssetPath - The path of the product assetproductAssetProperties - The rendering properties of the product assetCommerceException - when the operation fails.void removeAsset(java.lang.String productAssetPath)
throws CommerceException
productAssetPath - The path of the product assetCommerceException - when the operation fails.Copyright © 2010 - 2023 Adobe. All Rights Reserved