From fbae6a6eba5827e436488cedc6142b295cc40c05 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 28 Sep 2021 10:53:04 +0200 Subject: [PATCH] added set/get listWebContent to layers --- .../ConvertToDataViewModel.java | 26 ++++++++--------- .../products/model/LayerConcessioneDV.java | 28 ++++++++++++++++++- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/gcube/application/geoportalcommon/ConvertToDataViewModel.java b/src/main/java/org/gcube/application/geoportalcommon/ConvertToDataViewModel.java index 2b702fc..4c8ba78 100644 --- a/src/main/java/org/gcube/application/geoportalcommon/ConvertToDataViewModel.java +++ b/src/main/java/org/gcube/application/geoportalcommon/ConvertToDataViewModel.java @@ -270,19 +270,6 @@ public class ConvertToDataViewModel { } - // TO AVOID SERIALIZATION ISSUE AGAINST GWT -// public static List toListString(List orginList){ -// if(orginList==null) -// return null; -// -// List destList = new ArrayList(orginList.size()); -// for (String orgValue : orginList) { -// destList.add(orgValue); -// } -// -// return destList; -// } - /** * To user. * @@ -521,6 +508,7 @@ public class ConvertToDataViewModel { theLayerConessione.setLayerUUID(layerConcessione.getLayerUUID()); theLayerConessione.setAuthors(layerConcessione.getAuthors()); + layerConcessione.getActualContent() if (bounds == null) bounds = toBoundMap(layerConcessione.getBbox()); @@ -537,6 +525,18 @@ public class ConvertToDataViewModel { theLayerConessione.setTopicCategory(layerConcessione.getTopicCategory()); theLayerConessione.setValutazioneQualita(layerConcessione.getValutazioneQualita()); theLayerConessione.setRefersTo(refersToBaseConcessione); + + List actContent = layerConcessione.getActualContent(); + if (actContent != null && actContent.size() > 0) { + List listWsContent = new ArrayList(); + + for (PersistedContent content : actContent) { + if (content != null && content instanceof WorkspaceContent) { + listWsContent.add(toWorkspaceContent((WorkspaceContent) content)); + } + } + theLayerConessione.setListWsContent(listWsContent); + } LOG.debug("Returning: " + theLayerConessione); return theLayerConessione; diff --git a/src/main/java/org/gcube/application/geoportalcommon/shared/products/model/LayerConcessioneDV.java b/src/main/java/org/gcube/application/geoportalcommon/shared/products/model/LayerConcessioneDV.java index 31eaf9d..7dcef24 100644 --- a/src/main/java/org/gcube/application/geoportalcommon/shared/products/model/LayerConcessioneDV.java +++ b/src/main/java/org/gcube/application/geoportalcommon/shared/products/model/LayerConcessioneDV.java @@ -5,13 +5,14 @@ import java.util.List; import org.gcube.application.geoportalcommon.shared.gis.BoundsMap; import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV; +import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV; /** * The Class LayerConcessioneDV. * * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * - * Sep 9, 2021 + * Sep 9, 2021 */ public class LayerConcessioneDV extends SDILayerDescriptorDV implements Serializable { @@ -45,6 +46,8 @@ public class LayerConcessioneDV extends SDILayerDescriptorDV implements Serializ private BaseConcessioneDV refersTo; + private List listWsContent; + /** * Instantiates a new layer concessione DV. */ @@ -214,6 +217,25 @@ public class LayerConcessioneDV extends SDILayerDescriptorDV implements Serializ this.refersTo = refersTo; } + /** + * Sets the list ws content. + * + * @param listWsContent the new list ws content + */ + public void setListWsContent(List listWsContent) { + this.listWsContent = listWsContent; + + } + + /** + * Gets the list ws content. + * + * @return the list ws content + */ + public List getListWsContent() { + return listWsContent; + } + /** * To string. * @@ -238,6 +260,10 @@ public class LayerConcessioneDV extends SDILayerDescriptorDV implements Serializ builder.append(scalaAcquisizione); builder.append(", authors="); builder.append(authors); + builder.append(", refersTo="); + builder.append(refersTo); + builder.append(", listWsContent="); + builder.append(listWsContent); builder.append("]"); return builder.toString(); }