mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
In sortResults method, use date.issued instead of date.accessioned
git-svn-id: http://scm.dspace.org/svn/repo/trunk@202 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -702,8 +702,8 @@ public class Browse
|
||||
return;
|
||||
|
||||
ItemComparator ic = params.getSortByTitle().booleanValue() ?
|
||||
new ItemComparator("title", null, Item.ANY, true) :
|
||||
new ItemComparator("date", "accessioned", Item.ANY, true);
|
||||
new ItemComparator("title", null, Item.ANY, true) :
|
||||
new ItemComparator("date", "issued", Item.ANY, true);
|
||||
|
||||
Collections.sort(results, ic);
|
||||
}
|
||||
|
@@ -46,6 +46,7 @@ import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import org.dspace.browse.Browse;
|
||||
import org.dspace.content.DCValue;
|
||||
import org.dspace.content.Item;
|
||||
|
||||
@@ -109,6 +110,13 @@ public class ItemComparator implements Comparator
|
||||
String firstValue = getValue(firstItem.getDC(element, qualifier, language));
|
||||
String secondValue = getValue(secondItem.getDC(element, qualifier, language));
|
||||
|
||||
// Normalize titles for comparison purposes
|
||||
if ("title".equals(element))
|
||||
{
|
||||
firstValue = Browse.getNormalizedTitle(firstValue, language);
|
||||
secondValue = Browse.getNormalizedTitle(secondValue, language);
|
||||
}
|
||||
|
||||
if ((firstValue == null) && (secondValue == null))
|
||||
return 0;
|
||||
if ((firstValue != null) && (secondValue == null))
|
||||
|
Reference in New Issue
Block a user