Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-sdmx-import-widget@99290 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
192e9d08b7
commit
e5e74f8001
|
@ -0,0 +1,2 @@
|
||||||
|
disabled=06target
|
||||||
|
eclipse.preferences.version=1
|
7
pom.xml
7
pom.xml
|
@ -130,6 +130,13 @@
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- tabular-data-monitor-widget -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
<artifactId>tabular-data-monitor-widget</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- LOGGING -->
|
<!-- LOGGING -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -5,15 +5,17 @@ package org.gcube.portlets.user.td.sdmximportwidget.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.monitor.OperationMonitor;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.monitor.OperationMonitorSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
import org.gcube.portlets.user.td.gwtservice.shared.source.SDMXRegistrySource;
|
||||||
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorBarUpdater;
|
||||||
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorUpdater;
|
||||||
|
import org.gcube.portlets.user.td.monitorwidget.client.MonitorUpdaterListener;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
import org.gcube.portlets.user.td.sdmximportwidget.client.progress.ImportProgressBarUpdater;
|
|
||||||
import org.gcube.portlets.user.td.sdmximportwidget.client.progress.OperationProgressListener;
|
|
||||||
import org.gcube.portlets.user.td.sdmximportwidget.client.progress.OperationProgressUpdater;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.user.client.Command;
|
import com.google.gwt.user.client.Command;
|
||||||
|
@ -41,12 +43,13 @@ import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SDMXOperationInProgressCard extends WizardCard implements
|
public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
OperationProgressListener {
|
MonitorUpdaterListener {
|
||||||
|
|
||||||
public static final int STATUS_POLLING_DELAY = 1000;
|
public static final int STATUS_POLLING_DELAY = 1000;
|
||||||
protected SDMXOperationInProgressCard thisCard;
|
protected SDMXOperationInProgressCard thisCard;
|
||||||
protected SDMXImportSession importSession;
|
protected SDMXImportSession importSession;
|
||||||
protected OperationProgressUpdater progressUpdater;
|
protected MonitorUpdater progressUpdater;
|
||||||
|
protected ProgressBar progressBar;
|
||||||
|
|
||||||
public SDMXOperationInProgressCard(final SDMXImportSession importSession) {
|
public SDMXOperationInProgressCard(final SDMXImportSession importSession) {
|
||||||
super("Operation In Progress", "");
|
super("Operation In Progress", "");
|
||||||
|
@ -129,21 +132,25 @@ public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
operationInProgressPanel.add(progressBar, new BoxLayoutData(
|
operationInProgressPanel.add(progressBar, new BoxLayoutData(
|
||||||
new Margins(10, 5, 10, 5)));
|
new Margins(10, 5, 10, 5)));
|
||||||
|
|
||||||
progressUpdater = new OperationProgressUpdater();
|
|
||||||
progressUpdater.addListener(new ImportProgressBarUpdater(progressBar));
|
|
||||||
|
|
||||||
progressUpdater.addListener(this);
|
|
||||||
|
|
||||||
setContent(operationInProgressPanel);
|
setContent(operationInProgressPanel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void importSDMX() {
|
public void importSDMX() {
|
||||||
TDGWTServiceAsync.INSTANCE.startSDMXImport(importSession,
|
TDGWTServiceAsync.INSTANCE.startSDMXImport(importSession,
|
||||||
new AsyncCallback<Void>() {
|
new AsyncCallback<String>() {
|
||||||
|
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(String taskId) {
|
||||||
|
OperationMonitorSession operationMonitorSession = new OperationMonitorSession(
|
||||||
|
taskId);
|
||||||
|
progressUpdater = new MonitorUpdater(
|
||||||
|
operationMonitorSession);
|
||||||
|
progressUpdater.addListener(new MonitorBarUpdater(
|
||||||
|
progressBar));
|
||||||
|
|
||||||
|
progressUpdater.addListener(thisCard);
|
||||||
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -172,23 +179,24 @@ public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
importSDMX();
|
importSDMX();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void operationInitializing() {
|
@Override
|
||||||
|
public void monitorInitializing(OperationMonitor operationMonitor) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void operationUpdate(float elaborated) {
|
@Override
|
||||||
|
public void monitorUpdate(OperationMonitor operationMonitor) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void operationComplete(final TRId trId) {
|
@Override
|
||||||
// final String tableId,final String tableResourceId) {
|
public void monitorComplete(final TRId trId) {
|
||||||
|
|
||||||
Command sayComplete = new Command() {
|
Command sayComplete = new Command() {
|
||||||
public void execute() {
|
public void execute() {
|
||||||
try {
|
try {
|
||||||
getWizardWindow().close(false);
|
getWizardWindow().close(false);
|
||||||
Log.info("fire Complete: tabular resource " + trId.getId());
|
Log.info("fire Complete: " + trId);
|
||||||
Log.info("fire Complete: tableId " + trId.getTableId());
|
|
||||||
|
|
||||||
getWizardWindow().fireCompleted(trId);
|
getWizardWindow().fireCompleted(trId);
|
||||||
|
|
||||||
|
@ -204,7 +212,8 @@ public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
getWizardWindow().setEnableNextButton(true);
|
getWizardWindow().setEnableNextButton(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void operationFailed(Throwable caught, String reason,
|
@Override
|
||||||
|
public void monitorFailed(Throwable caught, String reason,
|
||||||
String failureDetails) {
|
String failureDetails) {
|
||||||
if (caught instanceof TDGWTSessionExpiredException) {
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
getEventBus()
|
getEventBus()
|
||||||
|
@ -212,22 +221,18 @@ public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
new SessionExpiredEvent(
|
new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
AlertMessageBox d = new AlertMessageBox("Error in SDMX Import",
|
AlertMessageBox d = new AlertMessageBox(
|
||||||
reason);
|
"Error in Codelist Mapping Import", reason);
|
||||||
d.addHideHandler(new HideHandler() {
|
d.addHideHandler(new HideHandler() {
|
||||||
|
|
||||||
public void onHide(HideEvent event) {
|
public void onHide(HideEvent event) {
|
||||||
//
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
d.show();
|
d.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operationStopped(final TRId trId, String reason, String details) {
|
public void monitorStopped(final TRId trId, String reason, String details) {
|
||||||
// final String tableId,final String tableResourceId) {
|
|
||||||
|
|
||||||
Command sayComplete = new Command() {
|
Command sayComplete = new Command() {
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
@ -252,13 +257,27 @@ public class SDMXOperationInProgressCard extends WizardCard implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operationGeneratingView() {
|
public void monitorGeneratingView(OperationMonitor operationMonitor) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void operationValidate(float elaborated) {
|
public void monitorValidate(OperationMonitor operationMonitor) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void monitorAborted() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void monitorPutInBackground() {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,101 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.gcube.portlets.user.td.sdmximportwidget.client.progress;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
|
||||||
import com.sencha.gxt.widget.core.client.ProgressBar;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates a {@link ProgressBar} progress and text based on {@link OperationProgressListener} events.
|
|
||||||
*
|
|
||||||
* @author "Giancarlo Panichi"
|
|
||||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class ImportProgressBarUpdater implements OperationProgressListener {
|
|
||||||
|
|
||||||
protected ProgressBar progressBar;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new {@link ProgressBar} updater.
|
|
||||||
* @param progressBar the {@link ProgressBar} to update.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public ImportProgressBarUpdater(ProgressBar progressBar) {
|
|
||||||
this.progressBar = progressBar;
|
|
||||||
this.progressBar.updateProgress(0, "Please Wait...");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void operationComplete(TRId trId) {
|
|
||||||
Log.info("Import complete");
|
|
||||||
progressBar.updateProgress(1, "Import complete.");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationFailed(Throwable caught, String reason, String failureDetails) {
|
|
||||||
Log.info("Import failed");
|
|
||||||
progressBar.updateText("Import failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationInitializing() {
|
|
||||||
Log.info("Inport inizializing");
|
|
||||||
progressBar.updateProgress(0, "Initializing...");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationUpdate(float elaborated) {
|
|
||||||
Log.info("Elaborated: "+elaborated);
|
|
||||||
if (elaborated>=0 && elaborated<1) {
|
|
||||||
Log.trace("progress "+elaborated);
|
|
||||||
int elab=new Float(elaborated*100).intValue();
|
|
||||||
progressBar.updateProgress(elaborated,elab+"% Importing...");
|
|
||||||
}
|
|
||||||
if (elaborated == 1) progressBar.updateProgress(1, "Completed");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationValidate(float elaborated) {
|
|
||||||
Log.info("Validation Elaborated: "+elaborated);
|
|
||||||
if (elaborated == 0) progressBar.updateProgress(0, "Start Validation...");
|
|
||||||
if (elaborated>0 && elaborated<1) {
|
|
||||||
Log.trace("Validation progress "+elaborated);
|
|
||||||
int elab=new Float(elaborated*100).intValue();
|
|
||||||
progressBar.updateProgress(elaborated,elab+"% Validation Progress...");
|
|
||||||
}
|
|
||||||
if (elaborated == 1) progressBar.updateProgress(1, "Validation...");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationStopped(TRId trId,String reason, String details) {
|
|
||||||
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
|
|
||||||
progressBar.updateText("Validations failed");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void operationGeneratingView() {
|
|
||||||
Log.info("Generating View...");
|
|
||||||
progressBar.updateText("Generating View...");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.gcube.portlets.user.td.sdmximportwidget.client.progress;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines a listener for operation progress.
|
|
||||||
*
|
|
||||||
* @author "Giancarlo Panichi" <a
|
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public interface OperationProgressListener {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the operation is starting.
|
|
||||||
*/
|
|
||||||
public void operationInitializing();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when there is a progress for the operation.
|
|
||||||
*
|
|
||||||
* @param elaborated
|
|
||||||
* the elaborated part.
|
|
||||||
*/
|
|
||||||
public void operationUpdate(float elaborated);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when there is a validate for the operation.
|
|
||||||
* @param elaborated the elaborated part.
|
|
||||||
*/
|
|
||||||
public void operationValidate(float elaborated);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the operation is complete.
|
|
||||||
*/
|
|
||||||
public void operationComplete(TRId trId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the operation is failed.
|
|
||||||
*
|
|
||||||
* @param caught
|
|
||||||
* the failure exception.
|
|
||||||
* @param reason
|
|
||||||
* the failure reason.
|
|
||||||
*/
|
|
||||||
public void operationFailed(Throwable caught, String reason,
|
|
||||||
String failureDetails);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the operation is stopped
|
|
||||||
*
|
|
||||||
* @param trId
|
|
||||||
* @param reason
|
|
||||||
* @param details
|
|
||||||
*/
|
|
||||||
public void operationStopped(TRId trId, String reason, String details);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when the operation is generating the view
|
|
||||||
*/
|
|
||||||
public void operationGeneratingView();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,192 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.gcube.portlets.user.td.sdmximportwidget.client.progress;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportMonitor;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
|
||||||
import com.google.gwt.user.client.Timer;
|
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This {@link Timer} retrieves {@link OperationProgress} from the specified
|
|
||||||
* {@link OperationProgressSource} with the scheduled interval. The retrieved
|
|
||||||
* information are spread to the subscribed {@link OperationProgressListener}.
|
|
||||||
*
|
|
||||||
* @author "Giancarlo Panichi" <a
|
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class OperationProgressUpdater extends Timer {
|
|
||||||
|
|
||||||
protected ArrayList<OperationProgressListener> listeners = new ArrayList<OperationProgressListener>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Log.debug("requesting operation progress");
|
|
||||||
TDGWTServiceAsync.INSTANCE
|
|
||||||
.getSDMXImportMonitor(new AsyncCallback<SDMXImportMonitor>() {
|
|
||||||
|
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
cancel();
|
|
||||||
Log.error("Error retrieving the operation state",
|
|
||||||
caught);
|
|
||||||
String message = getStack(caught);
|
|
||||||
fireOperationFailed(caught,
|
|
||||||
"Failed getting operation updates", message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onSuccess(SDMXImportMonitor result) {
|
|
||||||
Log.info("retrieved ImportMonitor: "
|
|
||||||
+ result.getStatus());
|
|
||||||
switch (result.getStatus()) {
|
|
||||||
case INITIALIZING:
|
|
||||||
Log.info("Initializing...");
|
|
||||||
fireOperationInitializing();
|
|
||||||
break;
|
|
||||||
case IN_PROGRESS:
|
|
||||||
fireOperationUpdate(result.getProgress());
|
|
||||||
break;
|
|
||||||
case VALIDATING_RULES:
|
|
||||||
fireOperationValidate(result.getProgress());
|
|
||||||
break;
|
|
||||||
case GENERATING_VIEW:
|
|
||||||
Log.info("Generating View...");
|
|
||||||
fireOperationGeneratingView();
|
|
||||||
break;
|
|
||||||
case FAILED:
|
|
||||||
cancel();
|
|
||||||
errorMessage(result);
|
|
||||||
break;
|
|
||||||
case STOPPED:
|
|
||||||
cancel();
|
|
||||||
stopMessage(result);
|
|
||||||
break;
|
|
||||||
case SUCCEDED:
|
|
||||||
cancel();
|
|
||||||
Log.info("Import fisnish TableId :"
|
|
||||||
+ result.getTrId());
|
|
||||||
fireOperationComplete(result.getTrId());
|
|
||||||
break;
|
|
||||||
case ABORTED:
|
|
||||||
Log.info("Import SDMX Aborted");
|
|
||||||
cancel();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected void errorMessage(SDMXImportMonitor result) {
|
|
||||||
Log.info("SDMX Import Failed");
|
|
||||||
Throwable th = null;
|
|
||||||
String failure = null;
|
|
||||||
String details = null;
|
|
||||||
if (result.getError() != null) {
|
|
||||||
th = result.getError();
|
|
||||||
failure = "Failed Client Library Import";
|
|
||||||
details = result.getError().getLocalizedMessage();
|
|
||||||
} else {
|
|
||||||
th = new Throwable("Failed");
|
|
||||||
failure = "Failed Client Library Import";
|
|
||||||
details = "Error in import";
|
|
||||||
}
|
|
||||||
fireOperationFailed(th, failure, details);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void stopMessage(SDMXImportMonitor result) {
|
|
||||||
Log.info("SDMX Import Stopped");
|
|
||||||
String failure = null;
|
|
||||||
String details = null;
|
|
||||||
if (result.getError() != null) {
|
|
||||||
failure = "Stopped";
|
|
||||||
details = result.getError().getLocalizedMessage();
|
|
||||||
} else {
|
|
||||||
failure = "Stopped";
|
|
||||||
details = "Stopped import SDMX";
|
|
||||||
}
|
|
||||||
|
|
||||||
fireOperationStopped(result.getTrId(),failure, details);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String getStack(Throwable e) {
|
|
||||||
String message = e.getLocalizedMessage() + " -> <br>";
|
|
||||||
Throwable c = e.getCause();
|
|
||||||
if (c != null)
|
|
||||||
message += getStack(c);
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fireOperationInitializing() {
|
|
||||||
for (OperationProgressListener listener : listeners)
|
|
||||||
listener.operationInitializing();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fireOperationGeneratingView() {
|
|
||||||
for (OperationProgressListener listener : listeners)
|
|
||||||
listener.operationGeneratingView();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fireOperationUpdate(float elaborated) {
|
|
||||||
for (OperationProgressListener listener : listeners)
|
|
||||||
listener.operationUpdate(elaborated);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fireOperationValidate(float elaborated) {
|
|
||||||
for (OperationProgressListener listener : listeners)
|
|
||||||
listener.operationValidate(elaborated);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fireOperationComplete(TRId trId) {
|
|
||||||
for (OperationProgressListener listener : listeners)
|
|
||||||
listener.operationComplete(trId);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fireOperationFailed(Throwable caught, String failure,
|
|
||||||
String failureDetails) {
|
|
||||||
for (OperationProgressListener listener : listeners)
|
|
||||||
listener.operationFailed(caught, failure, failureDetails);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void fireOperationStopped(TRId trId, String reason, String details) {
|
|
||||||
for (OperationProgressListener listener : listeners)
|
|
||||||
listener.operationStopped(trId,reason, details);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a new {@link OperationProgressListener} to this
|
|
||||||
* {@link OperationProgressUpdater}.
|
|
||||||
*
|
|
||||||
* @param listener
|
|
||||||
* the listener to add.
|
|
||||||
*/
|
|
||||||
public void addListener(OperationProgressListener listener) {
|
|
||||||
listeners.add(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the specified {@link OperationProgressListener} from this
|
|
||||||
* {@link OperationProgressUpdater}.
|
|
||||||
*
|
|
||||||
* @param listener
|
|
||||||
* the listener to remove.
|
|
||||||
*/
|
|
||||||
public void removeListener(OperationProgressListener listener) {
|
|
||||||
listeners.remove(listener);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -19,6 +19,7 @@
|
||||||
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
|
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
|
||||||
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
|
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
|
||||||
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
||||||
|
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue