From e48b7b84c057762ce8e8fa43d26814711752d399 Mon Sep 17 00:00:00 2001 From: tkellner Date: Mon, 1 Oct 2012 08:30:42 +0000 Subject: Fixed some TODOs... git-svn-id: https://svn.iaik.tugraz.at/svn/egiz/prj/current/12PDF-OVER-4.0@12538 3a0b52a2-8410-0410-bc02-ff6273a87459 --- .../pdfover/gui/workflow/states/LocalBKUState.java | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java index ca0e164c..9962d968 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/LocalBKUState.java +++ b/trunk/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)); } -- cgit v1.2.3