Versions Compared

Key

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

...

 

Description

Example

File Structure

a)

Creation of basic Demo Module:     

  • It creates basic file structure of an openmrs module with a ModuleActivator.java     
  • To create a basic module you should set all module wizard questions to 'n'.



b)

Creation of Demo Module with a link in admin page:     

  • It creates a module similar to basic module with extra adminList.java file to create a link in openmrs admin page under the parent tag of module name.
  • To create a module with admin link
    • you need to set module wizard question , " Do you want admin page link " value to  'y'.
    • After the wizard question ,extra parameter gets prompted asking for the text of link which should appear in admin page (parameter : Link Name).



c)

Creation of Demo Module with a SpringMvc driven page:

  • Creates a module with a controller which is mapped to a url , on redirecting returns model view of a jsp.
    • controller mapped to path : module/<artifactId>/<artifactId>Link.form
    • jsp page                          : <artifactId>Form.Jsp
          
  • To create a module with spring driven page you need to set module wizard question "Do you want Spring driven Mvc page" value  to  'y'.
  • In example,  
    • controller mapped to path : module/demo/demoLink.form
    • jsp page                          : demoForm.Jsp



d)

Creation of Demo Module with a service/serviceimpl/dao/hibernatedao:

  • Creates a module with a service, serviceImpl , DAO ,HibernateDAO , pojo , hibernate mapping xml , liquiibase.xml and sqldiff.xml with related mappings.
  • To create a module with service/dao  files you need to set module wizard question "Do you want service/serviceimpl/dao/hibernatedao mapping " value to  'y'. 
  • It then prompt's for parameter. **  Service
    -Service Name : Name for Service, Dao, Hibernate  files.**  Object Name
    -Object  Name  : Name for hbm.xml  and its pojo.




...

To change a default-value of a parameter, pass the parameter expression concatenating with -D with a value.

Code Block
Syntax: mvn org.openmrs.maven.plugins:module-wizard-plugin:1.0-SNAPSHOT:generate -D<parameterExpression>=<value>

Parameter

ParameterExpression

Group Id

-DgroupId=

Artifact Id

-DartifactId=

Version

-Dversion=

Module Name

-DmoduleName=

Module Description

-DmoduleDescription=

Module Author

-DmoduleAuthor=

OpenMRS Version Depended on

-DopenmrsVerison=

Example:command- 

mvn org.openmrs.maven.plugins: module-wizard-plugin:1.0.0:generate -P ModuleWizardPlugin  :generate  -DartifactId=demo -Dversion=2.0-SNAPSHOT -DmoduleName="Demo" -DmoduleDescription="A sample module for Demo." -DopenmrsVersion=1.8.0

...