[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17173673#comment-17173673 ] Jacques Le Roux commented on OFBIZ-4274: With OFBIZ-11328 and OFBIZ-11347 I think we can close here. I'll in a month if nobody is against... > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST, URI > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17161189#comment-17161189 ] Jacques Le Roux commented on OFBIZ-4274: Thanks Ean, [~gvasmatkar] leads the effort on REST, let's see what he think about your request... > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST, URI > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17153853#comment-17153853 ] Ean Schuessler commented on OFBIZ-4274: --- I also wrote my own REST servlet implementation for OFBiz. Some client frameworks expect the CRUD mapping to PUT, GET, POST and DELETE to work. It would be nice if we could support that. I also implemented Accept header to specify the format of the returned data as CSV, JSON, XML or even PDF. Pluggable response types ended up being something I used a lot. On Wed, Jul 8, 2020 at 1:43 PM Jacques Le Roux (Jira) -- Ean Schuessler, Brainfood Co-Founder e...@brainfood.com 214-720-0700 > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST, URI > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17153850#comment-17153850 ] Jacques Le Roux commented on OFBIZ-4274: Hi All viewers, With [~gvasmatkar]'s [effort|https://markmail.org/message/ymli7g6few4ww2rh] should we not close here? > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST, URI > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17014496#comment-17014496 ] Nicolas Malin commented on OFBIZ-4274: -- I confirm the step is now closer, with adding a missing request uri and a filter call : {code:java} diff --git framework/common/webcommon/WEB-INF/common-controller.xml framework/common/webcommon/WEB-INF/common-controller.xml index 80407c67cc..b7720187cf 100644 --- framework/common/webcommon/WEB-INF/common-controller.xml +++ framework/common/webcommon/WEB-INF/common-controller.xml @@ -105,6 +105,14 @@ under the License. + +Verify the user to return an authentication token + + + + + + diff --git framework/webtools/webapp/webtools/WEB-INF/web.xml framework/webtools/webapp/webtools/WEB-INF/web.xml index 9604febb37..f47d48c69f 100644 --- framework/webtools/webapp/webtools/WEB-INF/web.xml +++ framework/webtools/webapp/webtools/WEB-INF/web.xml @@ -45,6 +45,11 @@ under the License. component://webtools/widget/CommonScreens.xml + +JWTFilter +TokenFilter + org.apache.ofbiz.webapp.control.TokenFilter + ControlFilter ControlFilter @@ -63,6 +68,10 @@ under the License. ContextFilter org.apache.ofbiz.webapp.control.ContextFilter + +TokenFilter +/* + ControlFilter /* {code} We can use this sequence : {code:java} $ curl -k -XPOST -d USERNAME=admin -d PASSWORD=ofbiz https://localhost:8443/webtools/control/getAuthenticationToken $ curl -k -XGET -H "Authorization: Bearer ${previousToken}" https://localhost:8443/webtools/control/entity/find/Party/Company {code} > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST, URI > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17014159#comment-17014159 ] Nicolas Malin commented on OFBIZ-4274: -- [~mbrohl], I think we already have all element for the authentification. I will check if it's possible to use jwt system easily because at this time we have the event to validate a autentification by Bearer {code:java} {code} With the OFBIZ-11007, I will try to create a call example with curl to update a Party through webtools > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST, URI > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16744825#comment-16744825 ] Michael Brohl commented on OFBIZ-4274: -- I just think if we want to offer a solution to make OFBiz accessible through REST, we should take care of all related aspects using best practices. Proper authentication and security is a crucial part of it. I don't think that we should leave the users alone with that. That's a point we should take care of, which makes senses when we have the base solution up and running. But I have the strong opinion that we should not commit anything RESTful to the codebase before we have the full solution incl. authentication. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16744802#comment-16744802 ] Jacques Le Roux commented on OFBIZ-4274: Thanks for the point about revocation Mathieu. I agree, better keep what we have already and even maybe explore the \@remember annotation. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16744471#comment-16744471 ] Mathieu Lirzin commented on OFBIZ-4274: --- Hello [~mbrohl], I didn't deeply thought about authentication and REST in the context of OFBiz. My focus has been more on the routing side. Stateless communication is a constraint of the REST architectural style which allows an architecture to achieve both simplicity, robustness, and performance (via cacheability). Token based authentication is nice in that regards since it satisfies the statelessness constraint of REST, however from what I have heard and read the major drawback of token based authentication is that it makes revocation harder than with traditional stateful session based authentication. As a consequence I tend to think that OFBiz should be agnostic and let administrators/integrators plug the authentication mechanism that satisfies the requirements of their customers. However I don't have a strong opinion on that subject. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16744194#comment-16744194 ] Jacques Le Roux commented on OFBIZ-4274: That's interesting indeed Michael, thanks. It remember me about [the end of the discussion|https://markmail.org/message/ai6q2fbksowaayn4] which leaded to the creation of this Jira, where Adrian spoke about CXF and Martin Kreidenweis about [Enunciate|http://enunciate.webcohesion.com/] > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16744174#comment-16744174 ] Michael Brohl commented on OFBIZ-4274: -- We are talking about REST which should be stateless - no need to have the coller stayed logged in... It was more targeted to the usual process where you have a /login request which returns a token with which you can do subsequent REST calls without providing your credentials everytime. See [1] for a better explanation. [1] https://stackoverflow.com/questions/26777083/best-practice-for-rest-token-based-authentication-with-jax-rs-and-jersey#26778123 > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16744167#comment-16744167 ] Jacques Le Roux commented on OFBIZ-4274: BTW, it's not related to REST and only losely to your question Michael, but while at it. I stumbled upon something I did not know while working on OFBIZ-10666: https://stackoverflow.com/questions/5082846/how-to-implement-stay-logged-in-when-user-login-in-to-the-web-application/5083809#5083809 Not sure what it's worth and how/when to apply, so just telling... But it could be an alternative to our custom externalLoginKey or Tomcat SSO > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16743936#comment-16743936 ] Michael Brohl commented on OFBIZ-4274: -- Hi [~mthl], I wonder if authentication will be handled in your REST implementation also? > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16732980#comment-16732980 ] Jacques Le Roux commented on OFBIZ-4274: Thanks for the update Mathieu, not a priority for me at the moment. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16732808#comment-16732808 ] Mathieu Lirzin commented on OFBIZ-4274: --- Hello Jacques, Since the end of my internship in september 2018 I didn't work on it. The remaining things for that needs to be done are: * Multi-segment paths like {{/foo/bar/baz}} which is conflicting with the override view feature. * URI Templates (See [RFC6570|https://tools.ietf.org/html/rfc6570]) * JSON screen renderer I have some local branches containing “Work In Progress” code for those features and I plan to continue the work someday. Of course If somebody is eager to see those features implemented in {{trunk}}, I am willing to share my code and discuss the implementation choices. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16732341#comment-16732341 ] Jacques Le Roux commented on OFBIZ-4274: HI Mathieu, I'm curious too, what is the status here? > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16552000#comment-16552000 ] Taher Alkhateeb commented on OFBIZ-4274: Hi Mathieu, Are we stopping work here until we complete OFBIZ-10485? I'm asking so that I can focus my efforts on one place, as I'm getting a bit lost. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16520089#comment-16520089 ] Mathieu Lirzin commented on OFBIZ-4274: --- I have been working on a POC during the last month. What has been implemented is the support of the {{method}} attribute corresponds to OFBIZ-10438. Additionally I have worked on supporting URI templates with multi-part paths but I still need to find a solution to re-implement the support of overridden view URI without using {{RequestHandler::getOverrideViewURI.}} > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16497079#comment-16497079 ] Taher Alkhateeb commented on OFBIZ-4274: Hello Scott, I would prefer to start from your work than to start from zero, if you feel like sharing your PoC then I'd love to start from there. I would share my ideas for GraphQL perhaps _after_ I get a better idea of your work, at which time I can make more informed suggestions. One point I'd like to add is that maybe we should consider evolution over revolution. Fully replacing the services with this API might be too much of a superman task unless perhaps we do it slowly and gradually (and only if that makes sense / is necessary). Finally, I don't know what the rest of you fine folks would like to do, but for me I'd like to start with Scott's initial suggestion and create a library around it. This library / API should form the kernel of what we want to do and build on top of, so it's a necessary step 1. If you'd like to help or work on this yourself please inform me so that I can give you your space for that. Otherwise I can perhaps work on a patch and collaborate with you on it in here. Ideas and suggestions are welcomed. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16490450#comment-16490450 ] Nicolas Malin commented on OFBIZ-4274: -- Hi, with your example Scott it's more clear :) Taher I see three differents task to continue : * Improve the controller to support correctly Rest call * Create a new handler event for invoke your and Scott's approach * Create a new jsonMacroFromLibrary.ftl Mathieu started a POC on the first point so I thinks we need analyse how can works a new handler with GraphQL or RSQL. For the last, I have some ideas to do that, it's the easier part :) > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16490134#comment-16490134 ] Scott Gray commented on OFBIZ-4274: --- I had pictured that GraphQL could be layered on top of the model I was describing to allow for custom queries. I haven't looked into GraphQL mutations enough to know if it would be remotely suitable for OFBiz beyond reading data. I'd be interested in hearing more details about what you envisage. I'll be too busy for the next few months to do much beyond discussion. I do have an early rough version PoC of what I've been describing, I could share that if there's any interest but I'd need to do some cleanup and upgrade it to gradle first. All it really does so far is allow CRUD to/from the database based on a resource model and an RSQL (Rest Query Language) implementation for querying resources. There's no ECA implementation for business logic, no authorization handling etc. The most important thing to me though, is that whatever approach is taken is useful both to an external client and also within OFBiz itself. The best way to battle test something is to try and have our thousands of services and data prep scripts use it. When I get time again I'll probably do the ECA implementation for my approach and then have a go at replacing all shipment related interactions OFBiz with the new model. Doesn't mean I don't want to see alternative approaches though, it's just that I'd like to see how it works out. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16489467#comment-16489467 ] Taher Alkhateeb commented on OFBIZ-4274: Hi Scott and everyone The way you described the solution makes me think GraphQL might seems like a better fit, because it works almost the same way. Anyway, I have a few ideas for a PoC now, but I don't know if anyone is working on this so far? If not, should I submit an initial patch for discussion? Or do you folks want to collaborate somehow? Ideas > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16489084#comment-16489084 ] Jacques Le Roux commented on OFBIZ-4274: Thanks Mathieu, That's what I surmised after reading a bit more in it :) > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1642#comment-1642 ] Mathieu Lirzin commented on OFBIZ-4274: --- Hi Jacques, The Camel REST DSL will only serve as an inspiration in this project. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16488813#comment-16488813 ] Jacques Le Roux commented on OFBIZ-4274: Hi Mathieu, After having a cursory look at the Camel REST DSL I was wondering why and how you want to use it? Or do you only want to draw your inspiration from it? > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16486900#comment-16486900 ] Mathieu Lirzin commented on OFBIZ-4274: --- I agree with Scott that it is better to make OFBiz _RESTFul from the ground up_. In particular since it is already built around an HTTP API which are defined by the various implementation of the {{EventHandler}} interface. Given Roy Fielding's definition of resources, I think that “resources” shouldn't be conflated with “entities”. AIUI the notion of “resource” would be better tied to “request-map” objects because a resource is basically something that has an URI as descibed by [RFC-3986|https://tools.ietf.org/html/rfc3986?ref=binfind.com/web#section-1]: {quote}This specification does not limit the scope of what might be a resource; rather, the term "resource" is used in a general sense for whatever might be identified by a URI. Familiar examples include an electronic document, an image, a source of information with a consistent purpose (e.g., "today's weather report for Los Angeles"), a service (e.g., an HTTP-to-SMS gateway), and a collection of other resources. A resource is not necessarily accessible via the Internet; e.g., human beings, corporations, and bound books in a library can also be resources. Likewise, abstract concepts can be resources, such as the operators and operands of a mathematical equation, the types of a relationship (e.g., "parent" or "employee"), or numeric values (e.g., zero, one, and infinity). {quote} Having said that, I think the POC for manipulating entities is really interesting since the CRUD manipulations are common enough to likely generate a lot of boiler-plate. What I would advocate however is to follow an iterative approach by first introducing resources identified by nouns, allow the various HTTP methods to be handled separately ({{GET/POST}} are currently mapped to the same handler), and then define some hypermedia controls. Basically this approach is following [Richardson maturity model|https://www.martinfowler.com/articles/richardsonMaturityModel.html]. when we will have enough examples to start seeing patterns, we can start to seriously think about what kind of abstractions and DSL we want when manipulating entities more conveniently. IMHO trying to define an generic REST model upfront is likely to make us fall into clumsy abstractions, since it is unlikely that we could get the big picture at this stage. Here is a concrete proposal for the first iteration: {code:xml} {code} The choice for this *temporary* syntax is motivated by the fact that the only required change in the XML grammar is an optional method attribute which defaults to "all" to match the current behavior. To handle the {{/foo/{bar}}} paths, the {{requestHandler::doRequest}} will resolve it by adding an extra {{bar}} parameter associated with the matching value in the request object that can then be retrieved in the event Handler. I have already started to implement this. This work is accessible from [Néréide labs|https://labs.nereide.fr/10031/Communautaire/compare/trunk...rest] Additionally It would be interesting to be able to define a subset of requests that the {{request-map}} handles either with a sub-element: {code:xml} {code} or with a list of methods in the {{method}} attribute: {code:xml} ... {code} > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16486611#comment-16486611 ] Scott Gray commented on OFBIZ-4274: --- Hi Nicolas, The mapping would result in a JSON structure similar to this: {code:javascript} { "shipmentId": "1", "destinationPostalAddress": { "contactMechId": "9015" }, "destinationTelecomNumber": { "contactMechId": "9025" }, "fromParty": { "partyId": "Company" }, "shipmentItems": [ { "product": { "productId": "GZ-2644" }, "shipmentItemSeqId": "1", "quantity": 2.00, "orderShipments": [ { "orderItemSeqId": "1", "shipGroupSeqId": "1", "quantity": 2.00, "itemIssuances": [ { "issuedDateTime": "2015-05-16T10:49:17+", "quantity": 1.00, "inventoryItemId": "9001" } ], "orderId": "DEMO10090" } ] } ], "originPostalAddress": { "contactMechId": "9200" }, "primaryShipGroupSeqId": "1", "status": { "statusId": "SHIPMENT_PACKED" }, "shipmentPackages": [ { "packageContents": [ { "shipmentItemSeqId": "1", "quantity": 1.00 } ], "shipmentPackageSeqId": "1", "dateCreated": "2015-05-16T10:49:17+" } ], "toParty": { "partyId": "DemoCustomer" }, "shipmentRouteSegments": [ { "carrierPartyId": "UPS", "destTelecomNumberId": "9025", "carrierServiceStatusId": "SHRSCS_NOT_STARTED", "originFacilityId": "WebStoreWarehouse", "originTelecomNumberId": "9201", "shipmentPackages": [ { "shipmentPackageSeqId": "1" } ], "shipmentRouteSegmentId": "1", "originContactMechId": "9200", "destContactMechId": "9015", "shipmentMethodTypeId": "NEXT_DAY" } ], "originFacility": { "facilityId": "WebStoreWarehouse" }, "primaryOrderId": "DEMO10090", "type": { "shipmentTypeId": "SALES_SHIPMENT" }, "originTelecomNumber": { "contactMechId": "9201" } } {code} The API might look something like this (I'm making it up on the spot): {code:groovy} shipment = ResourceAPI.use(delegator).resource("shipment").get("1") shipment.shipmentItems.each { shipmentItem -> shipmentItem.orderShipments.each { orderShipment -> Debug.log("${shipment.shipmentId}/${shipmentItem.shipmentItemSeqId} shipped ${orderShipment.quantity} units of ${shipmentItem.product.productId} from order ${orderShipment.orderId}/${orderShipment.orderItemSeqId}") } } // perform an update on the resource shipment.status.statusId = "SHIPMENT_SHIPPED" ResourceAPI.use(delegator).resource("shipment").post(shipment) {code} So instead of working on individual table records to read and write, you'd be working on a view of the entire shipment document. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16484239#comment-16484239 ] Nicolas Malin commented on OFBIZ-4274: -- Scott, I tried to understand your example based on *Shipment* but the mutliple embedding of element *many-relation* disturb me :) If you have the time, can you give me some example on how you image or how you POC works to call orderShipments or issuances ? > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Major > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16482860#comment-16482860 ] Taher Alkhateeb commented on OFBIZ-4274: Hi Scott, Okay give me a chance to try and wrap my head around this: * So you create some kind of definition like * Once you've defined this resource, it is automatically available for GET POST and other HTTP operations If my understanding above is correct, then I like the idea, and it is consistent with the spirit of how we do things in OFBiz (behind the DSL) However, I'm not clear on what you meant by the RECAs? Does it initiate a call chain similar to SECAs? based on events-condition-action logic? And Finally, why _must_ we rewrite anything? Why not keeps things as is and just introduce this feature? > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16482251#comment-16482251 ] Scott Gray commented on OFBIZ-4274: --- One option to consider, that is maybe a bit unconventional: * Create a mapping DSL similar to entity definitions that maps a "resource" (complex JSON document) to the entity model * Implement logic similar to the entity-auto engine that allows search/get/create/update/delete operations on the resources without any additional logic beyond the mapping DSL * Implement all non-auto logic as Resource ECAs (RECAs) that can validate and modify the document and initiate operations on other related resources Rather than resulting in a REST-like set of web APIs, it would essentially make OFBiz a fully RESTful architecture from the ground up. The entire system would operate via the REST API rather than directly interacting with the delegator. Instead of dealing with the ~3700 services we have currently, we'd basically have maybe 50 or so "resources" that would represent the entire API. Obviously there would be a lot of ECA services but they could be hidden away a bit since they aren't intended to be called directly. Unfortunately it would involve re-writing pretty much everything. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16481726#comment-16481726 ] Taher Alkhateeb commented on OFBIZ-4274: I think the integration of Camel at this point is not very relevant to REST integration. We need to look at available libraries and translate the service layer to work with it. I will come back to this discussion soon with some further ideas. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16480337#comment-16480337 ] Jacques Le Roux commented on OFBIZ-4274: Hi Mathieu, Also while at it, I wonder if [Eclipse MicroProfile|https://dzone.com/articles/building-your-next-microservice-with-eclipse-micro] could not have an interest for your project. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16478390#comment-16478390 ] Shi Jinghai commented on OFBIZ-4274: Yes, swagger is suitable for api document. We're using swagger as api document. As trying to contribute a webpos2 component, I'm cleaning the api and translating the document into English. Our swagger doc in yaml format, it's more convenient than json format. We haven't used swagger as a validator until now. The only problem I met is on expressing OFBiz auth, I don't know how to define a http or https path in openapi spec. !swagger-pos-openapi.png! > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16478111#comment-16478111 ] Mathieu Lirzin commented on OFBIZ-4274: --- Indeed to document REST APIs, OpenAPI specs are useful when used in combinaison of Swagger UI. Defining the routing and the spec in the same file similarly to what [https://camel.apache.org/swagger-java.html] does would be convenient. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16478082#comment-16478082 ] Jacques Le Roux commented on OFBIZ-4274: Also I was wondering if https://swagger.io/ could not be of help in your work and its future. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16478079#comment-16478079 ] Jacques Le Roux commented on OFBIZ-4274: Hi Mathieu, This is very promising and Camel is certainly a good choice. BTW we have an [OFBizian|https://www.ofbizian.com/search/label/OFBiz] now part of the [Camel PMC|https://projects.apache.org/committee.html?camel] and still an [OFBiz PMC member|https://cwiki.apache.org/confluence/display/OFBIZ/Apache+OFBiz+PMC+Members+and+Committers] That could certainly help ;) [~bibryam] has also articles at http://camel.apache.org/articles.html and [GitHub|https://github.com/bibryam/ofbiz-camel]. This [article|http://www.ofbizian.com/2017/12/which-camel-dsl-to-choose-and-why.html] might be particularly interesting... HTH :) > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16477992#comment-16477992 ] Mathieu Lirzin commented on OFBIZ-4274: --- I have been [studying for a month|https://markmail.org/message/ulsnwg6vs53f5o5w] the various options to expose OFBiz services and entities as an HTTP REST API. The main parts of this endeavor consists in: * Defining a Domain Specific Language to associate routes to services. * Choosing a platform to handle the HTTP requests Existing Web frameworks (Juneau, CXF, Vert.x, ...) provide solutions for solving both aspects. However their DSL tend to not fit the XML configuration idiom of OFBiz, and are generally tied to a particular Language (Java, Groovy, ...). Moreover I am a bit reluctant to make OFBiz dependent on a particular framework which is not backed by a solid standard (like [JAX-RS|https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services]). Besides those web frameworks, I have discovered [Apache Camel|https://camel.apache.org/] which is a mature integration framework based on the patterns described in the excellent [Enterprise Integration Patterns|https://en.wikipedia.org/wiki/Enterprise_Integration_Patterns] book. Camel provides a [REST DSL|https://camel.apache.org/rest-dsl] which seems to fit OFBiz idioms nicely since it can be written both in XML and Java, and it handles generic endpoints. While in the long run I think It might be interesting to [integrate Camel within OFBiz|https://github.com/bibryam/ofbiz-camel] more deeply since it seems that integration of OFBiz with external solutions seems to be the norm (in my short experience), having to deal with its genericity would be a bit overwhelming for me. So what I am proposing here is to take inspiration from this REST DSL and adapt it to OFBiz. In term of infrastructure the HTTP routes will be served by a basic Java Servlet. Of course like every initial plan it will have to be reevaluated while implementing it. Suggestions and comments welcome. > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16237435#comment-16237435 ] Jacques Le Roux commented on OFBIZ-4274: Actually I'm also very interested in Vert.x. I have a related message pending since mid July about OFBIZ-9491 For me personally, it's a bit early to suggest that because I did not already follow http://vertx.io/docs/guide-for-java-devs/ This is also interesting https://github.com/jponge/vertx-gradle-plugin > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16236414#comment-16236414 ] Ean Schuessler commented on OFBIZ-4274: --- Sure, you can have a look here: https://gitlab.brainfood.com/brainfood/ofbiz-directcontrolservlet Like ControlServlet this has become its own tangle of hardcoded functionality but with different priorities. It has some things to automatically return service data as a CSV and to generate PDFs via LibreOffice. Adam and I both think that it would be a good idea to start over on something other than servlets where asynchronous calls weren't bolted on after the fact, maybe Netty or Vert.x. On Wed, Nov 1, 2017 at 6:09 AM, Jacques Le Roux (JIRA)-- Ean Schuessler, Brainfood Co-Founder e...@brainfood.com 214-720-0700 > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16233936#comment-16233936 ] Jacques Le Roux commented on OFBIZ-4274: Hi Ean, Scott Scott, yes that's possible, I have only read the annoucing email so don't know much about it Ean, it would be interesting indeed to know what you were up to :) > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16227741#comment-16227741 ] Ean Schuessler commented on OFBIZ-4274: --- We implemented a replacement for ControlServlet that allows for different methods (GET, POST, PUT, etc.) to be bound. Moqui provides this same type of support. I think the most straightforward approach is to expand ControlServlet to handle it but it is a little complicated in there. We should have done it that way in the first place but didn't want to subject others to our experiment. We are happy to release our work for discussion. -- Ean Schuessler, Brainfood Co-Founder e...@brainfood.com 214-720-0700 > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16227710#comment-16227710 ] Scott Gray commented on OFBIZ-4274: --- Juneau appears to leverage POJO <-> REST, considering OFBiz doesn't use POJOs I'm not sure if it would be much help > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16226790#comment-16226790 ] Michael Brohl commented on OFBIZ-4274: -- Apache Juneau might be worth a look also, it has just become an Apache top level project: http://juneau.apache.org > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16226591#comment-16226591 ] Jacques Le Roux commented on OFBIZ-4274: I'm also interested by this issue, before going further, I'll have a look at http://juneau.apache.org as soon as I'll get enough time to seriously do so... > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16110367#comment-16110367 ] Deepak Dixit commented on OFBIZ-4274: - Hi Taher, We can explore http://swagger.io/ as well, its integrated with moqui as well. It has Apache License 2.0 https://swagger.io/license/ > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: rest-conf.xml, RestExampleSchema.xsd, > RestXmlRepresentation.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16106957#comment-16106957 ] Jacques Le Roux commented on OFBIZ-4274: Hi Taher, Great initiative, Jersey being initially developed by Oracle I guess it's a good choice. I checked Jersey uses a CDDL license https://github.com/jersey/jersey/blob/master/LICENSE.txt. So only the API can be used http://www.apache.org/legal/resolved.html#category-b. Also "Jersey also exposes numerous extension SPIs so that developers may extend Jersey to best suit their needs." So that should be OK. Did you look/compare at/with RESTEasy after Mandeep Sidhu's suggestion: https://lists.apache.org/thread.html/Zhs84z7faup26x5 (I did not)? Maybe it's simpler? But does not cover as much as Jersey? > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: rest-conf.xml, RestExampleSchema.xsd, > RestXmlRepresentation.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (OFBIZ-4274) Implement a REST Servlet
[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16106939#comment-16106939 ] Taher Alkhateeb commented on OFBIZ-4274: I am thinking of integrating OFBiz with [Jersey|https://github.com/jersey/jersey]. Is anyone interested in exploring this with me? > Implement a REST Servlet > > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework >Affects Versions: Trunk >Reporter: Adrian Crum >Priority: Minor > Labels: REST > Attachments: rest-conf.xml, RestExampleSchema.xsd, > RestXmlRepresentation.xml > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian JIRA (v6.4.14#64029)