Experimental Rest API

283 views
Skip to first unread message

hengsin

unread,
Sep 11, 2019, 3:33:49 AM9/11/19
to iDempiere
https://github.com/hengsin/idempiere-rest

Feel free to try it out. 

If you want to make any changes, just fork it and create pull request.

If you want to report any issue, submit it to the github issue tracker.

Finally, this is not production code and have not goes through much testing, so use it at your own risk.

David Podhola

unread,
Sep 11, 2019, 4:37:49 AM9/11/19
to iDempiere
Hi, this looks very cool, thanks for sharing! Would you please mind the instructions on how to build from the command line? I understand the repository needs to be in the same folder as the whole idempiere folder, but when I try `mvn install` I get 

Missing requirement: com.trekglobal.idempiere.rest.api 0.1.0.qualifier requires 'osgi.bundle; org.glassfish.jersey.containers.servlet 2.22.1' but it could not be found

I think org.glassfish.jersey.containers.servlet is really not present in the iDempiere 6.2... or am I missing something?

Thanks and all the best,

David

Dne středa 11. září 2019 9:33:49 UTC+2 hengsin napsal(a):

Heng Sin Low

unread,
Sep 11, 2019, 6:54:16 AM9/11/19
to idem...@googlegroups.com
This need the iDempiere default branch, not 6.2. Please follow the folder layout specify in the project home page.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/c98c0f21-50fb-4393-95cb-add17ba694ef%40googlegroups.com.

David Podhola

unread,
Sep 11, 2019, 7:33:46 AM9/11/19
to iDempiere
OK, so let me share the details with you:

iDempiere - I believe I am on the default branch:
david@david-SKY-X4:~/dev/idempiere$  hg identify -b
default

Also, this is a fresh download of the sources from the server (removed the folder and cloned again to be 100% sure).

Folder layout:
- iDempiere is ~/dev/idempiere
- the REST plugin is ~/dev/idempiere-rest

I believe this is what you have on the project homepage. Moving the REST plugin somewhere else result into the iDempiere repository not being found.

When I try `mvn install` I get "Missing requirement: com.trekglobal.idempiere.rest.api 0.1.0.qualifier requires 'osgi.bundle; org.glassfish.jersey.containers.servlet 2.22.1' but it could not be found"

In the repository folder I have only those files from Jersey:

org.glassfish.jersey.bundles.repackaged.jersey-guava_2.22.1.v20161103-1916.jar  
org.glassfish.jersey.core.jersey-common_2.22.1.v20181004-1955.jar

I DO have file org.glassfish.jersey.containers.servlet*  on my computer; but only in .metadata folder in the workspace:

./.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.glassfish.jersey.containers.servlet.core_2.22.1.v20161103-0227.jar
./.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.glassfish.jersey.containers.servlet_2.22.1.v20161103-0227.jar
./.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.glassfish.jersey.containers.servlet.core.source_2.22.1.v20161103-0227.jar
./.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.glassfish.jersey.containers.servlet.source_2.22.1.v20161103-0227.jar

Isn't the default target configuration the problem missing the plugin reported?
Screenshot from 2019-09-11 13-31-39.png


Please advise, thanks.

David

Dne středa 11. září 2019 12:54:16 UTC+2 hengsin napsal(a):
This need the iDempiere default branch, not 6.2. Please follow the folder layout specify in the project home page.

On Wed, Sep 11, 2019 at 4:37 PM David Podhola <david....@naseukoly.cz> wrote:
Hi, this looks very cool, thanks for sharing! Would you please mind the instructions on how to build from the command line? I understand the repository needs to be in the same folder as the whole idempiere folder, but when I try `mvn install` I get 

Missing requirement: com.trekglobal.idempiere.rest.api 0.1.0.qualifier requires 'osgi.bundle; org.glassfish.jersey.containers.servlet 2.22.1' but it could not be found

I think org.glassfish.jersey.containers.servlet is really not present in the iDempiere 6.2... or am I missing something?

Thanks and all the best,

David

Dne středa 11. září 2019 9:33:49 UTC+2 hengsin napsal(a):
https://github.com/hengsin/idempiere-rest

Feel free to try it out. 

If you want to make any changes, just fork it and create pull request.

If you want to report any issue, submit it to the github issue tracker.

Finally, this is not production code and have not goes through much testing, so use it at your own risk.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idem...@googlegroups.com.

Heng Sin Low

unread,
Sep 11, 2019, 8:09:55 AM9/11/19
to idem...@googlegroups.com
Yes, you are right, maven verify doesn't work.

For running from Eclipse, use the server.product.rest launch configuration in the com.trekglobal.idempiere.rest.api project (you might need to adjust the workspace location of the launch configuration). That should be working fine as that's what I've been using for testing thus far.

To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/1bfa1e25-8d0f-425a-80aa-209ee43b4c8e%40googlegroups.com.

Saúl Piña

unread,
Sep 11, 2019, 10:44:56 AM9/11/19
to iDempiere
Hi Hengsin, TY!, it's a great plugin, here is another approach for that https://bitbucket.org/ingeint/idempiere-restful-plugin/src/master/, it's a light approach.

