diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/Access.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/Access.java index ec7beb0..cc178b2 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/Access.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/Access.java @@ -49,6 +49,10 @@ import com.orientechnologies.orient.core.record.ODirection; @Path(AccessPath.ACCESS_PATH_PART) public class Access extends BaseRest { + public Access() { + super(); + } + /* * e.g. GET /access/contexts */ diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/BaseRest.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/BaseRest.java index 1b1f9ae..f63feca 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/BaseRest.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/BaseRest.java @@ -17,6 +17,11 @@ public class BaseRest { protected Logger logger = LoggerFactory.getLogger(this.getClass()); + public BaseRest() { + ContextUtility.getHierarchicalMode().set(false); + ContextUtility.getIncludeInstanceContexts().set(false); + } + @Context protected UriInfo uriInfo; diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java index 582b6fc..46b233b 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/ContextManager.java @@ -36,6 +36,11 @@ public class ContextManager { */ private static Logger logger = LoggerFactory.getLogger(ContextManager.class); + public ContextManager() { + ContextUtility.getHierarchicalMode().set(false); + ContextUtility.getIncludeInstanceContexts().set(false); + } + /* * GET /contexts * diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/InstancesManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/InstancesManager.java index 07929ef..37c1f75 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/InstancesManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/InstancesManager.java @@ -35,6 +35,10 @@ import org.gcube.informationsystem.resourceregistry.instances.base.ElementManage @Path(InstancePath.INSTANCES_PATH_PART) public class InstancesManager extends BaseRest { + public InstancesManager() { + super(); + } + /* * GET /instances/{TYPE_NAME}[?polymorphic=true] * e.g. GET /instances/ContactFacet?polymorphic=true diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/SharingManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/SharingManager.java index acfb78f..45804db 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/SharingManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/SharingManager.java @@ -28,6 +28,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.Schema import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath; import org.gcube.informationsystem.resourceregistry.api.rest.SharingPath; import org.gcube.informationsystem.resourceregistry.api.rest.SharingPath.SharingOperation; +import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility; import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement; import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagementUtility; import org.gcube.informationsystem.resourceregistry.instances.model.ERManagement; @@ -42,6 +43,11 @@ public class SharingManager { private static Logger logger = LoggerFactory.getLogger(SharingManager.class); + public SharingManager() { + ContextUtility.getHierarchicalMode().set(false); + ContextUtility.getIncludeInstanceContexts().set(false); + } + protected String serializeAffectedInstaces(ObjectMapper objectMapper, Map affectedInstances) throws ResourceRegistryException { ArrayNode arrayNode = objectMapper.createArrayNode(); for(JsonNode jsonNode : affectedInstances.values()) { diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/TypeManager.java b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/TypeManager.java index 99f70c3..6eedfb2 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/rest/TypeManager.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/rest/TypeManager.java @@ -21,6 +21,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.Schema import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException; import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath; import org.gcube.informationsystem.resourceregistry.api.rest.TypePath; +import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility; import org.gcube.informationsystem.resourceregistry.types.SchemaManagement; import org.gcube.informationsystem.types.TypeMapper; import org.gcube.informationsystem.types.reference.Type; @@ -35,6 +36,11 @@ public class TypeManager { private static Logger logger = LoggerFactory.getLogger(TypeManager.class); + public TypeManager() { + ContextUtility.getHierarchicalMode().set(false); + ContextUtility.getIncludeInstanceContexts().set(false); + } + /* * PUT /types/{TYPE_NAME} * e.g. PUT /types/ContactFacet