diff --git a/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExport.java b/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExport.java index 60a835d1dc..a04c44586f 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExport.java +++ b/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExport.java @@ -584,6 +584,16 @@ public class ItemExport String myName = b.getName(); String oldName = myName; + + String description = b.getDescription(); + if ((description != null) && (!description.equals(""))) + { + description = "\tdescription:" + description; + } else + { + description = ""; + } + int myPrefix = 1; // only used with name conflict InputStream is = b.retrieve(); @@ -616,12 +626,12 @@ public class ItemExport if (b.isRegisteredBitstream()) { out.println("-r -s " + b.getStoreNumber() - + " -f " + myName + "\tbundle:" - + bundleName); + + " -f " + myName + + "\tbundle:" + bundleName + description); } else { - out.println(myName + "\tbundle:" + bundleName); + out.println(myName + "\tbundle:" + bundleName + description); } isDone = true; diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java index e150a95938..ffdc801f94 100755 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java @@ -945,8 +945,7 @@ public class ItemImport } catch (IOException e1) { - System.err - .println("Non-critical problem releasing resources."); + System.err.println("Non-critical problem releasing resources."); } } } @@ -995,9 +994,8 @@ public class ItemImport String sRegistrationLine = line.trim(); int iAssetstore = -1; String sFilePath = null; - String sBundle = null; - StringTokenizer tokenizer = - new StringTokenizer(sRegistrationLine); + String sBundle = null; + StringTokenizer tokenizer = new StringTokenizer(sRegistrationLine); while (tokenizer.hasMoreTokens()) { String sToken = tokenizer.nextToken(); @@ -1020,13 +1018,12 @@ public class ItemImport else if (sToken.equals("-f") && tokenizer.hasMoreTokens()) { sFilePath = tokenizer.nextToken(); - } else if (sToken.startsWith("bundle:")) { sBundle = sToken.substring(7); } - else + else { // unrecognized token - should be no problem } @@ -1040,8 +1037,9 @@ public class ItemImport } registerBitstream(c, i, iAssetstore, sFilePath, sBundle); System.out.println("\tRegistering Bitstream: " + sFilePath - + "\tAssetstore: " + iAssetstore - + "\tBundle: " + sBundle); + + "\tAssetstore: " + iAssetstore + + "\tBundle: " + sBundle + + "\tDescription: " + sBundle); continue; // process next line in contents file } @@ -1107,10 +1105,9 @@ public class ItemImport if (bundleExists) { String bundleName = line.substring(bMarkerIndex - + bundleMarker.length(), bEndIndex); + + bundleMarker.length(), bEndIndex).trim(); - processContentFileEntry(c, i, path, bitstreamName, - bundleName); + processContentFileEntry(c, i, path, bitstreamName, bundleName); System.out.println("\tBitstream: " + bitstreamName + "\tBundle: " + bundleName); } @@ -1188,7 +1185,7 @@ public class ItemImport newBundleName = "ORIGINAL"; } } - + if (!isTest) { // find the bundle diff --git a/dspace/CHANGES b/dspace/CHANGES index 0963b1c87b..dc73df2cd9 100644 --- a/dspace/CHANGES +++ b/dspace/CHANGES @@ -30,6 +30,7 @@ - [DS-60] netid.toLowerCase() in different classes and methods - ID: 2458187 - Fix for Jira [DS-98] Key jsp.mydspace.request.export.community not set in Messages.properties - [2696133] New export option (migrate) and fix for Jira [DS-59] + - Fix for Jira [DS-127] Item exporter does not export bitsteam descriptions (Stuart Lewis / Chris Yates / Flavio Botelho / Alex Barbieri / Reuben Pasquini / Paulo Matos) - [2057378] Hierarchical LDAP support