915: TDM - Support the Spanish language

Task-Url: https://support.d4science.org/issues/915

Updated Spanish Support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-rule-widget@119885 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-10-20 11:11:54 +00:00 committed by Giancarlo Panichi
parent 7178883fed
commit db1befc86c
16 changed files with 426 additions and 102 deletions

View File

@ -15,6 +15,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDRuleTableType;
import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDRuleType; import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDRuleType;
import org.gcube.portlets.user.td.rulewidget.client.multicolumn.data.MapPlaceHolderToColumnRow; import org.gcube.portlets.user.td.rulewidget.client.multicolumn.data.MapPlaceHolderToColumnRow;
import org.gcube.portlets.user.td.rulewidget.client.multicolumn.data.MapPlaceHolderToColumnRowProperties; import org.gcube.portlets.user.td.rulewidget.client.multicolumn.data.MapPlaceHolderToColumnRowProperties;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
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.tr.column.ColumnData; import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
@ -62,7 +63,9 @@ import com.sencha.gxt.widget.core.client.grid.editing.GridRowEditing;
* *
*/ */
public class RuleOnTableApplyMapColumnCard extends WizardCard { public class RuleOnTableApplyMapColumnCard extends WizardCard {
private static RuleOnTableApplyMessages msgs=GWT.create(RuleOnTableApplyMessages.class);
private CommonMessages msgsCommon;
private RuleOnTableApplyMapColumnCard thisCard; private RuleOnTableApplyMapColumnCard thisCard;
private ApplyTableRuleSession applyTableRuleSession; private ApplyTableRuleSession applyTableRuleSession;
private Grid<MapPlaceHolderToColumnRow> grid; private Grid<MapPlaceHolderToColumnRow> grid;
@ -70,16 +73,21 @@ public class RuleOnTableApplyMapColumnCard extends WizardCard {
private ArrayList<MapPlaceHolderToColumnRow> rows; private ArrayList<MapPlaceHolderToColumnRow> rows;
private ArrayList<ColumnData> columns; private ArrayList<ColumnData> columns;
private ListStore<ColumnData> storeComboColumnData; private ListStore<ColumnData> storeComboColumnData;
public RuleOnTableApplyMapColumnCard( public RuleOnTableApplyMapColumnCard(
ApplyTableRuleSession applyTableRuleSession) { ApplyTableRuleSession applyTableRuleSession) {
super("Map columns", ""); super(msgs.ruleOnTableApplyMapColumnCardHead(), "");
this.thisCard = this; this.thisCard = this;
this.applyTableRuleSession = applyTableRuleSession; this.applyTableRuleSession = applyTableRuleSession;
initMessages();
createData(); createData();
retrieveColumns(); retrieveColumns();
} }
protected void initMessages(){
msgsCommon=GWT.create(CommonMessages.class);
}
protected void createData() { protected void createData() {
RuleDescriptionData ruleDescriptionData = applyTableRuleSession RuleDescriptionData ruleDescriptionData = applyTableRuleSession
@ -109,8 +117,8 @@ public class RuleOnTableApplyMapColumnCard extends WizardCard {
} }
}; };
AlertMessageBox d = new AlertMessageBox("Attention", AlertMessageBox d = new AlertMessageBox(msgsCommon.attention(),
"This is not a rule on table!"); msgs.thisIsNotARuleOnTable());
d.addHideHandler(hideHandler); d.addHideHandler(hideHandler);
d.setModal(false); d.setModal(false);
d.show(); d.show();
@ -134,9 +142,9 @@ public class RuleOnTableApplyMapColumnCard extends WizardCard {
.create(MapPlaceHolderToColumnRowProperties.class); .create(MapPlaceHolderToColumnRowProperties.class);
ColumnConfig<MapPlaceHolderToColumnRow, String> placeHolderCol = new ColumnConfig<MapPlaceHolderToColumnRow, String>( ColumnConfig<MapPlaceHolderToColumnRow, String> placeHolderCol = new ColumnConfig<MapPlaceHolderToColumnRow, String>(
props.placeHolderLabel(), 220, "Place Holder"); props.placeHolderLabel(), 220, msgs.placeHolderCol());
ColumnConfig<MapPlaceHolderToColumnRow, ColumnData> columnCol = new ColumnConfig<MapPlaceHolderToColumnRow, ColumnData>( ColumnConfig<MapPlaceHolderToColumnRow, ColumnData> columnCol = new ColumnConfig<MapPlaceHolderToColumnRow, ColumnData>(
props.column(), 220, "Column"); props.column(), 220, msgs.columnCol());
columnCol.setCell(new AbstractCell<ColumnData>() { columnCol.setCell(new AbstractCell<ColumnData>() {
@ -293,13 +301,13 @@ public class RuleOnTableApplyMapColumnCard extends WizardCard {
} else { } else {
if (caught instanceof TDGWTIsLockedException) { if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage()); Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked", UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage()); caught.getLocalizedMessage());
} else { } else {
Log.error("Error retrieving column: " Log.error("Error retrieving column: "
+ caught.getMessage()); + caught.getMessage());
UtilsGXT3.alert("Error retrieving column", UtilsGXT3.alert(msgs.errorRetrievingColumnsHead(),
caught.getMessage()); caught.getMessage());
} }
} }
@ -376,8 +384,8 @@ public class RuleOnTableApplyMapColumnCard extends WizardCard {
}; };
if (store == null || store.size() <= 0) { if (store == null || store.size() <= 0) {
AlertMessageBox d = new AlertMessageBox("Attention", AlertMessageBox d = new AlertMessageBox(msgsCommon.attention(),
"Error no mapping for this table Rule!"); msgs.errorNoMappingForThisTableRule());
d.addHideHandler(hideHandler); d.addHideHandler(hideHandler);
d.setModal(false); d.setModal(false);
d.show(); d.show();

View File

@ -0,0 +1,76 @@
package org.gcube.portlets.user.td.rulewidget.client.multicolumn;
import com.google.gwt.i18n.client.Messages;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface RuleOnTableApplyMessages extends Messages {
@DefaultMessage("Apply Rule On Table")
String ruleOnTableApplyWizardHead();
@DefaultMessage("Select Rule")
String ruleOnTableApplySelectRuleCardHead();
@DefaultMessage("Name")
String nameCol();
@DefaultMessage("Description")
String descriptionCol();
@DefaultMessage("Owner")
String ownerCol();
@DefaultMessage("Creation Date")
String creationDateCol();
@DefaultMessage("Scope")
String scopeCol();
@DefaultMessage("Error retrieving rules!")
String errorRetrievingRules();
@DefaultMessage("Select a rule!")
String selectARule();
@DefaultMessage("Info")
String infoItemText();
@DefaultMessage("Map columns")
String ruleOnTableApplyMapColumnCardHead();
@DefaultMessage("This is not a rule on table!")
String thisIsNotARuleOnTable();
@DefaultMessage("Place Holder")
String placeHolderCol();
@DefaultMessage("Column")
String columnCol();
@DefaultMessage("Error retrieving columns")
String errorRetrievingColumnsHead();
@DefaultMessage("Error no mapping for this table Rule!")
String errorNoMappingForThisTableRule();
@DefaultMessage("Apply Rule On Table")
String ruleOnTableApplyOperationInProgressCardHead();
@DefaultMessage("Rule Name: ")
String ruleNameLabel();
@DefaultMessage("Rule Description: ")
String ruleDescriptionLabel();
@DefaultMessage("Rule On Table")
String summaryHead();
@DefaultMessage("An error occured in apply rule on table: ")
String errorInApplyRuleOnTable();
}

View File

@ -9,6 +9,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpire
import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyTableRuleSession; import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyTableRuleSession;
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.widgetcommonevent.client.CommonMessages;
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.OperationResult; import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult;
@ -16,6 +17,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
@ -36,15 +38,18 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou
*/ */
public class RuleOnTableApplyOperationInProgressCard extends WizardCard public class RuleOnTableApplyOperationInProgressCard extends WizardCard
implements MonitorDialogListener { implements MonitorDialogListener {
private static RuleOnTableApplyMessages msgs=GWT.create(RuleOnTableApplyMessages.class);
private CommonMessages msgsCommon;
private HtmlLayoutContainer resultField; private HtmlLayoutContainer resultField;
private ApplyTableRuleSession applyTableRuleSession; private ApplyTableRuleSession applyTableRuleSession;
public RuleOnTableApplyOperationInProgressCard( public RuleOnTableApplyOperationInProgressCard(
ApplyTableRuleSession applyTableRuleSession) { ApplyTableRuleSession applyTableRuleSession) {
super("Apply Rule On Table", ""); super(msgs.ruleOnTableApplyOperationInProgressCardHead(), "");
this.applyTableRuleSession = applyTableRuleSession; this.applyTableRuleSession = applyTableRuleSession;
initMessages();
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer(); VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER); operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
@ -56,16 +61,16 @@ public class RuleOnTableApplyOperationInProgressCard extends WizardCard
// display:block;vertical-align:text-top; // display:block;vertical-align:text-top;
description.setHTML(0, 0, description.setHTML(0, 0,
"<span style=\"font-weight:bold;\";>Rule Name: </span>"); "<span style=\"font-weight:bold;\";>"+msgs.ruleNameLabel()+"</span>");
description.setText(0, 1, applyTableRuleSession description.setText(0, 1, applyTableRuleSession
.getRuleDescriptionData().getName()); .getRuleDescriptionData().getName());
description.setHTML(1, 0, description.setHTML(1, 0,
"<span style=\"font-weight:bold;\";>Rule Description: </span>"); "<span style=\"font-weight:bold;\";>"+msgs.ruleDescriptionLabel()+"</span>");
description.setText(1, 1, applyTableRuleSession description.setText(1, 1, applyTableRuleSession
.getRuleDescriptionData().getDescription()); .getRuleDescriptionData().getDescription());
FramedPanel summary = new FramedPanel(); FramedPanel summary = new FramedPanel();
summary.setHeadingText("Rule On Table"); summary.setHeadingText(msgs.summaryHead());
summary.setWidth(400); summary.setWidth(400);
summary.add(description); summary.add(description);
operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20, operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20,
@ -80,6 +85,10 @@ public class RuleOnTableApplyOperationInProgressCard extends WizardCard
resultField.setVisible(false); resultField.setVisible(false);
} }
protected void initMessages(){
msgsCommon=GWT.create(CommonMessages.class);
}
public void applyTableRule() { public void applyTableRule() {
ExpressionServiceAsync.INSTANCE.startApplyTableRule(applyTableRuleSession, ExpressionServiceAsync.INSTANCE.startApplyTableRule(applyTableRuleSession,
@ -99,11 +108,11 @@ public class RuleOnTableApplyOperationInProgressCard extends WizardCard
} else { } else {
if (caught instanceof TDGWTIsLockedException) { if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage()); Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error","Error ", showErrorAndHide(msgsCommon.errorLocked(),msgsCommon.errorLocked(),
caught.getLocalizedMessage(), caught); caught.getLocalizedMessage(), caught);
} else { } else {
showErrorAndHide("Error", showErrorAndHide(msgsCommon.error(),
"An error occured in apply rule on table: ", msgs.errorInApplyRuleOnTable(),
caught.getLocalizedMessage(), caught.getLocalizedMessage(),
caught); caught);
@ -135,7 +144,7 @@ public class RuleOnTableApplyOperationInProgressCard extends WizardCard
final TRId newTrId = operationResult.getTrId(); final TRId newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold; color:#009900;'>Operation Completed</div>"); .appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold; color:#009900;'>"+msgsCommon.operationCompleted()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true); resultField.setVisible(true);
@ -166,7 +175,7 @@ public class RuleOnTableApplyOperationInProgressCard extends WizardCard
public void operationFailed(Throwable caught, String reason, String details) { public void operationFailed(Throwable caught, String reason, String details) {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color:red;'>Operation Failed</div>"); .appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color:red;'>"+msgsCommon.operationFailed()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true); resultField.setVisible(true);
if (caught instanceof TDGWTSessionExpiredException) { if (caught instanceof TDGWTSessionExpiredException) {
@ -175,7 +184,7 @@ public class RuleOnTableApplyOperationInProgressCard extends WizardCard
new SessionExpiredEvent( new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER)); SessionExpiredType.EXPIREDONSERVER));
} else { } else {
showErrorAndHide("Error", showErrorAndHide(msgsCommon.error(),
reason,details,caught); reason,details,caught);
} }
@ -187,7 +196,7 @@ public class RuleOnTableApplyOperationInProgressCard extends WizardCard
final TRId newTrId = operationResult.getTrId(); final TRId newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #FF9900;'>Validation Failed</div>"); .appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #FF9900;'>"+msgsCommon.validationFailed()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true); resultField.setVisible(true);
@ -219,7 +228,7 @@ public class RuleOnTableApplyOperationInProgressCard extends WizardCard
public void operationAborted() { public void operationAborted() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #AA00AA;'>Operation Aborted</div>"); .appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #AA00AA;'>"+msgsCommon.operationAborted()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true); resultField.setVisible(true);
@ -249,7 +258,7 @@ public class RuleOnTableApplyOperationInProgressCard extends WizardCard
public void operationPutInBackground() { public void operationPutInBackground() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #00AAAA;'>Operation in Background</div>"); .appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold;color: #00AAAA;'>"+msgsCommon.operationInBackground()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true); resultField.setVisible(true);

View File

@ -12,6 +12,7 @@ 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.gwtservice.shared.rule.description.RuleDescriptionData;
import org.gcube.portlets.user.td.rulewidget.client.RuleInfoDialog; import org.gcube.portlets.user.td.rulewidget.client.RuleInfoDialog;
import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle; import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
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.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
@ -78,6 +79,8 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
public class RuleOnTableApplySelectRuleCard extends WizardCard { public class RuleOnTableApplySelectRuleCard extends WizardCard {
private static final String GRID_HEIGHT = "334px"; private static final String GRID_HEIGHT = "334px";
private static final DateTimeFormat sdf=DateTimeFormat.getFormat("yyyy-MM-dd HH:mm"); private static final DateTimeFormat sdf=DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");
private static RuleOnTableApplyMessages msgs=GWT.create(RuleOnTableApplyMessages.class);
private CommonMessages msgsCommon;
interface RuleOnTableSelectTemplates extends XTemplates { interface RuleOnTableSelectTemplates extends XTemplates {
@XTemplate("<span title=\"{value}\">{value}</span>") @XTemplate("<span title=\"{value}\">{value}</span>")
@ -91,15 +94,22 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
private ListLoader<ListLoadConfig, ListLoadResult<RuleDescriptionData>> loader; private ListLoader<ListLoadConfig, ListLoadResult<RuleDescriptionData>> loader;
private RuleDescriptionData ruleDescriptionData; private RuleDescriptionData ruleDescriptionData;
public RuleOnTableApplySelectRuleCard(ApplyTableRuleSession applyTableRuleSession) { public RuleOnTableApplySelectRuleCard(ApplyTableRuleSession applyTableRuleSession) {
super("Select Rule", super(msgs.ruleOnTableApplySelectRuleCardHead(),
""); "");
this.thisCard = this; this.thisCard = this;
this.applyTableRuleSession=applyTableRuleSession; this.applyTableRuleSession=applyTableRuleSession;
initMessages();
FormPanel panel = createPanel(); FormPanel panel = createPanel();
setCenterWidget(panel, new MarginData(0)); setCenterWidget(panel, new MarginData(0));
} }
protected void initMessages(){
msgsCommon=GWT.create(CommonMessages.class);
}
protected FormPanel createPanel() { protected FormPanel createPanel() {
FormPanel panel = new FormPanel(); FormPanel panel = new FormPanel();
@ -112,14 +122,14 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
//ToolBarHead //ToolBarHead
ToolBar toolBarHead = new ToolBar(); ToolBar toolBarHead = new ToolBar();
toolBarHead.add(new LabelToolItem("Search: ")); toolBarHead.add(new LabelToolItem(msgsCommon.toolItemSearchLabel()));
final TextField searchField = new TextField(); final TextField searchField = new TextField();
toolBarHead.add(searchField); toolBarHead.add(searchField);
TextButton btnReload = new TextButton(); TextButton btnReload = new TextButton();
// btnReload.setText("Reload"); // btnReload.setText("Reload");
btnReload.setIcon(ResourceBundle.INSTANCE.refresh()); btnReload.setIcon(ResourceBundle.INSTANCE.refresh());
btnReload.setToolTip("Reload"); btnReload.setToolTip(msgsCommon.toolItemReloadLabel());
toolBarHead.add(btnReload); toolBarHead.add(btnReload);
IdentityValueProvider<RuleDescriptionData> identity = new IdentityValueProvider<RuleDescriptionData>(); IdentityValueProvider<RuleDescriptionData> identity = new IdentityValueProvider<RuleDescriptionData>();
@ -130,7 +140,7 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
.create(RuleDescriptionDataProperties.class); .create(RuleDescriptionDataProperties.class);
ColumnConfig<RuleDescriptionData, String> nameCol = new ColumnConfig<RuleDescriptionData, String>( ColumnConfig<RuleDescriptionData, String> nameCol = new ColumnConfig<RuleDescriptionData, String>(
props.name(), 120, "Name"); props.name(), 120, msgs.nameCol());
nameCol.setCell(new AbstractCell<String>() { nameCol.setCell(new AbstractCell<String>() {
@ -143,7 +153,7 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
}); });
ColumnConfig<RuleDescriptionData, String> scopeCol = new ColumnConfig<RuleDescriptionData, String>( ColumnConfig<RuleDescriptionData, String> scopeCol = new ColumnConfig<RuleDescriptionData, String>(
props.scopeLabel(), 40, "Scope"); props.scopeLabel(), 40, msgs.scopeCol());
nameCol.setCell(new AbstractCell<String>() { nameCol.setCell(new AbstractCell<String>() {
@ -157,7 +167,7 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>( ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>(
props.description(), 120, "Description"); props.description(), 120, msgs.descriptionCol());
descriptionCol.setCell(new AbstractCell<String>() { descriptionCol.setCell(new AbstractCell<String>() {
@Override @Override
@ -169,7 +179,7 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
}); });
ColumnConfig<RuleDescriptionData, String> ownerCol = new ColumnConfig<RuleDescriptionData, String>( ColumnConfig<RuleDescriptionData, String> ownerCol = new ColumnConfig<RuleDescriptionData, String>(
props.ownerLogin(), 70, "Owner"); props.ownerLogin(), 70, msgs.ownerCol());
ownerCol.setCell(new AbstractCell<String>() { ownerCol.setCell(new AbstractCell<String>() {
@Override @Override
@ -181,7 +191,7 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
}); });
ColumnConfig<RuleDescriptionData, Date> creationDateCol = new ColumnConfig<RuleDescriptionData, Date>( ColumnConfig<RuleDescriptionData, Date> creationDateCol = new ColumnConfig<RuleDescriptionData, Date>(
props.creationDate(), 56, "Creation Date"); props.creationDate(), 56, msgs.creationDateCol());
creationDateCol.setCell(new DateCell(sdf)); creationDateCol.setCell(new DateCell(sdf));
@ -297,8 +307,8 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
} else { } else {
Log.error("Load rules failure:" Log.error("Load rules failure:"
+ caught.getLocalizedMessage()); + caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving rules", UtilsGXT3.alert(msgsCommon.error(),
"Error retrieving rules"); msgs.errorRetrievingRules());
} }
callback.onFailure(caught); callback.onFailure(caught);
@ -385,8 +395,8 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
tdRuleType); tdRuleType);
*/ */
if (ruleDescriptionData == null) { if (ruleDescriptionData == null) {
AlertMessageBox d = new AlertMessageBox("Attention", AlertMessageBox d = new AlertMessageBox(msgsCommon.attention(),
"Select one rule!"); msgs.selectARule());
d.addHideHandler(hideHandler); d.addHideHandler(hideHandler);
d.setModal(false); d.setModal(false);
d.show(); d.show();
@ -421,7 +431,7 @@ public class RuleOnTableApplySelectRuleCard extends WizardCard {
Menu contextMenu = new Menu(); Menu contextMenu = new Menu();
MenuItem infoItem = new MenuItem(); MenuItem infoItem = new MenuItem();
infoItem.setText("Info"); infoItem.setText(msgs.infoItemText());
infoItem.setIcon(ResourceBundle.INSTANCE.information()); infoItem.setIcon(ResourceBundle.INSTANCE.information());
infoItem.addSelectionHandler(new SelectionHandler<Item>() { infoItem.addSelectionHandler(new SelectionHandler<Item>() {

View File

@ -8,6 +8,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow; import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.shared.GWT;
import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.EventBus;
@ -21,6 +22,7 @@ import com.google.web.bindery.event.shared.EventBus;
public class RuleOnTableApplyWizard extends WizardWindow { public class RuleOnTableApplyWizard extends WizardWindow {
private static final String WIZARDWIDTH = "770px"; private static final String WIZARDWIDTH = "770px";
private static final String WIZARDHEIGHT = "520px"; private static final String WIZARDHEIGHT = "520px";
private static RuleOnTableApplyMessages msgs=GWT.create(RuleOnTableApplyMessages.class);
private TRId trId; private TRId trId;
/** /**
* *
@ -28,7 +30,7 @@ public class RuleOnTableApplyWizard extends WizardWindow {
* @param eventBus * @param eventBus
*/ */
public RuleOnTableApplyWizard(TRId trId, EventBus eventBus) { public RuleOnTableApplyWizard(TRId trId, EventBus eventBus) {
super("Apply Rule On Table",eventBus); super(msgs.ruleOnTableApplyWizardHead(),eventBus);
this.trId=trId; this.trId=trId;
Log.debug("RuleOnTableApplyWizard"); Log.debug("RuleOnTableApplyWizard");
setWidth(WIZARDWIDTH); setWidth(WIZARDWIDTH);

View File

@ -6,6 +6,7 @@ import org.gcube.portlets.user.td.expressionwidget.client.properties.RuleColumnP
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleColumnPlaceHolderDescriptor; import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleColumnPlaceHolderDescriptor;
import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDRuleTableType; import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDRuleTableType;
import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle; import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3; import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
@ -64,6 +65,7 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
*/ */
public class RuleOnTableNewDefinitionCard extends WizardCard { public class RuleOnTableNewDefinitionCard extends WizardCard {
public interface DataTypePropertiesCombo extends public interface DataTypePropertiesCombo extends
PropertyAccess<ColumnDataType> { PropertyAccess<ColumnDataType> {
@ -75,20 +77,30 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
} }
private static int seq; private static int seq;
private static RuleOnTableNewMessages msgs = GWT
.create(RuleOnTableNewMessages.class);
private CommonMessages msgsCommon;
private RuleOnTableNewDefinitionCard thisCard; private RuleOnTableNewDefinitionCard thisCard;
private TDRuleTableType tdRuleTableType; private TDRuleTableType tdRuleTableType;
private Grid<RuleColumnPlaceHolderDescriptor> grid; private Grid<RuleColumnPlaceHolderDescriptor> grid;
private ListStore<RuleColumnPlaceHolderDescriptor> store; private ListStore<RuleColumnPlaceHolderDescriptor> store;
private boolean addStatus; private boolean addStatus;
public RuleOnTableNewDefinitionCard() { public RuleOnTableNewDefinitionCard() {
super("Columns Definition", super(msgs.ruleOnTableNewDefinitionCardHead(),
"N.B. Use drag and drop in order to change the position of the columns"); msgs.ruleOnTableNewDefinitionCardFoot());
this.thisCard = this; this.thisCard = this;
initMessages();
FormPanel panel = createPanel(); FormPanel panel = createPanel();
setCenterWidget(panel, new MarginData(0)); setCenterWidget(panel, new MarginData(0));
} }
protected void initMessages(){
msgsCommon=GWT.create(CommonMessages.class);
}
protected FormPanel createPanel() { protected FormPanel createPanel() {
FormPanel panel = new FormPanel(); FormPanel panel = new FormPanel();
@ -102,14 +114,14 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
RuleColumnPlaceHolderDescriptorProperties props = GWT RuleColumnPlaceHolderDescriptorProperties props = GWT
.create(RuleColumnPlaceHolderDescriptorProperties.class); .create(RuleColumnPlaceHolderDescriptorProperties.class);
ColumnConfig<RuleColumnPlaceHolderDescriptor, String> labelColumn = new ColumnConfig<RuleColumnPlaceHolderDescriptor, String>( ColumnConfig<RuleColumnPlaceHolderDescriptor, String> labelCol = new ColumnConfig<RuleColumnPlaceHolderDescriptor, String>(
props.label(), 220, "Label"); props.label(), 220, msgs.labelCol());
ColumnConfig<RuleColumnPlaceHolderDescriptor, ColumnDataType> columnDataTypeColumn = new ColumnConfig<RuleColumnPlaceHolderDescriptor, ColumnDataType>( ColumnConfig<RuleColumnPlaceHolderDescriptor, ColumnDataType> columnDataTypeCol = new ColumnConfig<RuleColumnPlaceHolderDescriptor, ColumnDataType>(
props.columnDataType(), 130, "Data Type"); props.columnDataType(), 130, msgs.columnDataTypeCol());
ArrayList<ColumnConfig<RuleColumnPlaceHolderDescriptor, ?>> l = new ArrayList<ColumnConfig<RuleColumnPlaceHolderDescriptor, ?>>(); ArrayList<ColumnConfig<RuleColumnPlaceHolderDescriptor, ?>> l = new ArrayList<ColumnConfig<RuleColumnPlaceHolderDescriptor, ?>>();
l.add(labelColumn); l.add(labelCol);
l.add(columnDataTypeColumn); l.add(columnDataTypeCol);
ColumnModel<RuleColumnPlaceHolderDescriptor> columns = new ColumnModel<RuleColumnPlaceHolderDescriptor>( ColumnModel<RuleColumnPlaceHolderDescriptor> columns = new ColumnModel<RuleColumnPlaceHolderDescriptor>(
l); l);
@ -127,7 +139,7 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
grid.setBorders(false); grid.setBorders(false);
grid.setLoadMask(true); grid.setLoadMask(true);
grid.setColumnReordering(false); grid.setColumnReordering(false);
grid.getView().setAutoExpandColumn(labelColumn); grid.getView().setAutoExpandColumn(labelCol);
grid.getView().setSortingEnabled(false); grid.getView().setSortingEnabled(false);
GridDragSource<RuleColumnPlaceHolderDescriptor> ds = new GridDragSource<RuleColumnPlaceHolderDescriptor>( GridDragSource<RuleColumnPlaceHolderDescriptor> ds = new GridDragSource<RuleColumnPlaceHolderDescriptor>(
@ -167,14 +179,14 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
final GridRowEditing<RuleColumnPlaceHolderDescriptor> editing = new GridRowEditing<RuleColumnPlaceHolderDescriptor>( final GridRowEditing<RuleColumnPlaceHolderDescriptor> editing = new GridRowEditing<RuleColumnPlaceHolderDescriptor>(
grid); grid);
editing.addEditor(labelColumn, labelField); editing.addEditor(labelCol, labelField);
editing.addEditor(columnDataTypeColumn, comboColumnDataType); editing.addEditor(columnDataTypeCol, comboColumnDataType);
final TextButton addButton = new TextButton("Add Column"); final TextButton btnAddColumn = new TextButton(msgs.btnAddColumnText());
addButton.setIcon(ResourceBundle.INSTANCE.columnAdd24()); btnAddColumn.setIcon(ResourceBundle.INSTANCE.columnAdd24());
addButton.setIconAlign(IconAlign.TOP); btnAddColumn.setIconAlign(IconAlign.TOP);
addButton.setToolTip("Add Column"); btnAddColumn.setToolTip(msgs.btnAddColumnToolTip());
addButton.addSelectHandler(new SelectHandler() { btnAddColumn.addSelectHandler(new SelectHandler() {
@Override @Override
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
@ -193,8 +205,8 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
} }
}); });
TextButton deleteBtn = new TextButton("Delete"); TextButton btnDelete = new TextButton(msgs.btnDeleteText());
deleteBtn.addSelectHandler(new SelectEvent.SelectHandler() { btnDelete.addSelectHandler(new SelectEvent.SelectHandler() {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
GridCell cell = editing.getActiveCell(); GridCell cell = editing.getActiveCell();
int rowIndex = cell.getRow(); int rowIndex = cell.getRow();
@ -205,7 +217,7 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
store.commitChanges(); store.commitChanges();
editing.getCancelButton().setVisible(true); editing.getCancelButton().setVisible(true);
addButton.setEnabled(true); btnAddColumn.setEnabled(true);
setEnableNextButton(true); setEnableNextButton(true);
if (addStatus) { if (addStatus) {
addStatus = false; addStatus = false;
@ -213,14 +225,14 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
} }
}); });
ButtonBar buttonBar = editing.getButtonBar(); ButtonBar buttonBar = editing.getButtonBar();
buttonBar.add(deleteBtn); buttonBar.add(btnDelete);
editing.addBeforeStartEditHandler(new BeforeStartEditHandler<RuleColumnPlaceHolderDescriptor>() { editing.addBeforeStartEditHandler(new BeforeStartEditHandler<RuleColumnPlaceHolderDescriptor>() {
@Override @Override
public void onBeforeStartEdit( public void onBeforeStartEdit(
BeforeStartEditEvent<RuleColumnPlaceHolderDescriptor> event) { BeforeStartEditEvent<RuleColumnPlaceHolderDescriptor> event) {
addButton.setEnabled(false); btnAddColumn.setEnabled(false);
setEnableNextButton(false); setEnableNextButton(false);
} }
}); });
@ -231,7 +243,7 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
public void onCancelEdit( public void onCancelEdit(
CancelEditEvent<RuleColumnPlaceHolderDescriptor> event) { CancelEditEvent<RuleColumnPlaceHolderDescriptor> event) {
store.rejectChanges(); store.rejectChanges();
addButton.setEnabled(true); btnAddColumn.setEnabled(true);
setEnableNextButton(true); setEnableNextButton(true);
} }
@ -278,14 +290,14 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
store.rejectChanges(); store.rejectChanges();
} }
UtilsGXT3 UtilsGXT3
.alert("Attention", .alert(msgsCommon.attention(),
"This label is already present, please choose another(case insensitive)!"); msgs.labelAlreadyPresent());
} else { } else {
store.commitChanges(); store.commitChanges();
} }
editing.getCancelButton().setVisible(true); editing.getCancelButton().setVisible(true);
addButton.setEnabled(true); btnAddColumn.setEnabled(true);
setEnableNextButton(true); setEnableNextButton(true);
} catch (Throwable e) { } catch (Throwable e) {
@ -298,7 +310,7 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
// //
ToolBar toolBar = new ToolBar(); ToolBar toolBar = new ToolBar();
toolBar.add(addButton); toolBar.add(btnAddColumn);
v.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0))); v.add(toolBar, new VerticalLayoutData(1, -1, new Margins(0)));
v.add(grid, new VerticalLayoutData(1, 1, new Margins(0))); v.add(grid, new VerticalLayoutData(1, 1, new Margins(0)));
@ -352,8 +364,8 @@ public class RuleOnTableNewDefinitionCard extends WizardCard {
}; };
if (store == null || store.size() <= 0) { if (store == null || store.size() <= 0) {
AlertMessageBox d = new AlertMessageBox("Attention", AlertMessageBox d = new AlertMessageBox(msgsCommon.attention(),
"Add at least one column"); msgs.addAtLeastOneColumn());
d.addHideHandler(hideHandler); d.addHideHandler(hideHandler);
d.setModal(false); d.setModal(false);
d.show(); d.show();

View File

@ -7,9 +7,11 @@ import org.gcube.portlets.user.td.expressionwidget.client.exception.MultiColumnE
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType; 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.gwtservice.shared.rule.description.RuleDescriptionData;
import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDRuleTableType; import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDRuleTableType;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Command;
import com.sencha.gxt.core.client.util.Padding; import com.sencha.gxt.core.client.util.Padding;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox; import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
@ -25,20 +27,28 @@ import com.sencha.gxt.widget.core.client.form.FormPanel;
* *
*/ */
public class RuleOnTableNewExpressionCard extends WizardCard { public class RuleOnTableNewExpressionCard extends WizardCard {
private static RuleOnTableNewMessages msgs=GWT.create(RuleOnTableNewMessages.class);
private CommonMessages msgsCommon;
private RuleOnTableNewExpressionCard thisCard; private RuleOnTableNewExpressionCard thisCard;
private TDRuleTableType tdRuleTableType; private TDRuleTableType tdRuleTableType;
private RuleDescriptionData ruleDescriptionData; private RuleDescriptionData ruleDescriptionData;
private MultiColumnExpressionPanel multiColumnExpressionPanel; private MultiColumnExpressionPanel multiColumnExpressionPanel;
public RuleOnTableNewExpressionCard(TDRuleTableType tdRuleTableType) { public RuleOnTableNewExpressionCard(TDRuleTableType tdRuleTableType) {
super("Create Expression", super(msgs.ruleOnTableNewExpressionCardHead(),
""); "");
this.thisCard = this; this.thisCard = this;
this.tdRuleTableType=tdRuleTableType; this.tdRuleTableType=tdRuleTableType;
initMessages();
FormPanel panel = createPanel(); FormPanel panel = createPanel();
setCenterWidget(panel, new MarginData(0)); setCenterWidget(panel, new MarginData(0));
} }
protected void initMessages(){
msgsCommon=GWT.create(CommonMessages.class);
}
protected FormPanel createPanel() { protected FormPanel createPanel() {
FormPanel panel = new FormPanel(); FormPanel panel = new FormPanel();
@ -50,7 +60,7 @@ public class RuleOnTableNewExpressionCard extends WizardCard {
multiColumnExpressionPanel = new MultiColumnExpressionPanel(null, ruleDescriptionData); multiColumnExpressionPanel = new MultiColumnExpressionPanel(null, ruleDescriptionData);
panel.add(multiColumnExpressionPanel); panel.add(multiColumnExpressionPanel);
} catch (Throwable e) { } catch (Throwable e) {
showErrorAndHide("Error", e.getLocalizedMessage(), e.getLocalizedMessage(), e); showErrorAndHide(msgsCommon.error(), e.getLocalizedMessage(), e.getLocalizedMessage(), e);
} }
return panel; return panel;
@ -105,11 +115,11 @@ public class RuleOnTableNewExpressionCard extends WizardCard {
if(multiColumnExpressionPanel!=null){ if(multiColumnExpressionPanel!=null){
ruleDescriptionData = multiColumnExpressionPanel.getRuleOnTable(); ruleDescriptionData = multiColumnExpressionPanel.getRuleOnTable();
} else { } else {
showErrorAndHide("Error","Error creating rule on table!", "", new Exception("Error creating rule on table!")); showErrorAndHide(msgsCommon.error(),msgs.errorCreatingRuleOnTable(), "", new Exception(msgs.errorCreatingRuleOnTable()));
return; return;
} }
} catch (MultiColumnExpressionPanelException e) { } catch (MultiColumnExpressionPanelException e) {
AlertMessageBox d = new AlertMessageBox("Attention", AlertMessageBox d = new AlertMessageBox(msgsCommon.attention(),
e.getLocalizedMessage()); e.getLocalizedMessage());
d.addHideHandler(hideHandler); d.addHideHandler(hideHandler);
d.setModal(false); d.setModal(false);

View File

@ -0,0 +1,71 @@
package org.gcube.portlets.user.td.rulewidget.client.multicolumn;
import com.google.gwt.i18n.client.Messages;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface RuleOnTableNewMessages extends Messages {
@DefaultMessage("New Rule On Table")
String ruleOnTableNewWizardHead();
@DefaultMessage("Columns Definition")
String ruleOnTableNewDefinitionCardHead();
@DefaultMessage("N.B. Use drag and drop in order to change the position of the columns")
String ruleOnTableNewDefinitionCardFoot();
@DefaultMessage("Label")
String labelCol();
@DefaultMessage("Data Type")
String columnDataTypeCol();
@DefaultMessage("Add Column")
String btnAddColumnText();
@DefaultMessage("Add Column")
String btnAddColumnToolTip();
@DefaultMessage("Delete")
String btnDeleteText();
@DefaultMessage("This label is already present, please choose another(case insensitive)!")
String labelAlreadyPresent();
@DefaultMessage("Add at least one column")
String addAtLeastOneColumn();
@DefaultMessage("Create Expression")
String ruleOnTableNewExpressionCardHead();
@DefaultMessage("Error creating rule on table!")
String errorCreatingRuleOnTable();
@DefaultMessage("Save")
String save();
@DefaultMessage("Rule Name: ")
String ruleNameLabel();
@DefaultMessage("Rule Description: ")
String ruleDescriptionLabel();
@DefaultMessage("Rule On Table")
String summaryHead();
@DefaultMessage("Save Rule")
String ruleSavedHead();
@DefaultMessage("The rule is saved!")
String ruleSaved();
@DefaultMessage("Error saving rule on table ")
String errorSavingRuleOnTable();
}

View File

@ -7,12 +7,14 @@ import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceA
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.description.RuleDescriptionData; import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
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.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3; import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder; import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
@ -32,18 +34,20 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou
* *
*/ */
public class RuleOnTableNewOperationInProgressCard extends WizardCard { public class RuleOnTableNewOperationInProgressCard extends WizardCard {
private static RuleOnTableNewMessages msgs = GWT
.create(RuleOnTableNewMessages.class);
protected RuleOnTableNewOperationInProgressCard thisCard; private RuleDescriptionData ruleDescriptionData;
protected RuleDescriptionData ruleDescriptionData; private HtmlLayoutContainer resultField;
protected HtmlLayoutContainer resultField;
private CommonMessages msgsCommon;
public RuleOnTableNewOperationInProgressCard( public RuleOnTableNewOperationInProgressCard(
RuleDescriptionData ruleDescriptionData) { RuleDescriptionData ruleDescriptionData) {
super("Save", ""); super(msgs.save(), "");
this.ruleDescriptionData = ruleDescriptionData; this.ruleDescriptionData = ruleDescriptionData;
thisCard = this; initMessages();
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer(); VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER); operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
@ -55,14 +59,14 @@ public class RuleOnTableNewOperationInProgressCard extends WizardCard {
// display:block;vertical-align:text-top; // display:block;vertical-align:text-top;
description.setHTML(0, 0, description.setHTML(0, 0,
"<span style=\"font-weight:bold;\";>Rule Name: </span>"); "<span style=\"font-weight:bold;\";>"+msgs.ruleNameLabel()+"</span>");
description.setText(0, 1, ruleDescriptionData.getName()); description.setText(0, 1, ruleDescriptionData.getName());
description.setHTML(1, 0, description.setHTML(1, 0,
"<span style=\"font-weight:bold;\";>Rule Description: </span>"); "<span style=\"font-weight:bold;\";>"+msgs.ruleDescriptionLabel()+"</span>");
description.setText(1, 1, ruleDescriptionData.getDescription()); description.setText(1, 1, ruleDescriptionData.getDescription());
FramedPanel summary = new FramedPanel(); FramedPanel summary = new FramedPanel();
summary.setHeadingText("Rule On Table"); summary.setHeadingText(msgs.summaryHead());
summary.setWidth(400); summary.setWidth(400);
summary.add(description); summary.add(description);
operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20, operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20,
@ -77,6 +81,10 @@ public class RuleOnTableNewOperationInProgressCard extends WizardCard {
resultField.setVisible(false); resultField.setVisible(false);
} }
protected void initMessages(){
msgsCommon=GWT.create(CommonMessages.class);
}
public void saveRuleOnTable() { public void saveRuleOnTable() {
ExpressionServiceAsync.INSTANCE.saveRule(ruleDescriptionData, ExpressionServiceAsync.INSTANCE.saveRule(ruleDescriptionData,
@ -87,7 +95,7 @@ public class RuleOnTableNewOperationInProgressCard extends WizardCard {
Log.debug("Saved Rule: " + ruleId); Log.debug("Saved Rule: " + ruleId);
operationComplete(); operationComplete();
UtilsGXT3.info("Save Rule", "The rule is saved!"); UtilsGXT3.info(msgs.ruleSavedHead(), msgs.ruleSaved());
} }
@ -101,12 +109,12 @@ public class RuleOnTableNewOperationInProgressCard extends WizardCard {
} else { } else {
if (caught instanceof TDGWTIsLockedException) { if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage()); Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error", showErrorAndHide(msgsCommon.error(),
"Error saving rule on table", msgs.errorSavingRuleOnTable(),
caught.getLocalizedMessage(), caught); caught.getLocalizedMessage(), caught);
} else { } else {
showErrorAndHide("Error", showErrorAndHide(msgsCommon.error(),
"Error saving rule on table: ", msgs.errorSavingRuleOnTable(),
caught.getLocalizedMessage(), caught); caught.getLocalizedMessage(), caught);
} }
@ -131,7 +139,7 @@ public class RuleOnTableNewOperationInProgressCard extends WizardCard {
public void operationComplete() { public void operationComplete() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder safeHtmlBuilder
.appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold; color:#009900;'>Operation Completed</div>"); .appendHtmlConstant("<div style='text-align:center;font-size:large;font-weight:bold; color:#009900;'>"+msgsCommon.operationCompleted()+"</div>");
resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true); resultField.setVisible(true);

View File

@ -1,46 +1,43 @@
package org.gcube.portlets.user.td.rulewidget.client.multicolumn; package org.gcube.portlets.user.td.rulewidget.client.multicolumn;
import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle; import org.gcube.portlets.user.td.rulewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow; import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.EventBus;
/** /**
* *
* @author giancarlo * @author giancarlo email: <a
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class RuleOnTableNewWizard extends WizardWindow { public class RuleOnTableNewWizard extends WizardWindow {
private static final String WIZARDWIDTH = "950px"; private static final String WIZARDWIDTH = "950px";
private static final String WIZARDHEIGHT = "512px"; private static final String WIZARDHEIGHT = "512px";
private static RuleOnTableNewMessages msgs = GWT
.create(RuleOnTableNewMessages.class);
/** /**
* *
* @param title * @param title
* @param eventBus * @param eventBus
*/ */
public RuleOnTableNewWizard(EventBus eventBus) { public RuleOnTableNewWizard(EventBus eventBus) {
super("New Rule On Table",eventBus); super(msgs.ruleOnTableNewWizardHead(), eventBus);
Log.debug("RuleOnTableNewWizard"); Log.debug("RuleOnTableNewWizard");
setWidth(WIZARDWIDTH); setWidth(WIZARDWIDTH);
setHeight(WIZARDHEIGHT); setHeight(WIZARDHEIGHT);
getHeader().setIcon(ResourceBundle.INSTANCE.ruleTableAdd()); getHeader().setIcon(ResourceBundle.INSTANCE.ruleTableAdd());
create(); create();
} }
private void create() { private void create() {
RuleOnTableNewDefinitionCard createRuleOnTableDefinitionCard=new RuleOnTableNewDefinitionCard(); RuleOnTableNewDefinitionCard createRuleOnTableDefinitionCard = new RuleOnTableNewDefinitionCard();
addCard(createRuleOnTableDefinitionCard); addCard(createRuleOnTableDefinitionCard);
createRuleOnTableDefinitionCard.setup(); createRuleOnTableDefinitionCard.setup();
show(); show();
} }
} }

View File

@ -0,0 +1,21 @@
ruleOnTableApplyWizardHead = Apply Rule On Table
ruleOnTableApplySelectRuleCardHead = Select Rule
nameCol = Name
descriptionCol = Description
ownerCol = Owner
creationDateCol = Creation Date
scopeCol = Scope
errorRetrievingRules = Error retrieving rules!
selectARule = Select a rule!
infoItemText = Info
ruleOnTableApplyMapColumnCardHead = Map columns
thisIsNotARuleOnTable = This is not a rule on table!
placeHolderCol = Place Holder
columnCol = Column
errorRetrievingColumnsHead = Error retrieving columns
errorNoMappingForThisTableRule = Error no mapping for this table Rule!
ruleOnTableApplyOperationInProgressCardHead = Apply Rule On Table
ruleNameLabel = Rule Name:
ruleDescriptionLabel = Rule Description:
summaryHead = Rule On Table
errorInApplyRuleOnTable = An error occured in apply rule on table:

View File

@ -0,0 +1,21 @@
ruleOnTableApplyWizardHead = Aplica Regla en la Tabla
ruleOnTableApplySelectRuleCardHead = Seleccione Regla
nameCol = Nombre
descriptionCol = Descripción
ownerCol = Propietario
creationDateCol = Fecha Creacion
scopeCol = Scope
errorRetrievingRules = Error al recuperar las reglas!
selectARule = Seleccione una regla!
infoItemText = Info
ruleOnTableApplyMapColumnCardHead = Mapa Columnas
thisIsNotARuleOnTable = Esta no es una regla en la tabla!
placeHolderCol = Place Holder
columnCol = Columna
errorRetrievingColumnsHead = Error al recuperar las columnas
errorNoMappingForThisTableRule = Error ningún mapa para esta regla en la tabla!
ruleOnTableApplyOperationInProgressCardHead = Aplica Regla en la Tabla
ruleNameLabel = Nombre Regla:
ruleDescriptionLabel = Descripción Regla:
summaryHead = Regla en la Tabla
errorInApplyRuleOnTable = Error al aplicar la regla en la tabla:

View File

@ -0,0 +1,21 @@
ruleOnTableApplyWizardHead = Applica Regola su Tabella
ruleOnTableApplySelectRuleCardHead = Seleziona Regola
nameCol = Nome
descriptionCol = Descrizione
ownerCol = Proprietario
creationDateCol = Data Creazione
scopeCol = Scope
errorRetrievingRules = Errore recuperando le regole!
selectARule = Seleziona una regola!
infoItemText = Info
ruleOnTableApplyMapColumnCardHead = Mappa Colonne
thisIsNotARuleOnTable = Questa non è una regola su tabella!
placeHolderCol = Place Holder
columnCol = Colonna
errorRetrievingColumnsHead = Errore recuperando le colonne
errorNoMappingForThisTableRule = Errore nessuna mappa per questa regola su tabella!
ruleOnTableApplyOperationInProgressCardHead = Applica Regola su Tabella
ruleNameLabel = Nome Regola:
ruleDescriptionLabel = Descrizione Regola:
summaryHead = Regola su Tabella
errorInApplyRuleOnTable = Errore applicando la regola su tabella:

View File

@ -0,0 +1,20 @@
ruleOnTableNewWizardHead = New Rule On Table
ruleOnTableNewDefinitionCardHead = Columns Definition
ruleOnTableNewDefinitionCardFoot = N.B. Use drag and drop in order to change the position of the columns
labelCol = Label
columnDataTypeCol = Data Type
btnAddColumnText = Add Column
btnAddColumnToolTip = Add Column
btnDeleteText = Delete
labelAlreadyPresent = This label is already present, please choose another(case insensitive)!
addAtLeastOneColumn = Add at least one column
ruleOnTableNewExpressionCardHead = Create Expression
errorCreatingRuleOnTable = Error creating rule on table!
save = Save
ruleNameLabel = Rule Name:
ruleDescriptionLabel = Rule Description:
summaryHead = Rule On Table
ruleSavedHead = Save Rule
ruleSaved = The rule is saved!
errorSavingRuleOnTable = Error saving rule on table

View File

@ -0,0 +1,19 @@
ruleOnTableNewWizardHead = Nueva Regla en la Tabla
ruleOnTableNewDefinitionCardHead = Definición Columna
ruleOnTableNewDefinitionCardFoot = N.B. Use arrastrar y soltar para cambiar la posición de las columnas
labelCol = Etiqueta
columnDataTypeCol = Tipo de Datos
btnAddColumnText = Añadir Columna
btnAddColumnToolTip = Añadir Columna
btnDeleteText = Borrar
labelAlreadyPresent = Esta etiqueta está presente, seleccione otra(case insensitive)!
addAtLeastOneColumn = Añadir al menos una columna
ruleOnTableNewExpressionCardHead = Crear Expresión
errorCreatingRuleOnTable = Error al crear una regla en la tabla!
save = Guardar
ruleNameLabel = Nombre Regla:
ruleDescriptionLabel = Descripción Regla:
summaryHead = Regla en la Tabla
ruleSavedHead = Guardar Regla
ruleSaved = Regla guardada!
errorSavingRuleOnTable = Error al guardar la regla en la tabla

View File

@ -0,0 +1,19 @@
ruleOnTableNewWizardHead = Nuova Regola su Tabella
ruleOnTableNewDefinitionCardHead = Definizione Colonne
ruleOnTableNewDefinitionCardFoot = N.B. Usa drag and drop per modificare la posizione delle colonne
labelCol = Etichetta
columnDataTypeCol = Tipo di Dato
btnAddColumnText = Aggiungi Colonna
btnAddColumnToolTip = Aggiungi Colonna
btnDeleteText = Elimina
labelAlreadyPresent = Questa etichetta è già presente, sceglierne un''altra(case insensitive)!
addAtLeastOneColumn = Aggiungere almento una colonna
ruleOnTableNewExpressionCardHead = Crea Espressione
errorCreatingRuleOnTable = Errore creando una regola su tabella!
save = Salva
ruleNameLabel = Nome Regola:
ruleDescriptionLabel = Descrizione Regola:
summaryHead = Regola su Tabella
ruleSavedHead = Salva Regola
ruleSaved = La regola è salvata!
errorSavingRuleOnTable = Errore salvando la regola su tabella