Deactivate and delete expired assets

Avatar

Avatar
Validate 1
Level 2
sagarkmr09
Level 2

Likes

6 likes

Total Posts

36 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
sagarkmr09
Level 2

Likes

6 likes

Total Posts

36 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
sagarkmr09
Level 2

28-08-2019

Hi,

Is there a way to deactivate and delete the asset as soon as its expired i.e. the assets reaches the expiry date set for the asset?

Thanks,

Sagar

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
MVP
Himanshu_Singhal
MVP

Likes

65 likes

Total Posts

206 posts

Correct reply

23 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 25
MVP
Himanshu_Singhal
MVP

Likes

65 likes

Total Posts

206 posts

Correct reply

23 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give Back 5
Give Back 3
View profile
Himanshu_Singhal
MVP

29-08-2019

Digital Rights Management in Assets

Have you tried setting up the "Adobe CQ DAM Expiry Notification".

As per official documentation, if the configuration is set, the scheduler runs a check and deactivate the expired assets. However, it doesn't delete the assets and I don't think it does delete OOTB. For that you'll have to write custom code.

https://www.katrinaprieto.com/projects/adobe-aem/

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 2
sagarkmr09
Level 2

Likes

6 likes

Total Posts

36 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
sagarkmr09
Level 2

Likes

6 likes

Total Posts

36 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
sagarkmr09
Level 2

28-08-2019

Thanks for the query.

But for me when asset is expired, the it doesn't deactivates. Any configuration that i am missing?

Thanks

Avatar

Avatar
Validate 1
MVP
Theo_Pendle
MVP

Likes

238 likes

Total Posts

251 posts

Correct reply

105 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile

Avatar
Validate 1
MVP
Theo_Pendle
MVP

Likes

238 likes

Total Posts

251 posts

Correct reply

105 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile
Theo_Pendle
MVP

28-08-2019

Hi,

An expired asset is deactivated when is passes it's expiry date: "[...] ensures that the published asset is unpublished when it expires" (Digital Rights Management in Assets).

To delete the assets, you will have to create a workflow that finds all expired assets using a query, and deletes those nodes. Here is a query to find all assets expired at a given date (JCR SQL-2 does not have a DATE() function to get the current date, you will have to supply this date in Java):

SELECT asset.* FROM [dam:Asset] AS asset

INNER JOIN [dam:AssetContent] AS jcrContent ON ISCHILDNODE(jcrContent, asset)

INNER JOIN [nt:unstructured] as metadata ON ISCHILDNODE(metadata, jcrContent)

WHERE ISDESCENDANTNODE(asset, '/content/dam')

AND NAME(metadata) = 'metadata'

AND metadata.[prism:expirationDate] <= CAST('2019-08-28T23:59:59.999Z' AS DATE)

You can run this query now by going to CRXDE > Tools > Query, selecting SQL2, pasting the query in the text area and clicking execute:

Peek 2019-08-28 22-48.gif