Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added RA development

This tutorial will introduce you to OpenMRS SDK (Software Development Kit). It assumes that you have basic understanding of OpenMRS modular architecture (you can learn about it reading Technical Overview).

...

  1. Create server
  2. Add developed project to watched projects on server
  3. Create debugging configuration in IDE
  4. Run server

We will walk through these steps and create environment to develop and debug REST module on top of OpenMRS 2.0.0 platform.

...

If you want to enable remote debugging by default when running the server,
specify the port number here (e.g. 1044). Leave blank to disable debugging.
(Do not do this on a production server) (default: 'no debugging'): 

Type default value '1044' and push enter. Specifying debug port is essential to setup remote debugging configuration. You will be asked what database you want to use:

...

This way you can set up development environment for any module and openmrs-core. Remember that you have to provide all required modules by currently developed module.

Developing with the Reference Application

You can easily develop/ debug modules with the Reference Application just like with the platform. The steps are as follows.

  1. Create server with a distribution server.
  2. Select Reference Application version.
  3. Set debug port.
  4. Connect with database.
  5. Add a module as watched in the selected server.

As before, create a server by running 

Code Block
languagebash
mvn openmrs-sdk:setup

This will start the SDK in the wizard mode. When prompted, give a name to the server you're creating.

Next, you will be prompted to select server type.

Code Block
languagebash
You can setup the following servers:
1) Distribution
2) Platform
Which one do you choose? [1/2]:

Make a Distribution server by entering 1. Next you'll be prompted to select the distribution version.

Code Block
languagebash
You can deploy the following versions of distribution:
1) Reference Application 2.6-SNAPSHOT
2) Reference Application 2.5
3) Reference Application 2.4
4) Reference Application 2.3.1
5) Reference Application 2.2
6) Other...
Which one do you choose? [1/2/3/4/5/6]:

Select the latest Reference Application version by entering 1. The rest of the steps are the same as explained under Setting up dev environment. The watched modules will be built from source and deployed to the selected server every time you run that server.

Creating new distribution

...

To sum up, our openmrs-distro.properties file will look like this:

name= OWA development
version= 1.0
war.openmrs= 2.0.0
omod.owa=1.6.2
omod.webservices.rest=2.17-SNAPSHOT 

SDK automatically assumes that modules Maven Group ID is 'org.openmrs.module', but you can declare another Group ID

...