Re: buildbot exception in on ofbizTrunkFrameworkPlugins

2020-08-02 Thread Suraj Khurana
All good on the local machine.

--

Best Regards,
Suraj Khurana
Senior Technical Consultant


On Mon, Aug 3, 2020 at 10:15 AM  wrote:

> The Buildbot has detected a build exception on builder
> ofbizTrunkFrameworkPlugins while building ofbiz-plugins. Full details are
> available at:
> https://ci.apache.org/builders/ofbizTrunkFrameworkPlugins/builds/1581
>
> Buildbot URL: https://ci.apache.org/
>
> Buildslave for this Build: asf945_ubuntu
>
> Build Reason: The AnyBranchScheduler scheduler named
> 'onTrunkPluginsCommit' triggered this build
> Build Source Stamp: [branch trunk] b65d9c94df18ab57357111ee6365287f40fd1282
> Blamelist: Suraj Khurana 
>
> BUILD FAILED: exception build upload test-results part 1
>
> Sincerely,
>  -The Buildbot
>
>
>
>


Re: ParameterNumber checkstyle rule

2020-08-02 Thread Suraj Khurana
Thanks Jacques.

10 looks good to me as well.

I have created a Jira and uploaded patch for this:
https://issues.apache.org/jira/browse/OFBIZ-11931

--
Best Regards,
Suraj Khurana
Senior Technical Consultant


On Thu, Jul 30, 2020 at 2:10 PM Jacques Le Roux <
jacques.le.r...@les7arts.com> wrote:

> 10?
>
> Le 29/07/2020 à 17:53, Suraj Khurana a écrit :
> > Hello team,
> >
> > Currently there are around 175 issues due parameter count in java methods
> >
> > Its default value is 7 [1], we should decide this configuration for
> > checkstyle. In current code, there are some methods having around 20
> > parameters (addOrIncreaseItem).
> >
> > [1]:
> >
> https://checkstyle.sourceforge.io/apidocs/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheck.html
> >
> > Please share your thoughts on this.
> >
> > --
> > Best Regards,
> > Suraj Khurana
> > Senior Technical Consultant
>
>


Re: MethodLength checkstyle rule

2020-08-02 Thread Suraj Khurana
Thanks Jacques,

I think we can go with 500, I have uploaded the patch on the ticket
(OFBIZ-11915).

--
Best Regards,
Suraj Khurana
Senior Technical Consultant


On Thu, Jul 30, 2020 at 2:06 PM Jacques Le Roux <
jacques.le.r...@les7arts.com> wrote:

