aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpiazzi <rpiazzi@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2011-09-23 15:10:58 +0000
committerrpiazzi <rpiazzi@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2011-09-23 15:10:58 +0000
commit2eb9a696b20046eedbdc856a63dc11bc42763957 (patch)
tree96e72ba800c635916c73a43b29d467d75f41218d
parent518295b9b95a552795bda62a442d59b897b91737 (diff)
downloadpdf-as-3-2eb9a696b20046eedbdc856a63dc11bc42763957.tar.gz
pdf-as-3-2eb9a696b20046eedbdc856a63dc11bc42763957.tar.bz2
pdf-as-3-2eb9a696b20046eedbdc856a63dc11bc42763957.zip
Comprehensive changes due to reorganization of user interface. JavaScripts added for functionality and styling reasons. But due to changes the preview feature is no more active. See the code for further explanations.
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@822 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
-rw-r--r--pdf-as-web/src/main/webapp/jsp/signpreview.jsp274
1 files changed, 211 insertions, 63 deletions
diff --git a/pdf-as-web/src/main/webapp/jsp/signpreview.jsp b/pdf-as-web/src/main/webapp/jsp/signpreview.jsp
index d21a967..a94313e 100644
--- a/pdf-as-web/src/main/webapp/jsp/signpreview.jsp
+++ b/pdf-as-web/src/main/webapp/jsp/signpreview.jsp
@@ -4,81 +4,229 @@
<%@ page import="at.gv.egiz.pdfas.web.io.TextDataSource"%>
<%@ page import="org.apache.commons.lang.StringEscapeUtils"%>
<%@ page import="at.gv.egiz.pdfas.api.commons.Constants" %>
+<%@page import="at.gv.egiz.pdfas.web.servlets.SignServlet"%>
+<%@ 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">
-<%@ include file="language.jsp" %>
-<%
- SignSessionInformation si = (SignSessionInformation) session.getAttribute(SessionAttributes.ATTRIBUTE_SESSION_INFORMATION);
- String submit_url = (String)request.getAttribute("submit_url");
-
- String signature_data_url = (String)request.getAttribute("signature_data_url");
-
- String document_text = null;
- if (si.mode.equals(FormFields.VALUE_MODE_TEXTUAL)) {
-// SignatureData data = si.si.getSignatureData();
-// TextDataSourceImpl tds = (TextDataSourceImpl)data.getDataSource();
-// document_text = StringEscapeUtils.escapeHtml(tds.getText());
- document_text = StringEscapeUtils.escapeHtml(
- (String)request.getAttribute("document_text"));
- }
-%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <title><fmt:message key="signpreview.title"/></title>
+
+ <%
+
+ String contextPath = LocalRequestHelper.getLocalContextAddress(request, response);
+ String serverUrl = LocalRequestHelper.getLocalServerAddress(request, response);
+ String signature_data_url = (String)request.getAttribute("signature_data_url");
+ String sign_freetext = "";
+ String sign_mode = (String)session.getAttribute(SignServlet.SUBMITFORM_SIGNATURE_MODE_KEY);
+ //String source_mode = (String)session.getAttribute(SignServlet.SUBMITFORM_SOURCE_KEY);
+ //String sign_type = (String)session.getAttribute(SignServlet.SUBMITFORM_SIGNATURE_TYPE_KEY);
+ //String sign_pdfa = (String)session.getAttribute(SignServlet.SUBMITFORM_PDFA_KEY);
+ //String sign_note = (String)session.getAttribute(SignServlet.SUBMITFORM_NOTE_KEY);
+ //sign_freetext = (String)session.getAttribute(SignServlet.SUBMITFORM_FREETEXT_KEY);
+ String document_text="";
+ if (FormFields.FIELD_MODE_TEXTUAL.contains(sign_mode)) {
+ document_text = StringEscapeUtils.escapeHtml((String)request.getAttribute("document_text"));
+ }
+
+ if (document_text==null) {
+ document_text="";
+ }
+
+ String language = (String)session.getAttribute(SessionAttributes.LANGUAGE);
+
+ if (language!=null) {
+ if (language.equals("de")) {%>
+ <fmt:setLocale value="de"/>
+ <% } else { %>
+ <fmt:setLocale value="en"/>
+ <% }
+ }
+ else { %>
+ <fmt:setLocale value="de"/>
+ <% } %>
+
+ <title><fmt:message key="signpreview.title"/></title>
+ <meta name="decorator" content="production" />
+ <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"/>
+ <link rel="stylesheet" type="text/css" href="https://www.buergerkarte.at/pdf-as/css/pdfas-styles.css" />
+
+
+ <script language="javascript" type="text/javascript">
+
+ //Resize and reposition the IFrame when error happend within the IFrame
+ //(e.g. when Mobile BKU is called
+ //This function may not be actual anymore because the preview feature was not more needed
+ function moveErrorIFrame(object) {
+ var preview = document.getElementById('preview');
+ var signIframe = document.getElementById('signiframe');
+ var signIframeIntern = document.getElementById('signiframeintern');
+ var inhalt = document.getElementById('submitform');
+ var signButtons = document.getElementById('sign');
+
+ if (document.getElementById('heading2preview').style.display=='block') {
+ document.getElementById('heading2preview').style.display='none';
+ }
+ if (document.getElementById('heading2download').style.display=='block') {
+ document.getElementById('heading2download').style.display='none';
+ }
+ document.getElementById('heading2error').style.display='block';
+
+ document.getElementById('signpreviewnote').style.display='none';
+
+
+ var previewWidth = preview.offsetWidth;
+
+ inhalt.removeChild(preview);
+ inhalt.removeChild(signButtons);
+
+ signIframe.className='links';
+ signIframeIntern.className='linksinhalt';
+
+
+ document.getElementById('iframe').height = object.offsetHeight;
+ var abzugIFrameWidth = (previewWidth/94)*3*2;
+ document.getElementById('iframe').width = previewWidth - abzugIFrameWidth;
+
+ document.getElementById('downloadsignbuttons').style.display='block';
+ if (document.getElementById('backlink')) {
+ document.getElementById('backlink').style.display='none';
+ }
+ document.getElementById('signbacklink').style.display='none';
+ document.getElementById('localbku').style.display='none';
+ }
+
+ //Submit the hidden form when signing
+ function submitForm(button) {
+ if (button.name=='localbku') {
+ document.submitform.target = '_self';
+ }
+ else {
+ document.getElementById('sign').style.display='none';
+ document.getElementById('signiframe').style.display='block';
+ if (button.name == 'smartcard') {
+ document.getElementById('localbku').style.display = 'block';
+ }
+ else {
+ document.getElementById('iframe').height=250;
+ }
+ document.getElementById('backlink').style.display='none';
+ }
+
+ return (true);
+ }
+
+ //Deactivate the link to change language. This feature is just possible
+ //on the start page
+ function deactivateSprachlink() {
+ document.getElementById('sprachlink').style.display = 'none';
+ document.getElementById('sprachlinkdeaktiviert').style.display= 'block';
+ }
+
+ </script>
</head>
<body>
- <h1><fmt:message key="common.title"/></h1>
- <h2><fmt:message key="signpreview.heading2"/></h2>
- <%
- if (si.mode.equals(FormFields.VALUE_MODE_TEXTUAL)) {
- %>
- <form action="<%= submit_url %>" name="submitform" enctype="multipart/form-data" accept-charset="UTF-8" method="get">
- <pre class="pdfasnt"><%= document_text != null ? document_text : "" %></pre>
- <% if (Constants.SIGNATURE_DEVICE_BKU.equals(si.connector)) { %>
+ <h1 id="heading1preview" style="display:block"><fmt:message key="common.title"/></h1>
+ <h1 id="heading1download" style="display:none"><fmt:message key="download.title"/></h1>
+
+ <h2 id="heading2preview" style="display:block"><fmt:message key="signpreview.heading2"/></h2>
+ <h2 id="heading2download" style="display:none"><fmt:message key="download.heading2"/></h2>
+ <h2 id="heading2error" style="display:none"><fmt:message key="error.heading2"/></h2>
+ <div id="signpreviewnote" style="display:block">
+ <% if (FormFields.FIELD_MODE_TEXTUAL.contains(sign_mode)) { %>
+ <div><fmt:message key="signpreview.description.textual"/></div>
+ <% } else { %>
+ <div><fmt:message key="signpreview.description.binary"/></div>
+
+ <% } %>
+ </div>
+ <div class="pdfasverticalspace"></div>
+ <div id="inhalt">
+ <form name="submitform" id="submitform" method="post" action="<%= request.getContextPath() %>/Sign"
+ enctype="multipart/form-data" accept-charset="UTF-8" target="iframe">
+ <!-- Here just a preview hidden button is submitted with the form because the parameters
+ were already sent to the Servlet and put into session. This hidden button is to let the Servlet
+ distinguish between normal sign and sign with preview -->
+ <input type="hidden" name="<%= SignServlet.SUBMITFORM_PREVIEW %>" value="preview"/>
+ <div class="links" id="preview" style="display:block">
+ <div class="linksinhalt">
+ <% if (FormFields.VALUE_MODE_BINARY.equals(sign_mode)) { %>
+ <div><iframe src="<%=signature_data_url%>" width="400" height="200" title="Preview" scrolling="yes" frameborder="0"></iframe></div>
+ <% } else { %>
+ <div><iframe src="<%=signature_data_url%>" width="400" height="400" title="Preview" scrolling="no" frameborder="0"></iframe></div>
+ <% } %>
+ <div class="pdfasverticalspace"></div>
+ <% if (FormFields.VALUE_MODE_BINARY.equals(sign_mode)) {
+ if (language.equals("de")) { %>
+ <div><fmt:message key="signpreview.description.binary.notopened"/> <a href="<%=signature_data_url%>" target="_blank">hier</a> <fmt:message key="signpreview.description.binary.installplugin"/></div>
+ <% } else { %>
+ <div><fmt:message key="signpreview.description.binary.notopened"/> <a href="<%=signature_data_url%>" target="_blank">here</a> <fmt:message key="signpreview.description.binary.installplugin"/></div>
+ <% } %>
+ <div class="pdfasverticalspace"></div>
+ <% } %>
<div>
- <!-- =============================================== Start BKU-Erkennung -->
- <iframe src="bku-erkennung/bku-erkennung_iframe.html" width="152" height="57" id="sep_iframe" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" allowtransparency="true"></iframe>
- <!-- ================================================ Stop BKU-Erkennung -->
+ <a href="<%=contextPath%>/" id="backlink" style="display:block"><fmt:message key="common.back"/></a>
</div>
- <% } else if (Constants.SIGNATURE_DEVICE_MOC.equals(si.connector)) { %>
- <div>
- <img src="images/chiperling.jpg" width="57" height="57" alt="<fmt:message key="common.mocca"/>"/>
</div>
- <% } // end if %>
- <input type="submit" value="<fmt:message key="signpreview.button.sign"/>" />
- </form>
- <%
- } else {
- %>
- <div class="pdfasverticalspace"></div>
- <form action="<%= signature_data_url %>" method="get" target="blank_">
- <input type="submit" value="<fmt:message key="signpreview.showpreview"/>" />
- </form>
- <div class="pdfasverticalspace"></div>
- <% if (Constants.SIGNATURE_DEVICE_BKU.equals(si.connector)) { %>
- <div>
- <!-- =============================================== Start BKU-Erkennung -->
- <iframe src="bku-erkennung/bku-erkennung_iframe.html" width="152" height="57" id="sep_iframe" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" allowtransparency="true"></iframe>
- <!-- ================================================ Stop BKU-Erkennung -->
+ </div>
+ <div class="rechts" id="sign" style="display:block">
+ <div class="rechtsinhalt">
+ <div class="rechtslinks">
+ <img src="images/onlineBKU.png" alt="Chip-Karte" id="Karte" />
+ </div>
+ <div class="rechtsrechts">
+ <img src="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)"></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)"></input>
+ </div>
+ </div>
+ </div>
+ <div class="rechts" id="signiframe" style="display:none">
+ <div class="rechtsinhalt" id="signiframeintern">
+ <div><iframe id="iframe" src="jsp/please_wait.jsp" name="iframe" width="210" height="auto" scrolling="no" title="iframe" frameborder="0">
+ </iframe></div>
+ <div class="pdfasverticalspace"></div>
+ <div id="localbku" style="display:none; border-top:1px solid black; text-align:left;">
+ <input type="submit" name="<%= FormFields.FIELD_CONNECTOR_LOCALBKU %>" value="<fmt:message key="common.bku"/>" alt="Signatur mit lokaler BKU" onclick="return submitForm(this)"/>
+ <div class="linksnotesigblock"><fmt:message key="nullrequestpage.localbku.advice"/></div>
+ <div class="pdfasverticalspace"></div>
</div>
- <% } else if (Constants.SIGNATURE_DEVICE_MOC.equals(si.connector)) { %>
- <div>
- <img src="images/chiperling.jpg" width="57" height="57" alt="<fmt:message key="common.mocca"/>"/>
+ <div id="signbacklink" align="left" style="margin-left:5px;display:block"><a href="<%= request.getContextPath() %>/" target="_parent"><fmt:message key="common.cancel"/></a></div>
+ </div>
+ </div>
+ <div class="rechts" id="downloadsignbuttons" style="display:none">
+ <div class="rechtsinhalt">
+ <div class="rechtslinks">
+ <img src="images/onlineBKU.png" alt="Chip-Karte" id="Karte" />
</div>
- <% } // end if %>
- <form action="<%= submit_url %>" method="get">
- <input type="submit" value="<fmt:message key="signpreview.button.sign"/>" />
- </form>
- <%
- }
- %>
- <div class="pdfasverticalspace"></div>
- <a href="<%= request.getContextPath() %>/"><fmt:message key="common.back"/></a>
+ <div class="rechtsrechts">
+ <img src="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"></input>
+ </div>
+ <div class="rechtsrechts">
+ <input type="submit" name="<%= FormFields.FIELD_CONNECTOR_MOBILE %>" value="<fmt:message key="signupload.signwithmobile"/>" alt="Signatur mit Handy" disabled="disabled"></input>
+ </div>
+ </div>
+ </div>
+ </form>
+ </div>
+ <script language="javascript" type="text/javascript">
+ deactivateSprachlink();
+ </script>
</body>
-
-</html>
+</html> \ No newline at end of file