added new reserved prefixes `relatedIdentifier:Zenodo`
This commit is contained in:
parent
061ef6148b
commit
481817e588
|
@ -74,13 +74,16 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
// private static final org.slf4j.Logger logger =
|
||||
// LoggerFactory.getLogger(CKANPublisherServicesImpl.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(CKANPublisherServicesImpl.class);
|
||||
public static final String ITEM_URL_FIELD = "Item URL";
|
||||
public static final String SYSTEM_KEY_PREFIX = "system:";
|
||||
public static final String SYS_TYPE = SYSTEM_KEY_PREFIX + "type";
|
||||
|
||||
public static final String TAGS_VOCABULARY_KEY = "TAGS_VOCABULARY";
|
||||
|
||||
public static final List<String> SYSTEM_CUSTOM_FIELDS_PREFIXES = Arrays.asList(ITEM_URL_FIELD, SYSTEM_KEY_PREFIX);
|
||||
public static final String ITEM_URL_FIELD = "Item URL";
|
||||
public static final String RELATED_IDENTIFIER_ZENODO = "relatedIdentifier:Zenodo";
|
||||
public static final String SYSTEM_KEY_PREFIX = "system:";
|
||||
//These fiels are not upgradable via Edit Facility. They are not returned to the client
|
||||
public static final List<String> NOT_UPGRADABLE_CUSTOM_FIELDS_PREFIXES = Arrays.asList(ITEM_URL_FIELD, SYSTEM_KEY_PREFIX, RELATED_IDENTIFIER_ZENODO);
|
||||
|
||||
public static final String SYS_TYPE = SYSTEM_KEY_PREFIX + "type";
|
||||
// map <orgName, scope>
|
||||
private ConcurrentHashMap<String, String> mapOrganizationScope = new ConcurrentHashMap<String, String>();
|
||||
|
||||
|
@ -1331,13 +1334,13 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
* @return the map
|
||||
*/
|
||||
public static Map<String, List<String>> purgeSystemFields(Map<String, List<String>> extras) {
|
||||
logger.info("Purging extras from reserved fields {} ", SYSTEM_CUSTOM_FIELDS_PREFIXES);
|
||||
logger.info("Purging extras from reserved fields {} ", NOT_UPGRADABLE_CUSTOM_FIELDS_PREFIXES);
|
||||
if (extras == null)
|
||||
return null;
|
||||
|
||||
Map<String, List<String>> extrasPop = new HashMap<String, List<String>>(extras);
|
||||
for (String key : extras.keySet()) {
|
||||
List<String> list = SYSTEM_CUSTOM_FIELDS_PREFIXES.stream().filter(scf -> key.startsWith(scf))
|
||||
List<String> list = NOT_UPGRADABLE_CUSTOM_FIELDS_PREFIXES.stream().filter(scf -> key.startsWith(scf))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (list.size() > 0)
|
||||
|
@ -1398,7 +1401,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
|
||||
Map<String, List<String>> reserverSystemExtras = new HashMap<String, List<String>>();
|
||||
for (String key : extras.keySet()) {
|
||||
List<String> list = SYSTEM_CUSTOM_FIELDS_PREFIXES.stream().filter(scf -> key.startsWith(scf))
|
||||
List<String> list = NOT_UPGRADABLE_CUSTOM_FIELDS_PREFIXES.stream().filter(scf -> key.startsWith(scf))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (list.size() > 0)
|
||||
|
|
Loading…
Reference in New Issue