Hi All, I've implemented a replacement image object that I would really like to be the default on my site. I've thought of a few different approaches, and would like to see if there's any wisdom out there on which might be the easiest (or perhaps safest?) approach: 1 FTP defaults Can I change what product class is used to load image data when it is "put" from the FTP interface? I'm not sure how it decides this, but when I upload images they always appear as plain Zope images. This would probably be the most convenient solution, even though it won't do much about the ZMI upload (but I can use permissions to make the custom image easier to find), and, of course, it won't fix existing image instances (but that's a temporary problem). 2 Overloading Could I overload the product class with my product? E.g., could I just change "meta_type" to image in my product and have it clobber the plain Zope image? Sounds scary, but maybe possible. 3 Monkeypatching This would probably be the least convenient approach -- start with Image and overload all its methods. However, this is the only method I've actually seen in use. Opinions? Thanks! Terry -- ------------------------------------------------------ Terry Hancock hancock@anansispaceworks.com Anansi Spaceworks http://www.anansispaceworks.com P.O. Box 60583 Pasadena, CA 91116-6583 ------------------------------------------------------
What you need is a PUT_factory. Just drop it in the folder where you want it to do its magic or somewhere it can be acquired. An example PUT_factory is here: <http://www.zope.org/Members/shh/Patches/PUT_factory.py> If you are working with the CMF you can use the content_type_registry. Stefan --On Montag, 09. September 2002 09:28 -0700 Terry Hancock <hancock@anansispaceworks.com> wrote:
Can I change what product class is used to load image data when it is "put" from the FTP interface? I'm not sure how it decides this, but when I upload images they always appear as plain Zope images. This would probably be the most convenient solution, even though it won't do much about the ZMI upload (but I can use permissions to make the custom image easier to find), and, of course, it won't fix existing image instances (but that's a temporary problem).
-- Those who write software only for pay should go hurt some other field. /Erik Naggum/
participants (2)
-
Stefan H. Holek -
Terry Hancock