From aa880a2ae7b078bc776a3f04f47eda2782f80787 Mon Sep 17 00:00:00 2001 From: ferbas Date: Thu, 14 Jan 2010 14:39:47 +0000 Subject: fixing ognl + linebreak git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@550 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../impl/signator/binary/BinarySignator_1_0_0.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/gv/egiz') diff --git a/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java b/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java index 4b9a566..36d3764 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/signator/binary/BinarySignator_1_0_0.java @@ -43,8 +43,10 @@ import at.gv.egiz.pdfas.utils.OgnlUtil; import at.knowcenter.wag.egov.egiz.PdfAS; import at.knowcenter.wag.egov.egiz.PdfASID; import at.knowcenter.wag.egov.egiz.cfg.SettingsReader; +import at.knowcenter.wag.egov.egiz.exceptions.NormalizeException; import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException; import at.knowcenter.wag.egov.egiz.exceptions.PresentableException; +import at.knowcenter.wag.egov.egiz.exceptions.SignatureException; import at.knowcenter.wag.egov.egiz.framework.SignatorFactory; import at.knowcenter.wag.egov.egiz.pdf.BinarySignature; import at.knowcenter.wag.egov.egiz.pdf.IncrementalUpdateInformation; @@ -58,6 +60,7 @@ import at.knowcenter.wag.egov.egiz.sig.SignatureFieldDefinition; import at.knowcenter.wag.egov.egiz.sig.SignatureObject; import at.knowcenter.wag.egov.egiz.sig.SignatureTypes; import at.knowcenter.wag.egov.egiz.sig.signatureobject.SignatureObjectHelper; +import at.knowcenter.wag.egov.egiz.tools.Normalizer; import at.knowcenter.wag.exactparser.ByteArrayUtils; import com.lowagie.text.pdf.PdfPTable; @@ -94,6 +97,8 @@ public class BinarySignator_1_0_0 implements Signator */ public static final PdfASID MY_ID = new PdfASID(SignatorFactory.VENDOR, SignatorFactory.TYPE_BINARY, SignatorFactory.VERSION_1_0_0); + private Normalizer normalizer; + /** * @see at.knowcenter.wag.egov.egiz.framework.Signator#getMyId() */ @@ -107,7 +112,15 @@ public class BinarySignator_1_0_0 implements Signator */ public BinarySignator_1_0_0() { - // Default constructor. + try + { + this.normalizer = new Normalizer(); + } + catch (NormalizeException e) + { + String msg = "Normalizer can not be initialized"; + throw new RuntimeException(msg, new SignatureException(400, msg, e)); + } } /** @@ -320,8 +333,9 @@ public class BinarySignator_1_0_0 implements Signator // dferbas if (ognl.containsExpression(ri.sfd.value)) { // evaluate expression - String res = ognl.compileMessage(ri.sfd.value); - ri.value = res; + String res = ognl.compileMessage(ri.sfd.value); + + ri.value = this.normalizer.normalize(res); } else { ri.value = iui.signed_signature_object.retrieveStringValue(ri.sfd.field_name); -- cgit v1.2.3