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/null_request_page.jsp395
1 files changed, 340 insertions, 55 deletions
diff --git a/pdf-as-web/src/main/webapp/jsp/null_request_page.jsp b/pdf-as-web/src/main/webapp/jsp/null_request_page.jsp
index 77699e3..810349c 100644
--- a/pdf-as-web/src/main/webapp/jsp/null_request_page.jsp
+++ b/pdf-as-web/src/main/webapp/jsp/null_request_page.jsp
@@ -1,36 +1,107 @@
-<%@ page contentType="text/html; charset=UTF-8"%>
-<%@ page import="at.gv.egiz.pdfas.web.servlets.UpdateFormServlet"%>
+<%@ page contentType="text/html; charset=UTF-8" language="java" errorPage=""%>
<%@ page import="java.util.Locale" %>
<%@ page import="at.gv.egiz.pdfas.api.commons.Constants" %>
<%@ page import="at.gv.egiz.pdfas.web.session.VerifySessionInformation"%>
<%@ page import="at.gv.egiz.pdfas.web.session.SignSessionInformation" %>
<%@ page import="at.gv.egiz.pdfas.web.session.SessionAttributes" %>
+<%@ page import="at.gv.egiz.pdfas.web.FormFields" %>
+<%@ page import="at.gv.egiz.pdfas.web.servlets.SignServlet" %>
+<%@ page import="at.gv.egiz.pdfas.web.helper.LocalRequestHelper" %>
<%@ include file="language.jsp" %>
+
+
<%
+
+
+
+
+
String local_request_url = (String)request.getAttribute("local_request_url");
String data_url = (String) request.getAttribute("data_url");
HttpSessionBindingListener si = (HttpSessionBindingListener) session.getAttribute(SessionAttributes.ATTRIBUTE_SESSION_INFORMATION);
- Locale locale = (Locale) session.getAttribute(LocaleParamFilter.LOCALE_SESSION_KEY);
boolean isExternalInvocation = false;
- boolean isServerBKU = false;
+ boolean isServerBKU = false;
+ boolean isLocalBKU = false;
+ boolean isMobileBKU = false;
+
+ SignSessionInformation ssi = null;
+
if (si instanceof SignSessionInformation) {
- SignSessionInformation ssi = (SignSessionInformation) si;
+ ssi = (SignSessionInformation) si;
isExternalInvocation = ssi.exappinf != null;
- isServerBKU = Constants.SIGNATURE_DEVICE_MOC.equals(ssi.connector);
+ isServerBKU = Constants.SIGNATURE_DEVICE_MOC.equals(ssi.connector);
+ isLocalBKU = Constants.SIGNATURE_DEVICE_BKU.equals(ssi.connector);
+ isMobileBKU = Constants.SIGNATURE_DEVICE_MOBILE.equals(ssi.connector);
} else {
VerifySessionInformation vsi = (VerifySessionInformation) si;
isExternalInvocation = vsi.exappinf != null;
- isServerBKU = Constants.SIGNATURE_DEVICE_MOC.equals(vsi.connector);
+ isServerBKU = Constants.SIGNATURE_DEVICE_MOC.equals(vsi.connector);
+ isLocalBKU = Constants.SIGNATURE_DEVICE_BKU.equals(ssi.connector);
+ isMobileBKU = Constants.SIGNATURE_DEVICE_MOBILE.equals(ssi.connector);
+ }
+ boolean testMode = request.getContextPath().startsWith("/test-");
+
+ //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;
+ }
+ }
+ //
+
+ boolean german=true;
+
+ String language = (String)session.getAttribute(SessionAttributes.LANGUAGE);
+
+ if (language!=null) {
+ if (language.equals("de")) { %>
+ <fmt:setLocale value="de"/>
+ <% } else {
+ german = false; %>
+ <fmt:setLocale value="en"/>
+ <% }
}
-%>
+ else { %>
+ <fmt:setLocale value="de"/>
+ <% }
+ String height = (String)session.getAttribute(SignServlet.HEIGHT_SIGN_DIV);
+ %>
+
+
+
+
+
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <%
+ //buergerkarte.at Template has to be shown in some cases
+ if ((isLocalBKU || isExternalInvocation) && (!startedFromIFrame)) {
+ if (german) { %>
+ <meta name="decorator" content="production_de" />
+ <% } else { %>
+ <meta name="decorator" content="production_en" />
+ <% } %>
+ <meta http-equiv="Cache-Control" content="no-store"/>
+ <meta http-equiv="Pragma" content="no-cache"/>
+ <meta http-equiv="Expires" content="0"/>
+ <% } %>
+
<title><fmt:message key="nullrequestpage.title"/></title>
+
+ <% if (!startedFromIFrame) { %>
+ <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" />
+ <% } %>
<script language="javascript" type="text/javascript">
- <!--
+ <!--
+ //Disabling the SendRequest button when Local BKU is called
function disableElement(elementId) {
if (elementId != null && document.getElementById(elementId)) {
document.getElementById(elementId).disabled = true;
@@ -38,71 +109,285 @@
}
return(true);
}
+ //Hitting the SendRequest button and submitting the form when Local BKU is wanted
function hitButton() {
document.submitform.submit();
+ deactivateSprachlink();
disableElement("SendRequestButton");
if (document.getElementById("SendRequestButton")) {
- document.getElementById("SendRequestButton").value = "<fmt:message key="nullrequestpage.button.pleasewait"/>";
+ document.getElementById("SendRequestButton").value = "<fmt:message key='nullrequestpage.button.pleasewait'/>";
}
}
- -->
- </script>
- </head>
+ //Submitting the form of Mobile BKU or Online BKU
+ function submitFormWhenWithinIFrame() {
+ document.submitform.submit();
+ if (<%=language%>!=null) {
+ if (<%=language%>=='de') {
+ document.getElementById('SendRequestButton').value = 'Bitte warten...';
+ }
+ else {
+ document.getElementById('SendRequestButton').value = 'Please wait...';
+ }
+ document.getElementById('SendRequestButton').value = 'Bitte warten...';
+ }
+ document.getElementById('SendRequestButton').disabled = true;
+ }
- <body>
- <% if (!isExternalInvocation) { %>
- <h1><fmt:message key="common.title"/></h1>
- <h2><fmt:message key="nullrequestpage.heading2"/></h2>
- <% } // end if %>
+ //Disable form elements of signupload.jsp.
+ //Elements can just be disabled when form is already send, otherwise the values
+ //can not be transmitted
+ function disableFormSettings() {
+ //Just do this when it is called from signupload.jsp and not from signpreview.jsp
+ if (window.parent.document.getElementById('signaturesettings')) {
+ var parentDocument = window.parent.document;
+ //if (parentDocument.getElementById('descriptionbeforedocument').style.display=='block') {
+ // parentDocument.getElementById('descriptionbeforedocument').style.display='none';
+ //}
+ //else {
+ // parentDocument.getElementById('descriptionbeforefreetext').style.display='none';
+ //}
+ //parentDocument.getElementById('descriptionduring').style.display='block';
+ //parentDocument.submitform.<%= FormFields.FIELD_SIGNATURE_TYPE %>.disabled=true;
+ //parentDocument.submitform.<%= FormFields.FIELD_PDFA_ENABLED %>.disabled=true;
+ //parentDocument.submitform.<%= FormFields.FIELD_NOTE_ENABLED %>.disabled=true;
+ parentDocument.submitform.<%= FormFields.FIELD_SOURCE %>.disabled=true;
+ //parentDocument.submitform.<%= FormFields.FIELD_PREVIEW %>.disabled=true;
+ if (parentDocument.submitform.<%= FormFields.FIELD_SOURCE_FILE %>.style.display=='block') {
+ parentDocument.submitform.<%= FormFields.FIELD_SOURCE_FILE %>.disabled=true;
+ }
+ else {
+ parentDocument.submitform.<%= FormFields.FIELD_SOURCE_FREETEXT %>.disabled=true;
+ }
+ if (<%=isServerBKU%>==true) {
+ parentDocument.getElementById('localbku').style.display = 'block';
+ }
+ //parentDocument.getElementById('pdfalink').style.display = 'none';
+ //parentDocument.getElementById('pdfalinkdeaktiviert').style.display = 'block';
+ //parentDocument.getElementById('notelink').style.display = 'none';
+ //parentDocument.getElementById('notelinkdeaktiviert').style.display = 'block';
+ //parentDocument.getElementById('signmodelink').style.display = 'none';
+ //parentDocument.getElementById('signmodelinkdeaktiviert').style.display = 'block';
+ }
+ return (true);
+ }
+ //Deactivate the link to change language. This feature is just possible on the startpage
+ //because changing page language with all the javascript would be complicated
+ function deactivateSprachlink() {
+ document.getElementById('sprachlink').style.display = 'none';
+ document.getElementById('sprachlinkdeaktiviert').style.display= 'block';
+ }
+ //Set the height of the div's equally to before page
+ function setHeight() {
+ document.getElementById('sign').style.height = "<%=height%>";
+ document.getElementById('localbkutext').style.height = "<%=height%>";
+ }
+ //Detect IE7 and resize
+ 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('localbkutext').style.height = height;
+ document.getElementById('signintern').className='linksinhaltinternetexplorer';
+ document.getElementById('localbkutextintern').className='rechtsinhaltinternetexplorer';
+ document.getElementById('pdfasverticalspace').className='pdfasverticalspaceinternetexplorer';
+ }
+ }
+
+ -->
+
+ </script>
+ </head>
+
+ <%
+ //If whole application is not started from an IFrame within an external application (normal execution)
+ if (!startedFromIFrame) { %>
+ <% if (isServerBKU) { %>
+ <body style="background:#e6f2fa">
+ <div>
+ <form action="<%= local_request_url %>" name="submitform" accept-charset="UTF-8" method="post" target="_self">
+ <input type="hidden" name="XMLRequest" value="<?xml version='1.0' encoding='UTF-8'?><NullOperationRequest xmlns='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'/>" />
+ <input type="hidden" name="DataURL" value="<%= data_url %>" />
+ <input type="hidden" name="redirecttarget" value="_top"/>
+ <input type="hidden" name="appletWidth" value="190"/>
+ <input type="hidden" name="appletHeight" value="170"/>
+ <input type="hidden" name="appletBackground" value="#e6f2fa"/>
+ <input type="hidden" name="appletBackgroundColor" value="#e6f2fa"/>
+ <% if (language != null) { %>
+ <input type="hidden" name="locale" value="<%= language %>"/>
+ <% } // end if %>
+ </form>
+ <% if (!isExternalInvocation) { %>
+ <script language="javascript" type="text/javascript">
+ disableFormSettings();
+ document.submitform.submit();
+ </script>
+ <% } else { %>
+ <script language="javascript" type="text/javascript">
+ deactivateSprachlink();
+ document.submitform.submit();
+ </script>
+ <% } %>
+ </div>
+ </body>
+ <% } if (isMobileBKU) { %>
+ <body style="background:#e6f2fa">
+ <div>
+ <form action="<%= local_request_url %>" name="submitform" accept-charset="UTF-8" method="post" target="_self">
+ <input type="hidden" name="XMLRequest" value="<?xml version='1.0' encoding='UTF-8'?><NullOperationRequest xmlns='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'/>" />
+ <input type="hidden" name="DataURL" value="<%= data_url %>" />
+ <input type="hidden" name="redirecttarget" value="_top"/>
+ <input type="hidden" name="appletWidth" value="190"/>
+ <input type="hidden" name="appletHeight" value="170"/>
+ <% if (language != null) { %>
+ <input type="hidden" name="locale" value="<%= language %>"/>
+ <% } // end if %>
+ </form>
+ <% if (!isExternalInvocation) { %>
+ <script language="javascript" type="text/javascript">
+ disableFormSettings();
+ document.submitform.submit();
+ </script>
+ <% } else { %>
+ <script language="javascript" type="text/javascript">
+ deactivateSprachlink();
+ document.submitform.submit();
+ </script>
+ <% } %>
+ </div>
+ </body>
+ <% }
+ //If local BKU is choosed the whole page has to be shown
+ if (isLocalBKU) {
+ if (!isExternalInvocation) { %>
+ <body>
+ <h1 id="heading1" style="display:block">
+ <%
+ if (testMode) {
+ %>
+ <fmt:message key="test.common.title"/>
+ <% } else { %>
+ <fmt:message key="common.title"/>
+ <% } // end if %>
+ </h1>
+ <% } %>
+ <% if (isExternalInvocation) { %>
+ <div style="padding:10px 10px 10px 10px;"><fmt:message key="nullrequestpage.note.local"/></div>
+ <% } else { %>
+ <div><fmt:message key="nullrequestpage.note.local"/></div>
+ <div class="pdfasverticalspace" id="pdfasverticalspace"></div>
+ <% } // end if %>
+ <div id="inhalt">
+ <div class="links" id="sign">
+ <div class="linksinhaltmargin" id="signintern">
+ <form action="<%= local_request_url %>" name="submitform" accept-charset="UTF-8" method="post">
+ <input type="hidden" name="XMLRequest" value="<?xml version='1.0' encoding='UTF-8'?><NullOperationRequest xmlns='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'/>" />
+ <input type="hidden" name="DataURL" value="<%= data_url %>" />
+ <% if (language != null) { %>
+ <input type="hidden" name="locale" value="<%= language %>"/>
+ <% } // end if %>
+ <% if (!isExternalInvocation) { %>
+ <input type="submit" id="SendRequestButton" value="<fmt:message key="nullrequestpage.button.submit"/>" />
+ <% } // end if %>
+ </form>
+ <div class="pdfasverticalspace"></div>
+ <% if (!isExternalInvocation) { %>
+ <div id="backlink" align="left" style="margin-left:5px;display:block"><a href="<%= request.getContextPath() %>/" target="_self"><fmt:message key="common.cancel"/></a></div>
+ <% } %>
+ </div>
+ </div>
+ <div class="rechts" id="localbkutext">
+ <div class="rechtsinhalt" id="localbkutextintern">
+ <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" onclick="return submitForm(this)" disabled="disabled"></input>
+ </div>
+ <div class="rechtsrechts">
+ <input type="submit" name="<%= FormFields.FIELD_CONNECTOR_MOBILE %>" value="<fmt:message key="signupload.signwithmobile"/>" alt="Signatur mit Handy" onclick="return submitForm(this)" disabled="disabled"></input>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script language="javascript" type="text/javascript">
+ setHeight();
+ detectBrowser();
+ window.setTimeout("hitButton()",800);
+ </script>
+ </body>
+ <% } %>
+ <% }
+ //If the application is called within an IFrame from an external application the
+ //display has to be different
+ else { %>
+ <body>
+ <div style="width:600;height:auto">
<% if (isServerBKU) { %>
- <% if (!isExternalInvocation) { %>
- <div class="pdfasnote"><fmt:message key="nullrequestpage.note.server"/></div>
- <% } // end if %>
<form action="<%= local_request_url %>" name="submitform" accept-charset="UTF-8" method="post" target="moccaframe">
<input type="hidden" name="XMLRequest" value="<?xml version='1.0' encoding='UTF-8'?><NullOperationRequest xmlns='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'/>" />
<input type="hidden" name="DataURL" value="<%= data_url %>" />
<input type="hidden" name="appletWidth" value="190"/>
<input type="hidden" name="appletHeight" value="130"/>
- <% if (locale != null) { %>
- <input type="hidden" name="locale" value="<%= locale.toString() %>"/>
+ <% if (language != null) { %>
+ <input type="hidden" name="locale" value="<%= language %>"/>
<% } // end if %>
</form>
- <% if (!isExternalInvocation) { %>
- <div class="pdfasverticalspace"></div>
- <iframe name="moccaframe" style="border: 1px solid black;" width="190" height="152" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" src="<%= request.getContextPath() %>/jsp/please_wait.jsp" ></iframe>
- <% } else { // end if %>
- <iframe name="moccaframe" style="border: 1px none black;" width="190" height="152" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" src="<%= request.getContextPath() %>/jsp/please_wait.jsp" ></iframe>
- <% } // end if %>
-
- <% } else { %>
- <% if (isExternalInvocation) { %>
- <div class="pdfasnote" style="padding:10px 10px 10px 10px;"><fmt:message key="nullrequestpage.note.local"/></div>
- <% } else { %>
- <div class="pdfasnote"><fmt:message key="nullrequestpage.note.local"/></div>
- <div class="pdfasverticalspace"></div>
- <% } // end if %>
- <form action="<%= local_request_url %>" name="submitform" accept-charset="UTF-8" method="post">
+ <div><iframe name="moccaframe" style="border: 1px none black;" width="190" height="152" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" src="<%= request.getContextPath() %>/jsp/please_wait.jsp" ></iframe></div>
+ <div class="pdfasverticalspace"></div>
+ <form name="localform" id="localform" method="post" enctype="multipart/form-data" accept-charset="UTF-8" action="https://www.buergerkarte.at/test-pdf-as/Sign" target="_self">
+ <input type="submit" name="<%= FormFields.FIELD_CONNECTOR_LOCALBKU %>" value="Lokale BKU"/>
+ </form>
+ <div class="pdfasverticalspace"></div>
+ <div>Alternativ dazu wählen Sie eine lokale BKU</div>
+ <script language="javascript" type="text/javascript">
+ document.submitform.submit();
+ </script>
+ <% } if (isMobileBKU) { %>
+ <form action="<%= local_request_url %>" name="submitform" accept-charset="UTF-8" method="post" target="mobileframe">
<input type="hidden" name="XMLRequest" value="<?xml version='1.0' encoding='UTF-8'?><NullOperationRequest xmlns='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'/>" />
<input type="hidden" name="DataURL" value="<%= data_url %>" />
- <% if (locale != null) { %>
- <input type="hidden" name="locale" value="<%= locale.toString() %>"/>
+ <input type="hidden" name="appletWidth" value="190"/>
+ <input type="hidden" name="appletHeight" value="130"/>
+ <% if (language != null) { %>
+ <input type="hidden" name="locale" value="<%= language %>"/>
<% } // end if %>
- <% if (!isExternalInvocation) { %>
- <input type="submit" id="SendRequestButton" value="<fmt:message key="nullrequestpage.button.submit"/>" />
+ </form>
+ <iframe name="mobileframe" style="border: 1px none black;" width="190" height="152" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" src="<%= request.getContextPath() %>/jsp/please_wait.jsp" ></iframe>
+ <script language="javascript" type="text/javascript">
+ document.submitform.submit();
+ </script>
+ <% } if (isLocalBKU) { %>
+ <div style="padding:10px 10px 10px 10px;"><fmt:message key="nullrequestpage.note.local"/></div>
+ <form action="<%= local_request_url %>" name="submitform" accept-charset="UTF-8" method="post">
+ <input type="hidden" name="XMLRequest" value="<?xml version='1.0' encoding='UTF-8'?><NullOperationRequest xmlns='http://www.buergerkarte.at/namespaces/securitylayer/1.2#'/>" />
+ <input type="hidden" name="DataURL" value="<%= data_url %>" />
+ <% if (language != null) { %>
+ <input type="hidden" name="locale" value="<%= language %>"/>
<% } // end if %>
+ <% if (language !=null) { %>
+ <% if (language.equals("de")) { %>
+ <input type="submit" id="SendRequestButton" value="Absenden..." />
+ <% } else { %>
+ <input type="submit" id="SendRequestButton" value="Submit..." />
+ <% } %>
+ <% } else { %>
+ <input type="submit" id="SendRequestButton" value="Absenden..." />
+ <% } %>
</form>
- <% } // end if %>
-
- <% if (!isExternalInvocation) { %>
- <div class="pdfasverticalspace"></div>
- <a href="<%= request.getContextPath() %>/"><fmt:message key="common.back"/></a>
- <% } // end if %>
- <script language="javascript" type="text/javascript">
- <!--
- window.setTimeout("hitButton()", 800);
- -->
- </script>
- </body>
-
+ <script language="javascript" type="text/javascript">
+ window.setTimeout("submitFormWhenWithinIFrame()", 800);
+ </script>
+ <% } %>
+ </div>
+
+ </body>
+ <% } %>
</html>