diff --git a/.classpath b/.classpath index 3f8d197..2f7e064 100644 --- a/.classpath +++ b/.classpath @@ -32,7 +32,7 @@ - + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 43c8195..cac0df4 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,11 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index 1b22d70..f4bf050 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,5 +1,5 @@ - + diff --git a/pom.xml b/pom.xml index 2093f23..176e356 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ - 1.7 + 1.8 1.8 diff --git a/src/main/java/org/gcube/application/geoportalcommon/MockDocumentConfigurationReader.java b/src/main/java/org/gcube/application/geoportalcommon/MockDocumentConfigurationReader.java index 2a7be7a..4fac4ed 100644 --- a/src/main/java/org/gcube/application/geoportalcommon/MockDocumentConfigurationReader.java +++ b/src/main/java/org/gcube/application/geoportalcommon/MockDocumentConfigurationReader.java @@ -39,6 +39,10 @@ public class MockDocumentConfigurationReader { filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config3.json"; dc = getDocumentConfigVO(filePath); listDocumentConfigsDV.add(dc); + + filePath = "/home/francescomangiacrapa/git/geoportal-data-common/src/test/resources/geoportal-config4.json"; + dc = getDocumentConfigVO(filePath); + listDocumentConfigsDV.add(dc); } private DocumentConfigDV getDocumentConfigVO(String filePath) throws JsonProcessingException, IOException { diff --git a/src/main/java/org/gcube/application/geoportalcommon/geoportalconfig/GcubeProfile.java b/src/main/java/org/gcube/application/geoportalcommon/geoportalconfig/GcubeProfile.java index 0b37135..79710b1 100644 --- a/src/main/java/org/gcube/application/geoportalcommon/geoportalconfig/GcubeProfile.java +++ b/src/main/java/org/gcube/application/geoportalcommon/geoportalconfig/GcubeProfile.java @@ -26,6 +26,9 @@ public class GcubeProfile { @JsonProperty private String gcubeName; + @JsonProperty + private String parentName; + @JsonProperty private String sectionName; @@ -50,5 +53,6 @@ public class GcubeProfile { @JsonProperty(FILE_PATHS) private List filePaths; + } diff --git a/src/main/java/org/gcube/application/geoportalcommon/shared/geoportalconfig/GcubeProfileDV.java b/src/main/java/org/gcube/application/geoportalcommon/shared/geoportalconfig/GcubeProfileDV.java index 8c0cb34..d569451 100644 --- a/src/main/java/org/gcube/application/geoportalcommon/shared/geoportalconfig/GcubeProfileDV.java +++ b/src/main/java/org/gcube/application/geoportalcommon/shared/geoportalconfig/GcubeProfileDV.java @@ -3,6 +3,13 @@ package org.gcube.application.geoportalcommon.shared.geoportalconfig; import java.io.Serializable; import java.util.List; +/** + * The Class GcubeProfileDV. + * + * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it + * + * Mar 7, 2022 + */ public class GcubeProfileDV implements Serializable { /** @@ -16,6 +23,7 @@ public class GcubeProfileDV implements Serializable { private String gcubeName; private String sectionName; private String sectionTitle; + private String parentName; /** * 0: Not specified means Not Mandatory. The Gcube Profile is not mandatory and @@ -32,65 +40,174 @@ public class GcubeProfileDV implements Serializable { private List filePaths; + /** + * Instantiates a new gcube profile DV. + */ public GcubeProfileDV() { } + /** + * Gets the serialversionuid. + * + * @return the serialversionuid + */ + public static long getSerialversionuid() { + return serialVersionUID; + } + + /** + * Gets the gcube secondary type. + * + * @return the gcube secondary type + */ public String getGcubeSecondaryType() { return gcubeSecondaryType; } + /** + * Gets the gcube name. + * + * @return the gcube name + */ public String getGcubeName() { return gcubeName; } + /** + * Gets the section name. + * + * @return the section name + */ public String getSectionName() { return sectionName; } + /** + * Gets the section title. + * + * @return the section title + */ public String getSectionTitle() { return sectionTitle; } + + /** + * Gets the parent name. If is null or empty return the "" /(empty string) as default. + * + * @return the parent name + */ + public String getParentName() { + if (parentName == null) + return ""; + + return parentName; + } + + /** + * Gets the min occurs. + * + * @return the min occurs + */ public int getMinOccurs() { return minOccurs; } + /** + * Gets the max occurs. + * + * @return the max occurs + */ public int getMaxOccurs() { return maxOccurs; } + /** + * Gets the file paths. + * + * @return the file paths + */ public List getFilePaths() { return filePaths; } + /** + * Sets the gcube secondary type. + * + * @param gcubeSecondaryType the new gcube secondary type + */ public void setGcubeSecondaryType(String gcubeSecondaryType) { this.gcubeSecondaryType = gcubeSecondaryType; } + /** + * Sets the gcube name. + * + * @param gcubeName the new gcube name + */ public void setGcubeName(String gcubeName) { this.gcubeName = gcubeName; } + /** + * Sets the section name. + * + * @param sectionName the new section name + */ public void setSectionName(String sectionName) { this.sectionName = sectionName; } + /** + * Sets the section title. + * + * @param sectionTitle the new section title + */ public void setSectionTitle(String sectionTitle) { this.sectionTitle = sectionTitle; } + /** + * Sets the parent name. + * + * @param parentName the new parent name + */ + public void setParentName(String parentName) { + this.parentName = parentName; + } + + /** + * Sets the min occurs. + * + * @param minOccurs the new min occurs + */ public void setMinOccurs(int minOccurs) { this.minOccurs = minOccurs; } + /** + * Sets the max occurs. + * + * @param maxOccurs the new max occurs + */ public void setMaxOccurs(int maxOccurs) { this.maxOccurs = maxOccurs; } + /** + * Sets the file paths. + * + * @param filePaths the new file paths + */ public void setFilePaths(List filePaths) { this.filePaths = filePaths; } + /** + * To string. + * + * @return the string + */ @Override public String toString() { StringBuilder builder = new StringBuilder(); @@ -102,6 +219,8 @@ public class GcubeProfileDV implements Serializable { builder.append(sectionName); builder.append(", sectionTitle="); builder.append(sectionTitle); + builder.append(", parentName="); + builder.append(parentName); builder.append(", minOccurs="); builder.append(minOccurs); builder.append(", maxOccurs="); diff --git a/src/test/resources/geoportal-config.json b/src/test/resources/geoportal-config.json index 07f2147..0369e48 100644 --- a/src/test/resources/geoportal-config.json +++ b/src/test/resources/geoportal-config.json @@ -45,7 +45,7 @@ "gcubeName": "Immagine_Rappresentativa_di_Scavo", "sectionName": "immagini", "sectionTitle": "Immagini Rappresentative", - "minOccurs": 1, + "minOccurs": 3, "maxOccurs": 8, "parentName": "$.", "filePaths": [ diff --git a/src/test/resources/geoportal-config4.json b/src/test/resources/geoportal-config4.json new file mode 100644 index 0000000..d3a669a --- /dev/null +++ b/src/test/resources/geoportal-config4.json @@ -0,0 +1,16 @@ +{ + "id": "geoportal-data-entry-app", + "type": "DATA_ENTRY_GUI", + "item_type": "Dataset", + "configuration": { + "gcubeProfiles": [ + { + "gcubeSecondaryType": "DataCatalogueMetadata", + "gcubeName": "ResourceCatalogue_Dataset", + "sectionName": "$.", + "sectionTitle": "Dataset" + } + ], + "saveStep": "SUBMIT-FOR-REVIEW" + } +} \ No newline at end of file