From 168477fe312474c95e326383f8c101247a6f206f Mon Sep 17 00:00:00 2001 From: afitzek Date: Mon, 9 Jul 2012 14:24:21 +0000 Subject: Supported EID git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@920 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../gv/egiz/pdfas/web/servlets/DataURLServlet.java | 25 +-- .../at/gv/egiz/pdfas/web/i18n/language.properties | 19 +++ .../gv/egiz/pdfas/web/i18n/language_de.properties | 20 +++ .../src/main/webapp/images/dreieck-hinauf.gif | Bin 0 -> 114 bytes .../src/main/webapp/images/dreieck-hinunter.gif | Bin 0 -> 113 bytes pdf-as-web/src/main/webapp/jsp/signupload.jsp | 56 ++++++ pdf-as-web/src/main/webapp/jsp/supportedEID.jsp | 190 +++++++++++++++++++++ 7 files changed, 300 insertions(+), 10 deletions(-) create mode 100644 pdf-as-web/src/main/webapp/images/dreieck-hinauf.gif create mode 100644 pdf-as-web/src/main/webapp/images/dreieck-hinunter.gif create mode 100644 pdf-as-web/src/main/webapp/jsp/supportedEID.jsp (limited to 'pdf-as-web/src') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java index a19b24a..a4203ff 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java @@ -145,7 +145,7 @@ public class DataURLServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.debug("Data URL is accessed."); //$NON-NLS-1$ - + Object sessionObject = null; try { sessionObject = SessionHelper.getSession(request); @@ -164,6 +164,9 @@ public class DataURLServlet extends HttpServlet { } catch (ExternalErrorException f) { if (statLog.isInfoEnabled()) { + + String ua = request.getHeader("User-Agent"); + long endTime = System.currentTimeMillis(); // String toReport = "SIGN;" + si.mode + ";" + si.filename + // ";"+ fileSize + ";" + @@ -174,13 +177,13 @@ public class DataURLServlet extends HttpServlet { SignSessionInformation si = (SignSessionInformation) sessionObject; toReport = "SIGN;" + si.mode + ";" + si.connector + ";" + si.pdfDataSource.getLength() + ";" - + (endTime - si.startTime) + ";ERROR"; + + (endTime - si.startTime) + ";ERROR;" + ua; } else { VerifySessionInformation si = (VerifySessionInformation) sessionObject; try { - toReport = "VERIFY;"+ si.file_name + ";"+ 0 + ";" + (endTime - si.startTime) + ";" + VerifyServlet.debugVerifyResults(si.verifyResults) + ";ERROR"; + toReport = "VERIFY;"+ si.file_name + ";"+ 0 + ";" + (endTime - si.startTime) + ";" + VerifyServlet.debugVerifyResults(si.verifyResults) + ";ERROR;" + ua; } catch (SettingNotFoundException e1) { - toReport = "VERIFY;"+ si.file_name + ";"+ 0 + ";" + (endTime - si.startTime) + ";ERROR-debug-verify" + ";ERROR"; + toReport = "VERIFY;"+ si.file_name + ";"+ 0 + ";" + (endTime - si.startTime) + ";ERROR-debug-verify" + ";ERROR;" + ua; } } } @@ -398,7 +401,7 @@ public class DataURLServlet extends HttpServlet { response.setCharacterEncoding("UTF-8"); response.getWriter() .println( - "Das detached XML kann nicht direkt durch die BKU geschliffen werden, weil diese es als Request interpretieren würde. Daher das XML als Text:"); + "Das detached XML kann nicht direkt durch die BKU geschliffen werden, weil diese es als Request interpretieren w�rde. Daher das XML als Text:"); response.getWriter().println( new String(si.signedPdf, "UTF-8")); if (statLog.isInfoEnabled()) { @@ -408,7 +411,7 @@ public class DataURLServlet extends HttpServlet { String toReport = "SIGN;" + si.mode + ";" + si.connector + ";" + si.pdfDataSource.getLength() + ";" - + (endTime - si.startTime) + ";OK"; + + (endTime - si.startTime) + ";OK;" + userAgent; statLog.info(toReport); } @@ -427,7 +430,7 @@ public class DataURLServlet extends HttpServlet { String toReport = "SIGN;" + si.mode + ";" + si.connector + ";" + si.pdfDataSource.getLength() + ";" - + (endTime - si.startTime) + ";OK"; + + (endTime - si.startTime) + ";OK;" + userAgent; statLog.info(toReport); } @@ -468,7 +471,7 @@ public class DataURLServlet extends HttpServlet { String toReport = "SIGN;" + si.mode + ";" + si.connector + ";" + si.pdfDataSource.getLength() + ";" - + (endTime - si.startTime) + ";OK"; + + (endTime - si.startTime) + ";OK;" + userAgent; statLog.info(toReport); } @@ -499,6 +502,8 @@ public class DataURLServlet extends HttpServlet { SignatureException { log.trace("processVerify"); + String userAgent = request.getHeader("user-agent"); + String xml_response = request.getParameter("XMLResponse"); //$NON-NLS-1$ log.debug("xml_response = " + xml_response); //$NON-NLS-1$ @@ -558,9 +563,9 @@ public class DataURLServlet extends HttpServlet { // ";"+ fileSize + ";" + String toReport = null; try { - toReport = "VERIFY;"+ si.file_name + ";"+ 0 + ";" + (endTime - si.startTime) + ";" + VerifyServlet.debugVerifyResults(si.verifyResults) + ";OK"; + toReport = "VERIFY;"+ si.file_name + ";"+ 0 + ";" + (endTime - si.startTime) + ";" + VerifyServlet.debugVerifyResults(si.verifyResults) + ";OK;" + userAgent; } catch (SettingNotFoundException e1) { - toReport = "VERIFY;"+ si.file_name + ";"+ 0 + ";" + (endTime - si.startTime) + ";ERROR-debug-verify" + ";OK"; + toReport = "VERIFY;"+ si.file_name + ";"+ 0 + ";" + (endTime - si.startTime) + ";ERROR-debug-verify" + ";OK;" + userAgent; } statLog.info(toReport); diff --git a/pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language.properties b/pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language.properties index c9a1b02..2f541ce 100644 --- a/pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language.properties +++ b/pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language.properties @@ -138,3 +138,22 @@ verifyupload.heading2 = Verify document signature verifyupload.note = Please enter the complete document text together with the signature block. verifyupload.verifydevice = Verification device verifyupload.verifymode = Verification mode + +supported.EID.link = Supported cards from european countries + +supported.EID.title = Supported signature-creation devices + +supported.EID.text = This service creates qualified electronic signatures following the PDF-AS specification. Signatures can be validated at www.signaturpruefung.gv.at. The service supports signature-creation devices of the following countries. + +supported.EID.austria = Austria (citizen card as smart card or mobile phone signature) +supported.EID.belgium = Belgium +supported.EID.estonia = Estonia +supported.EID.finland = Finland +supported.EID.iceland = Iceland +supported.EID.italy = Italy +supported.EID.liechtenstein = Liechtenstein +supported.EID.lithuania = Lithuania +supported.EID.portugal = Portugal +supported.EID.spain = Spain +supported.EID.sweden = Sweden +supported.EID.switzerland = Switzerland \ No newline at end of file diff --git a/pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language_de.properties b/pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language_de.properties index d7185bc..7573f9e 100644 --- a/pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language_de.properties +++ b/pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language_de.properties @@ -140,3 +140,23 @@ verifyupload.heading2 = Dokument Signatur pr\u00FCfen verifyupload.note = Hier bitte den vollst\u00E4ndigen Dokumenttext samt Signaturblock eingeben. verifyupload.verifydevice = Pr\u00FCf-Applikation verifyupload.verifymode = Pr\u00FCf-Modus + +supported.EID.link = Folgende Karten aus dem EU Raum werden unterst\u00FCtzt + +supported.EID.title = Unterst\u00FCtzte Signaturerstellungseinheiten + +supported.EID.text = Dieses Service erstellt qualifizierte Signaturen nach der Spezifikation PDF-AS. Die Pr\u00FCfung der Signaturen kann unter www.signaturpruefung.gv.at erfolgen. Es werden Signaturerstellungseinheiten aus folgenden L\u00E4ndern unterst\u00FCtzt: + +supported.EID.austria = \u00D6sterreich (B\u00FCrgerkarte mit Chipkarte oder Handy-Signatur) +supported.EID.belgium = Belgien +supported.EID.estonia = Estland +supported.EID.finland = Finnland +supported.EID.iceland = Island +supported.EID.italy = Italien +supported.EID.liechtenstein = Liechtenstein +supported.EID.lithuania = Litauen +supported.EID.portugal = Portugal +supported.EID.spain = Spanien +supported.EID.sweden = Schweden +supported.EID.switzerland = Schweiz + diff --git a/pdf-as-web/src/main/webapp/images/dreieck-hinauf.gif b/pdf-as-web/src/main/webapp/images/dreieck-hinauf.gif new file mode 100644 index 0000000..47fbdae Binary files /dev/null and b/pdf-as-web/src/main/webapp/images/dreieck-hinauf.gif differ diff --git a/pdf-as-web/src/main/webapp/images/dreieck-hinunter.gif b/pdf-as-web/src/main/webapp/images/dreieck-hinunter.gif new file mode 100644 index 0000000..b63f11c Binary files /dev/null and b/pdf-as-web/src/main/webapp/images/dreieck-hinunter.gif differ diff --git a/pdf-as-web/src/main/webapp/jsp/signupload.jsp b/pdf-as-web/src/main/webapp/jsp/signupload.jsp index 89a9360..a65f56a 100644 --- a/pdf-as-web/src/main/webapp/jsp/signupload.jsp +++ b/pdf-as-web/src/main/webapp/jsp/signupload.jsp @@ -254,6 +254,9 @@ else { document.getElementById('descriptionbeforefreetext').style.display='none'; } + + document.getElementById('cardlink').style.display='none'; + document.getElementById('descriptionduring').style.display='block'; //document.getElementById('sprachlink').style.display = 'none'; //document.getElementById('sprachlinkdeaktiviert').style.display= 'block'; @@ -295,6 +298,9 @@ if (document.getElementById('descriptionbeforefreetext').style.display=='block') { document.getElementById('descriptionbeforefreetext').style.display='none' } + if (document.getElementById('cardlink').style.display=='block') { + document.getElementById('cardlink').style.display='none' + } if (document.getElementById('descriptionduring').style.display=='block') { document.getElementById('descriptionduring').style.display='none' } @@ -446,6 +452,21 @@ } } + + function PDFEinAusblenden(objekt) { + if (document.getElementById(objekt).style.display == 'block') { + document.getElementById(objekt).style.display = 'none'; + document.getElementById('dreieck-' + objekt).src = 'images/dreieck-hinunter.gif'; + document.getElementById('dreieck-' + objekt).alt = objekt + ' anzeigen'; + } + else { + document.getElementById(objekt).style.display = 'block'; + document.getElementById('dreieck-' + objekt).src = 'images/dreieck-hinauf.gif'; + document.getElementById('dreieck-' + objekt).alt = objekt + ' ausblenden'; + } + document.getElementById('dreieck-' + objekt).parentNode.blur(); + } + //Check the height of the IFrame to be shown for adjusting the high //of the currently showed div's as well as of those of other pages function checkHeight() { @@ -558,6 +579,41 @@ <% } %> + + + + + + diff --git a/pdf-as-web/src/main/webapp/jsp/supportedEID.jsp b/pdf-as-web/src/main/webapp/jsp/supportedEID.jsp new file mode 100644 index 0000000..b9d3ed0 --- /dev/null +++ b/pdf-as-web/src/main/webapp/jsp/supportedEID.jsp @@ -0,0 +1,190 @@ +<%@page import="at.gv.egiz.pdfas.web.session.SessionAttributes"%> +<%@ page import="org.apache.commons.lang.StringEscapeUtils"%> +<%@ page import="at.gv.egiz.pdfas.api.commons.Constants"%> +<%@ page import="at.gv.egiz.pdfas.web.i18n.LanguageDecoratorMapper"%> +<%@ page import="org.apache.commons.lang.BooleanUtils"%> +<%@ page import="at.gv.egiz.pdfas.web.i18n.LocaleParamFilter"%> +<%@ page import="java.util.Locale"%> +<%@ page import="at.gv.egiz.pdfas.web.helper.LocalRequestHelper"%> + +<%@ include file="/jsp/language.jsp"%> + + + + + + +<% + + String sessionLang = null; + + //When Change Language link is hit, three parameters are passed with a hidden form + //so that the settings keep the same. Check if this parameters are passed... + String source_mode_request = (String)request.getParameter("source_mode"); + String text_request = (String)request.getParameter("text"); + String lang_request = (String)request.getParameter("newlanguage"); + + if (lang_request!=null) { + if (lang_request.equals("de")) { + session.setAttribute(SessionAttributes.LANGUAGE, "de"); + } + else { + session.setAttribute(SessionAttributes.LANGUAGE, "en"); + } + } + + String serverUrl=LocalRequestHelper.getLocalServerAddress(request,response); + String baseUrl=LocalRequestHelper.getLocalContextAddress(request,response); + + //Check if application is started within an iframe from an extern application + String extern = (String)request.getParameter("extern"); + boolean startedFromIFrame = false; + + if (extern !=null) { + if (extern.equals("yes")) { + startedFromIFrame = true; + } + } + + String requestLang = (String)request.getParameter("locale"); + sessionLang = (String)session.getAttribute(SessionAttributes.LANGUAGE); + String language = ""; + + //If language within session... + if (sessionLang!=null) { + //But if language also changed by clicking the change language link + //or passed as parameter with the URL... + if (requestLang!=null) { + //If language has changed, change it also within session + if (!sessionLang.equals(requestLang)) { + session.setAttribute(SessionAttributes.LANGUAGE, requestLang); + } + //else do nothing + } + //else no change + } + //Else still no language within session + else { + //But if language changed by clicking the change language link + //or passed as parameter with the URL... + if (requestLang!=null) { + if (requestLang.equals("de")) { + session.setAttribute(SessionAttributes.LANGUAGE,"de"); + } + else { + session.setAttribute(SessionAttributes.LANGUAGE,"en"); + } + } + //No language here. Set to german + else { + session.setAttribute(SessionAttributes.LANGUAGE,"de"); + } + } + + language = (String)session.getAttribute(SessionAttributes.LANGUAGE); + + boolean german = true; + + if (language != null) { + if (language.equals("en")) { + german = false; + } + } + + if (german) { +%> + +<% + } else { +%> + +<% + } +%> + + + <fmt:message key="supported.EID.title"/> + + +<% + //If application called within an IFrame from an external application + //choose template and set session attribute + if (!startedFromIFrame) { + session.setAttribute("extern", "no"); + if (german) { + %> + + + <% } else { %> + + + <% } + } else { + session.setAttribute("extern", "yes"); + %> + + <% } %> + + <% if ((serverUrl.contains("http")) && (!serverUrl.contains("https")) && (!serverUrl.contains("localhost"))) { + baseUrl = baseUrl.replace("http","https"); %> + + <% } %> + + + + +

+ +

+
+ + + + +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + <% if(german) { %> +
  • +
  • + <% } else { %> +
  • +
  • + <% } %> +
  • +
+
+
+
+ +
+
+ + +
+ <% if (german) { %> + + <% } else { %> + + <% } %> + + +
+ + + + + \ No newline at end of file -- cgit v1.2.3