Versions Compared

Key

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

Settings (formerly Global Properties from 1.9 downwards) are configuration variables that the user can set through the Administration menu, without restarting or recompiling the application. They're useful when module code needs to refer to a value that's unique to a particular installation, such as a concept ID number or a file path.

ADDING A SETTING (FORMERLY GLOBAL PROPERTY FROM 1.9 DOWNWARDS) FOR YOUR MODULE

Settings (formerly Global Properties from 1.9 downwards) are defined in your module's config file. The property is added when the module is started if it doesn't already exist in the OpenMRS installation. See the module config file documentation for instructions to define properties in your module.

READING A SETTING (FORMERLY GLOBAL PROPERTY FROM 1.9 DOWNWARDS )IN CODE

...

Settings (formerly Global Properties from 1.9 downwards) are set in the Administration menu under Maintenance > Manage Settings (formerly Global Properties from 1.9 downwards). You can try it here on the demo site.  (Username is admin, password is testAdmin123).

To make it easier for users to configure your module, you can create an administration page that displays the Global Properties portlet. The portlet allows you to show only specific properties, rather than the entire list of Settings (formerly Global Properties from 1.9 downwards). Remember to add the link for this admin page to your module's extension.html.AdminList::getLinks() method so it appears on the OpenMRS Administration page.  

...