Regards.

Heng Sin Low

unread,
Sep 11, 2019, 7:33:31 PM9/11/19
to idem...@googlegroups.com
mvn verify now works with latest default branch.

David Podhola

unread,
Sep 12, 2019, 9:34:22 AM9/12/19
to idem...@googlegroups.com
Sorry, not working for me. I assume this is still related to the org.glassfish.jersey.containers.servlet not being in the iDempiere repository referenced. I will try to set up in Eclipse first as you suggested.

Screenshot from 2019-09-12 15-31-54.png

David Podhola




You received this message because you are subscribed to a topic in the Google Groups "iDempiere" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idempiere/uk14JyvALJU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/CAC%3D6jXG13%3DVmB10811YzDSwh2S3LhBN57Kwdpd_vzh8MYUicpA%40mail.gmail.com.

Heng Sin Low

unread,
Sep 12, 2019, 4:50:29 PM9/12/19
to idem...@googlegroups.com
It should work. you have to update your idempiere source and run mvn verify first.

David Podhola

unread,
Sep 13, 2019, 3:27:08 AM9/13/19
to iDempiere
Thanks, yes, it builds now. Great work!

Dne čtvrtek 12. září 2019 22:50:29 UTC+2 hengsin napsal(a):

--
You received this message because you are subscribed to a topic in the Google Groups "iDempiere" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idempiere/uk14JyvALJU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to idem...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idem...@googlegroups.com.

Heng Sin Low

unread,
Sep 13, 2019, 4:10:41 AM9/13/19
to idem...@googlegroups.com
I've added p2 deployment support to iDempiere instance. Instruction at the project home page (tested at a new iDempiere instance and it is working fine for me).

To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/1c09e0f6-36c8-4453-b2d3-3b8487ace60f%40googlegroups.com.

David Podhola

unread,
Sep 13, 2019, 6:27:03 AM9/13/19
to iDempiere
This would be even cooler! I would be very happy to use REST. 

But following the guide I found out the bundle is stuck in the Starting... state. 
I reverted back, tried again just with iDempiere and some bundles are simply in the Starting... state. The application itself works (http://localhost:8080/webui/),Screenshot from 2019-09-13 12-01-23.png


I am on e30a883d4b9c+, I think this is the latest changeset in Bitbucket. The P2 deployment worked correctly I think.
Screenshot from 2019-09-13 12-26-00.png


Please advise, thanks.

David

Dne pátek 13. září 2019 10:10:41 UTC+2 hengsin napsal(a):

Heng Sin Low

unread,
Sep 13, 2019, 6:42:13 AM9/13/19
to idem...@googlegroups.com
that's in the instructions in the project's home page - at osgi console, run "sta com.trekglobal.idempiere.rest.api" to activate the bundle

To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/96380b2b-241a-4215-89e1-d0c62f8d676b%40googlegroups.com.

David Podhola

unread,
Sep 13, 2019, 7:31:04 AM9/13/19
to iDempiere
Yes, I saw that I was just surprised I am not able to start it from the web. Started from telnet (telnet localhost 12612) without any issues, everything works as expected. Thanks again for the plugin and your support, this made me very happy!

Best,

David

Dne pátek 13. září 2019 12:42:13 UTC+2 hengsin napsal(a):

Igor Martins

unread,
Dec 20, 2019, 7:23:01 AM12/20/19
to iDempiere
Hello Hengsin,

I didn't see this post before, i'm sorry.
What do you think about the points that i post here https://groups.google.com/forum/#!topic/idempiere/n07pMdSPi8c ?

Heng Sin Low

unread,
Dec 20, 2019, 10:01:15 AM12/20/19
to idem...@googlegroups.com
[] is the json notation for array so yes, you can take that as list. For endpoint that can return >= 1 result, [] is use. You will have to do your own transformation if thatś not wha you need (should be pretty straightforward).

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/f0b81c0f-4d69-4afe-a751-2dadb4fcf360%40googlegroups.com.

Igor Martins

unread,
Dec 20, 2019, 2:27:23 PM12/20/19
to iDempiere
Got it,
Thank you so much!!!


Em sexta-feira, 20 de dezembro de 2019 12:01:15 UTC-3, hengsin escreveu:
[] is the json notation for array so yes, you can take that as list. For endpoint that can return >= 1 result, [] is use. You will have to do your own transformation if thatś not wha you need (should be pretty straightforward).

On Fri, Dec 20, 2019 at 8:23 PM Igor Martins <igor....@devcoffee.com.br> wrote:
Hello Hengsin,

I didn't see this post before, i'm sorry.
What do you think about the points that i post here https://groups.google.com/forum/#!topic/idempiere/n07pMdSPi8c ?

Em quarta-feira, 11 de setembro de 2019 04:33:49 UTC-3, hengsin escreveu:
https://github.com/hengsin/idempiere-rest

Feel free to try it out. 

If you want to make any changes, just fork it and create pull request.

If you want to report any issue, submit it to the github issue tracker.

Finally, this is not production code and have not goes through much testing, so use it at your own risk.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idem...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages