From b1a4a22cc65cd8806f3688db7c9735daefd26765 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Mon, 12 Dec 2022 17:27:57 +0100 Subject: [PATCH] Added setGcubeProfile, documentSectionAsJSON --- .../Geoportal_JSON_Mapper.java | 3 ++ .../shared/MetaDataProfileBeanExt.java | 45 ++++++++++++++++--- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gcube/application/geoportaldatamapper/Geoportal_JSON_Mapper.java b/src/main/java/org/gcube/application/geoportaldatamapper/Geoportal_JSON_Mapper.java index a160bc1..e12b7ee 100644 --- a/src/main/java/org/gcube/application/geoportaldatamapper/Geoportal_JSON_Mapper.java +++ b/src/main/java/org/gcube/application/geoportaldatamapper/Geoportal_JSON_Mapper.java @@ -191,6 +191,7 @@ public class Geoportal_JSON_Mapper { theProfileBeanExt.setCategories(theProfileBean.getCategories()); theProfileBeanExt.setTitle(theProfileBean.getTitle()); theProfileBeanExt.setType(theProfileBean.getType()); + theProfileBeanExt.setGcubeProfile(gcubeProfileDV); Document fromSectionDoc = listBSONDocument.get(i); LOG.debug("\n\nNew section DOC for index " + i + " is: " @@ -236,6 +237,8 @@ public class Geoportal_JSON_Mapper { } theProfileBeanExt.setMetadataFields(new ArrayList(cloneListOfMFW)); + theProfileBeanExt.setDocumentSectionAsJSON(fromSectionDoc.toJson()); + theProfileBeanExt.setGcubeProfile(gcubeProfileDV); LOG.debug("Metadata fields are: " + theProfileBeanExt.getMetadataFields()); // Reading filePaths diff --git a/src/main/java/org/gcube/application/geoportaldatamapper/shared/MetaDataProfileBeanExt.java b/src/main/java/org/gcube/application/geoportaldatamapper/shared/MetaDataProfileBeanExt.java index caa2b90..669d55a 100644 --- a/src/main/java/org/gcube/application/geoportaldatamapper/shared/MetaDataProfileBeanExt.java +++ b/src/main/java/org/gcube/application/geoportaldatamapper/shared/MetaDataProfileBeanExt.java @@ -4,6 +4,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV; import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV; import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV; import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.CategoryWrapper; @@ -23,8 +24,13 @@ public class MetaDataProfileBeanExt extends MetaDataProfileBean implements Seria * */ private static final long serialVersionUID = 2518128223147908835L; + + private String documentSectionAsJSON = null; + private List listFileset = null; + private GcubeProfileDV gcubeProfileDV; + /** * Instantiates a new meta data profile bean ext. */ @@ -56,6 +62,24 @@ public class MetaDataProfileBeanExt extends MetaDataProfileBean implements Seria return listFileset; } + /** + * Gets the document section as JSON. + * + * @return the document section as JSON + */ + public String getDocumentSectionAsJSON() { + return documentSectionAsJSON; + } + + /** + * Sets the document section as JSON. + * + * @param documentSectionAsJSON the new document section as JSON + */ + public void setDocumentSectionAsJSON(String documentSectionAsJSON) { + this.documentSectionAsJSON = documentSectionAsJSON; + } + /** * Sets the list fileset. * @@ -120,15 +144,24 @@ public class MetaDataProfileBeanExt extends MetaDataProfileBean implements Seria return clonedMDPBE; } + public void setGcubeProfile(GcubeProfileDV gcubeProfileDV) { + this.gcubeProfileDV = gcubeProfileDV; + + } + + public GcubeProfileDV getGcubeProfileDV() { + return gcubeProfileDV; + } + @Override public String toString() { StringBuilder builder = new StringBuilder(); - builder.append("MetaDataProfileBeanExt [getType()="); - builder.append(getType()); - builder.append(", getTitle()="); - builder.append(getTitle()); - builder.append(", getMetadataFields()="); - builder.append(getMetadataFields()); + builder.append("MetaDataProfileBeanExt [documentSectionAsJSON="); + builder.append(documentSectionAsJSON); + builder.append(", listFileset="); + builder.append(listFileset); + builder.append(", gcubeProfileDV="); + builder.append(gcubeProfileDV); builder.append("]"); return builder.toString(); }