From cab296807aff9ebdcede482562c6cf68e5732787 Mon Sep 17 00:00:00 2001 From: tknall Date: Mon, 24 Jan 2011 20:34:26 +0000 Subject: - signature block preview updated - added maven2 repository git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@729 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- pdf-as-web/maven2-repository/maven2-repository.zip | Bin 0 -> 21841887 bytes pdf-as-web/pom.xml | 10 +- .../egiz/pdfas/web/helper/SignServletHelper.java | 16 ++++ .../at/gv/egiz/pdfas/web/servlets/SignServlet.java | 8 +- .../pdfas/web/session/SignSessionInformation.java | 9 +- pdf-as-web/src/main/webapp/jsp/SIGNATURBLOCK.jsp | 10 +- .../main/webapp/jsp/SIGNATURBLOCK_DEPRECATED.jsp | 103 +++++++++++++++++++++ 7 files changed, 148 insertions(+), 8 deletions(-) create mode 100644 pdf-as-web/maven2-repository/maven2-repository.zip create mode 100644 pdf-as-web/src/main/webapp/jsp/SIGNATURBLOCK_DEPRECATED.jsp diff --git a/pdf-as-web/maven2-repository/maven2-repository.zip b/pdf-as-web/maven2-repository/maven2-repository.zip new file mode 100644 index 0000000..a4cd0fd Binary files /dev/null and b/pdf-as-web/maven2-repository/maven2-repository.zip differ diff --git a/pdf-as-web/pom.xml b/pdf-as-web/pom.xml index fa41411..b7464d6 100644 --- a/pdf-as-web/pom.xml +++ b/pdf-as-web/pom.xml @@ -10,7 +10,6 @@ pdf-as-web PDF-AS-WEB 3.2-SNAPSHOT - Webapplikation zur Amtssignatur fuer elektronische Aktenfuehrung http://egovlabs.gv.at/projects/pdf-as @@ -131,6 +130,15 @@ + + maven-assembly-plugin + + + src/main/assembly/assemble_repository.xml + + + + maven-javadoc-plugin diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java index 925df3a..dd0e876 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java @@ -18,6 +18,8 @@ import org.apache.commons.logging.LogFactory; import at.gv.egiz.pdfas.api.PdfAs; import at.gv.egiz.pdfas.api.commons.Constants; +import at.gv.egiz.pdfas.api.commons.DynamicSignatureLifetimeEnum; +import at.gv.egiz.pdfas.api.commons.DynamicSignatureProfile; import at.gv.egiz.pdfas.api.exceptions.PdfAsException; import at.gv.egiz.pdfas.api.internal.PdfAsInternal; import at.gv.egiz.pdfas.api.io.DataSink; @@ -77,6 +79,20 @@ public class SignServletHelper DataSink sink = new ByteArrayDataSink(); signParameters.setOutput(sink); + /* // dynamically switch to pdf/a + if (si.pdfa) { + DynamicSignatureProfile dsp = pdfAs.createDynamicSignatureProfile( + signParameters.getSignatureProfileId(), + DynamicSignatureLifetimeEnum.AUTO + ); + dsp.setPropertyRaw("key.SIG_PDFA1B_VALID", "true"); + dsp.setPropertyRaw("table.main.Style.font", "TTF:DejaVuSansCondensed.ttf,8"); + dsp.setPropertyRaw("table.main.Style.valuefont", "TTF:DejaVuSansMono.ttf,8"); + dsp.apply(); + signParameters.setSignatureProfileId(dsp.getName()); + } + */ + SignatureDetailInformation signatureDetail = pdfAs.prepareSign(signParameters); si.sdi = signatureDetail; si.signParameters = signParameters; diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java index 45f7e8f..620a738 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/SignServlet.java @@ -213,6 +213,7 @@ public class SignServlet extends HttpServlet si.type = ud.sig_type; si.filename = formatFileName(ud.file_name); si.download_inline = ud.download_inline; + si.pdfa = ud.pdfa; // added tzefferer: si.exappinf = exappinf; @@ -397,6 +398,9 @@ public class SignServlet extends HttpServlet { preview = true; } + + boolean pdfaEnabled = pdfa != null && "true".equalsIgnoreCase(pdfa.getString()); + boolean download_inline = true; if (download_fi.getString("UTF-8").equals(FormFields.VALUE_DOWNLOAD_ATTACHMENT)) //$NON-NLS-1$ @@ -438,7 +442,6 @@ public class SignServlet extends HttpServlet } else { log.debug("Processing free text."); try { - boolean pdfaEnabled = pdfa != null && "true".equalsIgnoreCase(pdfa.getString()); byte[] freeTextPDF = IText.createPDF(freeText.getString("UTF-8"), pdfaEnabled); pdfDataSource = new ByteArrayPdfDataSource(freeTextPDF); @@ -455,6 +458,7 @@ public class SignServlet extends HttpServlet UploadedData ud = new UploadedData(); ud.preview = preview; + ud.pdfa = pdfaEnabled; ud.download_inline = download_inline; ud.sig_type = sig_type; ud.sig_app = sig_app; @@ -575,6 +579,8 @@ public class SignServlet extends HttpServlet { protected boolean preview = false; + protected boolean pdfa = false; + protected boolean download_inline = false; protected String sig_type = null; diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/session/SignSessionInformation.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/session/SignSessionInformation.java index 90378d9..0b6a4d3 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/session/SignSessionInformation.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/session/SignSessionInformation.java @@ -78,7 +78,7 @@ public class SignSessionInformation implements HttpSessionBindingListener, Seria * @author: Thomas Zefferer */ public ExternAppInformation exappinf; - + /** * Information about the signature position * @@ -86,6 +86,13 @@ public class SignSessionInformation implements HttpSessionBindingListener, Seria */ public SignaturePositioning pos; + /** + * true if pdf/a is enabled + * + * @author tknall + */ + public boolean pdfa; + /** * The SignatureDetailInformation. */ diff --git a/pdf-as-web/src/main/webapp/jsp/SIGNATURBLOCK.jsp b/pdf-as-web/src/main/webapp/jsp/SIGNATURBLOCK.jsp index 6a1ce81..72edfac 100644 --- a/pdf-as-web/src/main/webapp/jsp/SIGNATURBLOCK.jsp +++ b/pdf-as-web/src/main/webapp/jsp/SIGNATURBLOCK.jsp @@ -61,14 +61,10 @@ - Signatur-Logo + Signatur-Logo <%= sbName %> " readonly="readonly" disabled="disabled" size="40" maxlength="255"/> - - <%= sbDate %> - <%= DateFormatUtils.formatUTC(new Date(), "yyyy-MM-dd'T'HH:mm:ss'Z'", request.getLocale()) %> - <%= sbIssuer %> @@ -99,5 +95,9 @@ <%= sbMeta %> <%= sbMetaValue %> + + <%= sbDate %> + <%= DateFormatUtils.formatUTC(new Date(), "yyyy-MM-dd'T'HH:mm:ss'Z'", request.getLocale()) %> + \ No newline at end of file diff --git a/pdf-as-web/src/main/webapp/jsp/SIGNATURBLOCK_DEPRECATED.jsp b/pdf-as-web/src/main/webapp/jsp/SIGNATURBLOCK_DEPRECATED.jsp new file mode 100644 index 0000000..6a1ce81 --- /dev/null +++ b/pdf-as-web/src/main/webapp/jsp/SIGNATURBLOCK_DEPRECATED.jsp @@ -0,0 +1,103 @@ +<%@ page contentType="text/html; charset=UTF-8" language="java" errorPage=""%> + +<%@ page import="org.apache.commons.lang.time.DateFormatUtils" %> +<%@ page import="java.util.Date" %> +<%@ page import="at.gv.egiz.pdfas.api.commons.Constants" %> +<%@ page import="at.gv.egiz.pdfas.web.servlets.UpdateFormServlet"%> +<%@ page import="at.gv.egiz.pdfas.web.FormFields" %> + +<%@ include file="language.jsp" %> + + <% + String mode = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_MODE_KEY); + String device = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_DEVICE_KEY); + String type = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_TYPE_KEY); + + String sbValue; + String sbLabel; + String sbMeta; + String sbName; + String sbDate; + String sbIssuer; + String sbNumber; + String sbKZ; + String sbID; + String sbMetaValue; + if ("SIGNATURBLOCK_DE".equals(type)) { + sbValue = "Signaturwert"; + sbLabel = "signatur-logo_de-100.png"; + sbMetaValue = "Informationen zur Prüfung der elektronischen Signatur und des Ausdrucks finden Sie unter: "; + sbName = "Unterzeichner"; + sbDate = "Datum/Zeit-UTC"; + sbIssuer = "Aussteller-Zertifikat"; + sbNumber = "Serien-Nr."; + sbKZ = "Methode"; + sbID = "Parameter"; + sbMeta = "Prüfinformation"; + } else { + sbValue = "Signature Value"; + sbLabel = "signatur-logo_en-100.png"; + sbMetaValue = "Information about the verification of the electronic signature and of the printout can be found at: "; + sbName = "Signatory"; + sbDate = "Date/Time-UTC"; + sbIssuer = "Issuer-Certificate"; + sbNumber = "Serial-No."; + sbKZ = "Method"; + sbID = "Parameter"; + sbMeta = "Verification"; + } + + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<%= sbValue %> +
Aqs3vMeF81wm/UJjIcLOzUs9
+
dxTBzhi2RC8avQyMAmc3v
+
WEj9HT1DI3iish4smRr
+
Signatur-Logo<%= sbName %>" readonly="readonly" disabled="disabled" size="40" maxlength="255"/>
<%= sbDate %><%= DateFormatUtils.formatUTC(new Date(), "yyyy-MM-dd'T'HH:mm:ss'Z'", request.getLocale()) %>
<%= sbIssuer %> +
CN=,
+
O=,
+
C=AT
+
<%= sbNumber %>123456
<%= sbKZ %> +
urn:pdfsigfilter:
+
bka.gv.at:
+
<%= FormFields.VALUE_MODE_TEXTUAL.equals(mode) ? "text:v1.2.0" : "binaer:v1.1.0" %>
+
<%= sbID %> +
etsi-moc-1.1@dbc17c36
+
<%= sbMeta %><%= sbMetaValue %>
+ \ No newline at end of file -- cgit v1.2.3