ref #9944: TabMan - Enable Excel export operation for DataSet only

https://support.d4science.org/issues/#9944

Added operation



git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@162146 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-01-12 16:15:28 +00:00
parent fd08ff7c21
commit ba6481fc91
22 changed files with 141 additions and 19 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/tabular-data-manager-2.17.0-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/tabular-data-manager-2.18.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/tabular-data-manager-2.17.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" output="target/tabular-data-manager-2.18.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -45,5 +45,5 @@
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA.jar" sourcepath="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/> <classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA.jar" sourcepath="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/> <classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="output" path="target/tabular-data-manager-2.17.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/tabular-data-manager-2.18.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -1,4 +1,8 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="org.gcube.portlets-user.tabular-data-portlet.2-18-0"
date="2018-01-12">
<Change>Added Excel Dataset Export support [ticket #9944]</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.tabular-data-portlet.2-17-0" <Changeset component="org.gcube.portlets-user.tabular-data-portlet.2-17-0"
date="2017-12-13"> date="2017-12-13">
<Change>Enable SDMX export operation for DataSet only for the tables <Change>Enable SDMX export operation for DataSet only for the tables

11
pom.xml
View File

@ -13,7 +13,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-manager</artifactId> <artifactId>tabular-data-manager</artifactId>
<version>2.17.0-SNAPSHOT</version> <version>2.18.0-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
@ -430,7 +430,14 @@
<artifactId>tabular-data-json-export-widget</artifactId> <artifactId>tabular-data-json-export-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- tabular-data-excel-export-widget -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-excel-export-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- tabular-data-codelistmapping-import-widget --> <!-- tabular-data-codelistmapping-import-widget -->
<dependency> <dependency>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>

View File

@ -16,6 +16,7 @@ import org.gcube.portlets.user.td.columnwidget.client.batch.ReplaceBatchDialog;
import org.gcube.portlets.user.td.columnwidget.client.replace.ReplaceAllDialog; import org.gcube.portlets.user.td.columnwidget.client.replace.ReplaceAllDialog;
import org.gcube.portlets.user.td.csvexportwidget.client.CSVExportWizardTD; import org.gcube.portlets.user.td.csvexportwidget.client.CSVExportWizardTD;
import org.gcube.portlets.user.td.csvimportwidget.client.CSVImportWizardTD; import org.gcube.portlets.user.td.csvimportwidget.client.CSVImportWizardTD;
import org.gcube.portlets.user.td.excelexportwidget.client.ExcelExportWizardTD;
import org.gcube.portlets.user.td.expressionwidget.client.MultiColumnFilterDialog; import org.gcube.portlets.user.td.expressionwidget.client.MultiColumnFilterDialog;
import org.gcube.portlets.user.td.expressionwidget.client.ReplaceColumnByMultiColumnExpressionDialog; import org.gcube.portlets.user.td.expressionwidget.client.ReplaceColumnByMultiColumnExpressionDialog;
import org.gcube.portlets.user.td.expressionwidget.client.RowsDeleteByMultiColumnExpressionDialog; import org.gcube.portlets.user.td.expressionwidget.client.RowsDeleteByMultiColumnExpressionDialog;
@ -830,6 +831,9 @@ public class TabularDataController {
case EXPORT_SDMX: case EXPORT_SDMX:
openSDMXExportWizard(); openSDMXExportWizard();
break; break;
case EXPORT_EXCEL:
openExcelExportWizard();
break;
case EXPORT_CSV: case EXPORT_CSV:
openCSVExportWizard(); openCSVExportWizard();
break; break;
@ -1049,6 +1053,7 @@ public class TabularDataController {
case TEST: case TEST:
testFeauture(); testFeauture();
break; break;
case IMPORT_EXCEL:
default: default:
break; break;
} }
@ -1309,6 +1314,49 @@ public class TabularDataController {
}); });
} }
private void openExcelExportWizard() {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
openWizard();
ExcelExportWizardTD exportWizard = new ExcelExportWizardTD(msgs
.excelExport(), eventBus);
exportWizard.addListener(new WizardListener() {
public void failed(String title, String message,
String details, Throwable throwable) {
UtilsGXT3.alert(title, message + " " + details);
resumeUIState();
}
public void completed(TRId id) {
resumeUIState();
}
@Override
public void putInBackground() {
Log.debug("PutInBakground");
resumeUIState();
}
public void aborted() {
resumeUIState();
}
});
exportWizard.show();
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
});
}
private void openExtractCodelistWizard() { private void openExtractCodelistWizard() {
GWT.runAsync(new RunAsyncCallback() { GWT.runAsync(new RunAsyncCallback() {

View File

@ -40,6 +40,9 @@ public interface TabularDataControllerMessages extends Messages {
@DefaultMessage("SDMX Import") @DefaultMessage("SDMX Import")
String sdmxImport(); String sdmxImport();
@DefaultMessage("Excel Import")
String excelImport();
@DefaultMessage("CSV Export") @DefaultMessage("CSV Export")
String csvExport(); String csvExport();
@ -49,6 +52,9 @@ public interface TabularDataControllerMessages extends Messages {
@DefaultMessage("SDMX Export") @DefaultMessage("SDMX Export")
String sdmxExport(); String sdmxExport();
@DefaultMessage("Excel Export")
String excelExport();
@DefaultMessage("Extract Codelist") @DefaultMessage("Extract Codelist")
String extractCodelist(); String extractCodelist();

View File

@ -69,7 +69,13 @@ public interface TabularDataResources extends ClientBundle {
@Source("sdmx_32.png") @Source("sdmx_32.png")
ImageResource sdmx32(); ImageResource sdmx32();
@Source("excel.png")
ImageResource excel();
@Source("excel_32.png")
ImageResource excel32();
@Source("gis.png") @Source("gis.png")
ImageResource gis(); ImageResource gis();

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 805 B

View File

@ -54,7 +54,9 @@ public class FileToolBar {
private TextButton importCSVButton; private TextButton importCSVButton;
// private TextButton importJSONButton; // private TextButton importJSONButton;
private TextButton importSDMXButton; private TextButton importSDMXButton;
private TextButton exportSDMXButton; private TextButton exportSDMXButton;
private TextButton exportExcelButton;
private TextButton exportCSVButton; private TextButton exportCSVButton;
private TextButton exportJSONButton; private TextButton exportJSONButton;
@ -272,12 +274,9 @@ public class FileToolBar {
exportGroup.add(exportLayout); exportGroup.add(exportLayout);
exportSDMXButton = new TextButton(msgs.exportSDMXButton(), exportSDMXButton = new TextButton(msgs.exportSDMXButton(),
TabularDataResources.INSTANCE.sdmx32()); TabularDataResources.INSTANCE.sdmx());
exportSDMXButton.disable(); exportSDMXButton.disable();
exportSDMXButton.setToolTip(msgs.exportSDMXButtonToolTip()); exportSDMXButton.setToolTip(msgs.exportSDMXButtonToolTip());
exportSDMXButton.setScale(ButtonScale.LARGE);
exportSDMXButton.setIconAlign(IconAlign.TOP);
exportSDMXButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
exportSDMXButton.addSelectHandler(new SelectHandler() { exportSDMXButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
@ -286,8 +285,19 @@ public class FileToolBar {
}); });
exportLayout.setWidget(0, 0, exportSDMXButton); exportLayout.setWidget(0, 0, exportSDMXButton);
exportLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
exportExcelButton = new TextButton(msgs.exportExcelButton(),
TabularDataResources.INSTANCE.excel());
exportExcelButton.disable();
exportExcelButton.setToolTip(msgs.exportExcelButtonToolTip());
exportExcelButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.EXPORT_EXCEL));
}
});
exportLayout.setWidget(1, 0, exportExcelButton);
exportCSVButton = new TextButton(msgs.exportCSVButton(), exportCSVButton = new TextButton(msgs.exportCSVButton(),
TabularDataResources.INSTANCE.csv()); TabularDataResources.INSTANCE.csv());
exportCSVButton.disable(); exportCSVButton.disable();
@ -298,7 +308,7 @@ public class FileToolBar {
eventBus.fireEvent(new RibbonEvent(RibbonType.EXPORT_CSV)); eventBus.fireEvent(new RibbonEvent(RibbonType.EXPORT_CSV));
} }
}); });
exportLayout.setWidget(0, 2, exportCSVButton); exportLayout.setWidget(0, 1, exportCSVButton);
exportJSONButton = new TextButton(msgs.exportJSONButton(), exportJSONButton = new TextButton(msgs.exportJSONButton(),
TabularDataResources.INSTANCE.json()); TabularDataResources.INSTANCE.json());
@ -310,7 +320,7 @@ public class FileToolBar {
eventBus.fireEvent(new RibbonEvent(RibbonType.EXPORT_JSON)); eventBus.fireEvent(new RibbonEvent(RibbonType.EXPORT_JSON));
} }
}); });
exportLayout.setWidget(1, 2, exportJSONButton); exportLayout.setWidget(1, 1, exportJSONButton);
cleanCells(exportLayout.getElement()); cleanCells(exportLayout.getElement());
// TimeLine (Tasks) // TimeLine (Tasks)
@ -559,6 +569,7 @@ public class FileToolBar {
exportCSVButton.disable(); exportCSVButton.disable();
exportJSONButton.disable(); exportJSONButton.disable();
exportSDMXButton.disable(); exportSDMXButton.disable();
exportExcelButton.disable();
timelineButton.disable(); timelineButton.disable();
backgroundButton.enable(); backgroundButton.enable();
historyButton.disable(); historyButton.disable();
@ -579,6 +590,7 @@ public class FileToolBar {
exportCSVButton.disable(); exportCSVButton.disable();
exportJSONButton.disable(); exportJSONButton.disable();
exportSDMXButton.disable(); exportSDMXButton.disable();
exportExcelButton.disable();
timelineButton.disable(); timelineButton.disable();
backgroundButton.enable(); backgroundButton.enable();
historyButton.disable(); historyButton.disable();
@ -609,6 +621,17 @@ public class FileToolBar {
} else { } else {
exportSDMXButton.disable(); exportSDMXButton.disable();
} }
if (trId != null
&& trId.getTableTypeName() != null
&& (trId
.getTableTypeName().compareTo(
TableType.DATASET.getTableTypeLabel()) == 0)) {
exportExcelButton.enable();
} else {
exportExcelButton.disable();
}
exportCSVButton.enable(); exportCSVButton.enable();
exportJSONButton.enable(); exportJSONButton.enable();
timelineButton.enable(); timelineButton.enable();
@ -630,6 +653,7 @@ public class FileToolBar {
exportCSVButton.disable(); exportCSVButton.disable();
exportJSONButton.disable(); exportJSONButton.disable();
exportSDMXButton.disable(); exportSDMXButton.disable();
exportExcelButton.disable();
timelineButton.disable(); timelineButton.disable();
backgroundButton.disable(); backgroundButton.disable();
historyButton.disable(); historyButton.disable();

View File

@ -85,6 +85,12 @@ public interface FileToolBarMessages extends Messages {
@DefaultMessage("Export SDMX document") @DefaultMessage("Export SDMX document")
String exportSDMXButtonToolTip(); String exportSDMXButtonToolTip();
@DefaultMessage("EXCEL")
String exportExcelButton();
@DefaultMessage("Export Excel document")
String exportExcelButtonToolTip();
@DefaultMessage("CSV") @DefaultMessage("CSV")
String exportCSVButton(); String exportCSVButton();

View File

@ -59,7 +59,9 @@
name='org.gcube.portlets.user.td.csvexportwidget.CSVExportWizardTD' /> name='org.gcube.portlets.user.td.csvexportwidget.CSVExportWizardTD' />
<inherits <inherits
name='org.gcube.portlets.user.td.jsonexportwidget.JSONExportWidgetTD' /> name='org.gcube.portlets.user.td.jsonexportwidget.JSONExportWidgetTD' />
<inherits
name='org.gcube.portlets.user.td.excelexportwidget.ExcelExportWizardTD' />
<inherits <inherits
name='org.gcube.portlets.user.td.extractcodelistwidget.ExtractCodelistWizardTD' /> name='org.gcube.portlets.user.td.extractcodelistwidget.ExtractCodelistWizardTD' />
<inherits <inherits
@ -107,10 +109,12 @@
<set-property name="locale" value="en, it, es" /> <set-property name="locale" value="en, it, es" />
<set-property-fallback name="locale" value="en" /> <set-property-fallback name="locale" value="en" />
<!-- <set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
<!--
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger" name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED" value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
/> --> /> -->
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED" <!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED"
/> --> /> -->

View File

@ -9,9 +9,11 @@ noTabularResourcePresent = No tabular resource present!
noCurrentTabularResourcePresent = No current tabular resource present! noCurrentTabularResourcePresent = No current tabular resource present!
csvImport = CSV import csvImport = CSV import
sdmxImport = SDMX Import sdmxImport = SDMX Import
excelImport = Excel Import
csvExport = CSV Export csvExport = CSV Export
jsonExport = JSON Export jsonExport = JSON Export
sdmxExport = SDMX Export sdmxExport = SDMX Export
excelExport = Excel Export
extractCodelist = Extract Codelist extractCodelist = Extract Codelist
codelistMappingImport = Codelist Mapping Import codelistMappingImport = Codelist Mapping Import
union = Union union = Union
@ -25,3 +27,4 @@ attentionNotOwnerTemplateApply = In order to apply a template you must be the ow
You are not the owner of this Tabular Resource! You are not the owner of this Tabular Resource!
attentionNotOwnerRuleApply = In order to apply a rule you must be the owner of the Tabular Resource. \ attentionNotOwnerRuleApply = In order to apply a rule you must be the owner of the Tabular Resource. \
You are not the owner of this Tabular Resource! You are not the owner of this Tabular Resource!

View File

@ -9,9 +9,11 @@ noTabularResourcePresent = Ningúna tabular resource present!
noCurrentTabularResourcePresent = Tabular resource actual sin present! noCurrentTabularResourcePresent = Tabular resource actual sin present!
csvImport = Importaciòn CSV csvImport = Importaciòn CSV
sdmxImport = Importaciòn SDMX sdmxImport = Importaciòn SDMX
excelImport = Importaciòn EXCEL
csvExport = Exportaciòn CSV csvExport = Exportaciòn CSV
jsonExport = Exportaciòn JSON jsonExport = Exportaciòn JSON
sdmxExport = Exportaciòm SDMX sdmxExport = Exportaciòm SDMX
excelExport = Exportaciòm EXCEL
extractCodelist = Extraer Codelist extractCodelist = Extraer Codelist
codelistMappingImport = Mapa Importaciòn codelistMappingImport = Mapa Importaciòn
union = Unión union = Unión

View File

@ -9,9 +9,11 @@ noTabularResourcePresent = Nessuna tabular resource presente!
noCurrentTabularResourcePresent = Tabular resource corrente non presente! noCurrentTabularResourcePresent = Tabular resource corrente non presente!
csvImport = Importa CSV csvImport = Importa CSV
sdmxImport = Importa SDMX sdmxImport = Importa SDMX
excelImport = Importa EXCEL
csvExport = Esporta CSV csvExport = Esporta CSV
jsonExport = Esporta JSON jsonExport = Esporta JSON
sdmxExport = Esporta SDMX sdmxExport = Esporta SDMX
excelExport = Esporta Excel
extractCodelist = Estrai Codelist extractCodelist = Estrai Codelist
codelistMappingImport = Codelist Mapping Importa codelistMappingImport = Codelist Mapping Importa
union = Unione union = Unione

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 805 B

View File

@ -21,6 +21,8 @@ importJSONButtonToolTip = Import table from JSON source
exportGroupHeadingText = Export exportGroupHeadingText = Export
exportSDMXButton = SDMX exportSDMXButton = SDMX
exportSDMXButtonToolTip = Export SDMX document exportSDMXButtonToolTip = Export SDMX document
exportExcelButton = EXCEL
exportExcelButtonToolTip = Export Excel document
exportCSVButton = CSV exportCSVButton = CSV
exportCSVButtonToolTip = Export CSV document exportCSVButtonToolTip = Export CSV document
exportJSONButton = JSON exportJSONButton = JSON

View File

@ -21,6 +21,8 @@ importJSONButtonToolTip = Importar una tabla de una fuente JSON
exportGroupHeadingText = Exportaciòn exportGroupHeadingText = Exportaciòn
exportSDMXButton = SDMX exportSDMXButton = SDMX
exportSDMXButtonToolTip = Documento de exportaciòn como SDMX exportSDMXButtonToolTip = Documento de exportaciòn como SDMX
exportExcelButton = EXCEL
exportExcelButtonToolTip = Documento de exportaciòn como EXCEL
exportCSVButton = CSV exportCSVButton = CSV
exportCSVButtonToolTip = Documento de exportaciòn como CSV exportCSVButtonToolTip = Documento de exportaciòn como CSV
exportJSONButton = JSON exportJSONButton = JSON

View File

@ -21,6 +21,8 @@ importJSONButtonToolTip = Importa una tabella da una sorgente JSON
exportGroupHeadingText = Esporta exportGroupHeadingText = Esporta
exportSDMXButton = SDMX exportSDMXButton = SDMX
exportSDMXButtonToolTip = Esporta come documento SDMX exportSDMXButtonToolTip = Esporta come documento SDMX
exportExcelButton = EXCEL
exportExcelButtonToolTip = Esporta come documento EXCEL
exportCSVButton = CSV exportCSVButton = CSV
exportCSVButtonToolTip = Esporta come documento CSV exportCSVButtonToolTip = Esporta come documento CSV
exportJSONButton = JSON exportJSONButton = JSON

View File

@ -59,6 +59,9 @@
name='org.gcube.portlets.user.td.csvexportwidget.CSVExportWizardTD' /> name='org.gcube.portlets.user.td.csvexportwidget.CSVExportWizardTD' />
<inherits <inherits
name='org.gcube.portlets.user.td.jsonexportwidget.JSONExportWidgetTD' /> name='org.gcube.portlets.user.td.jsonexportwidget.JSONExportWidgetTD' />
<inherits
name='org.gcube.portlets.user.td.excelexportwidget.ExcelExportWizardTD' />
<inherits <inherits
name='org.gcube.portlets.user.td.extractcodelistwidget.ExtractCodelistWizardTD' /> name='org.gcube.portlets.user.td.extractcodelistwidget.ExtractCodelistWizardTD' />
@ -106,15 +109,16 @@
<extend-property name="locale" values="es" /> <extend-property name="locale" values="es" />
<set-property name="locale" value="en, it, es" /> <set-property name="locale" value="en, it, es" />
<set-property-fallback name="locale" value="en" /> <set-property-fallback name="locale" value="en" />
<!-- <set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property <!--
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger" name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED" value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
/> --> /> -->
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" 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_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" /> <set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" /> <set-property name="log_GWTLogger" value="DISABLED" />