mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 22:13:08 +00:00
CSV Import fixes
This commit is contained in:
@@ -199,20 +199,22 @@ public class DSpaceCSV implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check that the scheme exists
|
// Check that the scheme exists
|
||||||
MetadataSchema foundSchema = metadataSchemaService.find(c, metadataSchema);
|
if (!StringUtils.equals(metadataSchema, "relation")) {
|
||||||
if (foundSchema == null) {
|
MetadataSchema foundSchema = metadataSchemaService.find(c, metadataSchema);
|
||||||
throw new MetadataImportInvalidHeadingException(clean[0],
|
if (foundSchema == null) {
|
||||||
MetadataImportInvalidHeadingException.SCHEMA,
|
throw new MetadataImportInvalidHeadingException(clean[0],
|
||||||
columnCounter);
|
MetadataImportInvalidHeadingException.SCHEMA,
|
||||||
}
|
columnCounter);
|
||||||
|
}
|
||||||
|
|
||||||
// Check that the metadata element exists in the schema
|
// Check that the metadata element exists in the schema
|
||||||
MetadataField foundField = metadataFieldService
|
MetadataField foundField = metadataFieldService
|
||||||
.findByElement(c, foundSchema, metadataElement, metadataQualifier);
|
.findByElement(c, foundSchema, metadataElement, metadataQualifier);
|
||||||
if (foundField == null && !StringUtils.equals(metadataSchema, "relationship")) {
|
if (foundField == null) {
|
||||||
throw new MetadataImportInvalidHeadingException(clean[0],
|
throw new MetadataImportInvalidHeadingException(clean[0],
|
||||||
MetadataImportInvalidHeadingException.ELEMENT,
|
MetadataImportInvalidHeadingException.ELEMENT,
|
||||||
columnCounter);
|
columnCounter);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the heading
|
// Store the heading
|
||||||
|
@@ -355,7 +355,7 @@ public class MetadataImport {
|
|||||||
// Add the metadata to the item
|
// Add the metadata to the item
|
||||||
List<BulkEditMetadataValue> relationships = new LinkedList<>();
|
List<BulkEditMetadataValue> relationships = new LinkedList<>();
|
||||||
for (BulkEditMetadataValue dcv : whatHasChanged.getAdds()) {
|
for (BulkEditMetadataValue dcv : whatHasChanged.getAdds()) {
|
||||||
if (StringUtils.equals(dcv.getSchema(), "relationship")) {
|
if (StringUtils.equals(dcv.getSchema(), "relation")) {
|
||||||
|
|
||||||
if (!StringUtils.equals(dcv.getElement(), "type")) {
|
if (!StringUtils.equals(dcv.getElement(), "type")) {
|
||||||
relationships.add(dcv);
|
relationships.add(dcv);
|
||||||
@@ -628,7 +628,7 @@ public class MetadataImport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (StringUtils.equals(schema, "relationship")) {
|
if (StringUtils.equals(schema, "relation")) {
|
||||||
handleRelationMetadata(c, item, schema, element, qualifier, language, values, authorities, confidences);
|
handleRelationMetadata(c, item, schema, element, qualifier, language, values, authorities, confidences);
|
||||||
} else {
|
} else {
|
||||||
itemService.clearMetadata(c, item, schema, element, qualifier, language);
|
itemService.clearMetadata(c, item, schema, element, qualifier, language);
|
||||||
|
Reference in New Issue
Block a user