aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src
diff options
context:
space:
mode:
authorafitzek <afitzek@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2012-07-09 14:24:21 +0000
committerafitzek <afitzek@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2012-07-09 14:24:21 +0000
commit168477fe312474c95e326383f8c101247a6f206f (patch)
tree92111c8191141bf1e5fba87501cf4ed402f488bf /pdf-as-web/src
parent28c303923ec7bb96b18c54d660630bfab86f3b8c (diff)
downloadpdf-as-3-168477fe312474c95e326383f8c101247a6f206f.tar.gz
pdf-as-3-168477fe312474c95e326383f8c101247a6f206f.tar.bz2
pdf-as-3-168477fe312474c95e326383f8c101247a6f206f.zip
Supported EID
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@920 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'pdf-as-web/src')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java25
-rw-r--r--pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language.properties19
-rw-r--r--pdf-as-web/src/main/resources/at/gv/egiz/pdfas/web/i18n/language_de.properties20
-rw-r--r--pdf-as-web/src/main/webapp/images/dreieck-hinauf.gifbin0 -> 114 bytes
-rw-r--r--pdf-as-web/src/main/webapp/images/dreieck-hinunter.gifbin0 -> 113 bytes
-rw-r--r--pdf-as-web/src/main/webapp/jsp/signupload.jsp56
-rw-r--r--pdf-as-web/src/main/webapp/jsp/supportedEID.jsp190
7 files changed, 300 insertions, 10 deletions
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 <a href="http://www.signaturpruefung.gv.at">www.signaturpruefung.gv.at</a>. 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 <a href="http://www.signaturpruefung.gv.at">www.signaturpruefung.gv.at</a> 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
--- /dev/null
+++ b/pdf-as-web/src/main/webapp/images/dreieck-hinauf.gif
Binary files 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
--- /dev/null
+++ b/pdf-as-web/src/main/webapp/images/dreieck-hinunter.gif
Binary files 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 @@
</div>
<% } %>
+ <div id="cardlink" style="display:block">
+ <a id='Link-cards' class='keinhover'><fmt:message key="supported.EID.link"/></a><a><img id='dreieck-CardSupport' alt="<fmt:message key="supported.EID.link"/>" src='images/dreieck-hinunter.gif' width='9' height='8' class='dreieck' /></a>
+ </div>
+
+ <script type='text/javascript'>
+ document.getElementById('Link-cards').href = "javascript:PDFEinAusblenden('CardSupport');";
+ document.getElementById('Link-cards').className = '';
+ document.getElementById('dreieck-CardSupport').parentNode.href = "javascript:PDFEinAusblenden('CardSupport');";
+ </script>
+ <div id="CardSupport" style="display:none">
+ <p>
+ <fmt:message key="supported.EID.text"/>
+ </p>
+ <ul class="links" style="margin-left:20px;">
+ <li><fmt:message key="supported.EID.austria"/></li>
+ <li><fmt:message key="supported.EID.belgium"/></li>
+ <li><fmt:message key="supported.EID.estonia"/></li>
+ <li><fmt:message key="supported.EID.finland"/></li>
+ <li><fmt:message key="supported.EID.iceland"/></li>
+ <li><fmt:message key="supported.EID.italy"/></li>
+ <li><fmt:message key="supported.EID.liechtenstein"/></li>
+ <li><fmt:message key="supported.EID.lithuania"/></li>
+ <li><fmt:message key="supported.EID.portugal"/></li>
+ <% if(german) { %>
+ <li><fmt:message key="supported.EID.sweden"/></li>
+ <li><fmt:message key="supported.EID.spain"/></li>
+ <% } else { %>
+ <li><fmt:message key="supported.EID.spain"/></li>
+ <li><fmt:message key="supported.EID.sweden"/></li>
+ <% } %>
+ <li><fmt:message key="supported.EID.switzerland"/></li>
+</ul>
+ </div> <!-- CardSupport -->
+</div>
+
<div id="descriptionduring" style="display:none">
<fmt:message key="signupload.signing"/>
</div>
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"%>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html>
+<head>
+
+<%
+
+ 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) {
+%>
+<fmt:setLocale value="de" />
+<%
+ } else {
+%>
+<fmt:setLocale value="en" />
+<%
+ }
+%>
+
+<title>
+ <fmt:message key="supported.EID.title"/>
+</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) {
+ %>
+ <meta name="decorator" content="production_de" />
+ <link rel="stylesheet" type="text/css" href="<%=baseUrl%>/css/pdfas-styles.css" />
+ <% } else { %>
+ <meta name="decorator" content="production_en" />
+ <link rel="stylesheet" type="text/css" href="<%=baseUrl%>/css/pdfas-styles.css" />
+ <% }
+ } else {
+ session.setAttribute("extern", "yes");
+ %>
+ <link rel="stylesheet" type="text/css" href="<%=baseUrl%>/css/extern-styles.css" />
+ <% } %>
+
+ <% if ((serverUrl.contains("http")) && (!serverUrl.contains("https")) && (!serverUrl.contains("localhost"))) {
+ baseUrl = baseUrl.replace("http","https"); %>
+ <meta HTTP-EQUIV="REFRESH" content="0; url=<%=baseUrl %>/">
+ <% } %>
+
+</head>
+<body>
+
+<h1 id="heading1" style="display:block">
+<fmt:message key="supported.EID.title"/>
+</h1>
+<div class="linksinhalt">
+
+
+<fmt:message key="supported.EID.text"/>
+
+<ul>
+ <li><fmt:message key="supported.EID.austria"/></li>
+ <li><fmt:message key="supported.EID.belgium"/></li>
+ <li><fmt:message key="supported.EID.estonia"/></li>
+ <li><fmt:message key="supported.EID.finland"/></li>
+ <li><fmt:message key="supported.EID.iceland"/></li>
+ <li><fmt:message key="supported.EID.italy"/></li>
+ <li><fmt:message key="supported.EID.liechtenstein"/></li>
+ <li><fmt:message key="supported.EID.lithuania"/></li>
+ <li><fmt:message key="supported.EID.portugal"/></li>
+ <% if(german) { %>
+ <li><fmt:message key="supported.EID.sweden"/></li>
+ <li><fmt:message key="supported.EID.spain"/></li>
+ <% } else { %>
+ <li><fmt:message key="supported.EID.spain"/></li>
+ <li><fmt:message key="supported.EID.sweden"/></li>
+ <% } %>
+ <li><fmt:message key="supported.EID.switzerland"/></li>
+</ul>
+</div>
+<div style="display: none;">
+<form id="submitform" name="submitform">
+ <select id="source" name="source_filefreetext">
+ <option name="none" value="none" selected="selected"></option>
+ </select>
+</form>
+</div>
+
+<!-- Form that sets the source choosed and eventually the text when free text is choosen.
+ This is for passing the information when the change language link was hit. -->
+ <form name="changelanguage" id="changelanguage" method="post" accept-charset="UTF-8" action="<%=baseUrl %>/jsp/supportedEID.jsp" target="_self">
+ <% if (german) { %>
+ <input type="hidden" name="newlanguage" value="en"/>
+ <% } else { %>
+ <input type="hidden" name="newlanguage" value="de"/>
+ <% } %>
+ <input type="hidden" name="source_mode" value="file"/>
+ <input type="hidden" name="text" value=""/>
+ </form>
+
+ <script language="javascript" type="text/javascript">
+ checkHeight();
+ detectBrowser();
+ </script>
+
+</body>
+</html> \ No newline at end of file