mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 12:03:09 +00:00
DS-3406: Sort communities and collections in-memory using a comparator
This commit is contained in:
@@ -9,6 +9,7 @@ package org.dspace.content;
|
||||
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.dspace.content.comparator.NameAscendingComparator;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.CommunityService;
|
||||
import org.dspace.core.*;
|
||||
@@ -140,6 +141,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
*/
|
||||
public List<Collection> getCollections()
|
||||
{
|
||||
Collections.sort(collections, new NameAscendingComparator());
|
||||
return collections;
|
||||
}
|
||||
|
||||
@@ -162,6 +164,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
*/
|
||||
public List<Community> getSubcommunities()
|
||||
{
|
||||
Collections.sort(subCommunities, new NameAscendingComparator());
|
||||
return subCommunities;
|
||||
}
|
||||
|
||||
@@ -173,6 +176,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
*/
|
||||
public List<Community> getParentCommunities()
|
||||
{
|
||||
Collections.sort(parentCommunities, new NameAscendingComparator());
|
||||
return parentCommunities;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user