aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authornetconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-08-17 06:47:16 +0000
committernetconomy <netconomy@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-08-17 06:47:16 +0000
commit265c48462e817d198573861e9f348f5f4a301e73 (patch)
tree8f0d3553033ba1ea9b82d23792e13724f73962f6 /src/main
parent0e247f20c66256ad935ae18e3cb3f34a9582d125 (diff)
downloadpdf-as-3-265c48462e817d198573861e9f348f5f4a301e73.tar.gz
pdf-as-3-265c48462e817d198573861e9f348f5f4a301e73.tar.bz2
pdf-as-3-265c48462e817d198573861e9f348f5f4a301e73.zip
deprecated codeREL-2.50RC@186
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@182 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/web/helper/SignServletHelper.java43
1 files 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);
}