> Hi Suraj,
>
> Has I had no ideas about the best length, I was to suggest to add the 2
> number (150+945) and to divide the total by 2.
>
> This gives us around 550, I'd have suggested 500, but 450 is fine with me.
>
> Thanks
>
> Jacques
>
> Le 29/07/2020 à 19:47, Suraj Khurana a écrit :
> > Hello team,
> >
> > Any thoughts on this, IMO we can make it to 450 or something, it's quite
> > readable by then.
> > Please suggest.
> >
> > --
> >
> > Best Regards,
> > Suraj Khurana
> > Senior Technical Consultant
> >
> >
> > On Sun, Jul 26, 2020 at 9:12 PM Suraj Khurana 
> > wrote:
> >
> >> Hello team,
> >>
> >> Currently there are around 200 issues due method length.
> >>
> >> Its default value is 150, we need to decide this configuration. In
> current
> >> code, maximum method length I noticed is of 945 lines
> >> (createOrder#OrderServices.java)
> >>
> >> I have created OFBIZ-11915 for this, we can continue this effort as per
> >> conclusions drawn in this thread.
> >>
> >> Please share your thoughts on this.
> >> --
> >> Best Regards,
> >> Suraj Khurana
> >> SENIOR TECHNICAL CONSULTANT
> >> mobile: +91 9669750002
> >> email: suraj.khur...@hotwax.co
> >> *www.hotwax.co *
> >>
>


Re: REST implementation

2020-08-02 Thread Girish Vasmatkar
Hi Daniel

You can use the JWT token in the README of. Sorry, if it is not clearly
documented, this will be improved upon further as I make more changes.
https://github.com/girishvasmatkar/ofbiz-plugins/tree/trunk/ofbiz-rest-impl

I need to implement an API endpoint that eventually generates a JWT token
that can be issued to the client to make subsequent API calls. Until then,
please use the once mentioned in the README examples. That JWT has userId
claim value as admin assuming admin would have got himself authenticated
and a JWT was issued to him.

I will soon add an API endpoint to issue JWTs and will update README
accordingly. I hope that answers your question.

Best Regards,
Girish







On Sun, Aug 2, 2020 at 3:21 PM Daniel Watford  wrote:

> Hi Girish,
>
> I wanted to try out some REST calls using Swagger-ui (
> https://localhost:8443/docs/swagger-ui.html) but don't know how to
> authenticate to get a JWT.
>
> Apologies if I missed the instructions elsewhere but please could you
> advise on how to authenticate against the REST api?
>
> Thanks,
>
> Dan.
>
> On Fri, 31 Jul 2020 at 09:34, Girish Vasmatkar <
> girish.vasmat...@hotwaxsystems.com> wrote:
>
> > Greetings!
> >
> > I have created a PR to add a REST component -
> > https://github.com/apache/ofbiz-plugins/pull/35 . Please take a look
> > and let me know what you think and let me know if you face any issues. I
> > intend to merge it in a week from now.
> >
> > With the PR (https://github.com/apache/ofbiz-framework/pull/214) to add
> > "action" attribute to the service definition now merged, this above
> > component should be able to expose exportable (export=true) and
> > actionable(action=GET|POST) services via REST.
> >
> > Once the changes for nested attributes (OFBIZ-11902
> > ) are done, I will
> also
> > be making corresponding changes in the GraphQL plugin to account for
> nested
> > attributes. OFBIZ-11902
> >  will
> > help in defining complex GraphQL mutations.
> >
> > I am parallelly also working on designing an XML DSL for REST that should
> > allow tying up REST resources with OFBiz services.
> >
> > Best,
> > Girish
> >
> >
> >
> > On Thu, Jul 9, 2020 at 6:27 PM Shi Jinghai  wrote:
> >
> > > Hi Girish,
> > >
> > > Yes, you got it.
> > >
> > > Web browser will popup a login dialog when response code is 401:
> > > setResponseHeader("WWW-Authenticate", "Bearer realm=\"authentication
> > > required\"");
> > >
> > > The popup is skipped and then react/vue/angular can handle the
> response:
> > > setResponseHeader("WWW-Authenticate", "OFBiz realm=\"authentication
> > > required\"");
> > >
> > >
> > > 发件人: Girish Vasmatkar
> > > 发送时间: 2020年7月9日 14:54
> > > 收件人: dev@ofbiz.apache.org
> > > 主题: Re: REST implementation
> > >
> > > Hi Shi
> > >
> > > Thanks for taking a look at it. I have a question on "WWW-Authenticate"
> > > header so please clarify and I can make appropriate changes
> accordingly -
> > >
> > > All I am finding is that to prevent the pop-up, either return 403
> (which
> > I
> > > do not want to do) or not include "WWW-Authenticate" header at all (not
> > > inclined to do this as well because then we would be violating the
> spec).
> > > Do you mean to NOT start the value of the header with "Bearer" ?
> > > so instead of below
> > >
> > > *WWW-Authenticate: Bearer realm="Access to OFBiz", charset="UTF-8"*
> > >
> > > should we change it to
> > >
> > > *WWW-Authenticate: xBearer realm="Access to OFBiz", charset="UTF-8"*
> > >
> > > I did not test it, but I can just change it like this without testing
> if
> > > you can please confirm it will prevent the browser dialog.
> > >
> > > Thanks again for the review.
> > >
> > > Best,
> > > Girish
> > >
> > > On Wed, Jul 8, 2020 at 8:45 PM Shi Jinghai 
> wrote:
> > >
> > > > Hi Girish,
> > > >
> > > > Excellent.
> > > >
> > > > Only one suggestion from my quick view, when response code is 401,
> the
> > > > "WWW-Authenticate" header should be set to start with a word NOT
> > “Bearer
> > > > …”, this can prevent web browser from popping up a login dialog.
> > > >
> > > > Kind Regards,
> > > >
> > > > Shi Jinghai
> > > >
> > > > 发件人: Girish Vasmatkar
> > > > 发送时间: 2020年7月8日 20:47
> > > > 收件人: dev@ofbiz.apache.org
> > > > 主题: Re: REST implementation
> > > >
> > > > Hi Folks
> > > >
> > > > I have added support for OpenApi Integration. The updated code can be
> > > found
> > > > here : https://github.com/girishvasmatkar/ofbiz-rest-impl. Please go
> > > > through the changes and test at your end and let me know your
> thoughts.
> > > >
> > > > I am planning to do some refactoring and then raise initial PR for
> the
> > > > plug-in if the changes look good to everyone.
> > > >
> > > > Best,
> > > > Girish
> > > >
> > > >
> > > > On Wed, Jun 17, 20

Re: REST implementation

2020-08-02 Thread Girish Vasmatkar
Hi Jacques

Thanks for taking a look at this. Since, REST does not define any WSDL,
rather WADL, we can try to show it, however, since it is a component as a
starting point, it would probably be good if we can show WADL, if and when
it gets included in the framework. Because request coming to webtools
(show_wadl=true) will eventually be handled by the REST component to fetch
WADL. Also, as you figured out, Swagger is there too to describe the
service details.

Also, I will make the changes as you suggested in the OpenAPI
configuration. On 404, yes, that's normal because there is no resource at
the ROOT at the moment. This can however be a good addition if this URL can
return all resource definitions. I will make note of it and try to
implement it.

Best Regards,
Girish








On Sun, Aug 2, 2020 at 2:47 PM Jacques Le Roux 
wrote:

> At https://localhost:8443/rest/ I get a 404 and in log
>
> javax.ws.rs.NotFoundException: HTTP 404 Not Found
>  at
> org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:250)
>  at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
>  at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
>  at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
>  at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
>  at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
>  at
> org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
>  at
> org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232)
>  at
> org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
>  at
> org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
>  at
> org.glassfish.jersey.servlet.ServletContainer.serviceImpl(ServletContainer.java:386)
>  at
> org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:561)
>  at
> org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:502)
>  at
> org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:439)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>  at
> org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>  at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
>  at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
>  at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
>  at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
>  at
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
>  at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
>  at
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
>  at
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
>  at
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
>  at org.apache.tomcat.util.net
> .NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589)
>  at org.apache.tomcat.util.net
> .SocketProcessorBase.run(SocketProcessorBase.java:49)
>  at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>  at java.lang.Thread.run(Thread.java:748)
>
> Normal?
>
> Le 02/08/2020 à 11:14, Jacques Le Roux a écrit :
> > I get that we have this information at
> >
> > https://localhost:8443/docs/swagger-ui.html
> >
> > like with
> >
> >
> https://localhost:8443/docs/swagger-ui.html#/Exported%20Services/findProductById
> >
> > So I guess we can put a link to that, rigth?
> >
> > Also there is no of...@apache.org (at
> OpenApiResource::buildOpenApiContact) I'd suggest dev@ofbiz.apache.org
> >
> > For "Terms of service" I suggest a link to ASL2 and to remove the below
> direct link to it.
> >
> > BTW thanks Girish, this is really a great step forward :)
> >
> > Jacques
> >
> >
> > Le 02/

