diff options
Diffstat (limited to 'src/main/java/at/gv')
3 files changed, 22 insertions, 3 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java index c51d10a..d903c9b 100644 --- a/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java +++ b/src/main/java/at/gv/egiz/pdfas/exceptions/ErrorCode.java @@ -59,6 +59,7 @@ public final class ErrorCode public static final int PLACEHOLDER_EXCEPTION = 700;
public static final int CAPTION_NOT_FOUND_EXCEPTION = 701;
+ public static final int UNABLE_TO_PARSE_ID = 800;
public static final int CORRECTOR_EXCEPTION = 801;
public static final int EXTERNAL_CORRECTOR_TIMEOUT_REACHED = 802;
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java b/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java index c2ec8ff..3107368 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/verificator/binary/BinaryVerificator_1_0_0.java @@ -29,6 +29,7 @@ import at.gv.egiz.pdfas.framework.input.PdfDataSource; import at.gv.egiz.pdfas.framework.verificator.Verificator;
import at.gv.egiz.pdfas.impl.input.CompoundPdfDataSourceImpl;
import at.gv.egiz.pdfas.impl.input.DelimitedPdfDataSource;
+import at.gv.egiz.pdfas.impl.vfilter.helper.VerificationFilterBinaryHelper;
import at.knowcenter.wag.egov.egiz.PdfASID;
import at.knowcenter.wag.egov.egiz.cfg.ConfigLogger;
import at.knowcenter.wag.egov.egiz.cfg.SettingsReader;
@@ -150,7 +151,8 @@ public class BinaryVerificator_1_0_0 implements Verificator ArrayParseResult kz_apr = (ArrayParseResult) getRequiredValueOfKey(pdf, egiz_dict, EGIZ_KZ_NAME);
PdfASID kz = null;
- String kz_string = VerificationFilter.restoreKZ(pdf, kz_apr);
+// String kz_string = VerificationFilter.restoreKZ(pdf, kz_apr);
+ String kz_string = VerificationFilterBinaryHelper.restoreKZ(pdf, kz_apr);
kz = new PdfASID(kz_string);
if (!kz_string.equals(getMyId().toString()))
{
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/vfilter/helper/VerificationFilterBinaryHelper.java b/src/main/java/at/gv/egiz/pdfas/impl/vfilter/helper/VerificationFilterBinaryHelper.java index b7f36d1..3ee5da0 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/vfilter/helper/VerificationFilterBinaryHelper.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/vfilter/helper/VerificationFilterBinaryHelper.java @@ -7,8 +7,10 @@ import java.io.IOException; import java.util.ArrayList;
import java.util.List;
-import at.gv.egiz.pdfas.exceptions.ErrorCode;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import at.gv.egiz.pdfas.exceptions.ErrorCode;
import at.knowcenter.wag.egov.egiz.PdfASID;
import at.knowcenter.wag.egov.egiz.exceptions.InvalidIDException;
import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException;
@@ -42,6 +44,11 @@ public final class VerificationFilterBinaryHelper public static final byte[] EGIZ_KZ_NAME = { 'I', 'D' };
/**
+ * The log.
+ */
+ private static final Log log = LogFactory.getLog(VerificationFilterBinaryHelper.class);
+
+ /**
* Tells, if the given incremental update block contains a binary signature.
*
* <p>
@@ -128,7 +135,13 @@ public final class VerificationFilterBinaryHelper {
List partition = new ArrayList();
- for (int i = 0; i < kz_apr.elements.size() / 2; i++)
+ int linesToProcess = (kz_apr.elements.size() / 2);
+ log.trace("Lines to process for KZ: " + linesToProcess);
+ if (linesToProcess > 1) {
+ log.debug("HOTFIX: forcing single line to process");
+ linesToProcess = 1;
+ }
+ for (int i = 0; i < linesToProcess; i++)
{
NumberParseResult start_npr = (NumberParseResult) kz_apr.elements.get(i * 2);
NumberParseResult length_npr = (NumberParseResult) kz_apr.elements.get(i * 2 + 1);
@@ -136,7 +149,10 @@ public final class VerificationFilterBinaryHelper StringInfo si = new StringInfo();
si.string_start = start_npr.number;
si.string_length = length_npr.number;
+ si.pdf = pdf;
+ log.trace("Adding KZ: " + si.toString());
+
partition.add(si);
}
|