diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:38:16 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:38:16 +0000 |
commit | 4c855f38594a63060061d90f17b62cfe47aab533 (patch) | |
tree | 65692521cde693caf361d8d2f9dda0e84e361d9e /pdf-over-gui | |
parent | ea349f87b971751dfefc21a2bb60ce8a6d61061b (diff) | |
download | mocca-4c855f38594a63060061d90f17b62cfe47aab533.tar.gz mocca-4c855f38594a63060061d90f17b62cfe47aab533.tar.bz2 mocca-4c855f38594a63060061d90f17b62cfe47aab533.zip |
Add cmd line arg for automatic positioning
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@428 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui')
4 files changed, 63 insertions, 11 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/AutomaticPositioningArgument.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/AutomaticPositioningArgument.java new file mode 100644 index 00000000..3c6b9f3e --- /dev/null +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/cliarguments/AutomaticPositioningArgument.java @@ -0,0 +1,48 @@ +/* + * Copyright 2012 by A-SIT, Secure Information Technology Center Austria + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://joinup.ec.europa.eu/software/page/eupl + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + */ +package at.asit.pdfover.gui.cliarguments; + +import at.asit.pdfover.gui.exceptions.InitializationException; +import at.asit.pdfover.signator.SignaturePosition; + +/** + * CLI Argument to set the BKU to use + */ +public class AutomaticPositioningArgument extends Argument { + /** + * Constructor + */ + public AutomaticPositioningArgument() { + super(new String[] { "-a" }, "argument.help.autopos"); //$NON-NLS-1$ //$NON-NLS-2$ + } + + /* + * (non-Javadoc) + * + * @see + * at.asit.pdfover.gui.cliarguments.CLIArgument#handleArgument(java.lang + * .String[], int, at.asit.pdfover.gui.workflow.StateMachine, + * at.asit.pdfover.gui.cliarguments.ArgumentHandler) + */ + @Override + public int handleArgument(String[] args, int argOffset, + ArgumentHandler handler) + throws InitializationException { + getConfiguration().setDefaultSignaturePositionOverlay(new SignaturePosition()); + return argOffset; + } + +} diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java index bf0694d4..d0f1f014 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java @@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory; import at.asit.pdfover.gui.Constants; import at.asit.pdfover.gui.cliarguments.ArgumentHandler; +import at.asit.pdfover.gui.cliarguments.AutomaticPositioningArgument; import at.asit.pdfover.gui.cliarguments.BKUArgument; import at.asit.pdfover.gui.cliarguments.ConfigFileArgument; import at.asit.pdfover.gui.cliarguments.EmblemArgument; @@ -71,6 +72,7 @@ public class PrepareConfigurationState extends State { super(stateMachine); this.handler = new ArgumentHandler(this.stateMachine); this.handler.addCLIArgument(HelpArgument.class); + this.handler.addCLIArgument(AutomaticPositioningArgument.class); this.handler.addCLIArgument(BKUArgument.class); this.handler.addCLIArgument(PhoneNumberArgument.class); this.handler.addCLIArgument(EmblemArgument.class); diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties index e2247ec0..7557948f 100644 --- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages.properties @@ -22,7 +22,8 @@ advanced_config.SigPHTransparencyMax=Opaque advanced_config.SigPHTransparencyMin=Invisible advanced_config.SigPHTransparencyTooltip=Set the transparency of the signature placeholder in the positioning step argument.error.output=is not a directory -argument.help.bku=Select the CCE to use. Values are: LOCAL, MOBILE. Example: -b <option> +argument.help.autopos=Enables automatic signature positioning +argument.help.bku=Select the CCE to use. Values are: LOCAL, MOBILE. Example: -b MOBILE argument.help.config=Defines which configuration file to use. Example: -c <config file> argument.help.emblem=Sets the signature logo file to use for the signature. Example: -e <emblem file> argument.help.help=Shows this help message @@ -33,15 +34,15 @@ argument.help.password=Sets the password to use for mobile CCE. Example: -p <pas argument.help.proxyhost=Sets the proxy host to use. Example: -proxy <hostname/IP> argument.help.proxyport=Sets the proxy port to use. Example: -proxyport <port> argument.info.help=The following options are available: -argument.invalid.bku=CCE argument invalid! Use: -argument.invalid.config=Configuration file argument invalid! Use: -argument.invalid.emblem=Signature logo argument invalid! Use: -argument.invalid.input=Document to sign argument invalid! Use: -argument.invalid.number=Phone number argument invalid! Use: -argument.invalid.output=Output folder argument invalid! Use: -argument.invalid.password=Mobile CCE password invalid! Use: -argument.invalid.proxyhost=Proxy host argument invalid! Use: -argument.invalid.proxyport=Proxy port argument invalid! Use: +argument.invalid.bku=CCE argument invalid! Usage: +argument.invalid.config=Configuration file argument invalid! Usage: +argument.invalid.emblem=Signature logo argument invalid! Usage: +argument.invalid.input=Document to sign argument invalid! Usage: +argument.invalid.number=Phone number argument invalid! Usage: +argument.invalid.output=Output folder argument invalid! Usage: +argument.invalid.password=Mobile CCE password invalid! Usage: +argument.invalid.proxyhost=Proxy host argument invalid! Usage: +argument.invalid.proxyport=Proxy port argument invalid! Usage: bku_selection.card=&Card bku_selection.mobile=&Mobile common.AllExtension_Description=All files diff --git a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties index 9e15c8f8..15f8b9c8 100644 --- a/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties +++ b/pdf-over-gui/src/main/resources/at/asit/pdfover/gui/messages_de.properties @@ -22,7 +22,8 @@ advanced_config.SigPHTransparencyMax=Undurchsichtig advanced_config.SigPHTransparencyMin=Unsichtbar advanced_config.SigPHTransparencyTooltip=Wählt die Transparenz des Signaturplatzhalters im Schritt "Positionierung" argument.error.output=ist kein Ordner -argument.help.bku=Wählen Sie die BKU. Gültige Werte: LOCAL, MOBILE. Bsp.: -b <bku> +argument.help.autopos=Aktiviert automatische Positionierung der Signatur +argument.help.bku=Wählen Sie die BKU. Gültige Werte: LOCAL, MOBILE. Bsp.: -b MOBILE argument.help.config=Auswahl der Konfigurationsdatei. Bsp.: -c <Dateiname> argument.help.emblem=Wählt die Bildmarke für die Signatur. Bsp.: -e <Dateiname> argument.help.help=Zeigt diese Hilfe an |