cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Pattison" <p...@76design.com>
Subject RE: Using internal paths for sendmail attachments
Date Thu, 22 Aug 2002 15:33:11 GMT


> -----Original Message-----
> From: Vadim Gritsenko [mailto:vadim.gritsenko@verizon.net]
> Sent: 22 August 2002 08:17
> To: cocoon-users@xml.apache.org
> Subject: Re: Using internal paths for sendmail attachments
>
>
> Paul Pattison wrote:
>
> >Thanks for your response Vadim.  I've been looking at the
> util logicsheet
> >and trying to figure this out, but I'm not having much luck.
>  My page is
> >seems to be just hanging.  I'm not sure if it's because of
> the 'resolver'
> >line of code or where I create my URLDataSource in the code.  All the
> >examples I could find re sending emails with attachments said to use
> >FileDataSource if the attachment was a file and
> URLDataSource if it's a URL.
> >I couldn't find any examples using URLDataSource, but that's
> what I think I
> >should be using.  Does anyone have experience with this
> JavaMail stuff?
> >Which of the DataSource objects should I be using?  FileDataSource or
> >URLDataSource?
> >
> >Is my code to resolve the uri correct?
> >
> >Thanks,
> >
> >Paul
> >
> >
> >Here is a snippet from the sendmail logicsheet:
> >
> >String _sendmail_strSubAttachement;
> >BodyPart _sendmail_att_part;
> >DataSource _sendmail_data_source;
> >
> >try {
> >	org.apache.excalibur.source.Source input_source =
> >resolver.resolve("cocoon:/newsletter.pdf");
> >
>
> Are you on 2.1? I was referring to 203.
> In 2.1, you should use resolveURI() method.

I am using 2.1.  I'll switch the method.

>
> >	_sendmail_data_source = new URLDataSource(new
> >java.net.URL(input_source.getSystemId()));
> >
>
> This should fail with malformed URL exception: unknown
> protocol cocoon.
>
> Vadim

You say it will fail.  Is there a way to do this then?  Do I have to write
the pdf to file and then attach it with the FileDataSource?  Any ideas?

>
> >	_sendmail_att_part = new MimeBodyPart();
> >	_sendmail_att_part.setDataHandler(new
> DataHandler(_sendmail_data_source));
> >	_sendmail_att_part.setFileName(_sendmail_data_source.getName());
> >	_sendmail_multipart.addBodyPart(_sendmail_att_part);
> >}
> >catch (Exception e) {
> >	throw new RuntimeException(e.getMessage());
> >
> >


---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message