Compare commits

..

1 Commits

Author SHA1 Message Date
Francesco Mangiacrapa 3a7005728f merged with master at a6ac952994 2023-06-15 12:08:37 +02:00
54 changed files with 515 additions and 1695 deletions

View File

@ -1,11 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/geoportal-data-viewer-app-3.7.0/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/geoportal-data-viewer-app-3.5.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-3.5.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> <classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes> <attributes>
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
@ -30,10 +35,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-3.7.0/WEB-INF/classes" path="src/main/resources"> <classpathentry kind="output" path="target/geoportal-data-viewer-app-3.5.0-SNAPSHOT/WEB-INF/classes"/>
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.7.0/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -1,4 +1,4 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.7.0 lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.5.0-SNAPSHOT
warSrcDir=src/main/webapp warSrcDir=src/main/webapp
warSrcDirIsOutput=false warSrcDirIsOutput=false

View File

@ -84,131 +84,7 @@
<wb-module deploy-name="geoportal-data-viewer-app-3.5.0-SNAPSHOT">
<wb-module deploy-name="geoportal-data-viewer-app-3.7.0">
@ -359,68 +235,6 @@
@ -507,68 +321,6 @@
@ -655,68 +407,6 @@
@ -760,6 +450,58 @@
@ -773,74 +515,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="geoportal-client-1.2.2.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-client/geoportal-client"> <dependent-module archiveName="geoportal-data-common-2.2.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="geoportal-common-1.1.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-common/geoportal-common">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -991,68 +668,6 @@
@ -1139,68 +754,6 @@
@ -1287,68 +840,6 @@

View File

