<div dir="ltr">Thanks everyone - the ZMI solution was what I was looking for, but I had already taken Sebastian's advice and now I'm serving everything behind nginx, which was easier than I thought it would be.<div>
<br></div><div>Thanks!<br><div><br><div class="gmail_quote">On Tue, Sep 23, 2008 at 7:58 PM, Uli Fouquet <span dir="ltr"><<a href="mailto:uli@gnufix.de">uli@gnufix.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi there,<br>
<div><div></div><div class="Wj3C7c"><br>
Pete Hunt wrote:<br>
<br>
> I'm developing a Flash/Flex application which communicates with Grok<br>
> via AMF. The problem is, in order for the security to work, I need to<br>
> add a crossdomain.xml file to the site root<br>
> (<a href="http://host/crossdomain.xml" target="_blank">http://host/crossdomain.xml</a>). Unfortunately, I can only create views<br>
> off of my application's path (<a href="http://host/myapp/blah" target="_blank">http://host/myapp/blah</a>), and I can't for<br>
> the life of me figure out how to add a static file via the ZMI to the<br>
> site root.<br>
<br>
</div></div>Michael told you already how to add a File-object to the root folder<br>
using the ZMI. There are, however, also some non-ZMI ways available.<br>
<br>
You could register a file in your `configure.zcml` like this::<br>
<br>
<configure<br>
...<br>
<browser:resource<br>
file="somedir/foo.xml"<br>
name="crossdomain.xml" /><br>
</configure><br>
<br>
which would make the file `foo.xml` located in the `somedir` directory<br>
of your package available under the name `crossdomain.xml`.<br>
<br>
The URLs<br>
<br>
http://<host>/@@/crossdomain.xml<br>
<br>
or<br>
<br>
http://<host>/++resource++crossdomain.xml<br>
<br>
would then deliver foo.xml with the correct filetype etc.<br>
<br>
Another, 'dirtier', approach would be to define a new view on root<br>
folders in your Grok application like this::<br>
<br>
from zope.app.folder.interfaces import IRootFolder<br>
import grok<br>
<br>
class Crossdomain(grok.View):<br>
grok.context(IRootFolder)<br>
<a href="http://grok.name" target="_blank">grok.name</a>('crossdomain.xml')<br>
<br>
def render(self):<br>
self.response.setHeader('Content-Type',<br>
'text/xml; charset=UTF-8')<br>
return "<doc>Some XML</doc>"<br>
<br>
Here you could get the file contents like this::<br>
<br>
http://<host>/crossdomain.xml<br>
<br>
which is the short form for<br>
<br>
http://<host>/@@crossdomain.xml<br>
<br>
Given you have no object named 'crossdomain.xml' in your root folder,<br>
the short form would return your view, i.e. your XML content. Hm, there<br>
are even more approaches, but that may help for now.<br>
<br>
Best regards,<br>
<br>
--<br>
<font color="#888888">Uli<br>
<br>
</font></blockquote></div><br></div></div></div>