From 168477fe312474c95e326383f8c101247a6f206f Mon Sep 17 00:00:00 2001 From: afitzek Date: Mon, 9 Jul 2012 14:24:21 +0000 Subject: Supported EID git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@920 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- pdf-as-web/src/main/webapp/jsp/supportedEID.jsp | 190 ++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 pdf-as-web/src/main/webapp/jsp/supportedEID.jsp (limited to 'pdf-as-web/src/main/webapp/jsp/supportedEID.jsp') diff --git a/pdf-as-web/src/main/webapp/jsp/supportedEID.jsp b/pdf-as-web/src/main/webapp/jsp/supportedEID.jsp new file mode 100644 index 0000000..b9d3ed0 --- /dev/null +++ b/pdf-as-web/src/main/webapp/jsp/supportedEID.jsp @@ -0,0 +1,190 @@ +<%@page import="at.gv.egiz.pdfas.web.session.SessionAttributes"%> +<%@ page import="org.apache.commons.lang.StringEscapeUtils"%> +<%@ page import="at.gv.egiz.pdfas.api.commons.Constants"%> +<%@ page import="at.gv.egiz.pdfas.web.i18n.LanguageDecoratorMapper"%> +<%@ page import="org.apache.commons.lang.BooleanUtils"%> +<%@ page import="at.gv.egiz.pdfas.web.i18n.LocaleParamFilter"%> +<%@ page import="java.util.Locale"%> +<%@ page import="at.gv.egiz.pdfas.web.helper.LocalRequestHelper"%> + +<%@ include file="/jsp/language.jsp"%> + + + + + + +<% + + String sessionLang = null; + + //When Change Language link is hit, three parameters are passed with a hidden form + //so that the settings keep the same. Check if this parameters are passed... + String source_mode_request = (String)request.getParameter("source_mode"); + String text_request = (String)request.getParameter("text"); + String lang_request = (String)request.getParameter("newlanguage"); + + if (lang_request!=null) { + if (lang_request.equals("de")) { + session.setAttribute(SessionAttributes.LANGUAGE, "de"); + } + else { + session.setAttribute(SessionAttributes.LANGUAGE, "en"); + } + } + + String serverUrl=LocalRequestHelper.getLocalServerAddress(request,response); + String baseUrl=LocalRequestHelper.getLocalContextAddress(request,response); + + //Check if application is started within an iframe from an extern application + String extern = (String)request.getParameter("extern"); + boolean startedFromIFrame = false; + + if (extern !=null) { + if (extern.equals("yes")) { + startedFromIFrame = true; + } + } + + String requestLang = (String)request.getParameter("locale"); + sessionLang = (String)session.getAttribute(SessionAttributes.LANGUAGE); + String language = ""; + + //If language within session... + if (sessionLang!=null) { + //But if language also changed by clicking the change language link + //or passed as parameter with the URL... + if (requestLang!=null) { + //If language has changed, change it also within session + if (!sessionLang.equals(requestLang)) { + session.setAttribute(SessionAttributes.LANGUAGE, requestLang); + } + //else do nothing + } + //else no change + } + //Else still no language within session + else { + //But if language changed by clicking the change language link + //or passed as parameter with the URL... + if (requestLang!=null) { + if (requestLang.equals("de")) { + session.setAttribute(SessionAttributes.LANGUAGE,"de"); + } + else { + session.setAttribute(SessionAttributes.LANGUAGE,"en"); + } + } + //No language here. Set to german + else { + session.setAttribute(SessionAttributes.LANGUAGE,"de"); + } + } + + language = (String)session.getAttribute(SessionAttributes.LANGUAGE); + + boolean german = true; + + if (language != null) { + if (language.equals("en")) { + german = false; + } + } + + if (german) { +%> + +<% + } else { +%> + +<% + } +%> + + + <fmt:message key="supported.EID.title"/> + + +<% + //If application called within an IFrame from an external application + //choose template and set session attribute + if (!startedFromIFrame) { + session.setAttribute("extern", "no"); + if (german) { + %> + + + <% } else { %> + + + <% } + } else { + session.setAttribute("extern", "yes"); + %> + + <% } %> + + <% if ((serverUrl.contains("http")) && (!serverUrl.contains("https")) && (!serverUrl.contains("localhost"))) { + baseUrl = baseUrl.replace("http","https"); %> + + <% } %> + + + + +

+ +

+
+ + + + +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + <% if(german) { %> +
  • +
  • + <% } else { %> +
  • +
  • + <% } %> +
  • +
+
+
+
+ +
+
+ + +
+ <% if (german) { %> + + <% } else { %> + + <% } %> + + +
+ + + + + \ No newline at end of file -- cgit v1.2.3