Open-source "Usage" action for the AEMaaCS Assets console: find every page, XF and CF using an asset
Hi all,
Sharing a small open-source tool I built for AEM as a Cloud Service: a Usage action in the Assets console that answers “where is this asset used?” more completely than the built-in References rail.
Select an asset and a Usage button appears. It lists every page, experience fragment and content fragment using that asset with the exact component, a Published/Draft badge, and direct Edit/View links.
What it adds over the native References rail
- Inline images in rich text (Text component)
- Assets referenced inside content fragments
- Experience fragments listed separately from pages
- Language masters vs. live copies, so a rollout isn’t counted multiple times
- Published status + a direct link per result
How it works (high level)
- A servlet bound by
resourceType=dam:Asset+ selectorusage→GET {asset}.usage.json. No/binpath to allowlist, and the asset’s own ACLs apply. - An
AssetReferenceResolverservice runs three lookups: a QueryBuilder query over configurable asset properties (fileReference, etc.), aLIKEon the Text component’stextproperty for rich-text images, and the Content Fragment API for fragment element references. - A small Granite overlay + clientlib adds the button and renders the panel.
Known limitations: a CF used on a page is reported as a CF usage (it doesn’t yet follow asset → CF → page); large repositories will want Oak indexes on the queried properties.
Code: https://github.com/shrutidamle-aem/aem-assets-usage
Write-up: Where is this asset used? A better “References” view for AEM Assets
Feedback very welcome — especially which usages it catches and which it misses in your projects.
