- Copyright: 2019 INGEINT https://www.ingeint.com
- Repository: https://bitbucket.org/ingeint/idempiere-restful-plugin
- License: GPL 2
This is an example of how to create new endpoints for iDempiere and how to integrate RESTful definition.
- Partner CRUD
- Restful resources definitions (enpoint, message, http status code)
- Json contract
- Exceptions handlers
- Transactions
- Version endpoint
- Use the postman collection in docs/com.ingeint.restful.postman_collection.json
- Use
RequestEnv
to get the current transactions name and iDempiere context. - Use a target platform to build the bundle.
It's necessary to add a new bean in WEB-INF/beans.xml file:
<jaxrs:serviceBeans>
<bean class="com.ingeint.ws.controller.PartnerController" />
<bean class="com.ingeint.ws.controller.VersionController" />
</jaxrs:serviceBeans>
Add the new dependency (artifacItem
) to the pom.xml file in the artifactItems
attribute, example:
<artifactItems>
<artifactItem>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>28.0-jre</version>
</artifactItem>
</artifactItems>
Then, add a new classpath entry in the .classpath file, example:
<classpathentry kind="lib" path="lib/guava.jar"/>
Verify you are including the folder lib
in the build.properties file, exaple:
bin.includes = .,\
META-INF/,\
OSGI-INF/,\
lib/
Finally, add the new dependency in MANIFEST.MF file as a Bundle-ClassPath
attribute, example:
Bundle-ClassPath: .,
lib/guava.jar
A target platform allows you to download dependencies and build the jar plugin, there are some examples: