I am trying to write a query where I can get content from a location in AEM dated from today's day back 24 months, but the date is not based on the publish/modify/creation date. They are asking for the dates to be based on the content called the "publish release date".
I have the following working off the creation date:
String sqlstmt = "SELECT * "
+ "FROM [nt:unstructured] AS comp "
+ "WHERE ISDESCENDANTNODE(comp, '" + pathLocation + "') "
+ " AND [sling:resourceType] = 'nvenergy/components/content/pressrelease' "
+ " AND comp.[jcr:created] >= "
+ " CAST('" + julianEndDateString + "T00:00:00.000Z' AS DATE) "
+ " AND comp.[jcr:created] < "
+ " CAST('" + julianCurrentDateString + "T00:00:00.000Z' AS DATE) "
+ " ORDER BY 1 ASC";
but I really need it to be off the content's "publish release date" found here:
...
if (currentNode.hasProperty("pressreleasepublishdate")) {
Calendar publishedDate =
currentNode.getProperty("pressreleasepublishdate").getDate();
...
Can I do a join or used something to use the node's property for the release date instead of the [jcr:created]
as my range? Or do I have to execute the query hold it in a temp list and resort based on the node's property for the release date?