Am 30.05.2010, 16:13 Uhr, schrieb Fritz Loseries <fr...@loseries.info>:
> I just got a problem where I think that there is a conflict with case
> sensitive registration.
> Through zcml I've registered "Filesystem Directory Views" using
> Uppercase for the first letter:
> <cmf:registerDirectory name="mytheme_images/Stammbaeume"/>
> <cmf:registerDirectory name="mytheme_images/Stammbaeume/Koschmieder"/>
> Then I've imported some document.zexp from another site.
> Within HTML code src of img is "../stammbaeume/koschmieder/img/image.png"
> Image will not be presented, because now image.png is no longer in the
> subdir img.
> Changing it to "../stammbaeume/koschmieder/image.png"
> Image will not be presented, because it is case sensitive.
> Changing it to "../Stammbaeume/Koschmieder/image.png"
> Image appears
> But changing all src of img in a mass of documents is an unpracticable
Why is it unpractical? If you know the exact pattern to replace it should
be easy enough to do this using a script.
> Thus I decided to change registration through zcml.
> <cmf:registerDirectory name="mytheme_images/stammbaeume"/>
> <cmf:registerDirectory name="mytheme_images/stammbaeume/koschmieder"/>
> and moving images to subdir img, as well as changing case of directory
> naming to lower case.
> Restarting Zope again, using original version of the CMF document, no
> image appears.
> But I got following warning:
> UserWarning: DirectoryView img refers to a non-existing path
> (self.id, reg_key), UserWarning)
> Through ZMI content of Stammbaeume/Koschmieder/img is accessible.
> This seems for me, that deleting a "Filesystem Directory View" and
> restarting Zope (running zcml) will not empty and refill the registry.
> Now I got a real conflict. I do not know, if this is a bug or if I can
> get an advice how to change it through GenericSetup.
Firstly, all Zope URLs are case-sensitive. Directory Views are nothing
more than storages for Zope objects in the file system. Secondly, you need
to do more than just register the directory in ZCML. This just makes them
available for the ZODB object of the File Directory View. Once you've
registered the new directory you can assign it to the relevant Filesystem
Directory View through its properties, or indeed using GenericSetup.
Clark Consulting & Research
Zope-CMF maillist - Zope-CMF@zope.org
See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests