Minor updated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-sdmx-export-widget@84593 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
89262eba2b
commit
e8731f4a1d
|
@ -4,6 +4,7 @@
|
||||||
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.Agencies;
|
import org.gcube.portlets.user.td.gwtservice.shared.Agencies;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
|
||||||
import com.google.gwt.event.logical.shared.SelectionEvent;
|
import com.google.gwt.event.logical.shared.SelectionEvent;
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.Agencies;
|
import org.gcube.portlets.user.td.gwtservice.shared.Agencies;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.Codelist;
|
import org.gcube.portlets.user.td.gwtservice.shared.Codelist;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -21,10 +21,10 @@ public class SDMXDatasetSelectionCard extends WizardCard {
|
||||||
protected SDMXExportSession importSession;
|
protected SDMXExportSession importSession;
|
||||||
protected DatasetSelectionPanel datasetSelectionPanel;
|
protected DatasetSelectionPanel datasetSelectionPanel;
|
||||||
|
|
||||||
public SDMXDatasetSelectionCard(final SDMXExportSession importSession) {
|
public SDMXDatasetSelectionCard(final SDMXExportSession exportSession) {
|
||||||
super("SDMX Dataset selection", "");
|
super("SDMX Dataset selection", "");
|
||||||
|
|
||||||
this.importSession = importSession;
|
this.exportSession = exportSession;
|
||||||
|
|
||||||
thisCard=this;
|
thisCard=this;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.rpc.SDMXExportWizardServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.SDMXExportSession;
|
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
|
||||||
|
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
|
|
@ -6,8 +6,8 @@ package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.ImportProgressBarUpdater;
|
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.ImportProgressBarUpdater;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.OperationProgressListener;
|
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.OperationProgressListener;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.OperationProgressUpdater;
|
import org.gcube.portlets.user.td.sdmxexportwidget.client.progress.OperationProgressUpdater;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.rpc.SDMXExportWizardServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
|
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
|
||||||
|
|
||||||
|
@ -36,15 +36,15 @@ public class SDMXOperationInProgressCard extends WizardCard
|
||||||
|
|
||||||
public static final int STATUS_POLLING_DELAY = 1000;
|
public static final int STATUS_POLLING_DELAY = 1000;
|
||||||
protected SDMXOperationInProgressCard thisCard;
|
protected SDMXOperationInProgressCard thisCard;
|
||||||
protected SDMXExportSession importSession;
|
protected SDMXExportSession exportSession;
|
||||||
protected OperationProgressUpdater progressUpdater;
|
protected OperationProgressUpdater progressUpdater;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SDMXOperationInProgressCard(final SDMXExportSession importSession) {
|
public SDMXOperationInProgressCard(final SDMXExportSession exportSession) {
|
||||||
super("Operation In Progress", "");
|
super("Operation In Progress", "");
|
||||||
|
|
||||||
this.importSession = importSession;
|
this.exportSession = exportSession;
|
||||||
thisCard=this;
|
thisCard=this;
|
||||||
|
|
||||||
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
|
VBoxLayoutContainer operationInProgressPanel = new VBoxLayoutContainer();
|
||||||
|
@ -80,7 +80,7 @@ public class SDMXOperationInProgressCard extends WizardCard
|
||||||
|
|
||||||
public void exportSDMX()
|
public void exportSDMX()
|
||||||
{
|
{
|
||||||
SDMXExportWizardServiceAsync.INSTANCE.exportSDMXClientLibraryRequest(importSession, new AsyncCallback<Void>() {
|
TDGWTServiceAsync.INSTANCE.exportSDMXClientLibraryRequest(exportSession, new AsyncCallback<Void>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(Void result) {
|
||||||
|
|
|
@ -3,12 +3,14 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
package org.gcube.portlets.user.td.sdmxexportwidget.client;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.rpc.SDMXExportWizardServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.Agencies;
|
import org.gcube.portlets.user.td.gwtservice.shared.Agencies;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.SDMXExportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.TabResource;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.TableDetail;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportSession;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -51,7 +53,7 @@ import com.sencha.gxt.widget.core.client.info.Info;
|
||||||
*/
|
*/
|
||||||
public class SDMXTableDetailCard extends WizardCard {
|
public class SDMXTableDetailCard extends WizardCard {
|
||||||
|
|
||||||
protected SDMXExportSession importSession;
|
protected SDMXExportSession exportSession;
|
||||||
protected SDMXTableDetailCard thisCard;
|
protected SDMXTableDetailCard thisCard;
|
||||||
|
|
||||||
protected static final AgenciesProperties agenciesProperties = GWT.create(AgenciesProperties.class);
|
protected static final AgenciesProperties agenciesProperties = GWT.create(AgenciesProperties.class);
|
||||||
|
@ -66,14 +68,14 @@ public class SDMXTableDetailCard extends WizardCard {
|
||||||
protected TextField right;
|
protected TextField right;
|
||||||
protected ComboBox<Agencies> combo=null;
|
protected ComboBox<Agencies> combo=null;
|
||||||
|
|
||||||
TableDetail detail=new TableDetail();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SDMXTableDetailCard(final SDMXExportSession importSession) {
|
|
||||||
|
public SDMXTableDetailCard(final SDMXExportSession exportSession) {
|
||||||
super("SDMX Table Detail", "");
|
super("SDMX Table Detail", "");
|
||||||
|
|
||||||
this.importSession = importSession;
|
this.exportSession = exportSession;
|
||||||
thisCard=this;
|
thisCard=this;
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,14 +101,14 @@ public class SDMXTableDetailCard extends WizardCard {
|
||||||
name = new TextField();
|
name = new TextField();
|
||||||
name.setAllowBlank(false);
|
name.setAllowBlank(false);
|
||||||
name.setEmptyText("Enter a name...");
|
name.setEmptyText("Enter a name...");
|
||||||
name.setValue(importSession.getSelectedCodelist().getName());
|
name.setValue(exportSession.getSelectedCodelist().getName());
|
||||||
p.add(new FieldLabel(name, "Name"), new VerticalLayoutData(1, -1));
|
p.add(new FieldLabel(name, "Name"), new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
|
|
||||||
description = new TextArea();
|
description = new TextArea();
|
||||||
description.setAllowBlank(false);
|
description.setAllowBlank(false);
|
||||||
description.setEmptyText("Enter a description...");
|
description.setEmptyText("Enter a description...");
|
||||||
description.setValue(importSession.getSelectedCodelist().getDescription());
|
description.setValue(exportSession.getSelectedCodelist().getDescription());
|
||||||
p.add(new FieldLabel(description, "Description"), new VerticalLayoutData(1, -1));
|
p.add(new FieldLabel(description, "Description"), new VerticalLayoutData(1, -1));
|
||||||
|
|
||||||
right = new TextField();
|
right = new TextField();
|
||||||
|
@ -168,7 +170,7 @@ public class SDMXTableDetailCard extends WizardCard {
|
||||||
|
|
||||||
|
|
||||||
protected void loadData(PagingLoadConfig loadConfig, final AsyncCallback<PagingLoadResult<Agencies>> callback) {
|
protected void loadData(PagingLoadConfig loadConfig, final AsyncCallback<PagingLoadResult<Agencies>> callback) {
|
||||||
SDMXExportWizardServiceAsync.INSTANCE.getAgencies(new AsyncCallback<List<Agencies>>() {
|
TDGWTServiceAsync.INSTANCE.getAgencies(new AsyncCallback<ArrayList<Agencies>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -176,7 +178,7 @@ public class SDMXTableDetailCard extends WizardCard {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<Agencies> result) {
|
public void onSuccess(ArrayList<Agencies> result) {
|
||||||
Log.trace("loaded "+result.size()+" agencies");
|
Log.trace("loaded "+result.size()+" agencies");
|
||||||
for(int i=0; i<result.size(); i++){
|
for(int i=0; i<result.size(); i++){
|
||||||
Agencies ag=result.get(i);
|
Agencies ag=result.get(i);
|
||||||
|
@ -215,14 +217,15 @@ public class SDMXTableDetailCard extends WizardCard {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
TabResource detail=new TabResource();
|
||||||
detail.setName(name.getCurrentValue());
|
detail.setName(name.getCurrentValue());
|
||||||
detail.setAgency(combo.getSelectedText());
|
detail.setAgency(combo.getSelectedText());
|
||||||
detail.setDescription(description.getCurrentValue());
|
detail.setDescription(description.getCurrentValue());
|
||||||
detail.setRight(right.getCurrentValue());
|
detail.setRight(right.getCurrentValue());
|
||||||
|
|
||||||
importSession.setTableDetail(detail);
|
exportSession.setTabResource(detail);
|
||||||
SDMXOperationInProgressCard sdmxOperationInProgressCard = new SDMXOperationInProgressCard(
|
SDMXOperationInProgressCard sdmxOperationInProgressCard = new SDMXOperationInProgressCard(
|
||||||
importSession);
|
exportSession);
|
||||||
getWizardWindow()
|
getWizardWindow()
|
||||||
.addCard(sdmxOperationInProgressCard);
|
.addCard(sdmxOperationInProgressCard);
|
||||||
Log.info("NextCard SDMXOperationInProgressCard");
|
Log.info("NextCard SDMXOperationInProgressCard");
|
||||||
|
|
|
@ -6,7 +6,7 @@ package org.gcube.portlets.user.td.sdmxexportwidget.client.progress;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gxtservice.shared.TRId;
|
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.sencha.gxt.widget.core.client.ProgressBar;
|
import com.sencha.gxt.widget.core.client.ProgressBar;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.td.sdmxexportwidget.client.progress;
|
package org.gcube.portlets.user.td.sdmxexportwidget.client.progress;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gxtservice.shared.TRId;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ public interface OperationProgressListener {
|
||||||
/**
|
/**
|
||||||
* Called when the operation is complete.
|
* Called when the operation is complete.
|
||||||
*/
|
*/
|
||||||
public void operationComplete(TRId trId);
|
public void operationComplete(String url);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the operation is failed.
|
* Called when the operation is failed.
|
||||||
|
|
|
@ -5,9 +5,9 @@ package org.gcube.portlets.user.td.sdmxexportwidget.client.progress;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gxtservice.shared.TRId;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.rpc.SDMXExportWizardServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.shared.TRId;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.shared.ExportMonitor;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportMonitor;
|
||||||
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -33,7 +33,7 @@ public class OperationProgressUpdater extends Timer {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Log.debug("requesting operation progress");
|
Log.debug("requesting operation progress");
|
||||||
SDMXExportWizardServiceAsync.INSTANCE.getExportMonitor(new AsyncCallback<ExportMonitor>() {
|
TDGWTServiceAsync.INSTANCE.getSDMXExportMonitor(new AsyncCallback<SDMXExportMonitor>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -44,7 +44,7 @@ public class OperationProgressUpdater extends Timer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ExportMonitor result) {
|
public void onSuccess(SDMXExportMonitor result) {
|
||||||
Log.info("retrieved ImportMonitor: "+result.getStatus());
|
Log.info("retrieved ImportMonitor: "+result.getStatus());
|
||||||
switch (result.getStatus()) {
|
switch (result.getStatus()) {
|
||||||
case WAITING:
|
case WAITING:
|
||||||
|
@ -61,8 +61,8 @@ public class OperationProgressUpdater extends Timer {
|
||||||
break;
|
break;
|
||||||
case SUCCEDED:
|
case SUCCEDED:
|
||||||
cancel();
|
cancel();
|
||||||
Log.info("Import fisnish TableId :"+result.getTrId());
|
Log.info("Import fisnish TableId :"+result.getUrl());
|
||||||
fireOperationComplete(result.getTrId());
|
fireOperationComplete(result.getUrl());
|
||||||
break;
|
break;
|
||||||
case ABORTED:
|
case ABORTED:
|
||||||
cancel();
|
cancel();
|
||||||
|
@ -101,9 +101,9 @@ public class OperationProgressUpdater extends Timer {
|
||||||
for (OperationProgressListener listener:listeners) listener.operationUpdate(elaborated);
|
for (OperationProgressListener listener:listeners) listener.operationUpdate(elaborated);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void fireOperationComplete(TRId trId)
|
protected void fireOperationComplete(String url)
|
||||||
{
|
{
|
||||||
for (OperationProgressListener listener:listeners) listener.operationComplete(trId);
|
for (OperationProgressListener listener:listeners) listener.operationComplete(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void fireOperationFailed(Throwable caught, String failure, String failureDetails)
|
protected void fireOperationFailed(Throwable caught, String failure, String failureDetails)
|
||||||
|
|
Loading…
Reference in New Issue