aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib
diff options
context:
space:
mode:
authoremusic <emina.music@egiz.gv.at>2018-03-21 17:56:48 +0100
committeremusic <emina.music@egiz.gv.at>2018-03-21 17:56:48 +0100
commit08911a1b4f7bc825841f99053cf98af795e506f2 (patch)
tree423df348b6b257ae433c08009e0762b82b0c9a0f /pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib
parentad3722eeda59cb2bcffa205f6ad8fbb37cf55504 (diff)
downloadpdf-as-4-08911a1b4f7bc825841f99053cf98af795e506f2.tar.gz
pdf-as-4-08911a1b4f7bc825841f99053cf98af795e506f2.tar.bz2
pdf-as-4-08911a1b4f7bc825841f99053cf98af795e506f2.zip
enabled placeholder serach for pdf-as web
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java3
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java45
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderConfiguration.java3
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderWebConfiguration.java18
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java10
5 files changed, 45 insertions, 34 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java
index 3c560142..e9e7e0f4 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java
@@ -44,7 +44,8 @@ public interface IConfigurationConstants {
public static final String LEGACY_POSITIONING = ".legacy.pos";
public static final String LEGACY_40_POSITIONING = ".legacy40.pos";
public static final String MIN_WIDTH = "minWidth";
-
+
+ public static final String PLACEHOLDER_WEB_ID = "placeholder_web_id";
public static final String PLACEHOLDER_ID = "placeholder_id";
public static final String PLACEHOLDER_MODE = "placeholder_mode";
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
index c3c2b6fd..f917de64 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java
@@ -23,17 +23,26 @@
******************************************************************************/
package at.gv.egiz.pdfas.lib.api;
+import at.gv.egiz.pdfas.common.exceptions.PdfAsSettingsValidationException;
+import at.gv.egiz.pdfas.common.settings.ISettings;
+import at.gv.egiz.pdfas.lib.api.sign.SignParameter;
+import at.gv.egiz.pdfas.lib.api.verify.VerifyParameter;
+import at.gv.egiz.pdfas.lib.configuration.ConfigurationValidator;
+import at.gv.egiz.pdfas.lib.impl.PdfAsImpl;
+import at.gv.egiz.pdfas.lib.impl.SignParameterImpl;
+import at.gv.egiz.pdfas.lib.impl.VerifyParameterImpl;
+import at.gv.egiz.pdfas.lib.impl.configuration.ConfigValidatorLoader;
import iaik.security.ec.provider.ECCelerate;
import iaik.security.provider.IAIK;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import java.awt.Graphics2D;
+import javax.activation.DataSource;
+import javax.crypto.Cipher;
+import java.awt.*;
import java.awt.image.BufferedImage;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.lang.management.RuntimeMXBean;
@@ -44,28 +53,6 @@ import java.util.Map.Entry;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
-import javax.activation.DataSource;
-import javax.crypto.Cipher;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import at.gv.egiz.pdfas.common.exceptions.PdfAsSettingsException;
-import at.gv.egiz.pdfas.common.exceptions.PdfAsSettingsValidationException;
-import at.gv.egiz.pdfas.common.settings.ISettings;
-import at.gv.egiz.pdfas.lib.api.sign.SignParameter;
-import at.gv.egiz.pdfas.lib.api.verify.VerifyParameter;
-import at.gv.egiz.pdfas.lib.configuration.ConfigurationValidator;
-import at.gv.egiz.pdfas.lib.impl.PdfAsImpl;
-import at.gv.egiz.pdfas.lib.impl.SignParameterImpl;
-import at.gv.egiz.pdfas.lib.impl.VerifyParameterImpl;
-import at.gv.egiz.pdfas.lib.impl.configuration.ConfigValidatorLoader;
-
-
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-
public class PdfAsFactory implements IConfigurationConstants {
private static final Logger logger = LoggerFactory
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderConfiguration.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderConfiguration.java
index b20215fc..69d83239 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderConfiguration.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderConfiguration.java
@@ -47,8 +47,7 @@ public class PlaceholderConfiguration extends SpecificBaseConfiguration
}
return false;
}
-
-
+
/**
* Match selected Profile for Placeholder
* Enables to activate placeholder search/match for different profiles
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderWebConfiguration.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderWebConfiguration.java
new file mode 100644
index 00000000..8c63ed02
--- /dev/null
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderWebConfiguration.java
@@ -0,0 +1,18 @@
+package at.gv.egiz.pdfas.lib.impl.configuration;
+
+import java.util.Properties;
+
+public class PlaceholderWebConfiguration {
+
+ protected static Properties properties = new Properties();
+
+ public static void setValue(String key, String value)
+ {
+ properties.setProperty(key,value);
+ }
+ public static String getValue(String key)
+ {
+ return properties.getProperty(key);
+ }
+
+}
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java
index 4b1a5a49..455077a8 100644
--- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java
+++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java
@@ -30,6 +30,7 @@ import at.gv.egiz.pdfas.common.exceptions.PdfAsErrorCarrier;
import at.gv.egiz.pdfas.common.exceptions.PdfAsException;
import at.gv.egiz.pdfas.common.settings.ISettings;
import at.gv.egiz.pdfas.lib.api.IConfigurationConstants;
+import at.gv.egiz.pdfas.lib.impl.configuration.PlaceholderWebConfiguration;
import at.gv.egiz.pdfas.lib.impl.status.OperationStatus;
public class PlaceholderFilter implements IConfigurationConstants,
@@ -42,9 +43,14 @@ public class PlaceholderFilter implements IConfigurationConstants,
if (status.getPlaceholderConfiguration().isGlobalPlaceholderEnabled()) {
PlaceholderExtractor extractor = status.getBackend()
.getPlaceholderExtractor();
- String placeholderID = settings.getValue(PLACEHOLDER_ID);
- String placeholderModeString = settings.getValue(PLACEHOLDER_MODE);
+ String placeholderID = PlaceholderWebConfiguration.getValue(PLACEHOLDER_WEB_ID);
+ if(placeholderID == null)
+ {
+ placeholderID = settings.getValue(PLACEHOLDER_ID);
+ }
+
+ String placeholderModeString = settings.getValue(PLACEHOLDER_MODE);
int placeholderMode = PLACEHOLDER_MATCH_MODE_MODERATE;
if (placeholderModeString != null) {
try {