[
https://issues.apache.org/jira/browse/JSPWIKI-526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12703083#action_12703083
]
Greg Kable commented on JSPWIKI-526:
------------------------------------
Thanks for the tips Janne.
Attached is the patch for the current 2.8 trunk. I decided to implement on 2.8
first because I have production wiki running 2.8 and the 2.8 code is more
stable. The patch ended up a little bigger than I expected because I added in
some extra stuff.
The brief summary of the jspwiki-526-PageSorter.patch is:
- Added a new JSPWiki property called jspwiki.pageNameComparator..class which
specifies a Comparator<String> class to be used as the default sort order for
pages sorted by name.
- Added a util class PageSorter which wraps up the pageNameComparator. This
class is initialised by and made available through WikiEngine. For a future
change, I think it would be better as a User preference rather than a global
property.
- Added a couple of Comparators which can be used as the default comparator. I
couldn't find a "human" comparator so I created one. If you know of one, we
can use it instead.
- Changed all places I could find where pages were presented in alphabetical
order to use PageSorter
- Added a new sortOrder parameter to AbstractReferralPlugin as suggested by
Santiago Gala on http://www.jspwiki.org/wiki/PluginRefactoring
All tests pass bar one WikIEngine test which seems to be invalid anyway. I
also have the patch in production on a small but fairly active wiki.
> Allow administrators to select the Comparator used for sorting page lists by
> name
> ---------------------------------------------------------------------------------
>
> Key: JSPWIKI-526
> URL: https://issues.apache.org/jira/browse/JSPWIKI-526
> Project: JSPWiki
> Issue Type: Improvement
> Components: Localization
> Reporter: Greg Kable
> Priority: Minor
> Attachments: jspwiki-526-PageSorter.patch
>
>
> I personally hate the order of pages returned by the standard sorting
> routines and would rather an order that understood numeric ordering. That
> is, instead of having the list:
> WikiPage1
> WikiPage10
> WikiPage2
> I'd like to get the list:
> WikiPage1
> WikiPage2
> WikiPage10
> There are also many other case, especially for localisation, where being able
> to set the page name order would be useful.
> To achieve this, I propose adding a JSPWiki property which specifies the
> Comparator to be used for page names. Before I do the work and submit a
> patch, I'd like to know:
> - Would this be a welcome feature?
> - Is jswpwiki.pageNameComparator an appropriate property name? If not, what
> do you suggest?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.