From fc45f8c186bc0f51dff9e74253ef23fa45f723cb Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 13 May 2015 17:07:20 +0000 Subject: [PATCH] 81: Allow the creation and use of expressions on multi column in TDM portlet Updated FilterSession Task-Url: https://support.d4science.org/issues/81 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@114740 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../td/gwtservice/server/SessionUtil.java | 2 +- .../gwtservice/server/TDGWTServiceImpl.java | 7 ++- .../shared/tr/column/FilterColumnSession.java | 47 ++++++++++--------- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java index e11f704..bbc460d 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java @@ -88,7 +88,7 @@ public class SessionUtil { .getAttribute(ScopeHelper.USERNAME_ATTRIBUTE); ASLSession session; if (username == null) { - /*logger.warn("no user found in session, using test one");*/ + logger.warn("no user found in session, use test user"); throw new TDGWTSessionExpiredException("Session Expired!"); /* // Remove comment for Test diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index 683fb59..b7bf4b0 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -5417,10 +5417,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements aslSession.getUsername(), aslSession.getScope())); TabularDataService service = TabularDataServiceFactory.getService(); - checkTRId(filterColumnSession.getColumn().getTrId()); + checkTRId(filterColumnSession.getTrId()); TabularResourceId tabularResourceId = new TabularResourceId( - Long.valueOf(filterColumnSession.getColumn().getTrId() + Long.valueOf(filterColumnSession.getTrId() .getId())); TabularResource tabularResource = service .getTabularResource(tabularResourceId); @@ -5445,8 +5445,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements logger.debug("Filter Column on service: TaskId " + trTask.getId()); TaskWrapper taskWrapper = new TaskWrapper(trTask, - UIOperationsId.FilterColumn, filterColumnSession - .getColumn().getTrId()); + UIOperationsId.FilterColumn, filterColumnSession.getTrId()); SessionUtil.setStartedTask(session, taskWrapper); return trTask.getId().getValue(); diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/column/FilterColumnSession.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/column/FilterColumnSession.java index f116a56..2857f25 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/column/FilterColumnSession.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/column/FilterColumnSession.java @@ -2,48 +2,51 @@ package org.gcube.portlets.user.td.gwtservice.shared.tr.column; import java.io.Serializable; +import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression; -import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData; /** * - * @author giancarlo - * email: g.panichi@isti.cnr.it + * @author giancarlo email: g.panichi@isti.cnr.it * */ -public class FilterColumnSession implements Serializable{ - +public class FilterColumnSession implements Serializable { + private static final long serialVersionUID = -5362632291599472352L; - private ColumnData column; + private TRId trId; private C_Expression cexpression; - - public FilterColumnSession(){ - + + public FilterColumnSession() { + } - - public FilterColumnSession(ColumnData column, C_Expression cexpression){ - this.column=column; - this.cexpression=cexpression; + + public FilterColumnSession(TRId trId, C_Expression cexpression) { + super(); + this.trId = trId; + this.cexpression = cexpression; } - - - public ColumnData getColumn() { - return column; + + public TRId getTrId() { + return trId; } - public void setColumn(ColumnData column) { - this.column = column; + + public void setTrId(TRId trId) { + this.trId = trId; } + public C_Expression getCexpression() { return cexpression; } + public void setCexpression(C_Expression cexpression) { this.cexpression = cexpression; } - + @Override public String toString() { - return "ColumnFilterSession [column=" + column + ", cexpression=" + return "FilterColumnSession [trId=" + trId + ", cexpression=" + cexpression + "]"; } - + }