Header contains context property only when requested
This commit is contained in:
parent
fa47217afd
commit
93855856b7
|
@ -49,6 +49,10 @@ import com.orientechnologies.orient.core.record.ODirection;
|
||||||
@Path(AccessPath.ACCESS_PATH_PART)
|
@Path(AccessPath.ACCESS_PATH_PART)
|
||||||
public class Access extends BaseRest {
|
public class Access extends BaseRest {
|
||||||
|
|
||||||
|
public Access() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* e.g. GET /access/contexts
|
* e.g. GET /access/contexts
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -17,6 +17,11 @@ public class BaseRest {
|
||||||
|
|
||||||
protected Logger logger = LoggerFactory.getLogger(this.getClass());
|
protected Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
|
|
||||||
|
public BaseRest() {
|
||||||
|
ContextUtility.getHierarchicalMode().set(false);
|
||||||
|
ContextUtility.getIncludeInstanceContexts().set(false);
|
||||||
|
}
|
||||||
|
|
||||||
@Context
|
@Context
|
||||||
protected UriInfo uriInfo;
|
protected UriInfo uriInfo;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,11 @@ public class ContextManager {
|
||||||
*/
|
*/
|
||||||
private static Logger logger = LoggerFactory.getLogger(ContextManager.class);
|
private static Logger logger = LoggerFactory.getLogger(ContextManager.class);
|
||||||
|
|
||||||
|
public ContextManager() {
|
||||||
|
ContextUtility.getHierarchicalMode().set(false);
|
||||||
|
ContextUtility.getIncludeInstanceContexts().set(false);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GET /contexts
|
* GET /contexts
|
||||||
*
|
*
|
||||||
|
|
|
@ -35,6 +35,10 @@ import org.gcube.informationsystem.resourceregistry.instances.base.ElementManage
|
||||||
@Path(InstancePath.INSTANCES_PATH_PART)
|
@Path(InstancePath.INSTANCES_PATH_PART)
|
||||||
public class InstancesManager extends BaseRest {
|
public class InstancesManager extends BaseRest {
|
||||||
|
|
||||||
|
public InstancesManager() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GET /instances/{TYPE_NAME}[?polymorphic=true]
|
* GET /instances/{TYPE_NAME}[?polymorphic=true]
|
||||||
* e.g. GET /instances/ContactFacet?polymorphic=true
|
* e.g. GET /instances/ContactFacet?polymorphic=true
|
||||||
|
|
|
@ -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.AccessPath;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.rest.SharingPath;
|
import org.gcube.informationsystem.resourceregistry.api.rest.SharingPath;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.rest.SharingPath.SharingOperation;
|
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.ElementManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagementUtility;
|
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagementUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.model.ERManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.model.ERManagement;
|
||||||
|
@ -42,6 +43,11 @@ public class SharingManager {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(SharingManager.class);
|
private static Logger logger = LoggerFactory.getLogger(SharingManager.class);
|
||||||
|
|
||||||
|
public SharingManager() {
|
||||||
|
ContextUtility.getHierarchicalMode().set(false);
|
||||||
|
ContextUtility.getIncludeInstanceContexts().set(false);
|
||||||
|
}
|
||||||
|
|
||||||
protected String serializeAffectedInstaces(ObjectMapper objectMapper, Map<UUID,JsonNode> affectedInstances) throws ResourceRegistryException {
|
protected String serializeAffectedInstaces(ObjectMapper objectMapper, Map<UUID,JsonNode> affectedInstances) throws ResourceRegistryException {
|
||||||
ArrayNode arrayNode = objectMapper.createArrayNode();
|
ArrayNode arrayNode = objectMapper.createArrayNode();
|
||||||
for(JsonNode jsonNode : affectedInstances.values()) {
|
for(JsonNode jsonNode : affectedInstances.values()) {
|
||||||
|
|
|
@ -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.exceptions.schema.SchemaNotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
|
import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.rest.TypePath;
|
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.resourceregistry.types.SchemaManagement;
|
||||||
import org.gcube.informationsystem.types.TypeMapper;
|
import org.gcube.informationsystem.types.TypeMapper;
|
||||||
import org.gcube.informationsystem.types.reference.Type;
|
import org.gcube.informationsystem.types.reference.Type;
|
||||||
|
@ -35,6 +36,11 @@ public class TypeManager {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(TypeManager.class);
|
private static Logger logger = LoggerFactory.getLogger(TypeManager.class);
|
||||||
|
|
||||||
|
public TypeManager() {
|
||||||
|
ContextUtility.getHierarchicalMode().set(false);
|
||||||
|
ContextUtility.getIncludeInstanceContexts().set(false);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PUT /types/{TYPE_NAME}
|
* PUT /types/{TYPE_NAME}
|
||||||
* e.g. PUT /types/ContactFacet
|
* e.g. PUT /types/ContactFacet
|
||||||
|
|
Loading…
Reference in New Issue