From a752a86e7858a9198c840f9cec0a8c18884f1dc4 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 24 Jan 2017 17:55:34 +0000 Subject: [PATCH] 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 --- .../server/CExpressionMapServlet.java | 14 ++++++++++---- .../expressionwidget/server/ExpressionSession.java | 4 ---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/CExpressionMapServlet.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/CExpressionMapServlet.java index 6dd898c..6c5be20 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/CExpressionMapServlet.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/CExpressionMapServlet.java @@ -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(), diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionSession.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionSession.java index 24b9ed3..c973d42 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionSession.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionSession.java @@ -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 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 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 sessionOp = new SessionOp<>(); Task monitor = sessionOp.get(httpRequest, serviceCredentials, SessionConstants.COLUMN_FILTER_SESSION_TASK);