How to get the list of all assets and content fragments used in a page?
I need to get the list of all Content fragments and assets used in a page in my sling servlet. Which API should I use for this.
Thanks
I need to get the list of all Content fragments and assets used in a page in my sling servlet. Which API should I use for this.
Thanks
Thanks @shaileshb584084 and @walterch for your time. I tried with AssetReferenceSearch and now I am able to get the list of assets and content fragment paths in the page. Not sure if I get nested CF list from this. I need to work on it. I am adding my code fragment below. Thanks again for your time.
Node node = resource.adaptTo(Node.class); AssetReferenceSearch reference = new AssetReferenceSearch(node,"/content/dam/custom-project-path",resourceResolver); Map<String,Asset> referenceList = new HashMap<String,Asset>(); referenceList.putAll(reference.search());
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.