From f38a65ed16cd68024da49f913e2d6fea9cadbbe6 Mon Sep 17 00:00:00 2001 From: rpiazzi Date: Fri, 23 Sep 2011 15:08:57 +0000 Subject: Comprehensive changes due to reorganization of user interface. JavaScripts added for functionality and styling reasons. Instead of constructing IFrames for the CCS's the whole page is now called within the IFrame. Additionally it was introduced the possibility to visualize the page differently when the whole application is called within an IFrame from an external application (see also other jsp's). git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@820 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../src/main/webapp/jsp/null_request_page.jsp | 395 ++++++++++++++++++--- 1 file 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")) { %> + + <% } else { + german = false; %> + + <% } } -%> + else { %> + + <% } + String height = (String)session.getAttribute(SignServlet.HEIGHT_SIGN_DIV); + %> + + + + + + <% + //buergerkarte.at Template has to be shown in some cases + if ((isLocalBKU || isExternalInvocation) && (!startedFromIFrame)) { + if (german) { %> + + <% } else { %> + + <% } %> + + + + <% } %> + <fmt:message key="nullrequestpage.title"/> + + <% if (!startedFromIFrame) { %> + + + <% } else { %> + + <% } %> - + //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; + } - - <% if (!isExternalInvocation) { %> -

-

- <% } // 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'; + } + } + + --> + + + + + <% + //If whole application is not started from an IFrame within an external application (normal execution) + if (!startedFromIFrame) { %> + <% if (isServerBKU) { %> + +
+
+ + + + + + + + <% if (language != null) { %> + + <% } // end if %> +
+ <% if (!isExternalInvocation) { %> + + <% } else { %> + + <% } %> +
+ + <% } if (isMobileBKU) { %> + +
+
+ + + + + + <% if (language != null) { %> + + <% } // end if %> +
+ <% if (!isExternalInvocation) { %> + + <% } else { %> + + <% } %> +
+ + <% } + //If local BKU is choosed the whole page has to be shown + if (isLocalBKU) { + if (!isExternalInvocation) { %> + +

+ <% + if (testMode) { + %> + + <% } else { %> + + <% } // end if %> +

+ <% } %> + <% if (isExternalInvocation) { %> +
+ <% } else { %> +
+
+ <% } // end if %> +
+ +
+
+ +
+ Handy +
+ +
+ " alt="Signatur mit Handy" onclick="return submitForm(this)" disabled="disabled"> +
+
+
+
+ + + <% } %> + <% } + //If the application is called within an IFrame from an external application the + //display has to be different + else { %> + +
<% if (isServerBKU) { %> - <% if (!isExternalInvocation) { %> -
- <% } // end if %>
- <% if (locale != null) { %> - + <% if (language != null) { %> + <% } // end if %>
- <% if (!isExternalInvocation) { %> -
- - <% } else { // end if %> - - <% } // end if %> - - <% } else { %> - <% if (isExternalInvocation) { %> -
- <% } else { %> -
-
- <% } // end if %> -
+
+
+ + +
+
+
Alternativ dazu wählen Sie eine lokale BKU
+ + <% } if (isMobileBKU) { %> +
- <% if (locale != null) { %> - + + + <% if (language != null) { %> + <% } // end if %> - <% if (!isExternalInvocation) { %> - " /> +
+ + + <% } if (isLocalBKU) { %> +
+
+ + + <% if (language != null) { %> + <% } // end if %> + <% if (language !=null) { %> + <% if (language.equals("de")) { %> + + <% } else { %> + + <% } %> + <% } else { %> + + <% } %>
- <% } // end if %> - - <% if (!isExternalInvocation) { %> -
- - <% } // end if %> - - - + + <% } %> +
+ + + <% } %> -- cgit v1.2.3