On Wed, Oct 6, 2010 at 6:02 AM, irrumabo <[email protected]> wrote: > Thanks Olemis; I have this working now - the problem was that my > <applet ...> tag looked something like this: > > <applet code="MyApplet" width="600" height="600"> > </applet> > > which means that the request for the applet is made relative to the > containing page, which is why the requested URL ends up being > something like "http://localhost/Projects/MyApplet.class", where > anything under "http://localhost/Projects" is Trac's problem as far as > Apache is concerned, and of course Trac doesn't know anything about > how to serve this applet. So a slightly crude solution is to have my > applet tag look like this: > > <applet code="/MyApplet" width="600" height="600"> > </applet> > > (i.e. a forward slash at the start of the code path) and now Apache > looks for it in its own "C:\Program Files\Apache Software Foundation > \Apache2.2\htdocs" directory and once I've copied the .class file into > there it all works. > > Would be nice to be able to just have the .class or .jar file inside > the .egg - are you saying that I can do this by implementing > ITemplateProvider? (in a plugin?). >
yes . That interface allow you to package Genshi HTML templates and static content inside your plugin and make it available from the outside. Use two folders in your plugin source tree for this purpose (one for templates , another for htdocs ;o) bind it to a package in your setup.py script, and implement this interface so that you'll have your own address space under http://server/path/to/env/chrome/<your id> . See Trac source for examples ;o) >From the packaging perspective it's ok, 'cause static files are shipped altogether . Nonetheless , for better performance it's recomended to serve http://server/path/to/env/chrome/* using Apache Directory or Location ... but that's another $1M USD in my pocket ;o) -- Regards, Olemis. Blog ES: http://simelo-es.blogspot.com/ Blog EN: http://simelo-en.blogspot.com/ Featured article: -- You received this message because you are subscribed to the Google Groups "Trac Users" 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-users?hl=en.
