(Scott Phillips) Fixed a problem where importing/exporting items multiple times would result in duplicate identifier.uri metadata records being added each time. Now it will check to see if the metadata record exists before adding it.

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3588 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Scott Phillips
2009-03-13 17:21:29 +00:00
parent 5d4b5c0b35
commit 5e5d52d985

View File

@@ -116,8 +116,14 @@ public class InstallItem
String handleref = HandleManager.getCanonicalForm(handle);
// Add handle as identifier.uri DC value
item.addDC("identifier", "uri", null, handleref);
// Add handle as identifier.uri DC value, first check that identifier dosn't allready exist
boolean identifierExists = false;
DCValue[] identifiers = item.getDC("identifier", "uri", Item.ANY);
for (DCValue identifier : identifiers)
if (handleref.equals(identifier.value))
identifierExists = true;
if (!identifierExists)
item.addDC("identifier", "uri", null, handleref);
String provDescription = "Made available in DSpace on " + now
+ " (GMT). " + getBitstreamProvenanceMessage(item);