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 891338d..c36482e 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 @@ -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.CodelistMappingFileUploadSession; 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.csv.CSVExportSession; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession; @@ -76,10 +77,10 @@ public class SessionUtil { ASLSession session; if (username == null) { logger.warn("no user found in session, using test one"); - throw new TDGWTSessionExpiredException("Session Expired!"); + /*throw new TDGWTSessionExpiredException("Session Expired!");*/ // Remove comment for Test - /* + username = Constants.DEFAULT_USER; String scope = Constants.DEFAULT_SCOPE; @@ -87,7 +88,7 @@ public class SessionUtil { session = SessionManager.getInstance().getASLSession( httpSession.getId(), username); session.setScope(scope); - */ + } else { session = SessionManager.getInstance().getASLSession( httpSession.getId(), username); diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/column/ReplaceColumnByExpressionSession.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/column/ReplaceColumnByExpressionSession.java index 57141b5..0dcec62 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/column/ReplaceColumnByExpressionSession.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/column/ReplaceColumnByExpressionSession.java @@ -15,34 +15,57 @@ public class ReplaceColumnByExpressionSession implements Serializable{ private static final long serialVersionUID = -3940140817918362233L; protected ColumnData column; - protected C_Expression cexpression; + protected C_Expression cConditionExpression; + protected C_Expression cReplaceExpression; protected String replaceValue; + protected boolean useExpression; public ReplaceColumnByExpressionSession(){ } - public ReplaceColumnByExpressionSession(ColumnData column, C_Expression cexpression, + public ReplaceColumnByExpressionSession(ColumnData column, C_Expression cConditionExpression, String replaceValue){ this.column=column; - this.cexpression=cexpression; + this.cConditionExpression=cConditionExpression; this.replaceValue=replaceValue; + this.useExpression=false; + } + + public ReplaceColumnByExpressionSession(ColumnData column, C_Expression cConditionExpression, + C_Expression cReplaceExpression){ + this.column=column; + this.cConditionExpression=cConditionExpression; + this.cReplaceExpression=cReplaceExpression; + this.useExpression=false; } + public ColumnData getColumn() { return column; } + public void setColumn(ColumnData column) { this.column = column; } - public C_Expression getCexpression() { - return cexpression; + + public C_Expression getcConditionExpression() { + return cConditionExpression; } - public void setCexpression(C_Expression cexpression) { - this.cexpression = cexpression; + + public void setcConditionExpression(C_Expression cConditionExpression) { + this.cConditionExpression = cConditionExpression; } - + + public C_Expression getcReplaceExpression() { + return cReplaceExpression; + } + + public void setcReplaceExpression(C_Expression cReplaceExpression) { + this.cReplaceExpression = cReplaceExpression; + } + public String getReplaceValue() { return replaceValue; } @@ -51,12 +74,23 @@ public class ReplaceColumnByExpressionSession implements Serializable{ this.replaceValue = replaceValue; } + public boolean isUseExpression() { + return useExpression; + } + + public void setUseExpression(boolean useExpression) { + this.useExpression = useExpression; + } + @Override public String toString() { return "ReplaceColumnByExpressionSession [column=" + column - + ", cexpression=" + cexpression + ", replaceValue=" - + replaceValue + "]"; + + ", cConditionExpression=" + cConditionExpression + + ", cReplaceExpression=" + cReplaceExpression + + ", replaceValue=" + replaceValue + ", useExpression=" + + useExpression + "]"; } + } diff --git a/src/test/java/org/gcube/portlets/user/td/gwtservice/client/TestServiceTable.java b/src/test/java/org/gcube/portlets/user/td/gwtservice/client/TestServiceTable.java index a5f3ce9..6cc5746 100644 --- a/src/test/java/org/gcube/portlets/user/td/gwtservice/client/TestServiceTable.java +++ b/src/test/java/org/gcube/portlets/user/td/gwtservice/client/TestServiceTable.java @@ -21,8 +21,8 @@ import org.junit.Test; * */ public class TestServiceTable { - private final static long trId = 264; - private final static long searchTableId=693; + private final static long trId = 157; + private final static long searchTableId=1951; private String user=Constants.DEFAULT_USER; private String scope=Constants.DEFAULT_SCOPE;