mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 22:43:12 +00:00
Merge branch 'w2p-133552_AIP-packager-bitstream-url-fix-7.6' into w2p-133552_AIP-packager-bitstream-url-fix-main
This commit is contained in:
@@ -224,29 +224,17 @@ public class PREMISCrosswalk
|
|||||||
// c. made-up name based on sequence ID and extension.
|
// c. made-up name based on sequence ID and extension.
|
||||||
String sid = String.valueOf(bitstream.getSequenceID());
|
String sid = String.valueOf(bitstream.getSequenceID());
|
||||||
String baseUrl = configurationService.getProperty("dspace.ui.url");
|
String baseUrl = configurationService.getProperty("dspace.ui.url");
|
||||||
String handle = null;
|
|
||||||
// get handle of parent Item of this bitstream, if there is one:
|
|
||||||
List<Bundle> bn = bitstream.getBundles();
|
|
||||||
if (bn.size() > 0) {
|
|
||||||
List<Item> bi = bn.get(0).getItems();
|
|
||||||
if (bi.size() > 0) {
|
|
||||||
handle = bi.get(0).getHandle();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// get or make up name for bitstream:
|
// get or make up name for bitstream:
|
||||||
String bsName = bitstream.getName();
|
String bsName = bitstream.getName();
|
||||||
if (bsName == null) {
|
if (bsName == null) {
|
||||||
List<String> ext = bitstream.getFormat(context).getExtensions();
|
List<String> ext = bitstream.getFormat(context).getExtensions();
|
||||||
bsName = "bitstream_" + sid + (ext.size() > 0 ? ext.get(0) : "");
|
bsName = "bitstream_" + sid + (ext.size() > 0 ? ext.get(0) : "");
|
||||||
}
|
}
|
||||||
if (handle != null && baseUrl != null) {
|
if (baseUrl != null) {
|
||||||
oiv.setText(baseUrl
|
oiv.setText(baseUrl
|
||||||
+ "/bitstream/"
|
+ "/bitstreams/"
|
||||||
+ URLEncoder.encode(handle, "UTF-8")
|
+ bitstream.getID()
|
||||||
+ "/"
|
+ "/download");
|
||||||
+ sid
|
|
||||||
+ "/"
|
|
||||||
+ URLEncoder.encode(bsName, "UTF-8"));
|
|
||||||
} else {
|
} else {
|
||||||
oiv.setText(URLEncoder.encode(bsName, "UTF-8"));
|
oiv.setText(URLEncoder.encode(bsName, "UTF-8"));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user