(
- properties.date(), 50, "Creation Date");
+ properties.date(), 50, msgs.creationDateColumn());
dateColumn.setCell(new DateCell(sdf));
@@ -218,7 +234,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
protected void createContextMenu() {
contextMenu = new Menu();
- MenuItem deleteTRItem = new MenuItem("Delete");
+ MenuItem deleteTRItem = new MenuItem(msgs.itemDelete());
deleteTRItem.setId("DeleteTR");
deleteTRItem
.setIcon(org.gcube.portlets.user.td.unionwizardwidget.client.resources.UnionResourceBundle.INSTANCE
@@ -273,8 +289,9 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
Log.debug("Error retrieving tabular resource: "
+ caught.getLocalizedMessage());
UtilsGXT3
- .alert("Error!",
- "Error retrieving tabular resources on server!");
+ .alert(msgsCommon.error(),
+ msgs.errorRetrievingTabularResources()
+ );
}
callback.onFailure(caught);
}
@@ -313,10 +330,14 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
grid.getLoader().load();
}
+ public void gridDeselectAll(){
+ grid.getSelectionModel().deselectAll();
+ }
+
protected void deleteTR(TabResource tabResource) {
removableTR = tabResource;
- final ConfirmMessageBox mb = new ConfirmMessageBox("Delete",
- "Would you like to delete this tabular resource?");
+ final ConfirmMessageBox mb = new ConfirmMessageBox(msgs.delete(),
+ msgs.woultYouLikeToDeleteThisTabularResource());
/* Next in GXT 3.1.1 */
@@ -369,13 +390,13 @@ public class TabResourcesSelectionPanel extends ContentPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
- UtilsGXT3.alert("Error Locked",
+ UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
Log.error("Error on delete TabResource: "
+ caught.getLocalizedMessage());
- UtilsGXT3.alert("Error",
- "Error on delete TabResource: "
+ UtilsGXT3.alert(msgsCommon.error(),
+ msgs.errorOnDeleteTabularResourceFixed()
+ caught.getLocalizedMessage());
}
}
diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java
index d0104c2..b4bd399 100644
--- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java
+++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java
@@ -10,6 +10,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpire
import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
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.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult;
@@ -17,6 +18,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
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.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -37,18 +39,18 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou
*/
public class UnionOperationInProgressCard extends WizardCard implements
MonitorDialogListener {
-
- protected UnionOperationInProgressCard thisCard;
- protected UnionSession unionSession;
- protected TRId newTrId;
- protected HtmlLayoutContainer resultField;
+ private static CommonMessages msgsCommon=GWT.create(CommonMessages.class);
+ private UnionWizardMessages msgs;
+ private UnionSession unionSession;
+ private TRId newTrId;
+ private HtmlLayoutContainer resultField;
+
public UnionOperationInProgressCard(final UnionSession unionSession) {
- super("Operation In Progress", "");
-
+ super(msgsCommon.operationInProgress(), "");
this.unionSession = unionSession;
- thisCard = this;
-
+ initMessages();
+
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
@@ -58,21 +60,21 @@ public class UnionOperationInProgressCard extends WizardCard implements
description.setBorderWidth(0);
description.setHTML(0, 0,
- "Union with: ");
+ ""+msgs.unionWithFixed()+"");
description.setText(0, 1, unionSession.getUnionTabularResource()
.getName());
description.setHTML(1, 0,
- "Type: ");
+ ""+msgs.typeFixed()+"");
description.setText(1, 1, unionSession.getUnionTabularResource()
.getTableTypeName());
description.setHTML(2, 0,
- "Owner: ");
+ ""+msgs.ownerFixed()+"");
description.setText(2, 1, unionSession.getUnionTabularResource()
.getOwnerLogin());
FramedPanel summary = new FramedPanel();
- summary.setHeadingText("Union Summary");
+ summary.setHeadingText(msgs.summaryUnion());
summary.setWidth(400);
summary.add(description);
operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20,
@@ -87,7 +89,11 @@ public class UnionOperationInProgressCard extends WizardCard implements
resultField.setVisible(false);
}
-
+
+ protected void initMessages(){
+ msgs = GWT.create(UnionWizardMessages.class);
+ }
+
/**
*
*/
@@ -109,18 +115,18 @@ public class UnionOperationInProgressCard extends WizardCard implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
- showErrorAndHide("Error Locked",
+ showErrorAndHide(msgsCommon.errorLocked(),
caught.getLocalizedMessage(), "",
caught);
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
- showErrorAndHide("Error Final",
+ showErrorAndHide(msgsCommon.errorFinal(),
caught.getLocalizedMessage(), "",
caught);
} else {
- showErrorAndHide("Error in Union",
- "An error occured in union.",
+ showErrorAndHide(msgsCommon.error(),
+ msgs.errorInUnionFixed(),
caught.getLocalizedMessage(),
caught);
}
@@ -152,7 +158,7 @@ public class UnionOperationInProgressCard extends WizardCard implements
newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
- .appendHtmlConstant("Operation Completed
");
+ .appendHtmlConstant(""+msgsCommon.operationCompleted()+"
");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
Command sayComplete = new Command() {
@@ -181,7 +187,7 @@ public class UnionOperationInProgressCard extends WizardCard implements
public void operationFailed(Throwable caught, String reason, String details) {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
- .appendHtmlConstant("Operation Failed
");
+ .appendHtmlConstant(""+msgsCommon.operationFailed()+"
");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
if (caught instanceof TDGWTSessionExpiredException) {
@@ -190,7 +196,7 @@ public class UnionOperationInProgressCard extends WizardCard implements
new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
- showErrorAndHide("Error in Union", reason, details, caught);
+ showErrorAndHide(msgsCommon.error(), reason, details, caught);
}
forceLayout();
@@ -201,7 +207,7 @@ public class UnionOperationInProgressCard extends WizardCard implements
newTrId = operationResult.getTrId();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
- .appendHtmlConstant("Validation Failed
");
+ .appendHtmlConstant(""+msgsCommon.validationFailed()+"
");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
@@ -232,7 +238,7 @@ public class UnionOperationInProgressCard extends WizardCard implements
public void operationAborted() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
- .appendHtmlConstant("Operation Aborted
");
+ .appendHtmlConstant(""+msgsCommon.operationAborted()+"
");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
@@ -262,7 +268,7 @@ public class UnionOperationInProgressCard extends WizardCard implements
public void operationPutInBackground() {
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder();
safeHtmlBuilder
- .appendHtmlConstant("Operation in Background
");
+ .appendHtmlConstant(""+msgsCommon.operationInBackground()+"
");
resultField.setHTML(safeHtmlBuilder.toSafeHtml());
resultField.setVisible(true);
diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages.java
new file mode 100644
index 0000000..bea1cba
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages.java
@@ -0,0 +1,95 @@
+package org.gcube.portlets.user.td.unionwizardwidget.client;
+
+import com.google.gwt.i18n.client.Messages;
+import com.google.gwt.safehtml.shared.SafeHtml;
+
+/**
+ *
+ * @author giancarlo email: g.panichi@isti.cnr.it
+ *
+ */
+public interface UnionWizardMessages extends Messages {
+
+ @DefaultMessage("Union")
+ String unionWizardHead();
+
+ @DefaultMessage("Select Tabular Resource for Union")
+ String tabResourcesSelectionCardHead();
+
+ @DefaultMessage("This tabular resource does not have a valid table!")
+ String attentionThisTabularResourceDoesNotHaveAValidTable();
+
+ @DefaultMessage("Delete")
+ String delete();
+
+ @DefaultMessage("Would you like to delete this tabular resource?")
+ String woultYouLikeToDeleteThisTabularResource();
+
+ @DefaultMessage("Would you like to delete this tabular resource without table?")
+ String woultYouLikeToDeleteThisTabularResourceWithoutTable();
+
+ @DefaultMessage("Error on delete Tabular Resource: ")
+ String errorOnDeleteTabularResourceFixed();
+
+ @DefaultMessage("Error retrienving information on current tabular resource: ")
+ String errorRetrievingInfomationOnTRFixed();
+
+ @DefaultMessage("Name")
+ String nameColumn();
+
+ @DefaultMessage("Type")
+ String typeColumn();
+
+ @DefaultMessage("Table Type")
+ String tableTypeColumn();
+
+ @DefaultMessage("Agency")
+ String agencyColumn();
+
+ @DefaultMessage("Owner")
+ SafeHtml ownerColumn();
+
+ @DefaultMessage("Creation Date")
+ String creationDateColumn();
+
+ @DefaultMessage("Delete")
+ String itemDelete();
+
+ @DefaultMessage("Error retrieving tabular resources on server!")
+ String errorRetrievingTabularResources();
+
+ @DefaultMessage("Mapping beetween Tabular Resources")
+ String columnMappingCardHead();
+
+ @DefaultMessage("Creates a valid column map!")
+ String attentionCreatesAValidColumnMap();
+
+ @DefaultMessage("Error retrieving source columns on server!")
+ String errorRetrievingSourceColumns();
+
+ @DefaultMessage("Error retrieving union columns on server!")
+ String errorRetrievingUnionColumns();
+
+ @DefaultMessage("Select a column...")
+ String comboSourceColumnEmptyText();
+
+ @DefaultMessage("Select a column...")
+ String comboUnionEmptyText();
+
+ @DefaultMessage("Union with: ")
+ String unionWithFixed();
+
+ @DefaultMessage("Type: ")
+ String typeFixed();
+
+ @DefaultMessage("Owner: ")
+ String ownerFixed();
+
+ @DefaultMessage("Union Summary")
+ String summaryUnion();
+
+ @DefaultMessage("An error occured in union.")
+ String errorInUnionFixed();
+
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java
index 56b97c1..a59bdeb 100644
--- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java
+++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTD.java
@@ -14,17 +14,15 @@ import com.google.web.bindery.event.shared.EventBus;
*
*/
public class UnionWizardTD extends WizardWindow {
- protected static final int WITHWIZARD = 800;
- protected static final int HEIGHTWIZARD = 520;
-
- protected UnionSession unionSession;
- protected TRId trId;
+ private static final int WITHWIZARD = 800;
+ private static final int HEIGHTWIZARD = 520;
+ private UnionSession unionSession;
/**
*
- * @param trId
- * @param title
- * @param eventBus
+ * @param trId tabular resource id
+ * @param title wizard title
+ * @param eventBus event bus
*/
public UnionWizardTD(TRId trId, String title, EventBus eventBus) {
super(title, eventBus);
@@ -32,7 +30,6 @@ public class UnionWizardTD extends WizardWindow {
setWidth(WITHWIZARD);
setHeight(HEIGHTWIZARD);
- this.trId = trId;
unionSession = new UnionSession();
unionSession.setTrId(trId);
diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTDEntry.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTDEntry.java
index c0cb6dc..f0558c8 100644
--- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTDEntry.java
+++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardTDEntry.java
@@ -4,20 +4,24 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.SimpleEventBus;
/**
*
- * @author "Giancarlo Panichi"
- * email: g.panichi@isti.cnr.it
+ * @author "Giancarlo Panichi" email: g.panichi@isti.cnr.it
*
*/
-public class UnionWizardTDEntry implements EntryPoint {
+public class UnionWizardTDEntry implements EntryPoint {
+
+ public UnionWizardMessages msgs = GWT.create(UnionWizardMessages.class);
public void onModuleLoad() {
- TRId trId=new TRId();
- SimpleEventBus eventBus=new SimpleEventBus();
- UnionWizardTD unionWizard= new UnionWizardTD(trId, "Union",eventBus);
+ TRId trId = new TRId();
+ SimpleEventBus eventBus = new SimpleEventBus();
+ UnionWizardTD unionWizard = new UnionWizardTD(trId,
+ msgs.unionWizardHead(), eventBus);
Log.info(unionWizard.getId());
}
}
diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionResourceBundle.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionResourceBundle.java
index df77749..92db785 100644
--- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionResourceBundle.java
+++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/resources/UnionResourceBundle.java
@@ -6,7 +6,12 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
-
+/**
+ *
+ * @author giancarlo
+ * email: g.panichi@isti.cnr.it
+ *
+ */
public interface UnionResourceBundle extends ClientBundle {
public static final UnionResourceBundle INSTANCE=GWT.create(UnionResourceBundle.class);
diff --git a/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages.properties b/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages.properties
deleted file mode 100644
index c222555..0000000
--- a/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-sendButton = Send
-nameField = Enter your name
\ No newline at end of file
diff --git a/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages_fr.properties b/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages_fr.properties
deleted file mode 100644
index b4a7627..0000000
--- a/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/Messages_fr.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-sendButton = Envoyer
-nameField = Entrez votre nom
\ No newline at end of file
diff --git a/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages.properties b/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages.properties
new file mode 100644
index 0000000..1e71468
--- /dev/null
+++ b/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages.properties
@@ -0,0 +1,28 @@
+unionWizardHead = Union
+tabResourcesSelectionCardHead = Select Tabular Resource for Union
+attentionThisTabularResourceDoesNotHaveAValidTable = This tabular resource does not have a valid table!
+delete = Delete
+woultYouLikeToDeleteThisTabularResource = Would you like to delete this tabular resource?
+woultYouLikeToDeleteThisTabularResourceWithoutTable = Would you like to delete this tabular resource without table?
+errorOnDeleteTabularResourceFixed = Error on delete Tabular Resource:
+errorRetrievingInfomationOnTRFixed = Error retrienving information on current tabular resource:
+nameColumn = Name
+typeColumn = Type
+tableTypeColumn = Table Type
+agencyColumn = Agency
+ownerColumn = Owner
+creationDateColumn = Creation Date
+itemDelete = Delete
+errorRetrievingTabularResources = Error retrieving tabular resources on server!
+columnMappingCardHead = Mapping beetween Tabular Resources
+attentionCreatesAValidColumnMap = Creates a valid column map!
+errorRetrievingSourceColumns = Error retrieving source columns on server!
+errorRetrievingUnionColumns = Error retrieving union columns on server!
+comboSourceColumnEmptyText = Select a column...
+comboUnionEmptyText = Select a column...
+unionWithFixed = Union with:
+typeFixed = Type:
+ownerFixed = Owner:
+summaryUnion = Union Summary
+errorInUnionFixed = An error occured in union.
+
diff --git a/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages_es.properties b/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages_es.properties
new file mode 100644
index 0000000..88e3644
--- /dev/null
+++ b/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages_es.properties
@@ -0,0 +1,27 @@
+unionWizardHead = Unión
+tabResourcesSelectionCardHead = Seleccione una Tabular Resource para la Unión
+attentionThisTabularResourceDoesNotHaveAValidTable = Esta tabular resource no tiene una tabla válida!
+delete = Borrar
+woultYouLikeToDeleteThisTabularResource = Quieres eliminar esta tabular resource?
+woultYouLikeToDeleteThisTabularResourceWithoutTable = Quieres eliminar esta tabular resource que no tiene una tabla válida?
+errorOnDeleteTabularResourceFixed = Error eliminando la tabular resource:
+errorRetrievingInfomationOnTRFixed = Error en la recuperación de información información relacionada con la tabular resource:
+nameColumn = Nombre
+typeColumn = Tipo
+tableTypeColumn = Tipo Tabla
+agencyColumn = Agencia
+ownerColumn = Propietario
+creationDateColumn = Fecha Creacion
+itemDelete = Borrar
+errorRetrievingTabularResources = Error al recuperar las tabular resources del servidor!
+columnMappingCardHead = Correspondencia entre tabular resources
+attentionCreatesAValidColumnMap = Crear un mapa válido entre columnas!
+errorRetrievingSourceColumns = Error al recuperar las columnas que son fuentes para el mapeo!
+errorRetrievingUnionColumns = Error al recuperar las columnas que son la unión para el mapeo!
+comboSourceColumnEmptyText = Seleccione una columna...
+comboUnionEmptyText = Seleccione una columna...
+unionWithFixed = Unión con:
+typeFixed = Tipo:
+ownerFixed = Propietario:
+summaryUnion = Resumen Unión
+errorInUnionFixed = Error en la operación de unión.
diff --git a/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages_it.properties b/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages_it.properties
new file mode 100644
index 0000000..914c8d5
--- /dev/null
+++ b/src/main/resources/org/gcube/portlets/user/td/unionwizardwidget/client/UnionWizardMessages_it.properties
@@ -0,0 +1,27 @@
+unionWizardHead = Unione
+tabResourcesSelectionCardHead = Seleziona una Tabular Resource per Unione
+attentionThisTabularResourceDoesNotHaveAValidTable = Questa tabular resource non ha una tabella valida!
+delete = Elimina
+woultYouLikeToDeleteThisTabularResource = Si desidera cancellare questa tabular resource?
+woultYouLikeToDeleteThisTabularResourceWithoutTable = Si desidera cancellare questa tabular resource senza tabella valida?
+errorOnDeleteTabularResourceFixed = Errore eliminando la tabular resource:
+errorRetrievingInfomationOnTRFixed = Errore recuperando le informazioni sulla tabular resource:
+nameColumn = Nome
+typeColumn = Tipo
+tableTypeColumn = Tipo Tabella
+agencyColumn = Agenzia
+ownerColumn = Proprietario
+creationDateColumn = Data Creazione
+itemDelete = Elimina
+errorRetrievingTabularResources = Errore recuperando le tabular resources dal server!
+columnMappingCardHead = Mappatura tra tabular resources
+attentionCreatesAValidColumnMap = Crea un mappa valida tra colonne!
+errorRetrievingSourceColumns = Errore recuperando le colonne sorgenti per la mappatura dal server!
+errorRetrievingUnionColumns = Errore recuperando le colonne unione per la mappatura dal server!
+comboSourceColumnEmptyText = Seleziona una colonna...
+comboUnionEmptyText = Seleziona una colonna...
+unionWithFixed = Unione con:
+typeFixed = Tipo:
+ownerFixed = Proprietario:
+summaryUnion = Sommario Unione
+errorInUnionFixed = Errore nell''operazione di unione.