From ee648e046da893067f34ddfc38445136f41ce2a7 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 5 Feb 2014 14:19:04 +0000 Subject: [PATCH] Minor Update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@90936 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/td/gwtservice/server/SessionUtil.java | 2 ++ .../user/td/gwtservice/server/TDGWTServiceImpl.java | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java index 75c03c3..40ebc22 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java @@ -456,8 +456,10 @@ public class SessionUtil { public static Boolean getCSVExportEnd(HttpSession httpSession) { Boolean end = (Boolean) httpSession.getAttribute(CSV_EXPORT_END); + logger.debug("getCSVExportEnd(): "+end); if (end == null) { logger.error("CSV_EXPORT_END was not acquired"); + end=false; } return end; } diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index d36decb..fe6f889 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -1996,7 +1996,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements exportMonitor.setProgress(task.getProgress()); break; case SUCCEDED: - SessionUtil.setCSVExportEnd(session, true); logger.debug("Task Result:" + task.getResult()); exportMonitor.setProgress(task.getProgress()); Table table = task.getResult().getPrimaryTable(); @@ -2053,8 +2052,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements ExportMetadata exportMetadata, CSVExportSession exportSession) throws TDGWTServiceException { logger.debug("Save Export In Destination"); + logger.debug("Destination: "+exportSession.getDestination().getId()); if (exportSession.getDestination().getId().compareTo("Workspace") == 0) { - if (SessionUtil.getCSVExportEnd(session) == false) { + logger.debug("Save on Workspace"); + boolean end=SessionUtil.getCSVExportEnd(session); + if (end == false) { SessionUtil.setCSVExportEnd(session, true); FilesStorage storage = new FilesStorage(); logger.debug("Create Item On Workspace: [ uri: " @@ -2068,9 +2070,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements exportSession.getFileName(), exportSession.getFileDescription(), "text/csv", exportSession.getItemId()); + + } else { + logger.debug("getCSVExportEnd(): true"); } } else { - + logger.error("Destination No Present"); + throw new TDGWTServiceException( + "Error in exportCSV CSVExportMonitor: no destination present"); } }