diff --git a/.classpath b/.classpath
index c5c4bd3..348ca0d 100644
--- a/.classpath
+++ b/.classpath
@@ -32,7 +32,6 @@
-
diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs
index d16c112..ff5aa39 100644
--- a/.settings/com.gwtplugins.gdt.eclipse.core.prefs
+++ b/.settings/com.gwtplugins.gdt.eclipse.core.prefs
@@ -1,4 +1,4 @@
eclipse.preferences.version=1
-lastWarOutDir=/home/francesco-mangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.0.0-SNAPSHOT
+lastWarOutDir=/home/francesco/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-1.0.0-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f80ad6f..642a4f8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,4 +6,4 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [v1.0.0-SNAPSHOT] - 2020-10-07
-First release
+[#20004] First release
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java
index 809ddfe..867b02a 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/GeoportalDataViewer.java
@@ -11,6 +11,8 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.ProductType;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
+import com.github.gwtbootstrap.client.ui.Tab;
+import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
@@ -20,6 +22,7 @@ import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
// TODO: Auto-generated Javadoc
@@ -144,22 +147,38 @@ public class GeoportalDataViewer implements EntryPoint {
List productIds = fRow.getMapProperties().get("product_id");
if(productIds!=null && productIds.size()>0) {
long id = Long.parseLong(productIds.get(0));
- GeoportalDataViewerServiceAsync.Util.getInstance().getConcessioneForId(id, new AsyncCallback() {
-
- @Override
- public void onFailure(Throwable caught) {
- Window.alert(caught.getMessage());
-
- }
-
- @Override
- public void onSuccess(ConcessioneDV result) {
- mainPanel.addNewTab(result);
-
- }
- });
- }else
- Window.alert("No product id found");
+ String tabName = "Dettagli Prodotto";
+ List listName = fRow.getMapProperties().get("nome");
+ if(listName!=null && listName.size()>0) {
+ tabName = listName.get(0);
+ }
+
+ boolean found = mainPanel.selectTabForProductId(id);
+ GWT.log("Product with id: "+id+" found? "+found);
+ if(!found) {
+
+ final Tab theTab = mainPanel.addAsTab(tabName, true, null);
+ GeoportalDataViewerServiceAsync.Util.getInstance().getConcessioneForId(id, new AsyncCallback() {
+
+ @Override
+ public void onFailure(Throwable caught) {
+ Window.alert(caught.getMessage());
+ theTab.clear();
+ theTab.setIcon(IconType.WARNING_SIGN);
+ theTab.add(new HTML(caught.getMessage()));
+
+ }
+
+ @Override
+ public void onSuccess(ConcessioneDV result) {
+ GWT.log("Showing: "+result);
+ mainPanel.renderProductIntoTab(theTab, result);
+
+ }
+ });
+ }else
+ Window.alert("No product id found");
+ }
}
}
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/Images.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/Images.java
new file mode 100644
index 0000000..f7f80fb
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/Images.java
@@ -0,0 +1,13 @@
+package org.gcube.portlets.user.geoportaldataviewer.client.resources;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+
+public interface Images extends ClientBundle {
+
+ public static final Images ICONS = GWT.create(Images.class);
+
+ @Source("loading.gif")
+ ImageResource loading();
+}
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/loading.gif b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/loading.gif
new file mode 100644
index 0000000..27f0eee
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/resources/loading.gif differ
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.java
index da16f9b..a010b6f 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.java
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/GeonaDataViewMainPanel.java
@@ -1,7 +1,13 @@
package org.gcube.portlets.user.geoportaldataviewer.client.ui;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
-import org.gcube.portlets.user.geoportaldataviewer.client.ui.concessione.ConcessioneView;
+import org.gcube.portlets.user.geoportaldataviewer.client.ui.products.ConcessioneView;
+import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
import com.github.gwtbootstrap.client.ui.Button;
@@ -10,6 +16,8 @@ import com.github.gwtbootstrap.client.ui.Tab;
import com.github.gwtbootstrap.client.ui.TabPanel;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerManager;
@@ -39,15 +47,16 @@ public class GeonaDataViewMainPanel extends Composite {
@UiField
TabPanel mainTabPanel;
-
-// @UiField
-// ButtonGroup buttonGroup;
+
+ private List listTabs = new ArrayList();
private MapPanel mapPanel;
private OpenLayerOSM map;
private HandlerManager eventBus;
+
+ private Map mapProducts = new HashMap();
public GeonaDataViewMainPanel(HandlerManager eventBus) {
initWidget(uiBinder.createAndBindUi(this));
@@ -116,14 +125,90 @@ public class GeonaDataViewMainPanel extends Composite {
}
- public void addNewTab(ConcessioneDV cdv) {
- Tab tab = new Tab();
- String nome = cdv.getNome();
- tab.setHeading(nome);
-
+ public void renderProductIntoTab(Tab tab, ConcessioneDV cdv) {
+ tab.clear();
+ tab.setHeading(cdv.getNome());
tab.add(new ConcessioneView(cdv));
+ mapProducts.put(cdv.getId(), tab);
+ selectTabForProductId(cdv.getId());
+ }
+
+ public boolean selectTabForProductId(long productId) {
+
+ Tab product = mapProducts.get(productId);
+ if(product!=null) {
+ selectTab(product);
+ //found
+ return true;
+ }
+ //not found
+ return false;
+
+ }
+
+ /**
+ * Adds the as tab.
+ *
+ * @param tabTitle the tab title
+ * @param tabDescr the tab descr
+ * @param spinner the spinner
+ * @param w the w
+ * @return the tab
+ */
+ public Tab addAsTab(String tabTitle, boolean spinner, Widget w){
+
+// field_create_analytics_request.setActive(false);
+
+ Tab tab = new Tab();
mainTabPanel.add(tab);
- tab.asWidget().getElement().focus();
+
+ if(spinner) {
+ LoaderIcon loader = new LoaderIcon("Loading...");
+ tab.add(loader);
+ }
+
+ tab.addClickHandler(new ClickHandler() {
+
+ @Override
+ public void onClick(ClickEvent event) {
+
+ }
+ });
+
+ //tab.setActive(true);
+ tab.setHeading(tabTitle);
+ listTabs.add(tab);
+
+ if(w!=null)
+ tab.add(w);
+
+ Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+
+ @Override
+ public void execute() {
+ selectTab(tab);
+
+ }
+ });
+
+ return tab;
+
+// tab.setActive(true);
+ }
+
+
+ private void selectTab(Tab theTab) {
+ int i = 1;
+ for (Tab tab : listTabs) {
+ GWT.log("Selecting "+tab);
+ tab.setActive(false);
+ if(tab.equals(theTab)) {
+ GWT.log("Tab selected "+tab);
+ mainTabPanel.selectTab(i);
+ }
+ i++;
+ }
+
}
}
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/images/ImageView.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/images/ImageView.java
new file mode 100644
index 0000000..e189420
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/images/ImageView.java
@@ -0,0 +1,54 @@
+package org.gcube.portlets.user.geoportaldataviewer.client.ui.images;
+
+import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
+import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
+
+import com.github.gwtbootstrap.client.ui.Heading;
+import com.github.gwtbootstrap.client.ui.Image;
+import com.github.gwtbootstrap.client.ui.Paragraph;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Widget;
+
+public class ImageView extends Composite {
+
+ private static ImageViewUiBinder uiBinder = GWT.create(ImageViewUiBinder.class);
+
+ interface ImageViewUiBinder extends UiBinder {
+ }
+
+ public ImageView() {
+ initWidget(uiBinder.createAndBindUi(this));
+ }
+
+ @UiField
+ Image imageURL;
+
+ @UiField
+ Heading heading;
+
+ @UiField
+ Paragraph paragraph1;
+
+
+ public ImageView(UploadedImageDV imageDV) {
+ initWidget(uiBinder.createAndBindUi(this));
+
+ imageDV.getDidascalia();
+ heading.setText(imageDV.getTitolo());
+ paragraph1.setText(imageDV.getDidascalia());
+
+ if(imageDV.getListWsContent()!=null && imageDV.getListWsContent().size()>0) {
+ WorkspaceContentDV latest = imageDV.getListWsContent().get(imageDV.getListWsContent().size()-1);
+ imageURL.setUrl(latest.getLink());
+ }
+
+ }
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/images/ImageView.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/images/ImageView.ui.xml
new file mode 100644
index 0000000..0be12f6
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/images/ImageView.ui.xml
@@ -0,0 +1,22 @@
+
+
+
+ .max-width-300 {
+ max-width: 300px;
+ }
+
+
+
+
+
+
+
+
+ Expand
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/concessione/ConcessioneView.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.java
similarity index 56%
rename from src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/concessione/ConcessioneView.java
rename to src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.java
index a3f9ea3..53144cc 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/concessione/ConcessioneView.java
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.java
@@ -1,11 +1,16 @@
-package org.gcube.portlets.user.geoportaldataviewer.client.ui.concessione;
+package org.gcube.portlets.user.geoportaldataviewer.client.ui.products;
+import java.util.List;
+
+import org.gcube.portlets.user.geoportaldataviewer.client.ui.images.ImageView;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
+import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
import com.github.gwtbootstrap.client.ui.Column;
import com.github.gwtbootstrap.client.ui.Heading;
import com.github.gwtbootstrap.client.ui.Label;
import com.github.gwtbootstrap.client.ui.Paragraph;
+import com.github.gwtbootstrap.client.ui.Thumbnails;
import com.github.gwtbootstrap.client.ui.constants.LabelType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
@@ -13,6 +18,7 @@ import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -35,25 +41,51 @@ public class ConcessioneView extends Composite {
@UiField
Column contributore;
+
+ @UiField
+ HTMLPanel imagesPanel;
+
+ private ConcessioneDV concessioneDV;
+
+ private Thumbnails thumbNails = new Thumbnails();
public ConcessioneView() {
initWidget(uiBinder.createAndBindUi(this));
}
- public ConcessioneView(ConcessioneDV concessione) {
+ public ConcessioneView(ConcessioneDV concessioneDV) {
this();
- titolo.setText(concessione.getNome());
- introduzione.setText(concessione.getIntroduzione());
+ this.concessioneDV = concessioneDV;
+ titolo.setText(concessioneDV.getNome());
+ introduzione.setText(concessioneDV.getIntroduzione());
- for (String author : concessione.getAuthors()) {
+ for (String author : concessioneDV.getAuthors()) {
addLabel(autori, author);
//autori.add(new Label(author));
}
- addLabel(contributore, concessione.getContributore());
+ addLabel(contributore, concessioneDV.getContributore());
+
+ addImages();
}
+ private void addImages() {
+ List immagini = concessioneDV.getImmaginiRappresentative();
+ if(immagini!=null && immagini.size()>0) {
+ imagesPanel.setVisible(true);
+ int i = 0;
+ for (UploadedImageDV uploadedImageDV : immagini) {
+ if(i==0)
+ imagesPanel.add(thumbNails);
+
+ thumbNails.add(new ImageView(uploadedImageDV));
+ }
+ }
+
+ }
+
+
public void addLabel(FlowPanel w, String labelValue, LabelType type){
Label label = new Label(labelValue);
label.setType(type);
@@ -66,5 +98,9 @@ public class ConcessioneView extends Composite {
label.getElement().getStyle().setMarginRight(5, Unit.PX);
w.add(label);
}
+
+ public ConcessioneDV getConcessioneDV() {
+ return concessioneDV;
+ }
}
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/concessione/ConcessioneView.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.ui.xml
similarity index 69%
rename from src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/concessione/ConcessioneView.ui.xml
rename to src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.ui.xml
index 6144072..3208f67 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/concessione/ConcessioneView.ui.xml
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/products/ConcessioneView.ui.xml
@@ -6,28 +6,37 @@
.important {
font-weight: bold;
}
+
.margin-left-10 {
margin-left: 10px;
}
+ .font-size-h1-22 h1{
+ font-size: 22px;
+ }
Hero Unit
Some Text for the Hero Unit.
-
+
Autori
-
+
Contributore
+
+ Immagini Rappresentative
+
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/util/LoaderIcon.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/util/LoaderIcon.java
new file mode 100644
index 0000000..4ba03f1
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/util/LoaderIcon.java
@@ -0,0 +1,61 @@
+/**
+ *
+ */
+package org.gcube.portlets.user.geoportaldataviewer.client.util;
+
+import org.gcube.portlets.user.geoportaldataviewer.client.resources.Images;
+
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Image;
+
+/**
+ * The Class LoaderIcon.
+ *
+ * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
+ * Feb 19, 2015
+ */
+public class LoaderIcon extends HorizontalPanel{
+
+
+ private Image imgLoading = new Image(Images.ICONS.loading());
+ private HTML txtLoading = new HTML("");
+
+ /**
+ * Instantiates a new loader icon.
+ *
+ * @param txtHTML the txt html
+ */
+ public LoaderIcon(String txtHTML) {
+ this();
+ setText(txtHTML);
+ }
+
+ /**
+ * Instantiates a new loader icon.
+ */
+ public LoaderIcon() {
+ setStyleName("marginTop20");
+ add(imgLoading);
+ add(txtLoading);
+ }
+
+ /**
+ * Sets the text.
+ *
+ * @param txtHTML the new text
+ */
+ public void setText(String txtHTML){
+ txtLoading.setHTML(""+txtHTML+"");
+ }
+
+ /**
+ * Show.
+ *
+ * @param bool the bool
+ */
+ public void show(boolean bool){
+ this.setVisible(bool);
+ }
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/ConvertToDataViewModel.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/ConvertToDataViewModel.java
index a6360e1..2ccb015 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/ConvertToDataViewModel.java
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/ConvertToDataViewModel.java
@@ -10,13 +10,16 @@ import org.gcube.application.geoportal.model.concessioni.Concessione;
import org.gcube.application.geoportal.model.concessioni.LayerConcessione;
import org.gcube.application.geoportal.model.concessioni.RelazioneScavo;
import org.gcube.application.geoportal.model.content.OtherContent;
+import org.gcube.application.geoportal.model.content.PersistedContent;
import org.gcube.application.geoportal.model.content.UploadedImage;
+import org.gcube.application.geoportal.model.content.WorkspaceContent;
import org.gcube.application.geoportal.model.gis.BBOX;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.LayerConcessioneDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.RelazioneScavoDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.OtherContentDV;
+import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.UploadedImageDV;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -210,10 +213,42 @@ public class ConvertToDataViewModel {
theUploadedImageDV.setResponsabili(uploadedImage.getResponsabili());
theUploadedImageDV.setSoggetto(uploadedImage.getSoggetto());
theUploadedImageDV.setTitolo(uploadedImage.getTitolo());
+
+ List actContent = uploadedImage.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));
+ }
+ }
+ theUploadedImageDV.setListWsContent(listWsContent);
+ }
LOG.debug("Returning: " + theUploadedImageDV);
return theUploadedImageDV;
}
+
+
+ /**
+ * To workspace content.
+ *
+ * @param wContent the w content
+ * @return the workspace content DV
+ */
+ public static WorkspaceContentDV toWorkspaceContent(WorkspaceContent wContent){
+ if (wContent == null)
+ return null;
+
+ WorkspaceContentDV theWSDV = new WorkspaceContentDV();
+ theWSDV.setLink(wContent.getLink());
+ theWSDV.setMimetype(wContent.getMimetype());
+ theWSDV.setStorageID(wContent.getStorageID());
+ theWSDV.setId(wContent.getId());
+
+ return theWSDV;
+ }
/**
* To layer concessione.
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/content/WorkspaceContentDV.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/content/WorkspaceContentDV.java
new file mode 100644
index 0000000..7872626
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/content/WorkspaceContentDV.java
@@ -0,0 +1,85 @@
+package org.gcube.portlets.user.geoportaldataviewer.shared.products.content;
+
+import java.io.Serializable;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * The Class WorkspaceContentDV.
+ *
+ * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
+ *
+ * Nov 5, 2020
+ */
+public class WorkspaceContentDV implements IsSerializable, Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3919923007831416696L;
+
+ /** The mimetype. */
+ private String mimetype;
+
+ /** The storage ID. */
+ private String storageID;
+
+ /** The link. */
+ private String link;
+
+ private Long id;
+
+ public WorkspaceContentDV() {
+
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getMimetype() {
+ return mimetype;
+ }
+
+ public void setMimetype(String mimetype) {
+ this.mimetype = mimetype;
+ }
+
+ public String getStorageID() {
+ return storageID;
+ }
+
+ public void setStorageID(String storageID) {
+ this.storageID = storageID;
+ }
+
+ public String getLink() {
+ return link;
+ }
+
+ public void setLink(String link) {
+ this.link = link;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("WorkspaceContentDV [mimetype=");
+ builder.append(mimetype);
+ builder.append(", storageID=");
+ builder.append(storageID);
+ builder.append(", link=");
+ builder.append(link);
+ builder.append(", id=");
+ builder.append(id);
+ builder.append("]");
+ return builder.toString();
+ }
+
+
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/model/UploadedImageDV.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/model/UploadedImageDV.java
index 3f6e86b..6da687b 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/model/UploadedImageDV.java
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/products/model/UploadedImageDV.java
@@ -4,22 +4,23 @@ import java.io.Serializable;
import java.util.List;
import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.AssociatedContentDV;
+import org.gcube.portlets.user.geoportaldataviewer.shared.products.content.WorkspaceContentDV;
/**
* The Class UploadedImage.
*
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
*
- * Nov 2, 2020
+ * Nov 2, 2020
*/
public class UploadedImageDV extends AssociatedContentDV implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 809167060189883015L;
-
+
/** The didascalia. */
private String didascalia;
-
+
/** The format. */
private String format;
@@ -29,6 +30,8 @@ public class UploadedImageDV extends AssociatedContentDV implements Serializable
/** The soggetto. */
private List soggetto;
+ private List listWsContent;
+
/**
* Instantiates a new uploaded image.
*/
@@ -108,6 +111,14 @@ public class UploadedImageDV extends AssociatedContentDV implements Serializable
this.soggetto = soggetto;
}
+ public List getListWsContent() {
+ return listWsContent;
+ }
+
+ public void setListWsContent(List listWsContent) {
+ this.listWsContent = listWsContent;
+ }
+
/**
* To string.
*
diff --git a/src/test/java/org/gcube/portlets/user/geoportaldataviewer/GetConcessione.java b/src/test/java/org/gcube/portlets/user/geoportaldataviewer/GetConcessione.java
index df80cdf..a056e42 100644
--- a/src/test/java/org/gcube/portlets/user/geoportaldataviewer/GetConcessione.java
+++ b/src/test/java/org/gcube/portlets/user/geoportaldataviewer/GetConcessione.java
@@ -14,14 +14,14 @@ public class GetConcessione {
private static final Logger LOG = LoggerFactory.getLogger(GetConcessione.class);
public static String SCOPE = "/gcube/devNext/NextNext";
- public static long concessioneId = 14;
+ public static long concessioneId = 48;
public static void main(String[] args) {
ScopeProvider.instance.set(SCOPE);
- Concessione loaded=(Concessione) ManagerFactory.getByRecordID(concessioneId).getRecord();
- LOG.info("Loaded bean : "+loaded);
+// Concessione loaded=(Concessione) ManagerFactory.getByRecordID(concessioneId).getRecord();
+// LOG.info("Loaded bean : "+loaded);
try {
LOG.info("Trying to get record for id "+concessioneId);
@@ -32,10 +32,9 @@ public class GetConcessione {
if(record !=null && record instanceof Concessione) {
concessione = (Concessione) record;
LOG.info("To concessione view model:" +ConvertToDataViewModel.toConcessione(concessione).toString());
- }else
- throw new Exception("No Concessione with id '"+concessioneId+"' is available");
-
-
+ }else {
+ LOG.warn("No Record with id '"+concessioneId+"' is available");
+ }
}catch (Exception e) {
String erroMsg = Concessione.class.getSimpleName() +" with id "+concessioneId+" not available";
LOG.error(erroMsg,e);