[xwiki-users] Sort Array of Objects
Hello again. I don´t have really much knowledge in Velocity. So right now begging for help :D #set($users = $xwiki.rightsmanager.usersApi.allUsers) #foreach($user in $users) I am getting an array of objects(user in xwiki). $users-array should be sorted by familyname Here is the snippet from https://velocity.apache.org/tools/devel/javadoc/org/apache/velocity/tools/ge... I am still kinda confused how to apply this on mine Single Property Sort #foreach($obj in $sorter.sort($objects, "name")) $obj.name Ordinal= $obj.ordinal #end End Thank you, guys =)
Hi Oleg,
On 03 May 2016, at 14:52, Rochlin Oleg <[email protected]> wrote:
Hello again.
I don´t have really much knowledge in Velocity. So right now begging for help :D
#set($users = $xwiki.rightsmanager.usersApi.allUsers)
#foreach($user in $users)
I am getting an array of objects(user in xwiki). $users-array should be sorted by familyname
Here is the snippet from
https://velocity.apache.org/tools/devel/javadoc/org/apache/velocity/tools/ge...
I am still kinda confused how to apply this on mine
Single Property Sort #foreach($obj in $sorter.sort($objects, "name")) $obj.name Ordinal= $obj.ordinal #end End
You should use $sorttool, see http://extensions.xwiki.org/xwiki/bin/view/Extension/Velocity+Module#HVeloci... Thanks -Vincent
Thank you, guys =)
participants (2)
-
Rochlin Oleg -
Vincent Massol