How do I rebrand OpenMRS

@dkayiwa I don’t understand what you mean by the name of the log file. What I sent was the server log @darius requested, and which is also what I put on pastebin.com. Anyway, I have been able to fix the problem now: login page successfully overridden.

One more thing, @dkayiwa and @darius the solution doesn’t work for the admin page. Without any intention to exhaust you guys, please could you help with means or ways I could override the admin page with custom logos and images.

@cpnwaugha can you give me the user interface url to the admin page you are referring to?

@dkayiwa this is the admin page using the demo: http://demo.openmrs.org/openmrs/admin/index.htm: And below is the admin image I need to override

@cpnwaugha did you try replacing these?

@dkayiwa, @darius am not looking to do it manually. I created a custom module, using this https://github.com/ssmusoke/openmrs-module-mapperoverridedemo.git, and the step shown here https://wiki.openmrs.org/pages/viewpage.action?pageId=93359429 . The thing is that the module is to override the default logo automatically. What am asking for is the extension point id and the extension param id, something like what was done in the wiki link above, to achieve the same for the admin page.

@cpnwaugha you could hack it by creating a class like this in your module and copy images to override them as done here https://github.com/openmrs/openmrs-module-legacyui/blob/master/omod/src/main/java/org/openmrs/web/CopyLegacyUiContentToWebInf.java#L64

Does the Custom Branding module work for this?

Thanks a lot @dkayiwa and @darius. @darius I want to achieve the openmrs logo override one time, automatically if I could call it that, whenever I start a new instance.

@dkayiwa, I have tried your suggestion but it didn’t work. Now let me be detailed about what I did. I created a package in the omod section of openmrs-module-mapperoverridedemo (which I forked on github): src/main/org/openmrs/modules/mapperoverridedemo/overrideadminpage. And there I put the class CopyLegacyUiContentToWebInf.java. After doing this, building and dropping the omod file in the modules directory of my instance, I got the same result; old logo still present. I still want to get this to work. I really need help to do it right.

Also, what I was asking is if I could use a json file like the one below which @darius pointed out to me a while back, and which was useful in overriding the other logos:

[{ “id”: “overrideSettings”, “extensions”: [ { “id”: “override.configureStandardHeader”, “extensionPointId”: “org.openmrs.module.appui.header.config”, “type”: “config”, “extensionParams”: { “logo-icon-url”: “/ms/uiframework/resource/mapperoverridedemo/images/smartacareLogo.png” } } ] }] where the id, and extensionPointId have values required to change the admin Logo.

I will continue to explore all the means until I get success. Thanks

@cpnwaugha did you try the module that Darius pointed you to?

Thanks for your timely response @dkayiwa. Yes I have tried the custom branding module, but the effect is not immediate and with that there’s no way to tell it worked. We want something that can be done once: we build the function into a module, and drop the module in the modules directory before starting the instance the first time. That way, we can deploy to many clients without having to do manual changes.

Is your module on github for me to look at?

@dkayiwa this is the link https://github.com/eHealth4everyone/mapperoverridedemo

In your class CopyLegacyUiContentToWebInf, i see so many lines. Are they all supposed to be copying only those two images that you would like to override? If not, can you remove all the unnecessary lines such that i look at only those of value?

@dkayiwa, I have cleaned the code here: https://github.com/eHealth4everyone/mapperoverridedemo and I have rebuilt the module but got no positive result.

And following is the link to the server log on pastebin: http://pastebin.com/aZacMmrv

Which version of the reference application are you using?

@dkayiwa reference application version 2.4

1 Like

Is there any reason why you are not using reference application version 2.5?

No reason @dkayiwa. I didn’t think I had to, but I will try out and see

@dkayiwa I have tried using reference application 2.5 to achieve this but it didn’t work. Take a look at the modified code here: https://github.com/eHealth4everyone/mapperoverridedemo

Do you have this bean? https://github.com/openmrs/openmrs-module-legacyui/blob/master/omod/src/main/resources/webModuleApplicationContext.xml#L1045 Of course the package and class name have to match with yours.