New Posts New Posts RSS Feed: SaveInterceptor on the client
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

SaveInterceptor on the client

 Post Reply Post Reply
Author
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Topic: SaveInterceptor on the client
    Posted: 08-Jan-2013 at 1:16pm
I have a need for Interception on the client (as opposed to the server) when saving. Not to do validation, but to update fields such as ModifiedOn and ModifiedBy.

I know this could be done on the server through the SaveInterceptor, but there really is no need for it to be done on the server as the data is available on the client and no need to make the server do the work.

As far as I can tell, the EntityManager.Saving event would be the best place to do this.
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 08-Jan-2013 at 3:50pm
Hi Greg,

Your comment about the EntityManager.Saving event makes sense. Per our documentation:

"The (EntityManager.Saving) event handler can use the IdeaBlade.EntityModel.EntitySavingEventArgs.Entities list to validate, modify, delete or add entities as needed."

Where you'd be modifying the entity in this case.

If you want to relief the server of some workload, that would most certainly help. (although I wouldn't expect noticeable improvement results for this particular example)

Regards,
   Silvio.

Edited by sbelini - 08-Jan-2013 at 3:51pm
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 09-Jan-2013 at 3:19am
Greg,
I believe you are using Cocktail. In Cocktail you can centrally intercept the save with an EntityManagerDelegate.

Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 09-Jan-2013 at 9:44am
Hi Marcel,

Yes, you are correct. Will check that out. Thanks to you both and have a Great New Year!

Greg
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down