@ -4,19 +4,7 @@
All notable changes to this project will be documented in this file. 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). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v3.7.0] ## [v3.5.0-SNAPSHOT]
- Provided the "Export as PDF" facility [#26026]
- Integrated the GeoportalExporter as service [#27321]
- Passed to the new KC-client [#27398]
## [v3.6.0]
- GUI optimization [#25461]
- Using the latest libraries version: gwt-ol.v8.4.1 (with openlayers.v6.6.1) and gwt.v2.10
- Showing basic statistics (i.e. "X project published") via 'countByPhase' method [#25598]
## [v3.5.0]
- Supported the cross-filtering [#25074] - Supported the cross-filtering [#25074]
- Supported the grouped custom layers [#25110] - Supported the grouped custom layers [#25110]

View File

@ -1,6 +1,6 @@
# GeoPortal Data Viewer App # GeoPortal Data Viewer App
The "Geoportal data-viewer" technology allows users to access and search for spatio-temporal documents through a web GIS which allows them to: (i) navigate and select the projects published in the system by "geographical map" (spatial dimension) , (ii) navigate and select the relationships between projects (evolution of over time) via "timeline" (temporal dimension), (iii) view metadata and resources (images, layers, etc. .) of documents via the "project view detail", (iv) export a view of the map with the layer of interest or add the layers of a project to the main map, (v) manage the order and overlapping of the layers, (vi) execute spatial queries on the layers and view the results, (vii) search through metadata or temporal dimension queries for the projects of interest, (vii) apply spatial filters for cross-layer. The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface
## Built With ## Built With
@ -9,9 +9,9 @@ The "Geoportal data-viewer" technology allows users to access and search for spa
**Uses** **Uses**
* GWT v.2.10.0. [GWT](http://www.gwtproject.org) is licensed under [Apache License 2.0](http://www.gwtproject.org/terms.html) * GWT v.2.9.0. [GWT](http://www.gwtproject.org) is licensed under [Apache License 2.0](http://www.gwtproject.org/terms.html)
* GWT-Bootstrap v.2.3.2.0. [GWT-Bootstrap](https://github.com/gwtbootstrap) is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) * GWT-Bootstrap v.2.3.2.0. [GWT-Bootstrap](https://github.com/gwtbootstrap) is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* GWT-OpenLayers 3+ v.8.5.0-gwt2_9. [GWT-OL3](https://github.com/TDesjardins/gwt-ol) * GWT-OpenLayers 3+ v.8.1.0-gwt2_9. [GWT-OL3](https://github.com/TDesjardins/gwt-ol)
* OpenLayers v.6.x [OpenLayers](https://openlayers.org/) is licensed under [BSD 2-Clause "Simplified"](https://github.com/openlayers/openlayers/blob/main/LICENSE.md) * OpenLayers v.6.x [OpenLayers](https://openlayers.org/) is licensed under [BSD 2-Clause "Simplified"](https://github.com/openlayers/openlayers/blob/main/LICENSE.md)
* NanoGallery v2.X [NanoGallery2](https://github.com/nanostudio-org/nanogallery2) is licensed under [GNU General Public License "gplv3"](https://www.gnu.org/licenses/gpl-3.0.html) * NanoGallery v2.X [NanoGallery2](https://github.com/nanostudio-org/nanogallery2) is licensed under [GNU General Public License "gplv3"](https://www.gnu.org/licenses/gpl-3.0.html)
* Vis-Timeline v7.x [VisTimeline](https://github.com/visjs/vis-timeline) is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) and MIT * Vis-Timeline v7.x [VisTimeline](https://github.com/visjs/vis-timeline) is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) and MIT
@ -21,40 +21,17 @@ The "Geoportal data-viewer" technology allows users to access and search for spa
<img src="https://gcube.wiki.gcube-system.org/images_gcube/8/82/GeoPortalDataViewer_Architecture.png" style="max-width:800px;" alt="GeoPortal Data-Viewer - Architecture" /> <img src="https://gcube.wiki.gcube-system.org/images_gcube/8/82/GeoPortalDataViewer_Architecture.png" style="max-width:800px;" alt="GeoPortal Data-Viewer - Architecture" />
## Showcase
##### D4GNA instance of Geoportal D4Science
see at [Dataset per il Geoportale Nazionale per lArcheologia (D4GNA)](https://gna.d4science.org/)
**D4GNA Viewer - OSM**
<img src="https://gcube.wiki.gcube-system.org/images_gcube/0/06/D4GNA_Viewer_OSM.png" style="max-width:800px;" alt="Data_Viewer_OSM" />
**D4GNA Viewer - MapBox**
<img src="https://gcube.wiki.gcube-system.org/images_gcube/9/9c/D4GNA_Viewer_MapBox.png" style="max-width:800px;" alt="Data_Viewer_MapBox" />
**D4GNA Viewer - Discovering...**
<img src="https://gcube.wiki.gcube-system.org/images_gcube/8/85/D4GNA_ERCIM_3.png" style="max-width:800px;" alt="D4GNA_ERCIM_3" />
<br />
<br />
<img src="https://gcube.wiki.gcube-system.org/images_gcube/9/9c/D4GNA_ERCIM_2.png" style="max-width:800px;" alt="D4GNA_ERCIM_2" />
## Documentation ## Documentation
Geoportal Service Documentation is available at [gCube CMS Suite](https://geoportal.d4science.org/geoportal-service/docs/index.html) Geoportal Service Documentation is available at [gCube CMS Suite](https://geoportal.d4science.org/geoportal-service/docs/index.html)
User Guide (DRAFT ITA) is available at [Guida al DataViewer D4GNA (DRAFT-ITA)](https://gcube.wiki.gcube-system.org/images_gcube/b/b3/D4science_Guida_al_DataViewer_D4GNA_bozza.pdf)
## Change log ## Change log
See the [Releases](https://code-repo.d4science.org/gCubeSystem/geoportal-data-viewer-app/releases) See the [Releases](https://code-repo.d4science.org/gCubeSystem/geoportal-data-viewer-app/releases)
## Authors ## Authors
* **Francesco Mangiacrapa** ([ORCID](https://orcid.org/0000-0002-6528-664X)) Computer Scientist at [ISTI-CNR Infrascience Group](http://infrascience.isti.cnr.it) * **Francesco Mangiacrapa** ([ORCID](https://orcid.org/0000-0002-6528-664X)) Computer Scientist at [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
## License ## License

44
pom.xml
View File

@ -14,7 +14,7 @@
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>geoportal-data-viewer-app</artifactId> <artifactId>geoportal-data-viewer-app</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>3.7.0</version> <version>3.5.0-SNAPSHOT</version>
<name>GeoPortal Data Viewer App</name> <name>GeoPortal Data Viewer App</name>
<description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface</description> <description>The GeoPortal Data Viewer App is an application to access, discovery and navigate the Geoportal projects/documents by a Web-Map Interface</description>
@ -23,7 +23,6 @@
<gwt.version>2.10.0</gwt.version> <gwt.version>2.10.0</gwt.version>
<gwt.compiler.style>PRETTY</gwt.compiler.style> <gwt.compiler.style>PRETTY</gwt.compiler.style>
<gson.version>2.6.2</gson.version> <gson.version>2.6.2</gson.version>
<gwt.ol.version>8.5.0</gwt.ol.version>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<!-- GWT 2.9 support 8, 9 and 11 --> <!-- GWT 2.9 support 8, 9 and 11 -->
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
@ -56,40 +55,13 @@
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId> <artifactId>maven-portal-bom</artifactId>
<version>${gcube-portal-bom-version}</version> <version>3.7.0</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<profiles>
<!-- PROD profile -->
<profile>
<id>geoportal-data-viewer-app-release-profile</id>
<activation>
<property>
<name>Release</name>
</property>
</activation>
<properties>
<gcube-portal-bom-version>4.0.0</gcube-portal-bom-version>
</properties>
</profile>
<!-- DEV profile -->
<profile>
<id>geoportal-data-viewer-app-snapshot-profile</id>
<activation>
<property>
<name>!Release</name>
</property>
</activation>
<properties>
<gcube-portal-bom-version>4.0.0-SNAPSHOT</gcube-portal-bom-version>
</properties>
</profile>
</profiles>
<dependencies> <dependencies>
<dependency> <dependency>
@ -130,7 +102,7 @@
<dependency> <dependency>
<groupId>com.github.tdesjardins</groupId> <groupId>com.github.tdesjardins</groupId>
<artifactId>gwt-ol3</artifactId> <artifactId>gwt-ol3</artifactId>
<version>${gwt.ol.version}</version> <version>8.1.0-gwt2_9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.gwtbootstrap</groupId> <groupId>com.github.gwtbootstrap</groupId>
@ -174,13 +146,13 @@
<dependency> <dependency>
<groupId>org.gcube.application</groupId> <groupId>org.gcube.application</groupId>
<artifactId>geoportal-data-mapper</artifactId> <artifactId>geoportal-data-mapper</artifactId>
<version>[1.0.1, 2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.application</groupId> <groupId>org.gcube.application</groupId>
<artifactId>geoportal-data-common</artifactId> <artifactId>geoportal-data-common</artifactId>
<version>[2.0.0, 3.0.0-SNAPSHOT)</version> <version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -202,26 +174,30 @@
<dependency> <dependency>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>keycloak-client</artifactId> <artifactId>keycloak-client</artifactId>
<version>[2.0.0, 3.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.liferay.portal</groupId> <groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId> <artifactId>portal-service</artifactId>
<!-- <version>6.2.5</version> -->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.portlet</groupId> <groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId> <artifactId>portlet-api</artifactId>
<!-- <version>2.0</version> -->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
<!-- <version>1.6.4</version> -->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<!-- <version>1.6.4</version> -->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>

View File

@ -17,17 +17,11 @@
<inherits name="com.google.gwt.json.JSON" /> <inherits name="com.google.gwt.json.JSON" />
<inherits
name='org.gcube.portal.clientcontext.GCubeClientContext' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> --> <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> --> <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits --> <!-- Other module inherits -->
<servlet path="/geoportalexporterservice"
class="org.gcube.portlets.user.geoportaldataviewer.server.GeoportalExporterActionServlet" />
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<entry-point <entry-point
class='org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer' /> class='org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer' />

View File

@ -64,7 +64,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils; import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap.CQL_FACILITY_ORIGIN; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap.CQL_FACILITY_ORIGIN;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel; import org.gcube.portlets.user.geoportaldataviewer.client.ui.GeonaDataViewMainPanel;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.relation.TimelineManagerStatus; import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.relation.TimelineManagerStatus;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.OLGeoJSONUtil; import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.OLGeoJSONUtil;
@ -112,8 +112,6 @@ public class GeoportalDataViewer implements EntryPoint {
public static final String DIV_TIMELINE_DATA = "timeline-data"; public static final String DIV_TIMELINE_DATA = "timeline-data";
public static final String DIV_LAYER_VIEW = "layer-viewer";
public static final String APP_NOTIFIER = "app-notifier"; public static final String APP_NOTIFIER = "app-notifier";
/** The Constant APP_DIV. */ /** The Constant APP_DIV. */
@ -150,7 +148,7 @@ public class GeoportalDataViewer implements EntryPoint {
int attempt = 0; int attempt = 0;
private LoaderIcon loaderApp = new LoaderIcon("Loading application... please wait", private LoaderIcon loaderApp = new LoaderIcon("Loading application... please wait",
new com.google.gwt.user.client.ui.Image(GeoportalImages.ICONS.spinnerEarth())); new com.google.gwt.user.client.ui.Image(GNAImages.ICONS.spinnerEarth()));
private HTML attributionDiv = new HTML(); private HTML attributionDiv = new HTML();
@ -417,7 +415,6 @@ public class GeoportalDataViewer implements EntryPoint {
mainPanel.setPanelsHeight(height); mainPanel.setPanelsHeight(height);
GWT.log("Set height: " + height); GWT.log("Set height: " + height);
mainPanel.setPanelsWidth(Window.getClientWidth());
} }
/** /**
@ -543,7 +540,7 @@ public class GeoportalDataViewer implements EntryPoint {
Modal errorModal = new Modal(true, true); Modal errorModal = new Modal(true, true);
errorModal.setCloseVisible(true); errorModal.setCloseVisible(true);
errorModal.setTitle("Oops..."); errorModal.setTitle("Oops...");
Image geoportalError = new Image(GeoportalImages.ICONS.warningError()); Image geoportalError = new Image(GNAImages.ICONS.warningError());
FlowPanel errorPanelMsg = new FlowPanel(); FlowPanel errorPanelMsg = new FlowPanel();
errorPanelMsg.getElement().addClassName("general_warning"); errorPanelMsg.getElement().addClassName("general_warning");
errorPanelMsg.add(geoportalError); errorPanelMsg.add(geoportalError);
@ -1072,7 +1069,7 @@ public class GeoportalDataViewer implements EntryPoint {
* @return the general error panel * @return the general error panel
*/ */
private FlowPanel getGeneralErrorPanel() { private FlowPanel getGeneralErrorPanel() {
Image geoportalError = new Image(GeoportalImages.ICONS.geoportaServiceError()); Image geoportalError = new Image(GNAImages.ICONS.geoportaServiceError());
FlowPanel errorPanelMsg = new FlowPanel(); FlowPanel errorPanelMsg = new FlowPanel();
errorPanelMsg.getElement().addClassName("general_error"); errorPanelMsg.getElement().addClassName("general_error");
errorPanelMsg.add(geoportalError); errorPanelMsg.add(geoportalError);

View File

@ -3,7 +3,6 @@ package org.gcube.portlets.user.geoportaldataviewer.client;
import org.gcube.application.geoportalcommon.ConvertToDataViewModel; import org.gcube.application.geoportalcommon.ConvertToDataViewModel;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayersMapParameters; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayersMapParameters;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Element;
import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.i18n.client.DateTimeFormat;
@ -16,17 +15,6 @@ import com.google.gwt.i18n.client.DateTimeFormat;
*/ */
public class GeoportalDataViewerConstants { public class GeoportalDataViewerConstants {
//Geoportal_Exporter_ACTION_SERVLET
public static final String UCD_ID_PARAMETER = "ucdID";
public static final String PROIECT_ID_PARAMETER = "projectID";
public static final String CONTEXT_ID_PARAMETER = "c_id";
public static final String USER_ID_PARAMETER = "u_id";
public static final String USERNAME_PARAMETER = "usn";
public static final String GEOPORTAL_EXPORT_ACTION_SERVLET = GWT.getModuleBaseURL()
+ "geoportalexporterservice";
public static final int TABLET_WIDTH = 1601;
public static final String MAP_DIV = "map"; public static final String MAP_DIV = "map";
public static final String GET_WMS_PARAMETER = "wmsrequest"; public static final String GET_WMS_PARAMETER = "wmsrequest";
@ -49,29 +37,6 @@ public class GeoportalDataViewerConstants {
public static final String PROJECT_ID_KEY_FEATURE = "projectid"; public static final String PROJECT_ID_KEY_FEATURE = "projectid";
public static enum GisToolbarFacilities {
COLLECTION("Collection", "Open the collections"), MAP("Map", "Select the base Map"),
OVERLAY("Overlay", "Add overlay layers"), SEARCH("Search", "Search in the collections"),
FILTER("Filter", "Apply spatial filtering"), LAYERS("Layers", "Layers added to Map"),
PRESET_LOCATION("Preset Location", "Center the Map to Location");
String name;
String tooltip;
GisToolbarFacilities(String name, String tooltip) {
this.name = name;
this.tooltip = tooltip;
}
public String getName() {
return name;
}
public String getTooltip() {
return tooltip;
}
}
/** /**
* The Enum LayerType. * The Enum LayerType.
* *

View File

@ -14,7 +14,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.materialization.GC
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView; import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap; import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoportalSpatialQueryResult; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult;
import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse; import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse;
import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs; import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs;
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration; import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
@ -57,8 +57,8 @@ public interface GeoportalDataViewerService extends RemoteService {
* @return the data result * @return the data result
* @throws Exception the exception * @throws Exception the exception
*/ */
List<GeoportalSpatialQueryResult> getDataResult(List<LayerObject> layerObjects, String mapSrsName, List<GeoNaSpatialQueryResult> getDataResult(List<LayerObject> layerObjects, String mapSrsName, BoundsMap mapBBOX,
BoundsMap mapBBOX, int maxWFSFeature, double zoomLevel) throws Exception; int maxWFSFeature, double zoomLevel) throws Exception;
/** /**
* Gets the my login. * Gets the my login.
@ -104,7 +104,7 @@ public interface GeoportalDataViewerService extends RemoteService {
* @param zoomLevel the zoom level * @param zoomLevel the zoom level
* @return the WFS features * @return the WFS features
*/ */
List<GeoportalSpatialQueryResult> getWFSFeatures(List<LayerObject> layerObjects, String mapSrsName, List<GeoNaSpatialQueryResult> getWFSFeatures(List<LayerObject> layerObjects, String mapSrsName,
BoundsMap selectBBOX, int maxWFSFeature, double zoomLevel); BoundsMap selectBBOX, int maxWFSFeature, double zoomLevel);
/** /**
@ -227,8 +227,4 @@ public interface GeoportalDataViewerService extends RemoteService {
*/ */
String getHTTPResponseForURL(String url); String getHTTPResponseForURL(String url);
Integer getCountFor(String profileID, String phase, String status);
Boolean checkExportAsPDFConfig();
} }

View File

@ -14,7 +14,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.materialization.GC
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView; import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap; import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoportalSpatialQueryResult; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult;
import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse; import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse;
import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs; import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs;
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration; import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
@ -48,7 +48,7 @@ public interface GeoportalDataViewerServiceAsync {
void parseWmsRequest(String wmsRequest, String layerName, AsyncCallback<GeoInformationForWMSRequest> callback); void parseWmsRequest(String wmsRequest, String layerName, AsyncCallback<GeoInformationForWMSRequest> callback);
void getDataResult(List<LayerObject> layerObjects, String mapSrsName, BoundsMap mapBBOX, int maxWFSFeature, void getDataResult(List<LayerObject> layerObjects, String mapSrsName, BoundsMap mapBBOX, int maxWFSFeature,
double zoomLevel, AsyncCallback<List<GeoportalSpatialQueryResult>> callback); double zoomLevel, AsyncCallback<List<GeoNaSpatialQueryResult>> callback);
void getMyLogin(AsyncCallback<String> callback); void getMyLogin(AsyncCallback<String> callback);
@ -60,7 +60,7 @@ public interface GeoportalDataViewerServiceAsync {
AsyncCallback<List<GCubeSDIViewerLayerDV>> asyncCallback); AsyncCallback<List<GCubeSDIViewerLayerDV>> asyncCallback);
void getWFSFeatures(List<LayerObject> layerObjects, String mapSrsName, BoundsMap selectBBOX, int maxWFSFeature, void getWFSFeatures(List<LayerObject> layerObjects, String mapSrsName, BoundsMap selectBBOX, int maxWFSFeature,
double zoomLevel, AsyncCallback<List<GeoportalSpatialQueryResult>> callback); double zoomLevel, AsyncCallback<List<GeoNaSpatialQueryResult>> callback);
void getListBaseLayers(AsyncCallback<List<BaseMapLayer>> callback); void getListBaseLayers(AsyncCallback<List<BaseMapLayer>> callback);
@ -91,8 +91,4 @@ public interface GeoportalDataViewerServiceAsync {
void getHTTPResponseForURL(String url, AsyncCallback<String> callback); void getHTTPResponseForURL(String url, AsyncCallback<String> callback);
void getCountFor(String profileID, String phase, String status, AsyncCallback<Integer> callback);
void checkExportAsPDFConfig(AsyncCallback<Boolean> callback);
} }

View File

@ -40,7 +40,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.ui.ModalWindow;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.ProjectUtil; import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.ProjectUtil;
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil; import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil; import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoportalSpatialQueryResult; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerItem;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
@ -190,7 +190,7 @@ public class LayerManager {
GeoportalDataViewerServiceAsync.Util.getInstance().getDataResult(listLO, olMap.getProjectionCode(), GeoportalDataViewerServiceAsync.Util.getInstance().getDataResult(listLO, olMap.getProjectionCode(),
mapBBOX, GeoportalDataViewerConstants.MAX_WFS_FEATURES, olMap.getCurrentZoomLevel(), mapBBOX, GeoportalDataViewerConstants.MAX_WFS_FEATURES, olMap.getCurrentZoomLevel(),
new AsyncCallback<List<GeoportalSpatialQueryResult>>() { new AsyncCallback<List<GeoNaSpatialQueryResult>>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
@ -199,7 +199,7 @@ public class LayerManager {
} }
@Override @Override
public void onSuccess(List<GeoportalSpatialQueryResult> listGeonaDataObjects) { public void onSuccess(List<GeoNaSpatialQueryResult> listGeonaDataObjects) {
if (listGeonaDataObjects == null) if (listGeonaDataObjects == null)
return; return;
@ -221,7 +221,7 @@ public class LayerManager {
List<FeatureRow> theFeatures = null; List<FeatureRow> theFeatures = null;
// TODO SWTCH FOR EARCH ITEM TYPE // TODO SWTCH FOR EARCH ITEM TYPE
for (final GeoportalSpatialQueryResult geoNaDataObject : listGeonaDataObjects) { for (final GeoNaSpatialQueryResult geoNaDataObject : listGeonaDataObjects) {
GWT.log("GeoNaDataObject: " + geoNaDataObject); GWT.log("GeoNaDataObject: " + geoNaDataObject);
List<FeatureRow> features = geoNaDataObject.getFeatures(); List<FeatureRow> features = geoNaDataObject.getFeatures();
LayerItem layerItem = geoNaDataObject.getSourceLayerObject().getLayerItem(); LayerItem layerItem = geoNaDataObject.getSourceLayerObject().getLayerItem();
@ -515,7 +515,7 @@ public class LayerManager {
GWT.log("Parsed WMS Request returned: " + geoInfoWMS); GWT.log("Parsed WMS Request returned: " + geoInfoWMS);
LayerItem layerItem = toLayerItem(featureType, layerTitle, geoInfoWMS.getLayerName(), LayerItem layerItem = toLayerItem(featureType, layerTitle, geoInfoWMS.getLayerName(),
geoInfoWMS.getWmsRequest(), geoInfoWMS.getServiceEndPoint(), true, isBase, geoInfoWMS.getWmsRequest(), geoInfoWMS.getBaseWmsServiceHost(), true, isBase,
displayInLayerSwitcher, (ArrayList<String>) geoInfoWMS.getStyles().getGeoStyles(), displayInLayerSwitcher, (ArrayList<String>) geoInfoWMS.getStyles().getGeoStyles(),
geoInfoWMS.getWmsRequest(), false, geoInfoWMS.getMapWMSNoStandard(), geoInfoWMS.getWmsRequest(), false, geoInfoWMS.getMapWMSNoStandard(),
geoInfoWMS.isNcWMS(), UUID, geoInfoWMS.getZAxis(), minResolution, maxResolution); geoInfoWMS.isNcWMS(), UUID, geoInfoWMS.getZAxis(), minResolution, maxResolution);
@ -709,7 +709,7 @@ public class LayerManager {
* @param listGeoNaDataObject the list geo na data object * @param listGeoNaDataObject the list geo na data object
* @param queryClick the query click * @param queryClick the query click
*/ */
public void showPopupInfoForLayer(List<GeoportalSpatialQueryResult> listGeoNaDataObject, ExtentWrapped queryClick) { public void showPopupInfoForLayer(List<GeoNaSpatialQueryResult> listGeoNaDataObject, ExtentWrapped queryClick) {
GWT.log("showPopupInfoForLayer called for " + listGeoNaDataObject); GWT.log("showPopupInfoForLayer called for " + listGeoNaDataObject);
ScrollPanel scrollPanel = new ScrollPanel(); ScrollPanel scrollPanel = new ScrollPanel();
@ -767,7 +767,7 @@ public class LayerManager {
// } // }
String prevProjectId = ""; String prevProjectId = "";
for (GeoportalSpatialQueryResult geoNaSpatialQueryResult : listGeoNaDataObject) { for (GeoNaSpatialQueryResult geoNaSpatialQueryResult : listGeoNaDataObject) {
try { try {
Set<String> indexLayers = mapIndexLayerObjects.keySet(); Set<String> indexLayers = mapIndexLayerObjects.keySet();
@ -1123,7 +1123,7 @@ public class LayerManager {
* @param feature the feature * @param feature the feature
* @param onFailureCenterTo the on failure center to * @param onFailureCenterTo the on failure center to
*/ */
public void showPopupInfoForCentroidLayer(GeoportalSpatialQueryResult geoNaDataObject, FeatureRow feature, public void showPopupInfoForCentroidLayer(GeoNaSpatialQueryResult geoNaDataObject, FeatureRow feature,
Coordinate onFailureCenterTo) { Coordinate onFailureCenterTo) {
GWT.log("showPopupInfoForCentroidLayer showing feature: " + feature); GWT.log("showPopupInfoForCentroidLayer showing feature: " + feature);
GWT.log("showPopupInfoForCentroidLayer showing layerObject: " + geoNaDataObject.getSourceLayerObject()); GWT.log("showPopupInfoForCentroidLayer showing layerObject: " + geoNaDataObject.getSourceLayerObject());
@ -1142,7 +1142,6 @@ public class LayerManager {
FlexTable intFlex = new FlexTable(); FlexTable intFlex = new FlexTable();
intFlex.setCellPadding(1); intFlex.setCellPadding(1);
intFlex.setCellSpacing(1); intFlex.setCellSpacing(1);
intFlex.getElement().addClassName("thePopDataTable");
if (projectDV.getTheDocument() != null) { if (projectDV.getTheDocument() != null) {
LinkedHashMap<String, Object> map = projectDV.getTheDocument().getDocumentAsMap(); LinkedHashMap<String, Object> map = projectDV.getTheDocument().getDocumentAsMap();
// my-html-table // my-html-table

View File

@ -32,15 +32,15 @@ public class ExtentWrapped extends ol.Extent {
super(minX, minY, maxX, maxY); super(minX, minY, maxX, maxY);
} }
// /** /**
// * @param coordinate coordinate to check. * @param coordinate coordinate to check.
// * @return true if the passed coordinate is contained or on the edge of the * @return true if the passed coordinate is contained or on the edge of the
// * extent. * extent.
// */ */
// @JsOverlay @JsOverlay
// public final Coordinate getCenter() { public final Coordinate getCenter() {
// return getCenter((ol.Extent) this); return getCenter((ol.Extent) this);
// } }
@JsMethod(name = "getCenter", namespace = PACKAGE_EXTENT) @JsMethod(name = "getCenter", namespace = PACKAGE_EXTENT)
private static native Coordinate getCenter(Extent extent); private static native Coordinate getCenter(Extent extent);

View File

@ -8,7 +8,7 @@ import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery.TYPE; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery.TYPE;
@ -87,7 +87,7 @@ public class LightOpenLayerMap {
private ol.layer.Vector geometryLayer; private ol.layer.Vector geometryLayer;
private String markerURL = GeoportalImages.ICONS.mapMarkerIcon().getURL(); private String markerURL = GNAImages.ICONS.mapMarkerIcon().getURL();
private LayerOrder layerOrder = new LayerOrder(); private LayerOrder layerOrder = new LayerOrder();

View File

@ -439,7 +439,7 @@ public abstract class OpenLayerMap {
imageWMSParams.setLayers(layerItem.getName()); imageWMSParams.setLayers(layerItem.getName());
ImageWmsOptions imageWMSOptions = OLFactory.createOptions(); ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setUrl(layerItem.getMapServerEndpoint()); imageWMSOptions.setUrl(layerItem.getMapServerHost());
imageWMSOptions.setParams(imageWMSParams); imageWMSOptions.setParams(imageWMSParams);
// imageWMSOptions.setRatio(1.5f); // imageWMSOptions.setRatio(1.5f);
@ -544,7 +544,7 @@ public abstract class OpenLayerMap {
imageWMSParams.setLayers(layerItem.getName()); imageWMSParams.setLayers(layerItem.getName());
ImageWmsOptions imageWMSOptions = OLFactory.createOptions(); ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setUrl(layerItem.getMapServerEndpoint()); imageWMSOptions.setUrl(layerItem.getMapServerHost());
imageWMSOptions.setParams(imageWMSParams); imageWMSOptions.setParams(imageWMSParams);
// imageWMSOptions.setRatio(1.5f); // imageWMSOptions.setRatio(1.5f);
@ -595,7 +595,7 @@ public abstract class OpenLayerMap {
imageWMSParams.setLayers(layerItem.getName()); imageWMSParams.setLayers(layerItem.getName());
ImageWmsOptions imageWMSOptions = OLFactory.createOptions(); ImageWmsOptions imageWMSOptions = OLFactory.createOptions();
imageWMSOptions.setUrl(layerItem.getMapServerEndpoint()); imageWMSOptions.setUrl(layerItem.getMapServerHost());
imageWMSOptions.setParams(imageWMSParams); imageWMSOptions.setParams(imageWMSParams);
// imageWMSOptions.setRatio(1.5f); // imageWMSOptions.setRatio(1.5f);

View File

@ -4,7 +4,7 @@ import com.github.gwtbootstrap.client.ui.constants.BaseIconType;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.ClientBundle;
public interface GeoportalIcons extends ClientBundle { public interface GNAIcons extends ClientBundle {
/** My custom base icon collection */ /** My custom base icon collection */
public enum CustomIconType implements BaseIconType { public enum CustomIconType implements BaseIconType {
@ -15,7 +15,7 @@ public interface GeoportalIcons extends ClientBundle {
/** Inject the icon's css once at first usage */ /** Inject the icon's css once at first usage */
static { static {
GeoportalImages icons = GWT.create(GeoportalImages.class); GNAImages icons = GWT.create(GNAImages.class);
icons.css().ensureInjected(); icons.css().ensureInjected();
} }

View File

@ -5,13 +5,13 @@ import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.CssResource; import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.ImageResource; import com.google.gwt.resources.client.ImageResource;
public interface GeoportalImages extends ClientBundle { public interface GNAImages extends ClientBundle {
/** Get access to the css resource during gwt compilation */ /** Get access to the css resource during gwt compilation */
@Source("baseIcons.css") @Source("baseIcons.css")
CssResource css(); CssResource css();
public static final GeoportalImages ICONS = GWT.create(GeoportalImages.class); public static final GNAImages ICONS = GWT.create(GNAImages.class);
/** /**
* Our sample image icon. Makes the image resource for the gwt-compiler's css * Our sample image icon. Makes the image resource for the gwt-compiler's css

View File

@ -11,20 +11,9 @@
top: 50px; top: 50px;
right: 10px; right: 10px;
} }
.to-align-left {
position: absolute;
top: 5px;
color: white !important;
text-decoration: none !important;
}
.to-align-left :hover {
color: #F5F5F5;
}
</ui:style> </ui:style>
<g:HTMLPanel ui:field="detailsHTMLPanel" visible="false"> <g:HTMLPanel ui:field="detailsHTMLPanel" visible="false">
<b:Button ui:field="closeButton" addStyleNames="{style.to-align-left}"></b:Button> <b:Button ui:field="closeButton" addStyleNames="{style.to-align-right}"></b:Button>
<g:HTMLPanel ui:field="datailsContainerPanel"></g:HTMLPanel> <g:HTMLPanel ui:field="datailsContainerPanel"></g:HTMLPanel>
</g:HTMLPanel> </g:HTMLPanel>
</ui:UiBinder> </ui:UiBinder>

View File

@ -14,16 +14,14 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.layers.Conf
import org.gcube.application.geoportalcommon.shared.geoportal.config.layers.LayerIDV; import org.gcube.application.geoportalcommon.shared.geoportal.config.layers.LayerIDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView; import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.GisToolbarFacilities;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ChangeMapLayerEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.ChangeMapLayerEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.MapExtentToEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.collections.OpenCollectionEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.collections.OpenCollectionEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap; import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerMap;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalIcons; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAIcons;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.search.SearchFacilityUI; import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.search.SearchFacilityUI;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.crossfiltering.CrossFilteringLayerPanel; import org.gcube.portlets.user.geoportaldataviewer.client.ui.crossfiltering.CrossFilteringLayerPanel;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.customoverlays.OverlayCustomLayerPanel; import org.gcube.portlets.user.geoportaldataviewer.client.ui.customoverlays.OverlayCustomLayerPanel;
@ -66,7 +64,6 @@ import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.LayoutPanel; import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.RadioButton; import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
@ -80,8 +77,6 @@ import com.google.gwt.user.client.ui.Widget;
*/ */
public class GeonaDataViewMainPanel extends Composite { public class GeonaDataViewMainPanel extends Composite {
private static final String PLACEHOLDER_SELECT_SEARCH_IN = "Select Collection..."; private static final String PLACEHOLDER_SELECT_SEARCH_IN = "Select Collection...";
private static GeonaDataViewMainPanelUiBinder uiBinder = GWT.create(GeonaDataViewMainPanelUiBinder.class); private static GeonaDataViewMainPanelUiBinder uiBinder = GWT.create(GeonaDataViewMainPanelUiBinder.class);
@ -147,10 +142,8 @@ public class GeonaDataViewMainPanel extends Composite {
@UiField @UiField
ListBox navListSearch; ListBox navListSearch;
//@UiField @UiField
//ScrollPanel overlayLayersPanel; ScrollPanel overlayLayersPanel;
RootPanel overlayLayersPanel = RootPanel.get(GeoportalDataViewer.DIV_LAYER_VIEW);
@UiField @UiField
ScrollPanel searchFacilityPanel; ScrollPanel searchFacilityPanel;
@ -186,26 +179,25 @@ public class GeonaDataViewMainPanel extends Composite {
mapPanel = new MapPanel(mapHeight + "px"); mapPanel = new MapPanel(mapHeight + "px");
detailsPanel.setHeight(mapHeight + "px"); detailsPanel.setHeight(mapHeight + "px");
detailsPanel.setApplicationBus(applicationBus); detailsPanel.setApplicationBus(applicationBus);
overlayLayersPanel.setVisible(false);
mainContainerPanel.add(mapPanel); mainContainerPanel.add(mapPanel);
bindHandlers(); bindHandlers();
dataPointSelection.setIcon(IconType.SCREENSHOT); dataPointSelection.setIcon(IconType.SCREENSHOT);
dataBoxSelection.setIcon(IconType.BOOKMARK); dataBoxSelection.setIcon(IconType.BOOKMARK);
removeQuery.setIcon(IconType.REMOVE); removeQuery.setIcon(IconType.REMOVE);
Image italyImg = new Image(GeoportalImages.ICONS.italyIcon()); Image italyImg = new Image(GNAImages.ICONS.italyIcon());
italyImg.getElement().getStyle().setPaddingLeft(20, Unit.PX); italyImg.getElement().getStyle().setPaddingLeft(20, Unit.PX);
extentToItaly.getElement().appendChild(italyImg.getElement()); extentToItaly.getElement().appendChild(italyImg.getElement());
extentToItaly.setWidth("140px"); extentToItaly.setWidth("140px");
Image worldImg = new Image(GeoportalImages.ICONS.worldIcon()); Image worldImg = new Image(GNAImages.ICONS.worldIcon());
worldImg.getElement().getStyle().setPaddingLeft(20, Unit.PX); worldImg.getElement().getStyle().setPaddingLeft(20, Unit.PX);
extentToEarth.getElement().appendChild(worldImg.getElement()); extentToEarth.getElement().appendChild(worldImg.getElement());
extentToEarth.setWidth("140px"); extentToEarth.setWidth("140px");
// linkMap.setCustomIconStyle(GeoportalIcons.CustomIconType.MAP.get()); // linkMap.setCustomIconStyle(GNAIcons.CustomIconType.MAP.get());
linkPresetLocation.setCustomIconStyle(GeoportalIcons.CustomIconType.PRESET_LOCATION.get()); linkPresetLocation.setCustomIconStyle(GNAIcons.CustomIconType.PRESET_LOCATION.get());
linkLayers.setCustomIconStyle(GeoportalIcons.CustomIconType.LAYERS.get()); linkLayers.setCustomIconStyle(GNAIcons.CustomIconType.LAYERS.get());
openCollectionDropDown.setIcon(IconType.COMPASS); openCollectionDropDown.setIcon(IconType.COMPASS);
@ -290,16 +282,9 @@ public class GeonaDataViewMainPanel extends Composite {
}); });
openCollectionDropDown.setTitle(GisToolbarFacilities.COLLECTION.getTooltip());
linkCustomOverlayLayers.setTitle(GisToolbarFacilities.OVERLAY.getTooltip());
linkCrossFilteringLayers.setTitle(GisToolbarFacilities.FILTER.getTooltip());
searchFacilityButton.setTitle(GisToolbarFacilities.SEARCH.getTooltip());
linkLayers.setTitle(GisToolbarFacilities.LAYERS.getTooltip());
linkMap.setTitle(GisToolbarFacilities.MAP.getTooltip());
linkPresetLocation.setTitle(GisToolbarFacilities.PRESET_LOCATION.getTooltip());
// layersDDB.setToggle(true); // layersDDB.setToggle(true);
bindEvents(); bindEvents();
} }
/** /**
@ -377,27 +362,6 @@ public class GeonaDataViewMainPanel extends Composite {
} }
public void setPanelsWidth(int clientWidth) {
if(clientWidth<GeoportalDataViewerConstants.TABLET_WIDTH) {
openCollectionDropDown.setText("");
linkCustomOverlayLayers.setText("");
linkCrossFilteringLayers.setText("");
searchFacilityButton.setText("");
linkLayers.setText("");
linkPresetLocation.setText("");
linkMap.setText("");
}else {
openCollectionDropDown.setText(GisToolbarFacilities.COLLECTION.getName());
linkCustomOverlayLayers.setText(GisToolbarFacilities.OVERLAY.getName());
linkCrossFilteringLayers.setText(GisToolbarFacilities.FILTER.getName());
searchFacilityButton.setText(GisToolbarFacilities.SEARCH.getName());
linkLayers.setText(GisToolbarFacilities.LAYERS.getName());
linkMap.setText(GisToolbarFacilities.MAP.getName());
linkPresetLocation.setText(GisToolbarFacilities.PRESET_LOCATION.getName());
}
}
/** /**
* Sets the overlay panel max height. * Sets the overlay panel max height.
*/ */
@ -781,6 +745,4 @@ public class GeonaDataViewMainPanel extends Composite {
} }
} }

View File

@ -55,15 +55,18 @@
addStyleNames="open-collection-style"> addStyleNames="open-collection-style">
</g:HTMLPanel> </g:HTMLPanel>
</b:DropdownButton> </b:DropdownButton>
<b:DropdownButton type="LINK" text="Map" ui:field="linkMap" icon="GLOBE"> <b:DropdownButton type="LINK"
title="Select the base Map" text="Map" ui:field="linkMap" icon="GLOBE">
<g:HTMLPanel ui:field="panelBaseLayers"> <g:HTMLPanel ui:field="panelBaseLayers">
</g:HTMLPanel> </g:HTMLPanel>
</b:DropdownButton> </b:DropdownButton>
<b:DropdownButton type="LINK" visible="false" text="Overlay" ui:field="linkCustomOverlayLayers" icon="REORDER"> <b:DropdownButton type="LINK" visible="false"
title="Add overlay layers.." text="Overlay" ui:field="linkCustomOverlayLayers" icon="REORDER">
<g:HTMLPanel ui:field="panelCustomOverlayLayers" addStyleNames="overlay-panel-style"> <g:HTMLPanel ui:field="panelCustomOverlayLayers" addStyleNames="overlay-panel-style">
</g:HTMLPanel> </g:HTMLPanel>
</b:DropdownButton> </b:DropdownButton>
<b:DropdownButton type="LINK" visible="false" text="Filter" ui:field="linkCrossFilteringLayers" icon="FILTER"> <b:DropdownButton type="LINK" visible="false"
title="Apply spatial filtering.." text="Filter" ui:field="linkCrossFilteringLayers" icon="FILTER">
<g:HTMLPanel ui:field="panelCrossFilteringLayers" addStyleNames="filter-panel-style"> <g:HTMLPanel ui:field="panelCrossFilteringLayers" addStyleNames="filter-panel-style">
</g:HTMLPanel> </g:HTMLPanel>
</b:DropdownButton> </b:DropdownButton>
@ -80,7 +83,8 @@
<g:ScrollPanel ui:field="searchFacilityPanel" <g:ScrollPanel ui:field="searchFacilityPanel"
addStyleNames="search-facility"></g:ScrollPanel> addStyleNames="search-facility"></g:ScrollPanel>
</b:DropdownButton> </b:DropdownButton>
<b:DropdownButton type="LINK" text="Preset Location" <b:DropdownButton type="LINK"
title="Center Map to Location" text="Preset Location"
ui:field="linkPresetLocation" addStyleNames="preset-location"> ui:field="linkPresetLocation" addStyleNames="preset-location">
<b:Nav> <b:Nav>
<b:Button type="LINK" ui:field="extentToItaly" <b:Button type="LINK" ui:field="extentToItaly"
@ -105,8 +109,8 @@
text="Remove Query" visible="false"></b:Button> text="Remove Query" visible="false"></b:Button>
<b:Button type="LINK" text="Layers" ui:field="linkLayers"> <b:Button type="LINK" text="Layers" ui:field="linkLayers">
</b:Button> </b:Button>
<!-- <g:ScrollPanel ui:field="overlayLayersPanel" <g:ScrollPanel ui:field="overlayLayersPanel"
addStyleNames="layers-panel" visible="false"></g:ScrollPanel> --> addStyleNames="layers-panel" visible="false"></g:ScrollPanel>
</g:HTMLPanel> </g:HTMLPanel>
</g:HTMLPanel> </g:HTMLPanel>
<c:DetailsPanel ui:field="detailsPanel" <c:DetailsPanel ui:field="detailsPanel"

View File

@ -4,11 +4,9 @@ import java.util.List;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON; import org.gcube.application.geoportalcommon.shared.geoportal.geojson.GeoJSON;
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView; import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.application.geoportalcommon.shared.geoportal.view.SectionView; import org.gcube.application.geoportalcommon.shared.geoportal.view.SectionView;
import org.gcube.portal.clientcontext.client.GCubeClientContext;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.MAP_PROJECTION;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync;
@ -27,7 +25,6 @@ import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.constants.ButtonType; import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.github.gwtbootstrap.client.ui.constants.IconType; import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.FormElement;
import com.google.gwt.dom.client.UListElement; import com.google.gwt.dom.client.UListElement;
import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.ClickHandler;
@ -38,16 +35,8 @@ import com.google.gwt.user.client.Random;
import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent;
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler;
import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
import com.google.gwt.user.client.ui.FormPanel.SubmitHandler;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Hidden;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
import ol.Coordinate; import ol.Coordinate;
@ -94,9 +83,6 @@ public class ProjectViewer extends Composite {
@UiField @UiField
Button expandButton; Button expandButton;
@UiField
Button exportButton;
@UiField @UiField
Button relationshipsButton; Button relationshipsButton;
@ -150,22 +136,6 @@ public class ProjectViewer extends Composite {
this.geoportalItemReferences = geoportalItemRefs; this.geoportalItemReferences = geoportalItemRefs;
this.applicationBus = applicationBus; this.applicationBus = applicationBus;
GeoportalDataViewerServiceAsync.Util.getInstance().checkExportAsPDFConfig(new AsyncCallback<Boolean>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(Boolean result) {
GWT.log("Export as PDF visible: " + result);
exportButton.setVisible(result);
}
});
final String theTitle = projectView.getTheProjectDV().getProfileName() != null final String theTitle = projectView.getTheProjectDV().getProfileName() != null
? projectView.getTheProjectDV().getProfileName() ? projectView.getTheProjectDV().getProfileName()
: "Project ID: " + projectView.getTheProjectDV().getId(); : "Project ID: " + projectView.getTheProjectDV().getId();
@ -213,79 +183,6 @@ public class ProjectViewer extends Composite {
} }
}); });
exportButton.setType(ButtonType.LINK);
exportButton.setIcon(IconType.FILE);
exportButton.setTitle("Export as PDF");
exportButton.setVisible(false);
exportButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
String theProjectName = "";
try {
theProjectName = (String) projectView.getTheProjectDV().getTheDocument().getFirstEntryOfMap()
.getValue();
theProjectName = theProjectName != null ? theProjectName
: "Project ID: " + projectView.getTheProjectDV().getId();
} catch (Exception e) {
// TODO: handle exception
}
// Reading contextId and userId from GCubeClientContext
String currentContextId = GCubeClientContext.getCurrentContextId();
String currentUserId = GCubeClientContext.getCurrentUserId();
ProjectDV thePDV = projectView.getTheProjectDV();
final String targetWindow = "target_window_" + Random.nextInt() + "_" + Random.nextInt();
final FormPanel form = new FormPanel();
final FormElement fe = form.getElement().cast();
//NewBrowserWindow theNewTabWindow = NewBrowserWindow.open("", "", null);
RootPanel.get().add(form);
VerticalPanel panel = new VerticalPanel();
form.setWidget(panel);
form.setAction(GeoportalDataViewerConstants.GEOPORTAL_EXPORT_ACTION_SERVLET);
form.setEncoding(FormPanel.ENCODING_URLENCODED);
form.setMethod(FormPanel.METHOD_POST);
panel.add(new Hidden(GeoportalDataViewerConstants.UCD_ID_PARAMETER, thePDV.getProfileID()));
panel.add(new Hidden(GeoportalDataViewerConstants.PROIECT_ID_PARAMETER, thePDV.getId()));
panel.add(new Hidden(GeoportalDataViewerConstants.CONTEXT_ID_PARAMETER, currentContextId));
panel.add(new Hidden(GeoportalDataViewerConstants.USER_ID_PARAMETER, currentUserId));
if(myLogin!=null) {
panel.add(new Hidden(GeoportalDataViewerConstants.USERNAME_PARAMETER, myLogin));
}
// final Modal contactinServiceModal = new Modal(true, true);
// contactinServiceModal.setCloseVisible(false);
// contactinServiceModal.setTitle("Export");
// FlowPanel panelMsg = new FlowPanel();
// panelMsg.add(new HTML("Contacting the service..."));
// contactinServiceModal.add(panelMsg);
// contactinServiceModal.show();
// Add an event handler to the form.
form.addSubmitHandler(new SubmitHandler() {
public void onSubmit(SubmitEvent event) {
GWT.log("onSubmit done");
fe.setTarget(targetWindow);
}
});
form.addSubmitCompleteHandler(new SubmitCompleteHandler() {
public void onSubmitComplete(SubmitCompleteEvent event) {
GWT.log("onSubmitComplete done");
//contactinServiceModal.hide();
}
});
form.submit();
}
});
relationshipsButton.setType(ButtonType.LINK); relationshipsButton.setType(ButtonType.LINK);
relationshipsButton.setIcon(IconType.LINK); relationshipsButton.setIcon(IconType.LINK);
relationshipsButton.setTitle("Show Relationships of this Project"); relationshipsButton.setTitle("Show Relationships of this Project");
@ -343,6 +240,14 @@ public class ProjectViewer extends Composite {
public void onClick(ClickEvent event) { public void onClick(ClickEvent event) {
boolean visible = toc_list_container.isVisible(); boolean visible = toc_list_container.isVisible();
setTocContentVisible(!visible); setTocContentVisible(!visible);
// if (visible) {
// toc_list_container.setVisible(false);
// reduceToc.setIcon(IconType.PLUS_SIGN_ALT);
// } else {
// toc_list_container.setVisible(true);
// reduceToc.setIcon(IconType.MINUS_SIGN_ALT);
// }
} }
}); });

View File

@ -23,7 +23,6 @@
color: white; color: white;
padding: 10px 10px; padding: 10px 10px;
font-size: 14px; font-size: 14px;
padding-left: 40px;
} }
.width-100 { .width-100 {
@ -44,10 +43,9 @@
<g:HorizontalPanel <g:HorizontalPanel
addStyleNames="functionalities-style"> addStyleNames="functionalities-style">
<b:Button ui:field="shareButton">Share</b:Button> <b:Button ui:field="shareButton">Share</b:Button>
<b:Button ui:field="exportButton">Export</b:Button>
<b:Button ui:field="expandButton">Expand</b:Button> <b:Button ui:field="expandButton">Expand</b:Button>
<b:Button ui:field="relationshipsButton">Relationships</b:Button> <b:Button ui:field="relationshipsButton">Relationships</b:Button>
<b:Button ui:field="addLayersToMap">Add Layers</b:Button> <b:Button ui:field="addLayersToMap">Add Layers to Map</b:Button>
</g:HorizontalPanel> </g:HorizontalPanel>
<g:HTMLPanel ui:field="centroidPanel"></g:HTMLPanel> <g:HTMLPanel ui:field="centroidPanel"></g:HTMLPanel>
<g:HTMLPanel ui:field="tableOfContentPanel" <g:HTMLPanel ui:field="tableOfContentPanel"

View File

@ -7,7 +7,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerServiceAsync;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent.EVENT_SOURCE; import org.gcube.portlets.user.geoportaldataviewer.client.events.ShowDetailsEvent.EVENT_SOURCE;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.ProjectUtil; import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.ProjectUtil;
import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon; import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
@ -45,7 +45,7 @@ public class TimelineRelationPanel extends Composite {
Anchor timelinePopupCloser; Anchor timelinePopupCloser;
private LoaderIcon loaderData = new LoaderIcon("Loading data... please wait", private LoaderIcon loaderData = new LoaderIcon("Loading data... please wait",
new Image(GeoportalImages.ICONS.spinnerClock())); new Image(GNAImages.ICONS.spinnerClock()));
private TimelineRelationPanel instance = this; private TimelineRelationPanel instance = this;

View File

@ -219,7 +219,7 @@ public class OverlayCustomLayerPanel extends Composite {
flow.add(new HTMLPanel("Legend for: " + theLayerName)); flow.add(new HTMLPanel("Legend for: " + theLayerName));
final HorizontalPanel hpLegend = new HorizontalPanel(); final HorizontalPanel hpLegend = new HorizontalPanel();
String url = geoInformation.getServiceEndPoint() + "?service=WMS&" + "version=" String url = geoInformation.getBaseWmsServiceHost() + "?service=WMS&" + "version="
+ URLUtil.getValueOfParameter("version", wmsLink) + "&" + "request=GetLegendGraphic&" + "layer=" + URLUtil.getValueOfParameter("version", wmsLink) + "&" + "request=GetLegendGraphic&" + "layer="
+ theLayerName; + theLayerName;

View File

@ -8,7 +8,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerSer
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent; import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.DO_LAYER_ACTION; import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.DO_LAYER_ACTION;
import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.SwapLayer; import org.gcube.portlets.user.geoportaldataviewer.client.events.DoActionOnDetailLayersEvent.SwapLayer;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.ProjectUtil; import org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.ProjectUtil;
import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon; import org.gcube.portlets.user.geoportaldataviewer.client.util.LoaderIcon;
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil; import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
@ -50,11 +50,11 @@ public class DragDropLayer extends FlowPanel {
private static DragDropLayer draggingTarget = null; private static DragDropLayer draggingTarget = null;
final boolean droppable; final boolean droppable;
private Label labelLayerName; private Label labelLayerName;
private Image imgLayerVisible = new Image(GeoportalImages.ICONS.layerVisible()); private Image imgLayerVisible = new Image(GNAImages.ICONS.layerVisible());
private Image imgLayerInvisible = new Image(GeoportalImages.ICONS.layerInvisible()); private Image imgLayerInvisible = new Image(GNAImages.ICONS.layerInvisible());
private Image imgLocate = new Image(GeoportalImages.ICONS.locate()); private Image imgLocate = new Image(GNAImages.ICONS.locate());
private Image imgLocateNone = new Image(GeoportalImages.ICONS.locateNone()); private Image imgLocateNone = new Image(GNAImages.ICONS.locateNone());
private boolean locateEnabled = false; private boolean locateEnabled = false;
private HTML buttonLocate = new HTML(); private HTML buttonLocate = new HTML();

View File

@ -146,13 +146,13 @@ public class DialogShareableLink extends Composite {
/** /**
* Instantiates a new dialog shareable link. * Instantiates a new dialog shareable link.
* *
* @param itemRef the item ref * @param item the item
* @param version the version * @param version the version
*/ */
public DialogShareableLink(GeoportalItemReferences itemRef, String version) { public DialogShareableLink(GeoportalItemReferences item, String version) {
initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));
this.geonItemRef = itemRef; this.geonItemRef = item;
this.fileVersion = version; this.fileVersion = version;
this.actionAlert.setAnimation(true); this.actionAlert.setAnimation(true);
@ -186,7 +186,7 @@ public class DialogShareableLink extends Composite {
showLoadingIcon(true); showLoadingIcon(true);
// alertFilePublicLink.setVisible(true); // alertFilePublicLink.setVisible(true);
loadAndShowPublicLinksForItem(itemRef); loadAndShowPublicLinksForItem(item);
// getElement().setClassName("gwt-DialogBoxNew"); // getElement().setClassName("gwt-DialogBoxNew");
modalBox.setTitle("Share Link..."); modalBox.setTitle("Share Link...");
ModalFooter modalFooter = new ModalFooter(); ModalFooter modalFooter = new ModalFooter();

View File

@ -67,9 +67,6 @@ public class LayerCollectionPanel extends Composite {
@UiField @UiField
HTMLPanel styleListPanel; HTMLPanel styleListPanel;
@UiField
HTMLPanel statisticPanel;
@UiField @UiField
Button buttonLegend; Button buttonLegend;
@ -112,7 +109,6 @@ public class LayerCollectionPanel extends Composite {
buttonLegend.setType(ButtonType.LINK); buttonLegend.setType(ButtonType.LINK);
legendPanel.setVisible(false); legendPanel.setVisible(false);
statisticPanel.setVisible(false);
GWT.log("Found available collection " + coll); GWT.log("Found available collection " + coll);
String label = coll.getUcd().getName(); String label = coll.getUcd().getName();
@ -144,31 +140,6 @@ public class LayerCollectionPanel extends Composite {
basePanel.add(checkbox); basePanel.add(checkbox);
GeoportalDataViewerServiceAsync.Util.getInstance().getCountFor(collectionID, "Published", "OK", new AsyncCallback<Integer>() {
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(Integer result) {
if(result!=null) {
String resultLabel = result+" project";
if(result>1) {
resultLabel+="s";
}
resultLabel+= " published";
statisticPanel.setVisible(true);
statisticPanel.add(new HTML(resultLabel));
}
}
});
ViewerConfiguration theConfig = GeoportalDataViewer.getStatus().getViewerConfig(); ViewerConfiguration theConfig = GeoportalDataViewer.getStatus().getViewerConfig();
final GCubeCollection toOpen = theConfig.getAvailableCollections().get(collectionID); final GCubeCollection toOpen = theConfig.getAvailableCollections().get(collectionID);
@ -300,7 +271,7 @@ public class LayerCollectionPanel extends Composite {
flow.add(new HTMLPanel("Legend for: " + theLayerName)); flow.add(new HTMLPanel("Legend for: " + theLayerName));
final HorizontalPanel hpLegend = new HorizontalPanel(); final HorizontalPanel hpLegend = new HorizontalPanel();
String url = geoInformation.getServiceEndPoint() + "?service=WMS&" + "version=" String url = geoInformation.getBaseWmsServiceHost() + "?service=WMS&" + "version="
+ URLUtil.getValueOfParameter("version", wmsLink) + "&" + "request=GetLegendGraphic&" + "layer=" + URLUtil.getValueOfParameter("version", wmsLink) + "&" + "request=GetLegendGraphic&" + "layer="
+ theLayerName; + theLayerName;

View File

@ -10,8 +10,6 @@
<g:HTMLPanel> <g:HTMLPanel>
<g:HTMLPanel ui:field="basePanel"> <g:HTMLPanel ui:field="basePanel">
</g:HTMLPanel> </g:HTMLPanel>
<g:HTMLPanel ui:field="statisticPanel" addStyleNames="statistic-style-panel">
</g:HTMLPanel>
<g:HTMLPanel ui:field="stylePanel" visible="false" addStyleNames="layer-style-panel"> <g:HTMLPanel ui:field="stylePanel" visible="false" addStyleNames="layer-style-panel">
Layer Style Layer Style
<g:HorizontalPanel> <g:HorizontalPanel>

View File

@ -9,7 +9,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerCon
import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped; import org.gcube.portlets.user.geoportaldataviewer.client.gis.ExtentWrapped;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.LightOpenLayerMap; import org.gcube.portlets.user.geoportaldataviewer.client.gis.LightOpenLayerMap;
import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils; import org.gcube.portlets.user.geoportaldataviewer.client.gis.MapUtils;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalIcons; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAIcons;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location; import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.Location;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.PLACE; import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil.PLACE;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
@ -86,7 +86,7 @@ public class MapView extends Composite {
theMapPanel.setWidth(internalMapWidth); theMapPanel.setWidth(internalMapWidth);
theMapPanel.setHeight(internalMapHeight); theMapPanel.setHeight(internalMapHeight);
linkMap.setCustomIconStyle(GeoportalIcons.CustomIconType.MAP.get()); linkMap.setCustomIconStyle(GNAIcons.CustomIconType.MAP.get());
Scheduler.get().scheduleDeferred(new ScheduledCommand() { Scheduler.get().scheduleDeferred(new ScheduledCommand() {

View File

@ -3,7 +3,7 @@
*/ */
package org.gcube.portlets.user.geoportaldataviewer.client.util; package org.gcube.portlets.user.geoportaldataviewer.client.util;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages; import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
@ -18,7 +18,7 @@ import com.google.gwt.user.client.ui.Image;
public class LoaderIcon extends HorizontalPanel{ public class LoaderIcon extends HorizontalPanel{
private Image imgLoading = new Image(GeoportalImages.ICONS.loading()); private Image imgLoading = new Image(GNAImages.ICONS.loading());
private HTML txtLoading = new HTML(""); private HTML txtLoading = new HTML("");
/** /**

View File

@ -65,11 +65,9 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclara
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView; import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap; import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.application.geoportalcommon.util.StringUtil;
import org.gcube.application.geoportalcommon.util.URLParserUtil; import org.gcube.application.geoportalcommon.util.URLParserUtil;
import org.gcube.application.geoportaldatamapper.GcubeProfilesPerUCDIdCache; import org.gcube.application.geoportaldatamapper.GcubeProfilesPerUCDIdCache;
import org.gcube.application.geoportaldatamapper.Geoportal_JSON_Mapper; import org.gcube.application.geoportaldatamapper.Geoportal_JSON_Mapper;
import org.gcube.application.geoportaldatamapper.exporter.Geoportal_PDF_Exporter;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerService; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerService;
import org.gcube.portlets.user.geoportaldataviewer.server.gis.FeatureParser; import org.gcube.portlets.user.geoportaldataviewer.server.gis.FeatureParser;
@ -81,7 +79,7 @@ import org.gcube.portlets.user.geoportaldataviewer.server.util.HTTPRequestUtil;
import org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil; import org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil;
import org.gcube.portlets.user.geoportaldataviewer.server.util.TemporalComparatorUtil; import org.gcube.portlets.user.geoportaldataviewer.server.util.TemporalComparatorUtil;
import org.gcube.portlets.user.geoportaldataviewer.shared.GCubeCollection; import org.gcube.portlets.user.geoportaldataviewer.shared.GCubeCollection;
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoportalSpatialQueryResult; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult;
import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse; import org.gcube.portlets.user.geoportaldataviewer.shared.ItemFieldsResponse;
import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs; import org.gcube.portlets.user.geoportaldataviewer.shared.ResultSetPaginatedDataIDs;
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration; import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
@ -264,7 +262,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
public GeoInformationForWMSRequest loadGeoInfoForWmsRequest(String wmsLink, String layerName) throws Exception { public GeoInformationForWMSRequest loadGeoInfoForWmsRequest(String wmsLink, String layerName) throws Exception {
try { try {
WMSUrlValidator validator = new WMSUrlValidator(wmsLink, layerName); WMSUrlValidator validator = new WMSUrlValidator(wmsLink, layerName);
String wmsServiceServiceEndpoint = validator.getWmsServiceEndPoint(); String wmsServiceHost = validator.getWmsServiceHost();
String validWMSRequest = validator.parseWMSRequest(true, true); String validWMSRequest = validator.parseWMSRequest(true, true);
layerName = validator.getLayerName(); layerName = validator.getLayerName();
String versionWms = validator.getValueOfParsedWMSParameter(WmsParameters.VERSION); String versionWms = validator.getValueOfParsedWMSParameter(WmsParameters.VERSION);
@ -291,8 +289,8 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
? new ZAxis(layerZAxis.getUnits(), layerZAxis.isPositive(), layerZAxis.getValues()) ? new ZAxis(layerZAxis.getUnits(), layerZAxis.isPositive(), layerZAxis.getValues())
: null; : null;
return new GeoInformationForWMSRequest(wmsServiceServiceEndpoint, validWMSRequest, layerName, versionWms, return new GeoInformationForWMSRequest(wmsServiceHost, validWMSRequest, layerName, versionWms, crs,
crs, mapWmsNotStandard, styles, styles.isNcWms(), zAxis); mapWmsNotStandard, styles, styles.isNcWms(), zAxis);
} catch (Exception e) { } catch (Exception e) {
String msg = "An error occurred during wms request validation for layer: " + layerName; String msg = "An error occurred during wms request validation for layer: " + layerName;
LOG.error(msg, e); LOG.error(msg, e);
@ -414,14 +412,14 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
* @return the WFS features * @return the WFS features
*/ */
@Override @Override
public List<GeoportalSpatialQueryResult> getWFSFeatures(List<LayerObject> layerObjects, String mapSrsName, public List<GeoNaSpatialQueryResult> getWFSFeatures(List<LayerObject> layerObjects, String mapSrsName,
BoundsMap selectBBOX, int maxWFSFeature, double zoomLevel) { BoundsMap selectBBOX, int maxWFSFeature, double zoomLevel) {
LOG.info("getWFSFeatures called"); LOG.info("getWFSFeatures called");
List<GeoportalSpatialQueryResult> listDAO = new ArrayList<GeoportalSpatialQueryResult>(layerObjects.size()); List<GeoNaSpatialQueryResult> listDAO = new ArrayList<GeoNaSpatialQueryResult>(layerObjects.size());
for (LayerObject layerObject : layerObjects) { for (LayerObject layerObject : layerObjects) {
GeoportalSpatialQueryResult geoDAO = new GeoportalSpatialQueryResult(); GeoNaSpatialQueryResult geoDAO = new GeoNaSpatialQueryResult();
List<FeatureRow> features = FeatureParser.getWFSFeatures(layerObject.getLayerItem(), mapSrsName, selectBBOX, List<FeatureRow> features = FeatureParser.getWFSFeatures(layerObject.getLayerItem(), mapSrsName, selectBBOX,
maxWFSFeature); maxWFSFeature);
LOG.debug("For layer name: " + layerObject.getLayerItem().getName() + " got features: " + features); LOG.debug("For layer name: " + layerObject.getLayerItem().getName() + " got features: " + features);
@ -618,6 +616,56 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
} }
// public Map<String, List<GroupedLayersDV>> getAvaiableCrossFilteringLayers() {
//
// Map<String, List<GroupedLayersDV>> mapProfileIDOvelayLayers = new LinkedHashMap<>();
//
// // Reading UCDs Collections from the session
// Map<String, UseCaseDescriptor> ucdCollections = SessionUtil.getAvailableCollections(getThreadLocalRequest());
//
// for (String profileId : ucdCollections.keySet()) {
//
// UseCaseDescriptor u = ucdCollections.get(profileId);
//
// // Loading geoportal_grouped_overlay_layers if exists
// GEOPORTAL_DATA_HANDLER theHandler = GEOPORTAL_DATA_HANDLER.geoportal_grouped_cross_filtering;
// List<HandlerDeclaration> handlers = u.getHandlersByType(theHandler.getType());
//
// if (handlers != null && handlers.size() > 0) {
// // Loading Handler gcube_profiles
// HandlerDeclaration handler = handlers.get(0);
// List<GroupedLayersDV> listGroupedCustomLayers = null;
// try {
//
// HandlerDeclarationDV handlerDV = ConvertToDataValueObjectModel.toHandlerDeclarationDV(handler, u,
// GEOPORTAL_CONFIGURATION_TYPE.grouped_overlay_layers);
//
// if (handler != null) {
// ConfigurationDV<?> config = handlerDV.getConfiguration();
// switch (config.getConfigurationType()) {
// case grouped_overlay_layers:
// listGroupedCustomLayers = (List<GroupedLayersDV>) config.getConfiguration();
// break;
// default:
// break;
// }
// }
// } catch (Exception e) {
// LOG.error("Error on loading {} config for ucd Id {}. Returning null",
// GEOPORTAL_CONFIGURATION_TYPE.grouped_overlay_layers, u.getId());
// }
//
// mapProfileIDOvelayLayers.put(profileId, listGroupedCustomLayers);
// } else {
// LOG.warn("No handler " + theHandler + "found into UCD " + u.getId() + ", continue...");
// mapProfileIDOvelayLayers.put(profileId, null);
// }
// }
//
// return mapProfileIDOvelayLayers;
//
// }
/** /**
* Gets the layer index. * Gets the layer index.
* *
@ -657,7 +705,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
GCubeSDILayer indexLayer = index.getLayer(); GCubeSDILayer indexLayer = index.getLayer();
HashMap<String, String> ogcLinks = indexLayer.getOgcLinks(); HashMap<String, String> ogcLinks = indexLayer.getOgcLinks();
String wmsLink = ogcLinks.get("wms"); String wmsLink = ogcLinks.get("wms");
LOG.info("wms link is {}", StringUtil.ellipsize(wmsLink, 150)); LOG.info("wms link is {}", wmsLink);
int lastCharOfthePath = wmsLink.indexOf("?"); int lastCharOfthePath = wmsLink.indexOf("?");
String wmsPath = wmsLink.substring(0, lastCharOfthePath); String wmsPath = wmsLink.substring(0, lastCharOfthePath);
for (GeoServerPlatformInfoDV geoserver : indexLayer.getPlatformInfos()) { for (GeoServerPlatformInfoDV geoserver : indexLayer.getPlatformInfos()) {
@ -667,7 +715,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
LOG.debug("purged wmsPath from the 'workspace' is {}", wmsPath); LOG.debug("purged wmsPath from the 'workspace' is {}", wmsPath);
wmsLink = wmsPath + wmsLink.substring(lastCharOfthePath, wmsLink.length()); wmsLink = wmsPath + wmsLink.substring(lastCharOfthePath, wmsLink.length());
ogcLinks.put("wms", wmsLink); ogcLinks.put("wms", wmsLink);
LOG.info("wms link without {} is {}", geoserver.getWorkspace(), StringUtil.ellipsize(wmsLink, 150)); LOG.info("wms link without {} is {}", geoserver.getWorkspace(), wmsLink);
} }
} }
return index; return index;
@ -815,7 +863,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
*/ */
@Override @Override
protected void onBeforeRequestDeserialized(String serializedRequest) { protected void onBeforeRequestDeserialized(String serializedRequest) {
LOG.debug("onBeforeRequestDeserialized called"); LOG.info("onBeforeRequestDeserialized called");
String scope = ""; String scope = "";
try { try {
@ -1199,7 +1247,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
* @throws Exception the exception * @throws Exception the exception
*/ */
@Override @Override
public List<GeoportalSpatialQueryResult> getDataResult(List<LayerObject> layerObjects, String mapSrsName, public List<GeoNaSpatialQueryResult> getDataResult(List<LayerObject> layerObjects, String mapSrsName,
BoundsMap selectBBOX, int maxWFSFeature, double zoomLevel) throws Exception { BoundsMap selectBBOX, int maxWFSFeature, double zoomLevel) throws Exception {
LOG.info("getDataResult called"); LOG.info("getDataResult called");
@ -1214,13 +1262,13 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
+ ", zoomLevel: " + zoomLevel); + ", zoomLevel: " + zoomLevel);
} }
List<GeoportalSpatialQueryResult> listDAO = new ArrayList<GeoportalSpatialQueryResult>(layerObjects.size()); List<GeoNaSpatialQueryResult> listDAO = new ArrayList<GeoNaSpatialQueryResult>(layerObjects.size());
try { try {
new GeoportalServiceIdentityProxy(this.getThreadLocalRequest()); new GeoportalServiceIdentityProxy(this.getThreadLocalRequest());
for (LayerObject layerObject : layerObjects) { for (LayerObject layerObject : layerObjects) {
GeoportalSpatialQueryResult geoDAO = new GeoportalSpatialQueryResult(); GeoNaSpatialQueryResult geoDAO = new GeoNaSpatialQueryResult();
List<FeatureRow> features = FeatureParser.getWFSFeatures(layerObject.getLayerItem(), mapSrsName, List<FeatureRow> features = FeatureParser.getWFSFeatures(layerObject.getLayerItem(), mapSrsName,
selectBBOX, maxWFSFeature); selectBBOX, maxWFSFeature);
LOG.debug("For layer name: " + layerObject.getLayerItem().getName() + " got features: " + features); LOG.debug("For layer name: " + layerObject.getLayerItem().getName() + " got features: " + features);
@ -1814,39 +1862,4 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
return HTTPRequestUtil.getResponse(url); return HTTPRequestUtil.getResponse(url);
} }
@Override
public Integer getCountFor(String profileID, String phase, String status) {
LOG.debug("getCountFor profileID: " + profileID + ", phase: " + phase + ", status: " + status + "called");
Integer integer = null;
try {
new GeoportalServiceIdentityProxy(this.getThreadLocalRequest());
integer = GeoportalClientCaller.projects().getCountByPhaseFor(profileID, phase, status);
LOG.info("getCountFor profileID: " + profileID + ", phase: " + phase + ", status: " + status
+ " returning: " + integer);
} catch (Exception e) {
LOG.error("Error occurred in getCountFor for profileID: " + profileID, e);
}
return integer;
}
@Override
public Boolean checkExportAsPDFConfig() {
LOG.debug("checkExportAsPDFConfig called");
Boolean configChecked = null;
try {
new GeoportalServiceIdentityProxy(this.getThreadLocalRequest());
configChecked = SessionUtil.getCheckConfigForPFDExporter(this.getThreadLocalRequest());
if(configChecked==null) {
Geoportal_PDF_Exporter gpdfe = new Geoportal_PDF_Exporter();
configChecked = gpdfe.checkConfig();
SessionUtil.setCheckConfigForPFDExporter(this.getThreadLocalRequest(), configChecked);
}
LOG.info("Does the 'Export As PDF' config exists? " + configChecked);
} catch (Exception e) {
LOG.error("Error occurred in checkExportAsPDFConfig", e);
}
return configChecked;
}
} }

View File

@ -1,257 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.geoportaldataviewer.server;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.apache.http.client.methods.HttpGet;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.GeoportalServiceIdentityProxy;
import org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil;
import org.gcube.portlets.user.uriresolvermanager.geoportal.GeoportalExporterAPI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The Class GeoportalExporterActionServlet.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Apr 23, 2024
*/
public class GeoportalExporterActionServlet extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = 6037090280489238565L;
protected static Logger logger = LoggerFactory.getLogger(GeoportalExporterActionServlet.class);
/**
* {@inheritDoc}
*/
@Override
public void init() throws ServletException {
super.init();
logger.trace(GeoportalExporterActionServlet.class.getSimpleName() + " ready.");
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
logger.info("doPost Called");
serveRequest(req, resp);
}
/**
* Do get.
*
* @param req the req
* @param resp the resp
* @throws IOException Signals that an I/O exception has occurred.
* @throws ServletException the servlet exception
*/
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
logger.info("doGet Called");
sendError(resp,
"The request cannot be served (via http GET). Please retry by using the Export facility provided by Data-Viewer UI");
}
/**
* Serve request.
*
* @param req the req
* @param resp the resp
* @throws IOException Signals that an I/O exception has occurred.
*/
public void serveRequest(HttpServletRequest req, HttpServletResponse resp) throws IOException {
// setSecretManager();
String projectID = req.getParameter(GeoportalDataViewerConstants.PROIECT_ID_PARAMETER);
String ucdID = req.getParameter(GeoportalDataViewerConstants.UCD_ID_PARAMETER);
String contextID = req.getParameter(GeoportalDataViewerConstants.CONTEXT_ID_PARAMETER);
String userID = req.getParameter(GeoportalDataViewerConstants.USER_ID_PARAMETER);
String username = req.getParameter(GeoportalDataViewerConstants.USERNAME_PARAMETER);
// logger.info("serveRequest called with [projectID: " + projectID + ", ucdID: " + ucdID + ", contextID: " + contextID+"]");
logger.info("serveRequest called with [projectID: " + projectID + ", ucdID: " + ucdID + ", contextID: "
+ contextID + ", userID: " + userID + ", username: " + username + "]");
if (contextID == null || contextID.isEmpty())
sendError(resp, "Bad Request. No context found!");
PortalContext pContext = PortalContext.getConfiguration();
String scope = pContext.getCurrentScope(contextID);
logger.info("The scope is {}", scope);
try {
// Setting header required to {@PortalContext}
MutableHttpServletRequest mutableRequest = new MutableHttpServletRequest(req);
mutableRequest.putHeader(PortalContext.VRE_ID_ATTR_NAME, contextID);
// DEV MODE
if (!SessionUtil.isIntoPortal()) {
logger.info("DEBUG MODE, putting header " + PortalContext.USER_ID_ATTR_NAME);
mutableRequest.putHeader(PortalContext.USER_ID_ATTR_NAME, userID);
}
// IF USERNAME exists, add the userID to request. So performing the request to
// exporter service on behalf of the user.
if (username != null) {
logger.info("Username found, putting header " + PortalContext.USER_ID_ATTR_NAME);
mutableRequest.putHeader(PortalContext.USER_ID_ATTR_NAME, userID);
}
ScopeProvider.instance.set(scope);
GeoportalServiceIdentityProxy identity = new GeoportalServiceIdentityProxy(mutableRequest);
String theToken = identity.getToken();
String theIdentity = identity.getIdentity();
logger.info("The identity is {}", theIdentity);
GeoportalExporterAPI geoportalExporterAPI = new GeoportalExporterAPI();
URL urlRequest = geoportalExporterAPI.exportProject("pdf", ucdID, projectID, false);
String urlToRedirect = urlRequest.toString();
logger.info("Performing request to {} with identity description {}", urlToRedirect,
identity.getDescription());
logger.info("Token is {}", theToken.substring(0, 20) + "_MASKED_TOKEN");
InputStream is = performHttpRequestToSGService(urlToRedirect, theIdentity, theToken);
resp.setContentType("text/html; charset=utf-8");
IOUtils.copy(is, resp.getOutputStream());
resp.flushBuffer();
} catch (Exception e) {
logger.error("Error occurred when exporting the Project with id: " + projectID, e);
sendError(resp, "Error occurred when exporting the Project. Error is: " + e.getMessage());
return;
}
}
/**
* Perform http request to SG service.
*
* @param urlToService the url to service
* @param identity the identity
* @param token the token
* @return the input stream
* @throws IOException Signals that an I/O exception has occurred.
*/
public static InputStream performHttpRequestToSGService(String urlToService, String identity, String token)
throws IOException {
logger.debug("performHttpRequestToSGService called");
try {
URL url = new URL(urlToService);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// timeout at 60sec
conn.setConnectTimeout(6000);
conn.setDoOutput(true);
if (token.length() > 50) {
// is JWT TOKEN
conn.setRequestProperty("Authorization", "Bearer " + token);
} else {
// is legacy Token
conn.setRequestProperty("gcube-token", token);
}
conn.setRequestProperty("Content-Type", "text/html");
conn.setRequestMethod("GET");
logger.debug("performHttpRequestToSGService done, returning");
return conn.getInputStream();
} catch (IOException e) {
logger.error("Error on performing request to url " + urlToService, e);
throw e;
}
}
/**
* Sets the headers to target.
*
* @param httpSource the http source
* @param response the response
* @return the http servlet response
*/
public static HttpServletResponse setHeadersToTarget(HttpServletRequest httpSource, HttpServletResponse response) {
Enumeration<String> headersNames = httpSource.getHeaderNames();
while (headersNames.hasMoreElements()) {
String headerName = (String) headersNames.nextElement();
Enumeration<String> values = httpSource.getHeaders(headerName);
while (values.hasMoreElements()) {
String value = values.nextElement();
logger.info("Copying header {} with value {}", headerName, value);
response.addHeader(headerName, value);
}
}
return response;
}
/**
* Sets the headers to target.
*
* @param httpSource the http source
* @param httpTarget the http target
* @return the http get
*/
public static HttpGet setHeadersToTarget(HttpServletRequest httpSource, HttpGet httpTarget) {
Enumeration<String> headersNames = httpSource.getHeaderNames();
while (headersNames.hasMoreElements()) {
String headerName = (String) headersNames.nextElement();
Enumeration<String> values = httpSource.getHeaders(headerName);
while (values.hasMoreElements()) {
String value = values.nextElement();
logger.info("Copying header {} with value {}", headerName, value);
httpTarget.addHeader(headerName, value);
}
}
return httpTarget;
}
/**
* Sets the headers to response.
*
* @param httpSource the http source
* @param httpTarget the http target
* @return the http get
*/
public static HttpGet setHeadersToResponse(HttpServletRequest httpSource, HttpGet httpTarget) {
Enumeration<String> headersNames = httpSource.getHeaderNames();
while (headersNames.hasMoreElements()) {
String headerName = (String) headersNames.nextElement();
Enumeration<String> values = httpSource.getHeaders(headerName);
while (values.hasMoreElements()) {
String value = values.nextElement();
logger.info("Copying header {} with value {}", headerName, value);
httpTarget.addHeader(headerName, value);
}
}
return httpTarget;
}
/**
* Send response.
*
* @param response the response
* @param message the message
* @throws IOException Signals that an I/O exception has occurred.
*/
protected void sendError(HttpServletResponse response, String message) throws IOException {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
response.setContentType("text/html");
response.getWriter().write("<html><head><title>Error</title></head><body>" + message + "</body></html>");
response.flushBuffer();
}
}

View File

@ -1,53 +0,0 @@
package org.gcube.portlets.user.geoportaldataviewer.server;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
final class MutableHttpServletRequest extends HttpServletRequestWrapper {
// holds custom header and value mapping
private final Map<String, String> customHeaders;
public MutableHttpServletRequest(HttpServletRequest request){
super(request);
this.customHeaders = new HashMap<String, String>();
}
public void putHeader(String name, String value){
this.customHeaders.put(name, value);
}
public String getHeader(String name) {
// check the custom headers first
String headerValue = customHeaders.get(name);
if (headerValue != null){
return headerValue;
}
// else return from into the original wrapped object
return ((HttpServletRequest) getRequest()).getHeader(name);
}
public Enumeration<String> getHeaderNames() {
// create a set of the custom header names
Set<String> set = new HashSet<String>(customHeaders.keySet());
// now add the headers from the wrapped request object
@SuppressWarnings("unchecked")
Enumeration<String> e = ((HttpServletRequest) getRequest()).getHeaderNames();
while (e.hasMoreElements()) {
// add the names of the request headers into the list
String n = e.nextElement();
set.add(n);
}
// create an enumeration from the set and return
return Collections.enumeration(set);
}
}

View File

@ -61,8 +61,8 @@ public class GisMakers {
public static String buildWFSFeatureQuery(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX, public static String buildWFSFeatureQuery(LayerItem layerItem, String mapSrsName, BoundsMap mapBBOX,
int maxFeatures, String outputFormat) { int maxFeatures, String outputFormat) {
String link = layerItem.getMapServerEndpoint(); String link = layerItem.getMapServerHost();
LOG.debug("Map server endpoint: " + link); LOG.debug("Map server host URL: " + link);
LOG.debug("CQL filter is: " + layerItem.getCqlFilter()); LOG.debug("CQL filter is: " + layerItem.getCqlFilter());
LOG.debug("MAX FEATURES: " + maxFeatures); LOG.debug("MAX FEATURES: " + maxFeatures);
LOG.debug("BBOX: " + mapBBOX); LOG.debug("BBOX: " + mapBBOX);

View File

@ -24,7 +24,7 @@ public class WMSUrlValidator {
private static final String OWS = "ows"; private static final String OWS = "ows";
private HashMap<String, String> parametersValue = new HashMap<String, String>(); private HashMap<String, String> parametersValue = new HashMap<String, String>();
private String wmsRequestURI; private String wmsRequestURI;
private String wmsServiceEndPoint; private String wmsServiceHost;
private String layerName; private String layerName;
private String wmsNoStandardParameters = ""; private String wmsNoStandardParameters = "";
@ -48,29 +48,34 @@ public class WMSUrlValidator {
throw new Exception("WMS request is null or empty"); throw new Exception("WMS request is null or empty");
this.wmsRequestURI = wmsRequest.trim(); this.wmsRequestURI = wmsRequest.trim();
boolean isOwsService = GeoWmsServiceUtility.isOWSSerice(this.wmsRequestURI);
WebMapServerHost webMapServerHost;
// IS WMS?
if (GeoWmsServiceUtility.isWMSService(wmsRequestURI)) {
LOG.trace("found " + GeoWmsServiceUtility.SERVICE_WMS + " in wms request: " + wmsRequestURI);
webMapServerHost = getWebMapServerHost(wmsRequestURI);
} else
throw new Exception("WMS service not found for layer: " + inputLayerName);
// VALIDATION WMS // VALIDATION WMS
int endpointLastCharIndex = wmsRequest.lastIndexOf("?"); String baseWmsService = webMapServerHost.getHost();
// No '?' char found // IS OWS OR WMS?
if (endpointLastCharIndex == -1) { this.wmsServiceHost = appendWmsServiceToBaseUrl(wmsRequest.substring(0, wmsRequest.indexOf("?")), isOwsService);
LOG.info("Char '?' not found, setting last index the end of the URI"); this.layerName = inputLayerName;
endpointLastCharIndex = wmsRequest.length();
}
String readWMSServiceEndpoint = wmsRequest.substring(0, endpointLastCharIndex);
this.wmsServiceEndPoint = readWMSServiceEndpoint;
try { try {
// VALIDATE WMS SERVICE FOR WEB MAP SERVER // VALIDATE WMS SERVICE FOR WEB MAP SERVER
if (!HttpRequestUtil.urlExists(this.wmsServiceEndPoint, true)) { if (!HttpRequestUtil.urlExists(this.wmsServiceHost, true)) {
LOG.warn("baseWmsServiceUrl: " + wmsServiceEndPoint + " is not valid URL!!"); LOG.info("baseWmsServiceUrl: " + wmsServiceHost
this.wmsServiceEndPoint = readWMSServiceEndpoint; + " is not a geoserver, setting as input base wms server: " + baseWmsService);
this.wmsServiceHost = baseWmsService;
} }
} catch (Exception e) { } catch (Exception e) {
LOG.error("Error on validating the endpoint: " + this.wmsServiceEndPoint, e); LOG.error("error on validating geoserver wms service: " + e);
boolean isOwsService = GeoWmsServiceUtility.isOWSSerice(this.wmsRequestURI); LOG.info("setting baseWmsService as input base wms server: " + baseWmsService);
LOG.info("Retrying by appending suffix WMS or WFS..."); this.wmsServiceHost = baseWmsService;
this.wmsServiceEndPoint = appendWmsServiceToBaseUrl(readWMSServiceEndpoint, isOwsService);
} }
// VALIDATION FOR THREDDS - FIND LAYER NAME INTO WMS PATH // VALIDATION FOR THREDDS - FIND LAYER NAME INTO WMS PATH
@ -82,7 +87,6 @@ public class WMSUrlValidator {
} }
LOG.info("WMSURLValidator found endpoint: " + wmsServiceEndPoint);
parametersValue.put(WmsParameters.LAYERS.getParameter(), this.layerName); parametersValue.put(WmsParameters.LAYERS.getParameter(), this.layerName);
} }
@ -226,13 +230,13 @@ public class WMSUrlValidator {
} }
/** /**
* Gets the wms service end point. * Gets the wms service host.
* *
* @return the wms service end point * @return the wms service host
*/ */
public String getWmsServiceEndPoint() { public String getWmsServiceHost() {
return wmsServiceEndPoint; return wmsServiceHost;
} }
/** /**

View File

@ -65,16 +65,4 @@ public class GeoportalServiceIdentityProxy {
public boolean isIAMClient() { public boolean isIAMClient() {
return isIAMClient; return isIAMClient;
} }
public String getDescription() {
return gCubeIdentity.getIdentityDescription();
}
public String getToken() {
return gCubeIdentity.getToken();
}
public String getIdentity() {
return gCubeIdentity.getIdentity();
}
} }

View File

@ -2,12 +2,13 @@ package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessid
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/** /**
* The Interface GcubeIdentity. * The Interface GcubeIdentity.
* *
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
* *
* Sep 23, 2021 * Sep 23, 2021
*/ */
public interface GcubeIdentity { public interface GcubeIdentity {
@ -24,26 +25,4 @@ public interface GcubeIdentity {
*/ */
public void resetIdentity(); public void resetIdentity();
/**
* Gets the identity description.
*
* @return the identity description
*/
public String getIdentityDescription();
/**
* Gets the identity.
*
* @return the identity
*/
public String getIdentity();
/**
* Gets the token.
*
* @return the token
*/
public String getToken();
} }

View File

@ -17,22 +17,17 @@ public class IAMClientIdentity implements GcubeIdentity {
private String previousUMAToken = null; private String previousUMAToken = null;
private String currentUMAToken = null;
private String clientId = null;
private static final String IAM_CLIENT_CREDENTIALS = "IAM_CLIENT_CREDENTIALS"; private static final String IAM_CLIENT_CREDENTIALS = "IAM_CLIENT_CREDENTIALS";
@Override @Override
public void setIdentity(HttpServletRequest httpRequest) throws Exception { public void setIdentity(HttpServletRequest httpRequest) throws Exception {
LOG.info("setIdentity called"); LOG.info("setIdentity called");
String currentScope = SessionUtil.getCurrentContext(httpRequest, true); String currentScope = SessionUtil.getCurrentContext(httpRequest, true);
LOG.info("the scope is {}", currentScope); IAMClientCredentials credentials = sessionGetIAMClientCredentials(httpRequest);
IAMClientCredentials credentials = sessionGetIAMClientCredentials(httpRequest);
try { try {
if (credentials == null) { if(credentials==null) {
credentials = IAMClientCredentialsReader.getCredentials(); credentials = IAMClientCredentialsReader.getCredentials();
sessionSetIAMClientCredentials(httpRequest, credentials); sessionSetIAMClientCredentials(httpRequest,credentials);
} }
} catch (Exception e) { } catch (Exception e) {
LOG.error("Error on discovering IAM Client credentials", e); LOG.error("Error on discovering IAM Client credentials", e);
@ -40,16 +35,16 @@ public class IAMClientIdentity implements GcubeIdentity {
} }
LOG.trace("Read credentials: " + credentials); LOG.trace("Read credentials: " + credentials);
clientId = credentials.getClientId(); String umaAcessToken = null;
String clientId = credentials.getClientId();
String clientSecret = credentials.getClientSecret(); String clientSecret = credentials.getClientSecret();
try { try {
LOG.info("Querying KeycloakClientFactory to get UMA token.."); LOG.info("Querying KeycloakClientFactory to get UMA token..");
TokenResponse tr = KeycloakClientFactory.newInstance().queryUMAToken(currentScope, clientId, clientSecret, currentScope, TokenResponse tr = KeycloakClientFactory.newInstance().queryUMAToken(clientId, clientSecret, currentScope,
null); null);
umaAcessToken = tr.getAccessToken();
currentUMAToken = tr.getAccessToken(); if (umaAcessToken != null && !umaAcessToken.isEmpty()) {
if (currentUMAToken != null && !currentUMAToken.isEmpty()) {
LOG.info("UMA Access Token read correctly"); LOG.info("UMA Access Token read correctly");
} else { } else {
LOG.error("UMA Access Token NOT RETRIEVED!!!"); LOG.error("UMA Access Token NOT RETRIEVED!!!");
@ -61,8 +56,6 @@ public class IAMClientIdentity implements GcubeIdentity {
try { try {
LOG.debug("JWT token: " + currentUMAToken.substring(0, 20) + "_MASKED_TOKEN_");
try { try {
// Here the previousUMAToken should be null // Here the previousUMAToken should be null
previousUMAToken = AccessTokenProvider.instance.get(); previousUMAToken = AccessTokenProvider.instance.get();
@ -71,9 +64,10 @@ public class IAMClientIdentity implements GcubeIdentity {
// silent // silent
} }
LOG.debug("JWT token: " + umaAcessToken.substring(0, 20) + "_MASKED_TOKEN_");
LOG.info("Setting clientId '" + clientId + "' identity by JWT token in the " LOG.info("Setting clientId '" + clientId + "' identity by JWT token in the "
+ AccessTokenProvider.class.getSimpleName()); + AccessTokenProvider.class.getSimpleName());
AccessTokenProvider.instance.set(currentUMAToken); AccessTokenProvider.instance.set(umaAcessToken);
} catch (Exception e) { } catch (Exception e) {
LOG.error(e.getMessage(), e); LOG.error(e.getMessage(), e);
throw new Exception(e.getMessage()); throw new Exception(e.getMessage());
@ -81,11 +75,6 @@ public class IAMClientIdentity implements GcubeIdentity {
} }
@Override
public String getToken() {
return currentUMAToken;
}
@Override @Override
public void resetIdentity() { public void resetIdentity() {
LOG.info("resetIdentity called"); LOG.info("resetIdentity called");
@ -114,7 +103,7 @@ public class IAMClientIdentity implements GcubeIdentity {
* Sets the IAM client credentials. * Sets the IAM client credentials.
* *
* @param httpRequest the http request * @param httpRequest the http request
* @param iamCC the iam CC * @param iamCC the iam CC
*/ */
public static void sessionSetIAMClientCredentials(HttpServletRequest httpRequest, IAMClientCredentials iamCC) { public static void sessionSetIAMClientCredentials(HttpServletRequest httpRequest, IAMClientCredentials iamCC) {
HttpSession session = httpRequest.getSession(); HttpSession session = httpRequest.getSession();
@ -125,15 +114,4 @@ public class IAMClientIdentity implements GcubeIdentity {
} }
} }
@Override
public String getIdentityDescription() {
return "ClientId: " + clientId;
}
@Override
public String getIdentity() {
return clientId;
}
} }

View File

@ -3,7 +3,6 @@ package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessid
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil; import org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil;
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -11,19 +10,13 @@ public class UserIdentity implements GcubeIdentity {
private static final Logger LOG = LoggerFactory.getLogger(UserIdentity.class); private static final Logger LOG = LoggerFactory.getLogger(UserIdentity.class);
private HttpServletRequest httpRequest;
private GCubeUser user;
public UserIdentity() { public UserIdentity() {
} }
@Override @Override
public void setIdentity(HttpServletRequest httpRequest) throws Exception { public void setIdentity(HttpServletRequest httpRequest) throws Exception {
LOG.info("setIdentity called"); LOG.info("setIdentity called");
this.httpRequest = httpRequest; SessionUtil.getCurrentToken(httpRequest, true);
SessionUtil.getCurrentToken(this.httpRequest, true);
user = SessionUtil.getCurrentUser(this.httpRequest);
} }
@ -32,20 +25,4 @@ public class UserIdentity implements GcubeIdentity {
LOG.info("resetIdentity called, doing nothing"); LOG.info("resetIdentity called, doing nothing");
// doing nothing // doing nothing
} }
@Override
public String getToken() {
return SessionUtil.getCurrentToken(this.httpRequest, true);
}
@Override
public String getIdentityDescription() {
return user != null ? "user: " + user.getUsername() : "null";
}
@Override
public String getIdentity() {
return user.getUsername();
}
} }

View File

@ -55,8 +55,6 @@ public class SessionUtil {
private static final String UCD_COLLECTIONS_SESSION = "THE_UCD_COLLECTIONS"; private static final String UCD_COLLECTIONS_SESSION = "THE_UCD_COLLECTIONS";
private static final String CHECKED_CONFIG_FOR_PDF_EXPORTER = "CHECKED_CONFIG_FOR_PDF_EXPORTER";
/** /**
* Checks if is into portal. * Checks if is into portal.
* *
@ -347,14 +345,4 @@ public class SessionUtil {
return (Map<String, UseCaseDescriptor>) session.getAttribute(UCD_COLLECTIONS_SESSION); return (Map<String, UseCaseDescriptor>) session.getAttribute(UCD_COLLECTIONS_SESSION);
} }
public static Boolean getCheckConfigForPFDExporter(HttpServletRequest httpServletRequest) {
HttpSession session = httpServletRequest.getSession();
return (Boolean) session.getAttribute(CHECKED_CONFIG_FOR_PDF_EXPORTER);
}
public static void setCheckConfigForPFDExporter(HttpServletRequest httpServletRequest, Boolean configChecked) {
HttpSession session = httpServletRequest.getSession();
session.setAttribute(CHECKED_CONFIG_FOR_PDF_EXPORTER, configChecked);
}
} }

View File

@ -3,7 +3,7 @@ package org.gcube.portlets.user.geoportaldataviewer.server.util;
import java.util.Comparator; import java.util.Comparator;
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
import org.gcube.portlets.user.geoportaldataviewer.shared.GeoportalSpatialQueryResult; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult;
/** /**
* The Class TemporalComparatorUtil. * The Class TemporalComparatorUtil.
@ -12,7 +12,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.GeoportalSpatialQueryR
* *
* Nov 18, 2022 * Nov 18, 2022
*/ */
public class TemporalComparatorUtil implements Comparator<GeoportalSpatialQueryResult> { public class TemporalComparatorUtil implements Comparator<GeoNaSpatialQueryResult> {
/** /**
* Compare. * Compare.
@ -22,7 +22,7 @@ public class TemporalComparatorUtil implements Comparator<GeoportalSpatialQueryR
* @return the int * @return the int
*/ */
@Override @Override
public int compare(GeoportalSpatialQueryResult a, GeoportalSpatialQueryResult b) { public int compare(GeoNaSpatialQueryResult a, GeoNaSpatialQueryResult b) {
if (a == null || a.getSourceLayerObject() == null || a.getSourceLayerObject().getProjectDV() == null) { if (a == null || a.getSourceLayerObject() == null || a.getSourceLayerObject().getProjectDV() == null) {
return -1; return -1;
} }

View File

@ -9,13 +9,13 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow;
/** /**
* The Class GeoportalSpatialQueryResult. * The Class GeoNaSpatialQueryResult.
* *
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
* *
* Jul 30, 2021 * Jul 30, 2021
*/ */
public class GeoportalSpatialQueryResult implements Serializable { public class GeoNaSpatialQueryResult implements Serializable {
/** /**
* *
@ -23,14 +23,14 @@ public class GeoportalSpatialQueryResult implements Serializable {
private static final long serialVersionUID = 3513120677727206958L; private static final long serialVersionUID = 3513120677727206958L;
private List<FeatureRow> features; private List<FeatureRow> features;
private LayerObject sourceLayerObject; private LayerObject sourceLayerObject;
// Map with couple (mongoId project, list of uploaded GeoportalImages for the // Map with couple (mongoId concessione, list of uploaded GNAImages for the
// project) // concessione)
private Map<String, List<PayloadDV>> mapImages = null; private Map<String, List<PayloadDV>> mapImages = null;
/** /**
* Instantiates a new geo na data object. * Instantiates a new geo na data object.
*/ */
public GeoportalSpatialQueryResult() { public GeoNaSpatialQueryResult() {
} }
@ -91,7 +91,7 @@ public class GeoportalSpatialQueryResult implements Serializable {
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("GeoportalSpatialQueryResult [features="); builder.append("GeoNaSpatialQueryResult [features=");
builder.append(features); builder.append(features);
builder.append(", sourceLayerObject="); builder.append(", sourceLayerObject=");
builder.append(sourceLayerObject); builder.append(sourceLayerObject);

View File

@ -0,0 +1,16 @@
package org.gcube.portlets.user.geoportaldataviewer.shared.gis;
import java.io.Serializable;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Data
public class DisplayCategory implements Serializable {
String title;
String description;
}

View File

@ -2,13 +2,18 @@ package org.gcube.portlets.user.geoportaldataviewer.shared.gis;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.gcube.application.geoportalcommon.shared.gis.BoundsMap; import org.gcube.application.geoportalcommon.shared.gis.BoundsMap;
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants.LayerType;
import org.gcube.portlets.user.geoportaldataviewer.client.util.URLUtil;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.Property; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.Property;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.ZAxis; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.ZAxis;
import com.google.gwt.core.client.GWT;
/** /**
* The Class LayerItem. * The Class LayerItem.
* *
@ -31,7 +36,7 @@ public class LayerItem implements Serializable, Cloneable {
private String url; private String url;
/** The base map server URL. */ /** The base map server URL. */
private String mapServerEndpoint; private String mapServerHost;
/** The style. */ /** The style. */
private String style; private String style;
@ -769,21 +774,21 @@ public class LayerItem implements Serializable, Cloneable {
} }
/** /**
* Gets the map server endpoint. * Gets the map server host.
* *
* @return the map server endpoint * @return the map server host
*/ */
public String getMapServerEndpoint() { public String getMapServerHost() {
return mapServerEndpoint; return mapServerHost;
} }
/** /**
* Sets the map server host. * Sets the map server host.
* *
* @param mapServerEndpoint the new map server host * @param mapServerHost the new map server host
*/ */
public void setMapServerHost(String mapServerEndpoint) { public void setMapServerHost(String mapServerHost) {
this.mapServerEndpoint = mapServerEndpoint; this.mapServerHost = mapServerHost;
} }
/** /**
@ -876,11 +881,6 @@ public class LayerItem implements Serializable, Cloneable {
return maxResolution; return maxResolution;
} }
/**
* To string.
*
* @return the string
*/
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
@ -890,8 +890,8 @@ public class LayerItem implements Serializable, Cloneable {
builder.append(title); builder.append(title);
builder.append(", url="); builder.append(", url=");
builder.append(url); builder.append(url);
builder.append(", mapServerEndpoint="); builder.append(", mapServerHost=");
builder.append(mapServerEndpoint); builder.append(mapServerHost);
builder.append(", style="); builder.append(", style=");
builder.append(style); builder.append(style);
builder.append(", isTrasparent="); builder.append(", isTrasparent=");
@ -948,4 +948,90 @@ public class LayerItem implements Serializable, Cloneable {
return builder.toString(); return builder.toString();
} }
/**
* To layer item.
*
* @param layerType the layer type
* @param layerTitle the layer title
* @param layerName the layer name
* @param layerURL the layer URL
* @param mapServerHost the map server host
* @param isExternal the is external
* @param isBase the is base
* @param displayInLayerSwitcher the display in layer switcher
* @param styles the styles
* @param wmsLink the wms link
* @param onTop the on top
* @param wmsNotStandardParams the wms not standard params
* @param isNcWms the is nc wms
* @param UUID the uuid
* @param zAxis the z axis
* @param minResolution the min resolution
* @param maxResolution the max resolution
* @return the layer item
*/
// TODO Constructor from IndexLayerDV, GCUBESDILAeryDV or direct info
private LayerItem toLayerItem(LayerType layerType, String layerTitle, String layerName, String layerURL,
String mapServerHost, boolean isExternal, boolean isBase, boolean displayInLayerSwitcher,
ArrayList<String> styles, String wmsLink, boolean onTop, HashMap<String, String> wmsNotStandardParams,
boolean isNcWms, String UUID, ZAxis zAxis, Double minResolution, Double maxResolution) {
// GWT.log("Add addLayerByWms 1");
LayerItem layerItem = new LayerItem();
layerItem.setBaseLayer(isBase);
layerItem.setTitle(layerTitle);
layerItem.setName(layerName);
layerItem.setUrl(layerURL);
layerItem.setMapServerHost(mapServerHost);
// l.setExternal(isExternal);
layerItem.setOpacity(1d);
layerItem.setBuffer(2);
layerItem.setWmsLink(wmsLink);
layerItem.setWmsNotStandardParams(wmsNotStandardParams);
layerItem.setNcWms(isNcWms);
layerItem.setUUID(UUID);
layerItem.setZAxis(zAxis);
layerItem.setMinResolution(minResolution);
layerItem.setMaxResolution(maxResolution);
switch (layerType) {
// TODO IMPLEMENT THIS CASE
case RASTER_BASELAYER:
// l.setHasLegend(false);
layerItem.setBaseLayer(true);
layerItem.setTrasparent(false);
layerItem.setClickData(false);
break;
case FEATURE_TYPE:
// CASE FEATURE TYPE
layerItem.setBaseLayer(false);
layerItem.setClickData(true);
layerItem.setTrasparent(true);
break;
}
GWT.log("styles " + styles);
if (styles != null && styles.size() > 0) {
layerItem.setHasLegend(true);
layerItem.setDefaultStyle(styles.get(0));
layerItem.setStyle(styles.get(0));
layerItem.setStyles(styles);
} else {
String style = URLUtil.getValueOfParameter("styles", wmsLink);
if (style != null) { // CASE OF STYLE ="";
// TENTATIVE TO GET LEGEND
layerItem.setHasLegend(true);
}
}
GWT.log("Built layer: " + layerItem);
return layerItem;
}
} }

View File

@ -0,0 +1,13 @@
package org.gcube.portlets.user.geoportaldataviewer.shared.gis;
import java.util.Map;
public class OverlayWMSLayer {
private String title;
private String name;
private String wmsServiceBaseURL;
private boolean display;
private Map<String, String> mapProperties;
}

View File

@ -8,14 +8,15 @@ import java.util.HashMap;
* *
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
* *
* Oct 27, 2020 * Oct 27, 2020
*/ */
public class GeoInformationForWMSRequest implements Serializable { public class GeoInformationForWMSRequest implements Serializable {
/** The Constant serialVersionUID. */ /** The Constant serialVersionUID. */
private static final long serialVersionUID = -6846636281073641003L; private static final long serialVersionUID = -6846636281073641003L;
private String serviceEndPoint; /** The base wms service host. */
private String baseWmsServiceHost;
/** The wms request. */ /** The wms request. */
private String wmsRequest; private String wmsRequest;
@ -52,19 +53,20 @@ public class GeoInformationForWMSRequest implements Serializable {
/** /**
* Instantiates a new geo information for wms request. * Instantiates a new geo information for wms request.
* *
* @param serviceEndPoint the base wms service host * @param baseWmsServiceHost the base wms service host
* @param wmsRequest the wms request * @param wmsRequest the wms request
* @param layerName the layer name * @param layerName the layer name
* @param versionWms the version wms * @param versionWms the version wms
* @param crs the crs * @param crs the crs
* @param mapWmsNoStandard the map wms not standard * @param mapWmsNoStandard the map wms not standard
* @param styles the layer styles * @param styles the layer styles
* @param isNcWMS the is nc WMS * @param isNcWMS the is nc WMS
* @param zAxis the z axis * @param zAxis the z axis
*/ */
public GeoInformationForWMSRequest(String serviceEndPoint, String wmsRequest, String layerName, String versionWms, public GeoInformationForWMSRequest(String baseWmsServiceHost, String wmsRequest, String layerName,
String crs, HashMap<String, String> mapWmsNoStandard, Styles styles, boolean isNcWMS, ZAxis zAxis) { String versionWms, String crs, HashMap<String, String> mapWmsNoStandard, Styles styles, boolean isNcWMS,
this.serviceEndPoint = serviceEndPoint; ZAxis zAxis) {
this.baseWmsServiceHost = baseWmsServiceHost;
this.wmsRequest = wmsRequest; this.wmsRequest = wmsRequest;
this.layerName = layerName; this.layerName = layerName;
this.versionWMS = versionWms; this.versionWMS = versionWms;
@ -96,21 +98,13 @@ public class GeoInformationForWMSRequest implements Serializable {
} }
/** /**
* Gets the service end point. * Gets the base wms service host.
* *
* @return the service end point * @return the baseWmsServiceHost
*/ */
public String getServiceEndPoint() { public String getBaseWmsServiceHost() {
return serviceEndPoint;
}
/** return baseWmsServiceHost;
* Sets the service end point.
*
* @param serviceEndPoint the new service end point
*/
public void setServiceEndPoint(String serviceEndPoint) {
this.serviceEndPoint = serviceEndPoint;
} }
/** /**
@ -186,11 +180,11 @@ public class GeoInformationForWMSRequest implements Serializable {
/** /**
* Sets the base wms service host. * Sets the base wms service host.
* *
* @param baseWmsServiceHost the new base wms service host * @param baseWmsServiceHost the baseWmsServiceHost to set
*/ */
public void setBaseWmsServiceHost(String baseWmsServiceHost) { public void setBaseWmsServiceHost(String baseWmsServiceHost) {
this.serviceEndPoint = baseWmsServiceHost; this.baseWmsServiceHost = baseWmsServiceHost;
} }
/** /**
@ -277,8 +271,8 @@ public class GeoInformationForWMSRequest implements Serializable {
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("GeoInformationForWMSRequest [serviceEndPoint="); builder.append("GeoInformationForWMSRequest [baseWmsServiceHost=");
builder.append(serviceEndPoint); builder.append(baseWmsServiceHost);
builder.append(", wmsRequest="); builder.append(", wmsRequest=");
builder.append(wmsRequest); builder.append(wmsRequest);
builder.append(", layerName="); builder.append(", layerName=");

View File

@ -17,17 +17,11 @@
<inherits name="com.google.gwt.json.JSON" /> <inherits name="com.google.gwt.json.JSON" />
<inherits
name='org.gcube.portal.clientcontext.GCubeClientContext' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> --> <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> --> <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits --> <!-- Other module inherits -->
<servlet path="/geoportalexporterservice"
class="org.gcube.portlets.user.geoportaldataviewer.server.GeoportalExporterActionServlet" />
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<entry-point <entry-point
class='org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer' /> class='org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer' />

View File

@ -200,7 +200,7 @@ body {
/*margin-top: 30px;*/ /*margin-top: 30px;*/
overflow-y: auto; overflow-y: auto;
transition: width 0.5s; transition: width 0.5s;
z-index: 950; z-index: 999;
} }
.overlay { .overlay {
@ -363,16 +363,12 @@ body {
border-radius: 20px; border-radius: 20px;
} }
.layer-panel { .layers-panel {
margin-top: 43px; margin-top: 10px;
background-color: white; background-color: white;
opacity: 90%; opacity: 90%;
padding: 10px; padding: 10px;
max-width: 430px; width: 410px;
z-index: 500;
overflow-y: auto;
position: absolute;
left: 52px;
} }
.dand-layer { .dand-layer {
@ -756,6 +752,62 @@ Table Of Contents (TOC)
padding: 20px; padding: 20px;
} }
/******************************
RESPONSIVE
*******************************/
@media all and (max-width: 2350px) {
#timeline-data {
width: 700px;
left: 550px;
}
}
@media all and (max-width: 2048px) {
#timeline-data {
width: 600px;
left: 310px;
bottom: 50px
}
.details-panel {
width: 600px;
}
}
@media all and (max-width: 1024px) {
#timeline-data {
width: 260px;
left: 140px;
bottom: 50px
}
.details-panel {
width: 400px;
}
.search-facility {
width: 250px;
max-width: 300px;
}
.inner-toolbar {
width: 100px;
}
}
@media all and (max-height: 900px) {
.ol-popup{
min-width: 150px;
max-width: 150px;
max-height: 150px;
overflow-y: scroll;
}
.ol-popup img {
width: 100%;
max-width: 150px;
}
}
/* OPEN COLLECTION UI */ /* OPEN COLLECTION UI */
.open-collection-style { .open-collection-style {
padding-left: 10px; padding-left: 10px;
@ -776,14 +828,6 @@ Table Of Contents (TOC)
color: gray; color: gray;
} }
.statistic-style-panel {
margin-left: 25px;
font-size: 13px;
color: gray;
font-weight: bold;
margin-top: -3px;
}
.layer-style-panel-table-legend table td { .layer-style-panel-table-legend table td {
padding-left: 5px; padding-left: 5px;
} }
@ -853,89 +897,3 @@ Table Of Contents (TOC)
.opacity-09 { .opacity-09 {
opacity: 0.9; opacity: 0.9;
} }
/******************************
RESPONSIVE
*******************************/
@media all and (max-width: 2350px) {
#timeline-data {
width: 700px;
left: 550px;
}
}
@media all and (max-width: 2048px) {
#timeline-data {
width: 600px;
left: 310px;
bottom: 50px
}
.details-panel {
width: 530px;
}
}
@media all and (max-width: 1601px) {
.layers-panel {
width: 350px;
}
.dand-layer {
width: 336px;
}
.thePopDataTable {
}
.search-facility {
max-width: 680px;
}
.search-field {
width: 97%;
}
.ol-popup {
min-width: 220px;
width: 220px;
}
.thePopDataTable tr:last-of-type {
display: none;
}
.layer-panel {
width: 355px;
}
}
@media all and (max-width: 1024px) {
#timeline-data {
width: 260px;
left: 140px;
bottom: 50px
}
.details-panel {
width: 400px;
}
.search-facility {
/*width: 250px;
max-width: 300px;*/
}
.inner-toolbar {
/*width: 100px;*/
}
}
@media all and (max-height: 900px) {
.ol-popup{
min-width: 150px;
max-width: 150px;
max-height: 150px;
overflow-y: scroll;
}
.ol-popup img {
width: 100%;
max-width: 150px;
}
}
/******************************
END RESPONSIVE
*******************************/

View File

@ -10,10 +10,10 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link <link
href="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v6.6.1/css/ol.css" href="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v6.4.3/css/ol.css"
rel="stylesheet" type="text/css"> rel="stylesheet" type="text/css">
<script <script
src="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v6.6.1/build/ol.js" src="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v6.4.3/build/ol.js"
type="text/javascript"></script> type="text/javascript"></script>
<link <link
@ -138,7 +138,6 @@
application to display correctly.</div> application to display correctly.</div>
</noscript> </noscript>
<div id="app-notifier" class="app-notifier"></div> <div id="app-notifier" class="app-notifier"></div>
<div id="layer-viewer" class="layer-panel"></div>
<div id="geoportal-data-viewer"></div> <div id="geoportal-data-viewer"></div>
<div class="timeline-container"> <div class="timeline-container">
<div id="timeline-data"></div> <div id="timeline-data"></div>

View File

@ -15,11 +15,11 @@
src='<%=request.getContextPath()%>/GeoportalDataViewer/js/bootstrap.min.js'></script> src='<%=request.getContextPath()%>/GeoportalDataViewer/js/bootstrap.min.js'></script>
<link <link
href="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v6.6.1/css/ol.css" href="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v6.4.3/css/ol.css"
rel="stylesheet" type="text/css"> rel="stylesheet" type="text/css">
<script <script
src="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v6.6.1/build/ol.js" src="//cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v6.4.3/build/ol.js"
type="text/javascript"></script> type="text/javascript"></script>
<link <link
@ -111,7 +111,6 @@
</script> </script>
<div id="app-notifier" class="app-notifier"></div> <div id="app-notifier" class="app-notifier"></div>
<div id="layer-viewer" class="layer-panel"></div>
<div id="geoportal-data-viewer"></div> <div id="geoportal-data-viewer"></div>
<div class="timeline-container"> <div class="timeline-container">
<div id="timeline-data"></div> <div id="timeline-data"></div>

View File

@ -16,16 +16,6 @@
<servlet-class>org.gcube.portlets.user.geoportaldataviewer.server.GeoportalDataViewerServiceImpl</servlet-class> <servlet-class>org.gcube.portlets.user.geoportaldataviewer.server.GeoportalDataViewerServiceImpl</servlet-class>
</servlet> </servlet>
<!-- <servlet> -->
<!-- <servlet-name>geoportalWaitingServerActionServlet</servlet-name> -->
<!-- <servlet-class>org.gcube.portlets.user.geoportaldataviewer.server.WatingServerActionServlet</servlet-class> -->
<!-- </servlet> -->
<servlet>
<servlet-name>geoportalExporterServerActionServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.geoportaldataviewer.server.GeoportalExporterActionServlet</servlet-class>
</servlet>
<servlet> <servlet>
<servlet-name>mpformbuilderServlet</servlet-name> <servlet-name>mpformbuilderServlet</servlet-name>
<servlet-class>org.gcube.portlets.widgets.mpformbuilder.server.MetadataProfileFormBuilderServiceImpl</servlet-class> <servlet-class>org.gcube.portlets.widgets.mpformbuilder.server.MetadataProfileFormBuilderServiceImpl</servlet-class>
@ -42,14 +32,4 @@
<url-pattern>/GeoportalDataViewer/geoportaldataviewerservice</url-pattern> <url-pattern>/GeoportalDataViewer/geoportaldataviewerservice</url-pattern>
</servlet-mapping> </servlet-mapping>
<!-- <servlet-mapping> -->
<!-- <servlet-name>geoportalWaitingServerActionServlet</servlet-name> -->
<!-- <url-pattern>/GeoportalDataViewer/geoportaldataviewerwaitingservice</url-pattern> -->
<!-- </servlet-mapping> -->
<servlet-mapping>
<servlet-name>geoportalExporterServerActionServlet</servlet-name>
<url-pattern>/GeoportalDataViewer/geoportalexporterservice</url-pattern>
</servlet-mapping>
</web-app> </web-app>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,42 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.geoportaldataviewer;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import org.gcube.portlets.user.geoportaldataviewer.server.GeoportalExporterActionServlet;
/**
* The Class GeoportalExporterActionServletTest.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Apr 24, 2024
*/
public class GeoportalExporterActionServletTest {
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
String url = "https://data.dev.d4science.org/geoportal/export/pdf/profiledConcessioni/661d2c6f8804530afb90b132";
String identity = "francesco.mangiacrapa";
String token = "";
System.out.println("Start");
InputStream response;
try {
response = GeoportalExporterActionServlet.performHttpRequestToSGService(url, identity, token);
System.out.println(IOUtils.toString(response));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("End");
}
}