diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 18:57:41 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 18:57:41 +0000 |
commit | fdc0f9a9dfc7dabdc96bb830a079a353f160395c (patch) | |
tree | 43b05a50edf88feaaa298273ea949af77d520ec7 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java | |
parent | f294a5abda6947a2edd7eb502ca340ac6c02f68f (diff) | |
download | pdf-over-fdc0f9a9dfc7dabdc96bb830a079a353f160395c.tar.gz pdf-over-fdc0f9a9dfc7dabdc96bb830a079a353f160395c.tar.bz2 pdf-over-fdc0f9a9dfc7dabdc96bb830a079a353f160395c.zip |
Fixed some TODOs...
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@57 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java index ca0e164c..9962d968 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java @@ -20,11 +20,14 @@ import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.methods.PostMethod; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Display; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.MainWindow.Buttons; import at.asit.pdfover.gui.MainWindowBehavior; +import at.asit.pdfover.gui.controls.ErrorDialog; import at.asit.pdfover.gui.workflow.StateMachine; import at.asit.pdfover.gui.workflow.Status; import at.asit.pdfover.signator.SLRequest; @@ -86,7 +89,7 @@ public class LocalBKUState extends State { log.debug("SL REQUEST: " + sl_request); //$NON-NLS-1$ method.addParameter("XMLRequest", sl_request); //$NON-NLS-1$ - + int returnCode = client.executeMethod(method); if(returnCode == HttpStatus.SC_OK) @@ -115,13 +118,12 @@ public class LocalBKUState extends State { SLResponse slResponse = new SLResponse(response, server, userAgent, signatureLayout); this.state.signingState.setSignatureResponse(slResponse); } else { - // TODO: Create HTTP exception this.state.threadException = new HttpException(method.getResponseBodyAsString()); } } catch (Exception e) { log.error("SignLocalBKUThread: ", e); //$NON-NLS-1$ - // TODO: Is local BKU running? + // this.state.threadException = e; } finally { this.state.stateMachine.invokeUpdate(); @@ -168,17 +170,13 @@ public class LocalBKUState extends State { } if(this.threadException != null) { - ErrorState error = new ErrorState(this.stateMachine); - error.setException(this.threadException); - this.setNextState(error); + ErrorDialog dialog = new ErrorDialog(Display.getCurrent().getActiveShell(), SWT.NONE, "Please check if a local BKU is running", this.threadException); + dialog.open(); + this.threadException = null; + this.run(); return; } - if(!this.signingState.hasSignatureResponse()) { - // The thread should set the response or the thread exception!!! - // TODO: Jump to error state! - } - // OK this.setNextState(new SigningState(this.stateMachine)); } |