mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-13 21:13:19 +00:00
Added ordering to bitstreams when listing bundles in dspace-api that defaults to sequence_id ASC.
Previously there had been no ordering on order retrieved, and order was dependent on last modified. UI will pick up on it unless it does an additional sorting afterwards. Issue #DS-192 - Bitstreams should be returned ordered git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5564 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -50,6 +50,7 @@ import org.dspace.authorize.AuthorizeConfiguration;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.authorize.AuthorizeManager;
|
||||
import org.dspace.authorize.ResourcePolicy;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.LogManager;
|
||||
@@ -102,13 +103,22 @@ public class Bundle extends DSpaceObject
|
||||
ourContext = context;
|
||||
bundleRow = row;
|
||||
bitstreams = new ArrayList<Bitstream>();
|
||||
String bitstreamOrderingField = ConfigurationManager.getProperty("webui.bitstream.order.field", "sequence_id");
|
||||
String bitstreamOrderingDirection = ConfigurationManager.getProperty("webui.bitstream.order.direction", "ASC");
|
||||
|
||||
StringBuilder query = new StringBuilder();
|
||||
query.append("SELECT bitstream.* FROM bitstream, bundle2bitstream WHERE");
|
||||
query.append(" bundle2bitstream.bitstream_id=bitstream.bitstream_id AND");
|
||||
query.append(" bundle2bitstream.bundle_id= ?");
|
||||
query.append(" ORDER BY bitstream.");
|
||||
query.append(bitstreamOrderingField);
|
||||
query.append(" ");
|
||||
query.append(bitstreamOrderingDirection);
|
||||
|
||||
// Get bitstreams
|
||||
TableRowIterator tri = DatabaseManager.queryTable(
|
||||
ourContext, "bitstream",
|
||||
"SELECT bitstream.* FROM bitstream, bundle2bitstream WHERE "
|
||||
+ "bundle2bitstream.bitstream_id=bitstream.bitstream_id AND "
|
||||
+ "bundle2bitstream.bundle_id= ? ",
|
||||
query.toString(),
|
||||
bundleRow.getIntColumn("bundle_id"));
|
||||
|
||||
try
|
||||
|
Reference in New Issue
Block a user