summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2021-09-13 14:57:00 +0200
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2021-09-13 14:57:00 +0200
commitdd6f9d619008b4e3bcd5b163a25d3cf91836bf03 (patch)
tree91930db3e5fe5eb445ee95f4499ebed0da2cd1f1
parentf2fc62bd1d2dd0dc9660375890c28af5cbb5b00a (diff)
downloadpdf-over-dd6f9d619008b4e3bcd5b163a25d3cf91836bf03.tar.gz
pdf-over-dd6f9d619008b4e3bcd5b163a25d3cf91836bf03.tar.bz2
pdf-over-dd6f9d619008b4e3bcd5b163a25d3cf91836bf03.zip
fixed issue 43
-rw-r--r--pdf-over-commons/pdf-over-commons.iml1
-rw-r--r--pdf-over-commons/pom.xml12
-rw-r--r--pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java6
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java26
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java10
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java2
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java19
-rw-r--r--pom.xml4
8 files changed, 35 insertions, 45 deletions
diff --git a/pdf-over-commons/pdf-over-commons.iml b/pdf-over-commons/pdf-over-commons.iml
index e1429905..6f3d8e8e 100644
--- a/pdf-over-commons/pdf-over-commons.iml
+++ b/pdf-over-commons/pdf-over-commons.iml
@@ -11,5 +11,6 @@
<orderEntry type="jdk" jdkName="11" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.6" level="project" />
+ <orderEntry type="library" name="Maven: org.eclipse.swt:org.eclipse.swt.win32.win32.x86_64:4.20" level="project" />
</component>
</module> \ No newline at end of file
diff --git a/pdf-over-commons/pom.xml b/pdf-over-commons/pom.xml
index 4757e939..1f9d34f2 100644
--- a/pdf-over-commons/pom.xml
+++ b/pdf-over-commons/pom.xml
@@ -16,6 +16,18 @@
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.swt</groupId>
+ <artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>
+ <version>4.20</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.swt</groupId>
+ <artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>
+ <version>4.20</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java
index c769a7af..9da35155 100644
--- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java
+++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/Constants.java
@@ -15,6 +15,7 @@
*/
package at.asit.pdfover.commons;
+import java.awt.*;
import java.io.File;
import java.io.FileInputStream;
import java.util.Locale;
@@ -24,8 +25,6 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
-import at.asit.pdfover.gui.bku.mobile.MobileBKUs;
-
/**
* Various constants
*/
@@ -97,9 +96,6 @@ public class Constants {
//public static final String DEFAULT_MOBILE_BKU_URL = "https://hs-abnahme.a-trust.at/mobile/https-security-layer-request/default.aspx"; //$NON-NLS-1$
public static final String DEFAULT_MOBILE_BKU_URL = "https://www.a-trust.at/mobile/https-security-layer-request/default.aspx"; //$NON-NLS-1$
- /** Default Mobile BKU type */
- public static final MobileBKUs DEFAULT_MOBILE_BKU_TYPE = MobileBKUs.A_TRUST;
-
/** Default signature placeholder transparency */
public static final int DEFAULT_SIGNATURE_PLACEHOLDER_TRANSPARENCY = 170;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
index 2ec6d80c..abed9e93 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
@@ -753,9 +753,9 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
void alignSignatureNoteTextToProfile(Profile profile){
if (detectChanges(profile) == false){
- this.txtSignatureNote.setText(getSignatureBlockNoteTextAccordingToProfile(profile));
+ this.txtSignatureNote.setText(getSignatureBlockNoteTextAccordingToProfile(profile, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale()));
this.configurationContainer.setSignatureNote(
- Messages.getString(getSignatureBlockNoteTextAccordingToProfile(profile))
+ Messages.getString(getSignatureBlockNoteTextAccordingToProfile(profile, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale()))
);
}
@@ -765,29 +765,19 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
String note = this.txtSignatureNote.getText();
note = note.replace("!","");
- if (note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.AMTSSIGNATURBLOCK)) ||
- note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.SIGNATURBLOCK_SMALL)) ||
- note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.INVISIBLE)) ||
- note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.BASE_LOGO))){
+ if (note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.AMTSSIGNATURBLOCK, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) ||
+ note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.SIGNATURBLOCK_SMALL, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) ||
+ note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.INVISIBLE, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale())) ||
+ note.equals(getSignatureBlockNoteTextAccordingToProfile(Profile.BASE_LOGO, SimpleConfigurationComposite.this.configurationContainer.getSignatureLocale()))){
return false;
}
return true;
}
- //TODO FIX ME
- String getSignatureBlockNoteTextAccordingToProfile(Profile profile, Locale locale){
- if (profile.equals(Profile.SIGNATURBLOCK_SMALL)){
- return Messages.getString("simple_config.Note_Default_Standard", locale);
- } else if (profile.equals(Profile.AMTSSIGNATURBLOCK)){
- return Messages.getString("simple_config.Note_Default_OfficialSignature", locale);
- } else {
- return "";
- }
- }
- String getSignatureBlockNoteTextAccordingToProfile(Profile profile){
- return getSignatureBlockNoteTextAccordingToProfile(profile, this.configurationContainer.getSignatureLocale());
+ String getSignatureBlockNoteTextAccordingToProfile(Profile profile, Locale signatureLocale){
+ return Profile.getSignatureBlockNoteTextAccordingToProfile(profile, this.configurationContainer.getSignatureLocale());
}
void setSignatureProfileSetting(){
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java
index 86d86e4b..4108a895 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigProviderImpl.java
@@ -45,6 +45,12 @@ import at.asit.pdfover.signator.SignaturePosition;
*/
public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator,
ConfigOverlayManipulator, PersistentConfigProvider {
+
+
+ /** Default Mobile BKU type */
+ public static final MobileBKUs DEFAULT_MOBILE_BKU_TYPE = MobileBKUs.A_TRUST;
+
+
/**
* SLF4J Logger instance
**/
@@ -178,7 +184,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator,
bkuType.trim().toUpperCase()));
} catch (IllegalArgumentException e) {
log.error("Invalid BKU type: " + bkuType); //$NON-NLS-1$
- this.configuration.setMobileBKUType(Constants.DEFAULT_MOBILE_BKU_TYPE);
+ this.configuration.setMobileBKUType(DEFAULT_MOBILE_BKU_TYPE);
}
}
@@ -408,7 +414,7 @@ public class ConfigProviderImpl implements ConfigProvider, ConfigManipulator,
props.setProperty(Constants.CFG_MOBILE_BKU_URL, mobileBKUURL);
MobileBKUs mobileBKUType = getMobileBKUType();
- if (mobileBKUType != Constants.DEFAULT_MOBILE_BKU_TYPE)
+ if (mobileBKUType != DEFAULT_MOBILE_BKU_TYPE)
props.setProperty(Constants.CFG_MOBILE_BKU_TYPE, mobileBKUType.toString());
if (getMobileBKUBase64())
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java
index 46b5c460..83d05f72 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/config/ConfigurationContainerImpl.java
@@ -99,7 +99,7 @@ public class ConfigurationContainerImpl implements ConfigurationContainer {
protected String mobileBKUURL = Constants.DEFAULT_MOBILE_BKU_URL;
/** Holds the mobile BKU type */
- protected MobileBKUs mobileBKUType = Constants.DEFAULT_MOBILE_BKU_TYPE;
+ protected MobileBKUs mobileBKUType = ConfigProviderImpl.DEFAULT_MOBILE_BKU_TYPE;
/** Holds the mobile BKU BASE64 setting */
protected boolean mobileBKUBase64 = false;
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 2ce4a5a0..b0c5de85 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
@@ -153,27 +153,12 @@ public class PrepareConfigurationState extends State {
String note_old = Messages.getString("simple_config.Note_Default_Old", loc); //$NON-NLS-1$
if (note.equals(note_old)) {
- String profileNote = getDefaultNote(config);
-
- note = Messages.getString("simple_config.Note_Default", loc); //$NON-NLS-1$
+ String profile = config.getSignatureProfile();
+ note = Profile.getSignatureBlockNoteTextAccordingToProfile(Profile.getProfile(profile), config.getLocale());
getStateMachine().getConfigManipulator().setSignatureNote(note);
}
}
- private String getDefaultNote(ConfigProvider config){
-
- Profile profile = Profile.getProfile(config.getSignatureProfile());
- Locale locale = config.getLocale();
-
- if (profile.equals(Profile.SIGNATURBLOCK_SMALL)){
- return Messages.getString("simple_config.Note_Default_Standard", locale);
- } else if (profile.equals(Profile.AMTSSIGNATURBLOCK)){
- return Messages.getString("simple_config.Note_Default_OfficialSignature", locale);
- } else {
- return "";
- }
- }
-
private void initializeFromArguments(String[] args, ArgumentHandler handler)
throws InitializationException {
handler.handleArguments(args);
diff --git a/pom.xml b/pom.xml
index 2be07484..3a85e3ef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,10 +82,10 @@
<modules>
<module>pdf-over-install-helper</module>
+ <module>pdf-over-commons</module>
<module>pdf-over-gui</module>
<module>pdf-over-signator</module>
<module>pdf-over-signer</module>
- <module>pdf-over-commons</module>
</modules>
<properties>
@@ -118,7 +118,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.8.1</version>
+ <version>3.0.1</version>
<configuration>
</configuration>
</plugin>