Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 32403 invoked from network); 12 Dec 2008 05:26:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2008 05:26:48 -0000 Received: (qmail 99808 invoked by uid 500); 12 Dec 2008 05:27:00 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 99800 invoked by uid 500); 12 Dec 2008 05:27:00 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 99789 invoked by uid 99); 12 Dec 2008 05:27:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2008 21:27:00 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lawgers@gmail.com designates 74.125.44.155 as permitted sender) Received: from [74.125.44.155] (HELO yx-out-1718.google.com) (74.125.44.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 05:26:45 +0000 Received: by yx-out-1718.google.com with SMTP id 3so585578yxi.82 for ; Thu, 11 Dec 2008 21:26:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=MFqdD+slNkjk/Z13RTaZ7v80RZlWpVl4qLbbwrOLAfs=; b=ElK8u4zO4ovkwu7imvx+N/XYHXzh/2bffBGp2VuQBaV8gGC2Nq7RH0rJ7gNpri+N3Z 7q0eCPFGudcR9bGkTTFVJsJ1XZNTRKaE1wXjAl3CR8aPdcqN4q44yKQcMMYv7wXUf2Te AhJ51MHYf/hbQY2M0Wn6mJE7nAidWjQxNH/vg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=xJ/bVg8KyI3VSB4qeeKlWeBRhzSwq7Pdk7Zp76oQutjB9i7Kbb4E3aSLOCzRrckuYx QVrAjvoi0+yRhhyMYITby0Lo8JS1GnOX9Sb2zAN+bT6W+hg5xhavmIjKKiBQQHMP9Sk0 c35t28LbR5HhJxJAPi0S7PUXC/RpEzpoxTEIo= Received: by 10.65.214.19 with SMTP id r19mr2754770qbq.20.1229059583984; Thu, 11 Dec 2008 21:26:23 -0800 (PST) Received: from ?192.168.1.200? ([76.14.65.15]) by mx.google.com with ESMTPS id p27sm2103463qbp.14.2008.12.11.21.26.22 (version=SSLv3 cipher=RC4-MD5); Thu, 11 Dec 2008 21:26:23 -0800 (PST) Message-Id: <303BF81F-739A-410D-B920-8E1FD76F56D4@gmail.com> From: Lawrence Gerstley To: user@cayenne.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Proper use of nesting DataContexts in RCP Date: Thu, 11 Dec 2008 21:26:21 -0800 X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org Hello, I've been using Cayenne quite successfully for sometime in creating my Eclipse RCP applications, but there is something that has flummoxed me for sometime, and was wondering about best practices. I've been creating a childDataContext (let's call in EDITORCHILDCTXT) every time I open up an EditorPart, so that it can use the Eclipse dirty/save model. This works fine, but a problem arises when I have dialogs in the editor. If I was editing, say, an ontological concept--let's call in CONCEPT, and it has 0-many PROPERTY, I might have a dialog window pop-up to create that property. The first thing I want to do in such a dialog is to create a CANDIDATE_PROPERTY, and add it to CONCEPT1. To do this, I would create a childDataContext (called DIALOGCHILDCTXT) as a child of EDITORCHILDCTXT. Now, ideally, I'd create and register a new PROPERTY and add it to the CONCEPT1 (something like "addToConceptProperties"). The problem, of course, is that the newly created PROPERTY1 is in DIALOGCHILDCONTEXT, and CONCEPT1 is in EDITORCHILDCTXT. The desired behavior is to be able to use a button in the dialog, rollback and close DIALOGCHILDCONTEXT, losing the PROPERTY information, but leaving any changes to CONCEPT1 in EDITORCHILDCTXT intact, and commit only if the user confirms a save in that editor. Now, I don't think that I want to move CONCEPT1 to the DIALOGCHILDCONTEXT when I open the dialog--doesn't that mean that I'd have to move it back when I close said dialog? Or do I want to get another copy of CONCEPT1 in the DIALOGCHILDCTXT to use for the addition of the new PROPERTY, and if I do that, how can I inform CONCEPT1 in the EDITORCHILDCTXT that it has a new PROPERTY, but not lose any of its other changes? Or, does this type of paradigm just not work here? Or, finally, am I just missing something terribly obvious, and have made a fool of myself. :) I've gone back and read some of your 2007 discussions about connecting relationships between different contexts, and combed through the documentation, but really can't determine how to do this without forcing premature commits, breaking the editor dirty/save paradigm. If you have any thoughts, I'd love to hear them! Many thanks, Lawrence ================================== lawgers@gmail.com