info.magnolia.dam.provider
Interface AssetProvider

All Known Implementing Classes:
JcrAssetProvider

public interface AssetProvider

Expose methods in order to access the Asset from a particular provider.
Classes implementing the AssetProvider are responsible for physical access to the Asset and its media.


Method Summary
 Asset getAsset(String assetIdentifier)
          Retrieve an Asset based on an assetIdentifier.
 String getAssetIdentifierForPath(String assetPath)
          Return the Asset Identifier referenced by this path.
 AssetMap getAssetMap(Asset asset)
          Return the AssetMap representation of the Asset.
 List<Asset> getAssetsForFilter(AssetFilter assetFilter)
          Retrieve an Asset List based on an AssetFilter .
 List<Asset> getAssetsFromFolderId(String folderIdentifier)
          Retrieve an Asset List based on an asset Identifier.
 List<Asset> getAssetsFromFolderPath(String folderPath)
          Retrieve an Asset List based on an asset Folder.
 String getIdentifier()
          Return the AssetProvider identifier.
 Rendition getRendition(Asset asset, String renditionName)
          Return the specified Asset Rendition.
 String getURI(Asset asset, String uriPrefix)
          Get URI link to the Asset.
 

Method Detail

getIdentifier

String getIdentifier()
Return the AssetProvider identifier.

Returns:
: AssetProvider identifier or null if not defined.

getAsset

Asset getAsset(String assetIdentifier)
Retrieve an Asset based on an assetIdentifier.
In Case of JCR, this identifier will be the Node.getIdentifier()

Returns:
the related Asset or null if exception or not found.

getAssetIdentifierForPath

String getAssetIdentifierForPath(String assetPath)
Return the Asset Identifier referenced by this path.

Returns:
The Asset.getIdentifier() value if found. Otherwise return null.

getAssetsFromFolderPath

List<Asset> getAssetsFromFolderPath(String folderPath)
Retrieve an Asset List based on an asset Folder.
Returns direct children of the Folder.

Returns:
the related Asset List or an empty List if exception or no Assets found.

getAssetsFromFolderId

List<Asset> getAssetsFromFolderId(String folderIdentifier)
Retrieve an Asset List based on an asset Identifier.
Returns direct children of the Folder. For example in case of JCR, this identifier will be the Node.getIdentifier()

Returns:
the related Asset List or an empty List if exception or no Assets found.

getAssetsForFilter

List<Asset> getAssetsForFilter(AssetFilter assetFilter)
Retrieve an Asset List based on an AssetFilter .

Returns:
the related Asset List or an empty List if exception or no Assets found.

getURI

String getURI(Asset asset,
              String uriPrefix)
Get URI link to the Asset.

Returns:
the URI to the real Asset or null if exception or none found.

getRendition

Rendition getRendition(Asset asset,
                       String renditionName)
                       throws NoSuchRenditionException,
                              DamException
Return the specified Asset Rendition.

Returns:
null if no rendition found.
Throws:
NoSuchRenditionException
DamException

getAssetMap

AssetMap getAssetMap(Asset asset)
Return the AssetMap representation of the Asset. AssetMap is mainly used in Templates to simplify data access.

Parameters:
asset -
Returns:
Related AssetMap or null in case of exception.


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.