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 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;

View File

@@ -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