Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 5293

Show
Ignore:
Timestamp:
08/16/08 12:57:54 (3 months ago)
Author:
sunbiz
Message:

registration: Fixed dom4j's XPath Dependency

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-modules/registration/nbproject/project.xml

    r5217 r5293  
    102102            <compilation-unit> 
    103103                <package-root>src</package-root> 
    104                 <classpath mode="compile">lib-common/commons-logging-1.0.4.jar;lib-common/hibernate3.jar;lib-common/junit-3.8.1.jar;lib-common/servlet-api.jar;lib-common/spring-2.5.1.jar;lib-common/spring-test.jar;lib-common/spring-webmvc.jar;lib-common/openmrs-api-1.4.0.00.5071.jar;lib-common/tests-openmrs-api-1.4.0.00.5071.jar;lib-common/web-openmrs-api-1.4.0.00.5071.jar;lib-common/commons-fileupload-1.2.1.jar;lib-common/commons-io-1.4.jar;lib-common/dom4j-1.6.1.jar;lib-common/jaxen-1.1.1.jar</classpath> 
     104                <classpath mode="compile">lib/avalon-framework-4.2.0.jar;lib/barcode4j.jar;lib/jaxen-1.1.1.jar;lib-common/commons-fileupload-1.2.1.jar;lib-common/commons-io-1.4.jar;lib-common/commons-logging-1.0.4.jar;lib-common/dom4j-1.6.1.jar;lib-common/hibernate3.jar;lib-common/junit-3.8.1.jar;lib-common/openmrs-api-1.4.0.00.5071.jar;lib-common/servlet-api.jar;lib-common/spring-2.5.1.jar;lib-common/spring-test.jar;lib-common/spring-webmvc.jar;lib-common/tests-openmrs-api-1.4.0.00.5071.jar;lib-common/web-openmrs-api-1.4.0.00.5071.jar</classpath> 
    105105                <source-level>1.5</source-level> 
    106106            </compilation-unit> 
    107107            <compilation-unit> 
    108108                <package-root>web/src</package-root> 
    109                 <classpath mode="compile">lib-common/commons-logging-1.0.4.jar;lib-common/hibernate3.jar;lib-common/junit-3.8.1.jar;lib-common/servlet-api.jar;lib-common/spring-2.5.1.jar;lib-common/spring-test.jar;lib-common/spring-webmvc.jar;lib-common/openmrs-api-1.4.0.00.5071.jar;lib-common/tests-openmrs-api-1.4.0.00.5071.jar;lib-common/web-openmrs-api-1.4.0.00.5071.jar;lib-common/commons-fileupload-1.2.1.jar;lib-common/commons-io-1.4.jar;lib-common/dom4j-1.6.1.jar;lib-common/jaxen-1.1.1.jar</classpath> 
     109                <classpath mode="compile">lib/avalon-framework-4.2.0.jar;lib/barcode4j.jar;lib/jaxen-1.1.1.jar;lib-common/commons-fileupload-1.2.1.jar;lib-common/commons-io-1.4.jar;lib-common/commons-logging-1.0.4.jar;lib-common/dom4j-1.6.1.jar;lib-common/hibernate3.jar;lib-common/junit-3.8.1.jar;lib-common/openmrs-api-1.4.0.00.5071.jar;lib-common/servlet-api.jar;lib-common/spring-2.5.1.jar;lib-common/spring-test.jar;lib-common/spring-webmvc.jar;lib-common/tests-openmrs-api-1.4.0.00.5071.jar;lib-common/web-openmrs-api-1.4.0.00.5071.jar</classpath> 
    110110                <source-level>1.5</source-level> 
    111111            </compilation-unit> 
     
    113113                <package-root>test</package-root> 
    114114                <unit-tests/> 
    115                 <classpath mode="compile">lib-common/commons-logging-1.0.4.jar;lib-common/hibernate3.jar;lib-common/junit-3.8.1.jar;lib-common/servlet-api.jar;lib-common/spring-2.5.1.jar;lib-common/spring-test.jar;lib-common/spring-webmvc.jar;lib-common/openmrs-api-1.4.0.00.5071.jar;lib-common/tests-openmrs-api-1.4.0.00.5071.jar;lib-common/web-openmrs-api-1.4.0.00.5071.jar;lib-common/commons-fileupload-1.2.1.jar;lib-common/commons-io-1.4.jar;lib-common/dom4j-1.6.1.jar;lib-common/jaxen-1.1.1.jar</classpath> 
     115                <classpath mode="compile">lib/avalon-framework-4.2.0.jar;lib/barcode4j.jar;lib/jaxen-1.1.1.jar;lib-common/commons-fileupload-1.2.1.jar;lib-common/commons-io-1.4.jar;lib-common/commons-logging-1.0.4.jar;lib-common/dom4j-1.6.1.jar;lib-common/hibernate3.jar;lib-common/junit-3.8.1.jar;lib-common/openmrs-api-1.4.0.00.5071.jar;lib-common/servlet-api.jar;lib-common/spring-2.5.1.jar;lib-common/spring-test.jar;lib-common/spring-webmvc.jar;lib-common/tests-openmrs-api-1.4.0.00.5071.jar;lib-common/web-openmrs-api-1.4.0.00.5071.jar</classpath> 
    116116                <source-level>1.5</source-level> 
    117117            </compilation-unit> 
  • openmrs-modules/registration/web/src/org/openmrs/module/registration/web/controller/OptionsController.java

    r5259 r5293  
    2121import javax.servlet.http.HttpServletResponse; 
    2222import org.dom4j.Document; 
    23 import org.dom4j.Element; 
    2423import org.dom4j.io.SAXReader; 
     24import org.jaxen.XPath; 
     25import org.jaxen.dom4j.Dom4jXPath; 
    2526import org.openmrs.util.OpenmrsUtil; 
    2627import org.springframework.web.servlet.ModelAndView; 
     
    3738            SAXReader reader = new SAXReader(); 
    3839            Document document = reader.read(availableIDs.toURI().toURL()); 
    39             Element root = document.getRootElement(); 
    40             List list = document.selectNodes("//patientIDs/available"); 
     40            XPath xpathSelector = new Dom4jXPath("//patientIDs/available"); 
     41            List list = xpathSelector.selectNodes(document); 
    4142            idMap.put("totalFree", list.size()); 
    42             list = document.selectNodes("//patientIDs/used"); 
    43             idMap.put("totalUsed", list.size()); 
     43            XPath xpathSelector2 = new Dom4jXPath("//patientIDs/used"); 
     44            List list2 = xpathSelector2.selectNodes(document); 
     45            idMap.put("totalUsed", list2.size()); 
    4446        } 
    4547        return new ModelAndView("/module/registration/optionsList", "idMap", idMap); 
  • openmrs-modules/registration/web/src/org/openmrs/module/registration/web/servlet/UploadHandler.java

    r5217 r5293  
    2424import org.dom4j.io.SAXReader; 
    2525import org.dom4j.io.XMLWriter; 
     26import org.jaxen.XPath; 
     27import org.jaxen.dom4j.Dom4jXPath; 
    2628import org.openmrs.util.OpenmrsUtil; 
    2729 
     
    6668                    int i = 0; 
    6769                    while ((str = br.readLine()) != null) { 
    68                         List list = document.selectNodes("//patientIDs[available=\'" + str + "']"); 
    69                         List list2 = document.selectNodes("//patientIDs[used=\'" + str + "']"); 
     70                        XPath xpathSelector = new Dom4jXPath("//patientIDs[available=\'" + str + "']"); 
     71                        List list = xpathSelector.selectNodes(document); 
     72                        XPath xpathSelector2 = new Dom4jXPath("//patientIDs[used=\'" + str + "']"); 
     73                        List list2 = xpathSelector2.selectNodes(document); 
    7074                        if (list.size() == 0 && list2.size() == 0) { 
    7175                            root.addElement("available").addText(str);