[Zope3-Users] Content cloning ?

Thierry Florac thierry.florac at onf.fr
Tue Jan 16 06:24:01 EST 2007


Le lundi 15 janvier 2007 à 16:36 +0100, Christian Theune a écrit :
> Am Montag, den 15.01.2007, 16:06 +0100 schrieb Thierry Florac:
> >   Hi,
> > 
> > In an application I'm currently building with Zope3, I need to be able
> > to "clone" several kinds of content data.
> > While cloning a simple content class is quite simple, I don't know
> > exactly how to clone data provided through adapters, which may store
> > these data throught annotations.
> > 
> > What I was thinking about was something like :
> >  - create a new interface "IClonable", with a single "clone" method
> >  - make my specific content interfaces, eventually provided throught
> > adapters, extend IClonable
> >  - get a list of interfaces provided by my content class, directly or
> > throught adapters, which extend IClonable, and call their "clone" method
> > when cloning is required.
> > 
> > So, actually, my main problem is : 
> >  - how can I get the list of interfaces provided by a given class,
> > directly of throught adapters ?
> >  - is this conception method the best one in Python/Zope3 to clone
> > data ??
> > 
> > Thanks for any help or advise...
> 
> You might want to checkout zc.copy.

Hi,

Thanks for this link ; in fact I already downloaded "zc.copy" but just
forgot to take a look at it...

In fact, after looking at "zc.copy" package, I finally used the
"original" zope.copypastemove package function to duplicate my content
because it better feets my needs, without duplicating a set of
informations as zc.copy does but just keeping a link on them.

The last problem I still have is that some of the informations stored
into object's annotations have to be indexed into a set of catalogs.
While these informations are indexed correctly when annotations are
created "by hand" in the "normal" way, it's not the case when content is
duplicated "in a whole". Any idea ? Should I iterate over object
annotations and check for ones that should contain indexable content ?

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.florac at onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85



More information about the Zope3-users mailing list