Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


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 by reading Technical Overview).

To get started, make sure that you have installed the latest version of OpenMRS SDK and Oracle JDK 8. You can find instructions on OpenMRS SDK wiki pages.

In this tutorial we will walk through common use cases and scenarios step by step.

Table of Contents

Why use the SDK

The question is why do I need to use the SDK for development, instead of installing Tomcat and using my own configuration.

...

We will walk through these steps and create an 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:

...

In this tutorial we will use most simple solution: H2, so answer with '1'. You can find more information about other options in OpenMRS SDK Setting up servers docs.

Last prompt will ask you for path to JDK:

...

Let's create basic distribution for development of Open Web Apps  for OpenMRS. To serve OWA we need  OWA module and REST module, because most of Web Apps want to consume OpenMRS REST API. To introduce module to distro configuration, we need to add new line in format: 'omod.{module id}={module version}'. Module id by convention matches module's Maven Artifact ID. For OWA module it is simply 'owa', for REST module it is 'webservices.rest'. We will use platform 2.0 version.  Let's name our distribution 'OWA development'.

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

...

To allow others to reproduce your server configuration, you have to create openmrs-distro.properties file with modules deployed on failing server. Since SDK 3.4.x you can go to your server directory `{user directory}/openmrs/{name of server}` and copy this file to share it with others. If you are using older version of SDK or standalone OpenMRS, you need to manually create this file as described in Creating new distribution

Creating MySQL dump file

...

from directory where you have those 2 files. flag -Drun makes SDK automatically run server after successful setup. Go to http://localhost:8080/openmrs/ to complete the setup.


Page Properties
hiddentrue


Related issues


...