From 203620ec8d0121f0786518a1a9bec8ba4a5e8fe1 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 30 Jul 2013 15:31:43 +0200 Subject: Legacy positioning mode for pdf --- .../java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java | 18 +++++++++++++++++- .../connectors/moa/MOASoapWithAttachmentConnector.java | 5 +++-- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'pdf-as-lib/src/main/java') diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java index 1a89b7b..a851e18 100644 --- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java +++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java @@ -48,6 +48,8 @@ import org.pdfbox.util.TextPosition; import org.pdfbox.util.operator.OperatorProcessor; import at.knowcenter.wag.egov.egiz.cfg.ConfigLogger; +import at.knowcenter.wag.egov.egiz.cfg.SettingsReader; +import at.knowcenter.wag.egov.egiz.exceptions.SettingsException; import at.knowcenter.wag.egov.egiz.pdf.operator.path.construction.ClosePath; import at.knowcenter.wag.egov.egiz.pdf.operator.path.construction.CurveTo; import at.knowcenter.wag.egov.egiz.pdf.operator.path.construction.CurveToReplicateFinalPoint; @@ -124,7 +126,21 @@ public class PDFPage extends PDFTextStripper newInvoke.setContext(this); operators.put("Do", newInvoke); - registerCustomPathOperators(); + boolean legacy = false; + + try { + String leg = SettingsReader.getInstance().getSetting("legacy_positioning", "false"); + if("true".equals(leg)) { + legacy = true; + } + } catch (SettingsException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(!legacy) { + registerCustomPathOperators(); + } } /** diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java index 401921b..f6f05fc 100644 --- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java +++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java @@ -71,6 +71,8 @@ public class MOASoapWithAttachmentConnector implements Connector */ private static Log log = LogFactory.getLog(MOASoapWithAttachmentConnector.class); + private static Log moaLog = LogFactory.getLog("at.knowcenter.wag.egov.egiz.sig.connectors.MOASSRepsonseLogger"); + protected static final String MULTIPART_LOC_REF_CONTENT = "formdata:fileupload"; //$NON-NLS-1$ protected static final String RETURN_HASH_INPUT_DATA = ""; //$NON-NLS-1$ @@ -139,7 +141,7 @@ public class MOASoapWithAttachmentConnector implements Connector log.debug("analyzeSignResponse:"); //$NON-NLS-1$ String response_string = response_properties.getProperty(BKUPostConnection.RESPONSE_STRING_KEY); - + moaLog.debug("MOA-SS Response: " + response_string); BKUHelper.checkResponseForError(response_string); SignSignatureObject so = MOAHelper.parseCreateXMLResponse(response_string, new DetachedLocRefMOAIdFormatter(), this.environment); @@ -154,7 +156,6 @@ public class MOASoapWithAttachmentConnector implements Connector public SignSignatureObject doSign(SignatureData data) throws ConnectorException { log.debug("doSign:"); //$NON-NLS-1$ - String sign_request_xml = prepareSignRequest(data); // DebugHelper.debugStringToFile(sign_request_xml, "MOA_DetLocRef_sign_request.xml"); //$NON-NLS-1$ -- cgit v1.2.3