Hi ,
I am new to Aem. is there any Query to find the assets based on some conditions? In my case, I need to Move the assets that are jcr:created is more than one month ago using Scheduler. That scheduler should run every week.
and
for moving we have AssetManager.moveAsset() but is there any sample code how to use that api programmatically?
Solved! Go to Solution.
Views
Replies
Total Likes
@Venki105 you can implement it using Query Builder API and make use of predicate relativedaterange.
sample query to get all assets that are modified 5 days before (Test using Query Builder Debugging Tool)
http://<host:port>/libs/cq/search/content/querydebug.html
path=/content/dam/wknd-events
type=dam:Asset
relativedaterange.property=jcr:content/jcr:lastModified
relativedaterange.lowerBound=-5d (If no upperBound is specified, it is treated as 0, indicating current time)
p.limit=-1
@Venki105 you can implement it using Query Builder API and make use of predicate relativedaterange.
sample query to get all assets that are modified 5 days before (Test using Query Builder Debugging Tool)
http://<host:port>/libs/cq/search/content/querydebug.html
path=/content/dam/wknd-events
type=dam:Asset
relativedaterange.property=jcr:content/jcr:lastModified
relativedaterange.lowerBound=-5d (If no upperBound is specified, it is treated as 0, indicating current time)
p.limit=-1