|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.dam.templating.functions.DamTemplatingFunctions
@Singleton public class DamTemplatingFunctions
Asset templating function exposed in FTL's as "damfn". This class exposed useful methods for FTL's and Model Class.
Field Summary | |
---|---|
static String |
DAM_VERSION_1_PROVIDER_ID
|
static String |
METADATA_KEY_ACCESS
|
Constructor Summary | |
---|---|
DamTemplatingFunctions(info.magnolia.dam.api.AssetProviderRegistry providerRegistry)
|
Method Summary | |
---|---|
info.magnolia.dam.api.Asset |
getAsset(String itemKey)
|
info.magnolia.dam.api.Asset |
getAsset(String providerId,
String assetPath)
|
info.magnolia.dam.api.Asset |
getAssetForAbsolutePath(String providerId,
String absoluteAssetPath)
|
info.magnolia.dam.api.Asset |
getAssetForId(String assetIdentifier)
Deprecated. use getAsset(String) . |
info.magnolia.dam.api.Asset |
getAssetForPath(String assetPath)
Deprecated. use getAssetForAbsolutePath(String, String) . |
String |
getAssetLink(info.magnolia.dam.api.Asset asset,
com.google.common.net.MediaType mediaType,
String renditionName)
|
String |
getAssetLink(String assetKey)
|
String |
getAssetLink(String itemKey,
String renditionName)
|
String |
getAssetLinkForId(String assetKey)
Deprecated. use getAssetLink(String) . |
String |
getAssetLinkForId(String itemKey,
String renditionName)
Deprecated. use getAssetLink(String, String) . |
Map<String,Object> |
getAssetMap(info.magnolia.dam.api.Asset asset)
Create a read only map containing: - All asset property names and values - a metadata child map containing all supported metadata property names and values. |
Map<String,Object> |
getAssetMap(String itemKey)
|
Map<String,Object> |
getAssetMapForAssetId(String assetKey)
|
info.magnolia.dam.api.Asset |
getAssetRendition(info.magnolia.dam.api.Asset asset,
String renditionName)
Deprecated. use getRendition(Asset, MediaType, String) . |
info.magnolia.dam.api.Asset |
getAssetRenditionForAssetId(String itemKey,
String renditionName)
Deprecated. use getRendition(String, MediaType, String) . |
List<info.magnolia.dam.api.Asset> |
getAssetsForFilter(info.magnolia.dam.api.AssetQuery assetQuery)
Deprecated. use getItems(String, AssetQuery) . |
List<info.magnolia.dam.api.Asset> |
getAssetsFromFolderId(String folderKey)
Deprecated. use getFolder(String) and the Folder.getChildren() . |
info.magnolia.dam.api.Folder |
getFolder(String itemKey)
|
info.magnolia.dam.api.Folder |
getFolder(String providerId,
String folderPath)
|
Iterator<info.magnolia.dam.api.Item> |
getItems(String providerId,
info.magnolia.dam.api.AssetQuery assetQuery)
Set AssetQuery.includesFolders() or AssetQuery.includesAssets() in order to restrict the returned Items. |
info.magnolia.dam.api.AssetRendition |
getRendition(info.magnolia.dam.api.Asset asset,
com.google.common.net.MediaType mediaType,
String renditionName)
Based on the passed MediaType and Asset , get an appropriate AssetRenderer . |
info.magnolia.dam.api.AssetRendition |
getRendition(info.magnolia.dam.api.Asset asset,
String renditionName)
|
info.magnolia.dam.api.AssetRendition |
getRendition(String itemKey,
com.google.common.net.MediaType mediaType,
String renditionName)
|
info.magnolia.dam.api.AssetRendition |
getRendition(String itemKey,
String renditionName)
|
boolean |
provides(String providerId,
com.google.common.net.MediaType mediaType)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String METADATA_KEY_ACCESS
public static final String DAM_VERSION_1_PROVIDER_ID
Constructor Detail |
---|
@Inject public DamTemplatingFunctions(info.magnolia.dam.api.AssetProviderRegistry providerRegistry)
Method Detail |
---|
public info.magnolia.dam.api.Asset getAsset(String itemKey)
itemKey
- ItemKey.asString()
.
public info.magnolia.dam.api.Asset getAsset(String providerId, String assetPath)
providerId
- assetPath
- relative path to the Asset.
IllegalArgumentException
- if the requested provider is not an implementation of PathAwareAssetProvider
.public info.magnolia.dam.api.Asset getAssetForAbsolutePath(String providerId, String absoluteAssetPath)
providerId
- assetPath
- absolute path to the Asset.
IllegalArgumentException
- if the requested provider is not an implementation of PathAwareAssetProvider
.public info.magnolia.dam.api.Folder getFolder(String itemKey)
itemKey
- ItemKey.asString()
.
public info.magnolia.dam.api.Folder getFolder(String providerId, String folderPath)
providerId
- folderPath
- relative path to the Folder.
IllegalArgumentException
- if the requested provider is not an implementation of PathAwareAssetProvider
.public Iterator<info.magnolia.dam.api.Item> getItems(String providerId, info.magnolia.dam.api.AssetQuery assetQuery)
AssetQuery.includesFolders()
or AssetQuery.includesAssets()
in order to restrict the returned Items.
public info.magnolia.dam.api.AssetRendition getRendition(info.magnolia.dam.api.Asset asset, com.google.common.net.MediaType mediaType, String renditionName)
MediaType
and Asset
, get an appropriate AssetRenderer
.
From the AssetRenderer
get the AssetRendition
for the given renditionName.
public info.magnolia.dam.api.AssetRendition getRendition(info.magnolia.dam.api.Asset asset, String renditionName)
AssetRendition
based on the MediaType
builded from the Asset.getMimeType()
.public info.magnolia.dam.api.AssetRendition getRendition(String itemKey, String renditionName)
public info.magnolia.dam.api.AssetRendition getRendition(String itemKey, com.google.common.net.MediaType mediaType, String renditionName)
public boolean provides(String providerId, com.google.common.net.MediaType mediaType)
AssetProvider.provides(MediaType)
or false in case of any exceptions.public Map<String,Object> getAssetMap(info.magnolia.dam.api.Asset asset)
public Map<String,Object> getAssetMap(String itemKey)
public String getAssetLink(String assetKey)
Asset.getLink()
or null in case of exception or if Asset is not found.public String getAssetLink(String itemKey, String renditionName)
AssetRendition.getLink()
or null in case of exception or if Asset
or AssetRendition
are not found.public String getAssetLink(info.magnolia.dam.api.Asset asset, com.google.common.net.MediaType mediaType, String renditionName)
AssetRendition.getLink()
or null in case of exception or if Asset
or AssetRendition
are not found.public Map<String,Object> getAssetMapForAssetId(String assetKey)
getAssetMap(Asset)
for the Asset
corresponding to the assetKey. Null in case of exception or if the Asset
was not found.@Deprecated public List<info.magnolia.dam.api.Asset> getAssetsFromFolderId(String folderKey)
getFolder(String)
and the Folder.getChildren()
.
ItemKey.asString()
).
@Deprecated public info.magnolia.dam.api.Asset getAssetForPath(String assetPath)
getAssetForAbsolutePath(String, String)
.
Asset
found under this path for the DamConstants#DEFAULT_JCR_PROVIDER_ID
or null otherwise.@Deprecated public info.magnolia.dam.api.Asset getAssetForId(String assetIdentifier)
getAsset(String)
.
@Deprecated public info.magnolia.dam.api.Asset getAssetRendition(info.magnolia.dam.api.Asset asset, String renditionName)
getRendition(Asset, MediaType, String)
.
Asset
based on the rendition Name. @Deprecated public info.magnolia.dam.api.Asset getAssetRenditionForAssetId(String itemKey, String renditionName)
getRendition(String, MediaType, String)
.
Asset
based on the rendition Name and itemKey. @Deprecated public String getAssetLinkForId(String assetKey)
getAssetLink(String)
.
Asset.getLink()
or null in case of exception or if Asset is not found.@Deprecated public String getAssetLinkForId(String itemKey, String renditionName)
getAssetLink(String, String)
.
AssetRendition.getLink()
or null in case of exception or if Asset is not found.@Deprecated public List<info.magnolia.dam.api.Asset> getAssetsForFilter(info.magnolia.dam.api.AssetQuery assetQuery)
getItems(String, AssetQuery)
.
DamConstants#DEFAULT_JCR_PROVIDER_ID
assetProvider, or an empty
list if nothing found or in case of Exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |