Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java	(revision 30838)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java	(revision 30839)
@@ -30,4 +30,5 @@
 import org.greenstone.gsdl3.service.ServiceRack;
 import org.greenstone.gsdl3.util.Dictionary;
+import org.greenstone.gsdl3.util.DisplayItemUtil;
 import org.greenstone.gsdl3.util.GSFile;
 import org.greenstone.gsdl3.util.GSPath;
@@ -89,5 +90,5 @@
 	/** list of services */
 	protected Element service_list = null;
-	/** list of metadata - all metadata, regardless of language goes in here */
+	/** list of metadata - all metadata, regardless of language goes in here . metadata should be language neutral. Language specific strings are displayItems*/
 	protected Element metadata_list = null;
   /** language specific display items */
@@ -105,4 +106,10 @@
 
 	protected Element _globalFormat = null;
+
+  	/**
+	 * A class loader that knows where to find resources 
+	 * put properties files, dtds etc in here
+	 */
+	protected ClassLoader class_loader = null;
 
 	public void setSiteHome(String home)
@@ -225,6 +232,4 @@
 		//clearServices();
 		Element service_rack_list = (Element) GSXML.getChildByTagName(service_cluster_info, GSXML.SERVICE_CLASS_ELEM + GSXML.LIST_MODIFIER);
-		logger.error("cluster service rack list =");
-		logger.error(GSXML.xmlNodeToString(service_rack_list));
 		if (service_rack_list == null)
 		{
@@ -263,5 +268,5 @@
 		{
 		  resolveMacros(display_list);
-			if (!addDisplayItems(display_list))
+		  if (!DisplayItemUtil.storeDisplayItems(this.display_item_list, display_list))
 			{
 
@@ -316,5 +321,5 @@
       </displayItem>
   */
-	protected boolean addDisplayItems(Element display_list)
+	protected boolean addDisplayItemsOld(Element display_list)
 	{
 
@@ -650,5 +655,7 @@
 			if (param_list == null)
 			{
-				addAllDisplayInfo(description, lang);
+			  Element di_list = result_doc.createElement(GSXML.DISPLAY_TEXT_ELEM + GSXML.LIST_MODIFIER);
+			  description.appendChild(di_list);
+			  DisplayItemUtil.addLanguageSpecificDisplayItems(di_list, this.display_item_list, lang, DEFAULT_LANG, this.class_loader);
 				description.appendChild(result_doc.importNode(this.service_list, true));
 				description.appendChild(result_doc.importNode(this.metadata_list, true));
@@ -679,5 +686,8 @@
 					else if (info.equals(GSXML.DISPLAY_TEXT_ELEM + GSXML.LIST_MODIFIER))
 					{
-						addAllDisplayInfo(description, lang);
+					  Element di_list = result_doc.createElement(GSXML.DISPLAY_TEXT_ELEM + GSXML.LIST_MODIFIER);
+					  description.appendChild(di_list);
+					  DisplayItemUtil.addLanguageSpecificDisplayItems(di_list, this.display_item_list, lang, DEFAULT_LANG, this.class_loader);
+
 					}
 					else if (info.equals(GSXML.LIBRARY_PARAM_ELEM+GSXML.LIST_MODIFIER))
@@ -932,59 +942,4 @@
 
 	}
-  // from our store of displayItems, (eg name, description etc) add one of each to response. PIck the best fit for request lang.
-
-  protected boolean addAllDisplayInfo(Element description, String lang)
-  {
-    Document doc = description.getOwnerDocument();
-    NodeList items = this.display_item_list.getChildNodes();
-    for (int i = 0; i < items.getLength(); i++)
-      { // for each key
-	Element m = (Element) items.item(i);
-	// is there one with the specified language?
-	Element new_m = GSXML.getNamedElement(m, GSXML.DISPLAY_TEXT_ELEM, GSXML.LANG_ATT, lang);
-	if (new_m == null) {
-	  // if not, have we got one with a key?
-	  new_m = GSXML.getNamedElement(m, GSXML.DISPLAY_TEXT_ELEM, GSXML.KEY_ATT, null);
-	  if (new_m != null) {
-	    // look up the dictionary
-	    String value = getTextString(new_m.getAttribute(GSXML.KEY_ATT), lang, new_m.getAttribute(GSXML.DICTIONARY_ATT));
-	    if (value != null) {
-	      GSXML.setNodeText(new_m, value);
-	    }
-	    else {
-	      // haven't found the key in the dictionary, ignore this display item
-	      new_m = null;
-	    }
-	  }
-	}
-	if (new_m == null && lang != DEFAULT_LANG) {
-	  // still haven't got a value. can we use the defualt lang?
-	  new_m = GSXML.getNamedElement(m, GSXML.DISPLAY_TEXT_ELEM, GSXML.LANG_ATT, DEFAULT_LANG);
-	}
-	if (new_m == null)
-	  {
-	    // STILL haven't found one, lets use the first one with a lang att (so we don't just get the key one back
-	    new_m = (Element) GSXML.getNamedElement(m, GSXML.DISPLAY_TEXT_ELEM, GSXML.LANG_ATT, null);
-	  }
-	if (new_m != null) {
-	  description.appendChild(doc.importNode(new_m, true));
-	}
-      } // for each key
-    return true;
-    
-  }
-  
-
-  protected String getTextString(String key, String lang, String dictionary) {
-    return getTextString(key, lang, dictionary, null);
-  }
-
-  protected String getTextString(String key, String lang, String dictionary, String[] args)
-  {
-    Dictionary dict = new Dictionary(dictionary, lang);
-    String result = dict.get(key, args);
-    return result;
-  }
-  
 
 	public HashMap<String, ServiceRack> getServiceMap()
