Hey everyone
I have a xwql query that returns a bunch of page titles which I can then put in a table based on what pages were entered on the relevant class pages
#set ($zoeken = $services.query.xwql("select distinct doc.fullName from XWikiDocument as doc, BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='Main.Werkwijze.Hardware en Servers automatisering.Logboek automatisering.Code.Logboek automatiseringClass' and list = '$doc.FullName' "))
#foreach ($page in $zoeken.execute())
#set($pagina = $xwiki.getDocument($page))
One of the other appwithinminute variables of the Class is a ‘done on’ date value ( $pagina.getValue(‘Datum’) )
What i’m trying to do is sort the resultant pages of the xwql query by this Date value.
- I attempted to sort by in the query directly 'Order by ‘$doc.Datum’ but it gives me this error:
Failed to execute the [velocity] macro. Cause: [[1,450] expecting: abs, concat, count, length, locate, lower, mod, size, sqrt, substring, trim, upper, integer literal, aggregate func, functions returning datetime, id]. Click on this message for details.
When the query is:
#set ($zoeken = $services.query.xwql("select distinct doc.fullName from XWikiDocument as doc, BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='Main.Werkwijze.Hardware en Servers automatisering.Logboek automatisering.Code.Logboek automatiseringClass' and obj.id=prop.id.id and prop.id.name='Onderdeel' and list = '$doc.FullName' order by '$doc.Datum' "))
- Using both the custom Datum value and $doc.creationDate result in the same error.
I’ve looked at the CollectionTool sort function but even when having a list of ordered dates id still need to find the corresponding page objects with the dates… which doesnt seem like the right way to do this.
I’m hoping someone here has an idea and can send me in the right direction,
Thank you in advance!