From fbc19f9e7eda2525ff377cb0ac146239b199a37d Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 27 May 2015 16:31:06 +0000 Subject: [PATCH] 81: Allow the creation and use of expressions on multi column in TDM portlet Task-Url: https://support.d4science.org/issues/81 Updated apply rule on table git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@115075 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../properties/ColumnDataProperties.java | 25 +++++++++++++++++++ .../client/rpc/ExpressionService.java | 5 ++++ .../client/rpc/ExpressionServiceAsync.java | 7 ++++++ .../server/ExpressionServiceImpl.java | 22 ++++++++++++++++ .../rule/RuleDescriptionDataProperties.java | 2 ++ 5 files changed, 61 insertions(+) create mode 100644 src/main/java/org/gcube/portlets/user/td/expressionwidget/client/properties/ColumnDataProperties.java diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/properties/ColumnDataProperties.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/properties/ColumnDataProperties.java new file mode 100644 index 0000000..c8b3a08 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/properties/ColumnDataProperties.java @@ -0,0 +1,25 @@ +package org.gcube.portlets.user.td.expressionwidget.client.properties; + +import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData; + +import com.google.gwt.editor.client.Editor.Path; +import com.sencha.gxt.core.client.ValueProvider; +import com.sencha.gxt.data.shared.ModelKeyProvider; +import com.sencha.gxt.data.shared.PropertyAccess; + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public interface ColumnDataProperties extends + PropertyAccess { + + @Path("id") + ModelKeyProvider id(); + + ValueProvider label(); + + +} diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/rpc/ExpressionService.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/rpc/ExpressionService.java index 0be4c33..7782206 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/rpc/ExpressionService.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/rpc/ExpressionService.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException; import org.gcube.portlets.user.td.gwtservice.shared.rule.AppliedRulesResponseData; +import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyTableRuleSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.DetachColumnRulesSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType; import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyAndDetachColumnRulesSession; @@ -77,6 +78,10 @@ public interface ExpressionService extends RemoteService { public void setDetachColumnRules(DetachColumnRulesSession detachColumnRulesSession) throws TDGWTServiceException; + public String startApplyTableRule(ApplyTableRuleSession applyTableRuleSession) + throws TDGWTServiceException; + + public AppliedRulesResponseData getActiveRulesByTabularResourceId(TRId trId) throws TDGWTServiceException; diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/rpc/ExpressionServiceAsync.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/rpc/ExpressionServiceAsync.java index 005c13d..5953fcd 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/rpc/ExpressionServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/client/rpc/ExpressionServiceAsync.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import org.gcube.portlets.user.td.gwtservice.shared.rule.AppliedRulesResponseData; import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyAndDetachColumnRulesSession; +import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyTableRuleSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.DetachColumnRulesSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType; import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData; @@ -67,6 +68,12 @@ public interface ExpressionServiceAsync { DetachColumnRulesSession detachColumnRulesSession, AsyncCallback callback); + void startApplyTableRule( + ApplyTableRuleSession applyTableRuleSession, + AsyncCallback callback); + + + void getActiveRulesByTabularResourceId(TRId trId, AsyncCallback callback); diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionServiceImpl.java index a732390..d99e972 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/ExpressionServiceImpl.java @@ -31,6 +31,7 @@ import org.gcube.portlets.user.td.gwtservice.server.trservice.ColumnDataTypeMap; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException; import org.gcube.portlets.user.td.gwtservice.shared.rule.AppliedRulesResponseData; import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyAndDetachColumnRulesSession; +import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyTableRuleSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.DetachColumnRulesSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType; import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData; @@ -629,6 +630,27 @@ public class ExpressionServiceImpl extends TDGWTServiceImpl implements } } + + + @Override + public String startApplyTableRule( + ApplyTableRuleSession applyTableRuleSession) + throws TDGWTServiceException { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + String taskId = startApplyTableRule( + applyTableRuleSession, session); + return taskId; + + } catch (TDGWTServiceException e) { + throw e; + } catch (Throwable e) { + e.printStackTrace(); + throw new TDGWTServiceException(e.getLocalizedMessage()); + } + + } + /** * diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataProperties.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataProperties.java index c4bed34..fcb90a8 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataProperties.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataProperties.java @@ -22,6 +22,8 @@ public interface RuleDescriptionDataProperties extends ValueProvider name(); ValueProvider scopeLabel(); + + ValueProvider creationDate(); ValueProvider description();