Presentation is loading. Please wait.

Presentation is loading. Please wait.

Https://www.scrumalliance.org/http://www.agilealliance.org/https://www.scrumalliance.org/ OpenMRS Create New Module.

Similar presentations


Presentation on theme: "Https://www.scrumalliance.org/http://www.agilealliance.org/https://www.scrumalliance.org/ OpenMRS Create New Module."— Presentation transcript:

1 https://www.scrumalliance.org/http://www.agilealliance.org/https://www.scrumalliance.org/ OpenMRS Create New Module

2 https://www.scrumalliance.org/http://www.agilealliance.org/ Agenda 1.Create new module with Archetype of OpenMRS https://wiki.openmrs.org/display/docs/Using+the+Module+Maven +Archetype 2. Load module into IDE and Module structure. 3.Writing first action with database use. 4.Writing admin menu 5.Writing test https://wiki.openmrs.org/display/docs/Unit+Tests 6. Deploy module

3 https://www.scrumalliance.org/http://www.agilealliance.org/ Maven Archetype In short, Archetype is a Maven project templating toolkit. An archetype is defined as an original pattern or model from which all other things of the same kind are made. The name fits as we are trying to provide a system that provides a consistent means of generating Maven projects. Archetype will help authors create Maven project templates for users, and provides users with the means to generate parameterized versions of those project templates.

4 https://www.scrumalliance.org/http://www.agilealliance.org/ Create new module with OpenMRS archetype Create a new setting.xml file Run the command Describe the information of module with the guide on screen step by step

5 https://www.scrumalliance.org/http://www.agilealliance.org/ Create new maven setting.xml <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> org.openmrs.maven.plugins OpenMRS true http://mavenrepo.openmrs.org/nexus/content/repositories/public/archetype-catalog.xml http://mavenrepo.openmrs.org/nexus/content/repositories/public openmrs-repo OpenMRS Nexus Repository http://mavenrepo.openmrs.org/nexus/content/repositories/public openmrs-repo OpenMRS Nexus Repository http://mavenrepo.openmrs.org/nexus/content/repositories/public false

6 https://www.scrumalliance.org/http://www.agilealliance.org/ Run command mvn module-wizard:generate -s path_to_settings.xml Headless install (No prompts) mvn module-wizard:generate -DinteractiveMode=false

7 https://www.scrumalliance.org/http://www.agilealliance.org/ Update information (prompts) Parameter DescriptionParameterExpressionDefault Value Group IdgroupIdorg.openmrs.module Artifact IdartifactIdbasicexample Package(set internally)groupId.artifactId Version version 1.0-SNAPSHOT Module namemoduleNameBasic Example Module name with no spaces(set internally) moduleName_ns Module descriptionmoduleDescriptionHelps to start writing OpenMRS modules Module authoruser.name(system-user-name) OpenMRS version to depended onopenmrsVerison1.8.2 Do you want to add an admin page link (y/n) adminLinkReplyy Do you want to add a service layer (y/n) serviceReplyy Service nameserviceDaoNamemoduleName_nsService Object nameobjectNamemoduleName_ns Do you want to add another module to depend on (y/n) dependentModulesn

8 https://www.scrumalliance.org/http://www.agilealliance.org/ OpenMRS Module structure Activator Admin page extension Api and omod module

9 https://www.scrumalliance.org/http://www.agilealliance.org/ Writing first action Controller in Omod file Return jsp page Binding data into jsp page Service and data model Service class and it implementation Hibernate mapping Sql.diff (or liquisbase.xml – since OpenMRS 1.7.0 it will run sql.diff first, then liquisbase.xml)

10 https://www.scrumalliance.org/http://www.agilealliance.org/ OpenMRS Unit test Unit tests are meant to be very small and efficient. Each method (aka each test) should only validate one logical piece of code. Method names should be long and descriptive Methods should have an Assert.* call in it

11 https://www.scrumalliance.org/http://www.agilealliance.org/ Example @test public void getAllUsers_shouldNotReturnNull() throws Exception { Assert.assertNotNull(Context.getUserService().getAllUsers()); }

12 https://www.scrumalliance.org/http://www.agilealliance.org/ Unit test with DbUnit Create resources folder in your api module. Define the following files on resources folder: Define xml file to provide your sample test data (by DbUnit convention) Define test-hibernate.cfg.xml Define TestingApplicationContext.xml The definition of those file can find as (for example): https://github.com/hiepkhachbk/OpenMRS_Basic_Module


Download ppt "Https://www.scrumalliance.org/http://www.agilealliance.org/https://www.scrumalliance.org/ OpenMRS Create New Module."

Similar presentations


Ads by Google