Changeset 5293
- Timestamp:
- 08/16/08 12:57:54 (3 months ago)
- Files:
-
- openmrs-modules/registration/lib/jaxen-1.1.1.jar (added)
- openmrs-modules/registration/nbproject/project.xml (modified) (2 diffs)
- openmrs-modules/registration/web/src/org/openmrs/module/registration/web/controller/OptionsController.java (modified) (2 diffs)
- openmrs-modules/registration/web/src/org/openmrs/module/registration/web/servlet/UploadHandler.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/registration/nbproject/project.xml
r5217 r5293 102 102 <compilation-unit> 103 103 <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> 105 105 <source-level>1.5</source-level> 106 106 </compilation-unit> 107 107 <compilation-unit> 108 108 <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> 110 110 <source-level>1.5</source-level> 111 111 </compilation-unit> … … 113 113 <package-root>test</package-root> 114 114 <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> 116 116 <source-level>1.5</source-level> 117 117 </compilation-unit> openmrs-modules/registration/web/src/org/openmrs/module/registration/web/controller/OptionsController.java
r5259 r5293 21 21 import javax.servlet.http.HttpServletResponse; 22 22 import org.dom4j.Document; 23 import org.dom4j.Element;24 23 import org.dom4j.io.SAXReader; 24 import org.jaxen.XPath; 25 import org.jaxen.dom4j.Dom4jXPath; 25 26 import org.openmrs.util.OpenmrsUtil; 26 27 import org.springframework.web.servlet.ModelAndView; … … 37 38 SAXReader reader = new SAXReader(); 38 39 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); 41 42 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()); 44 46 } 45 47 return new ModelAndView("/module/registration/optionsList", "idMap", idMap); openmrs-modules/registration/web/src/org/openmrs/module/registration/web/servlet/UploadHandler.java
r5217 r5293 24 24 import org.dom4j.io.SAXReader; 25 25 import org.dom4j.io.XMLWriter; 26 import org.jaxen.XPath; 27 import org.jaxen.dom4j.Dom4jXPath; 26 28 import org.openmrs.util.OpenmrsUtil; 27 29 … … 66 68 int i = 0; 67 69 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); 70 74 if (list.size() == 0 && list2.size() == 0) { 71 75 root.addElement("available").addText(str);