Wow! That&#39;s exactly what I need<br>
Tomorrow I&#39;ll try this<br><br>Thank you so much Tres!!!<br><br><div><span class="gmail_quote">2008/1/11, Tres Seaver &lt;<a href="mailto:tseaver@palladion.com">tseaver@palladion.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>Garito wrote:<br>&gt; Hi, all!<br>&gt; If you have download the ZSM product you could see I put on it a zexp<br>&gt; file with prototype and some other js file and a css file plus images
<br>&gt;<br>&gt; This was only a prototype solution to bring you the chance to see how<br>&gt; my ideas are but I think this is not a definitive solution<br>&gt;<br>&gt; Now my question:<br>&gt;<br>&gt; Which is the best zope way to serve this kind of files trying to avoid
<br>&gt; any other product dependence?<br>&gt;<br>&gt; Thanks a lot!<br><br>In the context of Five / Zope3, the static content items are<br>&quot;resources&quot;.&nbsp;&nbsp;One strategy would be to create a Zope2 product with those
<br>files in a subdirectory, e.g.::<br><br>&nbsp;&nbsp;$ mkdir Products/garito<br>&nbsp;&nbsp;$ cd Products/garito<br>&nbsp;&nbsp;$ echo &quot;# ZSM product&quot; &gt; __init__.py<br>&nbsp;&nbsp;$ mkdir static<br>&nbsp;&nbsp;$ cat &gt; static/garito.css<br>&nbsp;&nbsp;body {<br>&nbsp;&nbsp;&nbsp;&nbsp;background: #CCCCFF;
<br>&nbsp;&nbsp;}<br>&nbsp;&nbsp;^D<br><br>And then register that directory as a &quot;resource directory&quot; via ZCML::<br><br>&nbsp;&nbsp;$ cat &gt; configure.zcml<br>&nbsp;&nbsp;&lt;configure xmlns:browser=&quot;<a href="http://namespaces.zope.org/browser">
http://namespaces.zope.org/browser</a>&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;browser:resourceDirectory<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name=&quot;garito&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directory=&quot;static&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&gt;<br>&nbsp;&nbsp;&lt;/configure&gt;<br>&nbsp;&nbsp;^D<br><br>Now, when you start Zope2, you can pull in your static resources via
<br>special URLs, like <a href="http://localhost:8080/++resource++garito/garito.css">http://localhost:8080/++resource++garito/garito.css</a>::<br><br>&nbsp;&nbsp;$ cd ../..<br>&nbsp;&nbsp;$ bin/zopectl start<br>&nbsp;&nbsp;. daemon process started, pid=25240
<br>&nbsp;&nbsp;$ telnet localhost 8080<br>&nbsp;&nbsp;Trying 127.0.0.1...<br>&nbsp;&nbsp;Connected to localhost.<br>&nbsp;&nbsp;Escape character is &#39;^]&#39;.<br>&nbsp;&nbsp;GET /++resource++garito/garito.css HTTP/1.0<br><br>&nbsp;&nbsp;HTTP/1.0 200 OK<br>&nbsp;&nbsp;Server: Zope/(unreleased version, python 
2.4.4, linux2) ZServer/1.1<br>&nbsp;&nbsp;Date: Fri, 11 Jan 2008 18:53:11 GMT<br>&nbsp;&nbsp;Content-Length: 32<br>&nbsp;&nbsp;Last-Modified: Fri, 11 Jan 2008 18:44:47 GMT<br>&nbsp;&nbsp;Connection: close<br>&nbsp;&nbsp;Cache-Control: public,max-age=86400<br>&nbsp;&nbsp;Content-Type: text/css; charset=iso-8859-15
<br><br>&nbsp;&nbsp;body {<br>&nbsp;&nbsp;&nbsp;&nbsp;background: #CCCCFF;<br>&nbsp;&nbsp;}<br>&nbsp;&nbsp;Connection closed by foreign host.<br><br>In that product, you could also register a template / browser view which<br>includes your resources, e.g::<br><br>&nbsp;&nbsp;$ cd Products/garito
<br>&nbsp;&nbsp;$ cat &gt; <a href="http://garito.pt">garito.pt</a><br>&nbsp;&nbsp;&lt;html&gt;<br>&nbsp;&nbsp;&lt;head&gt;<br>&nbsp;&nbsp; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; href=&quot;/++resource++garito/garito.css&quot;/&gt;
<br>&nbsp;&nbsp;&lt;/head&gt;<br>&nbsp;&nbsp;&lt;body&gt;<br>&nbsp;&nbsp;&lt;h1&gt; Garito&#39;s view &lt;/h1&gt;<br>&nbsp;&nbsp;&lt;/body&gt;<br>&nbsp;&nbsp;&lt;/html&gt;<br>&nbsp;&nbsp;^D<br>&nbsp;&nbsp;$ cat &gt; configure.zcml<br>&nbsp;&nbsp;&lt;configure xmlns:browser=&quot;<a href="http://namespaces.zope.org/browser">
http://namespaces.zope.org/browser</a>&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;browser:page<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for=&quot;*&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name=&quot;garito.html&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;template=&quot;<a href="http://garito.pt">garito.pt</a>&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permission=&quot;
zope2.View&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;browser:resourceDirectory<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name=&quot;garito&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directory=&quot;static&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&gt;<br>&nbsp;&nbsp;&lt;/configure&gt;<br>&nbsp;&nbsp;^D<br>&nbsp;&nbsp;$ cd ../..<br>&nbsp;&nbsp;$ bin/zopectl restart
<br>&nbsp;&nbsp;$ telnet localhost 8080<br>&nbsp;&nbsp;Trying 127.0.0.1...<br>&nbsp;&nbsp;Connected to localhost.<br>&nbsp;&nbsp;Escape character is &#39;^]&#39;.<br>&nbsp;&nbsp;GET /garito.html HTTP/1.0<br><br>&nbsp;&nbsp;HTTP/1.0 200 OK<br>&nbsp;&nbsp;Server: Zope/(unreleased version, python 
2.4.4, linux2) ZServer/1.1<br>&nbsp;&nbsp;Date: Fri, 11 Jan 2008 19:02:05 GMT<br>&nbsp;&nbsp;Content-Length: 151<br>&nbsp;&nbsp;Content-Type: text/html; charset=iso-8859-15<br>&nbsp;&nbsp;Connection: close<br><br>&nbsp;&nbsp;&lt;html&gt;<br>&nbsp;&nbsp;&lt;head&gt;<br>&nbsp;&nbsp; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; href=&quot;/++resource++garito/garito.css&quot; /&gt;<br>&nbsp;&nbsp;&lt;/head&gt;<br>&nbsp;&nbsp;&lt;body&gt;<br>&nbsp;&nbsp;&lt;h1&gt; Garito&#39;s view &lt;/h1&gt;<br>&nbsp;&nbsp;&lt;/body&gt;<br>&nbsp;&nbsp;&lt;/html&gt;<br>&nbsp;&nbsp;Connection closed by foreign host.
<br><br>Which pulls in your static resources.<br><br><br><br>Tres.<br>- --<br>===================================================================<br>Tres Seaver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+1 540-429-0999&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="mailto:tseaver@palladion.com">
tseaver@palladion.com</a><br>Palladion Software&nbsp;&nbsp; &quot;Excellence by Design&quot;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://palladion.com">http://palladion.com</a><br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG v1.4.6 (GNU/Linux)<br>Comment: Using GnuPG with Mozilla - 
<a href="http://enigmail.mozdev.org">http://enigmail.mozdev.org</a><br><br>iD8DBQFHh72H+gerLs4ltQ4RAgwwAKDSJPrGAuwo++ShjWjZzyn06IDz1QCeK69s<br>+CIbgsCJkbRV5Tdh9XWEY9k=<br>=Du8x<br>-----END PGP SIGNATURE-----<br><br>_______________________________________________
<br>Zope maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Zope@zope.org">Zope@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope</a><br>**&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp;&nbsp;**<br>
(Related lists -<br> <a href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</a><br> <a href="http://mail.zope.org/mailman/listinfo/zope-dev">http://mail.zope.org/mailman/listinfo/zope-dev
</a> )<br></blockquote></div><br><br clear="all"><br>-- <br>Mis Cosas<br><a href="http://blogs.sistes.net/Garito">http://blogs.sistes.net/Garito</a><br>Zope Smart Manager<br><a href="http://blogs.sistes.net/Garito/670">http://blogs.sistes.net/Garito/670
</a>