Updated Rules

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@114364 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-04-23 11:41:49 +00:00
parent 24967d7ab1
commit d2d1d39a6d
2 changed files with 17 additions and 7 deletions

View File

@ -5,7 +5,7 @@ import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceA
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyColumnRulesSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyAndDetachColumnRulesSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog; import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener; import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3; import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
@ -78,8 +78,8 @@ public class RuleApplyDialog extends Window implements
hide(); hide();
} }
protected void applyRules(ApplyColumnRulesSession applyColumnRulesSession) { protected void applyRules(ApplyAndDetachColumnRulesSession applyColumnRulesSession) {
ExpressionServiceAsync.INSTANCE.startApplyColumnRules(applyColumnRulesSession, new AsyncCallback<String>() { ExpressionServiceAsync.INSTANCE.startApplyAndDetachColumnRules(applyColumnRulesSession, new AsyncCallback<String>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
@ -110,7 +110,11 @@ public class RuleApplyDialog extends Window implements
@Override @Override
public void onSuccess(String taskId) { public void onSuccess(String taskId) {
if(taskId!=null){
openMonitorDialog(taskId); openMonitorDialog(taskId);
} else {
close();
}
} }

View File

@ -13,7 +13,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalExcept
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.rule.AppliedRulesResponseData; import org.gcube.portlets.user.td.gwtservice.shared.rule.AppliedRulesResponseData;
import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyColumnRulesSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyAndDetachColumnRulesSession;
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData; import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3; import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
@ -548,7 +548,13 @@ public class RuleApplyPanel extends FramedPanel {
} }
} }
ApplyColumnRulesSession applyColumnRulesSession = new ApplyColumnRulesSession( if(rulesThatWillBeApplied.size()<=0&&rulesThatWillBeDetach.size()<=0){
Log.error("Select a rule!");
UtilsGXT3.alert("Attention", "Select a rule!");
return;
}
ApplyAndDetachColumnRulesSession applyColumnRulesSession = new ApplyAndDetachColumnRulesSession(
trId, column, rulesThatWillBeApplied, rulesThatWillBeDetach); trId, column, rulesThatWillBeApplied, rulesThatWillBeDetach);
parent.applyRules(applyColumnRulesSession); parent.applyRules(applyColumnRulesSession);