aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknowcenter <knowcenter@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-06-29 13:34:25 +0000
committerknowcenter <knowcenter@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-06-29 13:34:25 +0000
commit57e6d642bd6d1ab7bece6e9710c82d03e211084d (patch)
tree92c7e1af53b94d0773a5e27900610e893d5de179
parentb99002587331ff5974838c241a68fed1b7cf2ff3 (diff)
downloadpdf-as-3-57e6d642bd6d1ab7bece6e9710c82d03e211084d.tar.gz
pdf-as-3-57e6d642bd6d1ab7bece6e9710c82d03e211084d.tar.bz2
pdf-as-3-57e6d642bd6d1ab7bece6e9710c82d03e211084d.zip
minor changes regarding performance speed during verification
-a new key added in config to control verification of old textual signatures git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@126 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
-rw-r--r--pom.xml11
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java22
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/pdf/TextualSignature.java3
-rw-r--r--work/cfg/config.properties2
4 files changed, 35 insertions, 3 deletions
diff --git a/pom.xml b/pom.xml
index 9f09d94..869093c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,6 +47,17 @@
</roles>
<timezone>+1</timezone>
</developer>
+
+ <developer>
+ <id>amavriqi</id>
+ <name>Arian Mavriqi</name>
+ <email>amavriqi@iicm.edu</email>
+ <organization>KnowCenter</organization>
+ <roles>
+ <role>developer</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
</developers>
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java b/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java
index 9e7d1b6..da5a8dc 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/framework/VerificationFilter.java
@@ -65,6 +65,7 @@ import at.knowcenter.wag.exactparser.parsing.results.ObjectParseResult;
* </p>
*
* @author wprinz
+ * @author amavriqi
*/
public class VerificationFilter
{
@@ -177,8 +178,18 @@ public class VerificationFilter
}
else
{
+ // FIXME make better
+ //amavriqi: skip checking for old sigs becouse of performance issues
+ String old_text_sigs = SettingsReader.getInstance().getSetting("check_old_textual_sigs", "false");
+
+ //amavriqi: if old textual signatures not checked for then
+ // no need to check Incremental Block 0
+ if(old_text_sigs.equalsIgnoreCase("false") && (prev_end == 0))
+ {
+ continue;
+ }
logger_.debug("Extracting text for: " + prev_end + " to " + bpr.next_index);
-
+
Verificator verificator = new TextualVerificator_1_0_0();
List text_holders = verificator.parseBlock(pdf, bpr, prev_end);
logger_.debug("text_holders = " + text_holders.size());
@@ -190,6 +201,9 @@ public class VerificationFilter
current_block_contains_signature = true;
}
+ // FIXME make better
+ //amavriqi: only if old textual signatures are checked for
+ if(old_text_sigs.equalsIgnoreCase("true")){
if (prev_end == 0)
{
String rest_text = null;
@@ -200,6 +214,10 @@ public class VerificationFilter
}
else
{
+ //a.m.
+ logger_.debug("Incemental block" + prev_end + " and there are " + text_holders.size() + " text holders");
+ logger_.debug("Checking for older textual Signatures");
+ logger_.debug("Extracting text to " + bpr.next_index);
rest_text = PdfAS.extractNormalizedTextTextual(pdf, bpr.next_index);
}
@@ -212,7 +230,7 @@ public class VerificationFilter
holders.add(0, old_holders.get(0));
}
}
-
+ }
if (!text_holders.isEmpty())
{
List actual_text_holders = throwOutBinHolders(text_holders);
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TextualSignature.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TextualSignature.java
index 1a3b56b..a52d6dd 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TextualSignature.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TextualSignature.java
@@ -156,8 +156,9 @@ public class TextualSignature
// stripper.setStartPage(4);
// stripper.setEndPage(4);
+ logger_.debug("TextualSignator extractTextTextual: Begin stripping text");
String text = stripper.getText(doc);
-
+ logger_.debug("TextualSignator extractTextTextual: Stripping text ended");
doc.close();
//logger_.debug("TextualSignator extractTextTextual="+text);
return text;
diff --git a/work/cfg/config.properties b/work/cfg/config.properties
index 722dbc7..9df5dee 100644
--- a/work/cfg/config.properties
+++ b/work/cfg/config.properties
@@ -20,6 +20,8 @@ strict_mode=false
# added by tzefferer
allow_post_sign_modifications=false
+#
+check_old_textual_sigs=true
#############################################
# Signaturdienste