diff --git a/CHANGELOG.md b/CHANGELOG.md index fea72d5..e07e4e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [v4.2.0-SNAPSHOT] - Added INCLUDE_RELATION_PARAM param in AccessPath used by query APIs [#20298] -- Added QueryTempalte support [#22091] +- Added support for context names included in header among UUIDs [#22090] +- Added support for Json Query [#22047] +- Added support for Query Templates [#22091] ## [v4.1.0] diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextUtility.java b/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextUtility.java index 064df8c..43dcc24 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextUtility.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/api/contexts/ContextUtility.java @@ -2,12 +2,15 @@ package org.gcube.informationsystem.resourceregistry.api.contexts; import java.io.IOException; import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.UUID; +import org.gcube.com.fasterxml.jackson.core.JsonParseException; import org.gcube.com.fasterxml.jackson.databind.JavaType; +import org.gcube.com.fasterxml.jackson.databind.JsonMappingException; import org.gcube.com.fasterxml.jackson.databind.ObjectMapper; import org.gcube.informationsystem.utils.ElementMapper; import org.slf4j.Logger; @@ -17,15 +20,21 @@ public class ContextUtility { private static Logger logger = LoggerFactory.getLogger(ContextUtility.class); - public static Set getContextUUIDSet(String jsonArray) throws IOException { +// public static Set getContextUUIDSe(String jsonArray) throws IOException { +// ObjectMapper mapper = ElementMapper.getObjectMapper(); +// JavaType type = mapper.getTypeFactory().constructCollectionType(HashSet.class, UUID.class); +// return mapper.readValue(jsonArray, type); +// } +// +// public static Set getContextFullNameSet(String jsonArray) throws Exception { +// Set uuids = getContextUUIDSet(jsonArray); +// return getContextFullNameSet(uuids); +// } +// + public static Map getContextMap(String objectnode) throws JsonParseException, JsonMappingException, IOException{ ObjectMapper mapper = ElementMapper.getObjectMapper(); - JavaType type = mapper.getTypeFactory().constructCollectionType(HashSet.class, UUID.class); - return mapper.readValue(jsonArray, type); - } - - public static Set getContextFullNameSet(String jsonArray) throws Exception { - Set uuids = getContextUUIDSet(jsonArray); - return getContextFullNameSet(uuids); + JavaType type = mapper.getTypeFactory().constructMapType(HashMap.class, UUID.class, String.class); + return mapper.readValue(objectnode, type); } public static Set getContextUUIDSet(Collection uuidStrings) throws Exception {