|
|
|
@ -13,7 +13,7 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.context.Conte
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaException;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.rest.SchemaPath;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.rest.TypePath;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPCall;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPCall.HTTPMETHOD;
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.utils.Utility;
|
|
|
|
@ -69,16 +69,12 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
|
|
|
|
|
|
|
|
|
|
StringWriter stringWriter = new StringWriter();
|
|
|
|
|
stringWriter.append(PATH_SEPARATOR);
|
|
|
|
|
stringWriter.append(SchemaPath.SCHEMAS_PATH_PART);
|
|
|
|
|
stringWriter.append(TypePath.TYPES_PATH_PART);
|
|
|
|
|
stringWriter.append(PATH_SEPARATOR);
|
|
|
|
|
stringWriter.append(typeDefinitionObj.getName());
|
|
|
|
|
|
|
|
|
|
Map<String, String> parameters = new HashMap<>();
|
|
|
|
|
parameters.put(SchemaPath.BASE_TYPE_PATH_PARAM, baseType);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HTTPCall httpCall = getHTTPCall();
|
|
|
|
|
String c = httpCall.call(String.class, stringWriter.toString(), HTTPMETHOD.PUT, parameters, typeDefinitition);
|
|
|
|
|
String c = httpCall.call(String.class, stringWriter.toString(), HTTPMETHOD.PUT, typeDefinitition);
|
|
|
|
|
|
|
|
|
|
logger.trace("{} successfully created", c);
|
|
|
|
|
return c;
|
|
|
|
@ -112,13 +108,13 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
|
|
|
|
|
logger.info("Going to get {} schema", type);
|
|
|
|
|
StringWriter stringWriter = new StringWriter();
|
|
|
|
|
stringWriter.append(PATH_SEPARATOR);
|
|
|
|
|
stringWriter.append(SchemaPath.SCHEMAS_PATH_PART);
|
|
|
|
|
stringWriter.append(TypePath.TYPES_PATH_PART);
|
|
|
|
|
stringWriter.append(PATH_SEPARATOR);
|
|
|
|
|
stringWriter.append(type);
|
|
|
|
|
|
|
|
|
|
Map<String,String> parameters = new HashMap<>();
|
|
|
|
|
if(polymorphic != null) {
|
|
|
|
|
parameters.put(SchemaPath.POLYMORPHIC_PARAM, polymorphic.toString());
|
|
|
|
|
parameters.put(TypePath.POLYMORPHIC_PARAM, polymorphic.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HTTPCall httpCall = getHTTPCall();
|
|
|
|
|