Package com.day.cq.dam.api
Interface AssetReferenceResolver
-
@ProviderType public interface AssetReferenceResolver
TheAssetReferenceResolver
provides api to resolve the references of a composite assets (for e.g. InDesign assets) to an existing DAM's asset. Further it provides api for creation/cleanup of references and getting list of contained composite Assets. Implementation of this interface should be exposed as a component. Default implementation of this interface is available at com.day.cq.dam.core.impl.AssetReferenceResolverImpl
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
cleanup(java.lang.String assetPath, ResourceResolver resolver)
Deprecated.since 1.2java.lang.String
createReference(java.lang.String assetPath, boolean doSave, java.lang.String resolvedPath, java.util.List<java.lang.Object> data, ResourceResolver resolver)
This method would create the references which can be associated with the resolved asset as well can be stored as property/node by Composite Assetboolean
deleteLink(java.lang.String linkPath, ResourceResolver resolver)
Deprecated.since 1.2java.util.Map<java.lang.String,java.lang.String>
getReferences(java.lang.String assetPath, ResourceResolver resolver)
This method would take the asset path as input and return the assets being referred by the input asset with actual link nodes.java.lang.String
getResolvedPath(java.lang.String property, ResourceResolver resolver)
This method would take the property of an referenced asset through which it can be mapped/associated with DAM's existing asset.java.util.Iterator<? extends AssetRelation>
resolve(Asset asset)
This method would resolve asset references.boolean
resolveLink(java.lang.String linkPath, java.lang.String resolvedPath, ResourceResolver resolver)
Deprecated.since 1.2
-
-
-
Method Detail
-
resolve
java.util.Iterator<? extends AssetRelation> resolve(Asset asset)
This method would resolve asset references. Maps all the sub assets to DAM's existing asset- Parameters:
asset
- - asset for which references are to be resolved- Returns:
- - Iterator for relations created
-
getResolvedPath
java.lang.String getResolvedPath(java.lang.String property, ResourceResolver resolver)
This method would take the property of an referenced asset through which it can be mapped/associated with DAM's existing asset. It returns path of existing asset in DAM on success, otherwise returns NULL in case of not able to resolve.- Parameters:
property
- referenced asset's property through which it can be mapped to DAM's existing asset.resolver
- ResourceResolver instance- Returns:
- Path of the resolved asset on success, Null otherwise.
-
getReferences
java.util.Map<java.lang.String,java.lang.String> getReferences(java.lang.String assetPath, ResourceResolver resolver)
This method would take the asset path as input and return the assets being referred by the input asset with actual link nodes.- Parameters:
assetPath
- referenced asset's pathresolver
- ResourceResolver instance- Returns:
- Method returns Map in which key would be the composite asset refers input referenced asset and value would be the actual link node created by #AssetReferenceResolver.createReference
-
createReference
java.lang.String createReference(java.lang.String assetPath, boolean doSave, java.lang.String resolvedPath, java.util.List<java.lang.Object> data, ResourceResolver resolver) throws RepositoryException
This method would create the references which can be associated with the resolved asset as well can be stored as property/node by Composite Asset- Parameters:
assetPath
- composite asset's pathdoSave
- Whether the repository changes are saved or not.resolvedPath
- resolved path of the referenced asset in DAMdata
- Pass the additional data needed for reference creationresolver
- ResourceResolver instance- Returns:
- path of the created link on success otherwise NULL
- Throws:
RepositoryException
- thrown if an error occurs while accessing the asset
-
resolveLink
@Deprecated boolean resolveLink(java.lang.String linkPath, java.lang.String resolvedPath, ResourceResolver resolver)
Deprecated.since 1.2This method will resolve the missing link. If the links are missing at the time of Composite Asset upload, they can be resolved through following method after wards.- Parameters:
linkPath
- link's node pathresolvedPath
- path of an existing asset in the DAM to resolved withresolver
- ResourceResolver instance- Returns:
- returns true flag if able to resolve the link otherwise false
-
deleteLink
@Deprecated boolean deleteLink(java.lang.String linkPath, ResourceResolver resolver)
Deprecated.since 1.2This method will be called at the time of referenced asset deletion and provides the cleanup of the associated links.- Parameters:
linkPath
- link's node pathresolver
- ResourceResolver instance- Returns:
- returns true flag on successful link deletion otherwise false
-
cleanup
@Deprecated boolean cleanup(java.lang.String assetPath, ResourceResolver resolver)
Deprecated.since 1.2This method will clean all the links node created for referenced asset. It calls #AssetReferenceResolver.deleteLink internally to delete individual links- Parameters:
assetPath
- referenced asset's pathresolver
- ResourceResolver instance- Returns:
- returns true flag on successful cleanup otherwise false
-
-