aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main
diff options
context:
space:
mode:
authoremusic <emina.music@egiz.gv.at>2019-11-14 14:33:16 +0100
committeremusic <emina.music@egiz.gv.at>2019-11-14 14:33:16 +0100
commitac49b41cbc52e3e8df771825ff22f72a8fb81138 (patch)
treef4d17febf29bc2605c45fa53329de09652b50132 /pdf-as-lib/src/main
parentcd19c5592a1d294debbf10ffea4b82993e5197ff (diff)
downloadpdf-as-4-ac49b41cbc52e3e8df771825ff22f72a8fb81138.tar.gz
pdf-as-4-ac49b41cbc52e3e8df771825ff22f72a8fb81138.tar.bz2
pdf-as-4-ac49b41cbc52e3e8df771825ff22f72a8fb81138.zip
Enable placeholder search on a profile level
Diffstat (limited to 'pdf-as-lib/src/main')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/configuration/PlaceholderConfiguration.java11
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/placeholder/PlaceholderFilter.java12
2 files changed, 19 insertions, 4 deletions
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 7a67160a..326ed142 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
@@ -69,5 +69,16 @@ public class PlaceholderConfiguration extends SpecificBaseConfiguration
}
return false;
}
+
+ public String getProfilePlaceholderID(String selectedProfileID)
+ {
+ logger.info("SelectedProfileID in ProfileConfEnabled: "+selectedProfileID);
+ String profileMatch = SIG_OBJECT+SEPERATOR+selectedProfileID+SEPERATOR+PLACEHOLDER_ID;
+ if (configuration.getValuesPrefix(profileMatch)!=null) {
+ Map<String, String> map = configuration.getValuesPrefix(profileMatch);
+ return map.get(profileMatch);
+ }
+ return null;
+ }
}
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 f511525d..51cd3ff2 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
@@ -74,13 +74,17 @@ public class PlaceholderFilter implements IConfigurationConstants,
//filter for local placeholder in selected profiles
PlaceholderExtractor extractor = status.getBackend()
.getPlaceholderExtractor();
- String placeholderID = settings.getValue(PLACEHOLDER_ID);
- String placeholderModeString = settings.getValue(PLACEHOLDER_MODE);
- int placeholderMode = PLACEHOLDER_MATCH_MODE_SORTED;
+ int placeholderMode = PLACEHOLDER_MATCH_MODE_SORTED;
+
+ String placeholderID =status.getPlaceholderConfiguration().getProfilePlaceholderID(status.getRequestedSignature().getSignatureProfileID());
+ if(placeholderID != null)
+ {
+ placeholderMode = PLACEHOLDER_MATCH_MODE_MODERATE;
+ }
+ String placeholderModeString = settings.getValue(PLACEHOLDER_MODE);
if (placeholderModeString != null) {
try {
placeholderMode = Integer.parseInt(placeholderModeString);
-
if (placeholderMode < PLACEHOLDER_MODE_MIN
|| placeholderMode > PLACEHOLDER_MODE_MAX) {
throw new PdfAsErrorCarrier(new PDFASError(