0

Can I use Jersey 2.4.1 with Apahce Isis Project?

If not can I atleast extend existing RestEasy service to add more request path (application specific) which cannot be generated out of domain objects?.

For example I want to connect to Linked in or Facebook using oAuth Rest URI. Is it possible in Apache ISIS?

1 Answers1

0

You can certainly do the latter; subclass RestfulObjectsApplication and use addClass to register your additional resources, then specify your new subclass in web.xml

Dan

Dan Haywood
  • 2,215
  • 2
  • 17
  • 23
  • Hi, Thanks for the response it worked. I tried this earlier, I had made a mistake now corrected it. Its working but I still cannot mix with other jersey jars like oauth2-client-2.4.1.jar since this jar uses jax rs 2.0 api where as rest easy is using jsr311 api's. So I am getting a weird error `java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;` And how do we show the response which has returned by the API in UI? – Sunand Padmanabhan Feb 05 '14 at 09:29
  • I'm afraid that RO hasn't been upgraded to JAX-RS 2.0 yet, so that's not gonna work. Raise a ticket if you want. But so you know... the RO viewer is gonna get some serious work done on it later this year in support of Isis' next gen viewer (expected to be a single-page app, using AngularJS). So I will be upgrading it at that point anyway. In the meantime, I suspect you could run Jersey alongside the RO viewer; they're only servlets, after all. This is what we do in Isis where we have both the Wicket and RO viewers in the same webapp. Might be worth trying? – Dan Haywood Feb 06 '14 at 10:58
  • I tried to run Jersey alongside RO viewer but couldn't succeed. But can I build a Wicket UI to redirect/show the REST API Response? I am trying to build web application to handle various oAuth Client requests (for google, facebook, linked, Salesforce etc). I am creating domain objects to store the properties like client id, client secret, redirect uri etc. Ideally I want to have a button which can trigger oAuth flow which is Grant Auth Code and then fetch token. Could you please suggest me a way to achieve this in ISIS? It would help me a lot. I will also publish the code once done, Thanks! – Sunand Padmanabhan Feb 11 '14 at 11:48
  • Um, I'm not sure I really follow what you're trying to do (and even if I did, I'm no expert on oAuth...) When you talk about having domain objects with client Id, redirect Uri etc, it sounds like you want Isis to model the authentication domain itself? If so, I suppose that they could be surfaced via RO, but there would need to be some other component in your solution that acts as the RO client, actually making the calls out to these oAuth providers and then using RO/Isis for storing the state. But if I have this right, I think there are probably better matches to your reqts than Isis... – Dan Haywood Feb 12 '14 at 00:24
  • Ok, let me explain with an example, http://ga-dev-tools.appspot.com/explorer/ once you open this link you will see a query explorer for Google Analytics API. In order to execute the Query first we need to Authorize Access which is a button on top right, once clicked it opens an external window with an URL (oAuth flow happens). Once we get token then we can fire a query and fetch the result. I want to build a web app similarly for other providers like LinkedIn, Salesforce, Facebook. All i need to do is store the connection properties make an oAuth call fetch the token and access the resources. – Sunand Padmanabhan Feb 12 '14 at 04:57
  • Do you think Isis doesn't fit the above requirement? I feel that an External Link feature of Apache Wicket should suffice the requirement. Also redirecting it back to the original page. – Sunand Padmanabhan Feb 13 '14 at 22:40
  • Any Comments or thoughts on this? It will help me take some decisions, Thanks! – Sunand Padmanabhan Feb 15 '14 at 10:46
  • Hi Sunand, I honestly don't know enough about the security domain to say. But others in the Isis community might. I suggest raising this topic on the Isis users list (http://isis.apache.org/support.html). Also, why don't you start a little github project to spike this out... then I can fork it to understand a little more about where you are coming from and help develop the idea. – Dan Haywood Feb 15 '14 at 14:36
  • Thanks Dan! I will soon start a github project and will let you know. Also subscribed to the user's list and raised the question! – Sunand Padmanabhan Feb 17 '14 at 10:00