Re: REST implementation

2020-08-02 Thread Daniel Watford
Hi Girish,

I wanted to try out some REST calls using Swagger-ui (
https://localhost:8443/docs/swagger-ui.html) but don't know how to
authenticate to get a JWT.

Apologies if I missed the instructions elsewhere but please could you
advise on how to authenticate against the REST api?

Thanks,

Dan.

On Fri, 31 Jul 2020 at 09:34, Girish Vasmatkar <
girish.vasmat...@hotwaxsystems.com> wrote:

> Greetings!
>
> I have created a PR to add a REST component -
> https://github.com/apache/ofbiz-plugins/pull/35 . Please take a look
> and let me know what you think and let me know if you face any issues. I
> intend to merge it in a week from now.
>
> With the PR (https://github.com/apache/ofbiz-framework/pull/214) to add
> "action" attribute to the service definition now merged, this above
> component should be able to expose exportable (export=true) and
> actionable(action=GET|POST) services via REST.
>
> Once the changes for nested attributes (OFBIZ-11902
> ) are done, I will also
> be making corresponding changes in the GraphQL plugin to account for nested
> attributes. OFBIZ-11902
>  will
> help in defining complex GraphQL mutations.
>
> I am parallelly also working on designing an XML DSL for REST that should
> allow tying up REST resources with OFBiz services.
>
> Best,
> Girish
>
>
>
> On Thu, Jul 9, 2020 at 6:27 PM Shi Jinghai  wrote:
>
> > Hi Girish,
> >
> > Yes, you got it.
> >
> > Web browser will popup a login dialog when response code is 401:
> > setResponseHeader("WWW-Authenticate", "Bearer realm=\"authentication
> > required\"");
> >
> > The popup is skipped and then react/vue/angular can handle the response:
> > setResponseHeader("WWW-Authenticate", "OFBiz realm=\"authentication
> > required\"");
> >
> >
> > 发件人: Girish Vasmatkar
> > 发送时间: 2020年7月9日 14:54
> > 收件人: dev@ofbiz.apache.org
> > 主题: Re: REST implementation
> >
> > Hi Shi
> >
> > Thanks for taking a look at it. I have a question on "WWW-Authenticate"
> > header so please clarify and I can make appropriate changes accordingly -
> >
> > All I am finding is that to prevent the pop-up, either return 403 (which
> I
> > do not want to do) or not include "WWW-Authenticate" header at all (not
> > inclined to do this as well because then we would be violating the spec).
> > Do you mean to NOT start the value of the header with "Bearer" ?
> > so instead of below
> >
> > *WWW-Authenticate: Bearer realm="Access to OFBiz", charset="UTF-8"*
> >
> > should we change it to
> >
> > *WWW-Authenticate: xBearer realm="Access to OFBiz", charset="UTF-8"*
> >
> > I did not test it, but I can just change it like this without testing if
> > you can please confirm it will prevent the browser dialog.
> >
> > Thanks again for the review.
> >
> > Best,
> > Girish
> >
> > On Wed, Jul 8, 2020 at 8:45 PM Shi Jinghai  wrote:
> >
> > > Hi Girish,
> > >
> > > Excellent.
> > >
> > > Only one suggestion from my quick view, when response code is 401, the
> > > "WWW-Authenticate" header should be set to start with a word NOT
> “Bearer
> > > …”, this can prevent web browser from popping up a login dialog.
> > >
> > > Kind Regards,
> > >
> > > Shi Jinghai
> > >
> > > 发件人: Girish Vasmatkar
> > > 发送时间: 2020年7月8日 20:47
> > > 收件人: dev@ofbiz.apache.org
> > > 主题: Re: REST implementation
> > >
> > > Hi Folks
> > >
> > > I have added support for OpenApi Integration. The updated code can be
> > found
> > > here : https://github.com/girishvasmatkar/ofbiz-rest-impl. Please go
> > > through the changes and test at your end and let me know your thoughts.
> > >
> > > I am planning to do some refactoring and then raise initial PR for the
> > > plug-in if the changes look good to everyone.
> > >
> > > Best,
> > > Girish
> > >
> > >
> > > On Wed, Jun 17, 2020 at 4:54 PM Carsten Schinzer <
> > > cars...@dcs-verkaufssysteme.de> wrote:
> > >
> > > > Hi Girish,
> > > >
> > > > Thanks to clarify :)
> > > > What caught me on the OpenAPI integration is the snippet quoted below
> > and
> > > > I realize I should have read it in context. Actually then it is
> aligned
> > > > with my view.
> > > >
> > > > Warm regards
> > > >
> > > > Carsten
> > > >
> > > > > Initial implementation does not contain OpenApi integration
> yet.
> > > And
> > > >
> > > >
> > >
> > >
> >
> >
>


-- 
Daniel Watford


Re: REST implementation

2020-08-02 Thread Jacques Le Roux

At https://localhost:8443/rest/ I get a 404 and in log

javax.ws.rs.NotFoundException: HTTP 404 Not Found
    at 
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:250)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
    at 
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
    at 
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232)
    at 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)
    at 
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
    at 
