Integrated the "Export as PDF" facility [#26026]
This commit is contained in:
parent
8cf6d178b1
commit
90192d2085
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/geoportal-data-viewer-app-3.6.0/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/geoportal-data-viewer-app-3.7.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
|
@ -30,5 +30,5 @@
|
|||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.6.0/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/geoportal-data-viewer-app-3.7.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
eclipse.preferences.version=1
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.6.0
|
||||
lastWarOutDir=/home/francescomangiacrapa/git/geoportal-data-viewer-app/target/geoportal-data-viewer-app-3.7.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -99,8 +99,24 @@
|
|||
|
||||
|
||||
|
||||
<wb-module deploy-name="geoportal-data-viewer-app-3.6.0">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-module deploy-name="geoportal-data-viewer-app-3.7.0-SNAPSHOT">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -201,7 +217,15 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -302,7 +326,15 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -403,7 +435,15 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -504,7 +544,18 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
|
||||
<dependent-module archiveName="geo-utility-1.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geo-utility/geo-utility">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -605,7 +656,15 @@
|
|||
|
||||
|
||||
<property name="java-output-path" value="/geoportal-data-viewer-app/target/geoportal-data-viewer-app-0.0.1-SNAPSHOT/WEB-INF/classes"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -706,7 +765,15 @@
|
|||
|
||||
|
||||
<property name="context-root" value="geoportal-data-viewer-app"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -807,7 +874,15 @@
|
|||
|
||||
|
||||
</wb-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
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-SNAPSHOT]
|
||||
|
||||
- Provided the "Export as PDF" facility [#26026]
|
||||
|
||||
## [v3.6.0]
|
||||
|
||||
- GUI optimization [#25461]
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -14,7 +14,7 @@
|
|||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>geoportal-data-viewer-app</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>3.6.0</version>
|
||||
<version>3.7.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>
|
||||
|
||||
|
|
|
@ -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.GNAImages;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages;
|
||||
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(GNAImages.ICONS.spinnerEarth()));
|
||||
new com.google.gwt.user.client.ui.Image(GeoportalImages.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(GNAImages.ICONS.warningError());
|
||||
Image geoportalError = new Image(GeoportalImages.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(GNAImages.ICONS.geoportaServiceError());
|
||||
Image geoportalError = new Image(GeoportalImages.ICONS.geoportaServiceError());
|
||||
FlowPanel errorPanelMsg = new FlowPanel();
|
||||
errorPanelMsg.getElement().addClassName("general_error");
|
||||
errorPanelMsg.add(geoportalError);
|
||||
|
|
|
@ -3,6 +3,7 @@ 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;
|
||||
|
||||
|
@ -14,7 +15,14 @@ import com.google.gwt.i18n.client.DateTimeFormat;
|
|||
* Nov 24, 2020
|
||||
*/
|
||||
public class GeoportalDataViewerConstants {
|
||||
|
||||
|
||||
//WAITING_SERVER_ACTION_SERVLET
|
||||
public static final String WAITING_PARAMETER = "waiting";
|
||||
public static final String ACTION_TITLE_PARAMETER = "action";
|
||||
public static final String MESSAGE_PARAMETER = "message";
|
||||
public static final String WAITING_SERVER_ACTION_SERVLET = GWT.getModuleBaseURL()
|
||||
+ "geoportaldataviewerwaitingservice";
|
||||
|
||||
public static final int TABLET_WIDTH = 1601;
|
||||
|
||||
public static final String MAP_DIV = "map";
|
||||
|
@ -40,12 +48,9 @@ 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;
|
||||
|
|
|
@ -229,4 +229,9 @@ public interface GeoportalDataViewerService extends RemoteService {
|
|||
|
||||
Integer getCountFor(String profileID, String phase, String status);
|
||||
|
||||
Boolean checkExportAsPDFConfig();
|
||||
|
||||
String exportAsPDF(String profileID, String projectID, String profileTitle,
|
||||
GeoportalItemReferences geoportalItemReferences);
|
||||
|
||||
}
|
||||
|
|
|
@ -93,4 +93,9 @@ public interface GeoportalDataViewerServiceAsync {
|
|||
|
||||
void getCountFor(String profileID, String phase, String status, AsyncCallback<Integer> callback);
|
||||
|
||||
void checkExportAsPDFConfig(AsyncCallback<Boolean> callback);
|
||||
|
||||
void exportAsPDF(String profileID, String projectID, String profileTitle,
|
||||
GeoportalItemReferences geoportalItemReferences, AsyncCallback<String> callback);
|
||||
|
||||
}
|
||||
|
|
|
@ -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.GNAImages;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages;
|
||||
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 = GNAImages.ICONS.mapMarkerIcon().getURL();
|
||||
private String markerURL = GeoportalImages.ICONS.mapMarkerIcon().getURL();
|
||||
|
||||
private LayerOrder layerOrder = new LayerOrder();
|
||||
|
||||
|
|
|
@ -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 GNAIcons extends ClientBundle {
|
||||
public interface GeoportalIcons extends ClientBundle {
|
||||
|
||||
/** My custom base icon collection */
|
||||
public enum CustomIconType implements BaseIconType {
|
||||
|
@ -15,7 +15,7 @@ public interface GNAIcons extends ClientBundle {
|
|||
|
||||
/** Inject the icon's css once at first usage */
|
||||
static {
|
||||
GNAImages icons = GWT.create(GNAImages.class);
|
||||
GeoportalImages icons = GWT.create(GeoportalImages.class);
|
||||
icons.css().ensureInjected();
|
||||
}
|
||||
|
|
@ -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 GNAImages extends ClientBundle {
|
||||
public interface GeoportalImages extends ClientBundle {
|
||||
|
||||
/** Get access to the css resource during gwt compilation */
|
||||
@Source("baseIcons.css")
|
||||
CssResource css();
|
||||
|
||||
public static final GNAImages ICONS = GWT.create(GNAImages.class);
|
||||
public static final GeoportalImages ICONS = GWT.create(GeoportalImages.class);
|
||||
|
||||
/**
|
||||
* Our sample image icon. Makes the image resource for the gwt-compiler's css
|
|
@ -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.GNAIcons;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
|
||||
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.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(GNAImages.ICONS.italyIcon());
|
||||
Image italyImg = new Image(GeoportalImages.ICONS.italyIcon());
|
||||
italyImg.getElement().getStyle().setPaddingLeft(20, Unit.PX);
|
||||
extentToItaly.getElement().appendChild(italyImg.getElement());
|
||||
extentToItaly.setWidth("140px");
|
||||
|
||||
Image worldImg = new Image(GNAImages.ICONS.worldIcon());
|
||||
Image worldImg = new Image(GeoportalImages.ICONS.worldIcon());
|
||||
worldImg.getElement().getStyle().setPaddingLeft(20, Unit.PX);
|
||||
extentToEarth.getElement().appendChild(worldImg.getElement());
|
||||
extentToEarth.setWidth("140px");
|
||||
|
||||
// linkMap.setCustomIconStyle(GNAIcons.CustomIconType.MAP.get());
|
||||
linkPresetLocation.setCustomIconStyle(GNAIcons.CustomIconType.PRESET_LOCATION.get());
|
||||
linkLayers.setCustomIconStyle(GNAIcons.CustomIconType.LAYERS.get());
|
||||
// linkMap.setCustomIconStyle(GeoportalIcons.CustomIconType.MAP.get());
|
||||
linkPresetLocation.setCustomIconStyle(GeoportalIcons.CustomIconType.PRESET_LOCATION.get());
|
||||
linkLayers.setCustomIconStyle(GeoportalIcons.CustomIconType.LAYERS.get());
|
||||
|
||||
openCollectionDropDown.setIcon(IconType.COMPASS);
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.gcube.portlets.user.geoportaldataviewer.client.ui.map.ExtentMapUtil;
|
|||
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.MapView;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.util.NewBrowserWindow;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||
|
@ -83,6 +84,9 @@ public class ProjectViewer extends Composite {
|
|||
@UiField
|
||||
Button expandButton;
|
||||
|
||||
@UiField
|
||||
Button exportButton;
|
||||
|
||||
@UiField
|
||||
Button relationshipsButton;
|
||||
|
||||
|
@ -136,6 +140,22 @@ 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();
|
||||
|
@ -183,6 +203,51 @@ 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
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(GeoportalDataViewerConstants.WAITING_SERVER_ACTION_SERVLET+"?");
|
||||
builder.append(GeoportalDataViewerConstants.ACTION_TITLE_PARAMETER+"=Export as PDF&");
|
||||
builder.append(GeoportalDataViewerConstants.MESSAGE_PARAMETER+"="+theProjectName+"&");
|
||||
builder.append(GeoportalDataViewerConstants.WAITING_PARAMETER+"=true");
|
||||
|
||||
String theWaitingServletRequest = builder.toString();
|
||||
final NewBrowserWindow ref = NewBrowserWindow.open(theWaitingServletRequest, "_blank", null);
|
||||
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().exportAsPDF(projectView.getTheProjectDV().getProfileID(),
|
||||
projectView.getTheProjectDV().getId(), theTitle, geoportalItemReferences,
|
||||
new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String resultURL) {
|
||||
ref.setUrl(resultURL);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
relationshipsButton.setType(ButtonType.LINK);
|
||||
relationshipsButton.setIcon(IconType.LINK);
|
||||
relationshipsButton.setTitle("Show Relationships of this Project");
|
||||
|
@ -240,7 +305,7 @@ 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);
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
addStyleNames="functionalities-style">
|
||||
<b:Button ui:field="shareButton">Share</b:Button>
|
||||
<b:Button ui:field="expandButton">Expand</b:Button>
|
||||
<b:Button ui:field="exportButton">Export</b:Button>
|
||||
<b:Button ui:field="relationshipsButton">Relationships</b:Button>
|
||||
<b:Button ui:field="addLayersToMap">Add Layers to Map</b:Button>
|
||||
</g:HorizontalPanel>
|
||||
|
|
|
@ -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.GNAImages;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages;
|
||||
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(GNAImages.ICONS.spinnerClock()));
|
||||
new Image(GeoportalImages.ICONS.spinnerClock()));
|
||||
|
||||
private TimelineRelationPanel instance = this;
|
||||
|
||||
|
|
|
@ -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.GNAImages;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages;
|
||||
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(GNAImages.ICONS.layerVisible());
|
||||
private Image imgLayerInvisible = new Image(GNAImages.ICONS.layerInvisible());
|
||||
private Image imgLayerVisible = new Image(GeoportalImages.ICONS.layerVisible());
|
||||
private Image imgLayerInvisible = new Image(GeoportalImages.ICONS.layerInvisible());
|
||||
|
||||
private Image imgLocate = new Image(GNAImages.ICONS.locate());
|
||||
private Image imgLocateNone = new Image(GNAImages.ICONS.locateNone());
|
||||
private Image imgLocate = new Image(GeoportalImages.ICONS.locate());
|
||||
private Image imgLocateNone = new Image(GeoportalImages.ICONS.locateNone());
|
||||
private boolean locateEnabled = false;
|
||||
private HTML buttonLocate = new HTML();
|
||||
|
||||
|
|
|
@ -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.GNAIcons;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalIcons;
|
||||
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(GNAIcons.CustomIconType.MAP.get());
|
||||
linkMap.setCustomIconStyle(GeoportalIcons.CustomIconType.MAP.get());
|
||||
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
package org.gcube.portlets.user.geoportaldataviewer.client.util;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GNAImages;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.resources.GeoportalImages;
|
||||
|
||||
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(GNAImages.ICONS.loading());
|
||||
private Image imgLoading = new Image(GeoportalImages.ICONS.loading());
|
||||
private HTML txtLoading = new HTML("");
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,6 +69,9 @@ 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.application.geoportaldatamapper.shared.ExporterProjectSource;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
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;
|
||||
|
@ -1878,4 +1881,60 @@ 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String exportAsPDF(String profileID, String projectID, String profileTitle,
|
||||
GeoportalItemReferences geoportalItemReferences) {
|
||||
LOG.debug("exportAsPDF for profileID: " + profileID + ", projectID: " + projectID + "called");
|
||||
|
||||
String pdfURL = null;
|
||||
try {
|
||||
|
||||
GeoportalServiceIdentityProxy identity = new GeoportalServiceIdentityProxy(this.getThreadLocalRequest());
|
||||
|
||||
Geoportal_PDF_Exporter gpdfe = new Geoportal_PDF_Exporter();
|
||||
ExporterProjectSource exportSource = new ExporterProjectSource();
|
||||
exportSource.setProfileID(profileID);
|
||||
exportSource.setProfileTitle(profileTitle);
|
||||
exportSource.setProjectID(projectID);
|
||||
exportSource.setScope(ScopeProvider.instance.get());
|
||||
|
||||
GeoportalItemReferences gir = getPublicLinksFor(geoportalItemReferences);
|
||||
|
||||
if (identity.isUser()) {
|
||||
exportSource.setGisLink(gir.getRestrictedLink().getShortURL());
|
||||
GCubeUser user = SessionUtil.getCurrentUser(this.getThreadLocalRequest());
|
||||
exportSource.setAccountname(user.getUsername());
|
||||
} else {
|
||||
exportSource.setGisLink(gir.getOpenLink().getShortURL());
|
||||
exportSource.setAccountname(null);
|
||||
}
|
||||
|
||||
pdfURL = gpdfe.createPDFFile(exportSource);
|
||||
|
||||
} catch (Exception e1) {
|
||||
// silent
|
||||
}
|
||||
return pdfURL;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,136 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.user.geoportaldataviewer.server;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerConstants;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The Class WatingServerActionServlet.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Nov 22, 2023
|
||||
*/
|
||||
public class WatingServerActionServlet extends HttpServlet {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1058074450240555475L;
|
||||
protected static Logger logger = LoggerFactory.getLogger(WatingServerActionServlet.class);
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void init() throws ServletException {
|
||||
super.init();
|
||||
logger.trace("Workspace WatingServerActionServlet ready.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Do get.
|
||||
*
|
||||
* @param req the req
|
||||
* @param resp the resp
|
||||
* @throws IOException Signals that an I/O exception has occurred.
|
||||
*/
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest,
|
||||
* javax.servlet.http.HttpServletResponse)
|
||||
*/
|
||||
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
|
||||
|
||||
String action = req.getParameter(GeoportalDataViewerConstants.ACTION_TITLE_PARAMETER);
|
||||
String message = req.getParameter(GeoportalDataViewerConstants.MESSAGE_PARAMETER);
|
||||
boolean waiting = req.getParameter(GeoportalDataViewerConstants.WAITING_PARAMETER) == null ? true
|
||||
: req.getParameter(GeoportalDataViewerConstants.WAITING_PARAMETER).equals("true");
|
||||
|
||||
logger.debug("Input Params [action: " + action + ", message: "+ message +", waiting: " + waiting + "]");
|
||||
|
||||
action = action == null || action.isEmpty() ? "Loading" : action;
|
||||
|
||||
message = message == null || message.isEmpty() ? "" : message;
|
||||
|
||||
sendResponse(resp, action, message, waiting);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send response.
|
||||
*
|
||||
* @param response the response
|
||||
* @param action the action
|
||||
* @param message the message
|
||||
* @param waiting the waiting
|
||||
* @throws IOException Signals that an I/O exception has occurred.
|
||||
*/
|
||||
protected void sendResponse(HttpServletResponse response, String action, String message, boolean waiting) throws IOException {
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.getWriter().write(setHTMLMessage(action, message, waiting));
|
||||
response.flushBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTML message.
|
||||
*
|
||||
* @param action the action
|
||||
* @param message the message
|
||||
* @param waiting the waiting
|
||||
* @return the string
|
||||
*/
|
||||
protected String setHTMLMessage(String action, String message, boolean waiting) {
|
||||
|
||||
String html = "<html>" + "<head>" + "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"
|
||||
+ "<style>"
|
||||
+ "html, body {\n"
|
||||
+ " margin: 10px;\n"
|
||||
+ " width: 100%;\n"
|
||||
+ " height: 100%;\n"
|
||||
+ " display: table\n"
|
||||
+ "}\n"
|
||||
+ "#content {\n"
|
||||
+ " position: absolute;\n"
|
||||
+ " left: 50%;\n"
|
||||
+ " top: 50%;\n"
|
||||
+ " -webkit-transform: translate(-50%, -50%);\n"
|
||||
+ " transform: translate(-50%, -50%);\n"
|
||||
+ " text-align: center;\n"
|
||||
+ "}"
|
||||
+ "#message {\n"
|
||||
+ " color:gray;"
|
||||
+ " font-size: 24px;"
|
||||
+ "}"
|
||||
+ "</style>"
|
||||
+ "<title>D4Science Geoportal - Action</title>" + "</head>" + "<body>";
|
||||
|
||||
|
||||
html += "<img alt=\"D4Science Logo\" src=\"https://services.d4science.org/image/layout_set_logo?img_id=32727\"><br />";
|
||||
|
||||
html += "<div id=\"content\">";
|
||||
html += "<p style=\"font-size: 18px;\">" + action + "</p>";
|
||||
|
||||
if (waiting) {
|
||||
html += "<img alt=\"D4Science Geoportal Loading...\" src=\"../img/loading-gears.gif\"><br />";
|
||||
}
|
||||
|
||||
html += "<br/><p id=\"message\">" + message + "</p>";
|
||||
html += "</div></body></html>";
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
}
|
|
@ -55,6 +55,8 @@ 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.
|
||||
*
|
||||
|
@ -345,4 +347,14 @@ 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class GeoNaSpatialQueryResult implements Serializable {
|
|||
private static final long serialVersionUID = 3513120677727206958L;
|
||||
private List<FeatureRow> features;
|
||||
private LayerObject sourceLayerObject;
|
||||
// Map with couple (mongoId concessione, list of uploaded GNAImages for the
|
||||
// Map with couple (mongoId concessione, list of uploaded GeoportalImages for the
|
||||
// concessione)
|
||||
private Map<String, List<PayloadDV>> mapImages = null;
|
||||
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
<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>mpformbuilderServlet</servlet-name>
|
||||
|
@ -31,5 +36,10 @@
|
|||
<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>
|
||||
|
||||
</web-app>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
Loading…
Reference in New Issue