Index: lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationLoader.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/Attic/ConfigurationLoader.java,v diff -u -r1.4 -r1.5 --- lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationLoader.java 10 Nov 2005 03:32:54 -0000 1.4 +++ lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationLoader.java 27 Jan 2006 04:37:17 -0000 1.5 @@ -36,7 +36,9 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; +import org.lamsfoundation.lams.util.ConfigurationKeys; + /** *

* View Source @@ -96,19 +98,32 @@ { setConfigFilePath(); Map items = Collections.synchronizedMap(new HashMap()); + try{ Document configureDoc = XmlFileLoader.getDocumentFromFilePath(configFilePath); - Element root = (Element)configureDoc.getElementsByTagName("Lams").item(0); + Element root = (Element)configureDoc.getElementsByTagName(ConfigurationKeys.ROOT).item(0); NodeList nodeList = root.getChildNodes(); + for(int i=0; iIOExcpetion in ConfigurationLoader", e); @@ -124,5 +139,53 @@ } return items; } + + /** + * DictionaryDates are composed of one or more Dictionary items which have child elements + * language and createDate + * The Dictionary details will be placed in a separate hashMap with language + * as the key and createDate as the value. This hashMap will then be added in the main + * hashmap with "DictionaryDates" being the key. + * + * @param ele + * @param items The main hashmap where the elements are stored. + */ + private static void loadDictionaryDates(Element ele, Map items) + { + NodeList dictionaries = ele.getChildNodes(); + HashMap dictionaryMap = new HashMap(); + for(int i=0; icreateDate as the + * key->value pair. + * @param dictionary + * @param dictionaryItems The separate hashMap in which to store the different dictionary and the date it was created. + */ + private static void storeDictionaryDetailsInMap(Element dictionary, HashMap dictionaryItems) + { + + Element language = (Element)dictionary.getElementsByTagName(ConfigurationKeys.DICTIONARY_LANGUAGE).item(0); + Element createDate = (Element)dictionary.getElementsByTagName(ConfigurationKeys.DICTIONARY_CREATE_DATE).item(0); + if (language != null && createDate != null) + { + if (language.getLastChild() != null && createDate.getLastChild() != null) + { + dictionaryItems.put(language.getLastChild().getNodeValue(), createDate.getLastChild().getNodeValue()); + } + } + + } }