aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-12-16 10:27:30 +0000
committerpdanner <pdanner@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2010-12-16 10:27:30 +0000
commit89fa5dcd4985ced6de0f168314684f68017bce12 (patch)
treea203381504764e7cacb3e6d1b8ffd1113fd2b2d2 /src
parent11cea3c04723dbb1f9df0e2c50602913654657f6 (diff)
downloadpdf-as-3-89fa5dcd4985ced6de0f168314684f68017bce12.tar.gz
pdf-as-3-89fa5dcd4985ced6de0f168314684f68017bce12.tar.bz2
pdf-as-3-89fa5dcd4985ced6de0f168314684f68017bce12.zip
Changed default values of signParameters.isCheckForPlaceholder() and config property enable_placeholder_search
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@711 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/api/PdfAs.java4
-rw-r--r--src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java9
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java36
3 files changed, 32 insertions, 17 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java b/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java
index 286377b..a1095bb 100644
--- a/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java
+++ b/src/main/java/at/gv/egiz/pdfas/api/PdfAs.java
@@ -41,6 +41,10 @@ public interface PdfAs
// reconstructXMLDSIG(ReconstructXMLDsigAfterAnalysisParameters reconstructXMLDsigParameters)
// verify(VerifyAfterReconstructXMLDsigParameters verifyAfterReconstructXMLDsigParameters)
+// 16.12.2010 changed by exthex - added:
+// prepareSign(SignParameters signParameters)
+// sign(SignParameters signParameters, SignatureDetailInformation signatureDetailInformation)
+// finishSign(SignParameters signParameters, SignatureDetailInformation signatureDetailInformation)
/**
* Signs a PDF document using PDF-AS.
diff --git a/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java b/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
index 8dc928b..0bf1000 100644
--- a/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
+++ b/src/main/java/at/gv/egiz/pdfas/api/sign/SignParameters.java
@@ -125,9 +125,9 @@ public class SignParameters
protected TimeStamper timeStamperImpl;
/**
- *
+ * The flag to de-/activate placeholder search
*/
- protected boolean checkForPlaceholder = true;
+ protected Boolean checkForPlaceholder = null;
/**
* The id of the placeholder which should be replaced.
@@ -322,12 +322,11 @@ public class SignParameters
}
-
/**
*
* @return
*/
- public boolean isCheckForPlaceholder() {
+ public Boolean isCheckForPlaceholder() {
return this.checkForPlaceholder;
}
@@ -336,7 +335,7 @@ public class SignParameters
* @param check
*/
public void setCheckForPlaceholder(boolean check) {
- this.checkForPlaceholder = check;
+ this.checkForPlaceholder = Boolean.valueOf(check);
}
/**
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java b/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java
index 4ee4e70..3433565 100644
--- a/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java
+++ b/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java
@@ -678,25 +678,37 @@ public class PdfAsObject implements PdfAs
if (profile == null)
profile = defaultProfile;
String key = SignatureTypes.SIG_OBJ + profile + "." + ENABLE_PLACEHOLDER_SEARCH_KEY;
- String enableSearchString = settings.getValueFromKey(key);
+ String configFileActivedString = settings.getValueFromKey(key);
- if (enableSearchString == null){
+ if (configFileActivedString == null){
// check global enable_placeholder_search
- enableSearchString = settings.getValueFromKey(ENABLE_PLACEHOLDER_SEARCH_KEY);
+ configFileActivedString = settings.getValueFromKey(ENABLE_PLACEHOLDER_SEARCH_KEY);
}
- boolean enableSearch = true;
- if (enableSearchString != null && enableSearchString.trim().equalsIgnoreCase("false"))
- enableSearch = false;
+ Boolean configFileActived = null;
+ if (configFileActivedString != null)
+ configFileActived = Boolean.valueOf(configFileActivedString);
+
+ Boolean signParamsActivated = signParameters.isCheckForPlaceholder();
+
+ boolean enableSearch;
+ if (signParamsActivated != null)
+ {
+ enableSearch = signParamsActivated.booleanValue();
+ } else {
+ if (configFileActived != null)
+ enableSearch = configFileActived.booleanValue();
+ else
+ enableSearch = false;
+ }
+
if (enableSearch)
{
- if (signParameters.isCheckForPlaceholder()) {
- spd = SignaturePlaceholderExtractor.extract(
- signParameters.getDocument().createInputStream(),
- signParameters.getPlaceholderId(),
- signParameters.getPlaceholderMatchMode());
- }
+ spd = SignaturePlaceholderExtractor.extract(
+ signParameters.getDocument().createInputStream(),
+ signParameters.getPlaceholderId(),
+ signParameters.getPlaceholderMatchMode());
}
return spd;
}