In our company, we're using an EJB backend for Webservices and GWT-client.
The Service Layer is protected by Role-based Security.
I cannot see any way to use EntityProxies from GWT to access the service
layer, *it is impossible to apply the Role-based Security to a generic
EntityLocator Service* (the same Entity might be called from two totally
different UseCases).
Correct me if I'm wrong: but there is no way to use EntityProxies, I
therefore must use ValueProxies with RequestFactory.
I am aware, that when using ValueProxies, I have to manually merge Entites
into the JPA Persistence Context, first needing to lookup the entity by ID
and checking the version for Optimistic Lock problems and also checking the
relationships to be merged in (which i would like to avoid using
EntityProxies...)
*a) First problem: need to edit ValueProxy when updating*
I defined a ValueProxy that has a @ProxyForName Annotation poining to an
Entity.
When I want to update an entity with the ValueProxy, I first need to edit()
the ValueProxy on the GWT Client. Otherwise, in the RequestFactoryServlet,
all attributes of the entity are null an I run into various Exceptions on
the backend.
To me, this looks kind of strange first needing to edit a ValueProxy in
order to have all the data on the Serverside.
I would really prefer to use RequestFactory over GWT RPC, but I don't
understand why I first have to edit a ValueProxy in order to have its data
available on the server (I understand I have would to do so using
EntityProxies) .
*b) Second Problem: editing a ValueProxy must be done in the same Request
Context*
The second thing I don't like is kind of dependant to the first problem
described.
I must edit the ValueProxy in the same Context and make all changes in the
same Context.
MyRequest *req* = requestFactory.edit(myValueProxy);
myValueProxy.setAttr1("foo"):
myValueProxy.setAttr2("bar");
*req*.myUpdateMethod(myValueProxy).fire(...)
I have to do all this in the Presenter, if I dont't want to transfer the
open Request to the View.
That means, the presenter has provide a method with all editable Properties
to the view...
I would appreciate any feedback or corrections to
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.