refs 6548: TDM - Migrate TabMan to new PortalContext

Task-Url: https://support.d4science.org/issues/6548

Updated to new PortalContext

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@141747 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-01-24 17:55:34 +00:00
parent 9db7271d3e
commit a752a86e78
2 changed files with 10 additions and 8 deletions

View File

@ -13,7 +13,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.data.analysis.tabulardata.expression.Expression;
import org.gcube.portlets.user.td.expressionwidget.shared.exception.ExpressionParserException;
import org.gcube.portlets.user.td.gwtservice.server.SessionUtil;
@ -66,15 +65,22 @@ public class CExpressionMapServlet extends HttpServlet {
logger.info("CExpressionMapServlet import session id: "
+ session.getId());
@SuppressWarnings("unused")
ServiceCredentials serviceCredentials;
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
if (scopeGroupId == null || scopeGroupId.isEmpty()) {
logger.error("CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
throw new ServletException(
"CURR_GROUP_ID is null, it is a mandatory parameter in custom servlet: "
+ scopeGroupId);
}
try {
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
serviceCredentials = SessionUtil.getServiceCredentials(request,
scopeGroupId);
ScopeProvider.instance.set(serviceCredentials.getScope());
} catch (TDGWTServiceException e) {
logger.error(
"Error retrieving credentials:" + e.getLocalizedMessage(),

View File

@ -5,7 +5,6 @@ package org.gcube.portlets.user.td.expressionwidget.server;
import javax.servlet.http.HttpServletRequest;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.data.analysis.tabulardata.service.operation.Task;
import org.gcube.portlets.user.td.gwtservice.server.SessionConstants;
import org.gcube.portlets.user.td.gwtservice.server.SessionOp;
@ -25,7 +24,6 @@ public class ExpressionSession {
public static FilterColumnSession getColumnFilterSession(
HttpServletRequest httpRequest,
ServiceCredentials serviceCredentials) throws TDGWTServiceException {
ScopeProvider.instance.set(serviceCredentials.getScope());
SessionOp<FilterColumnSession> sessionOp = new SessionOp<>();
FilterColumnSession columnFilterSession = sessionOp.get(httpRequest,
serviceCredentials, SessionConstants.COLUMN_FILTER_SESSION,
@ -44,7 +42,6 @@ public class ExpressionSession {
public static ReplaceColumnByExpressionSession getReplaceColumnByExpressionSession(
HttpServletRequest httpRequest,
ServiceCredentials serviceCredentials) throws TDGWTServiceException {
ScopeProvider.instance.set(serviceCredentials.getScope());
SessionOp<ReplaceColumnByExpressionSession> sessionOp = new SessionOp<>();
ReplaceColumnByExpressionSession replaceColumnByExpressionSession = sessionOp
.get(httpRequest, serviceCredentials,
@ -66,7 +63,6 @@ public class ExpressionSession {
public static Task getColumnFilterTask(HttpServletRequest httpRequest,
ServiceCredentials serviceCredentials) {
ScopeProvider.instance.set(serviceCredentials.getScope());
SessionOp<Task> sessionOp = new SessionOp<>();
Task monitor = sessionOp.get(httpRequest, serviceCredentials,
SessionConstants.COLUMN_FILTER_SESSION_TASK);