[CST-5587] Orcid queue and history migration

This commit is contained in:
Luca Giamminonni
2022-04-27 13:20:02 +02:00
parent e726cc459f
commit 5b4130fbc7
94 changed files with 12354 additions and 12 deletions

View File

@@ -0,0 +1,47 @@
/**
* 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.util;
import org.apache.commons.lang3.StringUtils;
import org.dspace.submit.lookup.MapConverterModifier;
/**
*
* @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.it)
*/
public class SimpleMapConverter extends MapConverterModifier {
public String getValue(String key) {
boolean matchEmpty = false;
String stringValue = key;
String tmp = "";
if (mapping.containsKey(stringValue)) {
tmp = mapping.get(stringValue);
} else {
tmp = defaultValue;
for (String regex : regexConfig.keySet()) {
if (stringValue != null && stringValue.matches(regex)) {
tmp = stringValue.replaceAll(regex, regexConfig.get(regex));
if (StringUtils.isBlank(tmp)) {
matchEmpty = true;
}
}
}
}
if ("@@ident@@".equals(tmp)) {
return stringValue;
} else if (StringUtils.isNotBlank(tmp) || (StringUtils.isBlank(tmp) && matchEmpty)) {
return tmp;
}
return stringValue;
}
}