diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-07-14 12:55:20 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-07-14 12:55:20 +0200 |
commit | bccb1f7c2595611eeaa66b4a85dc0529bcb2522f (patch) | |
tree | 3726380e945f3db2ca36e8b06c1724f99ac5e3b4 /pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper | |
parent | 1219abaf9f0029e39f5fbdf342fd4ebf07144b5b (diff) | |
download | pdf-as-4-bccb1f7c2595611eeaa66b4a85dc0529bcb2522f.tar.gz pdf-as-4-bccb1f7c2595611eeaa66b4a85dc0529bcb2522f.tar.bz2 pdf-as-4-bccb1f7c2595611eeaa66b4a85dc0529bcb2522f.zip |
added Invoke Target
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 24 | ||||
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java | 12 |
2 files changed, 31 insertions, 5 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index b79075a1..8ec5d6fe 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -29,7 +29,6 @@ import java.awt.Image; import java.awt.image.RenderedImage; import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; @@ -54,10 +53,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import at.gv.egiz.pdfas.api.ws.PDFASSignParameters; -import at.gv.egiz.pdfas.api.ws.PDFASVerificationResponse; -import at.gv.egiz.pdfas.api.ws.VerificationLevel; import at.gv.egiz.pdfas.api.ws.PDFASSignParameters.Connector; import at.gv.egiz.pdfas.api.ws.PDFASSignResponse; +import at.gv.egiz.pdfas.api.ws.PDFASVerificationResponse; import at.gv.egiz.pdfas.common.exceptions.PdfAsException; import at.gv.egiz.pdfas.lib.api.ByteArrayDataSink; import at.gv.egiz.pdfas.lib.api.ByteArrayDataSource; @@ -109,11 +107,12 @@ public class PdfAsHelper { private static final String PDF_VER_LEVEL = "PDF_VER_LEVEL"; private static final String PDF_VER_RESP = "PDF_VER_RESP"; private static final String PDF_INVOKE_URL = "PDF_INVOKE_URL"; + private static final String PDF_INVOKE_TARGET = "PDF_INVOKE_TARGET"; private static final String REQUEST_FROM_DU = "REQ_DATA_URL"; private static final String SIGNATURE_DATA_HASH = "SIGNATURE_DATA_HASH"; private static final String SIGNATURE_ACTIVE = "SIGNATURE_ACTIVE"; private static final String VERIFICATION_RESULT = "VERIFICATION_RESULT"; - + private static final Logger logger = LoggerFactory .getLogger(PdfAsHelper.class); @@ -852,6 +851,23 @@ public class PdfAsHelper { Object obj = session.getAttribute(PDF_INVOKE_URL); return obj == null ? null : obj.toString(); } + + public static void setInvokeTarget(HttpServletRequest request, + HttpServletResponse response, String url) { + + + + HttpSession session = request.getSession(); + session.setAttribute(PDF_INVOKE_TARGET, url); + logger.debug("External Invoke TARGET: " + url); + } + + public static String getInvokeTarget(HttpServletRequest request, + HttpServletResponse response) { + HttpSession session = request.getSession(); + Object obj = session.getAttribute(PDF_INVOKE_TARGET); + return obj == null ? null : obj.toString(); + } private static String generateURL(HttpServletRequest request, HttpServletResponse response, String Servlet) { diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java index 126b10ce..c2cee9c6 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java @@ -33,11 +33,13 @@ public class PdfAsParameterExtractor { public static final String PARAM_INVOKE_URL = "invoke-app-url"; + public static final String PARAM_INVOKE_URL_TARGET = "invoke-app-url-target"; public static final String PARAM_INVOKE_URL_ERROR = "invoke-app-error-url"; public static final String PARAM_LOCALE = "locale"; public static final String PARAM_NUM_BYTES = "num-bytes"; public static final String PARAM_PDF_URL = "pdf-url"; public static final String PARAM_SIG_TYPE = "sig-type"; + public static final String PARAM_SIG_TYPE_ALIAS = "sig_type"; public static final String PARAM_SIG_POS_P = "sig-pos-p"; public static final String PARAM_SIG_POS_Y = "sig-pos-y"; public static final String PARAM_SIG_POS_X = "sig-pos-x"; @@ -63,6 +65,10 @@ public class PdfAsParameterExtractor { return (String)request.getAttribute(PARAM_INVOKE_URL); } + public static String getInvokeTarget(HttpServletRequest request) { + return (String)request.getAttribute(PARAM_INVOKE_URL_TARGET); + } + public static String getInvokeErrorURL(HttpServletRequest request) { String url = (String)request.getAttribute(PARAM_INVOKE_URL_ERROR); return url; @@ -81,7 +87,11 @@ public class PdfAsParameterExtractor { } public static String getSigType(HttpServletRequest request) { - return (String)request.getAttribute(PARAM_SIG_TYPE); + String value = (String)request.getAttribute(PARAM_SIG_TYPE); + if(value == null) { + value = (String)request.getAttribute(PARAM_SIG_TYPE_ALIAS); + } + return value; } public static String getSigPosP(HttpServletRequest request) { |