diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4CSVExport.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4CSVExport.java index 90b31a7..8ab9371 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4CSVExport.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4CSVExport.java @@ -3,13 +3,14 @@ package org.gcube.portlets.user.td.gwtservice.server.opexecution; import java.util.HashMap; import java.util.Map; -import javax.servlet.http.HttpSession; +import javax.servlet.http.HttpServletRequest; import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition; import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution; import org.gcube.data.analysis.tabulardata.service.TabularDataService; import org.gcube.portlets.user.td.gwtservice.server.SessionUtil; import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap; +import org.gcube.portlets.user.td.gwtservice.server.util.ServiceCredentials; import org.gcube.portlets.user.td.gwtservice.shared.Constants; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException; @@ -28,22 +29,25 @@ public class OpExecution4CSVExport extends OpExecutionBuilder { protected static Logger logger = LoggerFactory .getLogger(OpExecution4CSVExport.class); - private HttpSession session; + private HttpServletRequest httpRequest; + private ServiceCredentials serviceCredentials; private TabularDataService service; private CSVExportSession csvExportSession; - public OpExecution4CSVExport(HttpSession session, - TabularDataService service, CSVExportSession csvExportSession) { + public OpExecution4CSVExport(HttpServletRequest httpRequest, + ServiceCredentials serviceCredentials, TabularDataService service, + CSVExportSession csvExportSession) { this.service = service; this.csvExportSession = csvExportSession; - this.session = session; + this.httpRequest = httpRequest; + this.serviceCredentials = serviceCredentials; } @Override public void buildOpEx() throws TDGWTServiceException { logger.debug("CSV Export: " + csvExportSession); - SessionUtil.setCSVExportEnd(session, false); + SessionUtil.setCSVExportEnd(httpRequest, serviceCredentials, false); OperationDefinition operationDefinition; operationDefinition = OperationDefinitionMap.map( diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4CSVImport.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4CSVImport.java index 6361a97..bee02fd 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4CSVImport.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4CSVImport.java @@ -3,15 +3,13 @@ package org.gcube.portlets.user.td.gwtservice.server.opexecution; import java.util.HashMap; import java.util.Map; -import javax.servlet.http.HttpSession; - -import org.gcube.application.framework.core.session.ASLSession; import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition; import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution; import org.gcube.data.analysis.tabulardata.service.TabularDataService; import org.gcube.portlets.user.td.gwtservice.server.file.CSVFileUploadSession; import org.gcube.portlets.user.td.gwtservice.server.storage.FilesStorage; import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap; +import org.gcube.portlets.user.td.gwtservice.server.util.ServiceCredentials; import org.gcube.portlets.user.td.gwtservice.shared.Constants; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException; @@ -33,15 +31,15 @@ public class OpExecution4CSVImport extends OpExecutionBuilder { private TabularDataService service; private CSVImportSession csvImportSession; - private ASLSession aslSession; + private ServiceCredentials serviceCredentials; private CSVFileUploadSession fileUploadSession; - public OpExecution4CSVImport(HttpSession session, ASLSession aslSession, + public OpExecution4CSVImport(ServiceCredentials serviceCredentials, TabularDataService service, CSVImportSession csvImportSession, CSVFileUploadSession fileUploadSession) { this.service = service; this.csvImportSession = csvImportSession; - this.aslSession = aslSession; + this.serviceCredentials = serviceCredentials; this.fileUploadSession = fileUploadSession; } @@ -49,7 +47,7 @@ public class OpExecution4CSVImport extends OpExecutionBuilder { public void buildOpEx() throws TDGWTServiceException { logger.debug("CSV Import: " + csvImportSession); - String user = aslSession.getUsername(); + String user = serviceCredentials.getUserName(); logger.debug("Session User:" + user); String fileIdOnStorage = loadCSVFileOnStorage(user,