From 265c48462e817d198573861e9f348f5f4a301e73 Mon Sep 17 00:00:00 2001 From: netconomy Date: Fri, 17 Aug 2007 06:47:16 +0000 Subject: deprecated code git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@182 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../egiz/pdfas/web/helper/SignServletHelper.java | 43 ++++++++++++---------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java b/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java index 55e0051..cb30809 100644 --- a/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java +++ b/src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java @@ -3,6 +3,7 @@ */ package at.gv.egiz.pdfas.web.helper; +import java.io.FileInputStream; import java.io.IOException; import java.net.URL; @@ -20,6 +21,7 @@ import at.gv.egiz.pdfas.framework.signator.Signator; import at.gv.egiz.pdfas.web.SignSessionInformation; import at.knowcenter.wag.egov.egiz.PdfASID; import at.knowcenter.wag.egov.egiz.exceptions.PresentableException; +import at.knowcenter.wag.egov.egiz.framework.SignResult; import at.knowcenter.wag.egov.egiz.framework.signators.DetachedSignator_1_0_0; import at.knowcenter.wag.egov.egiz.sig.ConnectorFactory; import at.knowcenter.wag.egov.egiz.sig.connectors.Connector; @@ -27,6 +29,8 @@ import at.knowcenter.wag.egov.egiz.sig.connectors.ConnectorChooser; import at.knowcenter.wag.egov.egiz.sig.connectors.bku.SignSignatureObject; import at.knowcenter.wag.egov.egiz.web.FormFields; import at.knowcenter.wag.egov.egiz.web.LocalRequestHelper; +import at.knowcenter.wag.egov.egiz.web.PDFContainer; +import at.knowcenter.wag.egov.egiz.web.servlets.ProvidePDFServlet; /** * @author wprinz @@ -179,25 +183,26 @@ public class SignServletHelper else { // TODO @tzefferer: what is this code? - throw new RuntimeException("This has to be refactored."); -// SignResult sr = si.sign_result; -// byte[] signed_pdf = sr.getData(); -// PDFContainer entry = new PDFContainer(signed_pdf, si.exappinf.pdf_id); -// ProvidePDFServlet.signedDocuments.add(entry); -// -// // notify webapp... -// String invoke_url = si.exappinf.invoke_url; -// -// String providePDFServlet = "ProvidePDF"; -// String pdf_id = String.valueOf(si.exappinf.pdf_id); -// String session_id = si.exappinf.session_id; -// -// // build URL -// int ind = invoke_url.indexOf("?"); -// String query = invoke_url.substring(0, ind) + ";jsessionid=" + session_id + invoke_url.substring(ind) + "&" + FormFields.FIELD_PDF_URL + "=" + providePDFServlet + "&" + FormFields.FIELD_PDF_ID -// + "=" + pdf_id + "&" + FormFields.FIELD_FILE_LENGTH + "=" + signed_pdf.length; -// -// response.sendRedirect(query); + byte[] signed_pdf = new byte [(int)si.output.getFile().length()]; + FileInputStream fis = new FileInputStream(si.output.getFile()); + fis.read(signed_pdf); + fis.close(); + PDFContainer entry = new PDFContainer(signed_pdf, si.exappinf.pdf_id); + ProvidePDFServlet.signedDocuments.add(entry); + + // notify webapp... + String invoke_url = si.exappinf.invoke_url; + + String providePDFServlet = "ProvidePDF"; + String pdf_id = String.valueOf(si.exappinf.pdf_id); + String session_id = si.exappinf.session_id; + + // build URL + int ind = invoke_url.indexOf("?"); + String query = invoke_url.substring(0, ind) + ";jsessionid=" + session_id + invoke_url.substring(ind) + "&" + FormFields.FIELD_PDF_URL + "=" + providePDFServlet + "&" + FormFields.FIELD_PDF_ID + + "=" + pdf_id + "&" + FormFields.FIELD_FILE_LENGTH + "=" + signed_pdf.length; + + response.sendRedirect(query); } -- cgit v1.2.3