private void initMappings() { NodeList nodes = xmlFile.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { if (nodes.item(i).getNodeName().equals("mappings")) { NodeList cNodes = nodes.item(i).getChildNodes(); for (int j = 0; j < cNodes.getLength(); j++) { if (cNodes.item(j).getNodeName().equals("mapping")) { KMapping mapping = new KMapping(); mapping.initFromXml(cNodes.item(j)); mappings.add(mapping); mapping.setParentObject(mappings); } else if (cNodes.item(j).getNodeName().equals("virtualMapping")) { KMapping mapping = new KVirtualMapping(); mapping.initFromXml(cNodes.item(j)); mappings.add(mapping); mapping.setParentObject(mappings); } } } else if (nodes.item(i).getNodeName().equals("ajax-includes")) { NodeList cNodes = nodes.item(i).getChildNodes(); for (int j = 0; j < cNodes.getLength(); j++) { if (cNodes.item(j).getNodeName().equals("request")) { KAjaxRequest ajaxRequest = new KAjaxRequest(); ajaxRequest.initFromXml(cNodes.item(j)); ajaxIncludes.add(ajaxRequest); ajaxRequest.setParentObject(ajaxIncludes); } } } else if (nodes.item(i).getNodeName().equals("filters")) { NodeList cNodes = nodes.item(i).getChildNodes(); for (int j = 0; j < cNodes.getLength(); j++) { if (cNodes.item(j).getNodeName().equals("filter")) { KFilter filter = new KFilter(); filter.initFromXml(cNodes.item(j)); filters.add(filter); filter.setParentObject(filters); } } } } }
public void initContollers() { KTesterController testerCtrl = new KTesterController(); testerCtrl.initFromXML(null); testerCtrl.setEr(er); testerCtrl.setMessages(messages); kobjectControllers.put("KTester", testerCtrl); NodeList nodes = xmlFile.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { if (nodes.item(i).getNodeName().equals("class")) { String className = ((Element) nodes.item(i)).getAttribute("name"); if (className != null && className != "") { KObjectController koCtrl = getObjectController(className); if (koCtrl != null) { koCtrl.initFromXML(nodes.item(i)); koCtrl.setEr(er); koCtrl.setMessages(messages); Ko.koDisplays.put(className, koCtrl.getDisplayInstance()); } } } } }