From 11b5950be66bcc9d6f0bb28d3fc9d211bc70f4d9 Mon Sep 17 00:00:00 2001 From: tknall Date: Tue, 16 Mar 2010 12:07:29 +0000 Subject: Catching OutOfMemory exceptions, returning appropriate error message/code Binary signature: bug concerning indirect pdf objects fixed SignaturePositioning improved (Signature position can be declared by String which is parsed) Some more error codes (Out of memory, Invalid signature position) iText utility for creation of pdf files added ConfigUtils updated (destination of configuration to be extracted can now be chosen) PDFASUtils updated (more tools) WebApplication: Freetext pdf creation implemented WebApplication: XSS security updates git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@580 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/webapp/jsp/signupload.jsp | 90 +++++++++++++++++++++++++++++++++----- 1 file changed, 79 insertions(+), 11 deletions(-) (limited to 'src/main/webapp/jsp/signupload.jsp') diff --git a/src/main/webapp/jsp/signupload.jsp b/src/main/webapp/jsp/signupload.jsp index 010012b..f6c02fe 100644 --- a/src/main/webapp/jsp/signupload.jsp +++ b/src/main/webapp/jsp/signupload.jsp @@ -1,5 +1,6 @@ <%@ 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"%> @@ -41,18 +42,35 @@ updateform.<%= FormFields.FIELD_MODE %>.value = submitform.<%= FormFields.FIELD_MODE %>.value; updateform.<%= FormFields.FIELD_CONNECTOR %>.value = submitform.<%= FormFields.FIELD_CONNECTOR %>.value; updateform.<%= FormFields.FIELD_PDFA_ENABLED %>.value = (submitform.<%= FormFields.FIELD_PDFA_ENABLED %>.checked == true); + updateform.<%= FormFields.FIELD_SOURCE %>.value = submitform.<%= FormFields.FIELD_SOURCE %>.value; + if (submitform.<%= FormFields.FIELD_FREETEXT %>) { + updateform.<%= FormFields.FIELD_FREETEXT %>.value = submitform.<%= FormFields.FIELD_FREETEXT %>.value; + } updateform.submit(); return(false); } function submitForm(preview) { var submitform = document.getElementById('submitform'); - if (!submitform.fileupload.value) { - if (preview) { - alert(''); - } else { - alert(''); + if (submitform.fileupload) { + // file + if (!submitform.fileupload.value) { + if (preview) { + alert(''); + } else { + alert(''); + } + return(false); + } + } else { + // freetext + if (!submitform.freetext.value) { + if (preview) { + alert(''); + } else { + alert(''); + } + return(false); } - return(false); } if (preview) { submitform.<%= FormFields.FIELD_PREVIEW %>.value='true'; @@ -118,6 +136,21 @@ } } 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); %> @@ -131,13 +164,29 @@ <% } // end if %> -

-
-
+

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

+
+ <% if (freeText) { %> + + <% } else { %> + + <% } %> +
+ - + + + <% if (freeText) { %> + + <% } // end if %>
+ + + + + + + <% if (freeText) { %> + + <% } else { %> + + <% } // end if freetext %> + + -
: <% if (pdfa) { %><% } %>
+
+ : <% if (!freeText) { %><% } %> <% if (pdfa) { %><% } %> +
-- cgit v1.2.3