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-csv-export-widget@119944 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-10-21 15:06:44 +00:00
parent f81e9b8413
commit 4a52a2a4b7
21 changed files with 542 additions and 188 deletions

View File

@ -6,7 +6,7 @@
<Description>tabular-data-csv-export-widget allows csv export inside file and workspace</Description> <Description>tabular-data-csv-export-widget allows csv export inside file and workspace</Description>
<Class>PortletsUser</Class> <Class>PortletsUser</Class>
<Name>tabular-data-csv-export-widget</Name> <Name>tabular-data-csv-export-widget</Name>
<Version>1.8.0-SNAPSHOT</Version> <Version>1.0.0</Version>
<Packages> <Packages>
<Software> <Software>
<Description>tabular-data-csv-export-widget allows csv export inside file and workspace</Description> <Description>tabular-data-csv-export-widget allows csv export inside file and workspace</Description>

View File

@ -1,7 +1,9 @@
The gCube System - tabular-data-csv-export-widget The gCube System - tabular-data-csv-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 Authors
------- -------
@ -37,7 +39,7 @@ Documentation
tabular-data-csv-export-widget allows csv export inside file and workspace tabular-data-csv-export-widget allows csv export inside file and workspace
Documentation is available on-line from the Projects Documentation Wiki: 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 Licensing

View File

@ -38,7 +38,7 @@
<distroDirectory>${project.basedir}/distro</distroDirectory> <distroDirectory>${project.basedir}/distro</distroDirectory>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<release.date>2015-10-15</release.date> <release.date>2015-10-15</release.date>
<wikiurl>https://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager</wikiurl> <wikiurl>http://wiki.gcube-system.org/gcube/Tabular_Data_Manager</wikiurl>
<templatesDirectory>templates</templatesDirectory> <templatesDirectory>templates</templatesDirectory>
<distroDirectory>distro</distroDirectory> <distroDirectory>distro</distroDirectory>
<configDirectory>config</configDirectory> <configDirectory>config</configDirectory>

View File

