diff options
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover')
10 files changed, 80 insertions, 79 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PasswordArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PasswordArgument.java index b32a4edd..1f90cda2 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PasswordArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PasswordArgument.java @@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.workflow.states.mobilebku.ATrustHelper; +import at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHelper; /** * CLI Argument to provide Mobile BKU password @@ -52,7 +52,7 @@ public class PasswordArgument extends CLIArgument { String password = args[argOffset + 1]; - ATrustHelper.validatePassword(password); + MobileBKUHelper.validatePassword(password); getConfiguration().setDefaultMobilePasswordOverlay(password); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PhoneNumberArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PhoneNumberArgument.java index eccebb21..a6a1cb79 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PhoneNumberArgument.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/PhoneNumberArgument.java @@ -21,7 +21,7 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.exceptions.InitializationException; import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.workflow.states.mobilebku.ATrustHelper; +import at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHelper; /** * CLI Argument to provide Mobile BKU phone number to use @@ -55,7 +55,7 @@ public class PhoneNumberArgument extends CLIArgument { String number = args[argOffset + 1]; - number = ATrustHelper.normalizeMobileNumber(number); + number = MobileBKUHelper.normalizeMobileNumber(number); getConfiguration().setDefaultMobileNumberOverlay(number); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java index 4c706c2d..1f4ef4d1 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java @@ -39,7 +39,7 @@ import at.asit.pdfover.gui.exceptions.InvalidNumberException; import at.asit.pdfover.gui.exceptions.InvalidPasswordException; import at.asit.pdfover.gui.utils.Messages; import at.asit.pdfover.gui.workflow.states.State; -import at.asit.pdfover.gui.workflow.states.mobilebku.ATrustHelper; +import at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHelper; /** * Composite for entering the phone number for the mobile BKU @@ -62,7 +62,7 @@ public class MobileBKUEnterNumberComposite extends StateComposite { .getText(); - number = ATrustHelper.normalizeMobileNumber(number); + number = MobileBKUHelper.normalizeMobileNumber(number); MobileBKUEnterNumberComposite.this.setMobileNumber(number); @@ -71,7 +71,7 @@ public class MobileBKUEnterNumberComposite extends StateComposite { String password = MobileBKUEnterNumberComposite.this.txt_password .getText(); - ATrustHelper.validatePassword(password); + MobileBKUHelper.validatePassword(password); MobileBKUEnterNumberComposite.this.mobilePassword = password; MobileBKUEnterNumberComposite.this.setUserAck(true); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java index f0f5cb78..df883496 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterTANComposite.java @@ -63,7 +63,7 @@ public class MobileBKUEnterTANComposite extends StateComposite { tan = tan.trim(); - if(MobileBKUEnterTANComposite.this.vergleichswert.startsWith(tan)) { + if(MobileBKUEnterTANComposite.this.refVal.startsWith(tan)) { MobileBKUEnterTANComposite.this.setMessage(Messages.getString("error.EnteredReferenceValue")); //$NON-NLS-1$ return; } @@ -89,6 +89,19 @@ public class MobileBKUEnterTANComposite extends StateComposite { boolean userAck = false; + + private Label lblRefVal; + + String refVal; + + String tan; + + private Label lblTries; + + private Label lblRefValLabel; + + private Label lblTan; + /** * @return the userAck */ @@ -101,7 +114,7 @@ public class MobileBKUEnterTANComposite extends StateComposite { * @param tries */ public void setTries(int tries) { - this.lbl_tries.setText( + this.lblTries.setText( tries == 1 ? Messages.getString("tanEnter.try") : //$NON-NLS-1$ String.format(Messages.getString("tanEnter.tries"), tries)); //$NON-NLS-1$ } @@ -111,9 +124,9 @@ public class MobileBKUEnterTANComposite extends StateComposite { * @param msg */ public void setMessage(String msg) { - this.lbl_tries.setText(msg); - this.lbl_tries.redraw(); - this.lbl_tries.getParent().layout(true, true); + this.lblTries.setText(msg); + this.lblTries.redraw(); + this.lblTries.getParent().layout(true, true); } /** @@ -123,35 +136,23 @@ public class MobileBKUEnterTANComposite extends StateComposite { this.userAck = userAck; } - private Label lblvergleich; - - String vergleichswert; - - String tan; - - private Label lbl_tries; - - private Label lblVergleichswert; - - private Label lblTan; - /** - * @return the vergleichswert + * @return the reference value */ - public String getVergleichswert() { - return this.vergleichswert; + public String getRefVal() { + return this.refVal; } /** - * @param vergleichswert the vergleichswert to set + * @param refVal the reference value to set */ - public void setVergleichswert(String vergleichswert) { - this.vergleichswert = vergleichswert.trim(); + public void setRefVal(String refVal) { + this.refVal = refVal.trim(); - if(this.vergleichswert != null) { - this.lblvergleich.setText(this.vergleichswert); + if(this.refVal != null) { + this.lblRefVal.setText(this.refVal); } else { - this.lblvergleich.setText(""); //$NON-NLS-1$ + this.lblRefVal.setText(""); //$NON-NLS-1$ } } @@ -211,15 +212,15 @@ public class MobileBKUEnterTANComposite extends StateComposite { containerComposite.setLayoutData(fd_containerComposite); - this.lblVergleichswert = new Label(containerComposite, SWT.NATIVE); - this.lblVergleichswert.setAlignment(SWT.RIGHT); - FormData fd_lblVergleichswert = new FormData(); - //fd_lblVergleichswert.left = new FormAttachment(0, 20); - fd_lblVergleichswert.right = new FormAttachment(50, -10); - //fd_lblVergleichswert.top = new FormAttachment(30, -15); - fd_lblVergleichswert.bottom = new FormAttachment(50, -10); - this.lblVergleichswert.setLayoutData(fd_lblVergleichswert); - this.lblVergleichswert.setText(Messages.getString("tanEnter.ReferenceValue")); //$NON-NLS-1$ + this.lblRefValLabel = new Label(containerComposite, SWT.NATIVE); + this.lblRefValLabel.setAlignment(SWT.RIGHT); + FormData fd_lblRefValLabel = new FormData(); + //fd_lblRefValLabel.left = new FormAttachment(0, 20); + fd_lblRefValLabel.right = new FormAttachment(50, -10); + //fd_lblRefValLabel.top = new FormAttachment(30, -15); + fd_lblRefValLabel.bottom = new FormAttachment(50, -10); + this.lblRefValLabel.setLayoutData(fd_lblRefValLabel); + this.lblRefValLabel.setText(Messages.getString("tanEnter.ReferenceValue")); //$NON-NLS-1$ Label lbl_image = new Label(containerComposite, SWT.NATIVE); @@ -234,14 +235,14 @@ public class MobileBKUEnterTANComposite extends StateComposite { lbl_image.setLayoutData(fd_lbl_image); lbl_image.setImage(mobile); - this.lblvergleich = new Label(containerComposite, SWT.NATIVE); - FormData fd_lblvergleich = new FormData(); - fd_lblvergleich.left = new FormAttachment(50, 10); - fd_lblvergleich.right = new FormAttachment(100, -20); - //fd_lblvergleich.top = new FormAttachment(30, -15); - fd_lblvergleich.bottom = new FormAttachment(50, -10); - this.lblvergleich.setLayoutData(fd_lblvergleich); - this.lblvergleich.setText(""); //$NON-NLS-1$ + this.lblRefVal = new Label(containerComposite, SWT.NATIVE); + FormData fd_lblRefVal = new FormData(); + fd_lblRefVal.left = new FormAttachment(50, 10); + fd_lblRefVal.right = new FormAttachment(100, -20); + //fd_lblRefVal.top = new FormAttachment(30, -15); + fd_lblRefVal.bottom = new FormAttachment(50, -10); + this.lblRefVal.setLayoutData(fd_lblRefVal); + this.lblRefVal.setText(""); //$NON-NLS-1$ this.lblTan = new Label(containerComposite, SWT.NATIVE); this.lblTan.setAlignment(SWT.RIGHT); @@ -278,7 +279,7 @@ public class MobileBKUEnterTANComposite extends StateComposite { String text = MobileBKUEnterTANComposite.this.txt_tan.getText(); //log.debug("Current TAN: " + text); //$NON-NLS-1$ - if(text.length() > 3 && MobileBKUEnterTANComposite.this.getVergleichswert().startsWith(text.trim())) { + if(text.length() > 3 && MobileBKUEnterTANComposite.this.getRefVal().startsWith(text.trim())) { MobileBKUEnterTANComposite.this.setMessage(Messages.getString("error.EnteredReferenceValue")); //$NON-NLS-1$ } } @@ -286,13 +287,13 @@ public class MobileBKUEnterTANComposite extends StateComposite { Button btn_ok = new Button(containerComposite, SWT.NATIVE); - this.lbl_tries = new Label(containerComposite, SWT.WRAP | SWT.NATIVE); + this.lblTries = new Label(containerComposite, SWT.WRAP | SWT.NATIVE); FormData fd_lbl_tries = new FormData(); //fd_lbl_tries.left = new FormAttachment(15, 5); fd_lbl_tries.right = new FormAttachment(btn_ok, -10); //fd_lbl_tries.top = new FormAttachment(70, -15); fd_lbl_tries.bottom = new FormAttachment(100, -20); - this.lbl_tries.setLayoutData(fd_lbl_tries); + this.lblTries.setLayoutData(fd_lbl_tries); FormData fd_btn_ok = new FormData(); @@ -325,7 +326,7 @@ public class MobileBKUEnterTANComposite extends StateComposite { */ @Override public void reloadResources() { - this.lblVergleichswert.setText(Messages.getString("tanEnter.ReferenceValue")); //$NON-NLS-1$ + this.lblRefValLabel.setText(Messages.getString("tanEnter.ReferenceValue")); //$NON-NLS-1$ this.lblTan.setText(Messages.getString("tanEnter.TAN")); //$NON-NLS-1$ } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigurationContainerImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigurationContainerImpl.java index 219ac99b..cb2a1ee8 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigurationContainerImpl.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/ConfigurationContainerImpl.java @@ -32,7 +32,7 @@ import at.asit.pdfover.gui.exceptions.InvalidEmblemFile; import at.asit.pdfover.gui.exceptions.InvalidNumberException; import at.asit.pdfover.gui.exceptions.InvalidPortException; import at.asit.pdfover.gui.utils.Messages; -import at.asit.pdfover.gui.workflow.states.mobilebku.ATrustHelper; +import at.asit.pdfover.gui.workflow.states.mobilebku.MobileBKUHelper; import at.asit.pdfover.signator.BKUs; import at.asit.pdfover.signator.SignaturePosition; @@ -148,7 +148,7 @@ public class ConfigurationContainerImpl implements ConfigurationContainer { return; } try { - this.mobileNumber = ATrustHelper.normalizeMobileNumber(number); + this.mobileNumber = MobileBKUHelper.normalizeMobileNumber(number); } catch (InvalidNumberException e) { throw new InvalidNumberException(Messages.getString("error.InvalidPhoneNumber")); //$NON-NLS-1$ } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java index bc831766..71e68d36 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java @@ -251,7 +251,7 @@ public class MobileBKUState extends State { postTanThread.start(); } else { - tan.setVergleichswert(mobileStatus.getVergleichswert()); + tan.setRefVal(mobileStatus.getRefVal()); if (mobileStatus.getTanTries() < MobileBKUStatus.MOBILE_MAX_TAN_TRIES && mobileStatus.getTanTries() > 0) { diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHelper.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHelper.java index ee984e96..cbb234cb 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHelper.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHelper.java @@ -30,12 +30,12 @@ import at.asit.pdfover.gui.exceptions.PasswordTooShortException; /** * */ -public class ATrustHelper { +public class MobileBKUHelper { /** * SLF4J Logger instance **/ private static final Logger log = LoggerFactory - .getLogger(ATrustHelper.class); + .getLogger(MobileBKUHelper.class); /** * Regular expression for mobile phone numbers: this allows the entrance of diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java index fd8ded4e..78dad7a5 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java @@ -58,7 +58,7 @@ public class MobileBKUStatus { String baseURL; - String vergleichswert; + String refVal; String errorMessage; @@ -109,17 +109,17 @@ public class MobileBKUStatus { } /** - * @return the vergleichswert + * @return the reference value */ - public String getVergleichswert() { - return this.vergleichswert; + public String getRefVal() { + return this.refVal; } /** - * @param vergleichswert the vergleichswert to set + * @param refVal the reference value to set */ - public void setVergleichswert(String vergleichswert) { - this.vergleichswert = vergleichswert; + public void setRefVal(String refVal) { + this.refVal = refVal; } /** diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostCredentialsThread.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostCredentialsThread.java index a2269d21..45656404 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostCredentialsThread.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostCredentialsThread.java @@ -129,28 +129,28 @@ public class PostCredentialsThread implements Runnable { String eventValidation = status.getEventvalidation(); String sessionID = status.getSessionID(); - String vergleichswert = null; + String refVal = null; - status.setVergleichswert(null); + status.setRefVal(null); status.setErrorMessage(null); if(responseData.contains("signature.aspx?sid=")) { //$NON-NLS-1$ // credentials ok! TAN eingabe - sessionID = ATrustHelper.extractTag(responseData, "signature.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - viewState = ATrustHelper.extractTag(responseData, "id=\"__VIEWSTATE\" value=\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ + sessionID = MobileBKUHelper.extractTag(responseData, "signature.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$ + viewState = MobileBKUHelper.extractTag(responseData, "id=\"__VIEWSTATE\" value=\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - eventValidation = ATrustHelper.extractTag(responseData, "id=\"__EVENTVALIDATION\" value=\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ + eventValidation = MobileBKUHelper.extractTag(responseData, "id=\"__EVENTVALIDATION\" value=\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - vergleichswert = ATrustHelper.extractTag(responseData, "id='vergleichswert'><b>Vergleichswert:</b>", "</div>"); //$NON-NLS-1$//$NON-NLS-2$ + refVal = MobileBKUHelper.extractTag(responseData, "id='vergleichswert'><b>Vergleichswert:</b>", "</div>"); //$NON-NLS-1$//$NON-NLS-2$ - status.setVergleichswert(vergleichswert); + status.setRefVal(refVal); this.state.setCommunicationState(MobileBKUCommunicationState.POST_TAN); } else { // error seite // extract error text! - String errorMessage = ATrustHelper.extractTag(responseData, "<span id=\"Label1\" class=\"ErrorClass\">", "</span>"); //$NON-NLS-1$ //$NON-NLS-2$ + String errorMessage = MobileBKUHelper.extractTag(responseData, "<span id=\"Label1\" class=\"ErrorClass\">", "</span>"); //$NON-NLS-1$ //$NON-NLS-2$ this.state.getStatus().setErrorMessage(errorMessage); @@ -159,7 +159,7 @@ public class PostCredentialsThread implements Runnable { } log.info("sessionID: " + sessionID); //$NON-NLS-1$ - log.info("Vergleichswert: " + vergleichswert); //$NON-NLS-1$ + log.info("Vergleichswert: " + refVal); //$NON-NLS-1$ log.info("viewState: " + viewState); //$NON-NLS-1$ log.info("eventValidation: " + eventValidation); //$NON-NLS-1$ diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostSLRequestThread.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostSLRequestThread.java index ecd1d98a..4de8f6fc 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostSLRequestThread.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/PostSLRequestThread.java @@ -146,7 +146,7 @@ public class PostSLRequestThread implements Runnable { String responseData = null; this.state.getStatus().setBaseURL( - ATrustHelper.stripQueryString(url)); + MobileBKUHelper.stripQueryString(url)); // Follow redirects do { @@ -188,13 +188,13 @@ public class PostSLRequestThread implements Runnable { // Extract infos: - String sessionID = ATrustHelper.extractTag(responseData, + String sessionID = MobileBKUHelper.extractTag(responseData, "identification.aspx?sid=", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - String viewState = ATrustHelper.extractTag(responseData, + String viewState = MobileBKUHelper.extractTag(responseData, "id=\"__VIEWSTATE\" value=\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ - String eventValidation = ATrustHelper.extractTag(responseData, + String eventValidation = MobileBKUHelper.extractTag(responseData, "id=\"__EVENTVALIDATION\" value=\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ log.info("sessionID: " + sessionID); //$NON-NLS-1$ |