JSP find instances of a given page/asset | Adobe Higher Education
Skip to main content
Level 2
October 16, 2015
Répondu

JSP find instances of a given page/asset

 I want to be able to, in a JSP, file browse to a page/asset and find all instances of it within my entire AEM instance, so that I can find what uses it.

 

I know this functionality already exists in AEM as when you move a page that is used in a list if informs you that it will modify the list to point to its new location.  How can I access this information in a JSP file efficiently?

Ce sujet a été fermé aux réponses.
Meilleure réponse par edubey

Please use this piece of code to get all references of a Asset:

String damPath = "/content/dam/geometrixx/offices/basel kitchen.jpg"; for (ReferenceSearch.Info info: new ReferenceSearch().search(resourceResolver, damPath).values()) { for (String p: info.getProperties()) { out.println("Path is "+info.getPage().getPath()); }

Let me know if you face any issue.

1 commentaire

edubey
edubeyRéponse
Level 10
October 16, 2015

Please use this piece of code to get all references of a Asset:

String damPath = "/content/dam/geometrixx/offices/basel kitchen.jpg"; for (ReferenceSearch.Info info: new ReferenceSearch().search(resourceResolver, damPath).values()) { for (String p: info.getProperties()) { out.println("Path is "+info.getPage().getPath()); }

Let me know if you face any issue.