Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@99313 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-08-27 16:40:43 +00:00
parent 5b99711b35
commit df392995e7
2 changed files with 28 additions and 20 deletions

View File

@ -17,6 +17,7 @@ import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
import org.gcube.portlets.user.td.gwtservice.server.file.CSVFileUploadSession; import org.gcube.portlets.user.td.gwtservice.server.file.CSVFileUploadSession;
import org.gcube.portlets.user.td.gwtservice.server.file.CodelistMappingFileUploadSession; import org.gcube.portlets.user.td.gwtservice.server.file.CodelistMappingFileUploadSession;
import org.gcube.portlets.user.td.gwtservice.server.trservice.TRTasksManager; import org.gcube.portlets.user.td.gwtservice.server.trservice.TRTasksManager;
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession; import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
@ -75,17 +76,18 @@ public class SessionUtil {
ASLSession session; ASLSession session;
if (username == null) { if (username == null) {
logger.warn("no user found in session, using test one"); logger.warn("no user found in session, using test one");
throw new TDGWTSessionExpiredException("Session Expired!"); /* throw new TDGWTSessionExpiredException("Session Expired!"); */
// Remove comment for Test // Remove comment for Test
/*
* username = Constants.DEFAULT_USER; String scope = username = Constants.DEFAULT_USER;
* Constants.DEFAULT_SCOPE; String scope = Constants.DEFAULT_SCOPE;
*
* httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, httpSession.setAttribute(ScopeHelper.USERNAME_ATTRIBUTE, username);
* username); session = SessionManager.getInstance().getASLSession( session = SessionManager.getInstance().getASLSession(
* httpSession.getId(), username); session.setScope(scope); httpSession.getId(), username);
*/ session.setScope(scope);
} else { } else {
session = SessionManager.getInstance().getASLSession( session = SessionManager.getInstance().getASLSession(
httpSession.getId(), username); httpSession.getId(), username);
@ -1270,7 +1272,8 @@ public class SessionUtil {
if (tasksStarted == null) { if (tasksStarted == null) {
tasksStarted = new HashMap<String, TaskWrapper>(); tasksStarted = new HashMap<String, TaskWrapper>();
} else { } else {
httpSession.removeAttribute(SessionConstants.OPERATIONS_TASKS_STARTED); httpSession
.removeAttribute(SessionConstants.OPERATIONS_TASKS_STARTED);
} }
tasksStarted.put(taskWrapper.getTask().getId().getValue(), taskWrapper); tasksStarted.put(taskWrapper.getTask().getId().getValue(), taskWrapper);
httpSession.setAttribute(SessionConstants.OPERATIONS_TASKS_STARTED, httpSession.setAttribute(SessionConstants.OPERATIONS_TASKS_STARTED,

View File

@ -194,12 +194,11 @@ public class OperationMonitorCreator {
Table table; Table table;
ExportMetadata exportMetadata; ExportMetadata exportMetadata;
switch(taskWrapper.getOperationId()){ switch (taskWrapper.getOperationId()) {
case CSVExport: case CSVExport:
table = taskWrapper.getTask().getResult().getPrimaryTable(); table = taskWrapper.getTask().getResult().getPrimaryTable();
logger.debug("Table retrived: " + table.toString()); logger.debug("Table retrived: " + table.toString());
exportMetadata = table exportMetadata = table.getMetadata(ExportMetadata.class);
.getMetadata(ExportMetadata.class);
logger.debug("ExportMetadata: " + exportMetadata); logger.debug("ExportMetadata: " + exportMetadata);
operationMonitor.setTrId(SessionUtil.getTRId(session)); operationMonitor.setTrId(SessionUtil.getTRId(session));
@ -217,8 +216,7 @@ public class OperationMonitorCreator {
case SDMXExport: case SDMXExport:
table = taskWrapper.getTask().getResult().getPrimaryTable(); table = taskWrapper.getTask().getResult().getPrimaryTable();
logger.debug("Table retrived: " + table.toString()); logger.debug("Table retrived: " + table.toString());
exportMetadata = table exportMetadata = table.getMetadata(ExportMetadata.class);
.getMetadata(ExportMetadata.class);
logger.debug("ExportMetadata: " + exportMetadata); logger.debug("ExportMetadata: " + exportMetadata);
operationMonitor.setTrId(SessionUtil.getTRId(session)); operationMonitor.setTrId(SessionUtil.getTRId(session));
break; break;
@ -229,8 +227,15 @@ public class OperationMonitorCreator {
operationMonitor.setTrId(trId); operationMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session); tabResource = SessionUtil.getTabResource(session);
logger.debug("CurrentTabResource :"+tabResource);
if (tabResource != null) {
tabResource.setTrId(trId); tabResource.setTrId(trId);
SessionUtil.setTabResource(session, tabResource); SessionUtil.setTabResource(session, tabResource);
} else {
tabResource=new TabResource();
tabResource.setTrId(trId);
SessionUtil.setTabResource(session, tabResource);
}
SessionUtil.setTRId(session, trId); SessionUtil.setTRId(session, trId);
break; break;