aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/webapp/jsp
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-web/src/main/webapp/jsp')
-rw-r--r--pdf-as-web/src/main/webapp/jsp/download.jsp181
1 files changed, 158 insertions, 23 deletions
diff --git a/pdf-as-web/src/main/webapp/jsp/download.jsp b/pdf-as-web/src/main/webapp/jsp/download.jsp
index 1b56f93..e0c1cc4 100644
--- a/pdf-as-web/src/main/webapp/jsp/download.jsp
+++ b/pdf-as-web/src/main/webapp/jsp/download.jsp
@@ -4,41 +4,176 @@
<%@ page import="at.gv.egiz.pdfas.web.session.SessionAttributes" %>
<%@ page import="at.gv.egiz.pdfas.web.helper.LocalRequestHelper" %>
+<%@ page import="at.gv.egiz.pdfas.web.servlets.SignServlet" %>
+<%@ page import="at.gv.egiz.pdfas.api.commons.Constants" %>
+<%@page import="at.gv.egiz.pdfas.web.FormFields"%>
<%
- String downloadURL = (String) session.getAttribute(SessionAttributes.DOWNLOAD_URL_FOR_SIGNED_PDF_DOCUMENT);
+ String downloadURL = (String) session.getAttribute(SessionAttributes.DOWNLOAD_URL_FOR_SIGNED_PDF_DOCUMENT);
+
+ String connector = (String)session.getAttribute(SignServlet.SUBMITFORM_SIGNATURE_DEVICE_KEY);
+
+ session.setAttribute(SignServlet.SUBMITFORM_SIGNATURE_MODE_KEY, null);
+ session.setAttribute(SignServlet.SUBMITFORM_SOURCE_KEY, null);
+ session.setAttribute(SignServlet.SUBMITFORM_SIGNATURE_TYPE_KEY, null);
+ session.setAttribute(SignServlet.SUBMITFORM_PDFA_KEY, null);
+ session.setAttribute(SignServlet.SUBMITFORM_NOTE_KEY, null);
+ session.setAttribute(SignServlet.SUBMITFORM_FREETEXT_KEY, null);
+ session.setAttribute(SignServlet.SUBMITFORM_SIGNATURE_DEVICE_KEY, null);
+ session.setAttribute(SignServlet.SUBMITFORM_FILE_KEY, null);
+ session.setAttribute(SignServlet.SUBMITFORM_FILENAME_KEY, null);
+ session.setAttribute(SessionAttributes.ATTRIBUTE_SESSION_INFORMATION, null);
+ session.setAttribute(SignServlet.ERROR_WITHIN_IFRAME, null);
+
+ String height = (String)session.getAttribute(SignServlet.HEIGHT_SIGN_DIV);
+
+ String language = (String)session.getAttribute(SessionAttributes.LANGUAGE);
+ boolean german = true;
+
+ //Check if application is started within an iframe from an extern application
+ boolean startedFromIFrame = false;
+ String extern = (String)session.getAttribute("extern");
+ if (extern!=null) {
+ if (extern.equals("yes")) {
+ startedFromIFrame = true;
+ }
+ }
+ //
+
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
+ <% if (language!=null) { %>
+ <% if (language.equals("de")) { %>
+ <fmt:setLocale value="de"/>
+ <% } else {
+ german = false; %>
+ <fmt:setLocale value="en"/>
+ <% } %>
+ <% } else { %>
+ <fmt:setLocale value="de"/>
+ <% } %>
+
+ <!-- Check the possibility of the page being loaded within an iframe.
+ In this case some things doesn't need to be shown (e.g. the buergerkarte-background) -->
+ <% if (!startedFromIFrame) {
+ if (german) { %>
+ <meta name="decorator" content="production_de" />
+ <% } else { %>
+ <meta name="decorator" content="production_en" />
+ <% } %>
+ <link rel="stylesheet" type="text/css" href="https://www.buergerkarte.at/test-pdf-as/css/pdfas-styles.css" />
+ <!-- <link rel="stylesheet" href="https://www.buergerkarte.at/style.css" type="text/css" /> -->
+ <% } else { %>
+ <link rel="stylesheet" type="text/css" href="https://www.buergerkarte.at/test-pdf-as/css/extern-styles.css" />
+ <% } %>
+ <meta http-equiv="pragma" content="no-cache,no-store,private,must-revalidate,max-stale=0,post-check=0,pre-check=0"/>
+ <meta http-equiv="expires" content="0"/>
+ <meta http-equiv="cache-control" content="no-cache,no-store,must-revalidate,max-age=-1"/>
+ <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT"/>
+
+
<title><fmt:message key="download.title"/></title>
<script language="javascript" type="text/javascript">
<!--
- function disableElement(elementId) {
- document.getElementById(elementId).disabled = true;
- document.getElementById(elementId).blur();
- }
- function hitButton() {
- document.submitform.submit();
- disableElement("SendRequestButton");
- document.getElementById("SendRequestButton").value = "<fmt:message key="download.button.alreadydone"/>";
- return(true);
+ //Disable download button
+ function disableElement() {
+ document.submitform.SendRequestButton.disabled = true;
+ document.submitform.SendRequestButton.blur();
+ }
+ //Hit the download button to submit the form
+ function hitButton() {
+ disableElement();
+ document.submitform.SendRequestButton.value = "<fmt:message key="download.button.alreadydone"/>";
+ document.submitform.submit();
+ return(true);
+ }
+
+ //Deactivate the link for changing language
+ function deactivateSprachlink() {
+ document.getElementById('sprachlink').style.display = 'none';
+ document.getElementById('sprachlinkdeaktiviert').style.display= 'block';
+
+ }
+
+ //Detect browser and change sizes if IE 7.0
+ function detectBrowser() {
+ if ((navigator.appName.indexOf('Internet Explorer')!=-1) && (navigator.appVersion.indexOf('MSIE 7.0')!=-1)) {
+ var stringHeight = "<%=height%>";
+ var intHeight = stringHeight.substring(0,stringHeight.length-2);
+ var iediff = 25;
+ var height = parseInt(intHeight)+iediff;
+ height = height + 'px';
+ document.getElementById('sign').style.height=height;
+ document.getElementById('downloadtext').style.height=height;
+ document.getElementById('signintern').className='rechtsinhaltinternetexplorer';
+ document.getElementById('downloadtextintern').className='linksinhaltinternetexplorer';
+ document.getElementById('pdfasverticalspace').className='pdfasverticalspaceinternetexplorer';
}
+ }
+
+ //Set the height of the div's equal to the previous pages
+ function setHeight() {
+ document.getElementById('sign').style.height = "<%=height%>";
+ document.getElementById('downloadtext').style.height = "<%=height%>";
+ }
+
-->
</script>
- <base href="<%= LocalRequestHelper.getLocalContextAddress(request, response) %>/"/>
</head>
-
- <body>
- <h1><fmt:message key="common.title"/></h1>
- <h2><fmt:message key="download.heading2"/></h2>
- <div class="pdfasnote"><fmt:message key="download.note"/></div>
- <div class="pdfasverticalspace"></div>
- <form action="<%= downloadURL %>" name="submitform" accept-charset="UTF-8" method="post" enctype="application/x-www-form-urlencoded">
- <input type="submit" id="SendRequestButton" value="<fmt:message key="download.button.download"/>" onclick="return hitButton();"/>
- </form>
- <div class="pdfasverticalspace"></div>
- <a href="<%= (response.encodeRedirectURL(request.getContextPath() + "/") + "?") %><fmt:message key="common.locale.param"/>"><fmt:message key="common.back"/></a>
- </body>
+ <body>
+ <% if (!startedFromIFrame) { %>
+ <h1 id="heading1download">
+ <fmt:message key="download.title"/>
+ </h1>
+ <div>
+ <fmt:message key="download.description"/>
+ </div>
+ <div class="pdfasverticalspace" id="pdfasverticalspace"></div>
+ <% } %>
+ <div id="inhalt">
+ <div class="links" id="downloadtext">
+ <div class="linksinhaltmargin" id="downloadtextintern">
+ <div class="pdfasnote"><fmt:message key="download.note"/></div>
+ <div class="pdfasverticalspace"></div>
+ <div><form action="<%= downloadURL %>" name="submitform" accept-charset="UTF-8" method="post" enctype="application/x-www-form-urlencoded" target="_blank">
+ <input type="submit" name="SendRequestButton" id="SendRequestButton" value="<fmt:message key="download.button.download"/>" onclick="return hitButton();"/>
+ </form></div>
+ <div class="pdfasverticalspace"></div>
+ <% if (!startedFromIFrame) { %>
+ <div><a href="https://www.buergerkarte.at/test-pdf-as/"><fmt:message key="common.finish"/></a></div>
+ <% } %>
+ </div>
+ </div>
+ <div class="rechts" id="sign">
+ <div class="rechtsinhalt" id="signintern">
+ <div class="rechtslinks">
+ <img src="https://www.buergerkarte.at/test-pdf-as/images/onlineBKU.png" alt="Chip-Karte" id="Karte"/>
+ </div>
+ <div class="rechtsrechts">
+ <img src="https://www.buergerkarte.at/test-pdf-as/images/mobileBKU.png" alt="Handy" id="Handy"/>
+ </div>
+ <div class="rechtslinks">
+ <input type="submit" name="<%= FormFields.FIELD_CONNECTOR_SMARTCARD %>" value="<fmt:message key="signupload.signwithcard"/>" alt="Signatur mit Karte" disabled="disabled"/>
+ </div>
+ <div class="rechtsrechts">
+ <input type="submit" name="<%= FormFields.FIELD_CONNECTOR_MOBILE %>" value="<fmt:message key="signupload.signwithmobile"/>" alt="Signatur mit Handy" disabled="disabled"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <% if (!startedFromIFrame) { %>
+
+ <script language="javascript" type="text/javascript">
+ deactivateSprachlink();
+ setHeight();
+ detectBrowser();
+ </script>
+
+ <% } %>
+ </body>
+
+
</html>