info.magnolia.dam
Interface DamManager

All Known Implementing Classes:
DefaultDamManager

public interface DamManager

This is the entry point for accessing Asset for third parties.
The DamManager implementation should use the AssetProviderRegistry to retrieve the appropriate AssetProvider in order to Access Asset.
Assets and Assets folder are identified based on Path or Id.

      id: concatenation of the providerId and assetId: 'providerId:assetId' (for an internal asset: jcr:assetNodeIdentifier).
 


Method Summary
 Asset getAssetForId(String assetIdentifier)
          Retrieve an Asset based on an assetIdentifier.
Deleted/Hidden Assets will not be returned.
 Asset getAssetForPath(String assetPath)
          Retrieve an Asset based on an Asset path.
 AssetMap getAssetMap(Asset asset)
          Return the AssetMap representation of the Asset.
 AssetProvider getAssetProvider(String providerId)
          Return the AssetProvider related to the specified providerId.
 List<Asset> getAssetsForFilter(AssetFilter assetFilter)
          Retrieve an Asset List based on an AssetFilter.
 List<Asset> getAssetsFromFolderId(String folderIdentifier)
          Retrieve an Asset List based on a folder identifier.
 

Method Detail

getAssetForId

Asset getAssetForId(String assetIdentifier)
Retrieve an Asset based on an assetIdentifier.
Deleted/Hidden Assets will not be returned.

Parameters:
assetIdentifier -
Returns:
The referred Asset if found. Null if nothing found or in case of exception.

getAssetForPath

Asset getAssetForPath(String assetPath)
Retrieve an Asset based on an Asset path.
Deleted/Hidden Assets will not be returned.
  Iterate the registered provider.
   For every active provider call AssetProvider.getAssetIdentifierForPath(String assetPath) and keep the result if not null.
  If one and only one result found, return the related Asset.
  In no results or more than one result found, log and return null.
 

Returns:
Found Asset. Null otherwise

getAssetsFromFolderId

List<Asset> getAssetsFromFolderId(String folderIdentifier)
Retrieve an Asset List based on a folder identifier.
Like the AssetIdentifier, the folder identifier is a composite key. 'providerId':'folderId'
Deleted/Hidden Asset will not be returned.

Returns:
The related Asset List. An empty Asset List if nothing found or in case of exception.

getAssetsForFilter

List<Asset> getAssetsForFilter(AssetFilter assetFilter)
Retrieve an Asset List based on an AssetFilter. This implementation supports multi-asset type (asset linked to different providers).
  Iterate the registered provider.
   For every active provider call AssetProvider.getAssetsFromFilter(AssetFilter assetFilter).
   Concatenate the results.
 

Parameters:
assetFilter -
Returns:
The related Asset List. An empty Asset List if nothing found or in case of exception.

getAssetProvider

AssetProvider getAssetProvider(String providerId)
                               throws AssetProviderNotFoundException
Return the AssetProvider related to the specified providerId.

Parameters:
-
Returns:
The related AssetProvider. If not found, throws an AssetProviderNotFoundException.
Throws:
AssetProviderNotFoundException

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.