Hello,
I will need a xpath query that will perform
Check in damasset if under jcr:content the below properties , and may have customDateProperty
1>cq:lastReplicated is today
2>cq:lastReplicationAction is Activate
3>customDateProperty -> check if exists under jcr:content , if exists then check the timestamp if cq:lastReplicated timestamp and date is greater then customDateProperty
Could you please provide inputs on this
Regards,
Srinivas
Solved! Go to Solution.
Views
Replies
Total Likes
In code you can write a check if customProperty exist or not and based on that you can create different query.
I gave today's date in daterange.lowerbound you can update dynamically in the code. You can also explore relativedaterange if above query does not fit for your requirement.
https://hashimkhan.in/2015/12/02/query-builder/
You can use dateComparison Predicate to compare 2 JCR Date.
This query should help in your case. You can replace cq:lastModified with customProperty in line 3
path=/content/dam/we-retail dateComparison.property1=cq:lastReplicated dateComparison.property2=cq:lastModified dateComparison.operation=greater property=cq:lastReplicationAction property.value=Activate daterange.property=cq:lastReplicated daterange.lowerBound=2022-09-10T00:00:00.000+05:30 daterange.lowerOperation=>
Hello,
Thanks for the input. The query gave me goods insight as what could be done.
I still have one problem , if you could help me on it based on the previous xpath query
3> customProperty if we replace with cq:lastModified .
3a>We need to check if the customProperty exists , only then do the
if cq:lastReplicated timestamp and date is greater then customDateProperty
-> As the customProperty may not be present always on this nodes
3.b> Also check for the below
a>cq:lastReplicated is today
b>cq:lastReplicationAction is Activate
4> In case we don't have the customProperty then , it must still give the results based on
a>cq:lastReplicated is today
b>cq:lastReplicationAction is Activate
Thanks,
Srinivas
In code you can write a check if customProperty exist or not and based on that you can create different query.
I gave today's date in daterange.lowerbound you can update dynamically in the code. You can also explore relativedaterange if above query does not fit for your requirement.
https://hashimkhan.in/2015/12/02/query-builder/
Views
Likes
Replies