Hi David,

it'd be great if you can add this to the wiki...

On 25/04/2008, at 10:27 AM, David Holt wrote:

This is actually pretty straight forward to do. I don't know if this is the best way to accomplish saving XML objects as EOs, but it works and will hopefully help someone else!

The key is that Apache Digester provides the ability to create and call custom rules that have begin(), body() and end() methods when they hit an XML tag pattern. Use a custom rule instead of the stock ObjectCreateRule to create an EO and add it to an EditingContext BEFORE you start changing property values on the EO with the stock digester rules.

I'm using WOnder so i am using ERXEC for the editing context and when I add the related object with the rule (addToAuthors) I am taking advantage of the WOnder feature that automatically updates my inverse relationship. If you're not using WOnder you'll have to figure out where to addObjectToBothSidesOfRelationship ...

<...>

with regards,
--

Lachlan Deck



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to