ref 8033:Support for SDMX export from templates on tabman

https://support.d4science.org/issues/8033

Updated to support export of Dataset

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@146851 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-04-13 10:37:46 +00:00
parent 16573a6d6b
commit bcb7af8b9b
7 changed files with 140 additions and 37 deletions

View File

@ -2,6 +2,8 @@
<Changeset component="org.gcube.portlets-user.tabular-data-portlet.2-15-0"
date="2017-04-01">
<Change>Updated to DataMiner [ticket #6078]</Change>
<Change>Added support for template export in SDMX [issue #8033]
</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.tabular-data-portlet.2-14-0"
date="2017-02-15">

View File

@ -41,6 +41,7 @@ import org.gcube.portlets.user.td.rulewidget.client.RuleShareDialog;
import org.gcube.portlets.user.td.rulewidget.client.multicolumn.RuleOnTableApplyWizard;
import org.gcube.portlets.user.td.rulewidget.client.multicolumn.RuleOnTableNewWizard;
import org.gcube.portlets.user.td.sdmxexportwidget.client.SDMXExportWizardTD;
import org.gcube.portlets.user.td.sdmxexportwidget.client.template.SDMXTemplateExportWizard;
import org.gcube.portlets.user.td.sdmximportwidget.client.SDMXImportWizardTD;
import org.gcube.portlets.user.td.sharewidget.client.TRShare;
import org.gcube.portlets.user.td.statisticalwidget.client.DataMinerWidget;
@ -150,7 +151,7 @@ public class TabularDataController {
eventBus = new SimpleEventBus();
initMessages();
callHello();
//checkSession();
// checkSession();
pendingTasksRetrieve();
bindToEvents();
}
@ -160,14 +161,14 @@ public class TabularDataController {
msgsCommon = GWT.create(CommonMessages.class);
}
/*private void checkSession() {
// if you do not need to something when the session expire
CheckSession.getInstance().startPolling();
}*/
/*
* private void checkSession() { // if you do not need to something when the
* session expire CheckSession.getInstance().startPolling(); }
*/
private void sessionExpiredShow() {
Log.error("Session expired");
//CheckSession.showLogoutDialog();
// CheckSession.showLogoutDialog();
}
/**
@ -996,6 +997,12 @@ public class TabularDataController {
case TEMPLATE_SHARE:
openTemplateShare();
break;
case TEMPLATE_EXPORT_SDMX:
openTemplateExportSDMXWizard();
break;
case TEMPLATE_IMPORT_SDMX:
openTemplateImportSDMXWizard();
break;
case ANALYSE_TABLE_FILTER:
break;
case ANALYSE_TABLE_UNION:
@ -1088,7 +1095,6 @@ public class TabularDataController {
}
private void doBackgroundRequestCommand(BackgroundRequestEvent event) {
BackgroundRequestType type = event.getBackgroundRequestType();
Log.trace("doBackgroundRequestEvent BackgroundRequestType: " + type);
@ -1804,6 +1810,54 @@ public class TabularDataController {
}
private void openTemplateExportSDMXWizard() {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
openWizard();
SDMXTemplateExportWizard wizard = new SDMXTemplateExportWizard(
msgs.sdmxExport(), eventBus);
wizard.addListener(new WizardListener() {
@Override
public void completed(TRId tabularResourceId) {
openTable(tabularResourceId);
}
@Override
public void putInBackground() {
Log.debug("PutInBakground");
resumeUIState();
}
@Override
public void aborted() {
resumeUIState();
}
@Override
public void failed(String title, String message,
String details, Throwable throwable) {
UtilsGXT3.alert(title, message + " " + details);
resumeUIState();
}
});
wizard.show();
}
public void onFailure(Throwable reason) {
asyncCodeLoadingFailed(reason);
}
});
}
private void openTemplateImportSDMXWizard() {
}
private void openShareWindow() {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
@ -1872,7 +1926,8 @@ public class TabularDataController {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
Log.debug("Request Open Share Rule Dialog");
RuleShareDialog cfDialog = new RuleShareDialog(userInfo, eventBus);
RuleShareDialog cfDialog = new RuleShareDialog(userInfo,
eventBus);
cfDialog.show();
}
@ -2128,8 +2183,8 @@ public class TabularDataController {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
@SuppressWarnings("unused")
DataMinerWidget statisticalWidget = new DataMinerWidget(
trId, eventBus);
DataMinerWidget statisticalWidget = new DataMinerWidget(trId,
eventBus);
}
public void onFailure(Throwable reason) {

View File

@ -36,13 +36,16 @@ public class TemplateToolBar {
private EventBus eventBus;
private ToolBar toolBar;
//Template
// Template
private TextButton templateNewButton;
private TextButton templateOpenButton;
private TextButton templateDeleteButton;
private TextButton templateApplyButton;
private TextButton templateShareButton;
// Export
private TextButton templateExportSDMXButton;
public TemplateToolBar(EventBus eventBus) {
this.eventBus = eventBus;
@ -54,19 +57,19 @@ public class TemplateToolBar {
}
protected void build() {
TemplateToolBarMessages msgs = GWT.create(TemplateToolBarMessages.class);
TemplateToolBarMessages msgs = GWT
.create(TemplateToolBarMessages.class);
toolBar = new ToolBar();
toolBar.setSpacing(1);
toolBar.setEnableOverflow(false);
// Template
ButtonGroup templateGroup = new ButtonGroup();
templateGroup.setId("Manage");
templateGroup.setStyleName("ribbon");
templateGroup.setHeadingText(msgs.templateGroupHeadingText());
//templateGroup.disable();
// templateGroup.disable();
toolBar.add(templateGroup);
FlexTable templateLayout = new FlexTable();
@ -82,14 +85,13 @@ public class TemplateToolBar {
templateNewButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(
RibbonType.TEMPLATE_NEW));
eventBus.fireEvent(new RibbonEvent(RibbonType.TEMPLATE_NEW));
}
});
templateLayout.setWidget(0, 0, templateNewButton);
templateLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
templateOpenButton = new TextButton(msgs.templateOpenButton(),
TabularDataResources.INSTANCE.templateEdit32());
templateOpenButton.enable();
@ -100,15 +102,13 @@ public class TemplateToolBar {
templateOpenButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(
RibbonType.TEMPLATE_OPEN));
eventBus.fireEvent(new RibbonEvent(RibbonType.TEMPLATE_OPEN));
}
});
templateLayout.setWidget(0, 1, templateOpenButton);
templateLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
templateDeleteButton = new TextButton(msgs.templateDeleteButton(),
TabularDataResources.INSTANCE.templateDelete32());
templateDeleteButton.enable();
@ -119,15 +119,13 @@ public class TemplateToolBar {
templateDeleteButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(
RibbonType.TEMPLATE_DELETE));
eventBus.fireEvent(new RibbonEvent(RibbonType.TEMPLATE_DELETE));
}
});
templateLayout.setWidget(0, 2, templateDeleteButton);
templateLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
templateApplyButton = new TextButton(msgs.templateApplyButton(),
TabularDataResources.INSTANCE.templateApply32());
templateApplyButton.disable();
@ -144,8 +142,7 @@ public class TemplateToolBar {
templateLayout.setWidget(0, 3, templateApplyButton);
templateLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
templateShareButton = new TextButton(msgs.templateShareButton(),
TabularDataResources.INSTANCE.templateShare32());
templateShareButton.enable();
@ -162,9 +159,35 @@ public class TemplateToolBar {
templateLayout.setWidget(0, 4, templateShareButton);
templateLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
cleanCells(templateLayout.getElement());
// Export
ButtonGroup exportGroup = new ButtonGroup();
exportGroup.setStyleName("ribbon");
exportGroup.setHeadingText(msgs.templateExportGroupHeadingText());
toolBar.add(exportGroup);
FlexTable exportLayout = new FlexTable();
exportGroup.add(exportLayout);
templateExportSDMXButton = new TextButton(msgs.templateExportSDMXButton(),
TabularDataResources.INSTANCE.sdmx32());
templateExportSDMXButton.disable();
templateExportSDMXButton.setToolTip(msgs.templateExportSDMXButtonToolTip());
templateExportSDMXButton.setScale(ButtonScale.LARGE);
templateExportSDMXButton.setIconAlign(IconAlign.TOP);
templateExportSDMXButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
templateExportSDMXButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.TEMPLATE_EXPORT_SDMX));
}
});
exportLayout.setWidget(0, 0, templateExportSDMXButton);
exportLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
eventBus.addHandler(UIStateEvent.TYPE,
new UIStateEvent.UIStateHandler() {
@ -197,23 +220,26 @@ public class TemplateToolBar {
templateDeleteButton.enable();
templateApplyButton.disable();
templateShareButton.enable();
templateExportSDMXButton.disable();
break;
case TR_CLOSE:
case TR_READONLY:
case TR_READONLY:
templateOpenButton.enable();
templateNewButton.enable();
templateDeleteButton.enable();
templateApplyButton.disable();
templateShareButton.enable();
templateExportSDMXButton.disable();
break;
case TR_OPEN:
case TABLEUPDATE:
case TABLECURATION:
case TABLECURATION:
templateOpenButton.enable();
templateNewButton.enable();
templateDeleteButton.enable();
templateApplyButton.enable();
templateShareButton.enable();
templateExportSDMXButton.enable();
break;
case WIZARD_OPEN:
templateOpenButton.disable();
@ -221,6 +247,7 @@ public class TemplateToolBar {
templateDeleteButton.disable();
templateApplyButton.disable();
templateShareButton.disable();
templateExportSDMXButton.disable();
break;
default:
break;

View File

@ -42,5 +42,15 @@ public interface TemplateToolBarMessages extends Messages {
@DefaultMessage("Share")
String templateShareButtonToolTip();
@DefaultMessage("Export")
String templateExportGroupHeadingText();
@DefaultMessage("SDMX")
String templateExportSDMXButton();
@DefaultMessage("SDMX Export")
String templateExportSDMXButtonToolTip();
}

View File

@ -8,4 +8,7 @@ templateDeleteButtonToolTip = Delete
templateApplyButton = Apply
templateApplyButtonToolTip = Apply
templateShareButton = Share
templateShareButtonToolTip = Share
templateShareButtonToolTip = Share
templateExportGroupHeadingText = Export
templateExportSDMXButton = SDMX
templateExportSDMXButtonToolTip = SDMX Export

View File

@ -8,4 +8,7 @@ templateDeleteButtonToolTip = Borrar
templateApplyButton = Aplicar
templateApplyButtonToolTip = Aplicar
templateShareButton = Compartir
templateShareButtonToolTip = Compartir
templateShareButtonToolTip = Compartir
templateExportGroupHeadingText = Exportaciòn
templateExportSDMXButton = SDMX
templateExportSDMXButtonToolTip = Exportaciòn SDMX

View File

@ -8,4 +8,7 @@ templateDeleteButtonToolTip = Elimina
templateApplyButton = Applica
templateApplyButtonToolTip = Applica
templateShareButton = Condividi
templateShareButtonToolTip = Condividi
templateShareButtonToolTip = Condividi
templateExportGroupHeadingText = Esporta
templateExportSDMXButton = SDMX
templateExportSDMXButtonToolTip = Esportazione SDMX