package org.openmrs.module.openhmis.cashier.uiframework;

import org.openmrs.util.OpenmrsClassLoader;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * The OpenMRS UI Framework configuration settings.
 */
public class UiConfigurationCashier implements BeanFactoryPostProcessor {

	private static Log log = LogFactory.getLog(UiConfigurationCashier.class);

	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		log.info("Register openhmis.cashier module");
		try {
			// load UiFramework's StandardModuleUiConfiguration class
			Class cls = OpenmrsClassLoader.getInstance()
			        .loadClass("org.openmrs.ui.framework.StandardModuleUiConfiguration");

			// get spring's bean definition builder
			BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(cls);

			// set the module Id
			builder.addPropertyValue("moduleId", "openhmis.cashier");

			// register bean
			((DefaultListableBeanFactory)beanFactory).registerBeanDefinition(
			    "openhmisCashierStandardModuleUiConfiguration", builder.getBeanDefinition());
		} catch (ClassNotFoundException ex) {
			// StandardModuleUiConfiguration class not found!
			log.info("Unable to register openhmis.cashier UI 2.x module");
		}
	}
}

@@ -76,1618 +76,278 @@
 mrs.
-util.OpenmrsClassLoader;%0D%0Aimport org.springframework.beans.BeansException;%0D%0Aimport org.springframework.beans.factory.config.BeanFactoryPostProcessor;%0D%0Aimport org.springframework.beans.factory.config.ConfigurableListableBeanFactory;%0D%0Aimport org.springframework.beans.factory.support.BeanDefinitionBuilder;%0D%0Aimport org.springframework.beans.factory.support.DefaultListableBeanFactory;%0D%0Aimport org.apache.commons.logging.Log;%0D%0Aimport org.apache.commons.logging.LogFactory;%0D%0A%0D%0A/**%0D%0A * The OpenMRS UI Framework configuration settings.%0D%0A */%0D%0Apublic class UiConfigurationCashier implements BeanFactoryPostProcessor %7B%0D%0A%0D%0A%09private static Log log = LogFactory.getLog(UiConfigurationCashier.class);%0D%0A%0D%0A%09public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException %7B%0D%0A%09%09log.info(%22Register openhmis.cashier module%22);%0D%0A%09%09try %7B%0D%0A%09%09%09// load UiFramework's StandardModuleUiConfiguration class%0D%0A%09%09%09Class cls = OpenmrsClassLoader.getInstance()%0D%0A%09%09%09        .loadClass(%22org.openmrs.ui.framework.StandardModuleUiConfiguration%22);%0D%0A%0D%0A%09%09%09// get spring's bean definition builder%0D%0A%09%09%09BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(cls);%0D%0A%0D%0A%09%09%09// set the module Id%0D%0A%09%09%09builder.addPropertyValue(%22moduleId%22, %22openhmis.cashier%22);%0D%0A%0D%0A%09%09%09// register bean%0D%0A%09%09%09((DefaultListableBeanFactory)beanFactory).registerBeanDefinition(%0D%0A%09%09%09    %22openhmisCashierStandardModuleUiConfiguration%22, builder.getBeanDefinition());%0D%0A%09%09%7D catch (ClassNotFoundException ex) %7B%0D%0A%09%09%09// StandardModuleUiConfiguration class not found!%0D%0A%09%09%09log.info(%22Unable to register openhmis.cashier UI 2.x module%22);%0D%0A%09%09%7D
+module.openhmis.commons.uiframework.UiConfigurationFactory;%0D%0A%0D%0A/**%0D%0A * The OpenMRS UI Framework configuration settings.%0D%0A */%0D%0Apublic class UiConfigurationCashier extends UiConfigurationFactory %7B%0D%0A%0D%0A%09@Override%0D%0A%09public String getModuleId() %7B%0D%0A%09%09return %22openhmis.cashier%22;
 %0D%0A%09%7D

Implement Cashier module registration