From 9436e96d90050337813e39fdc4dd09d93bbea9dc Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 11 Jan 2021 13:17:53 +0100 Subject: [PATCH] Fixed profile according to latest version of IS Model and gCube Model --- .../org/gcube/gcat/profile/ISProfile.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/gcube/gcat/profile/ISProfile.java b/src/main/java/org/gcube/gcat/profile/ISProfile.java index c5fb919..a710f1b 100644 --- a/src/main/java/org/gcube/gcat/profile/ISProfile.java +++ b/src/main/java/org/gcube/gcat/profile/ISProfile.java @@ -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; @@ -57,7 +59,7 @@ public class ISProfile { public static final String PROFILE = "profile"; public static final String PROFILE_SCHEMA = "profileSchema"; - public static final String SCHEMA_URL_ADDRESS = "https://wiki.gcube-system.org/images_gcube/e/e8/Gcdcmetadataprofilev3.xsd"; + public static final String SCHEMA_URL_ADDRESS = "https://code-repo.d4science.org/gCubeSystem/gcubedatacatalogue-metadata-discovery/raw/branch/master/src/main/resources/org/gcube/datacatalogue/metadatadiscovery/Gdcmetadataprofilev3.xsd"; public static final URL SCHEMA_URL; static { @@ -110,12 +112,17 @@ 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); + ValueSchema schema = new ValueSchemaImpl(); + schema.setValue(DataCalogueMetadataFormatReader.getProfileSchemaString()); + schema.setSchema(SCHEMA_URL.toURI()); + + + 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."); + schemaFacet.setSchema(schema); + + configuration.addFacet(schemaFacet); return configuration; }