org.glassfish.jersey.servlet.ServletContainer.serviceImpl(ServletContainer.java:386)
    at 
org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:561)
    at 
org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:502)
    at 
org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:439)
    at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at 
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
    at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
    at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
    at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
    at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589)
    at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

Normal?

Le 02/08/2020 à 11:14, Jacques Le Roux a écrit :

I get that we have this information at

https://localhost:8443/docs/swagger-ui.html

like with

https://localhost:8443/docs/swagger-ui.html#/Exported%20Services/findProductById

So I guess we can put a link to that, rigth?

Also there is no of...@apache.org (at OpenApiResource::buildOpenApiContact) I'd 
suggest dev@ofbiz.apache.org

For "Terms of service" I suggest a link to ASL2 and to remove the below direct 
link to it.

BTW thanks Girish, this is really a great step forward :)

Jacques


Le 02/08/2020 à 09:40, Jacques Le Roux a écrit :

Hi Girish,

I'm just starting to review so I may miss things. Just a question for now. We 
have an option at

https://demo-trunk.ofbiz.apache.org/webtools/control/ServiceList?sel_service_name=testScv

to  (Show wsdl 
)

Would it be possible to have the same for REST?

Thanks

Jacques

Le 31/07/2020 à 10:32, Girish Vasmatkar a écrit :

