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:
parent
9db7271d3e
commit
a752a86e78
|
@ -13,7 +13,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.data.analysis.tabulardata.expression.Expression;
|
import org.gcube.data.analysis.tabulardata.expression.Expression;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.exception.ExpressionParserException;
|
import org.gcube.portlets.user.td.expressionwidget.shared.exception.ExpressionParserException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.server.SessionUtil;
|
import org.gcube.portlets.user.td.gwtservice.server.SessionUtil;
|
||||||
|
@ -66,15 +65,22 @@ public class CExpressionMapServlet extends HttpServlet {
|
||||||
logger.info("CExpressionMapServlet import session id: "
|
logger.info("CExpressionMapServlet import session id: "
|
||||||
+ session.getId());
|
+ session.getId());
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
ServiceCredentials serviceCredentials;
|
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 {
|
try {
|
||||||
String scopeGroupId = request.getParameter(Constants.CURR_GROUP_ID);
|
|
||||||
serviceCredentials = SessionUtil.getServiceCredentials(request,
|
serviceCredentials = SessionUtil.getServiceCredentials(request,
|
||||||
scopeGroupId);
|
scopeGroupId);
|
||||||
|
|
||||||
ScopeProvider.instance.set(serviceCredentials.getScope());
|
|
||||||
|
|
||||||
} catch (TDGWTServiceException e) {
|
} catch (TDGWTServiceException e) {
|
||||||
logger.error(
|
logger.error(
|
||||||
"Error retrieving credentials:" + e.getLocalizedMessage(),
|
"Error retrieving credentials:" + e.getLocalizedMessage(),
|
||||||
|
|
|
@ -5,7 +5,6 @@ package org.gcube.portlets.user.td.expressionwidget.server;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.data.analysis.tabulardata.service.operation.Task;
|
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.SessionConstants;
|
||||||
import org.gcube.portlets.user.td.gwtservice.server.SessionOp;
|
import org.gcube.portlets.user.td.gwtservice.server.SessionOp;
|
||||||
|
@ -25,7 +24,6 @@ public class ExpressionSession {
|
||||||
public static FilterColumnSession getColumnFilterSession(
|
public static FilterColumnSession getColumnFilterSession(
|
||||||
HttpServletRequest httpRequest,
|
HttpServletRequest httpRequest,
|
||||||
ServiceCredentials serviceCredentials) throws TDGWTServiceException {
|
ServiceCredentials serviceCredentials) throws TDGWTServiceException {
|
||||||
ScopeProvider.instance.set(serviceCredentials.getScope());
|
|
||||||
SessionOp<FilterColumnSession> sessionOp = new SessionOp<>();
|
SessionOp<FilterColumnSession> sessionOp = new SessionOp<>();
|
||||||
FilterColumnSession columnFilterSession = sessionOp.get(httpRequest,
|
FilterColumnSession columnFilterSession = sessionOp.get(httpRequest,
|
||||||
serviceCredentials, SessionConstants.COLUMN_FILTER_SESSION,
|
serviceCredentials, SessionConstants.COLUMN_FILTER_SESSION,
|
||||||
|
@ -44,7 +42,6 @@ public class ExpressionSession {
|
||||||
public static ReplaceColumnByExpressionSession getReplaceColumnByExpressionSession(
|
public static ReplaceColumnByExpressionSession getReplaceColumnByExpressionSession(
|
||||||
HttpServletRequest httpRequest,
|
HttpServletRequest httpRequest,
|
||||||
ServiceCredentials serviceCredentials) throws TDGWTServiceException {
|
ServiceCredentials serviceCredentials) throws TDGWTServiceException {
|
||||||
ScopeProvider.instance.set(serviceCredentials.getScope());
|
|
||||||
SessionOp<ReplaceColumnByExpressionSession> sessionOp = new SessionOp<>();
|
SessionOp<ReplaceColumnByExpressionSession> sessionOp = new SessionOp<>();
|
||||||
ReplaceColumnByExpressionSession replaceColumnByExpressionSession = sessionOp
|
ReplaceColumnByExpressionSession replaceColumnByExpressionSession = sessionOp
|
||||||
.get(httpRequest, serviceCredentials,
|
.get(httpRequest, serviceCredentials,
|
||||||
|
@ -66,7 +63,6 @@ public class ExpressionSession {
|
||||||
|
|
||||||
public static Task getColumnFilterTask(HttpServletRequest httpRequest,
|
public static Task getColumnFilterTask(HttpServletRequest httpRequest,
|
||||||
ServiceCredentials serviceCredentials) {
|
ServiceCredentials serviceCredentials) {
|
||||||
ScopeProvider.instance.set(serviceCredentials.getScope());
|
|
||||||
SessionOp<Task> sessionOp = new SessionOp<>();
|
SessionOp<Task> sessionOp = new SessionOp<>();
|
||||||
Task monitor = sessionOp.get(httpRequest, serviceCredentials,
|
Task monitor = sessionOp.get(httpRequest, serviceCredentials,
|
||||||
SessionConstants.COLUMN_FILTER_SESSION_TASK);
|
SessionConstants.COLUMN_FILTER_SESSION_TASK);
|
||||||
|
|
Loading…
Reference in New Issue