开发者

Java JCR how to change order of nodes?

I am using Jackrabbit with JCR, how can I开发者_JAVA百科 change the order of the nodes?


There are a number of ways;

1) Create a parent node type with the option "orderable".

[ns:NodeType] > ns:ParentType1 orderable
....
..

Now you can use the [orderBefore][1] method to order the nodes.

2) Use can use a SQL/XPATH query to order the nodes returned. e.g.

//element( *, blabla:nodes) order by
@blabla:title descending

[1]: http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Node.html#orderBefore(java.lang.String, java.lang.String)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