diff --git a/README.md b/README.md index b21bfb22d..c83285f63 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,31 @@ until they are able to migrate away from it, since most of the implementations o - It is compulsory to run openmrs-module-legacyui against legacyui branch of openmrs-core that I have created to eventually remove legacyui. +X +# openmrs-module-legacyui +[![Build Status](https://travis-ci.org/openmrs/openmrs-module-legacyui.svg?branch=master)](https://travis-ci.org/openmrs/openmrs-module-legacyui) [![Coverage Status](https://coveralls.io/repos/github/openmrs/openmrs-module-legacyui/badge.svg?branch=master)](https://coveralls.io/github/openmrs/openmrs-module-legacyui?branch=master) + +- The legacy user interface for OpenMRS Platform 2.x is chiefly comprised of administrative functions and the patient dashboard. +- A new and more contemporary UI has been introduced via a UI framework and the legacy UI is kept around for +administrative functions that are not yet implemented in the new UI. +- To retire the Legacy UI as planned, it is required to move the implementations and modules that still rely on it in order to +maintain backwards compatibility. +- The main idea behind this project is to move legacy UI functions into an OpenMRS module that these implementations can install +until they are able to migrate away from it, since most of the implementations of OpenMRS around the world are running OpenMRS 1.9. + +- It is compulsory to run openmrs-module-legacyui against legacyui branch of openmrs-core +that I have created to eventually remove legacyui. +X +# openmrs-module-legacyui +[![Build Status](https://travis-ci.org/openmrs/openmrs-module-legacyui.svg?branch=master)](https://travis-ci.org/openmrs/openmrs-module-legacyui) [![Coverage Status](https://coveralls.io/repos/github/openmrs/openmrs-module-legacyui/badge.svg?branch=master)](https://coveralls.io/github/openmrs/openmrs-module-legacyui?branch=master) + +- The legacy user interface for OpenMRS Platform 2.x is chiefly comprised of administrative functions and the patient dashboard. +- A new and more contemporary UI has been introduced via a UI framework and the legacy UI is kept around for +administrative functions that are not yet implemented in the new UI. +- To retire the Legacy UI as planned, it is required to move the implementations and modules that still rely on it in order to +maintain backwards compatibility. +- The main idea behind this project is to move legacy UI functions into an OpenMRS module that these implementations can install +until they are able to migrate away from it, since most of the implementations of OpenMRS around the world are running OpenMRS 1.9. + +- It is compulsory to run openmrs-module-legacyui against legacyui branch of openmrs-core +that I have created to eventually remove legacyui. diff --git a/omod/src/main/java/org/openmrs/web/WebComponentRegistrar.java b/omod/src/main/java/org/openmrs/web/WebComponentRegistrar.java index 595f9335b..c80b41cab 100644 --- a/omod/src/main/java/org/openmrs/web/WebComponentRegistrar.java +++ b/omod/src/main/java/org/openmrs/web/WebComponentRegistrar.java @@ -22,9 +22,14 @@ import org.springframework.stereotype.Component; import org.springframework.web.context.ServletContextAware; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + @Component public class WebComponentRegistrar implements ServletContextAware { - + + private static final Logger log = LoggerFactory.getLogger(WebComponentRegistrar.class); + @Override public void setServletContext(ServletContext servletContext) { @@ -61,7 +66,8 @@ public void setServletContext(ServletContext servletContext) { //This happens on running openmrs after InitializationFilter or UpdateFilter //hence requiring a restart to see any page other than index.htm //After a restart, all mappings will then happen within Listener.contextInitialized() - ex.printStackTrace(); + + log.error("Error registering web component", ex); } } diff --git a/omod/src/main/java/org/openmrs/web/controller/concept/ConceptDatatypeListController.java b/omod/src/main/java/org/openmrs/web/controller/concept/ConceptDatatypeListController.java index 6f4921952..b2e279696 100644 --- a/omod/src/main/java/org/openmrs/web/controller/concept/ConceptDatatypeListController.java +++ b/omod/src/main/java/org/openmrs/web/controller/concept/ConceptDatatypeListController.java @@ -20,7 +20,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.openmrs.ConceptDatatype; -import org.openmrs.api.APIException; import org.openmrs.api.ConceptService; import org.openmrs.api.context.Context; import org.openmrs.web.WebConstants; diff --git a/omod/src/main/java/org/openmrs/web/controller/concept/ConceptSourceListController.java b/omod/src/main/java/org/openmrs/web/controller/concept/ConceptSourceListController.java index 6de17d468..5803f9f65 100644 --- a/omod/src/main/java/org/openmrs/web/controller/concept/ConceptSourceListController.java +++ b/omod/src/main/java/org/openmrs/web/controller/concept/ConceptSourceListController.java @@ -21,11 +21,9 @@ import org.apache.commons.logging.LogFactory; import org.openmrs.ConceptSource; import org.openmrs.ImplementationId; -import org.openmrs.api.APIException; import org.openmrs.api.ConceptService; import org.openmrs.api.context.Context; import org.springframework.beans.propertyeditors.CustomNumberEditor; -import org.springframework.validation.BindException; import org.springframework.validation.Errors; import org.springframework.web.bind.ServletRequestDataBinder; import org.springframework.web.servlet.mvc.SimpleFormController; diff --git a/omod/src/main/java/org/openmrs/web/controller/maintenance/SystemInformationController.java b/omod/src/main/java/org/openmrs/web/controller/maintenance/SystemInformationController.java index 746ff5678..b33b0b5d1 100644 --- a/omod/src/main/java/org/openmrs/web/controller/maintenance/SystemInformationController.java +++ b/omod/src/main/java/org/openmrs/web/controller/maintenance/SystemInformationController.java @@ -9,6 +9,9 @@ */ package org.openmrs.web.controller.maintenance; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import org.openmrs.api.context.Context; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -20,7 +23,8 @@ */ @Controller public class SystemInformationController { - + private static final Logger log = + LoggerFactory.getLogger(SystemInformationController.class); /** * Default constructor used by spring MVC */ @@ -39,7 +43,10 @@ public SystemInformationController() { */ @RequestMapping(method = RequestMethod.GET, value = "admin/maintenance/systemInfo.htm") public String showPage(ModelMap model) { - model.addAttribute("systemInfo", Context.getAdministrationService().getSystemInformation()); + + log.debug("Loading system information page"); + + model.addAttribute("systemInfo", Context.getAdministrationService().getSystemInformation()); return "/module/legacyui/admin/maintenance/systemInfo"; } diff --git a/omod/src/test/java/org/openmrs/web/controller/ConceptFormControllerTest.java b/omod/src/test/java/org/openmrs/web/controller/ConceptFormControllerTest.java index d7687f319..8e117fd69 100644 --- a/omod/src/test/java/org/openmrs/web/controller/ConceptFormControllerTest.java +++ b/omod/src/test/java/org/openmrs/web/controller/ConceptFormControllerTest.java @@ -19,11 +19,8 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.util.Collection; import java.util.Locale; -import java.util.Set; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -35,9 +32,7 @@ import org.openmrs.ConceptAnswer; import org.openmrs.ConceptAttribute; import org.openmrs.ConceptAttributeType; -import org.openmrs.ConceptClass; import org.openmrs.ConceptComplex; -import org.openmrs.ConceptDatatype; import org.openmrs.ConceptDescription; import org.openmrs.ConceptMap; import org.openmrs.ConceptMapType; @@ -54,8 +49,6 @@ import org.openmrs.util.LocaleUtility; import org.openmrs.util.OpenmrsConstants; import org.openmrs.web.controller.ConceptFormController.ConceptFormBackingObject; -import org.openmrs.web.controller.concept.ConceptReferenceRange; -import org.openmrs.web.controller.mappper.ConceptFormMapper; import org.openmrs.web.test.BaseModuleWebContextSensitiveTest; import org.openmrs.web.test.WebTestHelper; import org.openmrs.web.test.WebTestHelper.Response; diff --git a/omod/src/test/java/org/openmrs/web/controller/maintenance/SystemInformationControllerTest.java b/omod/src/test/java/org/openmrs/web/controller/maintenance/SystemInformationControllerTest.java index ada1d7c04..87d7890eb 100644 --- a/omod/src/test/java/org/openmrs/web/controller/maintenance/SystemInformationControllerTest.java +++ b/omod/src/test/java/org/openmrs/web/controller/maintenance/SystemInformationControllerTest.java @@ -9,6 +9,9 @@ */ package org.openmrs.web.controller.maintenance; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.util.Map; import junit.framework.Assert; @@ -25,7 +28,9 @@ public class SystemInformationControllerTest extends BaseModuleWebContextSensitiveTest { private ModelMap model = null; - + + private static final Logger log = LoggerFactory.getLogger(SystemInformationControllerTest.class); + @Before public void before() throws Exception { createController(); @@ -36,9 +41,17 @@ public void before() throws Exception { */ private void createController() { model = new ModelMap(); - SystemInformationController controller = new SystemInformationController(); + + // Safe null check + if (model == null) { + log.warn("Model was null, creating new ModelMap"); + model = new ModelMap(); + } + + SystemInformationController controller = new SystemInformationController(); controller.showPage(model); - //System.out.println("SystemInformationControllerTest.createController() "+model.toString()); + + log.debug("createController() model: {}", model); } /**