diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/types/TypeManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/types/TypeManagement.java index 3457054..0a4fab9 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/types/TypeManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/types/TypeManagement.java @@ -133,45 +133,6 @@ public class TypeManagement { return type; } - /* - private static TypeDefinition getOClassTypeDefinition(OClass oClass) throws SchemaException { - try { - ODocument oDocument = ((OClassImpl) oClass).toStream(); - String json = oDocument.toJSON(); - ObjectMapper mapper = new ObjectMapper(); - ObjectNode node = (ObjectNode) mapper.readTree(json); - - if(oClass.isSubClassOf(Property.NAME)) { - node.put(ISManageable.CLASS_PROPERTY, PropertyTypeDefinition.NAME); - } else if(oClass.isSubClassOf(Resource.NAME)) { - node.put(ISManageable.CLASS_PROPERTY, ResourceTypeDefinition.NAME); - } else if(oClass.isSubClassOf(Facet.NAME)) { - node.put(ISManageable.CLASS_PROPERTY, FacetTypeDefinition.NAME); - } else if(oClass.isSubClassOf(IsRelatedTo.NAME)) { - node.put(ISManageable.CLASS_PROPERTY, IsRelatedToTypeDefinition.NAME); - } else if(oClass.isSubClassOf(ConsistsOf.NAME)) { - node.put(ISManageable.CLASS_PROPERTY, ConsistsOfTypeDefinition.NAME); - } - - if(!oClass.isSubClassOf(Resource.NAME)) { - ArrayNode arrayNode = (ArrayNode) node.get(EntityTypeDefinition.PROPERTIES_PROPERTY); - Iterator iterator = arrayNode.iterator(); - while(iterator.hasNext()) { - ObjectNode propertyNode = (ObjectNode) iterator.next(); - propertyNode.put(ISManageable.CLASS_PROPERTY, PropertyDefinition.NAME); - } - } - - String managedJson = mapper.writeValueAsString(node); - logger.trace("{} -> {}", json, managedJson); - - return TypeBinder.deserializeTypeDefinition(managedJson); - } catch(Exception e) { - throw new SchemaException(e); - } - } - */ - private static ElementManagement getTypeManagement(AccessType accessType, String name) { ElementManagement erManagement = null; @@ -254,27 +215,6 @@ public class TypeManagement { } } - /* - private String getTypeAsString(AccessType accessType, String name) throws SchemaException { - try { - ElementManagement erManagement = getTypeManagement(accessType, name); - return getTypeAsString(erManagement); - } catch(Exception e) { - throw new SchemaException(e); - } - } - - /* - private Type getType(AccessType accessType, String name) throws SchemaException { - try { - String typeString = getTypeAsString(accessType, name); - return TypeMapper.deserializeTypeDefinition(typeString); - } catch(Exception e) { - throw new SchemaException(e); - } - } - */ - private Type getType(OClass oClass) throws SchemaException { try { String typeString = getTypeAsString(oClass);