Setting extensions and global proprieties.

Greetings,

I’m fairly new in this community but I got a couple of questions regarding Extensions and Global Proprieties.

I’ve created a new module for reference application 2.8 and guided by the SDK documentation. I’m trying to add a link to my module domain on the homepage. Not manually but upon module installation.

I followed this guide and basically created a new directory named apps inside omod/resources and added the following json:

[
{
    "id": "${project.parent.groupId}.${project.parent.artifactId}.homeAppLink",
    "extensionPointId": "systemAdministration.apps",
    "type": "link",
    "label": "Share Administration",
    "requiredPrivilege": "Add Users",
    "url": "adminui/systemadmin/accounts/manageAccounts.page",
    "icon": "icon-envelope",
    "order": 90
}

]

It doesn’t seem to be working, altought I can make it work If I manually add the App Definition in <openmrs/referenceapplication/manageApps>

My second question is related to global settings, I wanna know If it’s possible to set global proprieties dynamically, inside the ModuleActivator or by module-dependency of some sort. In this case I want to set the setting <user.requireEmailAsUsername> (false by default) to true.

Thanks in advance.

Hi @a35449

  1. You should follow the exact JSON properties to get the icon label in the administration dashboard. Please check the dashboard and change your json configuration according to the requirements.

  2. Yes, you can use the Context.getAdminstrationService().setGlobalProperties() to set the global properties dynamically from the module activator.

Thanks for the tips!

I got the globalProperties working, but I’m still having issues with the Icon in the administration dashboard. I’m pretty sure the JSON is correct because I can import it directly in the Manage App administration section and it works.

I may be missing something else, not sure If I have to implement an Extension class and map it in the config.xml or If the json is not in the correct directory.

I’ve seen other repository examples and it’s more or less the same as I’ve done.

The json file needs to go in the web/resources and not webapp/resources directory.

1 Like