From 6684441798e6fdb899f4e67e39a42ccd40e8a607 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 18:59:00 +0000 Subject: Fixed some error with output folder variables setting pdfas config folder added extraction of pdfover config folder git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@66 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../src/main/java/at/asit/pdfover/gui/Main.java | 10 ++ .../composites/AdvancedConfigurationComposite.java | 5 +- .../java/at/asit/pdfover/gui/messages.properties | 113 -------------------- .../pdfover/gui/workflow/ConfigProviderImpl.java | 6 +- .../gui/workflow/states/MobileBKUState.java | 58 +++++++---- .../workflow/states/PrepareConfigurationState.java | 116 ++++++++++++++++++--- 6 files changed, 157 insertions(+), 151 deletions(-) delete mode 100644 pdf-over-gui/src/main/java/at/asit/pdfover/gui/messages.properties (limited to 'pdf-over-gui/src') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java index 43762b13..809c1d7d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/Main.java @@ -16,6 +16,8 @@ package at.asit.pdfover.gui; //Imports +import java.io.File; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,6 +38,14 @@ public class Main { */ public static void main(String[] args) { StateMachineImpl stateMachine = new StateMachineImpl(args); + + File configDir = new File(System.getProperty("user.home")+"/.pdfover"); + + if(!configDir.exists()) { + configDir.mkdir(); + + } + log.debug("Starting stateMachine ..."); //$NON-NLS-1$ stateMachine.start(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java index 2c25bd61..4b342cad 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java @@ -333,7 +333,10 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite { // load advanced settings this.performBKUSelectionChanged(this.configurationContainer.getBKUSelection()); - this.performOutputFolderChanged(this.configurationContainer.getOutputFolder()); + String outputFolder = this.configurationContainer.getOutputFolder(); + if(outputFolder != null) { + this.performOutputFolderChanged(outputFolder); + } this.performPositionSelection(this.configurationContainer.getAutomaticPosition()); } diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/messages.properties deleted file mode 100644 index 244cfb3d..00000000 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/messages.properties +++ /dev/null @@ -1,113 +0,0 @@ -TrustedSocketFactory.FailedToCreateSecureConnection=Failed to create secure network connection - -main.title=PDF-Over -main.configuration=Configuration -main.position=Positioning -main.signature=Signing -main.done=Finish - -common.browse=browse -common.Cancel=Cancel -common.Ok=OK -common.Save=Save -common.PDFExtension_Description=PDF documents -common.JPGExtension_Description=JPG Dateien -common.GIFExtension_Description=Gif Dateien -common.ALLExtension_Description=All files -common.file=File: -common.file_not_exists= does not exist! -common.open=Open - -config.Simple=Simple -config.Advanced=Advanced - -advanced_config.AutoPosition_Title=Positioning -advanced_config.AutoPosition=Automatic positioning -advanced_config.BKUSelection_Title=BKU Selection -advanced_config.OutputFolder_Title=Output location -advanced_config.OutputFolder=Default output folder: -advanced_config.OutputFolder.Dialog_Title=Select Output folder -advanced_config.OutputFolder.Dialog=Select a folder - -simple_config.Emblem_Title=Emblem -simple_config.EmblemEmpty=No Image. Drag and Drop a Image. Or use the browse button to select an emblem. -simple_config.UseEmblem=Use emblem -simple_config.MobileBKU_Title=Mobile signature -simple_config.PhoneNumber=Mobile number: -simple_config.ExampleNumber=+43676123456789 -simple_config.Proxy_Title=Proxy -simple_config.ProxyHost=Host: -simple_config.ProxyHostTemplate=Hostname or IP of proxy server -simple_config.ProxyPort=Port: -simple_config.ProxyPortTemplate=port proxy server [1-65535] - - - -dataSourceSelection.DropLabel=To sign a document\ndrag and drop it here\nor use the button below - -bku_selection.card=CARD -bku_selection.mobile=MOBILE - -mobileBKU.number=Number: -mobileBKU.password=Password: - -tanEnter.tries= tries left!" -tanEnter.ReferenceValue=reference value -tanEnter.TAN=TAN: - -BKU.LOCAL=Local BKU -BKU.MOBILE=Mobile BKU -BKU.NONE=no default - -error.SaveOutputFolder=Failed to save signed document to configured output folder. -error.Signatur=Signature error -error.PrepareDocument=Failed to prepare document for signature. -error.Initialization=Initialization failed. Please check your configuration. -error.Unexpected=Unexpected Error -error.LocalBKU=Please check if a local BKU is running -error.Details=Details -error.Retry=Retry -error.InvalidBKU=Invalid BKU selection. Please check. -error.InvalidSettings=Invalid settings are still present. Please check your input. -error.FailedToSaveSettings=Failed to save configuration file! -error.InvalidPhoneNumber=Given phone number is invalid! Example: +43664123456789 -error.EnteredReferenceValue=You entered the reference value! -error.TanTooLong=Entered TAN too long -error.FailedToGetSignedDocument=Failed to get signed document. -error.FailedToLoadEmblem=Failed to load the emblem - -exception.InvalidEmblemFile= is an invalid emblem file! -exception.InvalidPort= is invalid has to be between 1 and -exception.PasswordTooLong=Given password is too long! -exception.PasswordTooShort=Given password is too short! - -argument.help.bku=Select the BKU to use values are: LOCAL, MOBILE (example: -b