Hi All,
We have a use-case where we are exposing AEM DAM to an internal 3rd party app.
We want to track if assets in AEM are being used/referenced in the 3rd party application. Is there any way we can programmatically update Asset references in AEM? I have already looked into Asset Manager API and could not find a way.
We were thinking to expose an endpoint from AEM which would hit by third part app. It would add references programmatically in AEM.
Thanks
Solved! Go to Solution.
Hi @beast42 , We implemented a similar scenario once.
Follow these steps & you should be achieving this
sling:resourceType | String | <your custom java servlet with ResourceType> |
This is one of many approaches, but can be easily done.
~Aditya.Ch
Hi @beast42 ,
There are two aspects considering your scenario
/libs/dam/remoteassets/components/references/reference/reference.html
/libs/dam/remoteassets/components/references/reference/Reference.javaYou can override it, to have your asset reference listed in this table of Reference tab.
Additionally just for your reference - You can also find references of asset programatically - sharing code snippet below
String Pagepath = "/content/we-retail/en"; //This would be your page path Resource r = resourceResolver.getResource(Pagepath+"/"+JcrConstants.JCR_CONTENT); Node n = r.adaptTo(Node.class); AssetReferenceSearch ref = new AssetReferenceSearch(n,DamConstants.MOUNTPOINT_ASSETS,resourceResolver); Map<String,Asset> allref = new HashMap<String,Asset>(); allref.putAll(ref.search()); for (Map.Entry<String, Asset> entry : allref.entrySet()) { String val = entry.getKey(); out.println(val+"<br>"); // Path of all Asset ref in page Asset asset = entry.getValue(); }
Hope that helps!
Regards,
Santosh
Thanks @SantoshSai . We'll explore this approach further.
Hi @beast42 , We implemented a similar scenario once.
Follow these steps & you should be achieving this
sling:resourceType | String | <your custom java servlet with ResourceType> |
This is one of many approaches, but can be easily done.
~Aditya.Ch
Thanks @Aditya_Chabuku . We'll explore this approach further.
Hi @Aditya_Chabuku, how can we achieve this?
'Create a Listener to record every time an asset is being called from a 3rd party API'
What is the event we would need to listen?
Thank you.
Regards,
Views
Replies
Total Likes