[Dev] Contact quandary
Katie Capps Parlante
capps at osafoundation.org
Mon Mar 1 17:13:36 PST 2004
Hi Jeffrey,
There's another bug related to this problem, bug #1311 (essentially a
duplicate, I think).
I think that the intent was that sectionOwner should be the inverse of
section and all subAttributes (homeSection and workSection). Indeed, the
repository does not currently support this setup well, and that causes
various problems, including the deleting problem you mention. (The
repository will complain if you call the check() method on your view of
the repository.) In theory, we could support such a setup: homeSection
and workSection are also sections. Andi had some thoughts about how the
bidirectional relationship could actually get this right, but it would
require storing more information on the link.
We talked about going back and adding workSectionFor and homeSectionFor
attributes, but decided against it as it wasn't really the solution the
design team was looking for. If it would help the work you are doing
right now (i.e. so that you could delete), you could go ahead and add
them as a temporary measure.
Also, Andi has some changes queued up (some related to delete I think),
which he will add when he gets back from vacation. If delete still
causes you problems, its likely a bug that should be addressed.
As for the subAttributes issue, its on the list to address in the next
pass through the data model. I hope to write up such a list (issues that
we've run into on the application side of things) soon.
Cheers,
Katie
Jeffrey Harris wrote:
> Hi Folks,
>
> I've been trying to get Contacts created that can be deleted, and I'm
> having problems.
>
> When I create a new Contact with homeSection or workSection set, things
> look fine. But when I try to delete the new Contact, I run into
> trouble. I filed bug 1351 for this, thinking it's a repository problem,
> but now that I've pulled my hair out a little more and looked at the
> schema more carefully, I wonder if there's a problem there.
>
> If you look at
> <http://o11n.org/docs/current/model/parcels/OSAF/contentmodel/contacts/Kinds.html#Contact>
> you'll see that homeSection and workSection don't have direct
> inverseAttributes. They do have sections as a superAttribute, but I'm
> not sure this works. Try this thought experiment:
>
> Create a Contact contact.
> Create a ContactSection section.
> Set contact.homeSection=section.
>
> At this point the bi-directional link between contact and section has
> contact.homeSection pointing to section.sectionOwner. But
> section.sectionOwner is pointing at contact.sections, not back at
> contact.homeSection, and in fact attributes may not exist.
>
> Is this a problem, or am I misunderstanding how bi-directional links work?
>
> Interestingly, when I do this in python, the repository doesn't complain
> about creating or committing contact.homeSection, but it fails whenever
> I try to delete contact. That seemed to me to be because of this
> bi-directional problem.
>
> The remedy to this, I thought, would be to create homeSectionFor and
> workSectionFor in ContactSection, and change homeSection and workSection
> to have these attributes as their inverseAttributes. That seemed to
> work, but delete still doesn't quite work, so I don't know what's going on.
>
> Sincerely,
> Jeffrey
>
>
> ------------------------------------------------------------------------
>
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Open Source Applications Foundation "Dev" mailing list
> http://lists.osafoundation.org/mailman/listinfo/dev
More information about the Dev
mailing list