diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 23f6300..3f6b474 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,5 +1,6 @@ - + + @@ -45,7 +46,8 @@ - + + @@ -91,7 +93,8 @@ - + + @@ -137,7 +140,8 @@ - + + @@ -183,7 +187,8 @@ - + + @@ -229,7 +234,8 @@ - + + @@ -275,10 +281,8 @@ - - uses - - + + @@ -324,7 +328,8 @@ - + + @@ -370,7 +375,8 @@ - + + @@ -416,7 +422,8 @@ - + + diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/layers/LayersSectionViewer.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/layers/LayersSectionViewer.java index 240badd..e71b0e1 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/layers/LayersSectionViewer.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/client/ui/cms/layers/LayersSectionViewer.java @@ -100,26 +100,37 @@ public class LayersSectionViewer extends Composite { GWT.log("mapServerHost: " + mapServerHost); BBOXDV bbox = layer.getBbox(); + + try { - if(bbox!=null) { - - if(!GWT.isProdMode()) { - GWT.log("bbox: " + bbox); + if (bbox != null) { + + if (!GWT.isProdMode()) { + GWT.log("bbox: " + bbox); // GWT.log("bbox keys: " + bbox.keySet()); // GWT.log("bbox values: " + bbox.values()); - GWT.log("minX: " + bbox.getMinX()); - GWT.log("minY: " + bbox.getMinY()); - GWT.log("maxX: " + bbox.getMaxX()); - GWT.log("maxY: " + bbox.getMaxY()); + GWT.log("minX: " + bbox.getMinX()); + GWT.log("minY: " + bbox.getMinY()); + GWT.log("maxX: " + bbox.getMaxX()); + GWT.log("maxY: " + bbox.getMaxY()); + } + + BoundsMap bounds = new BoundsMap(bbox.getMinX(), bbox.getMinY(), bbox.getMaxX(), bbox.getMaxY(), ""); + GWT.log("bounds: " + bounds); + mapView.addWMSLayer(mapServerHost, layerName, bounds); + } else { + Alert alert = new Alert(); + alert.setType(AlertType.ERROR); + alert.setText("No BBOX found for this layer"); + alert.setClose(false); + layerPanel.add(alert); } - - BoundsMap bounds = new BoundsMap(bbox.getMinX(), bbox.getMinY(), bbox.getMaxX(), bbox.getMaxY(), ""); - GWT.log("bounds: " + bounds); - mapView.addWMSLayer(mapServerHost, layerName, bounds); - }else { + + } catch (Exception e) { Alert alert = new Alert(); alert.setType(AlertType.ERROR); - alert.setText("No BBOX found for this layer"); + alert.setHTML("Error on adding the layer to Map. Please check its WMS link:
"+layer.getWMSLink()); + alert.getElement().getStyle().setProperty("wordBreak", "break-all"); alert.setClose(false); layerPanel.add(alert); } @@ -138,18 +149,6 @@ public class LayersSectionViewer extends Composite { @Override public void onClick(ClickEvent event) { - - // DOWNLOAD only the layer by Geoserver - /* - * Map mapLayerURLs = - * mapView.getLightOLSM().getLayerURLsProperty(); Collection layerURLs = - * mapLayerURLs.values(); ArrayList layers = new - * ArrayList(layerURLs); exportPDF(layers.get(0)); String layerURL = - * mapLayerURLs.get(layerDV.getLayerName()); GWT.log("layerDV name is: " + - * layerDV.getLayerName()); if (layerURL != null) Window.open(layerURL, - * "_blank", null); - */ - downloadAttempt++; if (downloadAttempt > 3) { @@ -160,7 +159,6 @@ public class LayersSectionViewer extends Composite { // DOWNLOAD the OSM + layer by canvas downloadMap(mapView.getLightOLM().getMap(), mapView.getPanelMapElementId(), htmlLinkId, filename, mimeType); - // mapExport(mapView.getLightOLSM().getMap(), mapView.getPanelMapElementId()); } }); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/Geoportal_JSON_Mapper.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/Geoportal_JSON_Mapper.java index bd65665..e30f206 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/Geoportal_JSON_Mapper.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/Geoportal_JSON_Mapper.java @@ -577,6 +577,7 @@ public class Geoportal_JSON_Mapper { projectView.addSectionView(sectionView); } + LOG.debug("returning the projectView: " + projectView); return projectView; } diff --git a/src/test/java/org/gcube/portlets/user/geoportaldataviewer/GeoportalViewer_Tests.java b/src/test/java/org/gcube/portlets/user/geoportaldataviewer/GeoportalViewer_Tests.java index 690b09a..de03d26 100644 --- a/src/test/java/org/gcube/portlets/user/geoportaldataviewer/GeoportalViewer_Tests.java +++ b/src/test/java/org/gcube/portlets/user/geoportaldataviewer/GeoportalViewer_Tests.java @@ -59,13 +59,13 @@ public class GeoportalViewer_Tests { //private static String CONTEXT = "/pred4s/preprod/preVRE"; private static String CONTEXT = "/d4science.research-infrastructures.eu/D4OS/GNA"; - private static String TOKEN = ""; //GNA + private static String TOKEN = "ae9c0e67-68ca-42de-899b-015a98e4619b-843339462"; //GNA //private static String CONTEXT = "/gcube/devsec/devVRE"; //private static String TOKEN = ""; // devVRE private static String PROFILE_ID = "profiledConcessioni"; - private static String PROJECT_ID = "6388ea6ca1e60e66b7b584e0"; + private static String PROJECT_ID = "63c6c0f1a1e60e66b7b588fe"; private static String USERNAME = "francesco.mangiacrapa"; @@ -83,7 +83,7 @@ public class GeoportalViewer_Tests { clientProjects = GeoportalClientCaller.projects(); } - // @Test + @Test public void getProjectViewForID() { try {