Hash: SHA1

I put some minimal files together and uploaded them to the Collector so
that the problem should be more clear.

Some remarks about the IRC log (2006-08-17):
> faassen       so that if he changes something in the original, it also 
> changes in the copy, or vice versa"

I do not change something in the original so there is no change in the
copy. Let me explain what had happen.

The object name in a container should be the same as the value in a
datafield. If you add an object the NameChooser takes the value from
this datafield.

If you want to copy an object in the ZMI the copy must have another
object name because the names in a container must be unambigous. So the
NameChooser find a new name. The solution is to supplement the object
name with a prefix. In my solution this is the prefix "Copy". If the
original object has the object name "kitchen" the copy gets the name
"Copykitchen". An as the name of the object should be the same as the
value of the datafield (from which the object name originally comes) the
datafield in the copy is changed from the NameChooser accordlingly. So
in the datafield von object "Copykitchen" we find the value
"Copykitchen". That is correct. The change in this datafield doesn't
happened manually. It happens by the NameChooser.

> philiKON      his logic in the namechooser seems bogus too

Can you please be more specific?



- -------- Original-Nachricht --------
Betreff: [Z3d] 562/ 3 Reject "ObjectCopier must copy not reference the


Issue #562 Update (Reject) "ObjectCopier must copy not reference the object"
 Status Rejected, community/issue critical
To followup, visit:

= Reject - Entry #3 by faassen on Aug 17, 2006 7:46 am

 Status: Pending => Rejected

I'm not sure I understand the report fully. The claim is that no copy is
made by the ObjectCopier but references are made only. This is not true
for the ObjectCopier - it does make copies (though in some cases it will
make references if there is a reference in the object to an object in
another location).

It's possible something special happens in case of the use of the object
name. More details are needed here.

For the time being, I'm going to reject this issue, but please
give us a more detailed description about what's going on first.

= Edit - Entry #2 by srichter on Jun 16, 2006 8:20 am

 Changes: submitter email, importance (medium => critical)
= Request - Entry #1 by Frerich on Mar 3, 2006 5:14 pm

In my application one of the contenttype datafields should be the
objectname in the container. With a subclass of NameChooser I managed to
add content objects into the container with an objectname which is
identical with a name in a datafield.

In the container view it is possible to select id(s) for copying and
then to paste the selected objects into the same or into another container.

If the objectname of a pasted object is already in the container the
UserError "The given name is already being used" is triggered. Therefore
I programmed in the NameChooser:

    def chooseName(self, name, object):
        name = object.RaumName
            self.checkName(name, object)
        except UserError, e:
            if str(e) == "The given name is already being used":
                object.RaumName = u"Copy" + object.RaumName
                self.chooseName('', object)
                name = object.RaumName
                return name
        return name

So we get unambiguous objectnames for the container (maybe

And the datafield in the object (here: RaumName) is synchronized with
the objectname.

Since the ObjectCopier doesn't create a real copy but references only
the object the datafield is changed in two objects: in the *original*
object and the copied object. And the content of datafield in the
original object (something with "Copy") is different from the objectname
(without "Copy").

- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

Version: GnuPG v1.4.2.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to