PUT_Factory question
Hi ! I have read here and there a few messages talking about "PUT_Factory" scripts, which seem to enable us to create given objects types from informations transfered via HTTP or FTP "PUTs". Where could I find informations about this method ? Does it have to be implemented as a simple DTML Method, as a Python script or as an external method ?? Any information would be really usefull to me... Thanks, Thierry
Hello Thierry, Monday, October 08, 2001, 14:16:16, you wrote: TF> Hi ! TF> I have read here and there a few messages talking about "PUT_Factory" TF> scripts, which seem to enable us to create given objects types from TF> informations transfered via HTTP or FTP "PUTs". TF> Where could I find informations about this method ? Does it have to be TF> implemented as a simple DTML Method, as a Python script or as an external TF> method ?? TF> Any information would be really usefull to me... TF> Thanks, TF> Thierry Did you get any responses to this enquiry? I have been wondering about the same issues, and have never gotten any good response.. :-) -- Geir Bækholt web-developer geirh@funcom.com funcom oslo | webdev-team
Geir Bækholt wrote:
Hello Thierry,
Monday, October 08, 2001, 14:16:16, you wrote: TF> Hi ! TF> I have read here and there a few messages talking about "PUT_Factory" TF> scripts, which seem to enable us to create given objects types from TF> informations transfered via HTTP or FTP "PUTs". TF> Where could I find informations about this method ? Does it have to be TF> implemented as a simple DTML Method, as a Python script or as an external TF> method ?? TF> Any information would be really usefull to me... TF> Thanks, TF> Thierry
Did you get any responses to this enquiry? I have been wondering about the same issues, and have never gotten any good response..
:-)
Download HTMLDocument from zope.org to see how it works - have a look at its __init__.py : def PUT_factory( self, name, typ, body ): from OFS.Image import Image, File from OFS.DTMLDocument import DTMLDocument if typ == 'text/html': ob = HTMLDocument.HTMLDocument('', __name__=name) elif typ in ('text/xml', 'text/plain'): ob = DTMLDocument('', __name__=name) elif typ[:6] == 'image/': ob = Image(name, '', body, content_type=typ) else: ob = File(name, '', body, content_type=typ) return ob import webdav.NullResource webdav.NullResource.NullResource._default_PUT_factory = PUT_factory Enjoy, Andreas
participants (3)
-
Andreas Wandel -
Geir Bækholt -
Thierry FLORAC