Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Making URIHandlerImpl more REST-able
Making URIHandlerImpl more REST-able [message #1514384] Wed, 17 December 2014 08:53 Go to next message
Mark Hoffmann is currently offline Mark HoffmannFriend
Messages: 113
Registered: July 2009
Location: Jena
Senior Member
Hello,
we created JAX-RS applications using EMF. We serialize and deserialize the models in our REST resources.

The generated model editor makes it possible to read the model instances from a given REST URL. But saving is not so easy with many REST frameworks, because of missing content-type definitions in the request.
So, I slightly modified the org.eclipse.emf.ecore.resource.impl.URIHandlerImpl and provided a Map with the header definitions using the save options map. This map enabled additional request header settings like e.g. authentication information for the HttpUrlConnection.
Further I provided a default request header property for Content-Type with the value 'application/octet-stream' in case no header map is provided. In this case there no modification necessary for the generated editor as long as the server can handle this content-type. I tested the implementation adding the header map to the save options in the generated editor in the doSave method.

I have a patch attached based on the R2_10_maintenance branch. Should I raise a feature request in bugzilla?

Mark



Re: Making URIHandlerImpl more REST-able [message #1514823 is a reply to message #1514384] Wed, 17 December 2014 16:35 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 28963
Registered: July 2009
Senior Member
Mark,

This sounds like additional API and maintenance streams should generally
avoid API changes whenever possible. Best to examine this as part of
the master branch.


On 17/12/2014 9:54 AM, Mark Hoffmann wrote:
> Hello,
> we created JAX-RS applications using EMF. We serialize and deserialize the models in our REST resources.
>
> The generated model editor makes it possible to read the model instances from a given REST URL. But saving is not so easy with many REST frameworks, because of missing content-type definitions in the request.
> So, I slightly modified the org.eclipse.emf.ecore.resource.impl.URIHandlerImpl and provided a Map with the header definitions using the save options map. This map enabled additional request header settings like e.g. authentication information for the HttpUrlConnection.
> Further I provided a default request header property for Content-Type with the value 'application/octet-stream' in case no header map is provided. In this case there no modification necessary for the generated editor as long as the server can handle this content-type. I tested the implementation adding the header map to the save options in the generated editor in the doSave method.
>
> I have a patch attached based on the R2_10_maintenance branch. Should I raise a feature request in bugzilla?
>
> Mark
>
>
>
>
Re: Making URIHandlerImpl more REST-able [message #1514838 is a reply to message #1514823] Wed, 17 December 2014 16:54 Go to previous messageGo to next message
Mark Hoffmann is currently offline Mark HoffmannFriend
Messages: 113
Registered: July 2009
Location: Jena
Senior Member
Hello Ed,

I applied the patch to the master and it worked. Do I need a bugzilla request for it or can I push the change to gerrit?

Mark
Re: Making URIHandlerImpl more REST-able [message #1514942 is a reply to message #1514838] Wed, 17 December 2014 18:42 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 28963
Registered: July 2009
Senior Member
Mark,

Ultimately each commit is of the form "[bugzilla-id] ..." but to start
with we can live without.

On 17/12/2014 5:54 PM, Mark Hoffmann wrote:
> Hello Ed,
>
> I applied the patch to the master and it worked. Do I need a bugzilla
> request for it or can I push the change to gerrit?
>
> Mark
Previous Topic:Live vs Batch validation
Next Topic:One EClass for Two Ecore models
Goto Forum:
  


Current Time: Sun Nov 19 21:51:55 GMT 2017

Powered by FUDForum. Page generated in 0.01645 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software