From db52e4d66d60184d53a27ba4d6772461daacc03d Mon Sep 17 00:00:00 2001 From: tknall Date: Fri, 22 Mar 2013 08:57:51 +0000 Subject: Maintenance update (bugfixes, new features, cleanup...) Refer to /dok/RELEASE_NOTES-3.3.txt for further information. git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/pdf-as/trunk@931 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- pdf-as-web/src/main/webapp/META-INF/context.xml | 11 +- pdf-as-web/src/main/webapp/WEB-INF/decorators.xml | 9 +- pdf-as-web/src/main/webapp/WEB-INF/sitemesh.xml | 21 +- .../src/main/webapp/jsp/null_request_page.jsp | 7 +- .../src/main/webapp/sitemesh/buergerkarte_at.jsp | 227 ++++++++++++++++++++ pdf-as-web/src/main/webapp/sitemesh/standalone.jsp | 234 ++------------------- 6 files changed, 274 insertions(+), 235 deletions(-) create mode 100644 pdf-as-web/src/main/webapp/sitemesh/buergerkarte_at.jsp (limited to 'pdf-as-web/src/main/webapp') diff --git a/pdf-as-web/src/main/webapp/META-INF/context.xml b/pdf-as-web/src/main/webapp/META-INF/context.xml index a0de89e..6d79b26 100644 --- a/pdf-as-web/src/main/webapp/META-INF/context.xml +++ b/pdf-as-web/src/main/webapp/META-INF/context.xml @@ -1,9 +1,18 @@ - + + + + + + + diff --git a/pdf-as-web/src/main/webapp/WEB-INF/decorators.xml b/pdf-as-web/src/main/webapp/WEB-INF/decorators.xml index 6585f97..e1fff32 100644 --- a/pdf-as-web/src/main/webapp/WEB-INF/decorators.xml +++ b/pdf-as-web/src/main/webapp/WEB-INF/decorators.xml @@ -5,6 +5,11 @@ *.pdf /*.pdf - - + + + + + + \ No newline at end of file diff --git a/pdf-as-web/src/main/webapp/WEB-INF/sitemesh.xml b/pdf-as-web/src/main/webapp/WEB-INF/sitemesh.xml index c6653cc..cda7eb3 100644 --- a/pdf-as-web/src/main/webapp/WEB-INF/sitemesh.xml +++ b/pdf-as-web/src/main/webapp/WEB-INF/sitemesh.xml @@ -1,30 +1,27 @@ + + + - + + - - - - - - - + + + + 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 58442d6..5e992df 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 @@ -36,12 +36,13 @@ isLocalBKU = Constants.SIGNATURE_DEVICE_BKU.equals(ssi.connector); isMobileBKU = Constants.SIGNATURE_DEVICE_MOBILE.equals(ssi.connector); isMobileTest = Constants.SIGNATURE_DEVICE_MOBILETEST.equals(ssi.connector); - } else { + } else if (si instanceof VerifySessionInformation) { VerifySessionInformation vsi = (VerifySessionInformation) si; isExternalInvocation = vsi.exappinf != null; isServerBKU = Constants.SIGNATURE_DEVICE_MOC.equals(vsi.connector); - isLocalBKU = Constants.SIGNATURE_DEVICE_BKU.equals(ssi.connector); - isMobileBKU = Constants.SIGNATURE_DEVICE_MOBILE.equals(ssi.connector); + isLocalBKU = Constants.SIGNATURE_DEVICE_BKU.equals(vsi.connector); + isMobileBKU = Constants.SIGNATURE_DEVICE_MOBILE.equals(vsi.connector); + isMobileTest = Constants.SIGNATURE_DEVICE_MOBILETEST.equals(vsi.connector); } boolean testMode = request.getContextPath().startsWith("/test-"); diff --git a/pdf-as-web/src/main/webapp/sitemesh/buergerkarte_at.jsp b/pdf-as-web/src/main/webapp/sitemesh/buergerkarte_at.jsp new file mode 100644 index 0000000..4bb19ff --- /dev/null +++ b/pdf-as-web/src/main/webapp/sitemesh/buergerkarte_at.jsp @@ -0,0 +1,227 @@ + + +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %> + +<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> +<%@ page import="at.gv.egiz.pdfas.web.helper.LocalRequestHelper" %> + +<%@ page import="java.net.URL" %> +<%@ page import="java.net.URLConnection" %> +<%@ page import="java.io.InputStream" %> +<%@ page import="java.io.InputStreamReader" %> +<%@ page import="java.io.BufferedReader" %> +<%@ page import="net.htmlparser.jericho.Source" %> +<%@ page import="net.htmlparser.jericho.Element" %> +<%@ page import="net.htmlparser.jericho.Attributes" %> +<%@ page import="net.htmlparser.jericho.Attribute" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.Locale" %> +<%@ page import="at.gv.egiz.pdfas.web.i18n.LocaleParamFilter" %> +<%@ page import="java.nio.charset.Charset" %> +<%@ page import="at.gv.egiz.pdfas.web.session.SessionAttributes" %> + + +<%@page import="java.nio.charset.Charset"%> + + + + + + + <% + + String headerUrl="http://www.buergerkarte.at/header.php?lang="; + //String headerUrl="http://www.buergerkarte.at/header.php"; + String serverUrl=LocalRequestHelper.getLocalServerAddress(request,response); + String baseUrl=LocalRequestHelper.getLocalContextAddress(request,response); + + String requestLang = (String)session.getAttribute(SessionAttributes.LANGUAGE); + + String language = ""; + + URL urlHeader = new URL(headerUrl); + + if (requestLang!=null) { + if (requestLang.equals("de")) { + urlHeader = new URL(headerUrl+"de"); + language="de"; + } + else { + urlHeader = new URL(headerUrl+"en"); + language="en"; + } + } + else { + requestLang = request.getParameter("lang"); + if (requestLang!=null) { + if (requestLang.equals("de")) { + urlHeader = new URL(headerUrl+"de"); + language="de"; + } + else { + urlHeader = new URL(headerUrl+"en"); + language="en"; + } + } + else { + urlHeader = new URL(headerUrl+"de"); + language="de"; + } + } + + URLConnection ucHeader = urlHeader.openConnection(); + + InputStream isHeader = ucHeader.getInputStream(); + + //Read the header php files from the server + BufferedReader brHeader = new BufferedReader(new InputStreamReader(isHeader, Charset.forName("UTF-8"))); + + String phpLine=""; + String phpHeader=""; + while ((phpLine=brHeader.readLine())!=null) { + phpHeader += phpLine; + } + + phpHeader = phpHeader.substring(phpHeader.indexOf("Sie sind hier: Startseite > PDF-Signatur > PDF-Signatur \n"; + } + else { + replaceString = "
You are here: Start page > PDF-Signatures > PDF-Signature \n
"; + } + phpHeader = phpHeader.replace(breadcrumbsDiv, replaceString); + } + + + + //Insert a hidden language fake link, that is shown when the change of language is disabled + source = new Source(phpHeader); + + Element element = source.getElementById("sprachlinkneu"); + + if (element!=null) { + String languagelink; + int positionToInsertLangLink = 0; + int positionToEndLangLink = 0; + positionToInsertLangLink=element.getBegin(); + positionToEndLangLink=element.getEnd(); + if (!language.equals("de")) { + languagelink = "
  • Deutsch
  • "; + } + else { + languagelink = "
  • English
  • "; + } + String firstPart = phpHeader.substring(0, positionToInsertLangLink); + String secondPart = phpHeader.substring(positionToEndLangLink, phpHeader.length()); + phpHeader = firstPart+languagelink+secondPart; + } + else { + int positionToEnd=0; + list = source.getAllElements("li"); + it = list.iterator(); + int i=0; + while (it.hasNext()) { + element = (Element)it.next(); + if (i==5) { + positionToEnd = element.getEnd(); + } + i++; + } + String languagelink; + if (!language.equals("de")) { + languagelink = "
  • Deutsch
  • "; + } + else { + languagelink = "
  • English
  • "; + } + String firstPart = phpHeader.substring(0, positionToEnd); + String secondPart = phpHeader.substring(positionToEnd, phpHeader.length()); + phpHeader = firstPart+languagelink+secondPart; + } + + + + + %> + PDF Signature + + <% + if (language.equals("de")) { %> + + <% } else { %> + + <% } %> + + + + + + + + + + + <%= phpHeader %> + +
    + +
    + +
    + +
    +
    +
    + + + diff --git a/pdf-as-web/src/main/webapp/sitemesh/standalone.jsp b/pdf-as-web/src/main/webapp/sitemesh/standalone.jsp index 4bb19ff..4116890 100644 --- a/pdf-as-web/src/main/webapp/sitemesh/standalone.jsp +++ b/pdf-as-web/src/main/webapp/sitemesh/standalone.jsp @@ -1,227 +1,27 @@ - + +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%> + -<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> -<%@taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %> - -<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> +<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%> <%@ page import="at.gv.egiz.pdfas.web.helper.LocalRequestHelper" %> -<%@ page import="java.net.URL" %> -<%@ page import="java.net.URLConnection" %> -<%@ page import="java.io.InputStream" %> -<%@ page import="java.io.InputStreamReader" %> -<%@ page import="java.io.BufferedReader" %> -<%@ page import="net.htmlparser.jericho.Source" %> -<%@ page import="net.htmlparser.jericho.Element" %> -<%@ page import="net.htmlparser.jericho.Attributes" %> -<%@ page import="net.htmlparser.jericho.Attribute" %> -<%@ page import="java.util.List" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="java.util.Locale" %> -<%@ page import="at.gv.egiz.pdfas.web.i18n.LocaleParamFilter" %> -<%@ page import="java.nio.charset.Charset" %> -<%@ page import="at.gv.egiz.pdfas.web.session.SessionAttributes" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + -<%@page import="java.nio.charset.Charset"%> - - - - - - <% - - String headerUrl="http://www.buergerkarte.at/header.php?lang="; - //String headerUrl="http://www.buergerkarte.at/header.php"; - String serverUrl=LocalRequestHelper.getLocalServerAddress(request,response); - String baseUrl=LocalRequestHelper.getLocalContextAddress(request,response); - - String requestLang = (String)session.getAttribute(SessionAttributes.LANGUAGE); - - String language = ""; - - URL urlHeader = new URL(headerUrl); - - if (requestLang!=null) { - if (requestLang.equals("de")) { - urlHeader = new URL(headerUrl+"de"); - language="de"; - } - else { - urlHeader = new URL(headerUrl+"en"); - language="en"; - } - } - else { - requestLang = request.getParameter("lang"); - if (requestLang!=null) { - if (requestLang.equals("de")) { - urlHeader = new URL(headerUrl+"de"); - language="de"; - } - else { - urlHeader = new URL(headerUrl+"en"); - language="en"; - } - } - else { - urlHeader = new URL(headerUrl+"de"); - language="de"; - } - } - - URLConnection ucHeader = urlHeader.openConnection(); - - InputStream isHeader = ucHeader.getInputStream(); - - //Read the header php files from the server - BufferedReader brHeader = new BufferedReader(new InputStreamReader(isHeader, Charset.forName("UTF-8"))); - - String phpLine=""; - String phpHeader=""; - while ((phpLine=brHeader.readLine())!=null) { - phpHeader += phpLine; - } - - phpHeader = phpHeader.substring(phpHeader.indexOf("Sie sind hier: Startseite > PDF-Signatur > PDF-Signatur \n"; - } - else { - replaceString = "
    You are here: Start page > PDF-Signatures > PDF-Signature \n
    "; - } - phpHeader = phpHeader.replace(breadcrumbsDiv, replaceString); - } - - - - //Insert a hidden language fake link, that is shown when the change of language is disabled - source = new Source(phpHeader); - - Element element = source.getElementById("sprachlinkneu"); - - if (element!=null) { - String languagelink; - int positionToInsertLangLink = 0; - int positionToEndLangLink = 0; - positionToInsertLangLink=element.getBegin(); - positionToEndLangLink=element.getEnd(); - if (!language.equals("de")) { - languagelink = "
  • Deutsch
  • "; - } - else { - languagelink = "
  • English
  • "; - } - String firstPart = phpHeader.substring(0, positionToInsertLangLink); - String secondPart = phpHeader.substring(positionToEndLangLink, phpHeader.length()); - phpHeader = firstPart+languagelink+secondPart; - } - else { - int positionToEnd=0; - list = source.getAllElements("li"); - it = list.iterator(); - int i=0; - while (it.hasNext()) { - element = (Element)it.next(); - if (i==5) { - positionToEnd = element.getEnd(); - } - i++; - } - String languagelink; - if (!language.equals("de")) { - languagelink = "
  • Deutsch
  • "; - } - else { - languagelink = "
  • English
  • "; - } - String firstPart = phpHeader.substring(0, positionToEnd); - String secondPart = phpHeader.substring(positionToEnd, phpHeader.length()); - phpHeader = firstPart+languagelink+secondPart; - } - - - - - %> - PDF Signature - - <% - if (language.equals("de")) { %> - - <% } else { %> - - <% } %> - - - - - - - + + <fmt:message key="common.title" /> + - - <%= phpHeader %> - -
    - -
    - -
    - -
    -
    -
    - + + + + -- cgit v1.2.3