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
This commit is contained in:
Giancarlo Panichi 2015-10-22 15:13:26 +00:00 committed by Giancarlo Panichi
parent b80172ae22
commit 160cfd64ee
18 changed files with 372 additions and 161 deletions

View File

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

View File

@ -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

View File

@ -38,7 +38,7 @@
<distroDirectory>${project.basedir}/distro</distroDirectory>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<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>
<distroDirectory>distro</distroDirectory>
<configDirectory>config</configDirectory>

View File

@ -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("<p style='display:inline-table;'><b>"
+ workspaceDestination.getName() + "</b><br>"
+ workspaceDestination.getDescription() + "</p>");
radioWorkspaceDestination
.setBoxLabel("<p style='display:inline-table;'><b>"
+ msgsCommon.workspaceDestinationName() + "</b><br>"
+ msgsCommon.workspaceDestinationDescription() + "</p>");
radioWorkspaceDestination.setName(workspaceDestination.getName());
radioWorkspaceDestination.setStylePrimaryName(res.wizardCSS()
.getImportSelectionSource());
radioWorkspaceDestination.setValue(true);
Radio radioFileDestination = new Radio();
radioFileDestination.setBoxLabel("<p style='display:inline-table;'><b>"
+ fileDestination.getName() + "</b><br>"
+ fileDestination.getDescription() + "</p>");
+ msgsCommon.fileDestinationName() + "</b><br>"
+ msgsCommon.fileDestinationDescription() + "</p>");
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<HasValue<Boolean>>() {
public void onValueChange(ValueChangeEvent<HasValue<Boolean>> 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<TabResource>() {
@ -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);
}
}

View File

@ -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();
}

View File

@ -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<ColumnData> 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<TabResource>() {
@ -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());
}

View File

@ -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: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
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);
}
}

View File

@ -0,0 +1,86 @@
package org.gcube.portlets.user.td.jsonexportwidget.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 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();
}

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.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,
"<span style=\"font-weight:bold;\";>Destination: </span>");
"<span style=\"font-weight:bold;\";>"+msgs.jsonOperationInProgressCardDestinationLabel()+"</span>");
description.setText(0, 1, exportSession.getDestination().getName());
description.setHTML(1, 0,
"<span style=\"font-weight:bold;\";>File Name: </span>");
"<span style=\"font-weight:bold;\";>"+msgs.jsonOperationInProgressCardNameLabel()+"</span>");
description.setText(1, 1, exportSession.getFileName());
description.setHTML(2, 0,
"<span style=\"font-weight:bold;\";>File Description: </span>");
"<span style=\"font-weight:bold;\";>"+msgs.jsonOperationInProgressCardDescriptionLabel()+"</span>");
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<String>() {
@ -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("<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.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("<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.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("<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.operationProblem()+"</div>");
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("<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.setVisible(true);
@ -253,7 +258,7 @@ public class JSONOperationInProgressCard extends WizardCard implements
public void operationPutInBackground() {
SafeHtmlBuilder safeHtmlBuilder = new 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.setVisible(true);

View File

@ -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<String>());
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<String>());
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<ItemType> showableTypes = new ArrayList<ItemType>();
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();
}

View File

@ -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<ColumnData> {
// 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<ColumnData> sm;
protected final Grid<ColumnData> grid;
private final CheckBoxSelectionModel<ColumnData> sm;
private final Grid<ColumnData> 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<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
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<ColumnData> 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);
}
}

View File

@ -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

View File

@ -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

View File

@ -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

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}
------------------------------------------------------------
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
-------

View File

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