[ 
https://issues.apache.org/jira/browse/JSPWIKI-526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707693#action_12707693
 ] 

Harry Metske commented on JSPWIKI-526:
--------------------------------------

Greg, after applying the patches, I noticed that the JUnit test fails.

If I change it to this, it succeeds :

{code}

        // Default order first
        assertTrue( comparator.compare( "a c", "a1c" ) < 0 );
        assertTrue( comparator.compare( "a1c", "abc" ) < 0 );

        // Now letters then numbers then other
        HumanComparator.CharType sortOrder[] = { 
HumanComparator.CharType.TYPE_LETTER, HumanComparator.CharType.TYPE_DIGIT,
                                                
HumanComparator.CharType.TYPE_OTHER };
        comparator.setSortOrder( sortOrder );
        assertTrue( comparator.compare( "a c", "a1c" ) > 0 );
        assertTrue( comparator.compare( "a1c", "abc" ) > 0 );

        // Now numbers then letters then other
        sortOrder[0] = HumanComparator.CharType.TYPE_DIGIT;
        sortOrder[1] = HumanComparator.CharType.TYPE_LETTER;
        sortOrder[2] = HumanComparator.CharType.TYPE_OTHER;
        comparator.setSortOrder( sortOrder );
        assertTrue( comparator.compare( "a c", "a1c" ) > 0 );
        assertTrue( comparator.compare( "a1c", "abc" ) < 0 );

{code}
Could you check that ?

thanks, Harry

> 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, 
> 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.

Reply via email to