Greetings!

I have created a PR to add a REST component -
https://github.com/apache/ofbiz-plugins/pull/35 . Please take a look
and let me know what you think and let me know if you face any issues. I
intend to merge it in a week from now.

With the PR (https://github.com/apache/ofbiz-framework/pull/214) to add
"action" attribute to the service definition now merged, this above
component should be able to expose exportable (export=true) and
actionable(action=GET|POST) services via REST.

Once the changes for nested attributes (OFBIZ-11902


Re: REST implementation

2020-08-02 Thread Jacques Le Roux

I get that we have this information at

https://localhost:8443/docs/swagger-ui.html

like with

https://localhost:8443/docs/swagger-ui.html#/Exported%20Services/findProductById

So I guess we can put a link to that, rigth?

Also there is no of...@apache.org (at OpenApiResource::buildOpenApiContact) I'd 
suggest dev@ofbiz.apache.org

For "Terms of service" I suggest a link to ASL2 and to remove the below direct 
link to it.

BTW thanks Girish, this is really a great step forward :)

Jacques


Le 02/08/2020 à 09:40, Jacques Le Roux a écrit :

Hi Girish,

I'm just starting to review so I may miss things. Just a question for now. We 
have an option at

https://demo-trunk.ofbiz.apache.org/webtools/control/ServiceList?sel_service_name=testScv

to  (Show wsdl 
)

Would it be possible to have the same for REST?

Thanks

Jacques

Le 31/07/2020 à 10:32, Girish Vasmatkar a écrit :

Greetings!

I have created a PR to add a REST component -
https://github.com/apache/ofbiz-plugins/pull/35 . Please take a look
and let me know what you think and let me know if you face any issues. I
intend to merge it in a week from now.

With the PR (https://github.com/apache/ofbiz-framework/pull/214) to add
"action" attribute to the service definition now merged, this above
component should be able to expose exportable (export=true) and
actionable(action=GET|POST) services via REST.

Once the changes for nested attributes (OFBIZ-11902
) are done, I will also
be making corresponding changes in the GraphQL plugin to account for nested
attributes. OFBIZ-11902
 will
help in defining complex GraphQL mutations.

I am parallelly also working on designing an XML DSL for REST that should
allow tying up REST resources with OFBiz services.

Best,
Girish



On Thu, Jul 9, 2020 at 6:27 PM Shi Jinghai  wrote:


Hi Girish,

Yes, you got it.

Web browser will popup a login dialog when response code is 401:
setResponseHeader("WWW-Authenticate", "Bearer realm=\"authentication
required\"");

The popup is skipped and then react/vue/angular can handle the response:
setResponseHeader("WWW-Authenticate", "OFBiz realm=\"authentication
required\"");


发件人: Girish Vasmatkar
发送时间: 2020年7月9日 14:54
收件人: dev@ofbiz.apache.org
主题: Re: REST implementation

Hi Shi

Thanks for taking a look at it. I have a question on "WWW-Authenticate"
header so please clarify and I can make appropriate changes accordingly -

All I am finding is that to prevent the pop-up, either return 403 (which I
do not want to do) or not include "WWW-Authenticate" header at all (not
inclined to do this as well because then we would be violating the spec).
Do you mean to NOT start the value of the header with "Bearer" ?
so instead of below

*WWW-Authenticate: Bearer realm="Access to OFBiz", charset="UTF-8"*

should we change it to

*WWW-Authenticate: xBearer realm="Access to OFBiz", charset="UTF-8"*

I did not test it, but I can just change it like this without testing if
you can please confirm it will prevent the browser dialog.

Thanks again for the review.

Best,
Girish

On Wed, Jul 8, 2020 at 8:45 PM Shi Jinghai  wrote:


Hi Girish,

Excellent.

Only one suggestion from my quick view, when response code is 401, the
"WWW-Authenticate" header should be set to start with a word NOT “Bearer
…”, this can prevent web browser from popping up a login dialog.

Kind Regards,

Shi Jinghai

发件人: Girish Vasmatkar
发送时间: 2020年7月8日 20:47
收件人: dev@ofbiz.apache.org
主题: Re: REST implementation

Hi Folks

I have added support for OpenApi Integration. The updated code can be

found

here : https://github.com/girishvasmatkar/ofbiz-rest-impl. Please go
through the changes and test at your end and let me know your thoughts.

I am planning to do some refactoring and then raise initial PR for the
plug-in if the changes look good to everyone.

Best,
Girish


On Wed, Jun 17, 2020 at 4:54 PM Carsten Schinzer <
cars...@dcs-verkaufssysteme.de> wrote:


Hi Girish,

Thanks to clarify :)
What caught me on the OpenAPI integration is the snippet quoted below

and

I realize I should have read it in context. Actually then it is aligned
with my view.

Warm regards

Carsten


Initial implementation does not contain OpenApi integration yet.

And








Re: REST implementation

2020-08-02 Thread Jacques Le Roux

Not a big deal, saw that when applying as a patch:

git apply 35.patch
35.patch:364: trailing whitespace.
* GET /rest/services/{serviceName}?inParams=
35.patch:765: trailing whitespace.
    xmlns:xl="http://www.w3.org/1999/xlink";
35.patch:2813: trailing whitespace.

35.patch:486: new blank line at EOF.
+
35.patch:772: new blank line at EOF.
+
warning: 5 lines add whitespace errors.

Jacques

Le 02/08/2020 à 09:40, Jacques Le Roux a écrit :

Hi Girish,

I'm just starting to review so I may miss things. Just a question for now. We 
have an option at

https://demo-trunk.ofbiz.apache.org/webtools/control/ServiceList?sel_service_name=testScv

to  (Show wsdl 
)

Would it be possible to have the same for REST?

Thanks

Jacques

Le 31/07/2020 à 10:32, Girish Vasmatkar a écrit :

Greetings!

I have created a PR to add a REST component -
https://github.com/apache/ofbiz-plugins/pull/35 . Please take a look
and let me know what you think and let me know if you face any issues. I
intend to merge it in a week from now.

With the PR (https://github.com/apache/ofbiz-framework/pull/214) to add
"action" attribute to the service definition now merged, this above
component should be able to expose exportable (export=true) and
actionable(action=GET|POST) services via REST.

Once the changes for nested attributes (OFBIZ-11902
) are done, I will also
be making corresponding changes in the GraphQL plugin to account for nested
attributes. OFBIZ-11902
 will
help in defining complex GraphQL mutations.

I am parallelly also working on designing an XML DSL for REST that should
allow tying up REST resources with OFBiz services.

Best,
Girish



On Thu, Jul 9, 2020 at 6:27 PM Shi Jinghai  wrote:


Hi Girish,

Yes, you got it.

Web browser will popup a login dialog when response code is 401:
setResponseHeader("WWW-Authenticate", "Bearer realm=\"authentication
required\"");

The popup is skipped and then react/vue/angular can handle the response:
setResponseHeader("WWW-Authenticate", "OFBiz realm=\"authentication
required\"");


发件人: Girish Vasmatkar
发送时间: 2020年7月9日 14:54
收件人: dev@ofbiz.apache.org
主题: Re: REST implementation

Hi Shi

Thanks for taking a look at it. I have a question on "WWW-Authenticate"
header so please clarify and I can make appropriate changes accordingly -

All I am finding is that to prevent the pop-up, either return 403 (which I
do not want to do) or not include "WWW-Authenticate" header at all (not
inclined to do this as well because then we would be violating the spec).
Do you mean to NOT start the value of the header with "Bearer" ?
so instead of below

*WWW-Authenticate: Bearer realm="Access to OFBiz", charset="UTF-8"*

should we change it to

*WWW-Authenticate: xBearer realm="Access to OFBiz", charset="UTF-8"*

I did not test it, but I can just change it like this without testing if
you can please confirm it will prevent the browser dialog.

Thanks again for the review.

Best,
Girish

On Wed, Jul 8, 2020 at 8:45 PM Shi Jinghai  wrote:


Hi Girish,

Excellent.

Only one suggestion from my quick view, when response code is 401, the
"WWW-Authenticate" header should be set to start with a word NOT “Bearer
…”, this can prevent web browser from popping up a login dialog.

Kind Regards,

Shi Jinghai

发件人: Girish Vasmatkar
发送时间: 2020年7月8日 20:47
收件人: dev@ofbiz.apache.org
主题: Re: REST implementation

Hi Folks

I have added support for OpenApi Integration. The updated code can be

found

here : https://github.com/girishvasmatkar/ofbiz-rest-impl. Please go
through the changes and test at your end and let me know your thoughts.

I am planning to do some refactoring and then raise initial PR for the
plug-in if the changes look good to everyone.

Best,
Girish


On Wed, Jun 17, 2020 at 4:54 PM Carsten Schinzer <
cars...@dcs-verkaufssysteme.de> wrote:


Hi Girish,

Thanks to clarify :)
What caught me on the OpenAPI integration is the snippet quoted below

and

I realize I should have read it in context. Actually then it is aligned
with my view.

Warm regards

Carsten


Initial implementation does not contain OpenApi integration yet.

And








Re: REST implementation

2020-08-02 Thread Jacques Le Roux

Hi Girish,

I'm just starting to review so I may miss things. Just a question for now. We 
have an option at

https://demo-trunk.ofbiz.apache.org/webtools/control/ServiceList?sel_service_name=testScv

to  (Show wsdl 
)

Would it be possible to have the same for REST?

Thanks

Jacques

Le 31/07/2020 à 10:32, Girish Vasmatkar a écrit :

Greetings!

I have created a PR to add a REST component -
https://github.com/apache/ofbiz-plugins/pull/35 . Please take a look
and let me know what you think and let me know if you face any issues. I
intend to merge it in a week from now.

With the PR (https://github.com/apache/ofbiz-framework/pull/214) to add
"action" attribute to the service definition now merged, this above
component should be able to expose exportable (export=true) and
actionable(action=GET|POST) services via REST.

Once the changes for nested attributes (OFBIZ-11902
) are done, I will also
be making corresponding changes in the GraphQL plugin to account for nested
attributes. OFBIZ-11902
 will
help in defining complex GraphQL mutations.

I am parallelly also working on designing an XML DSL for REST that should
allow tying up REST resources with OFBiz services.

Best,
Girish



On Thu, Jul 9, 2020 at 6:27 PM Shi Jinghai  wrote:


Hi Girish,

Yes, you got it.

Web browser will popup a login dialog when response code is 401:
setResponseHeader("WWW-Authenticate", "Bearer realm=\"authentication
required\"");

The popup is skipped and then react/vue/angular can handle the response:
setResponseHeader("WWW-Authenticate", "OFBiz realm=\"authentication
required\"");


发件人: Girish Vasmatkar
发送时间: 2020年7月9日 14:54
收件人: dev@ofbiz.apache.org
主题: Re: REST implementation

Hi Shi

Thanks for taking a look at it. I have a question on "WWW-Authenticate"
header so please clarify and I can make appropriate changes accordingly -

All I am finding is that to prevent the pop-up, either return 403 (which I
do not want to do) or not include "WWW-Authenticate" header at all (not
inclined to do this as well because then we would be violating the spec).
Do you mean to NOT start the value of the header with "Bearer" ?
so instead of below

*WWW-Authenticate: Bearer realm="Access to OFBiz", charset="UTF-8"*

should we change it to

*WWW-Authenticate: xBearer realm="Access to OFBiz", charset="UTF-8"*

I did not test it, but I can just change it like this without testing if
you can please confirm it will prevent the browser dialog.

Thanks again for the review.

Best,
Girish

On Wed, Jul 8, 2020 at 8:45 PM Shi Jinghai  wrote:


Hi Girish,

Excellent.

Only one suggestion from my quick view, when response code is 401, the
"WWW-Authenticate" header should be set to start with a word NOT “Bearer
…”, this can prevent web browser from popping up a login dialog.

Kind Regards,

Shi Jinghai

发件人: Girish Vasmatkar
发送时间: 2020年7月8日 20:47
收件人: dev@ofbiz.apache.org
主题: Re: REST implementation

Hi Folks

I have added support for OpenApi Integration. The updated code can be

found

here : https://github.com/girishvasmatkar/ofbiz-rest-impl. Please go
through the changes and test at your end and let me know your thoughts.

I am planning to do some refactoring and then raise initial PR for the
plug-in if the changes look good to everyone.

Best,
Girish


On Wed, Jun 17, 2020 at 4:54 PM Carsten Schinzer <
cars...@dcs-verkaufssysteme.de> wrote:


Hi Girish,

Thanks to clarify :)
What caught me on the OpenAPI integration is the snippet quoted below

and

I realize I should have read it in context. Actually then it is aligned
with my view.

Warm regards

Carsten


Initial implementation does not contain OpenApi integration yet.

And