Move a page from core to legacy UI module
As of OpenMRS Platform 2.0, the legacy UI has been moved to the legacy UI module, the module's git repository is at https://github.com/openmrs/openmrs-module-legacyui
JSP files are located in the webapp/src/main/webapp folder, it is key to note that some pages are not backed by a controller and that some controllers are configured via xml while others are annotated, the changes to be made when the controllers are moved differ a little bit because of this. Below are the details of how to move a page from the platform to the module while keeping these factors in mind.
Note that some JSPs and controllers may have already been moved.
Move the JSP
Copy the JSP you wish to move to the omod/webapp directory in the module while preserving the folder structure, note that for the JSPs located in the WEB-INF/view folder, the folder structure you need to preserve is the one after WEB-INF/view e.g a JSP in the platform at webapp/src/main/webapp/WEB-INF/view/dictionary/conceptForm.jsp ends up at omod/webapp/dictionary/conceptForm.jsp in the module.
Delete the JSP from the platform
Move the controller
Depending on whether the page has an xml based controller or an annotated one or has no controller at all, follow the appropriate option from the ones below.
If there is a controller, remember to delete it from the platform after copying it to the module.
A Controller Configured via xml
It is possible that the entries to be moved have already been moved to the module and possibly commented out, if this is the case, just un-comment the appropriate entries in webModuleApplicationContext.xml file in the module.
An annotated controller
This kind of page will have no URL mapping in the openmrs-servlet.xml file.
If a page has no controller
If you think about it, in the module project structure we don't really have the module/legacyui folder but we keep prefixing the formView property value and the return paths from the annotated controllers with module/legacyui and things work magically, this is because modules resources like JSPs get copied by the module engine to the module/myModuleId folder at run time when the module is installed where myModuleId is the module's unique id which in this case is legacyui.
Move, Update and Run Unit tests
Most of the controllers for the pages have unit tests, move the test classes as well if any and update them accordingly, run the tests to ensure that they still pass before committing your changes.
Remember to update test classes you move to extend BaseModuleWebContextSensitiveTest for those that require a web context or BaseModuleContextSensitiveTest for the ones that don't.