Reorganizing code
This commit is contained in:
parent
421dce843f
commit
b98af42e99
|
@ -20,7 +20,7 @@ import org.gcube.informationsystem.resourceregistry.contexts.security.AdminSecur
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext.PermissionMode;
|
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext.PermissionMode;
|
||||||
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagementUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.utils.Utility;
|
import org.gcube.informationsystem.resourceregistry.utils.Utility;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -225,7 +225,7 @@ public class ContextUtility {
|
||||||
}
|
}
|
||||||
|
|
||||||
OResult oResult = resultSet.next();
|
OResult oResult = resultSet.next();
|
||||||
OVertex context = ElementManagement.getElementFromOptional(oResult.getVertex());
|
OVertex context = ElementManagementUtility.getElementFromOptional(oResult.getVertex());
|
||||||
|
|
||||||
logger.trace("Context Representing Vertex : {}", Utility.toJsonString(context, true));
|
logger.trace("Context Representing Vertex : {}", Utility.toJsonString(context, true));
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -160,22 +159,7 @@ public abstract class ElementManagement<El extends OElement> {
|
||||||
checkJsonNode();
|
checkJsonNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <E extends OElement> E getElementFromOptional(Optional<E> optional) throws ResourceRegistryException {
|
|
||||||
if(optional.isPresent()) {
|
|
||||||
return optional.get();
|
|
||||||
}else {
|
|
||||||
throw new ResourceRegistryException("An element not belonging to any defined type should not exists. Please contact the administrator.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static OClass getOClass(OElement oElement) throws ResourceRegistryException {
|
|
||||||
Optional<OClass> optional = oElement.getSchemaType();
|
|
||||||
if(optional.isPresent()) {
|
|
||||||
return optional.get();
|
|
||||||
}else {
|
|
||||||
throw new ResourceRegistryException("An element not belonging to any defined type should not exists. Please contact the administrator.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setoDatabaseDocument(ODatabaseDocument oDatabaseDocument) {
|
public void setoDatabaseDocument(ODatabaseDocument oDatabaseDocument) {
|
||||||
this.oDatabaseDocument = oDatabaseDocument;
|
this.oDatabaseDocument = oDatabaseDocument;
|
||||||
|
@ -188,7 +172,7 @@ public abstract class ElementManagement<El extends OElement> {
|
||||||
protected OClass getOClass() throws SchemaException, ResourceRegistryException {
|
protected OClass getOClass() throws SchemaException, ResourceRegistryException {
|
||||||
if(oClass == null) {
|
if(oClass == null) {
|
||||||
if(element != null) {
|
if(element != null) {
|
||||||
oClass = getOClass(element);
|
oClass = ElementManagementUtility.getOClass(element);
|
||||||
} else {
|
} else {
|
||||||
TypesCache typesCache = TypesCache.getInstance();
|
TypesCache typesCache = TypesCache.getInstance();
|
||||||
oClass = TypesCache.getInstance().getTypeOClass(elementType);
|
oClass = TypesCache.getInstance().getTypeOClass(elementType);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.instances.base;
|
package org.gcube.informationsystem.resourceregistry.instances.base;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.base.reference.AccessType;
|
import org.gcube.informationsystem.base.reference.AccessType;
|
||||||
|
@ -132,7 +133,7 @@ public class ElementManagementUtility {
|
||||||
|
|
||||||
OClass oClass = null;
|
OClass oClass = null;
|
||||||
try {
|
try {
|
||||||
oClass = ElementManagement.getOClass(vertex);
|
oClass = ElementManagementUtility.getOClass(vertex);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
String error = String.format("Unable to detect type of %s. %s", vertex.toString(),
|
String error = String.format("Unable to detect type of %s. %s", vertex.toString(),
|
||||||
Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
|
Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
|
||||||
|
@ -170,7 +171,7 @@ public class ElementManagementUtility {
|
||||||
OEdge.class.getSimpleName() + "instance is null. " + Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
|
OEdge.class.getSimpleName() + "instance is null. " + Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
OClass oClass = ElementManagement.getOClass(edge);
|
OClass oClass = ElementManagementUtility.getOClass(edge);
|
||||||
|
|
||||||
RelationManagement relationManagement = null;
|
RelationManagement relationManagement = null;
|
||||||
if(oClass.isSubClassOf(ConsistsOf.NAME)) {
|
if(oClass.isSubClassOf(ConsistsOf.NAME)) {
|
||||||
|
@ -191,4 +192,21 @@ public class ElementManagementUtility {
|
||||||
return relationManagement;
|
return relationManagement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <E extends OElement> E getElementFromOptional(Optional<E> optional) throws ResourceRegistryException {
|
||||||
|
if(optional.isPresent()) {
|
||||||
|
return optional.get();
|
||||||
|
}else {
|
||||||
|
throw new ResourceRegistryException("An element not belonging to any defined type should not exists. Please contact the administrator.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OClass getOClass(OElement oElement) throws ResourceRegistryException {
|
||||||
|
Optional<OClass> optional = oElement.getSchemaType();
|
||||||
|
if(optional.isPresent()) {
|
||||||
|
return optional.get();
|
||||||
|
}else {
|
||||||
|
throw new ResourceRegistryException("An element not belonging to any defined type should not exists. Please contact the administrator.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -612,7 +612,7 @@ public abstract class EntityManagement<E extends Entity> extends EntityElementMa
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
OClass oClass = ElementManagement.getOClass(vertex);
|
OClass oClass = ElementManagementUtility.getOClass(vertex);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the requested type (i.e. elementType)
|
* If the requested type (i.e. elementType)
|
||||||
|
@ -725,7 +725,7 @@ public abstract class EntityManagement<E extends Entity> extends EntityElementMa
|
||||||
|
|
||||||
while(resultSet.hasNext()) {
|
while(resultSet.hasNext()) {
|
||||||
OResult oResult = resultSet.next();
|
OResult oResult = resultSet.next();
|
||||||
OElement element = ElementManagement.getElementFromOptional(oResult.getElement());
|
OElement element = ElementManagementUtility.getElementFromOptional(oResult.getElement());
|
||||||
|
|
||||||
if(polymorphic) {
|
if(polymorphic) {
|
||||||
OClass oClass = null;
|
OClass oClass = null;
|
||||||
|
@ -733,7 +733,7 @@ public abstract class EntityManagement<E extends Entity> extends EntityElementMa
|
||||||
if(element instanceof OEdge) {
|
if(element instanceof OEdge) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
oClass = ElementManagement.getOClass(element);
|
oClass = ElementManagementUtility.getOClass(element);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
String error = String.format("Unable to detect type of %s. %s", element.toString(),
|
String error = String.format("Unable to detect type of %s. %s", element.toString(),
|
||||||
Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
|
Utility.SHOULD_NOT_OCCUR_ERROR_MESSAGE);
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resour
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext.PermissionMode;
|
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext.PermissionMode;
|
||||||
|
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagementUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.model.relations.ConsistsOfManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.model.relations.ConsistsOfManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.model.relations.IsRelatedToManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.model.relations.IsRelatedToManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.model.relations.RelationManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.model.relations.RelationManagement;
|
||||||
|
@ -215,7 +216,7 @@ public class ResourceManagement extends EntityManagement<Resource> {
|
||||||
while(iterator.hasNext()) {
|
while(iterator.hasNext()) {
|
||||||
|
|
||||||
OEdge edge = iterator.next();
|
OEdge edge = iterator.next();
|
||||||
OClass oClass = getOClass(edge);
|
OClass oClass = ElementManagementUtility.getOClass(edge);
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
RelationManagement relationManagement = null;
|
RelationManagement relationManagement = null;
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class QueryImpl implements Query {
|
||||||
|
|
||||||
while(resultSet.hasNext()) {
|
while(resultSet.hasNext()) {
|
||||||
OResult oResult = resultSet.next();
|
OResult oResult = resultSet.next();
|
||||||
OElement element = ElementManagement.getElementFromOptional(oResult.getElement());
|
OElement element = ElementManagementUtility.getElementFromOptional(oResult.getElement());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JsonNode jsonNode = null;
|
JsonNode jsonNode = null;
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.Schema
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility;
|
import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
||||||
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagementUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.base.entities.EntityElementManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.base.entities.EntityElementManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.utils.Utility;
|
import org.gcube.informationsystem.resourceregistry.utils.Utility;
|
||||||
import org.gcube.informationsystem.types.TypeMapper;
|
import org.gcube.informationsystem.types.TypeMapper;
|
||||||
|
@ -21,7 +21,6 @@ import org.gcube.informationsystem.types.reference.entities.EntityType;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
|
|
||||||
import com.orientechnologies.orient.core.record.OVertex;
|
import com.orientechnologies.orient.core.record.OVertex;
|
||||||
import com.orientechnologies.orient.core.sql.executor.OResult;
|
import com.orientechnologies.orient.core.sql.executor.OResult;
|
||||||
import com.orientechnologies.orient.core.sql.executor.OResultSet;
|
import com.orientechnologies.orient.core.sql.executor.OResultSet;
|
||||||
|
@ -40,12 +39,6 @@ public abstract class EntityTypeDefinitionManagement<E extends EntityType> exten
|
||||||
this.elementType = TypeMapper.getType(clz);
|
this.elementType = TypeMapper.getType(clz);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityTypeDefinitionManagement(SecurityContext securityContext, ODatabaseDocument oDatabaseDocument, Class<E> clz) throws ResourceRegistryException {
|
|
||||||
this(clz);
|
|
||||||
this.oDatabaseDocument = oDatabaseDocument;
|
|
||||||
setWorkingContext(securityContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SecurityContext getWorkingContext() throws ResourceRegistryException {
|
protected SecurityContext getWorkingContext() throws ResourceRegistryException {
|
||||||
if(workingContext == null) {
|
if(workingContext == null) {
|
||||||
|
@ -145,7 +138,7 @@ public abstract class EntityTypeDefinitionManagement<E extends EntityType> exten
|
||||||
}
|
}
|
||||||
|
|
||||||
OResult oResult = resultSet.next();
|
OResult oResult = resultSet.next();
|
||||||
OVertex element = (OVertex) ElementManagement.getElementFromOptional(oResult.getElement());
|
OVertex element = (OVertex) ElementManagementUtility.getElementFromOptional(oResult.getElement());
|
||||||
|
|
||||||
logger.trace("{} with id {} is : {}", elementType, getName(), Utility.toJsonString(element, true));
|
logger.trace("{} with id {} is : {}", elementType, getName(), Utility.toJsonString(element, true));
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.types.entities;
|
package org.gcube.informationsystem.resourceregistry.types.entities;
|
||||||
|
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
|
||||||
import org.gcube.informationsystem.types.reference.entities.FacetType;
|
import org.gcube.informationsystem.types.reference.entities.FacetType;
|
||||||
|
|
||||||
import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
|
@ -15,8 +11,4 @@ public class FacetTypeDefinitionManagement extends EntityTypeDefinitionManagemen
|
||||||
super(FacetType.class);
|
super(FacetType.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FacetTypeDefinitionManagement(SecurityContext securityContext, ODatabaseDocument oDatabaseDocument) throws ResourceRegistryException {
|
|
||||||
super(securityContext, oDatabaseDocument, FacetType.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.types.entities;
|
package org.gcube.informationsystem.resourceregistry.types.entities;
|
||||||
|
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
|
||||||
import org.gcube.informationsystem.types.reference.entities.ResourceType;
|
import org.gcube.informationsystem.types.reference.entities.ResourceType;
|
||||||
|
|
||||||
import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
|
@ -15,8 +11,4 @@ public class ResourceTypeDefinitionManagement extends EntityTypeDefinitionManage
|
||||||
super(ResourceType.class);
|
super(ResourceType.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResourceTypeDefinitionManagement(SecurityContext securityContext, ODatabaseDocument oDatabaseDocument) throws ResourceRegistryException {
|
|
||||||
super(securityContext, oDatabaseDocument, ResourceType.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
||||||
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
||||||
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.utils.Utility;
|
import org.gcube.informationsystem.resourceregistry.utils.Utility;
|
||||||
import org.gcube.informationsystem.types.reference.entities.EntityType;
|
import org.gcube.informationsystem.types.reference.entities.EntityType;
|
||||||
import org.gcube.informationsystem.types.reference.properties.PropertyType;
|
import org.gcube.informationsystem.types.reference.properties.PropertyType;
|
||||||
|
@ -143,7 +144,7 @@ public class PropertyTypeDefinitionManagement extends ElementManagement<OElement
|
||||||
}
|
}
|
||||||
|
|
||||||
OResult oResult = resultSet.next();
|
OResult oResult = resultSet.next();
|
||||||
OElement element = (OElement) ElementManagement.getElementFromOptional(oResult.getElement());
|
OElement element = (OElement) ElementManagementUtility.getElementFromOptional(oResult.getElement());
|
||||||
|
|
||||||
logger.trace("{} with id {} is : {}", elementType, getName(), Utility.toJsonString(element, true));
|
logger.trace("{} with id {} is : {}", elementType, getName(), Utility.toJsonString(element, true));
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,10 @@ public class ConsistsOfTypeDefinitionManagement
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected FacetTypeDefinitionManagement newTargetEntityManagement() throws ResourceRegistryException {
|
protected FacetTypeDefinitionManagement newTargetEntityManagement() throws ResourceRegistryException {
|
||||||
return new FacetTypeDefinitionManagement(getWorkingContext(), oDatabaseDocument);
|
FacetTypeDefinitionManagement ftdm = new FacetTypeDefinitionManagement();
|
||||||
|
ftdm.setWorkingContext(getWorkingContext());
|
||||||
|
ftdm.setoDatabaseDocument(oDatabaseDocument);
|
||||||
|
return ftdm;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -27,7 +27,10 @@ public class IsRelatedToTypeDefinitionManagement
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ResourceTypeDefinitionManagement newTargetEntityManagement() throws ResourceRegistryException {
|
protected ResourceTypeDefinitionManagement newTargetEntityManagement() throws ResourceRegistryException {
|
||||||
return new ResourceTypeDefinitionManagement(getWorkingContext(), oDatabaseDocument);
|
ResourceTypeDefinitionManagement rtdm = new ResourceTypeDefinitionManagement();
|
||||||
|
rtdm.setWorkingContext(getWorkingContext());
|
||||||
|
rtdm.setoDatabaseDocument(oDatabaseDocument);
|
||||||
|
return rtdm;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.Schema
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility;
|
import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext;
|
||||||
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseEnvironment;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagementUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.base.relations.RelationElementManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.base.relations.RelationElementManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.types.entities.EntityTypeDefinitionManagement;
|
import org.gcube.informationsystem.resourceregistry.types.entities.EntityTypeDefinitionManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.types.entities.ResourceTypeDefinitionManagement;
|
import org.gcube.informationsystem.resourceregistry.types.entities.ResourceTypeDefinitionManagement;
|
||||||
|
@ -167,7 +167,7 @@ public abstract class RelationTypeDefinitionManagement<T extends EntityTypeDefin
|
||||||
}
|
}
|
||||||
|
|
||||||
OResult oResult = resultSet.next();
|
OResult oResult = resultSet.next();
|
||||||
OEdge element = (OEdge) ElementManagement.getElementFromOptional(oResult.getElement());
|
OEdge element = (OEdge) ElementManagementUtility.getElementFromOptional(oResult.getElement());
|
||||||
|
|
||||||
logger.trace("{} with id {} is : {}", elementType, getName(), Utility.toJsonString(element, true));
|
logger.trace("{} with id {} is : {}", elementType, getName(), Utility.toJsonString(element, true));
|
||||||
|
|
||||||
|
@ -203,7 +203,10 @@ public abstract class RelationTypeDefinitionManagement<T extends EntityTypeDefin
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ResourceTypeDefinitionManagement newSourceEntityManagement() throws ResourceRegistryException {
|
protected ResourceTypeDefinitionManagement newSourceEntityManagement() throws ResourceRegistryException {
|
||||||
return new ResourceTypeDefinitionManagement(getWorkingContext(), oDatabaseDocument);
|
ResourceTypeDefinitionManagement rtdm = new ResourceTypeDefinitionManagement();
|
||||||
|
rtdm.setWorkingContext(getWorkingContext());
|
||||||
|
rtdm.setoDatabaseDocument(oDatabaseDocument);
|
||||||
|
return rtdm;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegis
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility;
|
import org.gcube.informationsystem.resourceregistry.contexts.ContextUtility;
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.AdminSecurityContext;
|
import org.gcube.informationsystem.resourceregistry.contexts.security.AdminSecurityContext;
|
||||||
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext.PermissionMode;
|
import org.gcube.informationsystem.resourceregistry.contexts.security.SecurityContext.PermissionMode;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.base.ElementManagementUtility;
|
||||||
import org.gcube.informationsystem.utils.ElementMapper;
|
import org.gcube.informationsystem.utils.ElementMapper;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -111,7 +111,7 @@ public class Utility {
|
||||||
|
|
||||||
OResult oResult = resultSet.next();
|
OResult oResult = resultSet.next();
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
El element = (El) ElementManagement.getElementFromOptional(oResult.getElement());
|
El element = (El) ElementManagementUtility.getElementFromOptional(oResult.getElement());
|
||||||
|
|
||||||
logger.trace("{} with id {} is : {}", elementType, uuid.toString(), Utility.toJsonString(element, true));
|
logger.trace("{} with id {} is : {}", elementType, uuid.toString(), Utility.toJsonString(element, true));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue