[Zope] [Fwd: Re: [Zope] Need large Zen for manage_clone and getitem...]

Heiko Stoermer heiko@mig.net
Thu, 26 Aug 1999 10:00:14 +0200


> > > > hi
> > > > I already posted this on monday, but I really don't have a solution yet,
> > > > so please be patient...
> > > > The situation is nearly the same as in the CMG(Chapter "Creating a
> > > > Configuration Interface"), except for the fact that the document to be
> > > > cloned is not in the current namespace but in some other folder in the
> > > > zope tree:
> > > > I want to manage_clone an object into the current folder that lives
> > > > _somewhere_, let's say in "foo":
> > > >
> > > > /_root
> > > >         |_foo
> > > >         |      |_Object
> > > >         |
> > > >         |_bar
> > > >               |_current_folder
> > > >
> > > > there are two DTML-Documents a and b where a is an input form that
> > > > contains a list of all objects in foo.
> > > > a calls b.
> > > > b is supposed to do the following:
> > > > <!--#call "manage_clone(foo.Object,'new_html',REQUEST)"-->
> > >
> > > try something like
> > >
> > > <!--#call "manage_clone(_.getitem(foo,Object),'new_html', REQUEST)" --
> > > >
> > >
> > > where Object is the value from the form.
> >
> > o.k., the form field is named "input", so I tried:
> > ..._clone(_.getitem(foo.input),...) => Attribute error, error value input
> >
> > or even:
> > ..._clone(_.getitem(_.string.join(['foo',REQUEST['input']],'.'))  => produces
> > the correct ID "foo.Object", but produces a key error...
> >
> > so I tried to test a hardcoded name in getitem() and put this into the code:
> > ..._clone(_.getitem('foo.thename',0),...     where 'thename' is an existing
> > ID in the folder foo
> > => key error.
> > I think getitem() somehow cannot handle the object path.
> > I didn't even find the place in the source where getitem() is defined
> > The problem is that my application relies on this. I can't proceed...
> > :-(
> >
>
> One more shot in the dark (I recall trying just about every
> conceivable variation, but can't remember which worked):
> have you tried _clone(_.getitem(foo, REQUEST['input']) ???

well, yes. It gives me:
->Error Type: SystemError
->Error Value: bad argument to internal function
I think the problem is that getitem() accepts only two arguments, the
second of
which is a flag of 0 or 1, whereas in your example it would be a string.

I'm really a little annoyed... actually, this is a very simple task, but
I don't
get it.
I just tried to workaround it with manage_copyObjects() and
manage_pasteObjects()... (not very smooth),
but I get an error, too:

> The data in the clipboard could not be read, possibly due to
>           cookie data being truncated by your web browser. Try
>                         copying fewer objects.
>

Maybe someone from Digital Creations have an idea?

Heiko.


--
Heiko Stoermer
MIG Augsburg