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
Solved! Go to Solution.
Views
Replies
Total Likes
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.
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.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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.
@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!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies