A little pseudo-code to show what I mean:
if (!article.hasDate) { return true; } else { if (article.date >= now()) { return true; } return false; }
Here are some articles I found online before I came up with a solution:
- http://labs.sixdimensions.com/blog/2013-07-10/custom-predicateevaluators-or-how-i-learned-stop-worrying-and-love/
- http://www.wemblog.com/2013/04/how-to-create-custom-query-predicate-in.html
Finally, here is what I have in CQ query builder:
path=[path/to/articles] type=cq:Page 99_property=@jcr:content/cq:template 99_property.value=[apps/path/to/template] 10_group.p.or=true 10_group.1_property=@jcr:content/offTime 10_group.1_property.operation=not 10_group.2_daterange.property=@jcr:content/offTime 10_group.2_daterange.lowerBound=[current-date-or-hardcode-date-for-testing] 10_group.2_daterange.lowerOperation=>=
This is now returning articles that does NOT have the offTime property; also it returns articles that DO have the offTime date and are current.
you want a Residential Property in Lucknow contact residential property construction company in lucknow.
ReplyDelete