merged with branch 1.0.0-SNAPSHOT

task_20357
Francesco Mangiacrapa 3 years ago
parent 34215b424b
commit 5def7389c2

@ -13,15 +13,15 @@
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
@ -35,5 +35,6 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="/home/francesco-mangiacrapa/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar"/>
<classpathentry kind="output" path="target/geoportal-data-viewer-app-1.0.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

@ -4,6 +4,6 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.0.0] - 2020-12-03
## [v1.0.0] - 2020-12-09
[#20004] First release

@ -1,6 +1,6 @@
# GeoPortal Data Viewer App
The GeoPortal Data Viewer App is an application to access, discovery and navigate the GeoNa products by a Gis GUI
The GeoPortal Data Viewer App is an application to access, discovery and navigate the GeoNa products by a Web-Map Interface
## Built With

@ -16,7 +16,7 @@
<packaging>war</packaging>
<version>1.0.0</version>
<name>GeoPortal Data Viewer App</name>
<description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the GeoNa products by a Gis GUI</description>
<description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the GeoNa products by a Web-Map Interface</description>
<properties>
<!-- Convenience property to set the GWT version -->

@ -2,6 +2,7 @@ package org.gcube.portlets.user.geoportaldataviewer.client.gis;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.Images;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery.TYPE;
@ -173,13 +174,18 @@ import ol.style.TextOptions;
*
* @param mapServerHost the map server host
* @param layerName the layer name
* @param bbox
* @return the image
*/
public Image addWMSLayer(String mapServerHost, String layerName) {
public Image addWMSLayer(String mapServerHost, String layerName, BoundsMap bbox) {
GWT.log("Adding wmsLayer with mapServerHost: "+mapServerHost+", layerName: "+layerName);
ImageWmsParams imageWMSParams = OLFactory.createOptions();
imageWMSParams.setLayers(layerName);
//imageWMSParams.setSize(new Size(400,400));
//imageWMSParams.setVersion("1.1.0");
// if(bbox!=null)
// imageWMSParams.set("BBOX", bbox.getLowerLeftX()+","+bbox.getLowerLeftY()+","+bbox.getUpperRightX()+","+bbox.getUpperRightY());
ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setUrl(mapServerHost);

@ -13,6 +13,7 @@ import com.github.gwtbootstrap.client.ui.Paragraph;
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.TextAlign;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
@ -40,6 +41,9 @@ public class ImageView extends Composite {
@UiField
Paragraph paragraph1;
@UiField
Paragraph paragraph2;
@UiField
Button openImage;
@ -54,6 +58,12 @@ public class ImageView extends Composite {
heading.setText(imageDV.getTitolo());
paragraph1.setText(imageDV.getDidascalia());
paragraph1.getElement().getStyle().setTextAlign(TextAlign.LEFT);
if(!showView && imageDV.getLicenseID()!=null) {
paragraph2.setVisible(true);
paragraph2.setText("ID Licenza: "+imageDV.getLicenseID());
}
if(imageDV.getListWsContent()!=null && imageDV.getListWsContent().size()>0) {
latest = imageDV.getListWsContent().get(imageDV.getListWsContent().size()-1);

@ -21,7 +21,7 @@
<b:Heading size="4" ui:field="heading"></b:Heading>
<b:Paragraph ui:field="paragraph1">
</b:Paragraph>
<b:Paragraph ui:field="paragraph2">
<b:Paragraph ui:field="paragraph2" visible="false">
</b:Paragraph>
</b:Caption>
</g:HTMLPanel>

@ -45,7 +45,7 @@ public class ThumbnailImageView extends Composite {
initWidget(uiBinder.createAndBindUi(this));
ImageView imageView = new ImageView(imageDV, showView, showOpen);
String title = StringUtil.ellipsize(imageDV.getTitolo(), 20);
String title = StringUtil.ellipsize(imageDV.getTitolo(), 25);
imageView.setHeading(title);
String didascalia = StringUtil.ellipsize(imageDV.getDidascalia(), 50);

@ -128,10 +128,12 @@ import ol.OLFactory;
@Override
public void execute() {
olsm.addWMSLayer(mapServerHost, layerName);
if (bbox != null) {
ExtentWrapped ew = null;
BoundsMap theBBOX = bbox;
if (bbox != null) {
Coordinate lower = OLFactory.createCoordinate(bbox.getLowerLeftX(), bbox.getLowerLeftY());
Coordinate lowerCoord = MapUtils.transformCoordiante(lower, GeoportalDataViewerConstants.EPSG_4326,
@ -141,12 +143,14 @@ import ol.OLFactory;
Coordinate upperCoord = MapUtils.transformCoordiante(upper, GeoportalDataViewerConstants.EPSG_4326,
GeoportalDataViewerConstants.EPSG_3857);
ExtentWrapped ew = new ExtentWrapped(lowerCoord.getX(), lowerCoord.getY(), upperCoord.getX(), upperCoord.getY());
//Coordinate center = ew.getCenter();
//GWT.log("center: "+center);
//Coordinate invertCoordinate = new Coordinate(center.getY(), center.getX());
// Size size = new Size(300, 300);
//olsm.getMap().getView().setCenter(invertCoordinate);
ew = new ExtentWrapped(lowerCoord.getX(), lowerCoord.getY(), upperCoord.getX(), upperCoord.getY());
theBBOX = new BoundsMap(lowerCoord.getX(), lowerCoord.getY(), upperCoord.getX(), upperCoord.getY(), null);
}
olsm.addWMSLayer(mapServerHost, layerName, theBBOX);
if (ew != null) {
olsm.getMap().getView().fit(ew);
}

@ -35,7 +35,7 @@ public class RelazioneScavoView extends Composite {
abstractParagraph.setText(relazioneScavoDV.getAbstractSection());
//customTable.addNextKeyValue("Created", relazioneScavoDV.getCreationTime());
customTable.addNextKeyValue("ID Licenza", relazioneScavoDV.getLicenseID());
//customTable.addNextKeyValue("ID Licenza", relazioneScavoDV.getLicenseID());
customTable.addNextKeyValues("Responsabili", relazioneScavoDV.getResponsabili(), GeoportalDataViewerConstants.NEW_LINE_BR);
relazioneScavoPanel.add(customTable);
}

@ -306,10 +306,16 @@ public class ConvertToDataViewModel {
String wmsLink = layerConcessione.getWmsLink();
String layerName = null;
BoundsMap bounds = null;
//reading layer name from wmsLink
//string bbox
if(wmsLink!=null) {
layerName = URLParserUtil.extractValueOfParameterFromURL("layers", wmsLink);
String bbox = URLParserUtil.extractValueOfParameterFromURL("bbox", wmsLink);
String wmsVersion = URLParserUtil.extractValueOfParameterFromURL("version", wmsLink);
bounds = toBoundMap(wmsVersion, bbox, ",");
LOG.debug("Built bounds from wmsLInk: "+bounds);
}
if(layerName!=null)
@ -322,7 +328,10 @@ public class ConvertToDataViewModel {
theLayerConessione.setLayerID(layerConcessione.getLayerID());
theLayerConessione.setLayerUUID(layerConcessione.getLayerUUID());
theLayerConessione.setAuthors(layerConcessione.getAuthors());
BoundsMap bounds = toBoundMap(layerConcessione.getBbox());
if(bounds==null)
bounds = toBoundMap(layerConcessione.getBbox());
theLayerConessione.setBbox(bounds);
theLayerConessione.setCreationTime(toDateFormatString(layerConcessione.getCreationTime()));
theLayerConessione.setId(layerConcessione.getId());
@ -378,5 +387,50 @@ public class ConvertToDataViewModel {
return new BoundsMap(bbox.getMinLong(), bbox.getMinLat(), bbox.getMaxLong(), bbox.getMaxLat(), null);
}
/**
* To bound map.
*
* @param bbox the bbox
* @return the bounds map
*/
public static BoundsMap toBoundMap(String wmsVersion, String bbox, String separator) {
if (bbox == null)
return null;
if(wmsVersion==null)
return null;
if(separator==null)
separator = ",";
try {
String[] bboxArr = bbox.split(separator);
if(wmsVersion.startsWith("1.3")) {
//is 1.3.x
return new BoundsMap(toDouble(bboxArr[1]), toDouble(bboxArr[0]), toDouble(bboxArr[3]), toDouble(bboxArr[2]), wmsVersion);
}else {
//should be 1.1.X
return new BoundsMap(toDouble(bboxArr[0]), toDouble(bboxArr[1]), toDouble(bboxArr[2]), toDouble(bboxArr[3]), wmsVersion);
}
}catch (Exception e) {
LOG.warn("Error on creating Bounds for wmsVersion "+wmsVersion+" and bbox "+bbox+" : ",e);
return null;
}
}
public static Double toDouble(String value) {
try {
return Double.parseDouble(value);
}catch (Exception e) {
LOG.warn("Error on parsing "+value+" as double: ",e);
return null;
}
}
}

@ -91,6 +91,7 @@ body {
#page-view-details .page-header {
margin-bottom: 22px;
padding-top: 5px;
}
@ -107,14 +108,15 @@ body {
}
#page-view-details .my-custom-flex-table {
margin-left: 20px;
margin-right: 40px;
margin-left: 10px;
/*margin-right: 40px;*/
font-size: 13px;
max-width: 98%;
max-width: 95%;
}
#page-view-details .my-custom-flex-table td {
padding: 5px;
padding-top: 5px;
padding-bottom: 5px;
}
#page-view-details .my-custom-flex-table tbody tr>td:first-child {
@ -211,7 +213,7 @@ body {
border: 1px solid #ddd;
border-radius: 4px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
padding-right: 10px;
/*padding-right: 10px;*/
margin-bottom: 10px;
width: 98%;
}

Loading…
Cancel
Save