I want to displays members of a group, sortet by the displayName instead of the username.
Something like this:
{code} #set($memberslist = $userAccessor.getMemberNamesAsList($group)) #set($myArrayList = []) #foreach( $member in $memberslist ) $myArrayList.add( {"fullname" : $action.getUserFullName($member) }) #end #foreach( $item in $sortTool.sort($myArrayList, "fullname:asc") ) <li> $item.toString() #end {code}
This does not work for me. Can you help me?
Sana,
many thanks. Sorry, I didn't reply to your hint.
Unfortunately that solution didn't work for me. I got an exception error.
So that request is still open (for me). Any idea (someone else)?
I have now a new similar task: I get the descendants of a given page in a user macro. I want to sort that pages by the last-modify-date. Again: how can that be done?
My user macro so far:
## Macro title: Page descendants ## Macro has a body: N ## List all descendant pages below a give page ## Developed by: Stefan Baader ## Date created: 13/10/2015 ## Installed by: Stefan Baader ## @param Page:title=Page|type=confluence-content|required=true|desc=Select a page do use #set( $pages = $pageManager.getPage($space.key, $paramPage).getDescendants() ) Descendants of page "${paramPage}" <table> <tr> <th>Seite</th> <th style="white-space:nowrap;">Vers. Nr.</th> <th style="white-space:nowrap;">Aktualisiert am</th> </tr> #foreach( $page in $pages) <tr> <td> <a href="$req.contextPath/pages/viewpage.action?pageId=$page.id">$page.title</a> </td> <td> $page.getVersion() </td> <td style="white-space:nowrap;"> $page.getLastModificationDate() </td> </tr> #end </table>
Have you looked at this one: https://answers.atlassian.com/questions/218237/sort-list-of-objects-in-velocity
It helped me with my sorting issues :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.