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"?>
<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>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</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>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -45,5 +45,5 @@
</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-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>

View File

@ -1,4 +1,8 @@
<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"
date="2017-12-13">
<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>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-manager</artifactId>
<version>2.17.0-SNAPSHOT</version>
<version>2.18.0-SNAPSHOT</version>
<packaging>war</packaging>
@ -430,7 +430,14 @@
<artifactId>tabular-data-json-export-widget</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</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 -->
<dependency>
<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.csvexportwidget.client.CSVExportWizardTD;
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.ReplaceColumnByMultiColumnExpressionDialog;
import org.gcube.portlets.user.td.expressionwidget.client.RowsDeleteByMultiColumnExpressionDialog;
@ -830,6 +831,9 @@ public class TabularDataController {
case EXPORT_SDMX:
openSDMXExportWizard();
break;
case EXPORT_EXCEL:
openExcelExportWizard();
break;
case EXPORT_CSV:
openCSVExportWizard();
break;
@ -1049,6 +1053,7 @@ public class TabularDataController {
case TEST:
testFeauture();
break;
case IMPORT_EXCEL:
default:
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() {
GWT.runAsync(new RunAsyncCallback() {

View File

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

View File

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

View File

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

View File

@ -59,7 +59,9 @@
name='org.gcube.portlets.user.td.csvexportwidget.CSVExportWizardTD' />
<inherits
name='org.gcube.portlets.user.td.jsonexportwidget.JSONExportWidgetTD' />
<inherits
name='org.gcube.portlets.user.td.excelexportwidget.ExcelExportWizardTD' />
<inherits
name='org.gcube.portlets.user.td.extractcodelistwidget.ExtractCodelistWizardTD' />
<inherits
@ -107,10 +109,12 @@
<set-property name="locale" value="en, it, es" />
<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"
value="ENABLED" /> <set-property name="log_SystemLogger" 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!
csvImport = CSV import
sdmxImport = SDMX Import
excelImport = Excel Import
csvExport = CSV Export
jsonExport = JSON Export
sdmxExport = SDMX Export
excelExport = Excel Export
extractCodelist = Extract Codelist
codelistMappingImport = Codelist Mapping Import
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!
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!

View File

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

View File

@ -9,9 +9,11 @@ noTabularResourcePresent = Nessuna tabular resource presente!
noCurrentTabularResourcePresent = Tabular resource corrente non presente!
csvImport = Importa CSV
sdmxImport = Importa SDMX
excelImport = Importa EXCEL
csvExport = Esporta CSV
jsonExport = Esporta JSON
sdmxExport = Esporta SDMX
excelExport = Esporta Excel
extractCodelist = Estrai Codelist
codelistMappingImport = Codelist Mapping Importa
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
exportSDMXButton = SDMX
exportSDMXButtonToolTip = Export SDMX document
exportExcelButton = EXCEL
exportExcelButtonToolTip = Export Excel document
exportCSVButton = CSV
exportCSVButtonToolTip = Export CSV document
exportJSONButton = JSON

View File

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

View File

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

View File

@ -59,6 +59,9 @@
name='org.gcube.portlets.user.td.csvexportwidget.CSVExportWizardTD' />
<inherits
name='org.gcube.portlets.user.td.jsonexportwidget.JSONExportWidgetTD' />
<inherits
name='org.gcube.portlets.user.td.excelexportwidget.ExcelExportWizardTD' />
<inherits
name='org.gcube.portlets.user.td.extractcodelistwidget.ExtractCodelistWizardTD' />
@ -106,15 +109,16 @@
<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
<!--
<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" />