diff options
Diffstat (limited to 'pdf-as-web/src/main/webapp/sitemesh')
-rw-r--r-- | pdf-as-web/src/main/webapp/sitemesh/buergerkarte_at.jsp | 227 | ||||
-rw-r--r-- | pdf-as-web/src/main/webapp/sitemesh/standalone.jsp | 234 |
2 files changed, 244 insertions, 217 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> > <a href=\""+serverUrl+"pdf-signatur.de.php\">PDF-Signatur</a> > PDF-Signatur \n</div>";
+ }
+ else {
+ replaceString = "<div id=\"breadcrumbs\"><em>You are here:</em> <a href=\""+serverUrl+"index.en.php\"> Start page </a> > <a href=\""+serverUrl+"pdf-signatur.en.php\">PDF-Signatures</a> > 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ü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>
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 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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" %>
+<%@ 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"%>
+<html>
-<%@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> > <a href=\""+serverUrl+"pdf-signatur.de.php\">PDF-Signatur</a> > PDF-Signatur \n</div>";
- }
- else {
- replaceString = "<div id=\"breadcrumbs\"><em>You are here:</em> <a href=\""+serverUrl+"index.en.php\"> Start page </a> > <a href=\""+serverUrl+"pdf-signatur.en.php\">PDF-Signatures</a> > 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ü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" />
+ <!--
+ <link rel="stylesheet" type="text/css" href="<%=LocalRequestHelper.getLocalContextAddress(request, response)%>/css/pdfas-styles.css" />
+ -->
+ <title><fmt:message key="common.title" /></title>
+ <!--
+ <link rel="stylesheet" type="text/css" href="<%=LocalRequestHelper.getLocalContextAddress(request, response)%>/css/pdfas-standalone-styles.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>
+ <decorator:body/>
</body>
+
</html>
|