[zope] [Zope] How to Add a File Dynamically??

Phil Harris phil.harris@zope.co.uk
Mon, 19 May 2003 14:14:03 +0100


You can use manageClone to do exactly this, example code, assuming this is 
in a python script:

context.manage_clone(someobject,'new id to create in this place')

context can of course be replaced with any folderish object, so:


somefolder.manage_clone(someobject,'new id to create in this place')

works in the same way

hth

Phil

On Mon, 19 May 2003 17:58:33 +0530, Zope@Stylus <zope@stylusinc.net> wrote:

> Hi
>
> I am working on Zope-2.5.1 installed on Mandrake Linux 9.0. I am working
> currently on a small project that functions similar to the CMF but not
> completely covering all its features.
> I am basically  trying to add a folder into the Zope Directory Structure 
> and
> then trying to upload files into the newly added folder through my web
> interface (Not ZMI)
>
> While adding a new folder I would like to add 3 files by default into the
> folder (like when i add a folder object through ZMI)
> 1) index_html - (Page Template)
> 2) tree.py - (Python Script)
> 3) getPath.zsql - (ZSQL Method)
>
> My Backend is Postgresql 7.2.2. For adding Folders and Files intot the 
> Zope
> Directory I am using External Methods which are functioning perfectly 
> fine.
> But the main issue is that when I add a folder I want that  three objects
> are added into the folder as well by default.
> a Python Script
> a Page Tenplate
> a ZSQL Method
> These three Objects should contain the code which is decided by me and is 
> a
> constant in all folders like the code in index_html for all folders.
> The Zope folder Object accomplishes this ... when we add a folder if I
> select to add a User Interface .. a default page template is added called
> index_html.
>
> I also would like to do something exactly similar.Please help me out ... 
> I m
> stuck with this for quite a few days now.
> Thanks for reading through the whole letter .. n thanks in advance for 
> all
> Help.
>
> Best Regards
> John
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.481 / Virus Database: 277 - Release Date: 5/13/2003
>
>
> _______________________________________________
> Zope maillist  -  Zope@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 )
>
>



-- 
Phil Harris