[Zope] Cloning objects to a ZClass instance

Joachim Werner joachim.werner@iuveno.de
Wed, 19 Apr 2000 18:03:13 +0200


> > I'd like to repeat a question to the list that seems to be more complicated
> > than I thought:
> > 
> > What I want to do is have a template folder with default images etc. in a
> > container ZCLass. The item ZClasses in the container (e.g. preconfigured member
> > homepages of a portal site) should not just be able to use the templates by
> > aquisition, but the template folder should be physically copied to the ZClass
> > instances at creation time so that the template content can be easily
> > customized within the instance.
> > 
> > I tried manage_clone and other ways, but with no success so far.
> > 
> > It must work in principle because I can do simple copy&paste in the
> > management interface, and I guess everything that can be done there can be done
> > programmatically, too ...
> > 
> 
> wouldn't
> 
> <dtml-call "<ZClassinstance>.manage_clone(....)">
> 
> or just calling the clone from the zclass instance work?
> 
> Rik


That's funny. I tried

<dtml-call "manage_clone(template,'clone_of_template')">

in the section of the ZClass constructor where it says:

 "<dtml-comment>

     You can ad code that modifies the new instance here.

     For example, if you have a property sheet that you want to update
     from form values, you can call it here:

  </dtml-comment>"

While adding empty folders or updating property sheets would work, the
manage_clone wouldn't.

But if I put the same line of code into the index_html file of the ZClass, it
will execute without problems when index_html is called.

Why the difference?

Joachim.