The first week of the coding period was hard but an exciting one. I was busy the whole week working on this PR to enable building O3 with the SDK.
So here is a description of things I did this week.
Initial commit
So for the first implementation I used these steps to deploy the O3.
- I created an embed distro.properties file to deploy the frontend and backend modules.
- I was getting an error when I tried to deploy the initializer module with the distro.properties file.
Unable to find/resolve artifact. Failure to find org.openmrs.module:initializer-omod:jar:2.5.0 in https://mavenrepo.openmrs.org/public
So I added the latest version of the initializer module to the SDK resource folder and wrote a code to copy it to the server module folder.
- I got the configuration folder from here. Then I added it to the SDK resource folder and added a code to copy it to the server folder.
After reviewing the PR mentors pointed to problems within this implementation.
- Metadata will change across versions and using an embed configuration is not sustainable.
- Copying an embed
initializer.omod
is problematic.
I was unsure of how to fix those problems. So I asked my mentors for guidance.
- Metadata for the O3 can be found in maven package
org.openmrs.distro:referenceapplication-config
. We need to add a feature to SDK that translate a distro entry like config.referenceapplication-config=${version}
to org.openmrs.distro:referenceapplication-config:${version}
.
Fixing problems
After playing around with the SDK code I figure out a way to fix these issues. The code I wrote does these steps
- Translate the distro entry to the maven artifact format.
- Download the maven artifact
org.openmrs.distro:referenceapplication-config:${version}
. It will download a file "referenceapplication-config.owa"
- Extract content of referenceapplication-config.owa to the server configuration folder.
Adding initializer module to the server
The initializer module is in the https://nexus.mekomsolutions.net/repository/maven-releases/ repository, and it is not included in OpenMRS SDK. So I added that repository to the SDK
What's next?
So now users can deploy O3 if they have a suitable distro.properties file but there is a small problem. Only advanced users are comfortable creating a distro.properties file on their own.
Many times most users need to just have a local instance of what is at https://dev3.openmrs.org/. Now I am working on adding a feature to the SDK that will enable users to set up O3 and have it ready without having to supply a distro.properties file.
I think I'll be able to implement this within this week.
Thank you for reading, see you next week.