Hi all,

I hope it's the right list for this request, if not please take 5 seconds to 
yell at me :)

I'm writing an ODT-export plugin for Trac, similar in essence to the other 
export plugins available on trac-hacks. It's based on an XSL transformation 
from XHTML to ODT, that I've developed for another project. It's working 
fine for plain text, and I'm working on adding images support.

I need to copy the images in the ODT file (which is basically a zip file), 
and for that I've thought about two ways :
 1. just download the file by making an HTTP request
 2. ask Trac for the real file path and copy it

The first solution doesn't seem right to me, because it creates a useless 
HTTP request, and it's bound to cause problems with permissions. I'll have 
to reuse or disable the authentication method and I'm not sure how to do 
that.

The second solution looks much cleaner, but I don't know how to do it. What 
I'm thinking now is to create a mock Request object with a special 
send_file() function which would hand me over the file path and the mime 
type. I still need to figure out how to insert this request in the system, 
maybe through the RequestDispatcher. Since it's touching the internals of 
Trac, I thought I'd ask you for advice.
Is there a preferred way to do this ?

Thanks for your help, and happy holidays (where applicable ;-) )

Aurélien
-- 
http://aurelien.bompard.org  ~~~~  Jabber : [email protected]
This mail is displayed with recycled electrons

--

You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.


Reply via email to