Digging up a Session object from an EOGenericRecord
Digging up a Session object from an EOGenericRecord
- Subject: Digging up a Session object from an EOGenericRecord
- From: Riccardo De Menna <email@hidden>
- Date: Sat, 7 Mar 2009 13:37:59 +0100
Hi folks,
I've encountered this issue (or similar ones) very often now and I'd
love to know how others tackle the problem.
I have implemented a standard way of adding a special timestamp to all
my records in my TGenericRecord (subclass of EOGenericRecord,
superclass of all my eo). The timestamp holds information on when a
record was last modified as well as who did it.
To do this I need to query my session for something like a
"currentUser" method inside the validateTimestamp method of my eo...
Is there a way to climb up to the Session from an EO?
One possible (failed) attempt:
One first clumsy attempt of mine was to override
defaultEditingContext() in my Session object and setting the ec
delegate object to the session itself before returning it. Then from
the eo I would ask for the ec.delegate() and get the session back.
Should work in theory, even though I dislike the fact that I use the
delegate() that's meant for other things. In practice it doesn't...
When I factor in my D2W pages my eo don't have the same ec I passed in
at factory creation time and so there's no session there.
Am I blind? Is there a fast an easy way to do it?
rdm
_______________________________________________
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