Fixed publishing on new Is due to change in gcube model

This commit is contained in:
Luca Frosini 2021-01-24 23:31:33 +01:00
parent 275880c428
commit 6b011e4e09
1 changed files with 14 additions and 8 deletions

View File

@ -30,15 +30,17 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegis
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient;
import org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClientFactory;
import org.gcube.resourcemanagement.model.impl.entities.facets.IdentifierFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.facets.SchemaFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.facets.SimpleFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.facets.XSDSchemaFacetImpl;
import org.gcube.resourcemanagement.model.impl.entities.resources.ConfigurationImpl;
import org.gcube.resourcemanagement.model.impl.properties.ValueSchemaImpl;
import org.gcube.resourcemanagement.model.impl.relations.consistsof.IsIdentifiedByImpl;
import org.gcube.resourcemanagement.model.reference.entities.facets.IdentifierFacet;
import org.gcube.resourcemanagement.model.reference.entities.facets.IdentifierFacet.IdentificationType;
import org.gcube.resourcemanagement.model.reference.entities.facets.SchemaFacet;
import org.gcube.resourcemanagement.model.reference.entities.facets.SimpleFacet;
import org.gcube.resourcemanagement.model.reference.entities.facets.XSDSchemaFacet;
import org.gcube.resourcemanagement.model.reference.entities.resources.Configuration;
import org.gcube.resourcemanagement.model.reference.properties.ValueSchema;
import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
import org.gcube.resources.discovery.client.queries.api.Query;
@ -110,12 +112,16 @@ public class ISProfile {
profile.setAdditionalProperty(PROFILE, xml);
configuration.addFacet(profile);
XSDSchemaFacet xsdSchemaFacet = new XSDSchemaFacetImpl();
xsdSchemaFacet.setName("gCube Item Profile");
xsdSchemaFacet.setSchemaURL(SCHEMA_URL);
xsdSchemaFacet.setDescription("gCube Metadata Profile defines a Metadata schema XML-based for adding custom metadata fields.");
xsdSchemaFacet.setContent(DataCalogueMetadataFormatReader.getProfileSchemaString());
configuration.addFacet(xsdSchemaFacet);
SchemaFacet schemaFacet = new SchemaFacetImpl();
schemaFacet.setName("gCube Item Profile");
schemaFacet.setDescription("gCube Metadata Profile defines a Metadata schema XML-based for adding custom metadata fields.");
ValueSchema valueSchema = new ValueSchemaImpl();
valueSchema.setSchema(SCHEMA_URL.toURI());
valueSchema.setValue(DataCalogueMetadataFormatReader.getProfileSchemaString());
schemaFacet.setSchema(valueSchema);
configuration.addFacet(schemaFacet);
return configuration;
}