Hello,

today, I was using the browser:resourceDirectory ZCML-directive and found, 
that it is not possible to serve resource-subdirectories (at least I could 
not make it work):

For instance, I might have a resource directory "resources" which contains 
subdirectories "sub1" and "sub2". If I register resources with

 <browser:resourceDirectory name="resources" directory="resources"  />

files in resources are served just fine, but files in the subdirectories are 
not. I tried to register each of the subdirectories individually:

 <browser:resourceDirectory name="resources/sub1" 
directory="resources/sub1"  />
 <browser:resourceDirectory name="resources/sub2" 
directory="resources/sub2"  />

but this didn't work either (still gives a 404).

Of course, I can register the subdirectories and bind them to top-level 
directory names:

        <browser:resourceDirectory name="resources/sub1" directory="sub1"  />
  <browser:resourceDirectory name="sub2" directory="resources/sub2"  />

but that makes it necessary to make tedious changes, if one wishes to 
integrate resources like static html pages into zope3, which were not written 
for it in the first place. (I am aware, that it is better to use apache to 
server static content, but that requires a much more sophisticated setup, 
which might not be necessary for small sites or during development.)

I was wondering, whether this behavior if resourceDirectory is intentional 
(which I simply don't understand) or if it is a real shortcoming.

My suggestions for the resourceDirectory directive would be, to add a boolean 
attribute "recursive", which can be used to control, whether or not 
subdirectories should be included. Also, I wonder, if one could make the 
"name" attribute optional and let it default to the value of the "diretory" 
attribute.

I haven't done any Zope3 development yet, but if some of you give me some 
feedback and maybe point me into the right directions, I am willing to look 
deeper into that...

Blessings,

Mat
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to