what is the best way to recognize the dam asset expiration date im writing one scheduler with in query but i couldnt get the result.

Avatar

Avatar
Boost 3
Level 2
keshav_goud
Level 2

Likes

3 likes

Total Posts

35 posts

Correct reply

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

Avatar
Boost 3
Level 2
keshav_goud
Level 2

Likes

3 likes

Total Posts

35 posts

Correct reply

0 solutions
Top badges earned
Boost 3
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile
keshav_goud
Level 2

14-07-2020

I gone through 

https://docs.adobe.com/content/help/en/experience-manager-65/developing/platform/query-builder/query...

 

according to the url im using query as:

 

queryMap.put("path", assetFolderPath);
queryMap.put("type", "dam:Asset");
queryMap.put("p.limit", "-1");
queryMap.put("daterange.property", "jcr:content/metadata/" + EXPIRATION_DATE);
queryMap.put("dterange.upperBound", dateFormat.format(calenderDate.getTime()));
queryMap.put("daterange,upperOperation", "<");

 

Can any one share me the best query to recognize my expire assets plzzzzzzzzzzzzzzzzzzz

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

573 likes

Total Posts

728 posts

Correct reply

240 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

14-07-2020

Hi @keshav_goud,

To find expired assets with respect to a specific date, query predicates you have used seems to be fine. 

Given that you are not getting results, I suggest to execute first at querydebug.html(http://localhost:4502/libs/cq/search/content/querydebug.html) with hard coded date values targeting one or two sample assets.

Then when you see the results coming up, can write dynamically in code.

Screenshot below for reference: Expired asset with respect to specific date in upperBound.

On similar lines, based on your exact constraint on expired asset, can make use of related daterange predicates to get desired results

ExpiredAsset.png

Answers (3)

Answers (3)

Avatar

Avatar
Give Back 50
Employee
berliant
Employee

Likes

207 likes

Total Posts

315 posts

Correct reply

98 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Employee
berliant
Employee

Likes

207 likes

Total Posts

315 posts

Correct reply

98 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
berliant
Employee

14-07-2020

You can possibly use a querry similar to:

 

path=/content/dam
type=dam:Asset

group.1_daterange.property=jcr:content/metadata/@prism:expirationDate
group.1_daterange.upperBound=2020-07-14T23:59:59.000-04:00
group.1_daterange.lowerBound=2020-07-13T00:00:00.000-04:00
group.p.limit=-1

Avatar

Avatar
Validate 1
Level 2
nitinjl
Level 2

Likes

6 likes

Total Posts

62 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
nitinjl
Level 2

Likes

6 likes

Total Posts

62 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
nitinjl
Level 2

14-07-2020

Use something like as below, here prism:expirationDate represents expiration date, and using properties lower bound and upper bound you can define the date range. 

select [jcr:path], [jcr:score], * from [dam:Asset] as a where [jcr
:content/metadata/prism:expirationDate] > cast('2017-03-22T07:00:00.000Z' as date) and [jcr:content/metadata/prism:expirationDate] < cast('2017-03-23T07:00:00.001Z' as date) and isdescendantnode(a, '/content/dam')
 

Avatar

Avatar
Applaud 25
Level 10
asutosh_jena
Level 10

Likes

593 likes

Total Posts

705 posts

Correct reply

207 solutions
Top badges earned
Applaud 25
Give Back 100
Boost 500
Affirm 100
Ignite 1
View profile

Avatar
Applaud 25
Level 10
asutosh_jena
Level 10

Likes

593 likes

Total Posts

705 posts

Correct reply

207 solutions
Top badges earned
Applaud 25
Give Back 100
Boost 500
Affirm 100
Ignite 1
View profile
asutosh_jena
Level 10

14-07-2020

@keshav_goud Can you please confirm if you are trying to find the assets those are already expired or is going to expire in next couple of days? Are you tracking for any specific property?