Versions Compared

Key

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

This page is about helping you to be able to add an extension such as a link or an icon or button onto the either the home page or any other pages page within the Reference Application.

I hope you want to add something that looks like any of these components below onto either the home or System Administration or any other page outside your module.

In the above image, i have buttons, links which can be added  onto another page outside your module by taking use of the extension feature within the UI Framework.

Let us for-example add the "Manage ChartSearch" button extension onto the System Administration page which appears when the user clicks the System Administration button on the home page.

All your you need to do is to add a json file onto the ...into your moduleId-omod/src/main/resources/apps/ folder of your module which defines the details of the extension.

...

Code Block
themeEclipse
languagejs
titlemoduleIdchartsearch-omod/src/main/resources/apps/chartSearch_app.json
linenumberstrue
[
    {
        "id": "${project.parent.artifactId}.chartSearchApp",
        "description": "${project.parent.artifactId}.refApp.description",
        "order": 10,
        "extensions": [
            {
                "id": "${project.parent.artifactId}.launcheManager",
                "extensionPointId": "systemAdministration.apps",
                "type": "link",
                "order": 10,
                "label": "chartsearch.refApp.manageChartSearch",
                "url": "chartsearch/manageChartSearch.page",
                "icon": "icon-search",
                "requiredPrivilege": "Task: Chart Search"
            }
        ]
    }
] 

In above code snippet: we have ids that unify your extension from any other one already available like on line 3 and 8.

The most important parts that you are in most cases going to be changing are, id, extensionPointId, label and url. 

The ExtensionPointId as on line 9 refers to another extension already existing by its ID, in this case i used; 

systemAdministration.apps which is the one used to adding an extension onto .../coreapps/systemadministration/systemAdministration.page

In-case you want to add one instead onto the home page, then you should change that to: org.openmrs.referenceapplication.homepageLink

Since my extension type is configured as a link, i set the url to the URL that will be launched when the user clicks the button