Re: How to selectively save EO
Re: How to selectively save EO
- Subject: Re: How to selectively save EO
- From: Paul Suh <email@hidden>
- Date: Mon, 24 Apr 2006 18:36:21 -0400
Louis,
If I understand your problem correctly, you would like to put in an
audit trail whenever a user opens an EO for editing, and again once
the EO is actually changed, right? In that case, you can trigger a
save to the object graph before the user ever sees the page. The
sequence of actions is:
1) User selects which EO he wishes to edit.
2) As a part of the action method, you insert an audit EO into the
user's EC, relate it to the EO that is to be edited, then save the EC.
3) Return an edit page to the user with the EO to be edited in a page-
level editing context. As a part of instantiating the edit page,
insert another audit trail EO, indicating that the object has been
edited.
4) If the user hits save, then both the EO to be edited and the audit
trail EO that marks the edit will be saved. If the user hits cancel,
then all of the changes in the page-level editing context are thrown
away, which is exactly the desired behavior. In either case, there is
an audit trail EO saved to the DB that marks that there was an edit
attempt.
You can do similar things if a user wants to create a new EO or
delete an EO. Does this make sense?
By the way, it's not so much a newbie question as an intermediate-
level question. It is getting into the whole concept of multiple
editing contexts and how to save changes cleanly.
--Paul
Paul Suh
http://www.ps-enable.com/
email@hidden (301) 643-1516
On Apr 23, 2006, at 7:03 PM, Louis Demers wrote:
At 3:22 PM -0400 2006/04/21, Paul Suh wrote:
Louis,
Trying to save a single EO while leaving others unsaved is almost
always indicative of a problem in your application's design....
That was my initial concern and the reason I asked the question on
how to do it, knowing I would be corrected by this list if that was
a NONO 8-), I was worried that my design was flawed because it
motivated me to do this.
My application is some sort of ERP for our particular needs, and I
wanted to record some signature that someone was trying to edit
some objects. The object I wanted to save was a signature object
referring to an object that already existed in the database but
that may have been edited without being committed yet. The object
being saved is not at the discretion of the user but my own
requirement to keep track of what is being done. I could restrain
the user to a very strict paradigm, but knowing the crowd I'm
trying to please, I'd rather not.
Your comments echoed some feelings I had when I faced this
technical difficulty and a re-examination of the task has me fairly
well convinced that what I want to do is legitimate. Whether
WebObjects has the flexibility is something else, but the solutions
proposed so far , in particular "EOtilities.localInstanceOfObject"
support the idea that WebObjects has foreseen this requirement. I
do realize this special steps forces me to investigate my model/
paradigm and I will have to take the responsibility to make sure I
do not just push forward a problem in my model design.
I taught this was a newbie question , but the discussions it raised
have been most enlightening.
I implemented the solution based on
EOUtilities.localInstanceOfObject after reviewing some "Use Cases"
to evaluate the potential impacts, and I'm convinced the need is
legitimate and the solution reliable. What more can I ask. On to
the next feature.
thanks to all.
--
Louis Demers ing.
email@hidden
_______________________________________________
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