O.k., maybe it is not possible to sort by a value in a subnode with a query because a node can potentially have multiple subnodes and therefore have multiple values to sort by. Of course this is rather stupid for my case. This leaves me with two options:

a) set an additional "lastmodified" value in the node itself (in addition to the MetaData) and sort by this value
b) query first, then sort the collection with a comparator

Both ways are not too sexy... :-(

-will

On 25.06.2009, at 18:32, Will Scheidegger wrote:


Dear Magnolians

This _should_ be an easy one, but after an hour of trying and googling my content nodes are still not being sorted by their modification date.

My query:

/jcr:root/path/to/data//element(*, myDataType) [...@owner = 'superuser'] order by MetaData/@mgnl:lastmodified

- It does something, because when I leave the order by... away I get a different sort order
- But the nodes are definitely not sorted by their modification date.
- Also tried with adding ascending and descending -> no effect
- "MetaData/@mgnl:lastmodified" seems to be correct because I can filter by this, just not sort

Googling for this only returned
http://www.mail-archive.com/[email protected]/msg07985.html

Has anyone solved this? Thanks.

-will

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to