From 29ad090c29567ff1a4d3a2ec9b8ad0b5d80ee24d Mon Sep 17 00:00:00 2001 From: pdanner Date: Mon, 6 Dec 2010 16:34:52 +0000 Subject: git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@671 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- pdf-as-web/src/main/webapp/jsp/signupload.jsp | 296 ++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 pdf-as-web/src/main/webapp/jsp/signupload.jsp (limited to 'pdf-as-web/src/main/webapp/jsp/signupload.jsp') diff --git a/pdf-as-web/src/main/webapp/jsp/signupload.jsp b/pdf-as-web/src/main/webapp/jsp/signupload.jsp new file mode 100644 index 0000000..9bc675f --- /dev/null +++ b/pdf-as-web/src/main/webapp/jsp/signupload.jsp @@ -0,0 +1,296 @@ +<%@page import="at.gv.egiz.pdfas.web.servlets.UpdateFormServlet"%> +<%@page import="at.gv.egiz.pdfas.web.FormFields"%> +<%@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"%> + + + +<%@ include file="language.jsp" %> + + + + <% + boolean testMode = request.getContextPath().startsWith("/test-"); + boolean forceTextualForMocca = false; + + final String SIGNATUREPROFILE_DE_nonPDFa = "SIGNATURBLOCK_DE"; + final String SIGNATUREPROFILE_EN_nonPDFa = "SIGNATURBLOCK_EN"; + final String SIGNATUREPROFILE_DE_PDFa = "SIGNATURBLOCK_DE_PDFA"; + final String SIGNATUREPROFILE_EN_PDFa = "SIGNATURBLOCK_EN_PDFA"; + + %> + + <% + if (testMode) { + %> + <fmt:message key="test.common.title"/> + <% } else { %> + <fmt:message key="common.title"/> + <% } // end if %> + + <% session.removeAttribute(SessionAttributes.SIGNED_PDF_DOCUMENT); %> + + <% + // PRESETS + // signature device + String device = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_DEVICE_KEY); + if (device == null) { + device = Constants.SIGNATURE_DEVICE_MOC; + session.setAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_DEVICE_KEY, device); + } + // signature mode + String mode = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_MODE_KEY); + if (forceTextualForMocca && Constants.SIGNATURE_DEVICE_MOC.equals(device)) { + mode = FormFields.VALUE_MODE_TEXTUAL; + session.setAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_MODE_KEY, mode); + } + if (mode == null) { + mode = FormFields.VALUE_MODE_BINARY; + session.setAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_MODE_KEY, mode); + } + + // PDF/A-1b + boolean pdfa = BooleanUtils.toBoolean((String) session.getAttribute(UpdateFormServlet.UPLOADFORM_PDFA_KEY)); + String TYPE_EN; + String TYPE_DE; + if (pdfa) { + TYPE_EN = SIGNATUREPROFILE_EN_PDFa; + TYPE_DE = SIGNATUREPROFILE_DE_PDFa; + } else { + TYPE_EN = SIGNATUREPROFILE_EN_nonPDFa; + TYPE_DE = SIGNATUREPROFILE_DE_nonPDFa; + } + + // signature type + String type = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_TYPE_KEY); + if (type == null) { + Locale locale = (Locale) session.getAttribute(LocaleParamFilter.LOCALE_SESSION_KEY); + if (locale == null) { + locale = request.getLocale(); + } + type = Locale.GERMAN.getLanguage().equals(locale.getLanguage()) ? TYPE_DE : TYPE_EN; + } else { + if (pdfa) { + if (SIGNATUREPROFILE_DE_nonPDFa.equals(type)) { + type = SIGNATUREPROFILE_DE_PDFa; + } else if (SIGNATUREPROFILE_EN_nonPDFa.equals(type)) { + type = SIGNATUREPROFILE_EN_PDFa; + } + } else { + if (SIGNATUREPROFILE_DE_PDFa.equals(type)) { + type = SIGNATUREPROFILE_DE_nonPDFa; + } else if (SIGNATUREPROFILE_EN_PDFa.equals(type)) { + type = SIGNATUREPROFILE_EN_nonPDFa; + } + } + } + session.setAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_TYPE_KEY, type); + + // source + String source = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SOURCE_KEY); + if (source == null) { + source = FormFields.VALUE_SOURCE_FILE; + } + session.setAttribute(UpdateFormServlet.UPLOADFORM_SOURCE_KEY, source); + boolean freeText = FormFields.VALUE_SOURCE_FREETEXT.equals(source); + + // freetext + String freeTextValue = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_FREETEXT_KEY); + if (freeTextValue == null) { + freeTextValue = ""; + } + session.setAttribute(UpdateFormServlet.UPLOADFORM_FREETEXT_KEY, freeTextValue); + + %> + + +

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

+

+ <% if (freeText) { %> + + <% } else { %> + + <% } %> +

+
+ <% if (freeText) { %> + + <% } else { %> + + <% } %> +
+
+ + + + + + <% if (freeText) { %> + + <% } // end if %> +
+
+ + + + + + + + + + + + + + + + + + +
+ + + + onclick="return updateForm();"/>  +
+ <% if (forceTextualForMocca && Constants.SIGNATURE_DEVICE_MOC.equals(device)) {%> + + + <% } else { %> + + <% } %> +
+ +
+ + + <% if (freeText) { %> + + <% } else { %> + + <% } // end if freetext %> +
+ <% if ((!freeText && (FormFields.VALUE_MODE_TEXTUAL.equals(mode))) || pdfa) { %> +
+ : + <% if ((FormFields.VALUE_MODE_TEXTUAL.equals(mode))) { %> + <% if (!freeText) { %><% } %> + <% } // end if %> + <% if (pdfa) { %> <% } %> +
+ <% } // end if %> + + + + +
+ + + +
+ <% if (Constants.SIGNATURE_DEVICE_BKU.equals(device)) { %> +
+ + + +
+ <% } else if (Constants.SIGNATURE_DEVICE_MOC.equals(device)) { %> +
+ <fmt:message key="/> +
+ <% } else { %> +
+ <% } // end if %> +
+ " onclick="return submitForm(false);"/> + " onclick="return submitForm(true);"/> +
+ + + + + -- cgit v1.2.3