Asset reference | Community
Skip to main content
mikezooz
Level 4
October 16, 2015
Solved

Asset reference

  • October 16, 2015
  • 1 reply
  • 908 views

Hi,

I am trying to find the asset reference, (ie) which all the pages using the particular asset.

My requirement is:

once i delete the asset from the DAM, it has to delete the asset link from the reference page as well.

So i found the API called: AssetReferenceResolver

and the method: getReferences()

i have written the below code but its shows "Method is not resolved"

Below is the code:

<%

String path="/content/dam/sample/banner-retro.png";

    AssetReferenceResolver assetRef = new AssetReferenceResolver();

    java.util.Map<java.lang.String,java.lang.String> map= assetRef.getReference(path,resourceResolver);
    for (java.util.Map.Entry<String, String> entry : map.entrySet())
    {
      String key = entry.getKey();
      String value = entry.getValue();
        out.println(value);
        }

%>

Could you please help me.

Many thanks!!!

Michael

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by blakhal
        You can use Assetreferencesearch from dam.commond.util

1 reply

blakhalAccepted solution
October 16, 2015
        You can use Assetreferencesearch from dam.commond.util