cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jasha Joachimsthal" <j.joachimst...@onehippo.com>
Subject RE: Mail + File Generation
Date Thu, 05 Jun 2008 06:39:51 GMT
Hi Matt, 

> -----Original Message-----
> From: Matthew Monkan [mailto:matthew@ieee.org] 
> Sent: woensdag 4 juni 2008 21:58
> To: users@cocoon.apache.org
> Subject: Mail + File Generation
> 
> 
> Okay, so I know how to generate an Excel document with data 
> from a DB, and I know how to send an e-mail with an attachment.
> 
> Is there a way to use only one URI to send an e-mail 
> containing a generated Excel document? This is a requirement.
> 
> For example:
> 
>       <map:match pattern="revenueAlert">
>         <map:generate type="file" src="content/main.xml" />
>         <map:transform type="sql">
> 	    <map:parameter name="use-connection" value="eta" />
>         </map:transform>
>         <map:transform type="xslt" src="style/main.xsl" />
>         <map:serialize type="xls" />
> 
>         <!-- Now I need to e-mail this Excel document as an 
> attachment to someone. -->
> 
>         <map:generate type="file" src="content/main.xml" />
>         <map:transform type="sendmail" />
>         <map:serialize type="xml" />
> 
>       </map:match>

Yes you can use one (external) URI that does both jobs. That URI sends
the mail with an attachment. That attachment is the URI of the pipeline
that generates the Excel file. 
You can add attachments to your email with

<email:attachment name="myexcelsheet.xls" src="cocoon:/revenueAlert"
mime-type="application/vnd.ms-excel"/>

> Also, I notice that when anything goes through a serializer, 
> it just opens the created file in an application or browser. 
> Is there a way to store the output of a serializer to some 
> destination instead of manually saving the file?

What destination do you mean? On the client or on the server? If you
want it on the server, you can use the SourceWritingTransformer [1] or
write your own flowscript function that gets the outputstream of the XLS
pipeline and writes it to disk.

[1] http://cocoon.apache.org/2.1/userdocs/sourcewriting-transformer.html


> --
> View this message in context: 
> http://www.nabble.com/Mail-%2B-File-Generation-tp17655330p1765
5330.html
> Sent from the Cocoon - Users mailing list archive at Nabble.com.

Regards,

Jasha Joachimsthal 

www.onehippo.com
Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
94952-3329 +1 (707) 773-4646


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message