diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2015-04-27 16:41:06 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2015-04-27 16:41:06 +0200 |
commit | 55194159de4eb2c6ce4c37d4367a788aa390ce5d (patch) | |
tree | df6963de14df006e94d263fb1d2e39013165dfb3 /simpleSigning/src/main/java/at/gv | |
parent | dbd565ec8195117306ae869f4e7b507ff275ed32 (diff) | |
download | einfach-signieren-55194159de4eb2c6ce4c37d4367a788aa390ce5d.tar.gz einfach-signieren-55194159de4eb2c6ce4c37d4367a788aa390ce5d.tar.bz2 einfach-signieren-55194159de4eb2c6ce4c37d4367a788aa390ce5d.zip |
added locale parameter, and pdfas_innerdiv css class
Diffstat (limited to 'simpleSigning/src/main/java/at/gv')
-rw-r--r-- | simpleSigning/src/main/java/at/gv/egiz/simpleSigning/StartSignature.java | 16 | ||||
-rw-r--r-- | simpleSigning/src/main/java/at/gv/egiz/simpleSigning/helper/SessionHelper.java | 15 |
2 files changed, 29 insertions, 2 deletions
diff --git a/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/StartSignature.java b/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/StartSignature.java index 5c3927e..e065ea6 100644 --- a/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/StartSignature.java +++ b/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/StartSignature.java @@ -40,6 +40,7 @@ public class StartSignature extends HttpServlet { private static final String PARAM_TYPE = "TYPE"; private static final String PARAM_TARGETURL = "TARGETURL"; private static final String PARAM_RESIZE = "RESIZE"; + private static final String PARAM_LOCALE = "LOCALE"; private static final String PARAM_QRCODE = "QRCODE"; private static final String PARAM_NEW = "NEW"; @@ -136,6 +137,7 @@ public class StartSignature extends HttpServlet { String type = req.getParameter(PARAM_TYPE); String targetUrl = req.getParameter(PARAM_TARGETURL); String qrCodeData = req.getParameter(PARAM_QRCODE); + String localeData = req.getParameter(PARAM_LOCALE); // Step 1. Setup Parameters if (type != null) { @@ -153,6 +155,14 @@ public class StartSignature extends HttpServlet { logger.info("[" + req.getSession().getId() + "]: setting QR Code Data to: " + qrCodeData); } + + if (localeData != null) { + // If we have a type set it + SessionHelper.setLocale(req, localeData); + + logger.info("[" + req.getSession().getId() + + "]: setting Locale to: " + localeData); + } if (eventId != null) { SessionHelper.setEventID(req, eventId); @@ -370,9 +380,13 @@ public class StartSignature extends HttpServlet { } String entry = ""; if (SessionHelper.getQRCodeContent(req) != null) { - entry = "<input type=\"hidden\" name=\"qrcontent\" value=\"" + entry += "<input type=\"hidden\" name=\"qrcontent\" value=\"" + SessionHelper.getQRCodeContent(req) + "\">"; } + if (SessionHelper.getLocale(req) != null) { + entry += "<input type=\"hidden\" name=\"locale\" value=\"" + + SessionHelper.getLocale(req) + "\">"; + } template = template.replace("##ADDITIONAL##", entry); diff --git a/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/helper/SessionHelper.java b/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/helper/SessionHelper.java index 720c93c..bc86da6 100644 --- a/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/helper/SessionHelper.java +++ b/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/helper/SessionHelper.java @@ -15,7 +15,7 @@ public class SessionHelper { private static final String SESSION_EVENTID = "SESSION_EVENTID"; private static final String SESSION_DOCUMENT = "SESSION_DOCUMENT"; private static final String SESSION_RESIZE_DONE = "SESSION_RESIZE_DONE"; - + private static final String SESSION_LOCALE = "SESSION_LOCALE"; private static final String SESSION_QRCODE_CONTENT = "SESSION_QRCODE_CONTENT"; private static final String SESSION_TYPE_TEXT = "TEXT"; @@ -65,6 +65,19 @@ public class SessionHelper { } } + public static void setLocale(HttpServletRequest request, String value) { + request.getSession().setAttribute(SESSION_LOCALE, value); + } + + public static String getLocale(HttpServletRequest request) { + Object s = request.getSession().getAttribute(SESSION_LOCALE); + if (s != null) { + return s.toString(); + } else { + return null; + } + } + public static void setContent(HttpServletRequest request, String value) { request.getSession().setAttribute(SESSION_CONTENT, value); } |