Expand my Community achievements bar.

SOLVED

Need to get assets thats has been used and unused

Avatar

Level 2

I am looking for a OOTB solution to generate a report for used and unused asset's under a dam node. Are there any query for that? I tried using generating report using this query 

```path=/content/dam/applicaion-name
type=dam:Asset
property=jcr:content/usages/dam:score
property.value=1
p.limit=-1```

usage dam:score if 0 then its not used anywhere and if its greater than 0 it has uses.
I did tried using `ReferenceSearch.search()` and made a custom report for my use case. But is their any OOTB solution for that?

1 Accepted Solution

Avatar

Correct answer by
Level 7

There is no direct way to create that. At my work I faced the same requirement and I went following way:

 

1. Created a servlet

2. Created an html input field where the user can type in the path.

3. Created a query that looks for type "dam:Assest" in given path.

4. Collected and iterate through all founded ressources and used "ReferenceAggregator" for check.

4.1. If the returning list is empty, then current asset is not in use.

4.2. If the returning list is not empty, then current asset is in use.

5. Created output (either html output or csv file)

 

Note: This way takes a while, depends on the number of stored assets, so may be you need help from your server admnistrator

View solution in original post

2 Replies

Avatar

Community Advisor

Hi @mohibul_hasan_dhrubo 

As far as my understanding in order for the dam:score to populate we need to enable asset insights unless its enabled and tracked with scripts at asset level there is no direct OOTB way to get it as report. Only way as per my understanding is create a servlet using AssetReferenceSearch method as shown this example and generate a CSV file which has asset name and referenced asset.I hope thats the way your generating now.

Once you enable asset insights the usage can be tracked in adobe analytics as a report

https://experienceleague.adobe.com/docs/experience-manager-learn/assets/advanced/asset-insights-laun...

 

Hope this helps.

 

Regards,

Rajashankar.R

Avatar

Correct answer by
Level 7

There is no direct way to create that. At my work I faced the same requirement and I went following way:

 

1. Created a servlet

2. Created an html input field where the user can type in the path.

3. Created a query that looks for type "dam:Assest" in given path.

4. Collected and iterate through all founded ressources and used "ReferenceAggregator" for check.

4.1. If the returning list is empty, then current asset is not in use.

4.2. If the returning list is not empty, then current asset is in use.

5. Created output (either html output or csv file)

 

Note: This way takes a while, depends on the number of stored assets, so may be you need help from your server admnistrator