RE: Can cocoon write pdf to a file?
Can you supply a link to this discussion/anwer? [EMAIL PROTECTED] 16/08/2002 12:20:57 This has been answered in the archives. I used the pdf transformer and saved the output stream to a file. TA -Original Message- From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:07 PM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? you should check the archives - i'm pretty sure this has been answered a lot. Think you'll want SourceWritingTransformer from Cocoon 2.1 dev (cvs check out from HEAD) Geoff -Original Message- From: kyle koss [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 1:54 PM To: [EMAIL PROTECTED] Subject: Can cocoon write pdf to a file? Is it possible for Cocoon to do an XML+XSL - PDF transformation, but instead of serving the PDF into the browser, writing it to a file? What I would like to do is, take information entered into a form on a jsp page, turn it into an XML file, and then apply my XSL to it to produce a PDF which is then stored to disk on the server. Can this be done using Cocoon, or would it be easier to just use FOP embedded in a servlet? If it can be done, what do I have to do? Regards, Kyle Koss - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
All, Sorry, mentioned the wrong transformer earlier. Used stream generator, posted xml, saved to file. See code below. JAVA CLASS: URL url = new URL(http://path/xml2pdf.pdf;); HttpURLConnection httpConn = null; try { httpConn = (HttpURLConnection)url.openConnection(); httpConn.setDoInput(true); httpConn.setDoOutput(true); httpConn.setRequestMethod(POST); httpConn.setUseCaches(false); httpConn.setDefaultUseCaches(false); httpConn.setRequestProperty(content-type,application/x-www-form-urlen coded); httpConn.setRequestProperty(content-length,String.valueOf(xml_os.size( ))); PrintWriter pw = new PrintWriter(httpConn.getOutputStream()); String content = Foo= + URLEncoder.encode(new String(xml_os.toByteArray()),UTF-8); pw.println(content); pw.close(); InputStream is = httpConn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); byte[] buff = new byte[512]; ByteArrayOutputStream bos = new ByteArrayOutputStream(); String line = null; int len = 0; while( (len=bis.read(buff)) != -1) { bos.write(buff, 0, len); } bis.close(); String fileName = out.pdf; FileOutputStream fos = null; File file = null; try { file = new File(fileName); fos = new FileOutputStream(file); fos.write(bos.toByteArray()); } catch (IOException ioe) { System.out.println(Exception Caught: Creating .pdf File); ioe.printStackTrace(); } finally { if (fos!=null) { fos.close(); } } System.out.println(* FILE CREATED: +fileName+ *); SITEMAP.XMAP : map:match pattern=*.pdf map:generate type=stream map:parameter name=form-name value=Foo/ /map:generate map:transform type=xslt src=doc2pdf.xsl/ map:serialize type=fo2pdf/ /map:match -Original Message- From: Derek Hohls [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 1:50 AM To: [EMAIL PROTECTED] Subject: RE: Can cocoon write pdf to a file? Can you supply a link to this discussion/anwer? [EMAIL PROTECTED] 16/08/2002 12:20:57 This has been answered in the archives. I used the pdf transformer and saved the output stream to a file. TA -Original Message- From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:07 PM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? you should check the archives - i'm pretty sure this has been answered a lot. Think you'll want SourceWritingTransformer from Cocoon 2.1 dev (cvs check out from HEAD) Geoff -Original Message- From: kyle koss [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 1:54 PM To: [EMAIL PROTECTED] Subject: Can cocoon write pdf to a file? Is it possible for Cocoon to do an XML+XSL - PDF transformation, but instead of serving the PDF into the browser, writing it to a file? What I would like to do is, take information entered into a form on a jsp page, turn it into an XML file, and then apply my XSL to it to produce a PDF which is then stored to disk on the server. Can this be done using Cocoon, or would it be easier to just use FOP embedded in a servlet? If it can be done, what do I have to do? Regards, Kyle Koss - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
Title: RE: Can cocoon write pdf to a file? will this code get .pdf file over HTTP? if yes, then wouldn't it be more efficient if instead of that, you somehow directly write on the hard disk without loading a Web server? -Original Message- From: Terry Anderson [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 9:44 AM To: [EMAIL PROTECTED] Subject: RE: Can cocoon write pdf to a file? All, Sorry, mentioned the wrong transformer earlier. Used stream generator, posted xml, saved to file. See code below. JAVA CLASS: URL url = new URL(http://path/xml2pdf.pdf); HttpURLConnection httpConn = null; try { httpConn = (HttpURLConnection)url.openConnection(); httpConn.setDoInput(true); httpConn.setDoOutput(true); httpConn.setRequestMethod(POST); httpConn.setUseCaches(false); httpConn.setDefaultUseCaches(false); httpConn.setRequestProperty(content-type,application/x-www- form-urlen coded); httpConn.setRequestProperty(content-length,String.valueOf(xm l_os.size( ))); PrintWriter pw = new PrintWriter(httpConn.getOutputStream()); String content = Foo= + URLEncoder.encode(new String(xml_os.toByteArray()),UTF-8); pw.println(content); pw.close(); InputStream is = httpConn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); byte[] buff = new byte[512]; ByteArrayOutputStream bos = new ByteArrayOutputStream(); String line = null; int len = 0; while( (len=bis.read(buff)) != -1) { bos.write(buff, 0, len); } bis.close(); String fileName = out.pdf; FileOutputStream fos = null; File file = null; try { file = new File(fileName); fos = new FileOutputStream(file); fos.write(bos.toByteArray()); } catch (IOException ioe) { System.out.println(Exception Caught: Creating .pdf File); ioe.printStackTrace(); } finally { if (fos!=null) { fos.close(); } } System.out.println(* FILE CREATED: +fileName+ *); SITEMAP.XMAP : map:match pattern=*.pdf map:generate type=stream map:parameter name=form-name value=Foo/ /map:generate map:transform type=xslt src="doc2pdf.xsl/ map:serialize type=fo2pdf/ /map:match -Original Message- From: Derek Hohls [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 1:50 AM To: [EMAIL PROTECTED] Subject: RE: Can cocoon write pdf to a file? Can you supply a link to this discussion/anwer? [EMAIL PROTECTED] 16/08/2002 12:20:57 This has been answered in the archives. I used the pdf transformer and saved the output stream to a file. TA -Original Message- From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:07 PM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? you should check the archives - i'm pretty sure this has been answered a lot. Think you'll want SourceWritingTransformer from Cocoon 2.1 dev (cvs check out from HEAD) Geoff -Original Message- From: kyle koss [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 1:54 PM To: [EMAIL PROTECTED] Subject: Can cocoon write pdf to a file? Is it possible for Cocoon to do an XML+XSL - PDF transformation, but instead of serving the PDF into the browser, writing it to a file? What I would like to do is, take information entered into a form on a jsp page, turn it into an XML file, and then apply my XSL to it to produce a PDF which is then stored to disk on the server. Can this be done using Cocoon, or would it be easier to just use FOP embedded in a servlet? If it can be done, what do I have to do? Regards, Kyle Koss - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
will this code get .pdf file over HTTP? if yes, then wouldn't it be more efficient if instead of that, you somehow directly write on the hard disk without loading a Web server? Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. Geoff -Original Message- From: Terry Anderson [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 9:44 AM To: [EMAIL PROTECTED] Subject: RE: Can cocoon write pdf to a file? All, Sorry, mentioned the wrong transformer earlier. Used stream generator, posted xml, saved to file. See code below. JAVA CLASS: URL url = new URL(http://path/xml2pdf.pdf;); HttpURLConnection httpConn = null; try { httpConn = (HttpURLConnection)url.openConnection(); httpConn.setDoInput(true); httpConn.setDoOutput(true); httpConn.setRequestMethod(POST); httpConn.setUseCaches(false); httpConn.setDefaultUseCaches(false); httpConn.setRequestProperty(content-type,application/x-www- form-urlen coded); httpConn.setRequestProperty(content-length,String.valueOf(xm l_os.size( ))); PrintWriter pw = new PrintWriter(httpConn.getOutputStream()); String content = Foo= + URLEncoder.encode(new String(xml_os.toByteArray()),UTF-8); pw.println(content); pw.close(); InputStream is = httpConn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); byte[] buff = new byte[512]; ByteArrayOutputStream bos = new ByteArrayOutputStream(); String line = null; int len = 0; while( (len=bis.read(buff)) != -1) { bos.write(buff, 0, len); } bis.close(); String fileName = out.pdf; FileOutputStream fos = null; File file = null; try { file = new File(fileName); fos = new FileOutputStream(file); fos.write(bos.toByteArray()); } catch (IOException ioe) { System.out.println(Exception Caught: Creating .pdf File); ioe.printStackTrace(); } finally { if (fos!=null) { fos.close(); } } System.out.println(* FILE CREATED: +fileName+ *); SITEMAP.XMAP : map:match pattern=*.pdf map:generate type=stream map:parameter name=form-name value=Foo/ /map:generate map:transform type=xslt src=doc2pdf.xsl/ map:serialize type=fo2pdf/ /map:match -Original Message- From: Derek Hohls [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 1:50 AM To: [EMAIL PROTECTED] Subject: RE: Can cocoon write pdf to a file? Can you supply a link to this discussion/anwer? [EMAIL PROTECTED] 16/08/2002 12:20:57 This has been answered in the archives. I used the pdf transformer and saved the output stream to a file. TA -Original Message- From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:07 PM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? you should check the archives - i'm pretty sure this has been answered a lot. Think you'll want SourceWritingTransformer from Cocoon 2.1 dev (cvs check out from HEAD) Geoff -Original Message- From: kyle koss [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 1:54 PM To: [EMAIL PROTECTED] Subject: Can cocoon write pdf to a file? Is it possible for Cocoon to do an XML+XSL - PDF transformation, but instead of serving the PDF into the browser, writing it to a file? What I would like to do is, take information entered into a form on a jsp page, turn it into an XML file, and then apply my XSL to it to produce a PDF which is then stored to disk on the server. Can this be done using Cocoon, or would it be easier to just use FOP embedded in a servlet? If it can be done, what do I have to do? Regards, Kyle Koss - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered
RE: Can cocoon write pdf to a file?
Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. SWT can have its own serializer? What a great stuff! Is this feature available in the scratchpad of C2.0.3? - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
Title: RE: Can cocoon write pdf to a file? thanks, I've seen it mentioned earlier. -Original Message- From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 10:12 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? will this code get .pdf file over HTTP? if yes, then wouldn't it be more efficient if instead of that, you somehow directly write on the hard disk without loading a Web server? Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. Geoff -Original Message- From: Terry Anderson [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 9:44 AM To: [EMAIL PROTECTED] Subject: RE: Can cocoon write pdf to a file? All, Sorry, mentioned the wrong transformer earlier. Used stream generator, posted xml, saved to file. See code below. JAVA CLASS: URL url = new URL(http://path/xml2pdf.pdf); HttpURLConnection httpConn = null; try { httpConn = (HttpURLConnection)url.openConnection(); httpConn.setDoInput(true); httpConn.setDoOutput(true); httpConn.setRequestMethod(POST); httpConn.setUseCaches(false); httpConn.setDefaultUseCaches(false); httpConn.setRequestProperty(content-type,application/x-www- form-urlen coded); httpConn.setRequestProperty(content-length,String.valueOf(xm l_os.size( ))); PrintWriter pw = new PrintWriter(httpConn.getOutputStream()); String content = Foo= + URLEncoder.encode(new String(xml_os.toByteArray()),UTF-8); pw.println(content); pw.close(); InputStream is = httpConn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); byte[] buff = new byte[512]; ByteArrayOutputStream bos = new ByteArrayOutputStream(); String line = null; int len = 0; while( (len=bis.read(buff)) != -1) { bos.write(buff, 0, len); } bis.close(); String fileName = out.pdf; FileOutputStream fos = null; File file = null; try { file = new File(fileName); fos = new FileOutputStream(file); fos.write(bos.toByteArray()); } catch (IOException ioe) { System.out.println(Exception Caught: Creating .pdf File); ioe.printStackTrace(); } finally { if (fos!=null) { fos.close(); } } System.out.println(* FILE CREATED: +fileName+ *); SITEMAP.XMAP : map:match pattern=*.pdf map:generate type=stream map:parameter name=form-name value=Foo/ /map:generate map:transform type=xslt src="doc2pdf.xsl/" map:serialize type=fo2pdf/ /map:match -Original Message- From: Derek Hohls [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 1:50 AM To: [EMAIL PROTECTED] Subject: RE: Can cocoon write pdf to a file? Can you supply a link to this discussion/anwer? [EMAIL PROTECTED] 16/08/2002 12:20:57 This has been answered in the archives. I used the pdf transformer and saved the output stream to a file. TA -Original Message- From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:07 PM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? you should check the archives - i'm pretty sure this has been answered a lot. Think you'll want SourceWritingTransformer from Cocoon 2.1 dev (cvs check out from HEAD) Geoff -Original Message- From: kyle koss [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 1:54 PM To: [EMAIL PROTECTED] Subject: Can cocoon write pdf to a file? Is it possible for Cocoon to do an XML+XSL - PDF transformation, but instead of serving the PDF into the browser, writing it to a file? What I would like to do is, take information entered into a form on a jsp page, turn it into an XML file, and then apply my XSL to it to produce a PDF which is then stored to disk on the server. Can this be done using Cocoon, or would it be easier to just use FOP embedded in a servlet? If it can be done, what do I have to do? Regards, Kyle Koss - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ---
RE: Can cocoon write pdf to a file?
Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. SWT can have its own serializer? What a great stuff! Is this feature available in the scratchpad of C2.0.3? Yes, just checked and it's in scratchpad of 2.0.3. From the java docs: This transformer allows you to output to a WritableSource. Definition: map:transformer name=tofile src=org.apache.cocoon.transformation.SourceWritingTransformer map:parameter name=serializer value=xml/ !-- this is the default Serializer (if your Source needs one, like for instance FileSource ) -- /map:transformer/ Invocation: map:transform type=tofile map:parameter name=serializer value=xml/ /map:transform Input XML document example: page xmlns:source=http://apache.org/cocoon/source/1.0; ... source:write src=context://doc/editable/my.xml page XML Object body /page /source:write ... /page Output XML document example: page xmlns:source=http://apache.org/cocoon/source/1.0; ... source:write src=/source/specific/path/to/context/doc/editable/my.xml result=success|failure action=new source specific error message /source:write ... /page Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
Title: RE: Can cocoon write pdf to a file? isn't there to be a serializer after the transformer in the pipeline? -Original Message- From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 10:22 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. SWT can have its own serializer? What a great stuff! Is this feature available in the scratchpad of C2.0.3? Yes, just checked and it's in scratchpad of 2.0.3. From the java docs: This transformer allows you to output to a WritableSource. Definition: map:transformer name=tofile src="org.apache.cocoon.transformation.SourceWritingTransformer map:parameter name=serializer value=xml/ !-- this is the default Serializer (if your Source needs one, like for instance FileSource ) -- /map:transformer/ Invocation: map:transform type=tofile map:parameter name=serializer value=xml/ /map:transform Input XML document example: page xmlns:source=http://apache.org/cocoon/source/1.0 ... source:write src="context://doc/editable/my.xml page XML Object body /page /source:write ... /page Output XML document example: page xmlns:source=http://apache.org/cocoon/source/1.0 ... source:write src="/source/specific/path/to/context/doc/editable/my.xml result=success|failure action=new source specific error message /source:write ... /page Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
Sure. The main pipeline continues but the portion of XML corresponding to the SWT has been replaced by the result of the SWT step. Input: ... source:write content_to_write ... /content_to_write /source:write ... Output: ... source:result isSuccess='true'/ ... Note: this is not the correct syntax, at all. But this is the idea :-) -Message d'origine- De: Argyn Kuketayev [mailto:[EMAIL PROTECTED]] Date: vendredi 16 août 2002 16:26 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? isn't there to be a serializer after the transformer in the pipeline? -Original Message- From: Geoff Howard [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Friday, August 16, 2002 10:22 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. SWT can have its own serializer? What a great stuff! Is this feature available in the scratchpad of C2.0.3? Yes, just checked and it's in scratchpad of 2.0.3. From the java docs: This transformer allows you to output to a WritableSource. Definition: map:transformer name=tofile src=org.apache.cocoon.transformation.SourceWritingTransformer map:parameter name=serializer value=xml/ !-- this is the default Serializer (if your Source needs one, like for instance FileSource ) -- /map:transformer/ Invocation: map:transform type=tofile map:parameter name=serializer value=xml/ /map:transform Input XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src=context://doc/editable/my.xml page XML Object body /page /source:write ... /page Output XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src=/source/specific/path/to/context/doc/editable/my.xml result=success|failure action=new source specific error message /source:write ... /page Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
Title: RE: Can cocoon write pdf to a file? I still don't see how this will work with PDF. PDF comes only from FOPSerializer. the last step in the pipeline. So, if you want to write its result on the disk, how can SWT be useful? I thought, maybe it makes a sense to have a special type of transformer or serializers, which would save output on the hard disk, but pass the URL to the pipeline. so, there'll be uniform way to deal with this sort of situations. on the other hand, having the caching configured properly would probably solve the problem too. -Original Message- From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 10:35 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Sure. The main pipeline continues but the portion of XML corresponding to the SWT has been replaced by the result of the SWT step. Input: ... source:write content_to_write ... /content_to_write /source:write ... Output: ... source:result isSuccess='true'/ ... Note: this is not the correct syntax, at all. But this is the idea :-) -Message d'origine- De: Argyn Kuketayev [mailto:[EMAIL PROTECTED]] Date: vendredi 16 août 2002 16:26 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? isn't there to be a serializer after the transformer in the pipeline? -Original Message- From: Geoff Howard [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Friday, August 16, 2002 10:22 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. SWT can have its own serializer? What a great stuff! Is this feature available in the scratchpad of C2.0.3? Yes, just checked and it's in scratchpad of 2.0.3. From the java docs: This transformer allows you to output to a WritableSource. Definition: map:transformer name=tofile src="org.apache.cocoon.transformation.SourceWritingTransformer" map:parameter name=serializer value=xml/ !-- this is the default Serializer (if your Source needs one, like for instance FileSource ) -- /map:transformer/ Invocation: map:transform type=tofile map:parameter name=serializer value=xml/ /map:transform Input XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src="context://doc/editable/my.xml" page XML Object body /page /source:write ... /page Output XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src="/source/specific/path/to/context/doc/editable/my.xml" result=success|failure action=new source specific error message /source:write ... /page Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
right, and the output of the cocoon pipeline gives the result of the output which you can transform into a report back to the user who called the action, or ignore it entirely. -Original Message- From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 10:35 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Sure. The main pipeline continues but the portion of XML corresponding to the SWT has been replaced by the result of the SWT step. Input: ... source:write content_to_write ... /content_to_write /source:write ... Output: ... source:result isSuccess='true'/ ... Note: this is not the correct syntax, at all. But this is the idea :-) -Message d'origine- De: Argyn Kuketayev [mailto:[EMAIL PROTECTED]] Date: vendredi 16 août 2002 16:26 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? isn't there to be a serializer after the transformer in the pipeline? -Original Message- From: Geoff Howard [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Friday, August 16, 2002 10:22 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. SWT can have its own serializer? What a great stuff! Is this feature available in the scratchpad of C2.0.3? Yes, just checked and it's in scratchpad of 2.0.3. From the java docs: This transformer allows you to output to a WritableSource. Definition: map:transformer name=tofile src=org.apache.cocoon.transformation.SourceWritingTransformer map:parameter name=serializer value=xml/ !-- this is the default Serializer (if your Source needs one, like for instance FileSource ) -- /map:transformer/ Invocation: map:transform type=tofile map:parameter name=serializer value=xml/ /map:transform Input XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src=context://doc/editable/my.xml page XML Object body /page /source:write ... /page Output XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src=/source/specific/path/to/context/doc/editable/my.xml result=success|failure action=new source specific error message /source:write ... /page Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
well, the SWT writes to a WritableSource, AFTER being serialized by its OWN serializer. So the main pipeline can be a HTML report of the PDF written to disk. -Message d'origine- De: Argyn Kuketayev [mailto:[EMAIL PROTECTED]] Date: vendredi 16 août 2002 16:40 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? I still don't see how this will work with PDF. PDF comes only from FOPSerializer. the last step in the pipeline. So, if you want to write its result on the disk, how can SWT be useful? I thought, maybe it makes a sense to have a special type of transformer or serializers, which would save output on the hard disk, but pass the URL to the pipeline. so, there'll be uniform way to deal with this sort of situations. on the other hand, having the caching configured properly would probably solve the problem too. -Original Message- From: ROSSEL Olivier [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Friday, August 16, 2002 10:35 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Sure. The main pipeline continues but the portion of XML corresponding to the SWT has been replaced by the result of the SWT step. Input: ... source:write content_to_write ... /content_to_write /source:write ... Output: ... source:result isSuccess='true'/ ... Note: this is not the correct syntax, at all. But this is the idea :-) -Message d'origine- De: Argyn Kuketayev [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Date: vendredi 16 août 2002 16:26 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? isn't there to be a serializer after the transformer in the pipeline? -Original Message- From: Geoff Howard [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Friday, August 16, 2002 10:22 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. SWT can have its own serializer? What a great stuff! Is this feature available in the scratchpad of C2.0.3? Yes, just checked and it's in scratchpad of 2.0.3. From the java docs: This transformer allows you to output to a WritableSource. Definition: map:transformer name=tofile src=org.apache.cocoon.transformation.SourceWritingTransformer map:parameter name=serializer value=xml/ !-- this is the default Serializer (if your Source needs one, like for instance FileSource ) -- /map:transformer/ Invocation: map:transform type=tofile map:parameter name=serializer value=xml/ /map:transform Input XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src=context://doc/editable/my.xml page XML Object body /page /source:write ... /page Output XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src=/source/specific/path/to/context/doc/editable/my.xml result=success|failure action=new source specific error message /source:write ... /page Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
Title: RE: Can cocoon write pdf to a file? ok, I'll check that, thanks -Original Message- From: ROSSEL Olivier [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 10:43 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? well, the SWT writes to a WritableSource, AFTER being serialized by its OWN serializer. So the main pipeline can be a HTML report of the PDF written to disk. -Message d'origine- De: Argyn Kuketayev [mailto:[EMAIL PROTECTED]] Date: vendredi 16 août 2002 16:40 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? I still don't see how this will work with PDF. PDF comes only from FOPSerializer. the last step in the pipeline. So, if you want to write its result on the disk, how can SWT be useful? I thought, maybe it makes a sense to have a special type of transformer or serializers, which would save output on the hard disk, but pass the URL to the pipeline. so, there'll be uniform way to deal with this sort of situations. on the other hand, having the caching configured properly would probably solve the problem too. -Original Message- From: ROSSEL Olivier [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Friday, August 16, 2002 10:35 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Sure. The main pipeline continues but the portion of XML corresponding to the SWT has been replaced by the result of the SWT step. Input: ... source:write content_to_write ... /content_to_write /source:write ... Output: ... source:result isSuccess='true'/ ... Note: this is not the correct syntax, at all. But this is the idea :-) -Message d'origine- De: Argyn Kuketayev [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Date: vendredi 16 août 2002 16:26 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? isn't there to be a serializer after the transformer in the pipeline? -Original Message- From: Geoff Howard [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Friday, August 16, 2002 10:22 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? Yes! you want SourceWritingTransformer from Cocoon 2.1 dev. There is a parameter to tell it how to serialize the output. It writes to a file on the local hard drive. SWT can have its own serializer? What a great stuff! Is this feature available in the scratchpad of C2.0.3? Yes, just checked and it's in scratchpad of 2.0.3. From the java docs: This transformer allows you to output to a WritableSource. Definition: map:transformer name=tofile src="org.apache.cocoon.transformation.SourceWritingTransformer" map:parameter name=serializer value=xml/ !-- this is the default Serializer (if your Source needs one, like for instance FileSource ) -- /map:transformer/ Invocation: map:transform type=tofile map:parameter name=serializer value=xml/ /map:transform Input XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src="context://doc/editable/my.xml" page XML Object body /page /source:write ... /page Output XML document example: page xmlns:source= http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 http://apache.org/cocoon/source/1.0 ... source:write src="/source/specific/path/to/context/doc/editable/my.xml" result=success|failure action=new source specific error message /source:write ... /page Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman
RE: Can cocoon write pdf to a file?
-Message d'origine- De: Argyn Kuketayev [mailto:[EMAIL PROTECTED]] Date: vendredi 16 août 2002 16:40 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? ... on the other hand, having the caching configured properly would probably solve the problem too. Wait, this last statement makes it sound like you are only interested in keeping the results cached to reduce load. If that is the case, use cocoon caching - it will automatically keep the result in memory and optionally write it out to disk/database as well. Caching will not keep a .pdf file anywhere - it remembers (compiles in docs is misnomer) the byte-stream for reuse if appropriate. I would highly reccomend against attempting to introduce your own file-based caching system when a good one is already in place. Hopefully, that's not what you meant by that. Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
on the other hand, having the caching configured properly would probably solve the problem too. Wait, this last statement makes it sound like you are only interested in keeping the results cached to reduce load. If that is the case, use cocoon caching - it will automatically keep the result in memory and optionally write it out to disk/database as well. Caching will not keep a .pdf file anywhere - it remembers (compiles in docs is misnomer) the byte-stream for reuse if appropriate. I would highly reccomend against attempting to introduce your own file-based caching system when a good one is already in place. Hopefully, that's not what you meant by that. I wonder if Cocoon (2.1?) handles Last-modified management? So when the browser requests something, Cocoon can (automatically or via custom actions) provide a Last-modified, and the client then decides if he can use its cache. I read that Cocoon handles Expires. But Expires and Last-modified are different notions. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
Title: RE: Can cocoon write pdf to a file? well, I don't remember who started the thread, not me though :) I'll also need some sort of solution with large PDF files. The idea is that you come and launch report, and given a URL to check it later (when PDF is ready). The URL would point to a file on the disk, which will be stored for some time, say one day. Cashing is for a different situation, which you described. -Original Message- From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 10:54 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? -Message d'origine- De: Argyn Kuketayev [mailto:[EMAIL PROTECTED]] Date: vendredi 16 août 2002 16:40 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? ... on the other hand, having the caching configured properly would probably solve the problem too. Wait, this last statement makes it sound like you are only interested in keeping the results cached to reduce load. If that is the case, use cocoon caching - it will automatically keep the result in memory and optionally write it out to disk/database as well. Caching will not keep a .pdf file anywhere - it remembers (compiles in docs is misnomer) the byte-stream for reuse if appropriate. I would highly reccomend against attempting to introduce your own file-based caching system when a good one is already in place. Hopefully, that's not what you meant by that. Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
I think you can use such a a pipeline: - SWT -- Serializer : PDF - sucessOrFailure2mail.xsl - Sendmail transformer So the first step makes the PDF and provides a report as XML . The second step creates a report mail from the XML output of the SWT. The third step sends the mail (may be with the URL where the PDF can be found). -Message d'origine- De: Argyn Kuketayev [mailto:[EMAIL PROTECTED]] Date: vendredi 16 août 2002 17:05 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? well, I don't remember who started the thread, not me though :) I'll also need some sort of solution with large PDF files. The idea is that you come and launch report, and given a URL to check it later (when PDF is ready). The URL would point to a file on the disk, which will be stored for some time, say one day. Cashing is for a different situation, which you described. -Original Message- From: Geoff Howard [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Friday, August 16, 2002 10:54 AM To: '[EMAIL PROTECTED]' Subject: RE: Can cocoon write pdf to a file? -Message d'origine- De: Argyn Kuketayev [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Date: vendredi 16 août 2002 16:40 À: '[EMAIL PROTECTED]' Objet: RE: Can cocoon write pdf to a file? ... on the other hand, having the caching configured properly would probably solve the problem too. Wait, this last statement makes it sound like you are only interested in keeping the results cached to reduce load. If that is the case, use cocoon caching - it will automatically keep the result in memory and optionally write it out to disk/database as well. Caching will not keep a .pdf file anywhere - it remembers (compiles in docs is misnomer) the byte-stream for reuse if appropriate. I would highly reccomend against attempting to introduce your own file-based caching system when a good one is already in place. Hopefully, that's not what you meant by that. Geoff - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
what for? -Original Message-From: kyle koss [mailto:[EMAIL PROTECTED]]Sent: Thursday, August 15, 2002 1:54 PMTo: [EMAIL PROTECTED]Subject: Can cocoon write pdf to a file? Is it possible for Cocoon to do an XML+XSL - PDF transformation, but instead of serving the PDF into the browser, writing it to a file?
RE: Can cocoon write pdf to a file?
Title: RE: Can cocoon write pdf to a file? I can't think of any way to do this with the included Cocoon components, why not to change FOPSerializer? e.g. make it write the file on hard disk, then in the output stream will be only the URL to that file?
Re: Can cocoon write pdf to a file?
Because what happens when someone then wants to do the same thing with a GIF, or HTML, or SWF? An action that writes any resource to a file can be reused in different circumstances. Justin On Thursday, August 15, 2002, at 01:46 PM, Argyn Kuketayev wrote: I can't think of any way to do this with the included Cocoon components, why not to change FOPSerializer? e.g. make it write the file on hard disk, then in the output stream will be only the URL to that file? - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can cocoon write pdf to a file?
you should check the archives - i'm pretty sure this has been answered a lot. Think you'll want SourceWritingTransformer from Cocoon 2.1 dev (cvs check out from HEAD) Geoff -Original Message-From: kyle koss [mailto:[EMAIL PROTECTED]]Sent: Thursday, August 15, 2002 1:54 PMTo: [EMAIL PROTECTED]Subject: Can cocoon write pdf to a file? Is it possible for Cocoon to do an XML+XSL - PDF transformation, but instead of serving the PDF into the browser, writing it to a file? What I would like to do is, take information entered into a form on a jsp page, turn it into an XML file, and then apply my XSL to it to produce a PDF which is then stored to disk on the server. Can this be done using Cocoon, or would it be easier to just use FOP embedded in a servlet? If it can be done, what do I have to do? Regards, Kyle Koss
RE: Can cocoon write pdf to a file?
Title: Message This has been answered in the archives. I used the pdf transformer and saved the output stream to a file. TA -Original Message-From: Geoff Howard [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:07 PMTo: '[EMAIL PROTECTED]'Subject: RE: Can cocoon write pdf to a file? you should check the archives - i'm pretty sure this has been answered a lot. Think you'll want SourceWritingTransformer from Cocoon 2.1 dev (cvs check out from HEAD) Geoff -Original Message-From: kyle koss [mailto:[EMAIL PROTECTED]]Sent: Thursday, August 15, 2002 1:54 PMTo: [EMAIL PROTECTED]Subject: Can cocoon write pdf to a file? Is it possible for Cocoon to do an XML+XSL - PDF transformation, but instead of serving the PDF into the browser, writing it to a file? What I would like to do is, take information entered into a form on a jsp page, turn it into an XML file, and then apply my XSL to it to produce a PDF which is then stored to disk on the server. Can this be done using Cocoon, or would it be easier to just use FOP embedded in a servlet? If it can be done, what do I have to do? Regards, Kyle Koss