Re: Getting information on updated n:m relationship
Re: Getting information on updated n:m relationship
- Subject: Re: Getting information on updated n:m relationship
- From: Chuck Hill <email@hidden>
- Date: Fri, 9 Mar 2007 10:38:13 -0800
On Mar 9, 2007, at 10:20 AM, Guido Neitzer wrote:
On 09.03.2007, at 11:09, Chuck Hill wrote:
Day two without coffee. I am not sure what you are after here.
Are you looking to know when they are added / removed within a
single EOF stack? Or when the relationships cached in memory get
out of sync with what is in the db (some other process updated the
db)? Or something else?
Oh, wow - are you on deprivation?
I was. But I gave it up and put on a pot. Moderation in all things,
including moderation.
What we are trying to do is getting something like an audit trail
for that relationship. Situation:
Assume you have entity A and entity B which are joined in a simple
n:m relationship which is flattened for convenience (simple join
table, no additional stuff in there). So, when someone adds or
deletes one of those relationships we get a notification while
listening for "editingContextDidSaveChanges" but we get that on
e.g. entity A. We don't get the information WHAT was changed.
So, we are looking for the most convenient way to track those
changes to say "user XY has removed object a from category b on
date z" and so on. And we would like to have something at a level
where the relationship is actually handled, not at the page doing
that (that would be the quick and dirty hack).
Yeah, the page is the wrong place to do this. To many relationships
are kind of a pain for things like this. I think this happens during
processRecentChanges(). It's been a while and I am kind of foggy.
Maybe Mike remembers?
I'd also consider two other options. One is to alter the EOGenerator
templates so these actions are tracked directly in addTo... and
removeFrom... methods on the EOs. The other option is to use
something like the CooperatingEditingContext and put the audit code
in willSave() on the EO. Either one is probably going to be less
painful than poking about in EOF internals and both are way better
than UI based tracking.
HTH
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden