aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-07-30 15:31:43 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2013-07-30 15:31:43 +0200
commit203620ec8d0121f0786518a1a9bec8ba4a5e8fe1 (patch)
tree9468b362a2cc536e010608677106fb829a078c81 /pdf-as-lib/src/main/java
parentf7c83a6da74871e37f52e7037842228bae8faba4 (diff)
downloadpdf-as-3-203620ec8d0121f0786518a1a9bec8ba4a5e8fe1.tar.gz
pdf-as-3-203620ec8d0121f0786518a1a9bec8ba4a5e8fe1.tar.bz2
pdf-as-3-203620ec8d0121f0786518a1a9bec8ba4a5e8fe1.zip
Legacy positioning mode for pdf
Diffstat (limited to 'pdf-as-lib/src/main/java')
-rw-r--r--pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/pdf/PDFPage.java18
-rw-r--r--pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java5
2 files changed, 20 insertions, 3 deletions
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 = "<ReturnHashInputData/>"; //$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$