Updated to new PortalContext

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@141686 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-01-20 18:15:48 +00:00
parent ed6649d618
commit bce05ddae9
2 changed files with 15 additions and 13 deletions

View File

@ -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(

View File

@ -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,