Package com.day.cq.dam.api
Interface AssetReferenceResolver
The
AssetReferenceResolver
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
Modifier and TypeMethodDescriptionboolean
cleanup
(String assetPath, ResourceResolver resolver) Deprecated.since 1.2createReference
(String assetPath, boolean doSave, String resolvedPath, List<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
(String linkPath, ResourceResolver resolver) Deprecated.since 1.2getReferences
(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.getResolvedPath
(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.Iterator
<? extends AssetRelation> This method would resolve asset references.boolean
resolveLink
(String linkPath, String resolvedPath, ResourceResolver resolver) Deprecated.since 1.2
-
Method Details
-
resolve
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
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
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
String createReference(String assetPath, boolean doSave, String resolvedPath, List<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.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.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.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
-