Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Asset reference

michaelvino86
Level 4
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
blakhal
Correct answer by
Level 1
Level 1
        You can use Assetreferencesearch from dam.commond.util

View solution in original post

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

View solution in original post