Hello,
I just wrote a simple component for that adds clojure nRepl support for OFBiz. This allows people to use clojure to interact with OFBiz and do all sorts of nice things. It also opens a lot of possibilities for improving the developer experience. Please let me know what you think about this. It would be great to have it upstream (not in this form). I would love some help on how to properly develop a plugin. I have a lot of ideas on how to use clojure for more productivity and interactive development. You can see a demo of the plugin here https://youtu.be/XXxJDZRzu_E . You can see the plugin source code here: https://github.com/netdava/ofbiz-clojure-repl . I believe the OFBiz development experience can look like this: * https://www.youtube.com/watch?v=ZkJX9ciI5aM&t=1824s * https://www.youtube.com/watch?v=Bs44qdAX5yo ## About ofbiz-clojure-repl plugin Uses [jvm-breakglass](https://github.com/matlux/jvm-breakglass) library to start an instance of nRepl inside Apache OFBiz. Once we have a Repl inside OFBiz we can connect to it from our favorite cloujure IDE and interact with it. Some things that can be done: * Interact with a running OFBiz instance from a shell like environment (Repl is better then the shell) * Prototype functionality and experiment with instant feedback - search for Repl driven development videos * Develop services for OFBiz in clojure and leverage all it's wonderfull properties * Use data visualization tools like [Proto-repl](https://github.com/jasongilman/proto-repl) to explore and do interactive Business Inteligence. * Desing reports using real data using something like [Gorilla-repl](http://gorilla-repl.org/) I've heard that Clojure was fun to write code with and I did not believe it until I tried it. Let's have fun developing on OFBiz, -- Eugen Stan +40720 898 747 / netdava.com |
Hello Eugen, Great initiative! Thank you for the work. I have a question about the implementation. It seems from reading your code [1] that you're essentially just passing the the context object to NREPL and getting it working from there. Although the idea works, you're not getting anything beyond just running the clojure REPL against the context. Why not design NREPL to be part of the framework from the start. Implement it as a container and fire it up and fully integrate with the framework. This way not only will you be able to run the REPL (which is great) but you will also have the ability to introspect every request / response and even add clojure as another implementation engine. [1] https://github.com/netdava/ofbiz-clojure-repl/blob/master/src/main/java/com/netdava/ofbiz/clojure/ClojureReplService.java On Monday, May 04, 2020 03:34 +03, Eugen Stan <[hidden email]> wrote: Hello, I just wrote a simple component for that adds clojure nRepl support for OFBiz. This allows people to use clojure to interact with OFBiz and do all sorts of nice things. It also opens a lot of possibilities for improving the developer experience. Please let me know what you think about this. It would be great to have it upstream (not in this form). I would love some help on how to properly develop a plugin. I have a lot of ideas on how to use clojure for more productivity and interactive development. You can see a demo of the plugin here https://youtu.be/XXxJDZRzu_E . You can see the plugin source code here: https://github.com/netdava/ofbiz-clojure-repl . I believe the OFBiz development experience can look like this: * https://www.youtube.com/watch?v=ZkJX9ciI5aM&t=1824s * https://www.youtube.com/watch?v=Bs44qdAX5yo ## About ofbiz-clojure-repl plugin Uses [jvm-breakglass](https://github.com/matlux/jvm-breakglass) library to start an instance of nRepl inside Apache OFBiz. Once we have a Repl inside OFBiz we can connect to it from our favorite cloujure IDE and interact with it. Some things that can be done: * Interact with a running OFBiz instance from a shell like environment (Repl is better then the shell) * Prototype functionality and experiment with instant feedback - search for Repl driven development videos * Develop services for OFBiz in clojure and leverage all it's wonderfull properties * Use data visualization tools like [Proto-repl](https://github.com/jasongilman/proto-repl) to explore and do interactive Business Inteligence. * Desing reports using real data using something like [Gorilla-repl](http://gorilla-repl.org/) I've heard that Clojure was fun to write code with and I did not believe it until I tried it. Let's have fun developing on OFBiz, -- Eugen Stan +40720 898 747 / netdava.com |
Hello Taher,
Thank you for the feedback. Yes, that is what I am doing at the moment. I had less than 48h of knowledge about ODBiz API so it was the best I could do. I believe even that can provide benefits since you have a way to call every service in a running OFBiz instance from code. It gives you access to data and the runtime behavior. It can also be used for doing operational work. You are talking about a more advanced integration and it might be worthwhile to do that when I know how. My short to medium term goal is to build an http API on top of OFBiz . I believe without an API I think the possibilities are quite limited. I have some of the pieces in place but this will take a bit of time and investigation in the inner workings of OFBiz. Mainly how to read the xml entity and service definitions so I can make something out of those. By the way, for building a POC API what are the first services I should target? The ones that are mostly used by end users or the ones that do not depend on few/no other services. Regards, Eugen La 04.05.2020 17:22, Taher Alkhateeb a scris: > Hello Eugen, > > Great initiative! Thank you for the work. > > I have a question about the implementation. It seems from reading your code [1] that you're essentially just passing the the context object to NREPL and getting it working from there. > > Although the idea works, you're not getting anything beyond just running the clojure REPL against the context. Why not design NREPL to be part of the framework from the start. Implement it as a container and fire it up and fully integrate with the framework. This way not only will you be able to run the REPL (which is great) but you will also have the ability to introspect every request / response and even add clojure as another implementation engine. > > [1] https://github.com/netdava/ofbiz-clojure-repl/blob/master/src/main/java/com/netdava/ofbiz/clojure/ClojureReplService.java > > > On Monday, May 04, 2020 03:34 +03, Eugen Stan <[hidden email]> wrote: > Hello, > > I just wrote a simple component for that adds clojure nRepl support for > OFBiz. This allows people to use clojure to interact with OFBiz and do > all sorts of nice things. > > It also opens a lot of possibilities for improving the developer > experience. > > Please let me know what you think about this. It would be great to have > it upstream (not in this form). > > I would love some help on how to properly develop a plugin. I have a lot > of ideas on how to use clojure for more productivity and interactive > development. > > > You can see a demo of the plugin here https://youtu.be/XXxJDZRzu_E . > > You can see the plugin source code here: > https://github.com/netdava/ofbiz-clojure-repl . > > I believe the OFBiz development experience can look like this: > > * https://www.youtube.com/watch?v=ZkJX9ciI5aM&t=1824s > * https://www.youtube.com/watch?v=Bs44qdAX5yo > > > ## About ofbiz-clojure-repl plugin > > Uses [jvm-breakglass](https://github.com/matlux/jvm-breakglass) library > to start an instance of nRepl inside Apache OFBiz. > Once we have a Repl inside OFBiz we can connect to it from our favorite > cloujure IDE and interact with it. > > Some things that can be done: > > * Interact with a running OFBiz instance from a shell like environment > (Repl is better then the shell) > * Prototype functionality and experiment with instant feedback - search > for Repl driven development videos > * Develop services for OFBiz in clojure and leverage all it's wonderfull > properties > * Use data visualization tools like > [Proto-repl](https://github.com/jasongilman/proto-repl) to explore and > do interactive Business Inteligence. > * Desing reports using real data using something like > [Gorilla-repl](http://gorilla-repl.org/) > > > I've heard that Clojure was fun to write code with and I did not believe > it until I tried it. > > Let's have fun developing on OFBiz, > > -- > Eugen Stan > +40720 898 747 / netdava.com > > > +40720 898 747 / netdava.com |
For me I would forget about the services for a moment. I would focus my attention on defining a container for the REPL [1]. Then I would try to implement clojure as an engine implementation for the services. This involves modifying a few XSD files and java files for parsing and also providing the engine implementation [2]. You can look at the groovy engine as an example [3] The ticky (and very useful) part would be to have the REPL with an open port available all the time, and can intercept every single request and investigate its contents. That would be a kickass feature IMHO. [1] https://ci.apache.org/projects/ofbiz/site/javadocs/org/apache/ofbiz/base/container/ComponentContainer.html [2] https://ci.apache.org/projects/ofbiz/site/javadocs/org/apache/ofbiz/service/engine/GenericEngine.html [3] https://ci.apache.org/projects/ofbiz/site/javadocs/org/apache/ofbiz/service/engine/GroovyEngine.html On Wednesday, May 06, 2020 09:42 +03, Eugen Stan <[hidden email]> wrote: Hello Taher, Thank you for the feedback. Yes, that is what I am doing at the moment. I had less than 48h of knowledge about ODBiz API so it was the best I could do. I believe even that can provide benefits since you have a way to call every service in a running OFBiz instance from code. It gives you access to data and the runtime behavior. It can also be used for doing operational work. You are talking about a more advanced integration and it might be worthwhile to do that when I know how. My short to medium term goal is to build an http API on top of OFBiz . I believe without an API I think the possibilities are quite limited. I have some of the pieces in place but this will take a bit of time and investigation in the inner workings of OFBiz. Mainly how to read the xml entity and service definitions so I can make something out of those. By the way, for building a POC API what are the first services I should target? The ones that are mostly used by end users or the ones that do not depend on few/no other services. Regards, Eugen La 04.05.2020 17:22, Taher Alkhateeb a scris: > Hello Eugen, > > Great initiative! Thank you for the work. > > I have a question about the implementation. It seems from reading your code [1] that you're essentially just passing the the context object to NREPL and getting it working from there. > > Although the idea works, you're not getting anything beyond just running the clojure REPL against the context. Why not design NREPL to be part of the framework from the start. Implement it as a container and fire it up and fully integrate with the framework. This way not only will you be able to run the REPL (which is great) but you will also have the ability to introspect every request / response and even add clojure as another implementation engine. > > [1] https://github.com/netdava/ofbiz-clojure-repl/blob/master/src/main/java/com/netdava/ofbiz/clojure/ClojureReplService.java > > > On Monday, May 04, 2020 03:34 +03, Eugen Stan <[hidden email]> wrote: > Hello, > > I just wrote a simple component for that adds clojure nRepl support for> OFBiz. This allows people to use clojure to interact with OFBiz and do > all sorts of nice things. > > It also opens a lot of possibilities for improving the developer > experience. > > Please let me know what you think about this. It would be great to have> it upstream (not in this form). > > I would love some help on how to properly develop a plugin. I have a lot > of ideas on how to use clojure for more productivity and interactive > development. > > > You can see a demo of the plugin here https://youtu.be/XXxJDZRzu_E . > > You can see the plugin source code here: > https://github.com/netdava/ofbiz-clojure-repl . > > I believe the OFBiz development experience can look like this: > > * https://www.youtube.com/watch?v=ZkJX9ciI5aM&t=1824s > * https://www.youtube.com/watch?v=Bs44qdAX5yo > > > ## About ofbiz-clojure-repl plugin > > Uses [jvm-breakglass](https://github.com/matlux/jvm-breakglass) library> to start an instance of nRepl inside Apache OFBiz. > Once we have a Repl inside OFBiz we can connect to it from our favorite> cloujure IDE and interact with it. > > Some things that can be done: > > * Interact with a running OFBiz instance from a shell like environment > (Repl is better then the shell) > * Prototype functionality and experiment with instant feedback - search> for Repl driven development videos > * Develop services for OFBiz in clojure and leverage all it's wonderfull > properties > * Use data visualization tools like > [Proto-repl](https://github.com/jasongilman/proto-repl) to explore and > do interactive Business Inteligence. > * Desing reports using real data using something like > [Gorilla-repl](http://gorilla-repl.org/) > > > I've heard that Clojure was fun to write code with and I did not believe > it until I tried it. > > Let's have fun developing on OFBiz, > > -- > Eugen Stan > +40720 898 747 / netdava.com > > > Eugen Stan +40720 898 747 / netdava.com |
Hi,
Please see my reply inline. La 06.05.2020 14:21, Taher Alkhateeb a scris: > For me I would forget about the services for a moment. I would focus my attention on defining a container for the REPL [1]. Then I would try to implement clojure as an engine implementation for the services. This involves modifying a few XSD files and java files for parsing and also providing the engine implementation [2]. You can look at the groovy engine as an example [3] Interesting idea. I will look into it. It's a different direction than my goal of providing an API on top of OFBiz but has potential by bringing Clojure's features. I don't know how easily it is to secure an embedded version of clojure or if we need to. Are groovy scripts allowed access to all Java API (file io, network etc) ? I'm asking because of security considerations. > The ticky (and very useful) part would be to have the REPL with an open port available all the time, and can intercept every single request and investigate its contents. That would be a kickass feature IMHO. I like your enthusiasm. Could you give me some examples as to why do you believe this is more important? Regarding the feature, it is doable but there is some work regarding authentication and authorization. There is [drawbridge] project for that. I think an http2 or a WebSocket version should work perfect and should not be that hard to build. [drawbridge] https://github.com/nrepl/drawbridge . > [1] https://ci.apache.org/projects/ofbiz/site/javadocs/org/apache/ofbiz/base/container/ComponentContainer.html > [2] https://ci.apache.org/projects/ofbiz/site/javadocs/org/apache/ofbiz/service/engine/GenericEngine.html > [3] https://ci.apache.org/projects/ofbiz/site/javadocs/org/apache/ofbiz/service/engine/GroovyEngine.html Thanks for the links. I checked them out. They are useful starting points. Would you sponsor the inclusion of this component in OFBiz ? Thanks, > On Wednesday, May 06, 2020 09:42 +03, Eugen Stan <[hidden email]> wrote: > Hello Taher, > > Thank you for the feedback. > Yes, that is what I am doing at the moment. I had less than 48h of > knowledge about ODBiz API so it was the best I could do. > > I believe even that can provide benefits since you have a way to call > every service in a running OFBiz instance from code. It gives you access > to data and the runtime behavior. > > It can also be used for doing operational work. > > You are talking about a more advanced integration and it might be > worthwhile to do that when I know how. > > My short to medium term goal is to build an http API on top of OFBiz . I > believe without an API I think the possibilities are quite limited. > > I have some of the pieces in place but this will take a bit of time and > investigation in the inner workings of OFBiz. Mainly how to read the xml > entity and service definitions so I can make something out of those. > > By the way, for building a POC API what are the first services I should > target? The ones that are mostly used by end users or the ones that do > not depend on few/no other services. > > > Regards, > > Eugen > > La 04.05.2020 17:22, Taher Alkhateeb a scris: >> Hello Eugen, >> >> Great initiative! Thank you for the work. >> >> I have a question about the implementation. It seems from reading your code [1] that you're essentially just passing the the context object to NREPL and getting it working from there. >> >> Although the idea works, you're not getting anything beyond just running the clojure REPL against the context. Why not design NREPL to be part of the framework from the start. Implement it as a container and fire it up and fully integrate with the framework. This way not only will you be able to run the REPL (which is great) but you will also have the ability to introspect every request / response and even add clojure as another implementation engine. >> >> [1] https://github.com/netdava/ofbiz-clojure-repl/blob/master/src/main/java/com/netdava/ofbiz/clojure/ClojureReplService.java >> >> >> On Monday, May 04, 2020 03:34 +03, Eugen Stan <[hidden email]> wrote: >> Hello, >> >> I just wrote a simple component for that adds clojure nRepl support for> OFBiz. This allows people to use clojure to interact with OFBiz and do >> all sorts of nice things. >> >> It also opens a lot of possibilities for improving the developer >> experience. >> >> Please let me know what you think about this. It would be great to have> it upstream (not in this form). >> >> I would love some help on how to properly develop a plugin. I have a lot >> of ideas on how to use clojure for more productivity and interactive >> development. >> >> >> You can see a demo of the plugin here https://youtu.be/XXxJDZRzu_E . >> >> You can see the plugin source code here: >> https://github.com/netdava/ofbiz-clojure-repl . >> >> I believe the OFBiz development experience can look like this: >> >> * https://www.youtube.com/watch?v=ZkJX9ciI5aM&t=1824s >> * https://www.youtube.com/watch?v=Bs44qdAX5yo >> >> >> ## About ofbiz-clojure-repl plugin >> >> Uses [jvm-breakglass](https://github.com/matlux/jvm-breakglass) library> to start an instance of nRepl inside Apache OFBiz. >> Once we have a Repl inside OFBiz we can connect to it from our favorite> cloujure IDE and interact with it. >> >> Some things that can be done: >> >> * Interact with a running OFBiz instance from a shell like environment >> (Repl is better then the shell) >> * Prototype functionality and experiment with instant feedback - search> for Repl driven development videos >> * Develop services for OFBiz in clojure and leverage all it's wonderfull >> properties >> * Use data visualization tools like >> [Proto-repl](https://github.com/jasongilman/proto-repl) to explore and >> do interactive Business Inteligence. >> * Desing reports using real data using something like >> [Gorilla-repl](http://gorilla-repl.org/) >> >> >> I've heard that Clojure was fun to write code with and I did not believe >> it until I tried it. >> >> Let's have fun developing on OFBiz, >> >> -- >> Eugen Stan >> +40720 898 747 / netdava.com >> >> >> > -- > Eugen Stan > +40720 898 747 / netdava.com > > > +40720 898 747 / netdava.com |
Hello Eugen, Q Are groovy scripts allowed access to all Java API (file io, network etc)? A Yes groovy scripts can pretty much access all resources and Java APIs. But they are implemented in multiple places as different things (service implementations, events, or simply helper scripts) Q Could you give me some examples as to why do you believe this is more important? A First of all any contribution / work you do is a good work. I'm encouraging you in a certain direction but at the end it's your itch to scratch. The reason why I encourage the solution I propose is that you can build whatever you want on top of it, including your proposed APIs. I think the API layer is better implemented when clojure is part of the core. Q Would you sponsor the inclusion of this component in OFBiz ? A I didn't know there are sponsors for features. Damn it I should've asked for sponsoring all the stuff I put in :) Joke aside, features are usually simply donated by willing developers for the benefit of everyone as enhancing the software comes back with added value to everyone including the original author. I think this is sort of the prominent way in which ASF projects generally thrive. The sponsoring is usually done as a code review / imporvement, guidance and collaboration. In all cases, good luck with your work and initiative. Cheers, Taher Alkhateeb On Wednesday, May 06, 2020 15:59 +03, Eugen Stan <[hidden email]> wrote: Hi, Please see my reply inline. La 06.05.2020 14:21, Taher Alkhateeb a scris: > For me I would forget about the services for a moment. I would focus my attention on defining a container for the REPL [1]. Then I would try to implement clojure as an engine implementation for the services. This involves modifying a few XSD files and java files for parsing and also providing the engine implementation [2]. You can look at the groovy engine as an example [3] Interesting idea. I will look into it. It's a different direction than my goal of providing an API on top of OFBiz but has potential by bringing Clojure's features. I don't know how easily it is to secure an embedded version of clojure or if we need to. Are groovy scripts allowed access to all Java API (file io, network etc) ? I'm asking because of security considerations. > The ticky (and very useful) part would be to have the REPL with an open port available all the time, and can intercept every single request and investigate its contents. That would be a kickass feature IMHO. I like your enthusiasm. Could you give me some examples as to why do you believe this is more important? Regarding the feature, it is doable but there is some work regarding authentication and authorization. There is [drawbridge] project forthat. I think an http2 or a WebSocket version should work perfect and should not be that hard to build. [drawbridge] https://github.com/nrepl/drawbridge . > [1] https://ci.apache.org/projects/ofbiz/site/javadocs/org/apache/ofbiz/base/container/ComponentContainer.html > [2] https://ci.apache.org/projects/ofbiz/site/javadocs/org/apache/ofbiz/service/engine/GenericEngine.html > [3] https://ci.apache.org/projects/ofbiz/site/javadocs/org/apache/ofbiz/service/engine/GroovyEngine.html Thanks for the links. I checked them out. They are useful starting points. Would you sponsor the inclusion of this component in OFBiz ? Thanks, > On Wednesday, May 06, 2020 09:42 +03, Eugen Stan <[hidden email]> wrote: > Hello Taher, > > Thank you for the feedback. > Yes, that is what I am doing at the moment. I had less than 48h of > knowledge about ODBiz API so it was the best I could do. > > I believe even that can provide benefits since you have a way to call > every service in a running OFBiz instance from code. It gives you access > to data and the runtime behavior. > > It can also be used for doing operational work. > > You are talking about a more advanced integration and it might be > worthwhile to do that when I know how. > > My short to medium term goal is to build an http API on top of OFBiz . I > believe without an API I think the possibilities are quite limited. > > I have some of the pieces in place but this will take a bit of time and> investigation in the inner workings of OFBiz. Mainly how to read the xml > entity and service definitions so I can make something out of those. > > By the way, for building a POC API what are the first services I should> target? The ones that are mostly used by end users or the ones that do > not depend on few/no other services. > > > Regards, > > Eugen > > La 04.05.2020 17:22, Taher Alkhateeb a scris: >> Hello Eugen, >> >> Great initiative! Thank you for the work. >> >> I have a question about the implementation. It seems from reading your code [1] that you're essentially just passing the the context object to NREPL and getting it working from there. >> >> Although the idea works, you're not getting anything beyond just running the clojure REPL against the context. Why not design NREPL to be part of the framework from the start. Implement it as a container and fire it up and fully integrate with the framework. This way not only will you be able to run the REPL (which is great) but you will also have the ability to introspect every request / response and even add clojure as another implementation engine. >> >> [1] https://github.com/netdava/ofbiz-clojure-repl/blob/master/src/main/java/com/netdava/ofbiz/clojure/ClojureReplService.java >> >> >> On Monday, May 04, 2020 03:34 +03, Eugen Stan <[hidden email]> wrote: >> Hello, >> >> I just wrote a simple component for that adds clojure nRepl support for> OFBiz. This allows people to use clojure to interact with OFBiz and do>> all sorts of nice things. >> >> It also opens a lot of possibilities for improving the developer >> experience. >> >> Please let me know what you think about this. It would be great to have> it upstream (not in this form). >> >> I would love some help on how to properly develop a plugin. I have a lot >> of ideas on how to use clojure for more productivity and interactive >> development. >> >> >> You can see a demo of the plugin here https://youtu.be/XXxJDZRzu_E . >> >> You can see the plugin source code here: >> https://github.com/netdava/ofbiz-clojure-repl . >> >> I believe the OFBiz development experience can look like this: >> >> * https://www.youtube.com/watch?v=ZkJX9ciI5aM&t=1824s >> * https://www.youtube.com/watch?v=Bs44qdAX5yo >> >> >> ## About ofbiz-clojure-repl plugin >> >> Uses [jvm-breakglass](https://github.com/matlux/jvm-breakglass) library> to start an instance of nRepl inside Apache OFBiz. >> Once we have a Repl inside OFBiz we can connect to it from our favorite> cloujure IDE and interact with it. >> >> Some things that can be done: >> >> * Interact with a running OFBiz instance from a shell like environment>> (Repl is better then the shell) >> * Prototype functionality and experiment with instant feedback - search> for Repl driven development videos >> * Develop services for OFBiz in clojure and leverage all it's wonderfull >> properties >> * Use data visualization tools like >> [Proto-repl](https://github.com/jasongilman/proto-repl) to explore and>> do interactive Business Inteligence. >> * Desing reports using real data using something like >> [Gorilla-repl](http://gorilla-repl.org/) >> >> >> I've heard that Clojure was fun to write code with and I did not believe >> it until I tried it. >> >> Let's have fun developing on OFBiz, >> >> -- >> Eugen Stan >> +40720 898 747 / netdava.com >> >> >> > -- > Eugen Stan > +40720 898 747 / netdava.com > > > Eugen Stan +40720 898 747 / netdava.com |
In reply to this post by Taher Alkhateeb-2
Hi Taher & Eugen,
I came across this thread by accident while searching for something else, but I wanted to say that what Taher suggests is possible and fairly easy to do. I have an NRepl container & Clojure service engine I wrote a few years ago for some older OFBiz codebases and that's basically the only way I interacted with them. :) I can locate them and post them on GitHub if you are interested - I believe the code involved was very minimal. Joe On 2020/05/04 14:22:38, "Taher Alkhateeb" <[hidden email]> wrote: > > Hello Eugen, > > Great initiative! Thank you for the work. > > I have a question about the implementation. It seems from reading your code [1] that you're essentially just passing the the context object to NREPL and getting it working from there. > > Although the idea works, you're not getting anything beyond just running the clojure REPL against the context. Why not design NREPL to be part of the framework from the start. Implement it as a container and fire it up and fully integrate with the framework. This way not only will you be able to run the REPL (which is great) but you will also have the ability to introspect every request / response and even add clojure as another implementation engine. |
Free forum by Nabble | Edit this page |