mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
minor fixes
This commit is contained in:
@@ -133,22 +133,22 @@ public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
|
|||||||
|| addedMetadata.contains(metadata)) {
|
|| addedMetadata.contains(metadata)) {
|
||||||
addedMetadata.add(metadata);
|
addedMetadata.add(metadata);
|
||||||
String[] md = splitMetadata(metadata);
|
String[] md = splitMetadata(metadata);
|
||||||
if (isValidMetadata(formName, md)) {
|
if (isValidMetadata(formName, md)) { //if in extra metadata or in the spefific form
|
||||||
if (isRepeatableMetadata(formName, md)) {
|
List<Value> values = itemLookup.getValues(field);
|
||||||
for (Value value : itemLookup.getValues(field)) {
|
if (values != null && values.size()>0){
|
||||||
String[] splitValue = splitValue(value.getAsString());
|
if (isRepeatableMetadata(formName, md)) { //if metadata is repeatable in form
|
||||||
if (splitValue[3] != null) {
|
for (Value value : values) {
|
||||||
item.addMetadata(md[0], md[1], md[2], md[3],
|
String[] splitValue = splitValue(value.getAsString());
|
||||||
splitValue[0], splitValue[1],
|
if (splitValue[3] != null) {
|
||||||
Integer.parseInt(splitValue[2]));
|
item.addMetadata(md[0], md[1], md[2], md[3],
|
||||||
} else {
|
splitValue[0], splitValue[1],
|
||||||
item.addMetadata(md[0], md[1], md[2], md[3],
|
Integer.parseInt(splitValue[2]));
|
||||||
value.getAsString());
|
} else {
|
||||||
|
item.addMetadata(md[0], md[1], md[2], md[3],
|
||||||
|
value.getAsString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
|
||||||
List<Value> values = itemLookup.getValues(field);
|
|
||||||
if (values != null && values.size()>0){
|
|
||||||
String value = values.iterator().next().getAsString();
|
String value = values.iterator().next().getAsString();
|
||||||
String[] splitValue = splitValue(value);
|
String[] splitValue = splitValue(value);
|
||||||
if (splitValue[3] != null) {
|
if (splitValue[3] != null) {
|
||||||
@@ -220,6 +220,7 @@ public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//KSTA:ToDo: Make this a modifier
|
||||||
if (md != null && md.contains("|")) {
|
if (md != null && md.contains("|")) {
|
||||||
String[] cond = md.trim().split("\\|");
|
String[] cond = md.trim().split("\\|");
|
||||||
for (int idx = 1; idx < cond.length; idx++) {
|
for (int idx = 1; idx < cond.length; idx++) {
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
/**
|
|
||||||
* The contents of this file are subject to the license and copyright
|
|
||||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
|
||||||
* tree and available online at
|
|
||||||
*
|
|
||||||
* http://www.dspace.org/license/
|
|
||||||
*/
|
|
||||||
package org.dspace.submit.lookup;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.dspace.submit.util.SubmissionLookupPublication;
|
|
||||||
|
|
||||||
public interface EnhancerSubmissionLookup {
|
|
||||||
|
|
||||||
List<String> getValues(
|
|
||||||
SubmissionLookupPublication publication);
|
|
||||||
|
|
||||||
}
|
|
@@ -68,7 +68,7 @@ public class MultipleSubmissionLookupDataLoader implements DataLoader {
|
|||||||
List<String> foundDOIs = new ArrayList<String>();
|
List<String> foundDOIs = new ArrayList<String>();
|
||||||
|
|
||||||
for (Record publication : recordSet.getRecords()) {
|
for (Record publication : recordSet.getRecords()) {
|
||||||
String providerName = publication.getValues(SubmissionLookupService.PROVIDER_NAME_FIELD).get(0).getAsString();
|
String providerName = SubmissionLookupService.getFirstValue(publication, SubmissionLookupService.PROVIDER_NAME_FIELD);
|
||||||
|
|
||||||
String doi = null;
|
String doi = null;
|
||||||
|
|
||||||
|
@@ -38,8 +38,6 @@ public class SubmissionLookupService {
|
|||||||
|
|
||||||
public static final String SEPARATOR_VALUE_REGEX = SEPARATOR_VALUE;
|
public static final String SEPARATOR_VALUE_REGEX = SEPARATOR_VALUE;
|
||||||
|
|
||||||
private Map<String, EnhancerSubmissionLookup> enhancedMetadata;
|
|
||||||
|
|
||||||
private List<SubmissionLookupProvider> providers;
|
private List<SubmissionLookupProvider> providers;
|
||||||
|
|
||||||
private Map<String, List<SubmissionLookupProvider>> idents2provs;
|
private Map<String, List<SubmissionLookupProvider>> idents2provs;
|
||||||
@@ -48,15 +46,7 @@ public class SubmissionLookupService {
|
|||||||
|
|
||||||
private TransformationEngine phase1TransformationEngine;
|
private TransformationEngine phase1TransformationEngine;
|
||||||
private TransformationEngine phase2TransformationEngine;
|
private TransformationEngine phase2TransformationEngine;
|
||||||
|
|
||||||
public void setEnhancedMetadata(
|
|
||||||
Map<String, EnhancerSubmissionLookup> enhancedMetadata) {
|
|
||||||
this.enhancedMetadata = enhancedMetadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, EnhancerSubmissionLookup> getEnhancedMetadata() {
|
|
||||||
return enhancedMetadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPhase2TransformationEngine(TransformationEngine phase2TransformationEngine) {
|
public void setPhase2TransformationEngine(TransformationEngine phase2TransformationEngine) {
|
||||||
this.phase2TransformationEngine = phase2TransformationEngine;
|
this.phase2TransformationEngine = phase2TransformationEngine;
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dspace.submit.util;
|
package org.dspace.submit.util;
|
||||||
|
|
||||||
|
import gr.ekt.bte.core.MutableRecord;
|
||||||
import gr.ekt.bte.core.Record;
|
import gr.ekt.bte.core.Record;
|
||||||
import gr.ekt.bte.core.Value;
|
import gr.ekt.bte.core.Value;
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ public class ItemSubmissionLookupDTO implements Serializable {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SubmissionLookupPublication pub = new SubmissionLookupPublication(MERGED_PUBLICATION_PROVIDER);
|
MutableRecord pub = new SubmissionLookupPublication(MERGED_PUBLICATION_PROVIDER);
|
||||||
for (SubmissionLookupProvider prov : providers)
|
for (SubmissionLookupProvider prov : providers)
|
||||||
{
|
{
|
||||||
for (Record p : publications)
|
for (Record p : publications)
|
||||||
@@ -80,7 +81,7 @@ public class ItemSubmissionLookupDTO implements Serializable {
|
|||||||
{
|
{
|
||||||
for (Value v : values)
|
for (Value v : values)
|
||||||
{
|
{
|
||||||
pub.add(field, v.getAsString());
|
pub.addValue(field, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user