Updated Rules
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@114237 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c46d685650
commit
55e17e0181
|
@ -58,12 +58,12 @@ public class TabularDataRibbon {
|
||||||
con.add(modifyToolBar.getToolBar(), vldata);
|
con.add(modifyToolBar.getToolBar(), vldata);
|
||||||
ribbon.add(con, msgs.modify());
|
ribbon.add(con, msgs.modify());
|
||||||
|
|
||||||
/*
|
|
||||||
ruleToolBar = new RuleToolBar(eventBus);
|
ruleToolBar = new RuleToolBar(eventBus);
|
||||||
con = new VerticalLayoutContainer();
|
con = new VerticalLayoutContainer();
|
||||||
con.add(ruleToolBar.getToolBar(), vldata);
|
con.add(ruleToolBar.getToolBar(), vldata);
|
||||||
ribbon.add(con, msgs.rule());
|
ribbon.add(con, msgs.rule());
|
||||||
*/
|
|
||||||
|
|
||||||
templateToolBar = new TemplateToolBar(eventBus);
|
templateToolBar = new TemplateToolBar(eventBus);
|
||||||
con = new VerticalLayoutContainer();
|
con = new VerticalLayoutContainer();
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package org.gcube.portlets.user.td.client.rule;
|
package org.gcube.portlets.user.td.client.rule;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
||||||
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.template.TemplateApplySession;
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.RulesOnColumnApplySession;
|
||||||
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,41 +78,45 @@ public class RuleApplyDialog extends Window implements
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void applyTemplate(final TemplateApplySession templateApplySession) {
|
protected void applyRules(RulesOnColumnApplySession ruleOnColumnApplySession) {
|
||||||
|
ExpressionServiceAsync.INSTANCE.startRulesOnColumnApply(ruleOnColumnApplySession, new AsyncCallback<String>() {
|
||||||
|
|
||||||
TDGWTServiceAsync.INSTANCE.startTemplateApply(templateApplySession,
|
@Override
|
||||||
new AsyncCallback<String>() {
|
public void onFailure(Throwable caught) {
|
||||||
public void onFailure(Throwable caught) {
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
if (caught instanceof TDGWTSessionExpiredException) {
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Locked",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Is Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
} else {
|
} else {
|
||||||
if (caught instanceof TDGWTIsLockedException) {
|
Log.debug("Apply Rules On Column Error: "
|
||||||
Log.error(caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error Locked",
|
UtilsGXT3
|
||||||
caught.getLocalizedMessage());
|
.alert("Apply Rules On Column",
|
||||||
} else {
|
|
||||||
if (caught instanceof TDGWTIsFinalException) {
|
|
||||||
Log.error(caught.getLocalizedMessage());
|
|
||||||
UtilsGXT3.alert("Error Is Final",
|
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
} else {
|
|
||||||
Log.debug("Apply Template Error: "
|
|
||||||
+ caught.getLocalizedMessage());
|
|
||||||
UtilsGXT3
|
|
||||||
.alert("Apply Template Error ",
|
|
||||||
"Error in invocation of apply template operation! "+caught.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void onSuccess(String taskId) {
|
@Override
|
||||||
openMonitorDialog(taskId);
|
public void onSuccess(String taskId) {
|
||||||
}
|
openMonitorDialog(taskId);
|
||||||
|
|
||||||
});
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +130,7 @@ public class RuleApplyDialog extends Window implements
|
||||||
public void operationComplete(OperationResult operationResult) {
|
public void operationComplete(OperationResult operationResult) {
|
||||||
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
|
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
|
||||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||||
ChangeTableRequestType.TEMPLATEAPPLY, operationResult.getTrId(), why);
|
ChangeTableRequestType.RULESONCOLUMNAPPLY, operationResult.getTrId(), why);
|
||||||
eventBus.fireEvent(changeTableRequestEvent);
|
eventBus.fireEvent(changeTableRequestEvent);
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
@ -142,7 +146,7 @@ public class RuleApplyDialog extends Window implements
|
||||||
public void operationStopped(OperationResult operationResult, String reason, String details) {
|
public void operationStopped(OperationResult operationResult, String reason, String details) {
|
||||||
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
|
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
|
||||||
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
|
||||||
ChangeTableRequestType.TEMPLATEAPPLY, operationResult.getTrId(), why);
|
ChangeTableRequestType.RULESONCOLUMNAPPLY, operationResult.getTrId(), why);
|
||||||
eventBus.fireEvent(changeTableRequestEvent);
|
eventBus.fireEvent(changeTableRequestEvent);
|
||||||
close();
|
close();
|
||||||
|
|
||||||
|
|
|
@ -4,35 +4,34 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||||
|
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataPropertiesCombo;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionData;
|
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataPropertiesCombo;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleScopeType;
|
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.TDGWTSessionExpiredException;
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateApplySession;
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.RulesOnColumnApplySession;
|
||||||
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;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.gwt.cell.client.TextCell;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.Scheduler;
|
import com.google.gwt.event.logical.shared.SelectionEvent;
|
||||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
import com.google.gwt.event.logical.shared.SelectionHandler;
|
||||||
import com.google.gwt.event.dom.client.KeyUpEvent;
|
|
||||||
import com.google.gwt.event.dom.client.KeyUpHandler;
|
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.web.bindery.event.shared.EventBus;
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||||
import com.sencha.gxt.core.client.IdentityValueProvider;
|
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||||
import com.sencha.gxt.core.client.Style.SelectionMode;
|
|
||||||
import com.sencha.gxt.core.client.resources.ThemeStyles;
|
|
||||||
import com.sencha.gxt.core.client.util.Margins;
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.data.client.loader.RpcProxy;
|
import com.sencha.gxt.data.client.loader.RpcProxy;
|
||||||
|
import com.sencha.gxt.data.shared.LabelProvider;
|
||||||
import com.sencha.gxt.data.shared.ListStore;
|
import com.sencha.gxt.data.shared.ListStore;
|
||||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
|
||||||
import com.sencha.gxt.data.shared.Store;
|
|
||||||
import com.sencha.gxt.data.shared.Store.StoreFilter;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
|
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
|
||||||
|
@ -48,13 +47,13 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
||||||
import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel;
|
import com.sencha.gxt.widget.core.client.form.DualListField;
|
||||||
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
||||||
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
import com.sencha.gxt.widget.core.client.form.DualListField.Mode;
|
||||||
import com.sencha.gxt.widget.core.client.grid.Grid;
|
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||||
import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
|
import com.sencha.gxt.widget.core.client.form.validator.EmptyValidator;
|
||||||
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
import com.sencha.gxt.widget.core.client.info.Info;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -68,14 +67,17 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private RuleApplyDialog parent;
|
private RuleApplyDialog parent;
|
||||||
private TRId trId;
|
private TRId trId;
|
||||||
private TemplateApplySession templateApplySession;
|
private ArrayList<ColumnData> columns;
|
||||||
|
private ColumnData column;
|
||||||
|
|
||||||
private TextButton btnApply;
|
private TextButton btnApply;
|
||||||
private TextButton btnClose;
|
private TextButton btnClose;
|
||||||
|
|
||||||
private ListLoader<ListLoadConfig, ListLoadResult<RuleDescriptionData>> loader;
|
|
||||||
private Grid<RuleDescriptionData> grid;
|
private ComboBox<ColumnData> comboColumns;
|
||||||
private ExtendedListStore<RuleDescriptionData> store;
|
private ListLoader<ListLoadConfig, ListLoadResult<RuleDescriptionData>> availableRulesLoader;
|
||||||
|
private ListLoader<ListLoadConfig, ListLoadResult<RuleDescriptionData>> appliesRulesLoader;
|
||||||
|
private DualListField<RuleDescriptionData, String> rulesDualList;
|
||||||
|
|
||||||
public RuleApplyPanel(RuleApplyDialog parent, TRId trId, EventBus eventBus) {
|
public RuleApplyPanel(RuleApplyDialog parent, TRId trId, EventBus eventBus) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
|
@ -86,126 +88,148 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
setBodyBorder(false);
|
setBodyBorder(false);
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
|
retrieveColumns();
|
||||||
create();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void retrieveColumns() {
|
||||||
|
TDGWTServiceAsync.INSTANCE.getColumns(trId,
|
||||||
|
new AsyncCallback<ArrayList<ColumnData>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Locked",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsFinalException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Final",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.debug("Error retrieving columns: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error retrieving columns",
|
||||||
|
"Error retrieving column on server!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ArrayList<ColumnData> result) {
|
||||||
|
Log.debug("Retrieved Columns");
|
||||||
|
if (result == null) {
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
"The requested columns is null");
|
||||||
|
}
|
||||||
|
columns = result;
|
||||||
|
create();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
protected void create() {
|
protected void create() {
|
||||||
ToolBar toolBarHead = new ToolBar();
|
|
||||||
toolBarHead.add(new LabelToolItem("Search: "));
|
|
||||||
final TextField searchField = new TextField();
|
|
||||||
toolBarHead.add(searchField);
|
|
||||||
|
|
||||||
TextButton btnReload = new TextButton();
|
Log.debug("Create RuleApplyPanel(): " + trId);
|
||||||
// btnReload.setText("Reload");
|
|
||||||
btnReload.setIcon(TabularDataResources.INSTANCE.refresh());
|
|
||||||
btnReload.setToolTip("Reload");
|
|
||||||
toolBarHead.add(btnReload);
|
|
||||||
|
|
||||||
IdentityValueProvider<RuleDescriptionData> identity = new IdentityValueProvider<RuleDescriptionData>();
|
|
||||||
CheckBoxSelectionModel<RuleDescriptionData> sm = new CheckBoxSelectionModel<RuleDescriptionData>(
|
|
||||||
identity);
|
|
||||||
|
|
||||||
RuleDescriptionDataProperties props = GWT
|
|
||||||
.create(RuleDescriptionDataProperties.class);
|
|
||||||
|
|
||||||
ColumnConfig<RuleDescriptionData, String> nameCol = new ColumnConfig<RuleDescriptionData, String>(
|
|
||||||
props.name(), 120, "Name");
|
|
||||||
|
|
||||||
ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>(
|
|
||||||
props.description(), 120, "Description");
|
|
||||||
|
|
||||||
ColumnConfig<RuleDescriptionData, String> readableExpressionCol = new ColumnConfig<RuleDescriptionData, String>(
|
|
||||||
props.readableExpression(), 230, "Expression");
|
|
||||||
|
|
||||||
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
|
|
||||||
l.add(nameCol);
|
|
||||||
l.add(descriptionCol);
|
|
||||||
l.add(readableExpressionCol);
|
|
||||||
|
|
||||||
ColumnModel<RuleDescriptionData> cm = new ColumnModel<RuleDescriptionData>(
|
FieldSet configurationFieldSet = new FieldSet();
|
||||||
l);
|
configurationFieldSet.setHeadingText("Configuration");
|
||||||
|
configurationFieldSet.setCollapsible(false);
|
||||||
|
|
||||||
store = new ExtendedListStore<RuleDescriptionData>(props.id());
|
|
||||||
|
VerticalLayoutContainer configurationFieldSetLayout=new VerticalLayoutContainer();
|
||||||
|
configurationFieldSet.add(configurationFieldSetLayout);
|
||||||
|
|
||||||
|
// Column Data
|
||||||
|
ColumnDataPropertiesCombo propsColumnData = GWT
|
||||||
|
.create(ColumnDataPropertiesCombo.class);
|
||||||
|
ListStore<ColumnData> storeCombo = new ListStore<ColumnData>(
|
||||||
|
propsColumnData.id());
|
||||||
|
storeCombo.addAll(columns);
|
||||||
|
|
||||||
searchField.addKeyUpHandler(new KeyUpHandler() {
|
Log.trace("StoreCombo created");
|
||||||
|
comboColumns = new ComboBox<ColumnData>(storeCombo,
|
||||||
|
propsColumnData.label());
|
||||||
|
|
||||||
public void onKeyUp(KeyUpEvent event) {
|
Log.trace("Combo ColumnData created");
|
||||||
Log.trace("searchTerm: " + searchField.getCurrentValue());
|
|
||||||
store.applyFilters();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
store.addFilter(new StoreFilter<RuleDescriptionData>() {
|
addHandlersForComboColumn(propsColumnData.label());
|
||||||
|
comboColumns.setEmptyText("Select a column...");
|
||||||
|
comboColumns.setWidth(191);
|
||||||
|
comboColumns.setTypeAhead(false);
|
||||||
|
comboColumns.setEditable(false);
|
||||||
|
comboColumns.setTriggerAction(TriggerAction.ALL);
|
||||||
|
|
||||||
@Override
|
FieldLabel comboColumnsLabel = new FieldLabel(comboColumns, "Column");
|
||||||
public boolean select(Store<RuleDescriptionData> store,
|
configurationFieldSetLayout.add(comboColumnsLabel, new VerticalLayoutData(1, -1,
|
||||||
RuleDescriptionData parent, RuleDescriptionData item) {
|
new Margins(0)));
|
||||||
String searchTerm = searchField.getCurrentValue();
|
|
||||||
if (searchTerm == null)
|
// Rules
|
||||||
return true;
|
RuleDescriptionDataPropertiesCombo propsRules = GWT
|
||||||
return RuleApplyPanel.this.select(item, searchTerm);
|
.create(RuleDescriptionDataPropertiesCombo.class);
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
store.setEnableFilters(true);
|
ListStore<RuleDescriptionData> availableRulesStore = new ListStore<RuleDescriptionData>(
|
||||||
|
propsRules.id());
|
||||||
RpcProxy<ListLoadConfig, ListLoadResult<RuleDescriptionData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<RuleDescriptionData>>() {
|
|
||||||
|
RpcProxy<ListLoadConfig, ListLoadResult<RuleDescriptionData>> availableRulesProxy = new RpcProxy<ListLoadConfig, ListLoadResult<RuleDescriptionData>>() {
|
||||||
|
|
||||||
public void load(
|
public void load(
|
||||||
ListLoadConfig loadConfig,
|
ListLoadConfig loadConfig,
|
||||||
final AsyncCallback<ListLoadResult<RuleDescriptionData>> callback) {
|
final AsyncCallback<ListLoadResult<RuleDescriptionData>> callback) {
|
||||||
loadData(loadConfig, callback);
|
loadAvaibleRules(loadConfig, callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
loader = new ListLoader<ListLoadConfig, ListLoadResult<RuleDescriptionData>>(
|
availableRulesLoader = new ListLoader<ListLoadConfig, ListLoadResult<RuleDescriptionData>>(
|
||||||
proxy);
|
availableRulesProxy);
|
||||||
|
|
||||||
loader.setRemoteSort(false);
|
availableRulesLoader.setRemoteSort(false);
|
||||||
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, RuleDescriptionData, ListLoadResult<RuleDescriptionData>>(
|
availableRulesLoader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, RuleDescriptionData, ListLoadResult<RuleDescriptionData>>(
|
||||||
store) {
|
availableRulesStore) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
SelectHandler sh = new SelectHandler() {
|
ListStore<RuleDescriptionData> appliesRulesStore = new ListStore<RuleDescriptionData>(
|
||||||
public void onSelect(SelectEvent event) {
|
propsRules.id());
|
||||||
loader.load();
|
|
||||||
|
RpcProxy<ListLoadConfig, ListLoadResult<RuleDescriptionData>> appliesRulesProxy = new RpcProxy<ListLoadConfig, ListLoadResult<RuleDescriptionData>>() {
|
||||||
|
|
||||||
|
public void load(
|
||||||
|
ListLoadConfig loadConfig,
|
||||||
|
final AsyncCallback<ListLoadResult<RuleDescriptionData>> callback) {
|
||||||
|
loadAppliesRules(loadConfig, callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
appliesRulesLoader = new ListLoader<ListLoadConfig, ListLoadResult<RuleDescriptionData>>(
|
||||||
|
appliesRulesProxy);
|
||||||
|
|
||||||
btnReload.addSelectHandler(sh);
|
appliesRulesLoader.setRemoteSort(false);
|
||||||
|
appliesRulesLoader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, RuleDescriptionData, ListLoadResult<RuleDescriptionData>>(
|
||||||
|
appliesRulesStore) {
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
grid = new Grid<RuleDescriptionData>(store, cm) {
|
rulesDualList = new DualListField<RuleDescriptionData, String>(
|
||||||
@Override
|
availableRulesStore, appliesRulesStore, propsRules.nameProv(), new TextCell());
|
||||||
protected void onAfterFirstAttach() {
|
rulesDualList.addValidator(new EmptyValidator<List<RuleDescriptionData>>());
|
||||||
super.onAfterFirstAttach();
|
rulesDualList.setEnableDnd(true);
|
||||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
rulesDualList.setMode(Mode.INSERT);
|
||||||
|
|
||||||
public void execute() {
|
FieldLabel ruleDualListLabel = new FieldLabel(rulesDualList, "Rules");
|
||||||
loader.load();
|
|
||||||
}
|
configurationFieldSetLayout.add(ruleDualListLabel, new VerticalLayoutData(1, -1,
|
||||||
});
|
new Margins(0)));
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
sm.setSelectionMode(SelectionMode.SINGLE);
|
|
||||||
grid.setLoader(loader);
|
|
||||||
grid.setSelectionModel(sm);
|
|
||||||
grid.setHeight("384px");
|
|
||||||
grid.getView().setStripeRows(true);
|
|
||||||
grid.getView().setColumnLines(true);
|
|
||||||
grid.getView().setAutoFill(true);
|
|
||||||
grid.setBorders(false);
|
|
||||||
grid.setLoadMask(true);
|
|
||||||
grid.setColumnReordering(true);
|
|
||||||
grid.setColumnResize(true);
|
|
||||||
grid.getView().setAutoExpandColumn(descriptionCol);
|
|
||||||
|
|
||||||
ToolBar toolBar = new ToolBar();
|
|
||||||
toolBar.add(grid);
|
|
||||||
toolBar.addStyleName(ThemeStyles.get().style().borderTop());
|
|
||||||
toolBar.getElement().getStyle().setProperty("borderBottom", "none");
|
|
||||||
|
|
||||||
|
// Button
|
||||||
btnApply = new TextButton("Apply");
|
btnApply = new TextButton("Apply");
|
||||||
btnApply.setIcon(TabularDataResources.INSTANCE.ruleApply());
|
btnApply.setIcon(TabularDataResources.INSTANCE.ruleApply());
|
||||||
btnApply.setIconAlign(IconAlign.RIGHT);
|
btnApply.setIconAlign(IconAlign.RIGHT);
|
||||||
|
@ -239,19 +263,41 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
v.add(toolBarHead, new VerticalLayoutData(1, -1, new Margins(0)));
|
v.add(configurationFieldSet, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||||
v.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
|
|
||||||
v.add(toolBar, new VerticalLayoutData(1, 25, new Margins(0)));
|
|
||||||
v.add(flowButton,
|
v.add(flowButton,
|
||||||
new VerticalLayoutData(1, 36, new Margins(5, 2, 5, 2)));
|
new VerticalLayoutData(1, 36, new Margins(5, 2, 5, 2)));
|
||||||
add(v);
|
add(v);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void loadData(ListLoadConfig loadConfig,
|
private void addHandlersForComboColumn(final LabelProvider<ColumnData> labelProvider) {
|
||||||
|
comboColumns.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
||||||
|
public void onSelection(SelectionEvent<ColumnData> event) {
|
||||||
|
Info.display(
|
||||||
|
"Column Selected",
|
||||||
|
"You selected "
|
||||||
|
+ (event.getSelectedItem() == null ? "nothing"
|
||||||
|
: labelProvider.getLabel(event
|
||||||
|
.getSelectedItem()) + "!"));
|
||||||
|
Log.debug("ComboColumn selected: " + event.getSelectedItem());
|
||||||
|
ColumnData columnData = event.getSelectedItem();
|
||||||
|
updateRulesInDualList(columnData);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void updateRulesInDualList(ColumnData columnData) {
|
||||||
|
column=columnData;
|
||||||
|
availableRulesLoader.load();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void loadAvaibleRules(ListLoadConfig loadConfig,
|
||||||
final AsyncCallback<ListLoadResult<RuleDescriptionData>> callback) {
|
final AsyncCallback<ListLoadResult<RuleDescriptionData>> callback) {
|
||||||
|
|
||||||
ExpressionServiceAsync.INSTANCE.getRules(RuleScopeType.COLUMN,
|
ExpressionServiceAsync.INSTANCE.getApplicableBaseColumnRules(column,
|
||||||
new AsyncCallback<ArrayList<RuleDescriptionData>>() {
|
new AsyncCallback<ArrayList<RuleDescriptionData>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -260,10 +306,10 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error("Load rules failure:"
|
Log.error("Error retrieving applicable rules:"
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving rules",
|
UtilsGXT3.alert("Error retrieving rules",
|
||||||
"Error retrieving rules");
|
"Error retrieving applicable rules");
|
||||||
}
|
}
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
|
|
||||||
|
@ -279,21 +325,57 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void loadAppliesRules(ListLoadConfig loadConfig,
|
||||||
|
final AsyncCallback<ListLoadResult<RuleDescriptionData>> callback) {
|
||||||
|
|
||||||
protected RuleDescriptionData getSelectedItem() {
|
ExpressionServiceAsync.INSTANCE.getApplicableBaseColumnRules(column,
|
||||||
return grid.getSelectionModel().getSelectedItem();
|
new AsyncCallback<ArrayList<RuleDescriptionData>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error("Error retrieving applicable rules:"
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error retrieving rules",
|
||||||
|
"Error retrieving applicable rules");
|
||||||
|
}
|
||||||
|
callback.onFailure(caught);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ArrayList<RuleDescriptionData> result) {
|
||||||
|
Log.trace("loaded " + result.size() + " Rules");
|
||||||
|
callback.onSuccess(new ListLoadResultBean<RuleDescriptionData>(
|
||||||
|
result));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected ArrayList<RuleDescriptionData> getSelectedItems() {
|
||||||
|
List<RuleDescriptionData> selectedItems=rulesDualList.getValue();
|
||||||
|
ArrayList<RuleDescriptionData> rulesSelected=new ArrayList<RuleDescriptionData>(selectedItems);
|
||||||
|
return rulesSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void apply() {
|
protected void apply() {
|
||||||
templateApplySession = new TemplateApplySession();
|
ArrayList<RuleDescriptionData> selectedRules = getSelectedItems();
|
||||||
RuleDescriptionData template = getSelectedItem();
|
ColumnData column=comboColumns.getCurrentValue();
|
||||||
if (template == null) {
|
if(column!=null){
|
||||||
UtilsGXT3.info("Attention", "Select the template to apply");
|
RulesOnColumnApplySession rulesOnColumnApplySession=new RulesOnColumnApplySession(trId, column, selectedRules);
|
||||||
|
parent.applyRules(rulesOnColumnApplySession);
|
||||||
} else {
|
} else {
|
||||||
//templateApplySession.setRuleDescriptionData(getSelectedItem());
|
Log.error("No column selected");
|
||||||
templateApplySession.setTrId(trId);
|
UtilsGXT3.alert("Attention",
|
||||||
Log.debug("applyTemplateSession: " + templateApplySession);
|
"Select a column");
|
||||||
parent.applyTemplate(templateApplySession);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,32 +383,6 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
parent.close();
|
parent.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class ExtendedListStore<M> extends ListStore<M> {
|
|
||||||
|
|
||||||
public ExtendedListStore(ModelKeyProvider<? super M> keyProvider) {
|
|
||||||
super(keyProvider);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void applyFilters() {
|
|
||||||
super.applyFilters();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void gridReload() {
|
|
||||||
grid.getLoader().load();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean select(RuleDescriptionData item, String searchTerm) {
|
|
||||||
if (item.getName() != null
|
|
||||||
&& item.getName().toLowerCase()
|
|
||||||
.contains(searchTerm.toLowerCase()))
|
|
||||||
return true;
|
|
||||||
if (item.getDescription() != null
|
|
||||||
&& item.getDescription().toLowerCase()
|
|
||||||
.contains(searchTerm.toLowerCase()))
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
package org.gcube.portlets.user.td.client.rule;
|
package org.gcube.portlets.user.td.client.rule;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
||||||
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.template.TemplateDeleteSession;
|
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;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
|
@ -69,38 +70,34 @@ public class RuleDeleteDialog extends Window {
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void templatesDelete(
|
protected void removeRule(
|
||||||
final TemplateDeleteSession templateDeleteSession) {
|
ArrayList<RuleDescriptionData> rules) {
|
||||||
|
|
||||||
|
|
||||||
TDGWTServiceAsync.INSTANCE.templateDelete(templateDeleteSession,
|
ExpressionServiceAsync.INSTANCE.removeRulesById(rules,
|
||||||
new AsyncCallback<Void>() {
|
new AsyncCallback<Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Void v) {
|
||||||
|
Log.debug("Rule is deleted!");
|
||||||
|
UtilsGXT3.info("Delete Rule", "The rule is deleted!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
if (caught instanceof TDGWTSessionExpiredException) {
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
eventBus.fireEvent(new SessionExpiredEvent(
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
if (caught instanceof TDGWTIsLockedException) {
|
Log.error("Error deleting column rule: "
|
||||||
Log.error(caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error Locked",
|
caught.printStackTrace();
|
||||||
caught.getLocalizedMessage());
|
UtilsGXT3.alert("Error deleting column rule",
|
||||||
} else {
|
caught.getLocalizedMessage());
|
||||||
Log.debug("Delete Template Error: "
|
|
||||||
+ caught.getLocalizedMessage());
|
|
||||||
UtilsGXT3.alert("Apply Template Error ",
|
|
||||||
"Error in invocation of delete template operation! "
|
|
||||||
+ caught.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void onSuccess(Void result) {
|
|
||||||
UtilsGXT3.info("Delete Template", "Template deleted!");
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,10 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionData;
|
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleScopeType;
|
|
||||||
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.template.TemplateDeleteSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType;
|
||||||
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;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
|
@ -70,7 +69,7 @@ public class RuleDeletePanel extends FramedPanel {
|
||||||
|
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private RuleDeleteDialog parent;
|
private RuleDeleteDialog parent;
|
||||||
private TemplateDeleteSession templateDeleteSession;
|
|
||||||
|
|
||||||
private TextButton btnDelete;
|
private TextButton btnDelete;
|
||||||
private TextButton btnClose;
|
private TextButton btnClose;
|
||||||
|
@ -252,7 +251,7 @@ public class RuleDeletePanel extends FramedPanel {
|
||||||
btnDelete = new TextButton("Delete");
|
btnDelete = new TextButton("Delete");
|
||||||
btnDelete.setIcon(TabularDataResources.INSTANCE.ruleDelete());
|
btnDelete.setIcon(TabularDataResources.INSTANCE.ruleDelete());
|
||||||
btnDelete.setIconAlign(IconAlign.RIGHT);
|
btnDelete.setIconAlign(IconAlign.RIGHT);
|
||||||
btnDelete.setToolTip("Delete Template");
|
btnDelete.setToolTip("Delete");
|
||||||
btnDelete.addSelectHandler(new SelectHandler() {
|
btnDelete.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
|
@ -341,23 +340,21 @@ public class RuleDeletePanel extends FramedPanel {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected ArrayList<RuleDescriptionData> getSelectedItem() {
|
protected ArrayList<RuleDescriptionData> getSelectedItem() {
|
||||||
ArrayList<RuleDescriptionData> templates = new ArrayList<RuleDescriptionData>();
|
ArrayList<RuleDescriptionData> rules = new ArrayList<RuleDescriptionData>();
|
||||||
for (RuleDescriptionData template : grid.getSelectionModel()
|
for (RuleDescriptionData rule : grid.getSelectionModel()
|
||||||
.getSelectedItems()) {
|
.getSelectedItems()) {
|
||||||
templates.add(template);
|
rules.add(rule);
|
||||||
}
|
}
|
||||||
return templates;
|
return rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void delete() {
|
protected void delete() {
|
||||||
templateDeleteSession = new TemplateDeleteSession();
|
ArrayList<RuleDescriptionData> rules = getSelectedItem();
|
||||||
ArrayList<RuleDescriptionData> templates = getSelectedItem();
|
if (rules == null || rules.size() == 0) {
|
||||||
if (templates == null || templates.size() == 0) {
|
UtilsGXT3.info("Attention", "Select the rule to be deleted");
|
||||||
UtilsGXT3.info("Attention", "Select the template to be deleted");
|
|
||||||
} else {
|
} else {
|
||||||
// templateDeleteSession.setTemplates(getSelectedItem());
|
Log.debug("Rules Delete: " + rules);
|
||||||
Log.debug("templateDeleteSession: " + templateDeleteSession);
|
parent.removeRule(rules);
|
||||||
parent.templatesDelete(templateDeleteSession);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package org.gcube.portlets.user.td.client.rule;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.client.RuleDialog;
|
import org.gcube.portlets.user.td.expressionwidget.client.RuleDialog;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionData;
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.web.bindery.event.shared.EventBus;
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
|
|
|
@ -5,10 +5,10 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionData;
|
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleScopeType;
|
|
||||||
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.RuleDescriptionData;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType;
|
||||||
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;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
|
|
|
@ -5,10 +5,10 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionData;
|
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleScopeType;
|
|
||||||
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.RuleDescriptionData;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType;
|
||||||
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;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
|
|
Loading…
Reference in New Issue