Import changes due to refactor in is-model
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@141708 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4164340b10
commit
c29c5c9bca
|
@ -4,6 +4,7 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.dbinitialization;
|
package org.gcube.informationsystem.resourceregistry.dbinitialization;
|
||||||
|
|
||||||
import org.gcube.informationsystem.impl.utils.discovery.SchemaAction;
|
import org.gcube.informationsystem.impl.utils.discovery.SchemaAction;
|
||||||
|
import org.gcube.informationsystem.model.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
import org.gcube.informationsystem.model.embedded.Embedded;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
import org.gcube.informationsystem.model.entity.Facet;
|
||||||
|
@ -11,7 +12,6 @@ import org.gcube.informationsystem.model.entity.Resource;
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
import org.gcube.informationsystem.model.relation.Relation;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.AccessType;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement;
|
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
|
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
|
||||||
import org.gcube.informationsystem.types.TypeBinder;
|
import org.gcube.informationsystem.types.TypeBinder;
|
||||||
|
|
|
@ -1,63 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.gcube.informationsystem.resourceregistry.er;
|
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
|
||||||
import org.gcube.informationsystem.model.entity.Context;
|
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
|
||||||
import org.gcube.informationsystem.model.relation.IsParentOf;
|
|
||||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
|
||||||
import org.gcube.informationsystem.model.relation.Relation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
|
||||||
*
|
|
||||||
* Enumerates the basic type names.
|
|
||||||
*/
|
|
||||||
public enum AccessType {
|
|
||||||
|
|
||||||
EMBEDDED(Embedded.class, Embedded.NAME),
|
|
||||||
CONTEXT(Context.class, Context.NAME),
|
|
||||||
IS_PARENT_OF(IsParentOf.class, IsParentOf.NAME),
|
|
||||||
|
|
||||||
ENTITY(Entity.class, Entity.NAME),
|
|
||||||
RESOURCE(Resource.class, Resource.NAME),
|
|
||||||
FACET(Facet.class, Facet.NAME),
|
|
||||||
|
|
||||||
RELATION(Relation.class, Relation.NAME),
|
|
||||||
IS_RELATED_TO(IsRelatedTo.class, IsRelatedTo.NAME),
|
|
||||||
CONSISTS_OF(ConsistsOf.class, ConsistsOf.NAME);
|
|
||||||
|
|
||||||
|
|
||||||
private final Class<?> clz;
|
|
||||||
private final String name;
|
|
||||||
private final String lowerCaseFirstCharacter;
|
|
||||||
|
|
||||||
AccessType(Class<?> clz, String name){
|
|
||||||
this.clz = clz;
|
|
||||||
this.name = name;
|
|
||||||
this.lowerCaseFirstCharacter = name.substring(0, 1).toLowerCase() + name.substring(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String lowerCaseFirstCharacter() {
|
|
||||||
return lowerCaseFirstCharacter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class<?> getTypeClass(){
|
|
||||||
return clz;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName(){
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString(){
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -19,7 +19,9 @@ import java.util.UUID;
|
||||||
|
|
||||||
import org.codehaus.jettison.json.JSONArray;
|
import org.codehaus.jettison.json.JSONArray;
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
|
import org.gcube.informationsystem.model.AccessType;
|
||||||
import org.gcube.informationsystem.model.ER;
|
import org.gcube.informationsystem.model.ER;
|
||||||
|
import org.gcube.informationsystem.model.ISManageable;
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.embedded.Header;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.entity.Facet;
|
import org.gcube.informationsystem.model.entity.Facet;
|
||||||
|
@ -536,8 +538,8 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getClassProperty(JsonNode jsonNode) {
|
public static String getClassProperty(JsonNode jsonNode) {
|
||||||
if (jsonNode.has(ER.CLASS_PROPERTY)) {
|
if (jsonNode.has(ISManageable.CLASS_PROPERTY)) {
|
||||||
return jsonNode.get(ER.CLASS_PROPERTY).asText();
|
return jsonNode.get(ISManageable.CLASS_PROPERTY).asText();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -768,7 +770,7 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
|
||||||
|
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject(properties);
|
JSONObject jsonObject = new JSONObject(properties);
|
||||||
jsonObject.put(ER.CLASS_PROPERTY, type);
|
jsonObject.put(ISManageable.CLASS_PROPERTY, type);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -787,7 +789,7 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONArray jsonArray = new JSONArray(superClasses);
|
JSONArray jsonArray = new JSONArray(superClasses);
|
||||||
jsonObject.put(ER.SUPERCLASSES_PROPERTY, jsonArray);
|
jsonObject.put(ISManageable.SUPERCLASSES_PROPERTY, jsonArray);
|
||||||
|
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ package org.gcube.informationsystem.resourceregistry.er;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.ER;
|
import org.gcube.informationsystem.model.ISManageable;
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
import org.gcube.informationsystem.model.embedded.Embedded;
|
||||||
import org.gcube.informationsystem.model.embedded.Header;
|
import org.gcube.informationsystem.model.embedded.Header;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
|
@ -45,7 +45,7 @@ public class EmbeddedMangement {
|
||||||
|
|
||||||
public static ODocument getEmbeddedType(JsonNode jsonNode)
|
public static ODocument getEmbeddedType(JsonNode jsonNode)
|
||||||
throws ResourceRegistryException {
|
throws ResourceRegistryException {
|
||||||
if (jsonNode.has(ER.CLASS_PROPERTY)) {
|
if (jsonNode.has(ISManageable.CLASS_PROPERTY)) {
|
||||||
// Complex type
|
// Complex type
|
||||||
String type = ERManagement.getClassProperty(jsonNode);
|
String type = ERManagement.getClassProperty(jsonNode);
|
||||||
|
|
||||||
|
|
|
@ -7,13 +7,13 @@ import java.util.Iterator;
|
||||||
|
|
||||||
import org.codehaus.jettison.json.JSONArray;
|
import org.codehaus.jettison.json.JSONArray;
|
||||||
import org.codehaus.jettison.json.JSONObject;
|
import org.codehaus.jettison.json.JSONObject;
|
||||||
|
import org.gcube.informationsystem.model.AccessType;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.entity.Resource;
|
||||||
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
import org.gcube.informationsystem.model.relation.ConsistsOf;
|
||||||
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
import org.gcube.informationsystem.model.relation.IsRelatedTo;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.EntityAlreadyPresentException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.EntityAlreadyPresentException;
|
||||||
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.er.AccessType;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.er.relation.ConsistsOfManagement;
|
import org.gcube.informationsystem.resourceregistry.er.relation.ConsistsOfManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.relation.IsRelatedToManagement;
|
import org.gcube.informationsystem.resourceregistry.er.relation.IsRelatedToManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.relation.RelationManagement;
|
import org.gcube.informationsystem.resourceregistry.er.relation.RelationManagement;
|
||||||
|
|
|
@ -8,10 +8,10 @@ import javax.ws.rs.PathParam;
|
||||||
import javax.ws.rs.Produces;
|
import javax.ws.rs.Produces;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
|
import org.gcube.informationsystem.model.AccessType;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.rest.SchemaPath;
|
import org.gcube.informationsystem.resourceregistry.api.rest.SchemaPath;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.AccessType;
|
|
||||||
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement;
|
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
|
import org.gcube.informationsystem.resourceregistry.schema.SchemaManagementImpl;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.schema;
|
package org.gcube.informationsystem.resourceregistry.schema;
|
||||||
|
|
||||||
|
import org.gcube.informationsystem.model.AccessType;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
||||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.AccessType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.gcube.informationsystem.model.AccessType;
|
||||||
import org.gcube.informationsystem.model.embedded.Embedded;
|
import org.gcube.informationsystem.model.embedded.Embedded;
|
||||||
import org.gcube.informationsystem.model.entity.Entity;
|
import org.gcube.informationsystem.model.entity.Entity;
|
||||||
import org.gcube.informationsystem.model.entity.Resource;
|
import org.gcube.informationsystem.model.entity.Resource;
|
||||||
|
@ -17,7 +18,6 @@ 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.context.SecurityContextMapper;
|
import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper;
|
||||||
import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper.PermissionMode;
|
import org.gcube.informationsystem.resourceregistry.context.SecurityContextMapper.PermissionMode;
|
||||||
import org.gcube.informationsystem.resourceregistry.er.AccessType;
|
|
||||||
import org.gcube.informationsystem.types.TypeBinder;
|
import org.gcube.informationsystem.types.TypeBinder;
|
||||||
import org.gcube.informationsystem.types.TypeBinder.Property;
|
import org.gcube.informationsystem.types.TypeBinder.Property;
|
||||||
import org.gcube.informationsystem.types.TypeBinder.TypeDefinition;
|
import org.gcube.informationsystem.types.TypeBinder.TypeDefinition;
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue