Compare commits

..

No commits in common. "master" and "feature_25598" have entirely different histories.

41 changed files with 299 additions and 1252 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.6.0/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -30,10 +30,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/geoportal-data-viewer-app-3.7.0/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.7.0/WEB-INF/classes"/>
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.6.0/WEB-INF/classes"/>
</classpath>

View File

@ -1,4 +1,4 @@
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.6.0
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -96,108 +96,8 @@
<wb-module deploy-name="geoportal-data-viewer-app-3.7.0">
<wb-module deploy-name="geoportal-data-viewer-app-3.6.0">
@ -295,57 +195,7 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -443,57 +293,7 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -591,57 +391,7 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
@ -739,97 +489,10 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<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.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type>
</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>
@ -927,57 +590,7 @@
<property name="java-output-path" value="/geoportal-data-viewer-app/target/geoportal-data-viewer-app-0.0.1-SNAPSHOT/WEB-INF/classes"/>
@ -1075,57 +688,7 @@
<property name="context-root" value="geoportal-data-viewer-app"/>
@ -1223,57 +786,7 @@
</wb-module>

View File

@ -4,13 +4,7 @@
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).
## [v3.7.0]
- Provided the "Export as PDF" facility [#26026]
- Integrated the GeoportalExporter as service [#27321]
- Passed to the new KC-client [#27398]
## [v3.6.0]
## [v3.6.0-SNAPSHOT]
- GUI optimization [#25461]
- Using the latest libraries version: gwt-ol.v8.4.1 (with openlayers.v6.6.1) and gwt.v2.10

View File

@ -9,9 +9,9 @@ The "Geoportal data-viewer" technology allows users to access and search for spa
**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-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)
* 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
@ -54,7 +54,7 @@ See the [Releases](https://code-repo.d4science.org/gCubeSystem/geoportal-data-vi
## 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

43
pom.xml
View File

@ -14,7 +14,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>geoportal-data-viewer-app</artifactId>
<packaging>war</packaging>
<version>3.7.0</version>
<version>3.6.0-SNAPSHOT</version>
<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>
@ -23,7 +23,7 @@
<gwt.version>2.10.0</gwt.version>
<gwt.compiler.style>PRETTY</gwt.compiler.style>
<gson.version>2.6.2</gson.version>
<gwt.ol.version>8.5.0</gwt.ol.version>
<gwt.ol.version>8.4.1</gwt.ol.version>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<!-- GWT 2.9 support 8, 9 and 11 -->
<maven.compiler.source>1.8</maven.compiler.source>
@ -56,40 +56,13 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>${gcube-portal-bom-version}</version>
<version>3.7.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</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>
<dependency>
@ -174,13 +147,13 @@
<dependency>
<groupId>org.gcube.application</groupId>
<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>
</dependency>
<dependency>
<groupId>org.gcube.application</groupId>
<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>
</dependency>
<dependency>
@ -202,26 +175,30 @@
<dependency>
<groupId>org.gcube.common</groupId>
<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>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<!-- <version>6.2.5</version> -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<!-- <version>2.0</version> -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<!-- <version>1.6.4</version> -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<!-- <version>1.6.4</version> -->
<scope>provided</scope>
</dependency>

View File

@ -17,17 +17,11 @@
<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.dark.Dark'/> -->
<!-- Other module inherits -->
<servlet path="/geoportalexporterservice"
class="org.gcube.portlets.user.geoportaldataviewer.server.GeoportalExporterActionServlet" />
<!-- Specify the app entry point class. -->
<entry-point
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.OpenLayerMap;
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.cms.project.relation.TimelineManagerStatus;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.OLGeoJSONUtil;
@ -150,7 +150,7 @@ public class GeoportalDataViewer implements EntryPoint {
int attempt = 0;
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();
@ -543,7 +543,7 @@ public class GeoportalDataViewer implements EntryPoint {
Modal errorModal = new Modal(true, true);
errorModal.setCloseVisible(true);
errorModal.setTitle("Oops...");
Image geoportalError = new Image(GeoportalImages.ICONS.warningError());
Image geoportalError = new Image(GNAImages.ICONS.warningError());
FlowPanel errorPanelMsg = new FlowPanel();
errorPanelMsg.getElement().addClassName("general_warning");
errorPanelMsg.add(geoportalError);
@ -1072,7 +1072,7 @@ public class GeoportalDataViewer implements EntryPoint {
* @return the general error panel
*/
private FlowPanel getGeneralErrorPanel() {
Image geoportalError = new Image(GeoportalImages.ICONS.geoportaServiceError());
Image geoportalError = new Image(GNAImages.ICONS.geoportaServiceError());
FlowPanel errorPanelMsg = new FlowPanel();
errorPanelMsg.getElement().addClassName("general_error");
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.portlets.user.geoportaldataviewer.client.gis.OpenLayersMapParameters;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.i18n.client.DateTimeFormat;
@ -15,16 +14,7 @@ import com.google.gwt.i18n.client.DateTimeFormat;
* Nov 24, 2020
*/
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";
@ -50,9 +40,12 @@ public class GeoportalDataViewerConstants {
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"),
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;

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.view.ProjectView;
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.ResultSetPaginatedDataIDs;
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
@ -57,8 +57,8 @@ public interface GeoportalDataViewerService extends RemoteService {
* @return the data result
* @throws Exception the exception
*/
List<GeoportalSpatialQueryResult> getDataResult(List<LayerObject> layerObjects, String mapSrsName,
BoundsMap mapBBOX, int maxWFSFeature, double zoomLevel) throws Exception;
List<GeoNaSpatialQueryResult> getDataResult(List<LayerObject> layerObjects, String mapSrsName, BoundsMap mapBBOX,
int maxWFSFeature, double zoomLevel) throws Exception;
/**
* Gets the my login.
@ -104,7 +104,7 @@ public interface GeoportalDataViewerService extends RemoteService {
* @param zoomLevel the zoom level
* @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);
/**
@ -229,6 +229,4 @@ public interface GeoportalDataViewerService extends RemoteService {
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.view.ProjectView;
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.ResultSetPaginatedDataIDs;
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 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);
@ -60,7 +60,7 @@ public interface GeoportalDataViewerServiceAsync {
AsyncCallback<List<GCubeSDIViewerLayerDV>> asyncCallback);
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);
@ -93,6 +93,4 @@ public interface GeoportalDataViewerServiceAsync {
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.util.StringUtil;
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.LayerItem;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject;
@ -190,7 +190,7 @@ public class LayerManager {
GeoportalDataViewerServiceAsync.Util.getInstance().getDataResult(listLO, olMap.getProjectionCode(),
mapBBOX, GeoportalDataViewerConstants.MAX_WFS_FEATURES, olMap.getCurrentZoomLevel(),
new AsyncCallback<List<GeoportalSpatialQueryResult>>() {
new AsyncCallback<List<GeoNaSpatialQueryResult>>() {
@Override
public void onFailure(Throwable caught) {
@ -199,7 +199,7 @@ public class LayerManager {
}
@Override
public void onSuccess(List<GeoportalSpatialQueryResult> listGeonaDataObjects) {
public void onSuccess(List<GeoNaSpatialQueryResult> listGeonaDataObjects) {
if (listGeonaDataObjects == null)
return;
@ -221,7 +221,7 @@ public class LayerManager {
List<FeatureRow> theFeatures = null;
// TODO SWTCH FOR EARCH ITEM TYPE
for (final GeoportalSpatialQueryResult geoNaDataObject : listGeonaDataObjects) {
for (final GeoNaSpatialQueryResult geoNaDataObject : listGeonaDataObjects) {
GWT.log("GeoNaDataObject: " + geoNaDataObject);
List<FeatureRow> features = geoNaDataObject.getFeatures();
LayerItem layerItem = geoNaDataObject.getSourceLayerObject().getLayerItem();
@ -709,7 +709,7 @@ public class LayerManager {
* @param listGeoNaDataObject the list geo na data object
* @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);
ScrollPanel scrollPanel = new ScrollPanel();
@ -767,7 +767,7 @@ public class LayerManager {
// }
String prevProjectId = "";
for (GeoportalSpatialQueryResult geoNaSpatialQueryResult : listGeoNaDataObject) {
for (GeoNaSpatialQueryResult geoNaSpatialQueryResult : listGeoNaDataObject) {
try {
Set<String> indexLayers = mapIndexLayerObjects.keySet();
@ -1123,7 +1123,7 @@ public class LayerManager {
* @param feature the feature
* @param onFailureCenterTo the on failure center to
*/
public void showPopupInfoForCentroidLayer(GeoportalSpatialQueryResult geoNaDataObject, FeatureRow feature,
public void showPopupInfoForCentroidLayer(GeoNaSpatialQueryResult geoNaDataObject, FeatureRow feature,
Coordinate onFailureCenterTo) {
GWT.log("showPopupInfoForCentroidLayer showing feature: " + feature);
GWT.log("showPopupInfoForCentroidLayer showing layerObject: " + geoNaDataObject.getSourceLayerObject());

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.GeoportalDataViewerConstants;
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.GeoQuery;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.GeoQuery.TYPE;
@ -87,7 +87,7 @@ public class LightOpenLayerMap {
private ol.layer.Vector geometryLayer;
private String markerURL = GeoportalImages.ICONS.mapMarkerIcon().getURL();
private String markerURL = GNAImages.ICONS.mapMarkerIcon().getURL();
private LayerOrder layerOrder = new LayerOrder();

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.resources.client.ClientBundle;
public interface GeoportalIcons extends ClientBundle {
public interface GNAIcons extends ClientBundle {
/** My custom base icon collection */
public enum CustomIconType implements BaseIconType {
@ -15,7 +15,7 @@ public interface GeoportalIcons extends ClientBundle {
/** Inject the icon's css once at first usage */
static {
GeoportalImages icons = GWT.create(GeoportalImages.class);
GNAImages icons = GWT.create(GNAImages.class);
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.ImageResource;
public interface GeoportalImages extends ClientBundle {
public interface GNAImages extends ClientBundle {
/** Get access to the css resource during gwt compilation */
@Source("baseIcons.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

View File

@ -22,8 +22,8 @@ import org.gcube.portlets.user.geoportaldataviewer.client.events.ChangeMapLayerE
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.gis.OpenLayerMap;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalIcons;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages;
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAIcons;
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.crossfiltering.CrossFilteringLayerPanel;
import org.gcube.portlets.user.geoportaldataviewer.client.ui.customoverlays.OverlayCustomLayerPanel;
@ -193,19 +193,19 @@ public class GeonaDataViewMainPanel extends Composite {
dataBoxSelection.setIcon(IconType.BOOKMARK);
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);
extentToItaly.getElement().appendChild(italyImg.getElement());
extentToItaly.setWidth("140px");
Image worldImg = new Image(GeoportalImages.ICONS.worldIcon());
Image worldImg = new Image(GNAImages.ICONS.worldIcon());
worldImg.getElement().getStyle().setPaddingLeft(20, Unit.PX);
extentToEarth.getElement().appendChild(worldImg.getElement());
extentToEarth.setWidth("140px");
// linkMap.setCustomIconStyle(GeoportalIcons.CustomIconType.MAP.get());
linkPresetLocation.setCustomIconStyle(GeoportalIcons.CustomIconType.PRESET_LOCATION.get());
linkLayers.setCustomIconStyle(GeoportalIcons.CustomIconType.LAYERS.get());
// linkMap.setCustomIconStyle(GNAIcons.CustomIconType.MAP.get());
linkPresetLocation.setCustomIconStyle(GNAIcons.CustomIconType.PRESET_LOCATION.get());
linkLayers.setCustomIconStyle(GNAIcons.CustomIconType.LAYERS.get());
openCollectionDropDown.setIcon(IconType.COMPASS);

View File

@ -4,11 +4,9 @@ import java.util.List;
import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
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.view.ProjectView;
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.MAP_PROJECTION;
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.IconType;
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.event.dom.client.ClickEvent;
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.rpc.AsyncCallback;
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.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 ol.Coordinate;
@ -94,9 +83,6 @@ public class ProjectViewer extends Composite {
@UiField
Button expandButton;
@UiField
Button exportButton;
@UiField
Button relationshipsButton;
@ -150,22 +136,6 @@ public class ProjectViewer extends Composite {
this.geoportalItemReferences = geoportalItemRefs;
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
? projectView.getTheProjectDV().getProfileName()
: "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.setIcon(IconType.LINK);
relationshipsButton.setTitle("Show Relationships of this Project");
@ -343,6 +240,14 @@ public class ProjectViewer extends Composite {
public void onClick(ClickEvent event) {
boolean visible = toc_list_container.isVisible();
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

@ -44,10 +44,9 @@
<g:HorizontalPanel
addStyleNames="functionalities-style">
<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="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:HTMLPanel ui:field="centroidPanel"></g:HTMLPanel>
<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.events.ShowDetailsEvent;
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.util.LoaderIcon;
@ -45,7 +45,7 @@ public class TimelineRelationPanel extends Composite {
Anchor timelinePopupCloser;
private LoaderIcon loaderData = new LoaderIcon("Loading data... please wait",
new Image(GeoportalImages.ICONS.spinnerClock()));
new Image(GNAImages.ICONS.spinnerClock()));
private TimelineRelationPanel instance = this;

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.DO_LAYER_ACTION;
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.util.LoaderIcon;
import org.gcube.portlets.user.geoportaldataviewer.client.util.StringUtil;
@ -50,11 +50,11 @@ public class DragDropLayer extends FlowPanel {
private static DragDropLayer draggingTarget = null;
final boolean droppable;
private Label labelLayerName;
private Image imgLayerVisible = new Image(GeoportalImages.ICONS.layerVisible());
private Image imgLayerInvisible = new Image(GeoportalImages.ICONS.layerInvisible());
private Image imgLayerVisible = new Image(GNAImages.ICONS.layerVisible());
private Image imgLayerInvisible = new Image(GNAImages.ICONS.layerInvisible());
private Image imgLocate = new Image(GeoportalImages.ICONS.locate());
private Image imgLocateNone = new Image(GeoportalImages.ICONS.locateNone());
private Image imgLocate = new Image(GNAImages.ICONS.locate());
private Image imgLocateNone = new Image(GNAImages.ICONS.locateNone());
private boolean locateEnabled = false;
private HTML buttonLocate = new HTML();

View File

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

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.LightOpenLayerMap;
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.PLACE;
import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer;
@ -86,7 +86,7 @@ public class MapView extends Composite {
theMapPanel.setWidth(internalMapWidth);
theMapPanel.setHeight(internalMapHeight);
linkMap.setCustomIconStyle(GeoportalIcons.CustomIconType.MAP.get());
linkMap.setCustomIconStyle(GNAIcons.CustomIconType.MAP.get());
Scheduler.get().scheduleDeferred(new ScheduledCommand() {

View File

@ -3,7 +3,7 @@
*/
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.HorizontalPanel;
@ -18,7 +18,7 @@ import com.google.gwt.user.client.ui.Image;
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("");
/**

View File

@ -69,7 +69,6 @@ import org.gcube.application.geoportalcommon.util.StringUtil;
import org.gcube.application.geoportalcommon.util.URLParserUtil;
import org.gcube.application.geoportaldatamapper.GcubeProfilesPerUCDIdCache;
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.GeoportalDataViewerService;
import org.gcube.portlets.user.geoportaldataviewer.server.gis.FeatureParser;
@ -81,7 +80,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.TemporalComparatorUtil;
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.ResultSetPaginatedDataIDs;
import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration;
@ -414,14 +413,14 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
* @return the WFS features
*/
@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) {
LOG.info("getWFSFeatures called");
List<GeoportalSpatialQueryResult> listDAO = new ArrayList<GeoportalSpatialQueryResult>(layerObjects.size());
List<GeoNaSpatialQueryResult> listDAO = new ArrayList<GeoNaSpatialQueryResult>(layerObjects.size());
for (LayerObject layerObject : layerObjects) {
GeoportalSpatialQueryResult geoDAO = new GeoportalSpatialQueryResult();
GeoNaSpatialQueryResult geoDAO = new GeoNaSpatialQueryResult();
List<FeatureRow> features = FeatureParser.getWFSFeatures(layerObject.getLayerItem(), mapSrsName, selectBBOX,
maxWFSFeature);
LOG.debug("For layer name: " + layerObject.getLayerItem().getName() + " got features: " + features);
@ -618,6 +617,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.
*
@ -1199,7 +1248,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
* @throws Exception the exception
*/
@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 {
LOG.info("getDataResult called");
@ -1214,13 +1263,13 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
+ ", zoomLevel: " + zoomLevel);
}
List<GeoportalSpatialQueryResult> listDAO = new ArrayList<GeoportalSpatialQueryResult>(layerObjects.size());
List<GeoNaSpatialQueryResult> listDAO = new ArrayList<GeoNaSpatialQueryResult>(layerObjects.size());
try {
new GeoportalServiceIdentityProxy(this.getThreadLocalRequest());
for (LayerObject layerObject : layerObjects) {
GeoportalSpatialQueryResult geoDAO = new GeoportalSpatialQueryResult();
GeoNaSpatialQueryResult geoDAO = new GeoNaSpatialQueryResult();
List<FeatureRow> features = FeatureParser.getWFSFeatures(layerObject.getLayerItem(), mapSrsName,
selectBBOX, maxWFSFeature);
LOG.debug("For layer name: " + layerObject.getLayerItem().getName() + " got features: " + features);
@ -1829,24 +1878,4 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
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

@ -22,9 +22,9 @@ public class GeoportalServiceIdentityProxy {
private static final Logger LOG = LoggerFactory.getLogger(GeoportalServiceIdentityProxy.class);
private GcubeIdentity gCubeIdentity;
private boolean isUser = false;
private boolean isIAMClient = false;
/**
@ -57,24 +57,12 @@ public class GeoportalServiceIdentityProxy {
gCubeIdentity.setIdentity(request);
}
public boolean isUser() {
return isUser;
}
public boolean isIAMClient() {
return isIAMClient;
}
public String getDescription() {
return gCubeIdentity.getIdentityDescription();
}
public String getToken() {
return gCubeIdentity.getToken();
}
public String getIdentity() {
return gCubeIdentity.getIdentity();
}
}

View File

@ -2,15 +2,16 @@ package org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.accessid
import javax.servlet.http.HttpServletRequest;
/**
* The Interface GcubeIdentity.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Sep 23, 2021
* Sep 23, 2021
*/
public interface GcubeIdentity {
/**
* Sets the identity.
*
@ -18,32 +19,10 @@ public interface GcubeIdentity {
* @throws Exception the exception
*/
public void setIdentity(HttpServletRequest httpRequest) throws Exception;
/**
* Reset identity.
*/
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

@ -16,23 +16,18 @@ public class IAMClientIdentity implements GcubeIdentity {
private static final Logger LOG = LoggerFactory.getLogger(IAMClientIdentity.class);
private String previousUMAToken = null;
private String currentUMAToken = null;
private String clientId = null;
private static final String IAM_CLIENT_CREDENTIALS = "IAM_CLIENT_CREDENTIALS";
@Override
public void setIdentity(HttpServletRequest httpRequest) throws Exception {
LOG.info("setIdentity called");
String currentScope = SessionUtil.getCurrentContext(httpRequest, true);
LOG.info("the scope is {}", currentScope);
IAMClientCredentials credentials = sessionGetIAMClientCredentials(httpRequest);
IAMClientCredentials credentials = sessionGetIAMClientCredentials(httpRequest);
try {
if (credentials == null) {
if(credentials==null) {
credentials = IAMClientCredentialsReader.getCredentials();
sessionSetIAMClientCredentials(httpRequest, credentials);
sessionSetIAMClientCredentials(httpRequest,credentials);
}
} catch (Exception e) {
LOG.error("Error on discovering IAM Client credentials", e);
@ -40,16 +35,16 @@ public class IAMClientIdentity implements GcubeIdentity {
}
LOG.trace("Read credentials: " + credentials);
clientId = credentials.getClientId();
String umaAcessToken = null;
String clientId = credentials.getClientId();
String clientSecret = credentials.getClientSecret();
try {
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);
currentUMAToken = tr.getAccessToken();
if (currentUMAToken != null && !currentUMAToken.isEmpty()) {
umaAcessToken = tr.getAccessToken();
if (umaAcessToken != null && !umaAcessToken.isEmpty()) {
LOG.info("UMA Access Token read correctly");
} else {
LOG.error("UMA Access Token NOT RETRIEVED!!!");
@ -61,8 +56,6 @@ public class IAMClientIdentity implements GcubeIdentity {
try {
LOG.debug("JWT token: " + currentUMAToken.substring(0, 20) + "_MASKED_TOKEN_");
try {
// Here the previousUMAToken should be null
previousUMAToken = AccessTokenProvider.instance.get();
@ -71,9 +64,10 @@ public class IAMClientIdentity implements GcubeIdentity {
// silent
}
LOG.debug("JWT token: " + umaAcessToken.substring(0, 20) + "_MASKED_TOKEN_");
LOG.info("Setting clientId '" + clientId + "' identity by JWT token in the "
+ AccessTokenProvider.class.getSimpleName());
AccessTokenProvider.instance.set(currentUMAToken);
AccessTokenProvider.instance.set(umaAcessToken);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
throw new Exception(e.getMessage());
@ -81,11 +75,6 @@ public class IAMClientIdentity implements GcubeIdentity {
}
@Override
public String getToken() {
return currentUMAToken;
}
@Override
public void resetIdentity() {
LOG.info("resetIdentity called");
@ -93,7 +82,7 @@ public class IAMClientIdentity implements GcubeIdentity {
LOG.info("resetIdentity to previous AccessToken");
}
/**
* Gets the IAM client credentials.
*
@ -114,7 +103,7 @@ public class IAMClientIdentity implements GcubeIdentity {
* Sets the IAM client credentials.
*
* @param httpRequest the http request
* @param iamCC the iam CC
* @param iamCC the iam CC
*/
public static void sessionSetIAMClientCredentials(HttpServletRequest httpRequest, IAMClientCredentials iamCC) {
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 org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil;
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -11,19 +10,13 @@ public class UserIdentity implements GcubeIdentity {
private static final Logger LOG = LoggerFactory.getLogger(UserIdentity.class);
private HttpServletRequest httpRequest;
private GCubeUser user;
public UserIdentity() {
}
@Override
public void setIdentity(HttpServletRequest httpRequest) throws Exception {
LOG.info("setIdentity called");
this.httpRequest = httpRequest;
SessionUtil.getCurrentToken(this.httpRequest, true);
user = SessionUtil.getCurrentUser(this.httpRequest);
SessionUtil.getCurrentToken(httpRequest, true);
}
@ -32,20 +25,4 @@ public class UserIdentity implements GcubeIdentity {
LOG.info("resetIdentity called, 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 CHECKED_CONFIG_FOR_PDF_EXPORTER = "CHECKED_CONFIG_FOR_PDF_EXPORTER";
/**
* Checks if is into portal.
*
@ -347,14 +345,4 @@ public class SessionUtil {
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 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.
@ -12,7 +12,7 @@ import org.gcube.portlets.user.geoportaldataviewer.shared.GeoportalSpatialQueryR
*
* Nov 18, 2022
*/
public class TemporalComparatorUtil implements Comparator<GeoportalSpatialQueryResult> {
public class TemporalComparatorUtil implements Comparator<GeoNaSpatialQueryResult> {
/**
* Compare.
@ -22,7 +22,7 @@ public class TemporalComparatorUtil implements Comparator<GeoportalSpatialQueryR
* @return the int
*/
@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) {
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;
/**
* The Class GeoportalSpatialQueryResult.
* The Class GeoNaSpatialQueryResult.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* 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 List<FeatureRow> features;
private LayerObject sourceLayerObject;
// Map with couple (mongoId project, list of uploaded GeoportalImages for the
// project)
// Map with couple (mongoId concessione, list of uploaded GNAImages for the
// concessione)
private Map<String, List<PayloadDV>> mapImages = null;
/**
* Instantiates a new geo na data object.
*/
public GeoportalSpatialQueryResult() {
public GeoNaSpatialQueryResult() {
}
@ -91,7 +91,7 @@ public class GeoportalSpatialQueryResult implements Serializable {
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("GeoportalSpatialQueryResult [features=");
builder.append("GeoNaSpatialQueryResult [features=");
builder.append(features);
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.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.ZAxis;
import com.google.gwt.core.client.GWT;
/**
* The Class LayerItem.
*
@ -948,4 +953,90 @@ public class LayerItem implements Serializable, Cloneable {
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

@ -17,17 +17,11 @@
<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.dark.Dark'/> -->
<!-- Other module inherits -->
<servlet path="/geoportalexporterservice"
class="org.gcube.portlets.user.geoportaldataviewer.server.GeoportalExporterActionServlet" />
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer' />

View File

@ -15,17 +15,7 @@
<servlet-name>geoportalDataViewerServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.geoportaldataviewer.server.GeoportalDataViewerServiceImpl</servlet-class>
</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-name>mpformbuilderServlet</servlet-name>
<servlet-class>org.gcube.portlets.widgets.mpformbuilder.server.MetadataProfileFormBuilderServiceImpl</servlet-class>
@ -41,15 +31,5 @@
<servlet-name>geoportalDataViewerServlet</servlet-name>
<url-pattern>/GeoportalDataViewer/geoportaldataviewerservice</url-pattern>
</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>

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");
}
}