Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Documentation

Page tree

Versions Compared

Key

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

This page will briefly discuss the development workflow for developing Open Web Apps. For a description of what Open Web Apps are, see the wiki page. Much of this document is copied derived from and inspired by the Developing an HTML+JS Open Web App Quickly wiki page.

...

In order to develop Open Web Apps, you will need an OpenMRS server running locally. The three ways to do this are described below.

...

The quickest and easiest way to do this set up a server locally is to download the latest standalone server from the OpenMRS downloads page. You will need Java 1.7+ to run the standalone server. Once it's downloaded, extract the ZIP archive and run the .jar file  file either by double clicking it or executing the following command:

...

Another easy way to run an OpenMRS server is to use the OpenMRS SDK. To use this method you must have Java 1.7+ and Maven 3+ installed. To install and configure the OpenMRS SDK, run the following:

...

It is also possible to run a Reference Application server using the SDK. See the SDK docs for instructions on how to do this.

...

A boilerplate Open Web App along with some associated build (Gulp) and package management (Bower) tooling can be scaffolded use using the Yeoman OpenMRS OWA generator. You will need NodeJS 4+ installed to do this. See the install instructions here.

...

Next, create a directory for your Open Web App and change into it. Then running to the following to scaffold your app:

...

The manifest.webapp files contain the information that OpenMRS needs to host your app. See the Open Web Apps Module documentation for detailed documentationdetails. The launch_path property contains to the the path to your app entry point. This is the page that will be loaded when you click on your app in OpenMRS.

...

Local Deployment

To speed up the development workflow, we can deploy directly to the app data directory on the filesystem using the following command:

...

The path to the local deploy directory is contained in gulpfile.js in the LOCAL_OWA_FOLDER variable. The following are the default locations for the various server installs:

  • Standalone: {{/path/to/openmrs-standalone-2.3.1/appdataowa
  • SDK: ~/openmrs/platform/owa (replace "platform" with the name you gave of your server) !! TODO: confirm this
  • Enterprise: /usr/share/tomcat7/.OpenmrsOpenMRS/owa !! TODO: confirm this
  • Docker: TODO

...

During the build process, the appropriate markup to include your packages will be injected therebetween these comments, and the packages will be copied into the dist/lib directory.

...

Code Block
themeMidnight
languagexml
firstlineBower CSS Injection Point
<!-- bower:css -->
<!-- endbower -->

4. Deployment

To produce a ZIP file that can be uploaded via the Open Web Apps module management page, run:

 

Code Block
themeMidnight
languagebash
titleBuild App
gulp

This will create a ZIP file in the dist directory that you can upload on the Open Web Apps module admin page.

See the Development section above to see how to speed up your development workflow using local deploys.