mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-09 02:54:20 +00:00
DS-3406: Sort communities and collections in-memory using a comparator
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
package org.dspace.content;
|
||||
|
||||
import org.dspace.content.comparator.NameAscendingComparator;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.CollectionService;
|
||||
import org.dspace.core.*;
|
||||
@@ -16,6 +17,7 @@ import org.hibernate.proxy.HibernateProxyHelper;
|
||||
import javax.persistence.*;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -263,6 +265,7 @@ public class Collection extends DSpaceObject implements DSpaceObjectLegacySuppor
|
||||
*/
|
||||
public List<Community> getCommunities() throws SQLException
|
||||
{
|
||||
Collections.sort(communities, new NameAscendingComparator());
|
||||
return communities;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user