Expand my Community achievements bar.

SOLVED

Asset reference

Avatar

Level 4

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

1 Accepted Solution

Avatar

Correct answer by
Level 1
        You can use Assetreferencesearch from dam.commond.util

View solution in original post

1 Reply

Avatar

Correct answer by
Level 1
        You can use Assetreferencesearch from dam.commond.util