From 160cfd64ee9b20a7810f85578c6e51721b8d2ff6 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 22 Oct 2015 15:13:26 +0000 Subject: [PATCH] 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-json-export-widget@119969 82a268e6-3cf1-43bd-a215-b396298e98cf --- config/profile.xml | 2 +- distro/README | 6 +- pom.xml | 2 +- .../client/DestinationSelectionCard.java | 89 ++++++++------- .../client/DownloadFileCard.java | 15 +-- .../client/JSONExportConfigCard.java | 101 +++++++++--------- .../client/JSONExportWidgetTDEntry.java | 18 +++- .../client/JSONExportWizardTDMessages.java | 86 +++++++++++++++ .../client/JSONOperationInProgressCard.java | 51 +++++---- .../client/JSONWorkSpaceSelectionCard.java | 50 +++++---- .../client/grid/ColumnDataGridPanel.java | 31 ++++-- .../JSONExportWizardTDMessages.properties | 24 +++++ .../JSONExportWizardTDMessages_es.properties | 24 +++++ .../JSONExportWizardTDMessages_it.properties | 24 +++++ .../client/Messages.properties | 2 - .../client/Messages_fr.properties | 2 - templates/README | 4 +- templates/profile.xml | 2 +- 18 files changed, 372 insertions(+), 161 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages.java create mode 100644 src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages_es.properties create mode 100644 src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages_it.properties delete mode 100644 src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/Messages.properties delete mode 100644 src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/Messages_fr.properties diff --git a/config/profile.xml b/config/profile.xml index 624458c..160b54d 100644 --- a/config/profile.xml +++ b/config/profile.xml @@ -6,7 +6,7 @@ tabular-data-json-export-widget allows json export inside file and workspace PortletsUser tabular-data-json-export-widget - 1.4.0-SNAPSHOT + 1.0.0 tabular-data-json-export-widget allows json export inside file and workspace diff --git a/distro/README b/distro/README index a2964e3..7ed982e 100644 --- a/distro/README +++ b/distro/README @@ -1,7 +1,9 @@ The gCube System - tabular-data-json-export-widget ------------------------------------------------------------ -This work has been supported by the following European projects: iMarine (FP7-INFRASTRUCTURES-2011-2) +This work has been partially supported by the following European projects: DILIGENT (FP6-2003-IST-2), +D4Science (FP7-INFRA-2007-1.2.2), D4Science-II (FP7-INFRA-2008-1.2.2), iMarine (FP7-INFRASTRUCTURES-2011-2), +and EUBrazilOpenBio (FP7-ICT-2011-EU-Brazil), Parthenos (H2020-INFRADEV-1-2014-1), BlueBridge (H2020-EINFRA-2015-1). Authors ------- @@ -37,7 +39,7 @@ Documentation tabular-data-json-export-widget allows json export inside file and workspace Documentation is available on-line from the Projects Documentation Wiki: - https://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager + http://wiki.gcube-system.org/gcube/Tabular_Data_Manager Licensing diff --git a/pom.xml b/pom.xml index c4635d8..9af63b7 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ ${project.basedir}/distro ${project.build.directory}/${project.build.finalName} 2015-10-15 - https://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager + http://wiki.gcube-system.org/gcube/Tabular_Data_Manager templates distro config diff --git a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/DestinationSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/DestinationSelectionCard.java index ec54f6b..905e7a1 100644 --- a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/DestinationSelectionCard.java +++ b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/DestinationSelectionCard.java @@ -3,8 +3,6 @@ */ package org.gcube.portlets.user.td.jsonexportwidget.client; - - import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.shared.json.JSONExportSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; @@ -12,11 +10,13 @@ import org.gcube.portlets.user.td.gwtservice.shared.destination.FileDestination; import org.gcube.portlets.user.td.gwtservice.shared.destination.WorkspaceDestination; 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.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.wizardwidget.client.WizardCard; import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.core.shared.GWT; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.user.client.Command; @@ -33,51 +33,59 @@ import com.sencha.gxt.widget.core.client.form.Radio; * */ public class DestinationSelectionCard extends WizardCard { + private static JSONExportWizardTDMessages msgs = GWT + .create(JSONExportWizardTDMessages.class); + private CommonMessages msgsCommon; - protected final JSONExportSession exportSession; - protected DestinationSelectionCard thisCard; - - final FileDestination fileDestination = FileDestination.INSTANCE; - final WorkspaceDestination workspaceDestination = WorkspaceDestination.INSTANCE; + private JSONExportSession exportSession; + private DestinationSelectionCard thisCard; + + private FileDestination fileDestination = FileDestination.INSTANCE; + private WorkspaceDestination workspaceDestination = WorkspaceDestination.INSTANCE; public DestinationSelectionCard(final JSONExportSession exportSession) { - super("JSON destination selection", ""); - thisCard=this; + super(msgs.destinationSelectionCardHead(), ""); + thisCard = this; this.exportSession = exportSession; + + initMessages(); // Default exportSession.setDestination(workspaceDestination); - + retrieveTabularResource(); - + } - - protected void create(){ + + protected void initMessages() { + msgsCommon = GWT.create(CommonMessages.class); + } + + protected void create() { VerticalPanel destinationSelectionPanel = new VerticalPanel(); destinationSelectionPanel.setStylePrimaryName(res.wizardCSS() .getImportSelectionSources()); Radio radioWorkspaceDestination = new Radio(); - radioWorkspaceDestination.setBoxLabel("

