Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-extractcodelist-widget@96307 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-29 16:11:49 +00:00
parent 71da9b38fc
commit 39177ac3b6
3 changed files with 23 additions and 23 deletions

View File

@ -75,7 +75,7 @@ public class ExtractCodelistOperationInProgressCard extends WizardCard implement
ProgressBar progressBar = new ProgressBar(); ProgressBar progressBar = new ProgressBar();
operationInProgressPanel.add(progressBar, new BoxLayoutData( operationInProgressPanel.add(progressBar, new BoxLayoutData(
new Margins(10, 5, 10, 5))); new Margins(10, 30, 10, 5)));
progressUpdater = new ExtractCodelistProgressUpdater(); progressUpdater = new ExtractCodelistProgressUpdater();
progressUpdater progressUpdater

View File

@ -36,8 +36,8 @@ public class ExtractCodelistProgressBarUpdater implements ExtractCodelistProgres
* {@inheritDoc} * {@inheritDoc}
*/ */
public void operationComplete() { public void operationComplete() {
Log.info("Export completed"); Log.info("Completed");
progressBar.updateProgress(1, "Export completed."); progressBar.updateProgress(1, "Completed.");
} }
@ -45,8 +45,8 @@ public class ExtractCodelistProgressBarUpdater implements ExtractCodelistProgres
* {@inheritDoc} * {@inheritDoc}
*/ */
public void operationFailed(Throwable caught, String reason, String failureDetails) { public void operationFailed(Throwable caught, String reason, String failureDetails) {
Log.info("Export failed"); Log.info("Failed");
progressBar.updateText("Export failed"); progressBar.updateText("Failed");
} }
public void operationInitializing() { public void operationInitializing() {
@ -61,7 +61,7 @@ public class ExtractCodelistProgressBarUpdater implements ExtractCodelistProgres
if (elaborated>0 && elaborated<1) { if (elaborated>0 && elaborated<1) {
Log.trace("progress "+elaborated); Log.trace("progress "+elaborated);
int elab=new Float(elaborated*100).intValue(); int elab=new Float(elaborated*100).intValue();
progressBar.updateProgress(elaborated,elab+"% Exporting..."); progressBar.updateProgress(elaborated,elab+"% Progress...");
} }
if (elaborated == 1) progressBar.updateProgress(1, "Completing..."); if (elaborated == 1) progressBar.updateProgress(1, "Completing...");

View File

@ -6,7 +6,7 @@ package org.gcube.portlets.user.td.extractcodelistwidget.client.progress;
import java.util.ArrayList; import java.util.ArrayList;
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.csv.CSVExportMonitor; import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistMonitor;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
@ -31,7 +31,7 @@ public class ExtractCodelistProgressUpdater extends Timer {
public void run() { public void run() {
Log.debug("requesting operation progress"); Log.debug("requesting operation progress");
TDGWTServiceAsync.INSTANCE TDGWTServiceAsync.INSTANCE
.getCSVExportMonitor(new AsyncCallback<CSVExportMonitor>() { .getExtractCodelistMonitor(new AsyncCallback<ExtractCodelistMonitor>() {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
@ -43,17 +43,17 @@ public class ExtractCodelistProgressUpdater extends Timer {
"Failed getting operation updates", message); "Failed getting operation updates", message);
} }
public void onSuccess(CSVExportMonitor result) { public void onSuccess(ExtractCodelistMonitor result) {
Log.info("retrieved CSVImportMonitor: " Log.info("retrieved Monitor: "
+ result.getStatus()); + result.getStatus());
switch (result.getStatus()) { switch (result.getStatus()) {
case INITIALIZING: case INITIALIZING:
Log.info("CSV Export Initializing..."); Log.info("Initializing...");
fireOperationInitializing(); fireOperationInitializing();
break; break;
case ABORTED: case ABORTED:
cancel(); cancel();
Log.info("CSV Export Operation Aborted"); Log.info("Operation Aborted");
break; break;
case IN_PROGRESS: case IN_PROGRESS:
fireOperationUpdate(result.getProgress()); fireOperationUpdate(result.getProgress());
@ -75,8 +75,8 @@ public class ExtractCodelistProgressUpdater extends Timer {
break; break;
case SUCCEDED: case SUCCEDED:
cancel(); cancel();
Log.info("Export fisnish ExportMetadata:" Log.info("Finish:"
+ result.getTrExportMetadata()); + result.toString());
fireOperationComplete(); fireOperationComplete();
break; break;
default: default:
@ -90,18 +90,18 @@ public class ExtractCodelistProgressUpdater extends Timer {
} }
protected void errorMessage(CSVExportMonitor result) { protected void errorMessage(ExtractCodelistMonitor result) {
Log.info("CSV Export Failed"); Log.info("Extract Codelist Failed");
Throwable th = null; Throwable th = null;
String failure = null; String failure = null;
String details = null; String details = null;
if (result.getError() != null) { if (result.getError() != null) {
th = result.getError(); th = result.getError();
failure = "Failed Client Library Export"; failure = "Failed Client Library Extract Codelist";
details = result.getError().getLocalizedMessage(); details = result.getError().getLocalizedMessage();
} else { } else {
th = new Throwable("Failed"); th = new Throwable("Failed");
failure = "Failed Client Library Export"; failure = "Failed Client Library Extract Codelist";
details = "Error in export"; details = "Error in export";
} }
@ -109,16 +109,16 @@ public class ExtractCodelistProgressUpdater extends Timer {
} }
protected void stopMessage(CSVExportMonitor result) { protected void stopMessage(ExtractCodelistMonitor result) {
Log.info("CSV Export Stopped"); Log.info("Extract Codelist Stopped");
String failure = null; String failure = null;
String details = null; String details = null;
if (result.getError() != null) { if (result.getError() != null) {
failure = "Stopped export csv"; failure = "Stopped extract codelist";
details = result.getError().getLocalizedMessage(); details = result.getError().getLocalizedMessage();
} else { } else {
failure = "Stopped export csv"; failure = "Stopped extract codelist";
details = "Stopped export csv"; details = "Stopped extract codelist";
} }
fireOperationStopped(result.getTrId(),failure, details); fireOperationStopped(result.getTrId(),failure, details);