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:
parent
16573a6d6b
commit
bcb7af8b9b
|
@ -2,6 +2,8 @@
|
||||||
<Changeset component="org.gcube.portlets-user.tabular-data-portlet.2-15-0"
|
<Changeset component="org.gcube.portlets-user.tabular-data-portlet.2-15-0"
|
||||||
date="2017-04-01">
|
date="2017-04-01">
|
||||||
<Change>Updated to DataMiner [ticket #6078]</Change>
|
<Change>Updated to DataMiner [ticket #6078]</Change>
|
||||||
|
<Change>Added support for template export in SDMX [issue #8033]
|
||||||
|
</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
<Changeset component="org.gcube.portlets-user.tabular-data-portlet.2-14-0"
|
<Changeset component="org.gcube.portlets-user.tabular-data-portlet.2-14-0"
|
||||||
date="2017-02-15">
|
date="2017-02-15">
|
||||||
|
|
|
@ -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.RuleOnTableApplyWizard;
|
||||||
import org.gcube.portlets.user.td.rulewidget.client.multicolumn.RuleOnTableNewWizard;
|
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.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.sdmximportwidget.client.SDMXImportWizardTD;
|
||||||
import org.gcube.portlets.user.td.sharewidget.client.TRShare;
|
import org.gcube.portlets.user.td.sharewidget.client.TRShare;
|
||||||
import org.gcube.portlets.user.td.statisticalwidget.client.DataMinerWidget;
|
import org.gcube.portlets.user.td.statisticalwidget.client.DataMinerWidget;
|
||||||
|
@ -150,7 +151,7 @@ public class TabularDataController {
|
||||||
eventBus = new SimpleEventBus();
|
eventBus = new SimpleEventBus();
|
||||||
initMessages();
|
initMessages();
|
||||||
callHello();
|
callHello();
|
||||||
//checkSession();
|
// checkSession();
|
||||||
pendingTasksRetrieve();
|
pendingTasksRetrieve();
|
||||||
bindToEvents();
|
bindToEvents();
|
||||||
}
|
}
|
||||||
|
@ -160,14 +161,14 @@ public class TabularDataController {
|
||||||
msgsCommon = GWT.create(CommonMessages.class);
|
msgsCommon = GWT.create(CommonMessages.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private void checkSession() {
|
/*
|
||||||
// if you do not need to something when the session expire
|
* private void checkSession() { // if you do not need to something when the
|
||||||
CheckSession.getInstance().startPolling();
|
* session expire CheckSession.getInstance().startPolling(); }
|
||||||
}*/
|
*/
|
||||||
|
|
||||||
private void sessionExpiredShow() {
|
private void sessionExpiredShow() {
|
||||||
Log.error("Session expired");
|
Log.error("Session expired");
|
||||||
//CheckSession.showLogoutDialog();
|
// CheckSession.showLogoutDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -996,6 +997,12 @@ public class TabularDataController {
|
||||||
case TEMPLATE_SHARE:
|
case TEMPLATE_SHARE:
|
||||||
openTemplateShare();
|
openTemplateShare();
|
||||||
break;
|
break;
|
||||||
|
case TEMPLATE_EXPORT_SDMX:
|
||||||
|
openTemplateExportSDMXWizard();
|
||||||
|
break;
|
||||||
|
case TEMPLATE_IMPORT_SDMX:
|
||||||
|
openTemplateImportSDMXWizard();
|
||||||
|
break;
|
||||||
case ANALYSE_TABLE_FILTER:
|
case ANALYSE_TABLE_FILTER:
|
||||||
break;
|
break;
|
||||||
case ANALYSE_TABLE_UNION:
|
case ANALYSE_TABLE_UNION:
|
||||||
|
@ -1088,7 +1095,6 @@ public class TabularDataController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void doBackgroundRequestCommand(BackgroundRequestEvent event) {
|
private void doBackgroundRequestCommand(BackgroundRequestEvent event) {
|
||||||
BackgroundRequestType type = event.getBackgroundRequestType();
|
BackgroundRequestType type = event.getBackgroundRequestType();
|
||||||
Log.trace("doBackgroundRequestEvent BackgroundRequestType: " + type);
|
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() {
|
private void openShareWindow() {
|
||||||
GWT.runAsync(new RunAsyncCallback() {
|
GWT.runAsync(new RunAsyncCallback() {
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
|
@ -1872,7 +1926,8 @@ public class TabularDataController {
|
||||||
GWT.runAsync(new RunAsyncCallback() {
|
GWT.runAsync(new RunAsyncCallback() {
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.debug("Request Open Share Rule Dialog");
|
Log.debug("Request Open Share Rule Dialog");
|
||||||
RuleShareDialog cfDialog = new RuleShareDialog(userInfo, eventBus);
|
RuleShareDialog cfDialog = new RuleShareDialog(userInfo,
|
||||||
|
eventBus);
|
||||||
cfDialog.show();
|
cfDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2128,8 +2183,8 @@ public class TabularDataController {
|
||||||
GWT.runAsync(new RunAsyncCallback() {
|
GWT.runAsync(new RunAsyncCallback() {
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
DataMinerWidget statisticalWidget = new DataMinerWidget(
|
DataMinerWidget statisticalWidget = new DataMinerWidget(trId,
|
||||||
trId, eventBus);
|
eventBus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFailure(Throwable reason) {
|
public void onFailure(Throwable reason) {
|
||||||
|
|
|
@ -36,13 +36,16 @@ public class TemplateToolBar {
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private ToolBar toolBar;
|
private ToolBar toolBar;
|
||||||
|
|
||||||
//Template
|
// Template
|
||||||
private TextButton templateNewButton;
|
private TextButton templateNewButton;
|
||||||
private TextButton templateOpenButton;
|
private TextButton templateOpenButton;
|
||||||
private TextButton templateDeleteButton;
|
private TextButton templateDeleteButton;
|
||||||
private TextButton templateApplyButton;
|
private TextButton templateApplyButton;
|
||||||
private TextButton templateShareButton;
|
private TextButton templateShareButton;
|
||||||
|
|
||||||
|
// Export
|
||||||
|
private TextButton templateExportSDMXButton;
|
||||||
|
|
||||||
|
|
||||||
public TemplateToolBar(EventBus eventBus) {
|
public TemplateToolBar(EventBus eventBus) {
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
|
@ -54,19 +57,19 @@ public class TemplateToolBar {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void build() {
|
protected void build() {
|
||||||
TemplateToolBarMessages msgs = GWT.create(TemplateToolBarMessages.class);
|
TemplateToolBarMessages msgs = GWT
|
||||||
|
.create(TemplateToolBarMessages.class);
|
||||||
|
|
||||||
toolBar = new ToolBar();
|
toolBar = new ToolBar();
|
||||||
toolBar.setSpacing(1);
|
toolBar.setSpacing(1);
|
||||||
toolBar.setEnableOverflow(false);
|
toolBar.setEnableOverflow(false);
|
||||||
|
|
||||||
// Template
|
// Template
|
||||||
ButtonGroup templateGroup = new ButtonGroup();
|
ButtonGroup templateGroup = new ButtonGroup();
|
||||||
templateGroup.setId("Manage");
|
templateGroup.setId("Manage");
|
||||||
templateGroup.setStyleName("ribbon");
|
templateGroup.setStyleName("ribbon");
|
||||||
templateGroup.setHeadingText(msgs.templateGroupHeadingText());
|
templateGroup.setHeadingText(msgs.templateGroupHeadingText());
|
||||||
//templateGroup.disable();
|
// templateGroup.disable();
|
||||||
toolBar.add(templateGroup);
|
toolBar.add(templateGroup);
|
||||||
|
|
||||||
FlexTable templateLayout = new FlexTable();
|
FlexTable templateLayout = new FlexTable();
|
||||||
|
@ -82,14 +85,13 @@ public class TemplateToolBar {
|
||||||
templateNewButton.addSelectHandler(new SelectHandler() {
|
templateNewButton.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
eventBus.fireEvent(new RibbonEvent(
|
eventBus.fireEvent(new RibbonEvent(RibbonType.TEMPLATE_NEW));
|
||||||
RibbonType.TEMPLATE_NEW));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
templateLayout.setWidget(0, 0, templateNewButton);
|
templateLayout.setWidget(0, 0, templateNewButton);
|
||||||
templateLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
templateLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||||
|
|
||||||
templateOpenButton = new TextButton(msgs.templateOpenButton(),
|
templateOpenButton = new TextButton(msgs.templateOpenButton(),
|
||||||
TabularDataResources.INSTANCE.templateEdit32());
|
TabularDataResources.INSTANCE.templateEdit32());
|
||||||
templateOpenButton.enable();
|
templateOpenButton.enable();
|
||||||
|
@ -100,15 +102,13 @@ public class TemplateToolBar {
|
||||||
templateOpenButton.addSelectHandler(new SelectHandler() {
|
templateOpenButton.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
eventBus.fireEvent(new RibbonEvent(
|
eventBus.fireEvent(new RibbonEvent(RibbonType.TEMPLATE_OPEN));
|
||||||
RibbonType.TEMPLATE_OPEN));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
templateLayout.setWidget(0, 1, templateOpenButton);
|
templateLayout.setWidget(0, 1, templateOpenButton);
|
||||||
templateLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
templateLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||||
|
|
||||||
|
|
||||||
templateDeleteButton = new TextButton(msgs.templateDeleteButton(),
|
templateDeleteButton = new TextButton(msgs.templateDeleteButton(),
|
||||||
TabularDataResources.INSTANCE.templateDelete32());
|
TabularDataResources.INSTANCE.templateDelete32());
|
||||||
templateDeleteButton.enable();
|
templateDeleteButton.enable();
|
||||||
|
@ -119,15 +119,13 @@ public class TemplateToolBar {
|
||||||
templateDeleteButton.addSelectHandler(new SelectHandler() {
|
templateDeleteButton.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
eventBus.fireEvent(new RibbonEvent(
|
eventBus.fireEvent(new RibbonEvent(RibbonType.TEMPLATE_DELETE));
|
||||||
RibbonType.TEMPLATE_DELETE));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
templateLayout.setWidget(0, 2, templateDeleteButton);
|
templateLayout.setWidget(0, 2, templateDeleteButton);
|
||||||
templateLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
templateLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
||||||
|
|
||||||
|
|
||||||
templateApplyButton = new TextButton(msgs.templateApplyButton(),
|
templateApplyButton = new TextButton(msgs.templateApplyButton(),
|
||||||
TabularDataResources.INSTANCE.templateApply32());
|
TabularDataResources.INSTANCE.templateApply32());
|
||||||
templateApplyButton.disable();
|
templateApplyButton.disable();
|
||||||
|
@ -144,8 +142,7 @@ public class TemplateToolBar {
|
||||||
|
|
||||||
templateLayout.setWidget(0, 3, templateApplyButton);
|
templateLayout.setWidget(0, 3, templateApplyButton);
|
||||||
templateLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
|
templateLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
|
||||||
|
|
||||||
|
|
||||||
templateShareButton = new TextButton(msgs.templateShareButton(),
|
templateShareButton = new TextButton(msgs.templateShareButton(),
|
||||||
TabularDataResources.INSTANCE.templateShare32());
|
TabularDataResources.INSTANCE.templateShare32());
|
||||||
templateShareButton.enable();
|
templateShareButton.enable();
|
||||||
|
@ -162,9 +159,35 @@ public class TemplateToolBar {
|
||||||
|
|
||||||
templateLayout.setWidget(0, 4, templateShareButton);
|
templateLayout.setWidget(0, 4, templateShareButton);
|
||||||
templateLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
|
templateLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
|
||||||
|
|
||||||
cleanCells(templateLayout.getElement());
|
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,
|
eventBus.addHandler(UIStateEvent.TYPE,
|
||||||
new UIStateEvent.UIStateHandler() {
|
new UIStateEvent.UIStateHandler() {
|
||||||
|
|
||||||
|
@ -197,23 +220,26 @@ public class TemplateToolBar {
|
||||||
templateDeleteButton.enable();
|
templateDeleteButton.enable();
|
||||||
templateApplyButton.disable();
|
templateApplyButton.disable();
|
||||||
templateShareButton.enable();
|
templateShareButton.enable();
|
||||||
|
templateExportSDMXButton.disable();
|
||||||
break;
|
break;
|
||||||
case TR_CLOSE:
|
case TR_CLOSE:
|
||||||
case TR_READONLY:
|
case TR_READONLY:
|
||||||
templateOpenButton.enable();
|
templateOpenButton.enable();
|
||||||
templateNewButton.enable();
|
templateNewButton.enable();
|
||||||
templateDeleteButton.enable();
|
templateDeleteButton.enable();
|
||||||
templateApplyButton.disable();
|
templateApplyButton.disable();
|
||||||
templateShareButton.enable();
|
templateShareButton.enable();
|
||||||
|
templateExportSDMXButton.disable();
|
||||||
break;
|
break;
|
||||||
case TR_OPEN:
|
case TR_OPEN:
|
||||||
case TABLEUPDATE:
|
case TABLEUPDATE:
|
||||||
case TABLECURATION:
|
case TABLECURATION:
|
||||||
templateOpenButton.enable();
|
templateOpenButton.enable();
|
||||||
templateNewButton.enable();
|
templateNewButton.enable();
|
||||||
templateDeleteButton.enable();
|
templateDeleteButton.enable();
|
||||||
templateApplyButton.enable();
|
templateApplyButton.enable();
|
||||||
templateShareButton.enable();
|
templateShareButton.enable();
|
||||||
|
templateExportSDMXButton.enable();
|
||||||
break;
|
break;
|
||||||
case WIZARD_OPEN:
|
case WIZARD_OPEN:
|
||||||
templateOpenButton.disable();
|
templateOpenButton.disable();
|
||||||
|
@ -221,6 +247,7 @@ public class TemplateToolBar {
|
||||||
templateDeleteButton.disable();
|
templateDeleteButton.disable();
|
||||||
templateApplyButton.disable();
|
templateApplyButton.disable();
|
||||||
templateShareButton.disable();
|
templateShareButton.disable();
|
||||||
|
templateExportSDMXButton.disable();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -42,5 +42,15 @@ public interface TemplateToolBarMessages extends Messages {
|
||||||
|
|
||||||
@DefaultMessage("Share")
|
@DefaultMessage("Share")
|
||||||
String templateShareButtonToolTip();
|
String templateShareButtonToolTip();
|
||||||
|
|
||||||
|
@DefaultMessage("Export")
|
||||||
|
String templateExportGroupHeadingText();
|
||||||
|
|
||||||
|
@DefaultMessage("SDMX")
|
||||||
|
String templateExportSDMXButton();
|
||||||
|
|
||||||
|
@DefaultMessage("SDMX Export")
|
||||||
|
String templateExportSDMXButtonToolTip();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -8,4 +8,7 @@ templateDeleteButtonToolTip = Delete
|
||||||
templateApplyButton = Apply
|
templateApplyButton = Apply
|
||||||
templateApplyButtonToolTip = Apply
|
templateApplyButtonToolTip = Apply
|
||||||
templateShareButton = Share
|
templateShareButton = Share
|
||||||
templateShareButtonToolTip = Share
|
templateShareButtonToolTip = Share
|
||||||
|
templateExportGroupHeadingText = Export
|
||||||
|
templateExportSDMXButton = SDMX
|
||||||
|
templateExportSDMXButtonToolTip = SDMX Export
|
|
@ -8,4 +8,7 @@ templateDeleteButtonToolTip = Borrar
|
||||||
templateApplyButton = Aplicar
|
templateApplyButton = Aplicar
|
||||||
templateApplyButtonToolTip = Aplicar
|
templateApplyButtonToolTip = Aplicar
|
||||||
templateShareButton = Compartir
|
templateShareButton = Compartir
|
||||||
templateShareButtonToolTip = Compartir
|
templateShareButtonToolTip = Compartir
|
||||||
|
templateExportGroupHeadingText = Exportaciòn
|
||||||
|
templateExportSDMXButton = SDMX
|
||||||
|
templateExportSDMXButtonToolTip = Exportaciòn SDMX
|
||||||
|
|
|
@ -8,4 +8,7 @@ templateDeleteButtonToolTip = Elimina
|
||||||
templateApplyButton = Applica
|
templateApplyButton = Applica
|
||||||
templateApplyButtonToolTip = Applica
|
templateApplyButtonToolTip = Applica
|
||||||
templateShareButton = Condividi
|
templateShareButton = Condividi
|
||||||
templateShareButtonToolTip = Condividi
|
templateShareButtonToolTip = Condividi
|
||||||
|
templateExportGroupHeadingText = Esporta
|
||||||
|
templateExportSDMXButton = SDMX
|
||||||
|
templateExportSDMXButtonToolTip = Esportazione SDMX
|
Loading…
Reference in New Issue