[Zope] A function like a FTP Object

Peter Bengtsson peterbe at gmail.com
Sun Jul 3 09:40:44 EDT 2005


Sure you can. Any object/method that is in Zope becomes available via FTP. 
Some example code::

class MyProduct(Folder):
    def struct_xml(self):
          return "<tag>1</tag>"
    def PUT(self, REQUEST, RESPONSE):
        if not REQUEST.get('BODY'):
            get_transaction.abort()
            RESPONSE.setStatus(405)
        else:
            body = REQUEST.get('BODY')
            self._save_struct_body(body)
            RESPONSE.setStatus(204)
        return RESPONSE


setattr(MyProduct, 'struct.xml', MyProduct.struct_xml)

    

On 7/3/05, Garito <garito at sistes.net> wrote:
> Hi all
> I would like to create a product with a function called struct.xml
> 
> I would like if I could access it via FTP because I would like editor
> integration
> 
> I open the file via FTP and I save it via FTP and PUT_factory mechamism
> 
> Can I make struct.xml accesible via a FTP file?
> 
> Thanks!!!
> 
> --
> Mis Cosas
> http://blogs.sistes.net/Garito/
> 
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com


More information about the Zope mailing list