Skip to content

iDempiere-micro/idempiere-micro-liberty-standalone

Repository files navigation

idempiere-micro-liberty-standalone

JitPack CircleCI Maintainability Codacy Badge

The standalone all-in-one iDempiere-micro microservice containing all the modules from CRM to Invoicing.

Build

Have iDempiere-micro PosgreSQL Docker 6.2 running on port 5433 to have the tests succeed.

IDEMPIERE_MICRO_VERSION=0.29.0 mvn clean install -P minify-runnable-package

Run

Standalone

Prepare the configuration

sudo cp ./src/main/resources/defaults.properties /etc/idempiere-micro.properties

Then edit /etc/idempiere-micro.properties and setup accordingly.

Start the microservice

(cd target; java -jar idempiere-micro-liberty-standalone.jar)

mvn liberty:run-server

Try with cURL

Note instead of cURL you can also install Postman and import the iDempiere micro Postman collection.

Prerequisities

You need jq to parse the JSON returned by login.

Authenticate

Get the JWT token for GardenUser

token=$( curl http://localhost:9080/idempiere-micro-liberty-standalone/session/GardenUser/login/GardenUser | jq -r ".token")

Query

Get the current user

curl -H "Content-Type: application/graphql" -H "Authorization: Bearer $token" --request POST --data 'query { me { id description } }' http://localhost:9080/idempiere-micro-liberty-standalone/graphql

Get the list of the users

curl -H "Content-Type: application/graphql" -H "Authorization: Bearer $token" --request POST --data 'query { users { id description } }' http://localhost:9080/idempiere-micro-liberty-standalone/graphql

Get the list of the business partners with contacts and locations

curl -H "Content-Type: application/graphql" -H "Authorization: Bearer $token" --request POST --data 'query { businessPartners { id name searchKey DUNS contacts {id description} locations {location {address1} } } }' http://localhost:9080/idempiere-micro-liberty-standalone/graphql

Mutate

Create a business partners

curl -H "Content-Type: application/graphql" -H "Authorization: Bearer $token" --request POST --data 'mutation { createBusinessPartner(businessPartner: { legalName: "TEST1", searchKey: "TEST1" } ) { id name } }' http://localhost:9080/idempiere-micro-liberty-standalone/graphql

Check the logs

Since OpenLiberty is used, the logs can be found according to the Open Liberty server logs documentation at ./target/liberty/wlp/usr/servers/idempiere-micro-liberty-standaloneServer/logs under the source code root.