Added CSV Export

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@85624 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2013-11-18 15:08:28 +00:00
parent 19448f68d0
commit 547c5a893a
4 changed files with 67 additions and 7 deletions

19
pom.xml
View File

@ -124,7 +124,7 @@
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>workspace-light-tree</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
@ -132,7 +132,7 @@
<scope>provided</scope>
</dependency>
<!-- TD Source -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
@ -186,6 +186,12 @@
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-csv-export-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!--tabular-data-information-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
@ -199,7 +205,14 @@
<artifactId>tabular-data-gwt-service</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- tabular-data-wizard-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-wizard-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- LOGGING -->
<dependency>
<groupId>com.allen-sauer.gwt.log</groupId>

View File

@ -4,6 +4,7 @@
package org.gcube.portlets.user.td.client;
import org.gcube.portlets.user.td.sdmximportwidget.client.SDMXImportWizardTD;
import org.gcube.portlets.user.td.wizardwidget.client.WizardListener;
import org.gcube.portlets.user.td.client.event.CloseTabularResourceEvent;
import org.gcube.portlets.user.td.client.event.CloseTabularResourceType;
import org.gcube.portlets.user.td.client.event.ExportTableEvent;
@ -16,6 +17,7 @@ import org.gcube.portlets.user.td.client.event.OpenTabularResourceEvent;
import org.gcube.portlets.user.td.client.event.OpenTabularResourceType;
import org.gcube.portlets.user.td.client.event.UIStateEvent;
import org.gcube.portlets.user.td.client.event.UIStateType;
import org.gcube.portlets.user.td.csvexportwidget.client.CSVExportWizardTD;
import org.gcube.portlets.user.td.csvimportwidget.client.CSVImportWizardTD;
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
import org.gcube.portlets.user.td.informationwidget.client.TabularResourceProperties;
@ -243,7 +245,7 @@ public class TabularDataController {
openSDMXExportWizard();
break;
case CSV:
openSDMXExportWizard();
openCSVExportWizard();
break;
case JSON:
openSDMXExportWizard();
@ -398,7 +400,46 @@ public class TabularDataController {
}
protected void openCSVExportWizard() {
GWT.runAsync(new RunAsyncCallback() {
@Override
public void onSuccess() {
openWizard();
CSVExportWizardTD exportWizard = new CSVExportWizardTD(
"CSV Export");
exportWizard
.addListener(new WizardListener() {
@Override
public void failed(Throwable throwable,
String reason, String details) {
alertMessage(reason, details);
resumeUIState();
}
@Override
public void completed(TRId id) {
resumeUIState();
}
@Override
public void aborted() {
resumeUIState();
}
});
exportWizard.show();
}
@Override
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
});
}
protected void openSDMXExportWizard() {
/*

View File

@ -213,7 +213,7 @@ public class FileToolBar {
exportGroup.setId("Export");
exportGroup.setStyleName("ribbon");
exportGroup.setHeadingText("Export");
exportGroup.disable();
//exportGroup.disable();
toolBar.add(exportGroup);
FlexTable exportLayout = new FlexTable();
@ -221,6 +221,7 @@ public class FileToolBar {
exportSDMXButton = new TextButton("SDMX",
TabularDataResources.INSTANCE.sdmx32());
exportSDMXButton.disable();
exportSDMXButton.setToolTip("Export SDMX document");
exportSDMXButton.setScale(ButtonScale.LARGE);
exportSDMXButton.setIconAlign(IconAlign.TOP);
@ -238,6 +239,7 @@ public class FileToolBar {
exportCSVButton = new TextButton("CSV",
TabularDataResources.INSTANCE.csv());
exportCSVButton.disable();
exportCSVButton.setToolTip("Export CSV document");
exportCSVButton.addSelectHandler(new SelectHandler() {
@ -250,6 +252,7 @@ public class FileToolBar {
exportJSONButton = new TextButton("JSON",
TabularDataResources.INSTANCE.json());
exportJSONButton.disable();
exportJSONButton.setToolTip("Export JSON document");
exportJSONButton.addSelectHandler(new SelectHandler() {
@ -319,7 +322,7 @@ public class FileToolBar {
importCSVButton.enable();
importJSONButton.disable();
importSDMXButton.enable();
exportCSVButton.disable();
exportCSVButton.enable();
exportJSONButton.disable();
exportSDMXButton.disable();
break;

View File

@ -13,11 +13,14 @@
<!-- <inherits name='org.gcube.portlets.user.td.ciw.csvimporterwidget' /> -->
<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.informationwidget.Information' />
<inherits name='org.gcube.portlets.user.td.openwidget.TDOpen' />
<inherits name='org.gcube.portlets.user.td.sdmximportwidget.SDMXImportWizardTD' />
<!-- <inherits name='org.gcube.portlets.user.td.sdmxexportwidget.SDMXExportWizardTD' /> -->
<inherits name='org.gcube.portlets.user.td.csvimportwidget.CSVImportWizardTD' />
<inherits name='org.gcube.portlets.user.td.csvexportwidget.CSVExportWizardTD' />
<inherits name='org.gcube.portlets.widgets.lighttree.WorkspacePortletLightTree' />