Fix for Jira [DS-127] Item exporter does not export bitsteam descriptions

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3640 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Stuart Lewis
2009-03-26 23:37:16 +00:00
parent 4fadd4357b
commit 3b63800d57
3 changed files with 24 additions and 16 deletions

View File

@@ -584,6 +584,16 @@ public class ItemExport
String myName = b.getName(); String myName = b.getName();
String oldName = myName; 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 int myPrefix = 1; // only used with name conflict
InputStream is = b.retrieve(); InputStream is = b.retrieve();
@@ -616,12 +626,12 @@ public class ItemExport
if (b.isRegisteredBitstream()) if (b.isRegisteredBitstream())
{ {
out.println("-r -s " + b.getStoreNumber() out.println("-r -s " + b.getStoreNumber()
+ " -f " + myName + "\tbundle:" + " -f " + myName +
+ bundleName); "\tbundle:" + bundleName + description);
} }
else else
{ {
out.println(myName + "\tbundle:" + bundleName); out.println(myName + "\tbundle:" + bundleName + description);
} }
isDone = true; isDone = true;

View File

@@ -945,8 +945,7 @@ public class ItemImport
} }
catch (IOException e1) catch (IOException e1)
{ {
System.err System.err.println("Non-critical problem releasing resources.");
.println("Non-critical problem releasing resources.");
} }
} }
} }
@@ -995,9 +994,8 @@ public class ItemImport
String sRegistrationLine = line.trim(); String sRegistrationLine = line.trim();
int iAssetstore = -1; int iAssetstore = -1;
String sFilePath = null; String sFilePath = null;
String sBundle = null; String sBundle = null;
StringTokenizer tokenizer = StringTokenizer tokenizer = new StringTokenizer(sRegistrationLine);
new StringTokenizer(sRegistrationLine);
while (tokenizer.hasMoreTokens()) while (tokenizer.hasMoreTokens())
{ {
String sToken = tokenizer.nextToken(); String sToken = tokenizer.nextToken();
@@ -1020,7 +1018,6 @@ public class ItemImport
else if (sToken.equals("-f") && tokenizer.hasMoreTokens()) else if (sToken.equals("-f") && tokenizer.hasMoreTokens())
{ {
sFilePath = tokenizer.nextToken(); sFilePath = tokenizer.nextToken();
} }
else if (sToken.startsWith("bundle:")) else if (sToken.startsWith("bundle:"))
{ {
@@ -1041,7 +1038,8 @@ public class ItemImport
registerBitstream(c, i, iAssetstore, sFilePath, sBundle); registerBitstream(c, i, iAssetstore, sFilePath, sBundle);
System.out.println("\tRegistering Bitstream: " + sFilePath System.out.println("\tRegistering Bitstream: " + sFilePath
+ "\tAssetstore: " + iAssetstore + "\tAssetstore: " + iAssetstore
+ "\tBundle: " + sBundle); + "\tBundle: " + sBundle
+ "\tDescription: " + sBundle);
continue; // process next line in contents file continue; // process next line in contents file
} }
@@ -1107,10 +1105,9 @@ public class ItemImport
if (bundleExists) if (bundleExists)
{ {
String bundleName = line.substring(bMarkerIndex String bundleName = line.substring(bMarkerIndex
+ bundleMarker.length(), bEndIndex); + bundleMarker.length(), bEndIndex).trim();
processContentFileEntry(c, i, path, bitstreamName, processContentFileEntry(c, i, path, bitstreamName, bundleName);
bundleName);
System.out.println("\tBitstream: " + bitstreamName System.out.println("\tBitstream: " + bitstreamName
+ "\tBundle: " + bundleName); + "\tBundle: " + bundleName);
} }

View File

@@ -30,6 +30,7 @@
- [DS-60] netid.toLowerCase() in different classes and methods - ID: 2458187 - [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 - 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] - [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) (Stuart Lewis / Chris Yates / Flavio Botelho / Alex Barbieri / Reuben Pasquini / Paulo Matos)
- [2057378] Hierarchical LDAP support - [2057378] Hierarchical LDAP support