aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/webapp/sitemesh/buergerkarte_at.jsp
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2013-03-22 08:57:51 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2013-03-22 08:57:51 +0000
commitdb52e4d66d60184d53a27ba4d6772461daacc03d (patch)
treeb83e1024bc356dd9c612151082ccaa718781a524 /pdf-as-web/src/main/webapp/sitemesh/buergerkarte_at.jsp
parent725749c85e2c4a0dca235e7b89a5c3b2752e5d54 (diff)
downloadpdf-as-3-db52e4d66d60184d53a27ba4d6772461daacc03d.tar.gz
pdf-as-3-db52e4d66d60184d53a27ba4d6772461daacc03d.tar.bz2
pdf-as-3-db52e4d66d60184d53a27ba4d6772461daacc03d.zip
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
Diffstat (limited to 'pdf-as-web/src/main/webapp/sitemesh/buergerkarte_at.jsp')
-rw-r--r--pdf-as-web/src/main/webapp/sitemesh/buergerkarte_at.jsp227
1 files changed, 227 insertions, 0 deletions
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 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<%@ 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"%>
+
+ <html>
+ <head>
+
+ <script language="javascript" type="text/javascript">
+ //Submit the form when the change language button was hit
+ function submit() {
+ var file = document.submitform.source.options[0].selected;
+ if (file) {
+ document.changelanguage.source_mode.value='file';
+ }
+ else {
+ document.changelanguage.source_mode.value='text';
+ document.changelanguage.text.value=document.getElementById('freetext').value;
+ }
+ document.changelanguage.submit();
+ }
+ </script>
+
+ <%
+
+ 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("<body"), phpHeader.length());
+
+ Source source = new Source(phpHeader);
+ List list = source.getAllElements();
+ Iterator it = list.iterator();
+ while (it.hasNext()) {
+ Element element = (Element)it.next();
+
+ //Set the absolute path for each element with src or href
+ String attributeValueSrc = element.getAttributeValue("src");
+ String attributeValueHref = element.getAttributeValue("href");
+
+ if ((attributeValueSrc!=null) || (attributeValueHref!=null)) {
+
+ String attribute = "";
+
+ if ((attributeValueSrc!=null) && (attributeValueHref!=null)) {
+ phpHeader = phpHeader.replace(attributeValueSrc, serverUrl+attributeValueSrc);
+ phpHeader = phpHeader.replace(attributeValueHref, serverUrl+attributeValueHref);
+ }
+ else {
+ if (attributeValueSrc!=null) {
+ phpHeader = phpHeader.replace(attributeValueSrc, serverUrl+attributeValueSrc);
+ }
+ if (attributeValueHref!=null) {
+ phpHeader = phpHeader.replace(attributeValueHref, serverUrl+attributeValueHref);
+ }
+ }
+ }
+
+ }
+
+ //Insert sitemap
+ Element breadcrumbsDiv = source.getElementById("breadcrumbs");
+ if (breadcrumbsDiv!=null) {
+ String replaceString = "";
+ if (language.equals("de")) {
+ replaceString = "<div id=\"breadcrumbs\"><em>Sie sind hier:</em> <a href=\""+serverUrl+"index.de.php\"> Startseite </a> &gt; <a href=\""+serverUrl+"pdf-signatur.de.php\">PDF-Signatur</a> &gt; PDF-Signatur \n</div>";
+ }
+ else {
+ replaceString = "<div id=\"breadcrumbs\"><em>You are here:</em> <a href=\""+serverUrl+"index.en.php\"> Start page </a> &gt; <a href=\""+serverUrl+"pdf-signatur.en.php\">PDF-Signatures</a> &gt; PDF-Signature \n</div>";
+ }
+ 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 = "<li id=\"sprachlinkneu\"><a href=\"#\" onclick=\"submit()\" hreflang=\"de\">Deutsch</a></li>";
+ }
+ else {
+ languagelink = "<li id=\"sprachlinkneu\"><a href=\"#\" onclick=\"submit()\" hreflang=\"en\">English</a></li>";
+ }
+ 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 = "<li id=\"sprachlinkneu\"><a href=\"#\" onclick=\"submit()\" hreflang=\"de\">Deutsch</a></li>";
+ }
+ else {
+ languagelink = "<li id=\"sprachlinkneu\"><a href=\"#\" onclick=\"submit()\" hreflang=\"en\">English</a></li>";
+ }
+ String firstPart = phpHeader.substring(0, positionToEnd);
+ String secondPart = phpHeader.substring(positionToEnd, phpHeader.length());
+ phpHeader = firstPart+languagelink+secondPart;
+ }
+
+
+
+
+ %>
+ <title>PDF Signature</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <%
+ if (language.equals("de")) { %>
+ <meta http-equiv="Content-Language" content="de" />
+ <% } else { %>
+ <meta http-equiv="Content-Language" content="en" />
+ <% } %>
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <meta name="Description" content="B&uuml;rgerkarte" />
+ <meta name="Keywords" content="Citizen Card, Austrian Citizen Card, Citizen Card Austria" />
+ <decorator:head/>
+ <link rel="stylesheet" type="text/css" href="<%=baseUrl %>/css/pdfas-styles.css" />
+ <link rel="shortcut icon" href="<%=serverUrl %>dateien/favicon.ico" type="image/vnd.microsoft.icon" />
+ <link rel="stylesheet" href="<%=serverUrl %>style.css" type="text/css" />
+ </head>
+
+ <%= phpHeader %>
+ <!-- mitte -->
+ <div id="mitte">
+ <!-- inhalt -->
+ <div class="inhalt" id="inhalt">
+ <!-- pdfas-container -->
+ <div id="pdfas-container">
+ <decorator:body/>
+ </div><!-- pdfas-container -->
+ </div><!-- inhalt -->
+ </div><!-- mitte -->
+ </div>
+ </body>
+</html>