" - + workspaceDestination.getName() + "
" - + workspaceDestination.getDescription() + "

"); + radioWorkspaceDestination + .setBoxLabel("

" + + msgsCommon.workspaceDestinationName() + "
" + + msgsCommon.workspaceDestinationDescription() + "

"); radioWorkspaceDestination.setName(workspaceDestination.getName()); radioWorkspaceDestination.setStylePrimaryName(res.wizardCSS() .getImportSelectionSource()); radioWorkspaceDestination.setValue(true); - - + Radio radioFileDestination = new Radio(); radioFileDestination.setBoxLabel("

" - + fileDestination.getName() + "
" - + fileDestination.getDescription() + "

"); + + msgsCommon.fileDestinationName() + "
" + + msgsCommon.fileDestinationDescription() + "

"); radioFileDestination.setName(fileDestination.getName()); radioFileDestination.setStylePrimaryName(res.wizardCSS() .getImportSelectionSource()); radioFileDestination.disable(); - + destinationSelectionPanel.add(radioWorkspaceDestination); destinationSelectionPanel.add(radioFileDestination); - // we can set name on radios or use toggle group ToggleGroup toggle = new ToggleGroup(); @@ -86,16 +94,17 @@ public class DestinationSelectionCard extends WizardCard { toggle.addValueChangeHandler(new ValueChangeHandler>() { - public void onValueChange(ValueChangeEvent> event) { try { ToggleGroup group = (ToggleGroup) event.getSource(); Radio radio = (Radio) group.getValue(); Log.info("Source Selected:" + radio.getName()); - if (radio.getName().compareTo(workspaceDestination.getName()) == 0) { + if (radio.getName().compareTo( + workspaceDestination.getName()) == 0) { exportSession.setDestination(workspaceDestination); } else { - if (radio.getName().compareTo(fileDestination.getName()) == 0) { + if (radio.getName() + .compareTo(fileDestination.getName()) == 0) { exportSession.setDestination(fileDestination); } else { @@ -114,8 +123,7 @@ public class DestinationSelectionCard extends WizardCard { setContent(destinationSelectionPanel); forceLayout(); } - - + protected void retrieveTabularResource() { TDGWTServiceAsync.INSTANCE .getTabResourceInformation(new AsyncCallback() { @@ -136,13 +144,13 @@ public class DestinationSelectionCard extends WizardCard { if (caught instanceof TDGWTIsLockedException) { Log.error(caught.getLocalizedMessage()); - showErrorAndHide("Error Locked", + showErrorAndHide(msgsCommon.errorLocked(), caught.getLocalizedMessage(), "", caught); } else { showErrorAndHide( - "Error", - "Error retrienving tabular resource info: ", + msgsCommon.error(), + msgs.errorRetrievingTabularResourceInfo(), caught.getLocalizedMessage(), caught); } @@ -153,7 +161,6 @@ public class DestinationSelectionCard extends WizardCard { }); } - @Override public void setup() { @@ -161,7 +168,8 @@ public class DestinationSelectionCard extends WizardCard { Command sayNextCard = new Command() { public void execute() { try { - String destinationId = exportSession.getDestination().getId(); + String destinationId = exportSession.getDestination() + .getId(); if (destinationId == null || destinationId.isEmpty()) { Log.error("JSON Export Source Id: " + destinationId); } else { @@ -191,7 +199,7 @@ public class DestinationSelectionCard extends WizardCard { }; getWizardWindow().setNextButtonCommand(sayNextCard); - + Command sayPreviousCard = new Command() { public void execute() { try { @@ -202,14 +210,13 @@ public class DestinationSelectionCard extends WizardCard { Log.error("sayPreviousCard :" + e.getLocalizedMessage()); } } - }; - - getWizardWindow().setPreviousButtonCommand(sayPreviousCard); - - setEnableBackButton(true); + }; + + getWizardWindow().setPreviousButtonCommand(sayPreviousCard); + + setEnableBackButton(true); setEnableNextButton(true); - + } - - + } diff --git a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/DownloadFileCard.java b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/DownloadFileCard.java index 6e46b25..ce35045 100644 --- a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/DownloadFileCard.java +++ b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/DownloadFileCard.java @@ -5,10 +5,10 @@ package org.gcube.portlets.user.td.jsonexportwidget.client; import org.gcube.portlets.user.td.gwtservice.shared.json.JSONExportSession; - import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.core.shared.GWT; import com.google.gwt.user.client.Command; /** @@ -18,16 +18,17 @@ import com.google.gwt.user.client.Command; * */ public class DownloadFileCard extends WizardCard { - protected JSONExportSession exportSession; - protected DownloadFileCard thisCard; + private static JSONExportWizardTDMessages msgs = GWT + .create(JSONExportWizardTDMessages.class); + + //private JSONExportSession exportSession; + private DownloadFileCard thisCard; public DownloadFileCard(final JSONExportSession exportSession) { - super("Download File", ""); + super(msgs.downloadFileCardHead(), ""); this.thisCard = this; - this.exportSession = exportSession; + //this.exportSession = exportSession; - - //setContent(); } diff --git a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportConfigCard.java b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportConfigCard.java index 7e29131..2420c3e 100644 --- a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportConfigCard.java +++ b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportConfigCard.java @@ -9,12 +9,14 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpire import org.gcube.portlets.user.td.gwtservice.shared.json.JSONExportSession; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; import org.gcube.portlets.user.td.jsonexportwidget.client.grid.ColumnDataGridPanel; +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.tr.column.ColumnData; 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.event.logical.shared.SelectionEvent; import com.google.gwt.event.logical.shared.SelectionHandler; import com.google.gwt.user.client.Command; @@ -39,22 +41,23 @@ import com.sencha.gxt.widget.core.client.tips.ToolTipConfig; * */ public class JSONExportConfigCard extends WizardCard { - + private static JSONExportWizardTDMessages msgs = GWT + .create(JSONExportWizardTDMessages.class); private static final int LABEL_WIDTH = 128; private static final int LABEL_PAD_WIDTH = 2; + private CommonMessages msgsCommon; - protected JSONExportSession exportSession; + private JSONExportSession exportSession; + private Radio radioViewColumnExportTrue; + private Radio radioViewColumnExportFalse; + + private ColumnDataGridPanel jsonColumnGridPanel; - private Radio viewColumnExportTrue; - private Radio viewColumnExportFalse; - - protected ColumnDataGridPanel jsonColumnGridPanel; - public JSONExportConfigCard(final JSONExportSession exportSession) { - super("JSON configuration", ""); - + super(msgs.jsonExportConfigCardHead(), ""); + initMessages(); if (exportSession == null) { Log.error("JSONExportSession is null"); } @@ -65,6 +68,10 @@ public class JSONExportConfigCard extends WizardCard { } + protected void initMessages() { + msgsCommon = GWT.create(CommonMessages.class); + } + protected FormPanel createPanel() { FormPanel panel = new FormPanel(); panel.setLabelWidth(90); @@ -74,27 +81,30 @@ public class JSONExportConfigCard extends WizardCard { panel.add(content); // Export View Column - viewColumnExportTrue = new Radio(); - viewColumnExportTrue.setBoxLabel("True"); - viewColumnExportTrue.setValue(true); + radioViewColumnExportTrue = new Radio(); + radioViewColumnExportTrue.setBoxLabel(msgs + .radioViewColumnExportTrueLabel()); + radioViewColumnExportTrue.setValue(true); - viewColumnExportFalse = new Radio(); - viewColumnExportFalse.setBoxLabel("False"); + radioViewColumnExportFalse = new Radio(); + radioViewColumnExportFalse.setBoxLabel(msgs + .radioViewColumnExportFalseLabel()); ToggleGroup exportViewColumnGroup = new ToggleGroup(); - exportViewColumnGroup.add(viewColumnExportTrue); - exportViewColumnGroup.add(viewColumnExportFalse); - + exportViewColumnGroup.add(radioViewColumnExportTrue); + exportViewColumnGroup.add(radioViewColumnExportFalse); + HorizontalPanel viewColumnExportPanel = new HorizontalPanel(); - viewColumnExportPanel.add(viewColumnExportTrue); - viewColumnExportPanel.add(viewColumnExportFalse); - + viewColumnExportPanel.add(radioViewColumnExportTrue); + viewColumnExportPanel.add(radioViewColumnExportFalse); + new ToolTip(viewColumnExportPanel, new ToolTipConfig( - "Export View Columns Too")); - FieldLabel fieldViewColumns=new FieldLabel(viewColumnExportPanel, "Export View Columns"); - fieldViewColumns.setLabelWidth(LABEL_WIDTH); - fieldViewColumns.setLabelPad(LABEL_PAD_WIDTH); - content.add(fieldViewColumns); + msgs.viewColumnExportPanelToolTip())); + FieldLabel viewColumnExportPanelLabel = new FieldLabel( + viewColumnExportPanel, msgs.viewColumnExportPanelLabel()); + viewColumnExportPanelLabel.setLabelWidth(LABEL_WIDTH); + viewColumnExportPanelLabel.setLabelPad(LABEL_PAD_WIDTH); + content.add(viewColumnExportPanelLabel); // Column Selection Grid jsonColumnGridPanel = new ColumnDataGridPanel(this); @@ -113,10 +123,8 @@ public class JSONExportConfigCard extends WizardCard { return panel; } - - protected boolean getExportViewColumns() { - if(viewColumnExportTrue.getValue()){ + if (radioViewColumnExportTrue.getValue()) { return true; } else { return false; @@ -156,7 +164,8 @@ public class JSONExportConfigCard extends WizardCard { ArrayList columns = jsonColumnGridPanel.getSelectedItems(); if (columns.size() == 0) { - d = new AlertMessageBox("Attention", "No columns selected"); + d = new AlertMessageBox(msgsCommon.attention(), + msgs.noColumnSelected()); d.addHideHandler(hideHandler); d.setModal(false); d.show(); @@ -167,13 +176,13 @@ public class JSONExportConfigCard extends WizardCard { } } - - protected void useWorkspaceDestination(){ + + protected void useWorkspaceDestination() { final WorkspaceDestination workspaceDestination = WorkspaceDestination.INSTANCE; exportSession.setDestination(workspaceDestination); retrieveTabularResource(); } - + protected void retrieveTabularResource() { TDGWTServiceAsync.INSTANCE .getTabResourceInformation(new AsyncCallback() { @@ -194,13 +203,12 @@ public class JSONExportConfigCard extends WizardCard { if (caught instanceof TDGWTIsLockedException) { Log.error(caught.getLocalizedMessage()); - showErrorAndHide("Error Locked", + showErrorAndHide(msgsCommon.errorLocked(), caught.getLocalizedMessage(), "", caught); } else { - showErrorAndHide( - "Error", - "Error retrienving tabular resource info: ", + showErrorAndHide(msgsCommon.error(), msgs + .errorRetrievingTabularResourceInfo(), caught.getLocalizedMessage(), caught); } @@ -211,24 +219,21 @@ public class JSONExportConfigCard extends WizardCard { }); } - - - + protected void goNext() { try { - /*DestinationSelectionCard destCard = new DestinationSelectionCard( - exportSession); - getWizardWindow().addCard(destCard); - getWizardWindow().nextCard();*/ - + /* + * DestinationSelectionCard destCard = new DestinationSelectionCard( + * exportSession); getWizardWindow().addCard(destCard); + * getWizardWindow().nextCard(); + */ + Log.info("NextCard JSONWorkspaceSelectionCard"); JSONWorkSpaceSelectionCard jsonWorkspaceSelectionCard = new JSONWorkSpaceSelectionCard( exportSession); - getWizardWindow().addCard( - jsonWorkspaceSelectionCard); + getWizardWindow().addCard(jsonWorkspaceSelectionCard); getWizardWindow().nextCard(); - - + } catch (Exception e) { Log.error("sayNextCard :" + e.getLocalizedMessage()); } diff --git a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWidgetTDEntry.java b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWidgetTDEntry.java index f758d4d..d0debc1 100644 --- a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWidgetTDEntry.java +++ b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWidgetTDEntry.java @@ -2,14 +2,28 @@ package org.gcube.portlets.user.td.jsonexportwidget.client; 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 + * email: g.panichi@isti.cnr.it + * + */ public class JSONExportWidgetTDEntry implements EntryPoint { - + + private JSONExportWizardTDMessages msgs; public void onModuleLoad() { + initMessages(); SimpleEventBus eventBus=new SimpleEventBus(); - JSONExportWidgetTD exportWizard= new JSONExportWidgetTD("CSVExport",eventBus); + JSONExportWidgetTD exportWizard= new JSONExportWidgetTD(msgs.jsonExportWizardHead(),eventBus); Log.info(exportWizard.getId()); } + + protected void initMessages(){ + msgs = GWT.create(JSONExportWizardTDMessages.class); + } + } diff --git a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages.java b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages.java new file mode 100644 index 0000000..a920a32 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages.java @@ -0,0 +1,86 @@ +package org.gcube.portlets.user.td.jsonexportwidget.client; + +import com.google.gwt.i18n.client.Messages; + + +/** + * + * @author giancarlo email: g.panichi@isti.cnr.it + * + */ +public interface JSONExportWizardTDMessages extends Messages { + + @DefaultMessage("JSON Export") + String jsonExportWizardHead(); + + @DefaultMessage("JSON configuration") + String jsonExportConfigCardHead(); + + @DefaultMessage("True") + String radioViewColumnExportTrueLabel(); + + @DefaultMessage("False") + String radioViewColumnExportFalseLabel(); + + @DefaultMessage("Export View Columns Too") + String viewColumnExportPanelToolTip(); + + @DefaultMessage("Export View Columns") + String viewColumnExportPanelLabel(); + + @DefaultMessage("No column selected!") + String noColumnSelected(); + + @DefaultMessage("Error retrieving tabular resource info:") + String errorRetrievingTabularResourceInfo(); + + @DefaultMessage("JSON Export in Workspace") + String jsonWorkspaceSelectionCardHead(); + + @DefaultMessage("Name") + String nameLabel(); + + @DefaultMessage("Description") + String descriptionLabel(); + + @DefaultMessage("Workspace Selection") + String workspaceExplorerPanelHead(); + + @DefaultMessage("Folder") + String workspaceExplorerPanelLabel(); + + @DefaultMessage("No folder selected!") + String attentionNoFolderSelected(); + + @DefaultMessage("No valid file description!") + String attentionNoValidFileDescription(); + + @DefaultMessage("No valid file name!") + String attentionNoValidFileName(); + + @DefaultMessage("JSON destination selection") + String destinationSelectionCardHead(); + + @DefaultMessage("Download File") + String downloadFileCardHead(); + + @DefaultMessage("Destination: ") + String jsonOperationInProgressCardDestinationLabel(); + + @DefaultMessage("Name: ") + String jsonOperationInProgressCardNameLabel(); + + @DefaultMessage("Description: ") + String jsonOperationInProgressCardDescriptionLabel(); + + @DefaultMessage("Export Summary") + String summaryExport(); + + @DefaultMessage("An error occured in export JSON:") + String errorInJSONExport(); + + @DefaultMessage("Columns") + String columnDataGridPanelHead(); + +} diff --git a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONOperationInProgressCard.java b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONOperationInProgressCard.java index a5e1083..48e8742 100644 --- a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONOperationInProgressCard.java +++ b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONOperationInProgressCard.java @@ -9,6 +9,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedExcep import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; 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; @@ -16,6 +17,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; @@ -36,18 +38,17 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou */ public class JSONOperationInProgressCard extends WizardCard implements MonitorDialogListener { - - protected JSONOperationInProgressCard thisCard; - protected JSONExportSession exportSession; - protected TRId newTrId; - protected HtmlLayoutContainer resultField; + private static CommonMessages msgsCommon = GWT.create(CommonMessages.class); + private JSONExportWizardTDMessages msgs; + private JSONExportSession exportSession; + private TRId newTrId; + private HtmlLayoutContainer resultField; public JSONOperationInProgressCard(final JSONExportSession exportSession) { - super("Operation In Progress", ""); - + super(msgsCommon.operationInProgress(), ""); this.exportSession = exportSession; - thisCard = this; - + initMessages(); + VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer(); operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER); @@ -59,18 +60,18 @@ public class JSONOperationInProgressCard extends WizardCard implements // display:block;vertical-align:text-top; description.setHTML(0, 0, - "Destination: "); + ""+msgs.jsonOperationInProgressCardDestinationLabel()+""); description.setText(0, 1, exportSession.getDestination().getName()); description.setHTML(1, 0, - "File Name: "); + ""+msgs.jsonOperationInProgressCardNameLabel()+""); description.setText(1, 1, exportSession.getFileName()); description.setHTML(2, 0, - "File Description: "); + ""+msgs.jsonOperationInProgressCardDescriptionLabel()+""); description.setText(2, 1, exportSession.getFileDescription()); FramedPanel summary = new FramedPanel(); - summary.setHeadingText("Export Summary"); + summary.setHeadingText(msgs.summaryExport()); summary.setWidth(400); summary.add(description); operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20, @@ -85,7 +86,11 @@ public class JSONOperationInProgressCard extends WizardCard implements resultField.setVisible(false); } - + + protected void initMessages(){ + msgs = GWT.create(JSONExportWizardTDMessages.class); + } + public void exportCSV() { TDGWTServiceAsync.INSTANCE.startJSONExport(exportSession, new AsyncCallback() { @@ -104,12 +109,12 @@ public class JSONOperationInProgressCard extends WizardCard implements } else { if (caught instanceof TDGWTIsLockedException) { Log.error(caught.getLocalizedMessage()); - showErrorAndHide("Error Locked", + showErrorAndHide(msgsCommon.errorLocked(), caught.getLocalizedMessage(), "", caught); } else { - showErrorAndHide("Error in export", - "An error occured in export. ", + showErrorAndHide(msgsCommon.error(), + msgs.errorInJSONExport(), caught.getLocalizedMessage(), caught); } @@ -140,7 +145,7 @@ public class JSONOperationInProgressCard extends WizardCard implements newTrId = operationResult.getTrId(); SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); safeHtmlBuilder - .appendHtmlConstant("
Operation Completed
"); + .appendHtmlConstant("
"+msgsCommon.operationCompleted()+"
"); resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setVisible(true); @@ -171,7 +176,7 @@ public class JSONOperationInProgressCard 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) { @@ -180,7 +185,7 @@ public class JSONOperationInProgressCard extends WizardCard implements new SessionExpiredEvent( SessionExpiredType.EXPIREDONSERVER)); } else { - showErrorAndHide("Error in Export", reason, details, caught); + showErrorAndHide(msgsCommon.error(), reason, details, caught); } forceLayout(); @@ -191,7 +196,7 @@ public class JSONOperationInProgressCard extends WizardCard implements newTrId = operationResult.getTrId(); SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); safeHtmlBuilder - .appendHtmlConstant("
Problems in the Operation
"); + .appendHtmlConstant("
"+msgsCommon.operationProblem()+"
"); resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setVisible(true); @@ -223,7 +228,7 @@ public class JSONOperationInProgressCard extends WizardCard implements public void operationAborted() { SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); safeHtmlBuilder - .appendHtmlConstant("
Operation Aborted
"); + .appendHtmlConstant("
"+msgsCommon.operationAborted()+"
"); resultField.setHTML(safeHtmlBuilder.toSafeHtml()); resultField.setVisible(true); @@ -253,7 +258,7 @@ public class JSONOperationInProgressCard 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/jsonexportwidget/client/JSONWorkSpaceSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONWorkSpaceSelectionCard.java index 2694140..a8026fc 100644 --- a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONWorkSpaceSelectionCard.java +++ b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/JSONWorkSpaceSelectionCard.java @@ -7,6 +7,7 @@ import java.util.ArrayList; import java.util.List; import org.gcube.portlets.user.td.gwtservice.shared.json.JSONExportSession; +import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener; import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectPanel; @@ -14,6 +15,7 @@ import org.gcube.portlets.widgets.wsexplorer.shared.Item; import org.gcube.portlets.widgets.wsexplorer.shared.ItemType; import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.core.shared.GWT; import com.google.gwt.user.client.Command; import com.sencha.gxt.widget.core.client.FramedPanel; import com.sencha.gxt.widget.core.client.box.AlertMessageBox; @@ -32,25 +34,27 @@ import com.sencha.gxt.widget.core.client.form.validator.EmptyValidator; * */ public class JSONWorkSpaceSelectionCard extends WizardCard { + private static JSONExportWizardTDMessages msgs = GWT.create(JSONExportWizardTDMessages.class); + private CommonMessages msgsCommon; + private JSONExportSession exportSession; + private JSONWorkSpaceSelectionCard thisCard; + private TextField fileName; + private TextField fileDescription; - protected JSONExportSession exportSession; - protected JSONWorkSpaceSelectionCard thisCard; - protected TextField fileName; - protected TextField fileDescription; - - protected VerticalLayoutContainer p; - protected WorkspaceExplorerSelectPanel wpanel; + private VerticalLayoutContainer p; + private WorkspaceExplorerSelectPanel workspaceExplorer; + /** * * @param exportSession */ public JSONWorkSpaceSelectionCard(final JSONExportSession exportSession) { - super("JSON Export in Workspace", ""); - + super(msgs.jsonWorkspaceSelectionCardHead(), ""); this.exportSession = exportSession; thisCard = this; - + initMessages(); + FramedPanel formPanel = new FramedPanel(); formPanel.setHeaderVisible(false); p = new VerticalLayoutContainer(); @@ -69,14 +73,14 @@ public class JSONWorkSpaceSelectionCard extends WizardCard { fileName.addValidator(new EmptyValidator()); fileName.setWidth("410px"); fileName.setValue(fileN); - p.add(new FieldLabel(fileName, "Name"), new VerticalLayoutData(1, -1)); + p.add(new FieldLabel(fileName, msgs.nameLabel()), new VerticalLayoutData(1, -1)); fileDescription = new TextField(); fileDescription.addValidator(new EmptyValidator()); fileDescription.setAllowBlank(false); fileDescription.setWidth("410px"); fileDescription.setValue("json"); - p.add(new FieldLabel(fileDescription, "Description"), + p.add(new FieldLabel(fileDescription, msgs.descriptionLabel()), new VerticalLayoutData(1, -1)); // / @@ -86,8 +90,8 @@ public class JSONWorkSpaceSelectionCard extends WizardCard { List showableTypes = new ArrayList(); showableTypes.add(ItemType.FOLDER); - wpanel = new WorkspaceExplorerSelectPanel(new String( - "Workspace Selection"), selectableTypes, showableTypes); + workspaceExplorer = new WorkspaceExplorerSelectPanel( + msgs.workspaceExplorerPanelHead(), selectableTypes, showableTypes); //wpanel.getElement().setAttribute("background-color", "white"); WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() { @@ -123,15 +127,19 @@ public class JSONWorkSpaceSelectionCard extends WizardCard { } }; - wpanel.addWorkspaceExplorerSelectNotificationListener(handler); + workspaceExplorer.addWorkspaceExplorerSelectNotificationListener(handler); // / - p.add(new FieldLabel(wpanel, "Folder"), new VerticalLayoutData(1, 1)); + p.add(new FieldLabel(workspaceExplorer, msgs.workspaceExplorerPanelLabel()), new VerticalLayoutData(1, 1)); setContent(formPanel); } + + protected void initMessages(){ + msgsCommon = GWT.create(CommonMessages.class); + } protected void checkExportData() { Log.debug("File Name:" + fileName.getCurrentValue() + " Item id: " @@ -160,22 +168,22 @@ public class JSONWorkSpaceSelectionCard extends WizardCard { .getCurrentValue()); goNext(); } else { - d = new AlertMessageBox("Attetion", "No folder selected"); + d = new AlertMessageBox(msgsCommon.attention(), msgs.attentionNoFolderSelected()); d.addHideHandler(hideHandler); d.setModal(false); d.show(); } } else { - d = new AlertMessageBox("Attention", - "No valid file description"); + d = new AlertMessageBox(msgsCommon.attention(), + msgs.attentionNoValidFileDescription()); d.addHideHandler(hideHandler); d.setModal(false); d.show(); } } else { - d = new AlertMessageBox("Attention", "No valid file name"); + d = new AlertMessageBox(msgsCommon.attention(), msgs.attentionNoValidFileName()); d.addHideHandler(hideHandler); d.setModal(false); d.show(); @@ -190,7 +198,7 @@ public class JSONWorkSpaceSelectionCard extends WizardCard { public void execute() { Log.debug("JSONWorkSpaceSelectionCard Call sayNextCard wpanel:" - + wpanel); + + workspaceExplorer); checkExportData(); } diff --git a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/grid/ColumnDataGridPanel.java b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/grid/ColumnDataGridPanel.java index cdeaf0d..c79672f 100644 --- a/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/grid/ColumnDataGridPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/jsonexportwidget/client/grid/ColumnDataGridPanel.java @@ -6,6 +6,8 @@ import java.util.List; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; 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.jsonexportwidget.client.JSONExportWizardTDMessages; +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.tr.column.ColumnData; @@ -48,13 +50,16 @@ public class ColumnDataGridPanel extends ContentPanel implements HasSelectionHandlers { // private static final String GRID_WIDTH ="524px"; private static final String GRID_HEIGHT = "320px"; - protected static final ColumnDataProperties props = GWT + private static final ColumnDataProperties props = GWT .create(ColumnDataProperties.class); - protected final CheckBoxSelectionModel sm; - - protected final Grid grid; + private final CheckBoxSelectionModel sm; + private final Grid grid; + + private JSONExportWizardTDMessages msgs; + private CommonMessages msgsCommon; + private WizardCard parent; - + /** * * @param parent @@ -62,7 +67,9 @@ public class ColumnDataGridPanel extends ContentPanel implements public ColumnDataGridPanel(WizardCard parent) { this.parent = parent; Log.debug("ColumnDataGridPanel"); - setHeadingText("Columns"); + initMessages(); + + setHeadingText(msgs.columnDataGridPanelHead()); ColumnConfig labelCol = new ColumnConfig( props.label()); @@ -125,7 +132,13 @@ public class ColumnDataGridPanel extends ContentPanel implements setWidget(con); } + + protected void initMessages() { + msgsCommon = GWT.create(CommonMessages.class); + msgs = GWT.create(JSONExportWizardTDMessages.class); + } + public Grid getGrid() { return grid; } @@ -144,15 +157,15 @@ public class ColumnDataGridPanel extends ContentPanel implements } else { if (caught instanceof TDGWTIsLockedException) { Log.error(caught.getLocalizedMessage()); - parent.showErrorAndHide("Error Locked", + parent.showErrorAndHide(msgsCommon.errorLocked(), caught.getLocalizedMessage(), "", caught); } else { Log.error("No load columns: " + caught.getLocalizedMessage()); - parent.showErrorAndHide("Error", - "No load columns.", + parent.showErrorAndHide(msgsCommon.errorRetrievingColumns(), + msgsCommon.errorRetrievingColumns(), caught.getLocalizedMessage(), caught); } } diff --git a/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages.properties b/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages.properties new file mode 100644 index 0000000..adfe003 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages.properties @@ -0,0 +1,24 @@ +jsonExportWizardHead = JSON Export +jsonExportConfigCardHead = JSON configuration +radioViewColumnExportTrueLabel = True +radioViewColumnExportFalseLabel = False +viewColumnExportPanelToolTip = Export View Columns Too +viewColumnExportPanelLabel = Export View Columns +noColumnSelected = No column selected +errorRetrievingTabularResourceInfo = Error retrieving tabular resource info: +jsonWorkspaceSelectionCardHead = JSON Export in Workspace +nameLabel = Name +descriptionLabel = Description +workspaceExplorerPanelHead = Workspace Selection +workspaceExplorerPanelLabel = Folder +attentionNoFolderSelected = No folder selected! +attentionNoValidFileDescription = No valid file description! +attentionNoValidFileName = No valid file name! +destinationSelectionCardHead = JSON destination selection +downloadFileCardHead = Download File +jsonOperationInProgressCardDestinationLabel = Destination: +jsonOperationInProgressCardNameLabel = Name: +jsonOperationInProgressCardDescriptionLabel = Description: +summaryExport = Export Summary +errorInJSONExport = An error occured in export JSON: +columnDataGridPanelHead = Columns \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages_es.properties b/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages_es.properties new file mode 100644 index 0000000..184a84a --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages_es.properties @@ -0,0 +1,24 @@ +jsonExportWizardHead = Exportación JSON +jsonExportConfigCardHead = Configuración JSON +radioViewColumnExportTrueLabel = Real +radioViewColumnExportFalseLabel = Falso +viewColumnExportPanelToolTip = También exporta View Column +viewColumnExportPanelLabel = Exporta View Columns +noColumnSelected = No columna seleccionada +errorRetrievingTabularResourceInfo = Error al recuperar info en la tabular resource: +jsonWorkspaceSelectionCardHead = Exporta JSON desde Workspace +nameLabel = Nombre +descriptionLabel = Descripción +workspaceExplorerPanelHead = Workspace Seleccione +workspaceExplorerPanelLabel = Folder +attentionNoFolderSelected = No folder seleccionado! +attentionNoValidFileDescription = No hay una descripción válida! +attentionNoValidFileName = No hay un nombre válido! +destinationSelectionCardHead = Seleccione el destino para el JSON +downloadFileCardHead = Descarga Archivo +jsonOperationInProgressCardDestinationLabel = Destino: +jsonOperationInProgressCardNameLabel = Nombre: +jsonOperationInProgressCardDescriptionLabel = Descripción: +summaryExport = Resumen de la Exportacione +errorInJSONExport = Se produjo un error en la exportación de JSON: +columnDataGridPanelHead = Columnas diff --git a/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages_it.properties b/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages_it.properties new file mode 100644 index 0000000..8956678 --- /dev/null +++ b/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/JSONExportWizardTDMessages_it.properties @@ -0,0 +1,24 @@ +csvExportWizardHead = Esporta CSV +csvExportConfigCardHead = Configurazione CSV +radioViewColumnExportTrueLabel = Vero +radioViewColumnExportFalseLabel = Falso +viewColumnExportPanelToolTip = Esporta anche le View Column +viewColumnExportPanelLabel = Esporta View Columns +noColumnSelected = Nessuna colonna selezionata +errorRetrievingTabularResourceInfo = Errore recuperando le info sulla tabular resource: +csvWorkspaceSelectionCardHead = Esporta CSV in Workspace +nameLabel = Nome +descriptionLabel = Descrizione +workspaceExplorerPanelHead = Workspace Seleziona +workspaceExplorerPanelLabel = Folder +attentionNoFolderSelected = Nessun folder selezionato! +attentionNoValidFileDescription = Descrizione non valida! +attentionNoValidFileName = Nome non valido! +destinationSelectionCardHead = Seleziona destinazione per il CSV +downloadFileCardHead = Scarica File +csvOperationInProgressCardDestinationLabel = Destinazione: +csvOperationInProgressCardNameLabel = Nome: +csvOperationInProgressCardDescriptionLabel = Descrizione: +summaryExport = Sommario Esportazione +errorInCSVExport = Un errore è avvenuto nell''esportazione del CSV: +columnDataGridPanelHead = Colonne diff --git a/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/Messages.properties b/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/Messages.properties deleted file mode 100644 index c222555..0000000 --- a/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/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/jsonexportwidget/client/Messages_fr.properties b/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/client/Messages_fr.properties deleted file mode 100644 index b4a7627..0000000 --- a/src/main/resources/org/gcube/portlets/user/td/jsonexportwidget/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/templates/README b/templates/README index 7e3ad55..38bf491 100644 --- a/templates/README +++ b/templates/README @@ -1,7 +1,9 @@ The gCube System - ${name} ------------------------------------------------------------ -This work has been supported by the following European projects: iMarine (FP7-INFRASTRUCTURES-2011-2) +This work has been partially supported by the following European projects: DILIGENT (FP6-2003-IST-2), +D4Science (FP7-INFRA-2007-1.2.2), D4Science-II (FP7-INFRA-2008-1.2.2), iMarine (FP7-INFRASTRUCTURES-2011-2), +and EUBrazilOpenBio (FP7-ICT-2011-EU-Brazil), Parthenos (H2020-INFRADEV-1-2014-1), BlueBridge (H2020-EINFRA-2015-1). Authors ------- diff --git a/templates/profile.xml b/templates/profile.xml index 19ed5bc..ffa3274 100644 --- a/templates/profile.xml +++ b/templates/profile.xml @@ -6,7 +6,7 @@ ${project.description} PortletsUser ${project.name} - ${version} + 1.0.0 ${project.description}