81: TDM - Allow the creation and use of expressions on multi column in TDM portlet
Task-Url: https://support.d4science.org/issues/81 Updated Rules On Table git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-rule-widget@115309 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
40412cd2e2
commit
801f78e551
|
@ -67,9 +67,10 @@ public class RuleActiveOnColumnPanel extends FramedPanel {
|
|||
private ArrayList<ColumnData> columns;
|
||||
|
||||
private AppliedRulesResponseData appliedRuleResponseData;
|
||||
|
||||
private VerticalLayoutContainer mainLayoutContainer;
|
||||
|
||||
|
||||
|
||||
public RuleActiveOnColumnPanel(TRId trId, EventBus eventBus) {
|
||||
super();
|
||||
this.trId = trId;
|
||||
|
@ -132,11 +133,11 @@ public class RuleActiveOnColumnPanel extends FramedPanel {
|
|||
protected void create() {
|
||||
Log.debug("Create RuleActiveOnColumnPanel(): " + trId);
|
||||
|
||||
VerticalLayoutContainer columnRulesFieldSetLayout = new VerticalLayoutContainer();
|
||||
columnRulesFieldSetLayout.setScrollMode(ScrollMode.AUTO);
|
||||
columnRulesFieldSetLayout.setAdjustForScroll(true);
|
||||
mainLayoutContainer = new VerticalLayoutContainer();
|
||||
mainLayoutContainer.setScrollMode(ScrollMode.AUTO);
|
||||
mainLayoutContainer.setAdjustForScroll(true);
|
||||
|
||||
add(columnRulesFieldSetLayout);
|
||||
add(mainLayoutContainer);
|
||||
|
||||
HashMap<String, ArrayList<RuleDescriptionData>> columnRuleMapping = appliedRuleResponseData
|
||||
.getColumnRuleMapping();
|
||||
|
@ -148,7 +149,7 @@ public class RuleActiveOnColumnPanel extends FramedPanel {
|
|||
if (columnAppliedRules != null && columnAppliedRules.size() > 0) {
|
||||
FieldLabel columnLabel = createColumnRules(column,
|
||||
columnAppliedRules);
|
||||
columnRulesFieldSetLayout.add(columnLabel,
|
||||
mainLayoutContainer.add(columnLabel,
|
||||
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
}
|
||||
}
|
||||
|
@ -156,7 +157,7 @@ public class RuleActiveOnColumnPanel extends FramedPanel {
|
|||
FieldLabel noRulesLabel = new FieldLabel(null, "No rules on column applied!");
|
||||
noRulesLabel.setLabelSeparator("");
|
||||
noRulesLabel.setLabelWidth(200);
|
||||
columnRulesFieldSetLayout.add(noRulesLabel, new VerticalLayoutData(
|
||||
mainLayoutContainer.add(noRulesLabel, new VerticalLayoutData(
|
||||
1, -1, new Margins(0)));
|
||||
|
||||
}
|
||||
|
@ -210,7 +211,7 @@ public class RuleActiveOnColumnPanel extends FramedPanel {
|
|||
});
|
||||
|
||||
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
|
||||
propsRules.creationDate(), 50, "Creation Date");
|
||||
propsRules.creationDate(), 56, "Creation Date");
|
||||
|
||||
creationDateCol.setCell(new AbstractCell<String>() {
|
||||
|
||||
|
|
|
@ -60,8 +60,10 @@ public class RuleActiveOnTablePanel extends FramedPanel {
|
|||
private TRId trId;
|
||||
|
||||
private AppliedRulesResponseData appliedRuleResponseData;
|
||||
|
||||
private Grid<RuleDescriptionData> gridAppliedRules;
|
||||
private ListStore<RuleDescriptionData> storeAppliedRules;
|
||||
private VerticalLayoutContainer mainLayoutContainer;
|
||||
|
||||
public RuleActiveOnTablePanel(TRId trId, EventBus eventBus) {
|
||||
super();
|
||||
this.trId = trId;
|
||||
|
@ -79,9 +81,9 @@ public class RuleActiveOnTablePanel extends FramedPanel {
|
|||
protected void create() {
|
||||
Log.debug("Create RuleActiveOnTablePanel(): " + trId);
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
v.setScrollMode(ScrollMode.AUTO);
|
||||
v.setAdjustForScroll(true);
|
||||
mainLayoutContainer = new VerticalLayoutContainer();
|
||||
mainLayoutContainer.setScrollMode(ScrollMode.AUTO);
|
||||
mainLayoutContainer.setAdjustForScroll(true);
|
||||
|
||||
|
||||
ArrayList<RuleDescriptionData> appliedTableRules=appliedRuleResponseData.getTableRules();
|
||||
|
@ -89,9 +91,9 @@ public class RuleActiveOnTablePanel extends FramedPanel {
|
|||
FieldLabel noRulesLabel = new FieldLabel(null, "No rules on table applied!");
|
||||
noRulesLabel.setLabelSeparator("");
|
||||
noRulesLabel.setLabelWidth(200);
|
||||
v.add(noRulesLabel, new VerticalLayoutData(
|
||||
mainLayoutContainer.add(noRulesLabel, new VerticalLayoutData(
|
||||
1, -1, new Margins(0)));
|
||||
add(v);
|
||||
add(mainLayoutContainer);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -138,7 +140,7 @@ public class RuleActiveOnTablePanel extends FramedPanel {
|
|||
});
|
||||
|
||||
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
|
||||
propsRules.creationDate(), 50, "Creation Date");
|
||||
propsRules.creationDate(), 56, "Creation Date");
|
||||
|
||||
creationDateCol.setCell(new AbstractCell<String>() {
|
||||
|
||||
|
@ -165,15 +167,15 @@ public class RuleActiveOnTablePanel extends FramedPanel {
|
|||
propsRules.description());
|
||||
|
||||
// Applies Rules
|
||||
ListStore<RuleDescriptionData> appliedRulesStore = new ListStore<RuleDescriptionData>(
|
||||
storeAppliedRules = new ListStore<RuleDescriptionData>(
|
||||
propsRules.id());
|
||||
|
||||
|
||||
appliedRulesStore.addAll(appliedTableRules);
|
||||
storeAppliedRules.addAll(appliedTableRules);
|
||||
|
||||
|
||||
final Grid<RuleDescriptionData> gridAppliedRules = new Grid<RuleDescriptionData>(
|
||||
appliedRulesStore, cm);
|
||||
gridAppliedRules = new Grid<RuleDescriptionData>(
|
||||
storeAppliedRules, cm);
|
||||
//gridAppliedRules.setHeight(RULES_GRID_HEIGHT);
|
||||
gridAppliedRules.getView().setStripeRows(true);
|
||||
gridAppliedRules.getView().setColumnLines(true);
|
||||
|
@ -192,9 +194,9 @@ public class RuleActiveOnTablePanel extends FramedPanel {
|
|||
|
||||
createContextMenu(gridAppliedRules);
|
||||
|
||||
v.add(gridAppliedRules, new VerticalLayoutData(
|
||||
mainLayoutContainer.add(gridAppliedRules, new VerticalLayoutData(
|
||||
1, 1, new Margins(0)));
|
||||
add(v);
|
||||
add(mainLayoutContainer);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData;
|
||||
import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
|
@ -166,7 +165,7 @@ public class RuleDeletePanel extends FramedPanel {
|
|||
});
|
||||
|
||||
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
|
||||
props.creationDate(), 50, "Creation Date");
|
||||
props.creationDate(), 56, "Creation Date");
|
||||
|
||||
creationDateCol.setCell(new AbstractCell<String>() {
|
||||
|
||||
|
@ -316,7 +315,7 @@ public class RuleDeletePanel extends FramedPanel {
|
|||
protected void loadData(ListLoadConfig loadConfig,
|
||||
final AsyncCallback<ListLoadResult<RuleDescriptionData>> callback) {
|
||||
|
||||
ExpressionServiceAsync.INSTANCE.getRules(RuleScopeType.COLUMN,
|
||||
ExpressionServiceAsync.INSTANCE.getRules(
|
||||
new AsyncCallback<ArrayList<RuleDescriptionData>>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -31,17 +31,17 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
|||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class RuleApplyDialog extends Window implements
|
||||
public class RuleOnColumnApplyDialog extends Window implements
|
||||
MonitorDialogListener {
|
||||
private static final String WIDTH = "770px";
|
||||
private static final String WIDTH = "780px";
|
||||
private static final String HEIGHT = "530px";
|
||||
private EventBus eventBus;
|
||||
|
||||
public RuleApplyDialog(TRId trId, EventBus eventBus) {
|
||||
public RuleOnColumnApplyDialog(TRId trId, EventBus eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
initWindow();
|
||||
|
||||
RuleApplyPanel ruleApplyPanel = new RuleApplyPanel(this,
|
||||
RuleOnColumnApplyPanel ruleApplyPanel = new RuleOnColumnApplyPanel(this,
|
||||
trId, eventBus);
|
||||
add(ruleApplyPanel);
|
||||
}
|
|
@ -68,8 +68,8 @@ import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
|||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class RuleApplyPanel extends FramedPanel {
|
||||
private static final String WIDTH = "760px";
|
||||
public class RuleOnColumnApplyPanel extends FramedPanel {
|
||||
private static final String WIDTH = "770px";
|
||||
private static final String HEIGHT = "520px";
|
||||
private static final String RULE_TIP = "<p>Tip.: Use drag and drop in order to change selected rules.</p>";
|
||||
private static final String RULES_GRID_HEIGHT = "184px";
|
||||
|
@ -81,7 +81,7 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
private EventBus eventBus;
|
||||
private RuleApplyDialog parent;
|
||||
private RuleOnColumnApplyDialog parent;
|
||||
private TRId trId;
|
||||
private ArrayList<ColumnData> columns;
|
||||
private ColumnData column;
|
||||
|
@ -98,12 +98,12 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
private ListStore<RuleDescriptionData> selectedRulesStore;
|
||||
private Grid<RuleDescriptionData> gridSelectedRules;
|
||||
|
||||
public RuleApplyPanel(RuleApplyDialog parent, TRId trId, EventBus eventBus) {
|
||||
public RuleOnColumnApplyPanel(RuleOnColumnApplyDialog parent, TRId trId, EventBus eventBus) {
|
||||
this.parent = parent;
|
||||
this.trId = trId;
|
||||
applicableRules = new ArrayList<RuleDescriptionData>();
|
||||
|
||||
Log.debug("RuleApplyPanel");
|
||||
Log.debug("RuleOnColumnApplyPanel");
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setHeaderVisible(false);
|
||||
|
@ -237,7 +237,7 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
});
|
||||
|
||||
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
|
||||
propsRules.creationDate(), 50, "Creation Date");
|
||||
propsRules.creationDate(), 56, "Creation Date");
|
||||
|
||||
creationDateCol.setCell(new AbstractCell<String>() {
|
||||
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData;
|
||||
import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
|
@ -172,7 +171,7 @@ public class RuleOpenPanel extends FramedPanel {
|
|||
});
|
||||
|
||||
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
|
||||
props.creationDate(), 50, "Creation Date");
|
||||
props.creationDate(), 56, "Creation Date");
|
||||
|
||||
creationDateCol.setCell(new AbstractCell<String>() {
|
||||
|
||||
|
@ -321,7 +320,7 @@ public class RuleOpenPanel extends FramedPanel {
|
|||
protected void loadData(ListLoadConfig loadConfig,
|
||||
final AsyncCallback<ListLoadResult<RuleDescriptionData>> callback) {
|
||||
|
||||
ExpressionServiceAsync.INSTANCE.getRules(RuleScopeType.COLUMN,
|
||||
ExpressionServiceAsync.INSTANCE.getRules(
|
||||
new AsyncCallback<ArrayList<RuleDescriptionData>>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
|||
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
|
||||
import org.gcube.portlets.user.td.expressionwidget.shared.rule.RuleDescriptionDataProperties;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData;
|
||||
import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
|
@ -172,7 +171,7 @@ public class RuleSharePanel extends FramedPanel {
|
|||
});
|
||||
|
||||
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
|
||||
props.creationDate(), 50, "Creation Date");
|
||||
props.creationDate(), 56, "Creation Date");
|
||||
|
||||
creationDateCol.setCell(new AbstractCell<String>() {
|
||||
|
||||
|
@ -323,7 +322,7 @@ public class RuleSharePanel extends FramedPanel {
|
|||
protected void loadData(ListLoadConfig loadConfig,
|
||||
final AsyncCallback<ListLoadResult<RuleDescriptionData>> callback) {
|
||||
|
||||
ExpressionServiceAsync.INSTANCE.getRules(RuleScopeType.COLUMN,
|
||||
ExpressionServiceAsync.INSTANCE.getRules(
|
||||
new AsyncCallback<ArrayList<RuleDescriptionData>>() {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.portlets.user.td.rulewidget.client.multicolumn;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnDataPropertiesCombo;
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
|
||||
|
@ -376,13 +377,21 @@ public class RuleOnTableApplyMapColumnCard extends WizardCard {
|
|||
|
||||
if (store == null || store.size() <= 0) {
|
||||
AlertMessageBox d = new AlertMessageBox("Attention",
|
||||
"Add at least one column");
|
||||
"Error no mapping for this table Rule!");
|
||||
d.addHideHandler(hideHandler);
|
||||
d.setModal(false);
|
||||
d.show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
HashMap<String, String> placeHolderToColumnMap=new HashMap<String,String>();
|
||||
for(MapPlaceHolderToColumnRow m: store.getAll()){
|
||||
placeHolderToColumnMap.put(m.getRuleColumnPlaceHolderDescriptor().getId(),
|
||||
m.getColumn().getColumnId());
|
||||
}
|
||||
|
||||
applyTableRuleSession.setPlaceHolderToColumnMap(placeHolderToColumnMap);
|
||||
goNext();
|
||||
}
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
|
|||
});
|
||||
|
||||
ColumnConfig<RuleDescriptionData, String> creationDateCol = new ColumnConfig<RuleDescriptionData, String>(
|
||||
props.creationDate(), 50, "Creation Date");
|
||||
props.creationDate(), 56, "Creation Date");
|
||||
|
||||
creationDateCol.setCell(new AbstractCell<String>() {
|
||||
|
||||
|
|
Loading…
Reference in New Issue