diff --git a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleActiveOnColumnPanel.java b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleActiveOnColumnPanel.java index c075772..f36a1d2 100644 --- a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleActiveOnColumnPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleActiveOnColumnPanel.java @@ -67,9 +67,10 @@ public class RuleActiveOnColumnPanel extends FramedPanel { private ArrayList 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> 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 creationDateCol = new ColumnConfig( - propsRules.creationDate(), 50, "Creation Date"); + propsRules.creationDate(), 56, "Creation Date"); creationDateCol.setCell(new AbstractCell() { diff --git a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleActiveOnTablePanel.java b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleActiveOnTablePanel.java index 6f9f254..15d6659 100644 --- a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleActiveOnTablePanel.java +++ b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleActiveOnTablePanel.java @@ -60,8 +60,10 @@ public class RuleActiveOnTablePanel extends FramedPanel { private TRId trId; private AppliedRulesResponseData appliedRuleResponseData; + + private Grid gridAppliedRules; + private ListStore 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 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 creationDateCol = new ColumnConfig( - propsRules.creationDate(), 50, "Creation Date"); + propsRules.creationDate(), 56, "Creation Date"); creationDateCol.setCell(new AbstractCell() { @@ -165,15 +167,15 @@ public class RuleActiveOnTablePanel extends FramedPanel { propsRules.description()); // Applies Rules - ListStore appliedRulesStore = new ListStore( + storeAppliedRules = new ListStore( propsRules.id()); - appliedRulesStore.addAll(appliedTableRules); + storeAppliedRules.addAll(appliedTableRules); - final Grid gridAppliedRules = new Grid( - appliedRulesStore, cm); + gridAppliedRules = new Grid( + 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; } diff --git a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleDeletePanel.java b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleDeletePanel.java index c12a3cb..33bbc97 100644 --- a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleDeletePanel.java +++ b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleDeletePanel.java @@ -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 creationDateCol = new ColumnConfig( - props.creationDate(), 50, "Creation Date"); + props.creationDate(), 56, "Creation Date"); creationDateCol.setCell(new AbstractCell() { @@ -316,7 +315,7 @@ public class RuleDeletePanel extends FramedPanel { protected void loadData(ListLoadConfig loadConfig, final AsyncCallback> callback) { - ExpressionServiceAsync.INSTANCE.getRules(RuleScopeType.COLUMN, + ExpressionServiceAsync.INSTANCE.getRules( new AsyncCallback>() { @Override diff --git a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleApplyDialog.java b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOnColumnApplyDialog.java similarity index 95% rename from src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleApplyDialog.java rename to src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOnColumnApplyDialog.java index 86d2b21..a5c9813 100644 --- a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleApplyDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOnColumnApplyDialog.java @@ -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 * */ -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); } diff --git a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleApplyPanel.java b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOnColumnApplyPanel.java similarity index 98% rename from src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleApplyPanel.java rename to src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOnColumnApplyPanel.java index 4e2edda..e44ea16 100644 --- a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleApplyPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOnColumnApplyPanel.java @@ -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 * */ -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 = "

Tip.: Use drag and drop in order to change selected rules.

"; 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 columns; private ColumnData column; @@ -98,12 +98,12 @@ public class RuleApplyPanel extends FramedPanel { private ListStore selectedRulesStore; private Grid 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(); - Log.debug("RuleApplyPanel"); + Log.debug("RuleOnColumnApplyPanel"); setWidth(WIDTH); setHeight(HEIGHT); setHeaderVisible(false); @@ -237,7 +237,7 @@ public class RuleApplyPanel extends FramedPanel { }); ColumnConfig creationDateCol = new ColumnConfig( - propsRules.creationDate(), 50, "Creation Date"); + propsRules.creationDate(), 56, "Creation Date"); creationDateCol.setCell(new AbstractCell() { diff --git a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOpenPanel.java b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOpenPanel.java index f861368..86bc6a3 100644 --- a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOpenPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleOpenPanel.java @@ -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 creationDateCol = new ColumnConfig( - props.creationDate(), 50, "Creation Date"); + props.creationDate(), 56, "Creation Date"); creationDateCol.setCell(new AbstractCell() { @@ -321,7 +320,7 @@ public class RuleOpenPanel extends FramedPanel { protected void loadData(ListLoadConfig loadConfig, final AsyncCallback> callback) { - ExpressionServiceAsync.INSTANCE.getRules(RuleScopeType.COLUMN, + ExpressionServiceAsync.INSTANCE.getRules( new AsyncCallback>() { @Override diff --git a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleSharePanel.java b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleSharePanel.java index fb074dd..f72ed29 100644 --- a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleSharePanel.java +++ b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/RuleSharePanel.java @@ -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 creationDateCol = new ColumnConfig( - props.creationDate(), 50, "Creation Date"); + props.creationDate(), 56, "Creation Date"); creationDateCol.setCell(new AbstractCell() { @@ -323,7 +322,7 @@ public class RuleSharePanel extends FramedPanel { protected void loadData(ListLoadConfig loadConfig, final AsyncCallback> callback) { - ExpressionServiceAsync.INSTANCE.getRules(RuleScopeType.COLUMN, + ExpressionServiceAsync.INSTANCE.getRules( new AsyncCallback>() { @Override diff --git a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/multicolumn/RuleOnTableApplyMapColumnCard.java b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/multicolumn/RuleOnTableApplyMapColumnCard.java index be42079..d36e55d 100644 --- a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/multicolumn/RuleOnTableApplyMapColumnCard.java +++ b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/multicolumn/RuleOnTableApplyMapColumnCard.java @@ -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 placeHolderToColumnMap=new HashMap(); + for(MapPlaceHolderToColumnRow m: store.getAll()){ + placeHolderToColumnMap.put(m.getRuleColumnPlaceHolderDescriptor().getId(), + m.getColumn().getColumnId()); + } + + applyTableRuleSession.setPlaceHolderToColumnMap(placeHolderToColumnMap); goNext(); } diff --git a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/multicolumn/RuleOnTableApplySelectRuleCard.java b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/multicolumn/RuleOnTableApplySelectRuleCard.java index b770afb..84cb1f2 100644 --- a/src/main/java/org/gcube/portlets/user/td/rulewidget/client/multicolumn/RuleOnTableApplySelectRuleCard.java +++ b/src/main/java/org/gcube/portlets/user/td/rulewidget/client/multicolumn/RuleOnTableApplySelectRuleCard.java @@ -178,7 +178,7 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard { }); ColumnConfig creationDateCol = new ColumnConfig( - props.creationDate(), 50, "Creation Date"); + props.creationDate(), 56, "Creation Date"); creationDateCol.setCell(new AbstractCell() {