Hi Matthias > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Matthias Lehmann > Sent: Friday, June 03, 2005 2:17 PM > To: zope3-dev@zope.org > Subject: [Zope3-dev] no subdirectories possible > withbrowser:resourceDirectory > > 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
See our implementation of nested source directories at: http://svn.tiks.org/viewcvs/Tiks/trunk/src/tiks/publisher/browser/ This implementation doesn't support a boolean, because perhaps you won't use all subfolders of your resource. e.g. use some external javascript libraries packages. You have to register all sub folders by it's subpath. I will move this to the z3 core after release 3.1 if somebody is interessted to have it there. Regards Roger Ineichen Projekt01 GmbH www.projekt01.ch _____________________________ END OF MESSAGE > _______________________________________________ > Zope3-dev mailing list > Zope3-dev@zope.org > Unsub: > http://mail.zope.org/mailman/options/zope3-dev/dev%40projekt01.ch > > _______________________________________________ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com