@ -10,6 +10,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.destination.WorkspaceDestina
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.tr.TabResource; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
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;
@ -49,28 +50,31 @@ import com.sencha.gxt.widget.core.client.tips.ToolTipConfig;
* *
*/ */
public class CSVExportConfigCard extends WizardCard { public class CSVExportConfigCard extends WizardCard {
private static final int LABEL_WIDTH = 128; private static final int LABEL_WIDTH = 128;
private static final int LABEL_PAD_WIDTH = 2; private static final int LABEL_PAD_WIDTH = 2;
private static final String DEFAULT_DELIMETER = ","; private static final String DEFAULT_DELIMETER = ",";
protected CSVExportSession exportSession; private static CSVExportWizardTDMessages msgs = GWT.create(CSVExportWizardTDMessages.class);
private CommonMessages msgsCommon;
private SimpleComboBox<String> encodings; private CSVExportSession exportSession;
private SimpleComboBox<String> comboEncodings;
private TextField customDelimiterField; private TextField customDelimiterField;
private Radio otherDelimiter; private Radio radioOtherDelimiter;
private Radio commaDelimiter; private Radio radioCommaDelimiter;
private Radio spaceDelimiter; private Radio radioSpaceDelimiter;
private Radio tabDelimiter; private Radio radioTabDelimiter;
private Radio semicoloDelimiter; private Radio radioSemicoloDelimiter;
private Radio viewColumnExportTrue; private Radio radioViewColumnExportTrue;
private Radio viewColumnExportFalse; private Radio radioViewColumnExportFalse;
protected ColumnDataGridPanel csvColumnGridPanel; protected ColumnDataGridPanel csvColumnGridPanel;
public CSVExportConfigCard(final CSVExportSession exportSession) {
super("CSV configuration", "");
public CSVExportConfigCard(final CSVExportSession exportSession) {
super(msgs.csvExportConfigCardHead(), "");
initMessages();
if (exportSession == null) { if (exportSession == null) {
Log.error("CSVExportSession is null"); Log.error("CSVExportSession is null");
} }
@ -81,6 +85,10 @@ public class CSVExportConfigCard extends WizardCard {
} }
protected void initMessages(){
msgsCommon = GWT.create(CommonMessages.class);
}
protected FormPanel createPanel() { protected FormPanel createPanel() {
FormPanel panel = new FormPanel(); FormPanel panel = new FormPanel();
panel.setLabelWidth(90); panel.setLabelWidth(90);
@ -89,21 +97,21 @@ public class CSVExportConfigCard extends WizardCard {
VerticalLayoutContainer content = new VerticalLayoutContainer(); VerticalLayoutContainer content = new VerticalLayoutContainer();
panel.add(content); panel.add(content);
encodings = new SimpleComboBox<String>( comboEncodings = new SimpleComboBox<String>(
new StringLabelProvider<String>()); new StringLabelProvider<String>());
encodings.setToolTip("The CSV file encoding"); comboEncodings.setToolTip(msgs.comboEncodingsToolTip());
encodings.setTabIndex(0); comboEncodings.setTabIndex(0);
encodings.setEditable(false); comboEncodings.setEditable(false);
encodings.setForceSelection(true); comboEncodings.setForceSelection(true);
encodings.setTriggerAction(TriggerAction.ALL); comboEncodings.setTriggerAction(TriggerAction.ALL);
encodings.addSelectionHandler(new SelectionHandler<String>() { comboEncodings.addSelectionHandler(new SelectionHandler<String>() {
public void onSelection(SelectionEvent<String> event) { public void onSelection(SelectionEvent<String> event) {
} }
}); });
encodings.focus(); comboEncodings.focus();
TDGWTServiceAsync.INSTANCE TDGWTServiceAsync.INSTANCE
.getAvailableCharset(new AsyncCallback<AvailableCharsetList>() { .getAvailableCharset(new AsyncCallback<AvailableCharsetList>() {
@ -115,9 +123,9 @@ public class CSVExportConfigCard extends WizardCard {
+ result.getDefaultCharset()); + result.getDefaultCharset());
for (String charset : result.getCharsetList()) for (String charset : result.getCharsetList())
encodings.add(charset); comboEncodings.add(charset);
encodings.setValue(result.getDefaultCharset()); comboEncodings.setValue(result.getDefaultCharset());
} }
@ -133,34 +141,34 @@ public class CSVExportConfigCard extends WizardCard {
} else { } else {
Log.error("Error loading charset list", caught); Log.error("Error loading charset list", caught);
showErrorAndHide("Error loading charset list", showErrorAndHide(msgs.errorLoadingCharsetListHead(),
"Error loading charset list:",caught.getLocalizedMessage() , caught); msgs.errorLoadingCharsetList(),caught.getLocalizedMessage() , caught);
} }
} }
}); });
FieldLabel fieldEncoding=new FieldLabel(encodings, "File encoding"); FieldLabel comboEncodingsLabel=new FieldLabel(comboEncodings, msgs.comboEncodingsLabel());
fieldEncoding.setLabelWidth(LABEL_WIDTH); comboEncodingsLabel.setLabelWidth(LABEL_WIDTH);
fieldEncoding.setLabelPad(LABEL_PAD_WIDTH); comboEncodingsLabel.setLabelPad(LABEL_PAD_WIDTH);
content.add(fieldEncoding); content.add(comboEncodingsLabel);
// Delimiter // Delimiter
commaDelimiter = new Radio(); radioCommaDelimiter = new Radio();
commaDelimiter.setBoxLabel("Comma"); radioCommaDelimiter.setBoxLabel(msgs.radioCommaDelimiterLabel());
commaDelimiter.setValue(true); radioCommaDelimiter.setValue(true);
spaceDelimiter = new Radio(); radioSpaceDelimiter = new Radio();
spaceDelimiter.setBoxLabel("Space"); radioSpaceDelimiter.setBoxLabel(msgs.radioSpaceDelimiterLabel());
tabDelimiter = new Radio(); radioTabDelimiter = new Radio();
tabDelimiter.setBoxLabel("Tab"); radioTabDelimiter.setBoxLabel(msgs.radioTabDelimiterLabel());
semicoloDelimiter = new Radio(); radioSemicoloDelimiter = new Radio();
semicoloDelimiter.setBoxLabel("Semicolon"); radioSemicoloDelimiter.setBoxLabel(msgs.radioSemicolonDelimiterLabel());
otherDelimiter = new Radio(); radioOtherDelimiter = new Radio();
otherDelimiter.setBoxLabel("Other delimiter"); radioOtherDelimiter.setBoxLabel(msgs.radioOtherDelimiterLabel());
customDelimiterField = new TextField(); customDelimiterField = new TextField();
customDelimiterField.setEnabled(false); customDelimiterField.setEnabled(false);
@ -169,11 +177,11 @@ public class CSVExportConfigCard extends WizardCard {
customDelimiterField.setWidth(20); customDelimiterField.setWidth(20);
ToggleGroup delimitersGroup = new ToggleGroup(); ToggleGroup delimitersGroup = new ToggleGroup();
delimitersGroup.add(commaDelimiter); delimitersGroup.add(radioCommaDelimiter);
delimitersGroup.add(spaceDelimiter); delimitersGroup.add(radioSpaceDelimiter);
delimitersGroup.add(tabDelimiter); delimitersGroup.add(radioTabDelimiter);
delimitersGroup.add(semicoloDelimiter); delimitersGroup.add(radioSemicoloDelimiter);
delimitersGroup.add(otherDelimiter); delimitersGroup.add(radioOtherDelimiter);
delimitersGroup delimitersGroup
.addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() { .addValueChangeHandler(new ValueChangeHandler<HasValue<Boolean>>() {
@ -181,57 +189,57 @@ public class CSVExportConfigCard extends WizardCard {
public void onValueChange( public void onValueChange(
ValueChangeEvent<HasValue<Boolean>> event) { ValueChangeEvent<HasValue<Boolean>> event) {
customDelimiterField.setEnabled(otherDelimiter customDelimiterField.setEnabled(radioOtherDelimiter
.getValue()); .getValue());
if (!otherDelimiter.getValue()) if (!radioOtherDelimiter.getValue())
customDelimiterField.clearInvalid(); customDelimiterField.clearInvalid();
else else
customDelimiterField.validate(); customDelimiterField.validate();
if (otherDelimiter.getValue() if (radioOtherDelimiter.getValue()
&& !customDelimiterField.isValid()) && !customDelimiterField.isValid())
return; return;
} }
}); });
HorizontalPanel delimitersPanel = new HorizontalPanel(); HorizontalPanel delimitersPanel = new HorizontalPanel();
delimitersPanel.add(commaDelimiter); delimitersPanel.add(radioCommaDelimiter);
delimitersPanel.add(spaceDelimiter); delimitersPanel.add(radioSpaceDelimiter);
delimitersPanel.add(tabDelimiter); delimitersPanel.add(radioTabDelimiter);
delimitersPanel.add(semicoloDelimiter); delimitersPanel.add(radioSemicoloDelimiter);
delimitersPanel.add(otherDelimiter); delimitersPanel.add(radioOtherDelimiter);
delimitersPanel.add(customDelimiterField); delimitersPanel.add(customDelimiterField);
new ToolTip(delimitersPanel, new ToolTipConfig( new ToolTip(delimitersPanel, new ToolTipConfig(
"The delimiter use to delimit the CSV fields")); msgs.delimitersPanelToolTip()));
FieldLabel fieldDelimeter=new FieldLabel(delimitersPanel, "Delimiter"); FieldLabel fieldDelimeter=new FieldLabel(delimitersPanel, msgs.delimitersPanelLabel());
fieldDelimeter.setLabelWidth(LABEL_WIDTH); fieldDelimeter.setLabelWidth(LABEL_WIDTH);
fieldDelimeter.setLabelPad(LABEL_PAD_WIDTH); fieldDelimeter.setLabelPad(LABEL_PAD_WIDTH);
content.add(fieldDelimeter); content.add(fieldDelimeter);
// Export View Column // Export View Column
viewColumnExportTrue = new Radio(); radioViewColumnExportTrue = new Radio();
viewColumnExportTrue.setBoxLabel("True"); radioViewColumnExportTrue.setBoxLabel(msgs.radioViewColumnExportTrueLabel());
viewColumnExportTrue.setValue(true); radioViewColumnExportTrue.setValue(true);
viewColumnExportFalse = new Radio(); radioViewColumnExportFalse = new Radio();
viewColumnExportFalse.setBoxLabel("False"); radioViewColumnExportFalse.setBoxLabel(msgs.radioViewColumnExportFalseLabel());
ToggleGroup exportViewColumnGroup = new ToggleGroup(); ToggleGroup exportViewColumnGroup = new ToggleGroup();
exportViewColumnGroup.add(viewColumnExportTrue); exportViewColumnGroup.add(radioViewColumnExportTrue);
exportViewColumnGroup.add(viewColumnExportFalse); exportViewColumnGroup.add(radioViewColumnExportFalse);
HorizontalPanel viewColumnExportPanel = new HorizontalPanel(); HorizontalPanel viewColumnExportPanel = new HorizontalPanel();
viewColumnExportPanel.add(viewColumnExportTrue); viewColumnExportPanel.add(radioViewColumnExportTrue);
viewColumnExportPanel.add(viewColumnExportFalse); viewColumnExportPanel.add(radioViewColumnExportFalse);
new ToolTip(viewColumnExportPanel, new ToolTipConfig( new ToolTip(viewColumnExportPanel, new ToolTipConfig(
"Export View Columns Too")); msgs.viewColumnExportPanelToolTip()));
FieldLabel fieldViewColumns=new FieldLabel(viewColumnExportPanel, "Export View Columns"); FieldLabel viewColumnExportPanelLabel=new FieldLabel(viewColumnExportPanel, msgs.viewColumnExportPanelLabel());
fieldViewColumns.setLabelWidth(LABEL_WIDTH); viewColumnExportPanelLabel.setLabelWidth(LABEL_WIDTH);
fieldViewColumns.setLabelPad(LABEL_PAD_WIDTH); viewColumnExportPanelLabel.setLabelPad(LABEL_PAD_WIDTH);
content.add(fieldViewColumns); content.add(viewColumnExportPanelLabel);
// Column Selection Grid // Column Selection Grid
csvColumnGridPanel = new ColumnDataGridPanel(this); csvColumnGridPanel = new ColumnDataGridPanel(this);
@ -251,21 +259,21 @@ public class CSVExportConfigCard extends WizardCard {
} }
protected char getSelectedDelimiter() { protected char getSelectedDelimiter() {
if (otherDelimiter.getValue()) if (radioOtherDelimiter.getValue())
return customDelimiterField.getValue().charAt(0); return customDelimiterField.getValue().charAt(0);
if (commaDelimiter.getValue()) if (radioCommaDelimiter.getValue())
return ','; return ',';
if (spaceDelimiter.getValue()) if (radioSpaceDelimiter.getValue())
return ' '; return ' ';
if (tabDelimiter.getValue()) if (radioTabDelimiter.getValue())
return '\t'; return '\t';
if (semicoloDelimiter.getValue()) if (radioSemicoloDelimiter.getValue())
return ';'; return ';';
return DEFAULT_DELIMETER.charAt(0); return DEFAULT_DELIMETER.charAt(0);
} }
protected boolean getExportViewColumns() { protected boolean getExportViewColumns() {
if(viewColumnExportTrue.getValue()){ if(radioViewColumnExportTrue.getValue()){
return true; return true;
} else { } else {
return false; return false;
@ -305,13 +313,13 @@ public class CSVExportConfigCard extends WizardCard {
ArrayList<ColumnData> columns = csvColumnGridPanel.getSelectedItems(); ArrayList<ColumnData> columns = csvColumnGridPanel.getSelectedItems();
if (columns.size() == 0) { if (columns.size() == 0) {
d = new AlertMessageBox("Attention", "No columns selected"); d = new AlertMessageBox(msgsCommon.attention(), msgs.noColumnSelected());
d.addHideHandler(hideHandler); d.addHideHandler(hideHandler);
d.setModal(false); d.setModal(false);
d.show(); d.show();
} else { } else {
exportSession.setColumns(columns); exportSession.setColumns(columns);
exportSession.setEncoding(encodings.getCurrentValue()); exportSession.setEncoding(comboEncodings.getCurrentValue());
exportSession.setSeparator(String.valueOf(getSelectedDelimiter())); exportSession.setSeparator(String.valueOf(getSelectedDelimiter()));
exportSession.setExportViewColumns(getExportViewColumns()); exportSession.setExportViewColumns(getExportViewColumns());
useWorkspaceDestination(); useWorkspaceDestination();
@ -345,13 +353,13 @@ public class CSVExportConfigCard extends WizardCard {
if (caught instanceof TDGWTIsLockedException) { if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage()); Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error Locked", showErrorAndHide(msgsCommon.errorLocked(),
caught.getLocalizedMessage(), "", caught.getLocalizedMessage(), "",
caught); caught);
} else { } else {
showErrorAndHide( showErrorAndHide(
"Error", msgsCommon.error(),
"Error retrienving tabular resource info: ", msgs.errorRetrievingTabularResourceInfo(),
caught.getLocalizedMessage(), caught); caught.getLocalizedMessage(), caught);
} }

View File

@ -6,6 +6,9 @@ import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.EventBus;
/** /**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* *
*/ */
public class CSVExportWizardTD extends WizardWindow { public class CSVExportWizardTD extends WizardWindow {
@ -23,7 +26,6 @@ public class CSVExportWizardTD extends WizardWindow {
super(title, eventBus); super(title, eventBus);
setWidth(WIZARDWIDTH); setWidth(WIZARDWIDTH);
exportSession = new CSVExportSession(); exportSession = new CSVExportSession();
CSVExportConfigCard csvExportConfigCard = new CSVExportConfigCard( CSVExportConfigCard csvExportConfigCard = new CSVExportConfigCard(

View File

@ -2,14 +2,28 @@ package org.gcube.portlets.user.td.csvexportwidget.client;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.shared.GWT;
import com.google.web.bindery.event.shared.SimpleEventBus; import com.google.web.bindery.event.shared.SimpleEventBus;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class CSVExportWizardTDEntry implements EntryPoint { public class CSVExportWizardTDEntry implements EntryPoint {
private CSVExportWizardTDMessages msgs;
public void onModuleLoad() { public void onModuleLoad() {
initMessage();
SimpleEventBus eventBus=new SimpleEventBus(); SimpleEventBus eventBus=new SimpleEventBus();
CSVExportWizardTD exportWizard= new CSVExportWizardTD("CSVExport",eventBus); CSVExportWizardTD exportWizard= new CSVExportWizardTD(msgs.csvExportWizardHead(),eventBus);
Log.info(exportWizard.getId()); Log.info(exportWizard.getId());
} }
protected void initMessage(){
msgs = GWT.create(CSVExportWizardTDMessages.class);
}
} }

View File

@ -0,0 +1,125 @@
package org.gcube.portlets.user.td.csvexportwidget.client;
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 CSVExportWizardTDMessages extends Messages {
@DefaultMessage("CSV Export")
String csvExportWizardHead();
@DefaultMessage("CSV configuration")
String csvExportConfigCardHead();
@DefaultMessage("Error loading charset list")
String errorLoadingCharsetListHead();
@DefaultMessage("Error loading charset list:")
String errorLoadingCharsetList();
@DefaultMessage("The CSV file encoding")
String comboEncodingsToolTip();
@DefaultMessage("File encoding")
String comboEncodingsLabel();
@DefaultMessage("The CSV file header")
String comboHeaderToolTip();
@DefaultMessage("Header")
String comboHeaderLabel();
@DefaultMessage("Comma")
String radioCommaDelimiterLabel();
@DefaultMessage("Space")
String radioSpaceDelimiterLabel();
@DefaultMessage("Tab")
String radioTabDelimiterLabel();
@DefaultMessage("Semicolon")
String radioSemicolonDelimiterLabel();
@DefaultMessage("Other delimiter")
String radioOtherDelimiterLabel();
@DefaultMessage("The delimiter use to delimit the CSV fields")
String delimitersPanelToolTip();
@DefaultMessage("Delimiter")
String delimitersPanelLabel();
@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("CSV Export in Workspace")
String csvWorkspaceSelectionCardHead();
@DefaultMessage("Name")
String nameLabel();
@DefaultMessage("Description")
String descriptionLabel();
@DefaultMessage("Workspace Selection")
String workspaceExplorerHead();
@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("CSV destination selection")
String destinationSelectionCardHead();
@DefaultMessage("Download File")
String downloadFileCardHead();
@DefaultMessage("Destination: ")
String csvOperationInProgressCardDestinationLabel();
@DefaultMessage("Name: ")
String csvOperationInProgressCardNameLabel();
@DefaultMessage("Description: ")
String csvOperationInProgressCardDescriptionLabel();
@DefaultMessage("Export Summary")
String summaryExport();
@DefaultMessage("An error occured in exportCSV:")
String errorInCSVExport();
@DefaultMessage("Columns")
String columnDataGridPanelHead();
}

View File

@ -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.gwtservice.shared.exception.TDGWTSessionExpiredException;
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,17 +38,16 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou
*/ */
public class CSVOperationInProgressCard extends WizardCard implements public class CSVOperationInProgressCard extends WizardCard implements
MonitorDialogListener { MonitorDialogListener {
private static CommonMessages msgsCommon = GWT.create(CommonMessages.class);
protected CSVOperationInProgressCard thisCard; private CSVExportWizardTDMessages msgs;
protected CSVExportSession exportSession; private CSVExportSession exportSession;
protected TRId newTrId; private TRId newTrId;
protected HtmlLayoutContainer resultField; private HtmlLayoutContainer resultField;
public CSVOperationInProgressCard(final CSVExportSession exportSession) { public CSVOperationInProgressCard(final CSVExportSession exportSession) {
super("Operation In Progress", ""); super(msgsCommon.operationInProgress(), "");
this.exportSession = exportSession; this.exportSession = exportSession;
thisCard = this; initMessages();
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer(); VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER); operationInProgressPanel.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
@ -58,19 +59,31 @@ public class CSVOperationInProgressCard extends WizardCard implements
description.setBorderWidth(0); description.setBorderWidth(0);
// display:block;vertical-align:text-top; // display:block;vertical-align:text-top;
description.setHTML(0, 0, description.setHTML(
"<span style=\"font-weight:bold;\";>Destination: </span>"); 0,
0,
"<span style=\"font-weight:bold;\";>"
+ msgs.csvOperationInProgressCardDestinationLabel()
+ "</span>");
description.setText(0, 1, exportSession.getDestination().getName()); description.setText(0, 1, exportSession.getDestination().getName());
description.setHTML(1, 0, description.setHTML(
"<span style=\"font-weight:bold;\";>File Name: </span>"); 1,
0,
"<span style=\"font-weight:bold;\";>"
+ msgs.csvOperationInProgressCardNameLabel()
+ "</span>");
description.setText(1, 1, exportSession.getFileName()); description.setText(1, 1, exportSession.getFileName());
description.setHTML(2, 0, description.setHTML(
"<span style=\"font-weight:bold;\";>File Description: </span>"); 2,
0,
"<span style=\"font-weight:bold;\";>"
+ msgs.csvOperationInProgressCardDescriptionLabel()
+ "</span>");
description.setText(2, 1, exportSession.getFileDescription()); description.setText(2, 1, exportSession.getFileDescription());
FramedPanel summary = new FramedPanel(); FramedPanel summary = new FramedPanel();
summary.setHeadingText("Export Summary"); summary.setHeadingText(msgs.summaryExport());
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,
@ -86,6 +99,10 @@ public class CSVOperationInProgressCard extends WizardCard implements
} }
protected void initMessages() {
msgs = GWT.create(CSVExportWizardTDMessages.class);
}
public void exportCSV() { public void exportCSV() {
TDGWTServiceAsync.INSTANCE.startCSVExport(exportSession, TDGWTServiceAsync.INSTANCE.startCSVExport(exportSession,
new AsyncCallback<String>() { new AsyncCallback<String>() {
@ -104,13 +121,13 @@ public class CSVOperationInProgressCard extends WizardCard implements
} else { } else {
if (caught instanceof TDGWTIsLockedException) { if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage()); Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error Locked", showErrorAndHide(msgsCommon.errorLocked(),
caught.getLocalizedMessage(), "", caught); caught.getLocalizedMessage(), "",
} else {
showErrorAndHide("Error in exportCSV",
"An error occured in exportCSV: ",
caught.getLocalizedMessage(),
caught); caught);
} else {
showErrorAndHide(msgsCommon.error(),
msgs.errorInCSVExport(),
caught.getLocalizedMessage(), caught);
} }
} }
@ -140,7 +157,8 @@ public class CSVOperationInProgressCard extends WizardCard implements
newTrId = operationResult.getTrId(); 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);
@ -171,7 +189,8 @@ public class CSVOperationInProgressCard extends WizardCard implements
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) {
@ -180,19 +199,20 @@ public class CSVOperationInProgressCard extends WizardCard implements
new SessionExpiredEvent( new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER)); SessionExpiredType.EXPIREDONSERVER));
} else { } else {
showErrorAndHide("Error in CSV Export", showErrorAndHide("Error in CSV Export", reason, details, caught);
reason,details, caught);
} }
forceLayout(); forceLayout();
} }
@Override @Override
public void operationStopped(OperationResult operationResult, String reason, String details) { public void operationStopped(OperationResult operationResult,
String reason, String details) {
newTrId = operationResult.getTrId(); 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;'>Problems in the Operation</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);
@ -224,7 +244,8 @@ public class CSVOperationInProgressCard extends WizardCard implements
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);
@ -254,7 +275,8 @@ public class CSVOperationInProgressCard extends WizardCard implements
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

@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
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 org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener; import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectPanel; 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 org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
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.widget.core.client.FramedPanel; import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox; import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
@ -32,6 +34,8 @@ import com.sencha.gxt.widget.core.client.form.validator.EmptyValidator;
* *
*/ */
public class CSVWorkSpaceSelectionCard extends WizardCard { public class CSVWorkSpaceSelectionCard extends WizardCard {
private static CSVExportWizardTDMessages msgs = GWT.create(CSVExportWizardTDMessages.class);
private CommonMessages msgsCommon;
private CSVExportSession exportSession; private CSVExportSession exportSession;
private CSVWorkSpaceSelectionCard thisCard; private CSVWorkSpaceSelectionCard thisCard;
@ -39,14 +43,15 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
private TextField fileDescription; private TextField fileDescription;
private VerticalLayoutContainer p; private VerticalLayoutContainer p;
private WorkspaceExplorerSelectPanel wpanel; private WorkspaceExplorerSelectPanel workspaceExplorerPanel;
public CSVWorkSpaceSelectionCard(final CSVExportSession exportSession) { public CSVWorkSpaceSelectionCard(final CSVExportSession exportSession) {
super("CSV Export in Workspace", ""); super(msgs.csvWorkspaceSelectionCardHead(), "");
this.exportSession = exportSession; this.exportSession = exportSession;
thisCard = this; thisCard = this;
initMessages();
FramedPanel formPanel = new FramedPanel(); FramedPanel formPanel = new FramedPanel();
formPanel.setHeaderVisible(false); formPanel.setHeaderVisible(false);
p = new VerticalLayoutContainer(); p = new VerticalLayoutContainer();
@ -65,7 +70,7 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
fileName.setAllowBlank(false); fileName.setAllowBlank(false);
fileName.setWidth("410px"); fileName.setWidth("410px");
fileName.setValue(fileN); fileName.setValue(fileN);
p.add(new FieldLabel(fileName, "Name"), new VerticalLayoutData(1, p.add(new FieldLabel(fileName, msgs.nameLabel()), new VerticalLayoutData(1,
-1)); -1));
fileDescription = new TextField(); fileDescription = new TextField();
@ -73,7 +78,7 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
fileDescription.addValidator(new EmptyValidator<String>()); fileDescription.addValidator(new EmptyValidator<String>());
fileDescription.setWidth("410px"); fileDescription.setWidth("410px");
fileDescription.setValue("csv"); fileDescription.setValue("csv");
p.add(new FieldLabel(fileDescription, "Description"), p.add(new FieldLabel(fileDescription, msgs.descriptionLabel()),
new VerticalLayoutData(1, -1)); new VerticalLayoutData(1, -1));
@ -84,8 +89,8 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
List<ItemType> showableTypes = new ArrayList<ItemType>(); List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.add(ItemType.FOLDER); showableTypes.add(ItemType.FOLDER);
wpanel = new WorkspaceExplorerSelectPanel(new String( workspaceExplorerPanel = new WorkspaceExplorerSelectPanel(new String(
"Workspace Selection"),selectableTypes, showableTypes); msgs.workspaceExplorerHead()),selectableTypes, showableTypes);
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() { WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
@ -120,16 +125,20 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
} }
}; };
wpanel.addWorkspaceExplorerSelectNotificationListener(handler); workspaceExplorerPanel.addWorkspaceExplorerSelectNotificationListener(handler);
/// ///
p.add(new FieldLabel(wpanel, "Folder"), new VerticalLayoutData(1, 1)); p.add(new FieldLabel(workspaceExplorerPanel, msgs.workspaceExplorerPanelLabel()), new VerticalLayoutData(1, 1));
setContent(formPanel); setContent(formPanel);
} }
protected void initMessages(){
msgsCommon = GWT.create(CommonMessages.class);
}
protected void checkExportData() { protected void checkExportData() {
Log.debug("File Name:" + fileName.getCurrentValue() + " Item id: " Log.debug("File Name:" + fileName.getCurrentValue() + " Item id: "
+ exportSession.getItemId()); + exportSession.getItemId());
@ -157,22 +166,22 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
.getCurrentValue()); .getCurrentValue());
goNext(); goNext();
} else { } else {
d = new AlertMessageBox("Attention", "No folder selected"); d = new AlertMessageBox(msgsCommon.attention(), msgs.attentionNoFolderSelected());
d.addHideHandler(hideHandler); d.addHideHandler(hideHandler);
d.setModal(false); d.setModal(false);
d.show(); d.show();
} }
} else { } else {
d = new AlertMessageBox("Attention", d = new AlertMessageBox(msgsCommon.attention(),
"No valid file description"); msgs.attentionNoValidFileDescription());
d.addHideHandler(hideHandler); d.addHideHandler(hideHandler);
d.setModal(false); d.setModal(false);
d.show(); d.show();
} }
} else { } else {
d = new AlertMessageBox("Attention", "No valid file name"); d = new AlertMessageBox(msgsCommon.attention(), msgs.attentionNoValidFileName());
d.addHideHandler(hideHandler); d.addHideHandler(hideHandler);
d.setModal(false); d.setModal(false);
d.show(); d.show();
@ -187,7 +196,7 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
public void execute() { public void execute() {
Log.debug("CSVWorkSpaceSelectionCard Call sayNextCard wpanel:" Log.debug("CSVWorkSpaceSelectionCard Call sayNextCard wpanel:"
+ wpanel); + workspaceExplorerPanel);
checkExportData(); checkExportData();
} }

View File

@ -12,11 +12,13 @@ import org.gcube.portlets.user.td.gwtservice.shared.destination.WorkspaceDestina
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.tr.TabResource; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
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 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.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Command;
@ -33,18 +35,22 @@ import com.sencha.gxt.widget.core.client.form.Radio;
* *
*/ */
public class DestinationSelectionCard extends WizardCard { public class DestinationSelectionCard extends WizardCard {
private static CSVExportWizardTDMessages msgs = GWT.create(CSVExportWizardTDMessages.class);
private CommonMessages msgsCommon;
protected final CSVExportSession exportSession; private final CSVExportSession exportSession;
protected DestinationSelectionCard thisCard; private DestinationSelectionCard thisCard;
final FileDestination fileDestination = FileDestination.INSTANCE; private final FileDestination fileDestination = FileDestination.INSTANCE;
final WorkspaceDestination workspaceDestination = WorkspaceDestination.INSTANCE; private final WorkspaceDestination workspaceDestination = WorkspaceDestination.INSTANCE;
public DestinationSelectionCard(final CSVExportSession exportSession) { public DestinationSelectionCard(final CSVExportSession exportSession) {
super("CSV destination selection", ""); super(msgs.destinationSelectionCardHead(), "");
thisCard=this; thisCard=this;
this.exportSession = exportSession; this.exportSession = exportSession;
initMessages();
// Default // Default
exportSession.setDestination(workspaceDestination); exportSession.setDestination(workspaceDestination);
@ -53,6 +59,10 @@ public class DestinationSelectionCard extends WizardCard {
} }
protected void initMessages(){
msgsCommon = GWT.create(CommonMessages.class);
}
protected void create(){ protected void create(){
VerticalPanel destinationSelectionPanel = new VerticalPanel(); VerticalPanel destinationSelectionPanel = new VerticalPanel();
destinationSelectionPanel.setStylePrimaryName(res.wizardCSS() destinationSelectionPanel.setStylePrimaryName(res.wizardCSS()
@ -60,8 +70,8 @@ public class DestinationSelectionCard extends WizardCard {
Radio radioWorkspaceDestination = new Radio(); Radio radioWorkspaceDestination = new Radio();
radioWorkspaceDestination.setBoxLabel("<p style='display:inline-table;'><b>" radioWorkspaceDestination.setBoxLabel("<p style='display:inline-table;'><b>"
+ workspaceDestination.getName() + "</b><br>" + msgsCommon.workspaceDestinationName() + "</b><br>"
+ workspaceDestination.getDescription() + "</p>"); + msgsCommon.workspaceDestinationDescription() + "</p>");
radioWorkspaceDestination.setName(workspaceDestination.getName()); radioWorkspaceDestination.setName(workspaceDestination.getName());
radioWorkspaceDestination.setStylePrimaryName(res.wizardCSS() radioWorkspaceDestination.setStylePrimaryName(res.wizardCSS()
.getImportSelectionSource()); .getImportSelectionSource());
@ -70,8 +80,8 @@ public class DestinationSelectionCard extends WizardCard {
Radio radioFileDestination = new Radio(); Radio radioFileDestination = new Radio();
radioFileDestination.setBoxLabel("<p style='display:inline-table;'><b>" radioFileDestination.setBoxLabel("<p style='display:inline-table;'><b>"
+ fileDestination.getName() + "</b><br>" + msgsCommon.fileDestinationName() + "</b><br>"
+ fileDestination.getDescription() + "</p>"); + msgsCommon.fileDestinationDescription() + "</p>");
radioFileDestination.setName(fileDestination.getName()); radioFileDestination.setName(fileDestination.getName());
radioFileDestination.setStylePrimaryName(res.wizardCSS() radioFileDestination.setStylePrimaryName(res.wizardCSS()
.getImportSelectionSource()); .getImportSelectionSource());
@ -138,13 +148,13 @@ public class DestinationSelectionCard extends WizardCard {
if (caught instanceof TDGWTIsLockedException) { if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage()); Log.error(caught.getLocalizedMessage());
showErrorAndHide("Error Locked", showErrorAndHide(msgsCommon.errorLocked(),
caught.getLocalizedMessage(), "", caught.getLocalizedMessage(), "",
caught); caught);
} else { } else {
showErrorAndHide( showErrorAndHide(
"Error", msgsCommon.error(),
"Error retrienving tabular resource info: ", msgs.errorRetrievingTabularResourceInfo(),
caught.getLocalizedMessage(), caught); caught.getLocalizedMessage(), caught);
} }

View File

@ -5,10 +5,10 @@ package org.gcube.portlets.user.td.csvexportwidget.client;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
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;
/** /**
@ -18,13 +18,14 @@ import com.google.gwt.user.client.Command;
* *
*/ */
public class DownloadFileCard extends WizardCard { public class DownloadFileCard extends WizardCard {
protected CSVExportSession exportSession; //private CSVExportSession exportSession;
protected DownloadFileCard thisCard; private static CSVExportWizardTDMessages msgs = GWT.create(CSVExportWizardTDMessages.class);
private DownloadFileCard thisCard;
public DownloadFileCard(final CSVExportSession exportSession) { public DownloadFileCard(final CSVExportSession exportSession) {
super("Download File", ""); super(msgs.downloadFileCardHead(), "");
this.thisCard = this; this.thisCard = this;
this.exportSession = exportSession; //this.exportSession = exportSession;

View File

@ -3,9 +3,11 @@ package org.gcube.portlets.user.td.csvexportwidget.client.grid;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.gcube.portlets.user.td.csvexportwidget.client.CSVExportWizardTDMessages;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; 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.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.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;
@ -38,6 +40,12 @@ import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel; import com.sencha.gxt.widget.core.client.grid.ColumnModel;
import com.sencha.gxt.widget.core.client.grid.Grid; import com.sencha.gxt.widget.core.client.grid.Grid;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ColumnDataGridPanel extends ContentPanel implements public class ColumnDataGridPanel extends ContentPanel implements
HasSelectionHandlers<ColumnData> { HasSelectionHandlers<ColumnData> {
//private static final String GRID_WIDTH ="524px"; //private static final String GRID_WIDTH ="524px";
@ -45,15 +53,19 @@ public class ColumnDataGridPanel extends ContentPanel implements
private static final ColumnDataProperties props = GWT private static final ColumnDataProperties props = GWT
.create(ColumnDataProperties.class); .create(ColumnDataProperties.class);
private final CheckBoxSelectionModel<ColumnData> sm; private final CheckBoxSelectionModel<ColumnData> sm;
private final Grid<ColumnData> grid; private final Grid<ColumnData> grid;
private CommonMessages msgsCommon;
private CSVExportWizardTDMessages msgs;
private WizardCard parent; private WizardCard parent;
public ColumnDataGridPanel(WizardCard parent) { public ColumnDataGridPanel(WizardCard parent) {
this.parent=parent; this.parent=parent;
Log.debug("ColumnDataGridPanel"); Log.debug("ColumnDataGridPanel");
setHeadingText("Columns"); initMessages();
setHeadingText(msgs.columnDataGridPanelHead());
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>( ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
props.label()); props.label());
@ -117,6 +129,11 @@ public class ColumnDataGridPanel extends ContentPanel implements
} }
protected void initMessages(){
msgsCommon = GWT.create(CommonMessages.class);
msgs = GWT.create(CSVExportWizardTDMessages.class);
}
public Grid<ColumnData> getGrid() { public Grid<ColumnData> getGrid() {
return grid; return grid;
} }
@ -135,7 +152,7 @@ public class ColumnDataGridPanel extends ContentPanel implements
} else { } else {
if (caught instanceof TDGWTIsLockedException) { if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage()); Log.error(caught.getLocalizedMessage());
parent.showErrorAndHide("Error Locked", parent.showErrorAndHide(msgsCommon.errorLocked(),
caught.getLocalizedMessage(), "", caught); caught.getLocalizedMessage(), "", caught);
} else { } else {

View File

@ -7,6 +7,12 @@ import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider; import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess; import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface ColumnDataProperties extends public interface ColumnDataProperties extends
PropertyAccess<ColumnData> { PropertyAccess<ColumnData> {

View File

@ -2,21 +2,24 @@
<module rename-to='CSVExportWizardTD'> <module rename-to='CSVExportWizardTD'>
<!-- Inherit the core Web Toolkit stuff. --> <!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' /> <inherits name='com.google.gwt.user.User' />
<!-- <inherits name="com.google.gwt.i18n.I18N" /> -->
<!-- We need the JUnit module in the main module, --> <!-- We need the JUnit module in the main module, -->
<!-- otherwise eclipse complains (Google plugin bug?) --> <!-- otherwise eclipse complains (Google plugin bug?) -->
<inherits name='com.google.gwt.junit.JUnit' /> <inherits name='com.google.gwt.junit.JUnit' />
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.standard.Standard' />
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits --> <!-- Other module inherits -->
<inherits name='com.sencha.gxt.ui.GXT' /> <inherits name='com.sencha.gxt.ui.GXT' />
<!-- GXT Theme -->
<!-- <inherits name='com.sencha.gxt.theme.blue.Blue' /> -->
<!-- <inherits name='com.sencha.gxt.theme.gray.Gray' /> -->
<!-- Be sure to include Neptunes gxt-theme-neptune.jar in the classpath -->
<!-- <inherits name='com.sencha.gxt.theme.neptune.Theme' /> -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" /> <inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' /> <inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' /> <inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' /> <inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
@ -24,7 +27,33 @@
<inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' /> <inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<!-- <entry-point class='org.gcube.portlets.user.SDMXImportWizardTD.client.SDMXImportWizardTDEntry' /> --> <!-- <entry-point class='org.gcube.portlets.user.SDMXImportWizardTD.client.SDMXImportWizardTDEntry'
/> -->
<!-- <set-configuration-property name="locale.cookie" value="TDLangCookie"
/> <set-configuration-property name="locale.queryparam" value="TDLang" />
<set-configuration-property name="locale.usemeta" value="Y" /> <set-configuration-property
name="locale.useragent" value="Y" /> <set-configuration-property name="locale.searchorder"
value="cookie,queryparam,meta,useragent" /> <extend-property name="locale"
values="en" /> <extend-property name="locale" values="it" /> <extend-property
name="locale" values="es" /> <set-property name="locale" value="en, it, es"
/> <set-property-fallback name="locale" value="en" /> -->
<!-- <set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
/> -->
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED"
/> -->
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="DISABLED"
/> -->
<!-- Specify the paths for translatable code --> <!-- Specify the paths for translatable code -->
<source path='client' /> <source path='client' />

View File

@ -0,0 +1,37 @@
csvExportWizardHead = CSV Export
csvExportConfigCardHead = CSV configuration
errorLoadingCharsetListHead = Error loading charset list
errorLoadingCharsetList = Error loading charset list:
comboEncodingsToolTip = The CSV file encoding
comboEncodingsLabel = File encoding
comboHeaderToolTip = The CSV file header
comboHeaderLabel = Header
radioCommaDelimiterLabel = Comma
radioSpaceDelimiterLabel = Space
radioTabDelimiterLabel = Tab
radioSemicolonDelimiterLabel = Semicolon
radioOtherDelimiterLabel = Other delimiter
delimitersPanelToolTip = The delimiter use to delimit the CSV fields
delimitersPanelLabel = Delimiter
radioViewColumnExportTrueLabel = True
radioViewColumnExportFalseLabel = False
viewColumnExportPanelToolTip = Export View Columns Too
viewColumnExportPanelLabel = Export View Columns
noColumnSelected = No column selected
errorRetrievingTabularResourceInfo = Error retrieving tabular resource info:
csvWorkspaceSelectionCardHead = CSV Export in Workspace
nameLabel = Name
descriptionLabel = Description
workspaceExplorerHead = Workspace Selection
workspaceExplorerPanelLabel = Folder
attentionNoFolderSelected = No folder selected!
attentionNoValidFileDescription = No valid file description!
attentionNoValidFileName = No valid file name!
destinationSelectionCardHead = CSV destination selection
downloadFileCardHead = Download File
csvOperationInProgressCardDestinationLabel = Destination:
csvOperationInProgressCardNameLabel = Name:
csvOperationInProgressCardDescriptionLabel = Description:
summaryExport = Export Summary
errorInCSVExport = An error occured in exportCSV:
columnDataGridPanelHead = Columns

View File

@ -0,0 +1,37 @@
csvExportWizardHead = Exportación CSV
csvExportConfigCardHead = Configuración CSV
errorLoadingCharsetListHead = Error al cargar la lista de formatos de caracteres
errorLoadingCharsetList = Error al cargar la lista de formatos de caracteres:
comboEncodingsToolTip = CSV archivo codificación
comboEncodingsLabel = Codificación
comboHeaderToolTip = CSV archivo encabezamiento
comboHeaderLabel = Encabezamiento
radioCommaDelimiterLabel = Coma
radioSpaceDelimiterLabel = Space
radioTabDelimiterLabel = Tab
radioSemicolonDelimiterLabel = Punto y Coma
radioOtherDelimiterLabel = Otro
delimitersPanelToolTip = El delimitador utilizado para delimitar campos CSV
delimitersPanelLabel = Delimitator
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:
csvWorkspaceSelectionCardHead = Exporta CSV desde Workspace
nameLabel = Nombre
descriptionLabel = Descripción
workspaceExplorerHead = 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 CSV
downloadFileCardHead = Descarga Archivo
csvOperationInProgressCardDestinationLabel = Destino:
csvOperationInProgressCardNameLabel = Nombre:
csvOperationInProgressCardDescriptionLabel = Descripción:
summaryExport = Resumen de la Exportacione
errorInCSVExport = Se produjo un error en la exportación de CSV:
columnDataGridPanelHead = Columnas

View File

@ -0,0 +1,37 @@
csvExportWizardHead = Esporta CSV
csvExportConfigCardHead = Configurazione CSV
errorLoadingCharsetListHead = Errore caricando la lista dei formati dei caratteri
errorLoadingCharsetList = Errore caricando la lista dei formati dei caratteri:
comboEncodingsToolTip = CSV file codifica
comboEncodingsLabel = File codifica
comboHeaderToolTip = CSV file intestazione
comboHeaderLabel = Intestazione
radioCommaDelimiterLabel = Virgola
radioSpaceDelimiterLabel = Spazio
radioTabDelimiterLabel = Tab
radioSemicolonDelimiterLabel = Punto e Virgola
radioOtherDelimiterLabel = Altro
delimitersPanelToolTip = Il delimitatore usato per delimitare i campi nel CSV
delimitersPanelLabel = Delimitatore
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
workspaceExplorerHead = 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

View File

@ -1,2 +0,0 @@
sendButton = Send
nameField = Enter your name

View File

@ -1,2 +0,0 @@
sendButton = Envoyer
nameField = Entrez votre nom

View File

@ -1,7 +1,9 @@
The gCube System - ${name} 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 Authors
------- -------

View File

@ -6,7 +6,7 @@
<Description>${project.description}</Description> <Description>${project.description}</Description>
<Class>PortletsUser</Class> <Class>PortletsUser</Class>
<Name>${project.name}</Name> <Name>${project.name}</Name>
<Version>${version}</Version> <Version>1.0.0</Version>
<Packages> <Packages>
<Software> <Software>
<Description>${project.description}</Description> <Description>${project.description}</Description>