updated Export facility

This commit is contained in:
Francesco Mangiacrapa 2024-05-06 11:41:28 +02:00
parent 0224f787c1
commit 7c1f0ad829
4 changed files with 28 additions and 22 deletions

View File

@ -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<GeoportalSpatialQueryResult> getDataResult(List<LayerObject> layerObjects, String mapSrsName,
BoundsMap mapBBOX, int maxWFSFeature, double zoomLevel) throws Exception;
/**
* Gets the my login.
@ -231,7 +231,4 @@ public interface GeoportalDataViewerService extends RemoteService {
Boolean checkExportAsPDFConfig();
// String exportAsPDF(String profileID, String projectID, String profileTitle,
// GeoportalItemReferences geoportalItemReferences);
}

View File

@ -95,7 +95,4 @@ public interface GeoportalDataViewerServiceAsync {
void checkExportAsPDFConfig(AsyncCallback<Boolean> callback);
// void exportAsPDF(String profileID, String projectID, String profileTitle,
// GeoportalItemReferences geoportalItemReferences, AsyncCallback<String> callback);
}

View File

@ -25,6 +25,7 @@ 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.Modal;
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.github.gwtbootstrap.client.ui.constants.IconType;
import com.google.gwt.core.client.GWT;
@ -38,6 +39,7 @@ 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.FlowPanel;
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.SubmitEvent;
@ -266,16 +268,26 @@ public class ProjectViewer extends Composite {
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));
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 FormPanel.SubmitHandler() {
public void onSubmit(SubmitEvent event) {
GWT.log("onSubmit done");
NewBrowserWindow.open("", targetWindow, null);
contactinServiceModal.hide();
}
});
form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
public void onSubmitComplete(SubmitCompleteEvent event) {
contactinServiceModal.hide();
NewBrowserWindow.open("", targetWindow, null);
GWT.log("onSubmitComplete done");
}

View File

@ -54,18 +54,18 @@ public class GeoportalExporterActionServlet extends HttpServlet {
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");
// 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.