Removing filed with key mapped as none

This commit is contained in:
Luca Frosini 2021-10-13 17:04:22 +02:00
parent 9105f4ba52
commit 1f60fa9f12
1 changed files with 10 additions and 5 deletions

View File

@ -71,6 +71,9 @@ public abstract class HelperMethods {
public static final String PUBLIC_CONTEX_KEY = "PublicVRE";
private static final String PATH_SEPARATOR = "/";
// This key is used in replaceFieldsKey() function to indicate to remove the metadata field
private static final String NONE_KEY = "none";
// caches
private static CacheInterface<String, String> userEmailCache = new CacheImpl<String, String>(1000 * 60 * 60 * 24);
private static CacheInterface<String, String> userFullnameCache = new CacheImpl<String, String>(1000 * 60 * 60 * 24);
@ -571,16 +574,18 @@ public abstract class HelperMethods {
if(namespaces.containsKey(entry.getKey())){
usedKey = namespaces.get(entry.getKey());
}
else{
} else{
usedKey = entry.getKey();
}
if(isSourceRecord)
if(isSourceRecord) {
usedKey = usedKey.replace("GRSF", "").trim();
}
// When the replaced key is none the metadata field must be removed
if(usedKey.compareTo(NONE_KEY)!=0) {
toReturn.put(usedKey, entry.getValue());
}
}
return toReturn;