|JPA-RS hooks and/or HATEOAS? [message #904806]
||Wed, 29 August 2012 03:33
| Friso Vrolijken
Registered: August 2012
I saw some content on the JPA-RS work that's being done. It looks very promising to me. But what I can't find is where I can hook in some business logic. Let me clarify: if I've got a resource that's owned by a user, there may be some business logic that dictates:
- which users can read/update/delete that resource
- what values/sub-resources may be updated
- what possible resource states may be
For that kind of use case I'd expect some kind of hook/plug in both before and after retrieval of the resource, but I can't seem to find it. Does anybody know if it exists?
Or should that be done via ServletFilters?
Another question I've got: is there any support for HATEOAS? I'd expect foreign key relations to be available via hyperlinks, but can't find that either.
Anybody got any information on these subjects? Thanks in advance.
|Re: JPA-RS hooks and/or HATEOAS? [message #905017 is a reply to message #904806]
||Wed, 29 August 2012 11:03
| Tom Ware
Registered: July 2009
We have made our initial relase of JPA-RS and the operations that are currently supported are documented here:
(remove spaces to get the full URL)
You can find some other information here:
One key thing to understand is that this is our initial release and we are quite interested in feedback about what is good about it and what needs to be improved. We intend to steadily improve the support with each release and are quite interested in building a list of what the community would like. This forum is a great place to provide feedback (along with the users mailing list and bugzilla - for bug reports and feature requests).
As far as your specific comments/questions are concerned:
1. Business Logic
- Right now, the hook w
e have added to allow business logic is the ability to call a SessionBean. That functionality is documented in the API document above.
- Although we have not added any specific support for restricting access at this point, it is possible to use a standard Java EE User/Role based system to restrict based on an authenticated user and a URL pattern.
- Any information you can provide about what functionality you would like to see would be interesting.
- Although they are likely not strictly HATEOAS, we do provide a number of ways to get metadata about your application. Take a look at the Metadata Operations section of the API doc
- Here is an example of a JSON object that could be returned by our current implementation. The foreign references are found in the relationships property:
- We are currently working on providing additional options for dealing with foreign references and hope to be able to publish something related to that in the next few weeks.
- Once again, feedback is welcome in that area
[Updated on: Fri, 31 August 2012 10:40] by Moderator
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01430 seconds