<%@ page import="at.knowcenter.wag.egov.egiz.web.FormFields" %> <%@ page import="at.knowcenter.wag.egov.egiz.web.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="at.knowcenter.wag.egov.egiz.web.servlets.UpdateFormServlet"%> <%@ 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);"/>