mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 21:43:11 +00:00
(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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user