AEM assets : how to identify asset expiry date: isAssetExpired boolean from where this can resolved | Community
Skip to main content
Prashardan
Level 4
May 13, 2025
Solved

AEM assets : how to identify asset expiry date: isAssetExpired boolean from where this can resolved

  • May 13, 2025
  • 2 replies
  • 627 views

Hi Team

I am working on AEM assets. Currently when an asset is expired, we are getting a flag mentioning asset is expired. 

 

I have identified it is coming from /libs/dam/gui/coral/components/admin/contentrenderer/card/asset/propertyList.jsp

 

so I have overlayed to /apps/dam/gui/coral/components/admin/contentrenderer/card/asset/propertyList.jsp

 

I want to understand how the below line is resolved so that I can get expirydate and display it when I hover over flag icon.

 

boolean isAssetExpired = request.getAttribute(IS_ASSETEXPIRED) != null ? (boolean) request.getAttribute(IS_ASSETEXPIRED) : false;

 

Kindly suggest

 

@amitvishwakarma @aanchal-sikka  @santoshsai @adilos-cantuerk @lukasz-m 

Best answer by K_M_K_Srikanth

you can use below code snippet for reference in the overridden jsp file

 

ValueMap metadata = asset.adaptTo(Resource.class).getChild("jcr:content/metadata").adaptTo(ValueMap.class); Calendar expiryDate = metadata.get("prism:expirationDate", Calendar.class); if (expiryDate != null) { String expiryDateStr = new SimpleDateFormat("yyyy-MM-dd").format(expiryDate.getTime()); // Now use expiryDateStr to show as tooltip or hover text }

now that you have the expirydate, you can use it anyway you want.

2 replies

K_M_K_Srikanth
Level 2
May 13, 2025

Hi @prashardan 

 

In AEM Assets Metadata contains prism:expirationDate which is responsible for displaying expiry flag, Also look out for the offtime property under jcr:content, try to modify these values and see if the flag is not visible.

Prashardan
Level 4
May 13, 2025

how can I retrieve these properties. Any out of the box java class?

I want to display this date. 
like if any asset is about in expire in next 3 days. I want to get its expiry date and calculate how many days from today. 

 

How can I retrieve and print prim:expirationDate

K_M_K_Srikanth
K_M_K_SrikanthAccepted solution
Level 2
May 14, 2025

you can use below code snippet for reference in the overridden jsp file

 

ValueMap metadata = asset.adaptTo(Resource.class).getChild("jcr:content/metadata").adaptTo(ValueMap.class); Calendar expiryDate = metadata.get("prism:expirationDate", Calendar.class); if (expiryDate != null) { String expiryDateStr = new SimpleDateFormat("yyyy-MM-dd").format(expiryDate.getTime()); // Now use expiryDateStr to show as tooltip or hover text }

now that you have the expirydate, you can use it anyway you want.

kautuk_sahni
Community Manager
Community Manager
July 2, 2025

@prashardan Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!

Kautuk Sahni