Index: /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java	(revision 25778)
+++ /main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java	(revision 25779)
@@ -31,4 +31,5 @@
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
@@ -2340,38 +2341,4 @@
 		}
 
-		if (displayItemListNode != null)
-		{
-
-		    NodeList nl = ((Element)displayItemListNode).getElementsByTagName(StaticStrings.DISPLAYITEM_STR);
-
-		    // make a list of all unique attribute names that are specifically not
-		    // description, smallicon, icon and name, since these are already processed above
-		    Set setOfUniqueDisplayItemNames = new LinkedHashSet();
-		    for(int i = 0; i < nl.getLength(); i++) {
-			Element displayItem = (Element)nl.item(i);
-			String name = displayItem.getAttribute(StaticStrings.NAME_ATTRIBUTE);
-
-			if(name.equals("")) continue; // no name attribute
-
-			if(name.equals(StaticStrings.DESCRIPTION_STR)) continue;
-			if(name.equals(StaticStrings.SMALLICON_STR)) continue;
-			if(name.equals(StaticStrings.ICON_STR)) continue;
-			if(name.equals(StaticStrings.NAME_STR)) continue;
-			// don't add displayItems that are handled by the indexers, etc. E.g. document:ex.Title 
-			if(name.indexOf(":") != -1) continue;
-
-			// otherwise
-			setOfUniqueDisplayItemNames.add(name); // Set will ensure no duplicate names
-		    }
-		    
-		    Iterator i = setOfUniqueDisplayItemNames.iterator();
-		    while (i.hasNext()) {
-			String displayItemName = (String)i.next();
-
-			ArrayList custom_displayItem = doDisplayItemList(dOc, displayItemListNode, displayItemName, displayItemName);		
-			appendArrayList(toElement, custom_displayItem);
-		    }
-		}
-
 		if (buildtype_value.equalsIgnoreCase("mg"))
 		{
@@ -2381,5 +2348,5 @@
 		{
 			doMGPPIndexes(dOc, searchNode);
-		}
+		}		
 
 		doDefaultIndex(dOc, searchNode);
@@ -2397,4 +2364,49 @@
 		doReplaceListRef(dOc, fromElement);
 		doServiceRackList(dOc, fromElement);
+
+		// the official displayItems in the displayItemList element have already been handled above
+		// and created as collectionmetadata elements in the dOc object
+		// Now we add in all the *other* (remaining) displayItems as collectionmeta elements
+		NodeList collectionMetadataList = dOc.getDocumentElement().getElementsByTagName(StaticStrings.COLLECTIONMETADATA_ELEMENT);
+		Set setOfUniqueColMetaNames = new HashSet();
+		for(int i = 0; i < collectionMetadataList.getLength(); i++) {
+		    Element colMeta = (Element)collectionMetadataList.item(i);
+		    String name = colMeta.getAttribute(StaticStrings.NAME_ATTRIBUTE);
+		    setOfUniqueColMetaNames.add(name);
+		}
+
+		if (displayItemListNode != null)
+		{
+		    NodeList nl = ((Element)displayItemListNode).getElementsByTagName(StaticStrings.DISPLAYITEM_STR);
+
+		    // make a list of all unique attribute names that are specifically not
+		    // description, smallicon, icon and name, since these are already processed above
+		    Set setOfUniqueDisplayItemNames = new LinkedHashSet();
+		    for(int i = 0; i < nl.getLength(); i++) {
+			Element displayItem = (Element)nl.item(i);
+			String name = displayItem.getAttribute(StaticStrings.NAME_ATTRIBUTE);
+
+			if(name.equals("")) continue; // no name attribute
+			if(setOfUniqueColMetaNames.contains(name)) continue;
+
+			if(name.equals(StaticStrings.DESCRIPTION_STR)) continue;
+			if(name.equals(StaticStrings.SMALLICON_STR)) continue;
+			if(name.equals(StaticStrings.ICON_STR)) continue;
+			if(name.equals(StaticStrings.NAME_STR)) continue;
+			// don't add displayItems that are handled by the indexers, etc. E.g. document:ex.Title 
+			if(name.indexOf(":") != -1) continue;
+
+			// otherwise
+			setOfUniqueDisplayItemNames.add(name); // Set will ensure no duplicate names
+		    }
+		    
+		    Iterator i = setOfUniqueDisplayItemNames.iterator();
+		    while (i.hasNext()) {
+			String displayItemName = (String)i.next();
+
+			ArrayList custom_displayItem = doDisplayItemList(dOc, displayItemListNode, displayItemName, displayItemName);		
+			appendArrayList(toElement, custom_displayItem);
+		    }
+		}
 
 	}
