Index: /trunk/gli/src/org/greenstone/gatherer/Configuration.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/Configuration.java	(revision 6085)
+++ /trunk/gli/src/org/greenstone/gatherer/Configuration.java	(revision 6086)
@@ -45,4 +45,5 @@
 import javax.swing.plaf.*;
 import org.greenstone.gatherer.msm.MSMUtils;
+import org.greenstone.gatherer.util.StaticStrings;
 import org.greenstone.gatherer.util.Utility;
 import org.w3c.dom.*;
@@ -100,4 +101,8 @@
     /** The general configuration settings. */
     private Document general_config;
+    
+    /** The element, from glis config file, that contains the various directory mappings. */
+    private Element directory_mappings_element;
+
     private int cache_hit = 0;
     private int cache_miss = 0;
@@ -177,4 +182,8 @@
 	    Gatherer.println("Loaded current Gatherer configuration.");
 	}
+
+	// Determine the Directory Mappings element
+	directory_mappings_element = (Element) MSMUtils.getNodeFromNamed(general_config.getDocumentElement(), StaticStrings.DIRECTORY_MAPPINGS_ELEMENT);
+
 	// Re-establish the color settings.
 	updateUI();
@@ -196,4 +205,35 @@
 	Gatherer.println("EXEC_ADDRESS = " + exec_address);
     }
+
+    /** Add a special directory mapping. */
+    public boolean addDirectoryMapping(String name, File file) {
+	boolean result = false;
+	try {
+	    // Ensure the name isn't already in use.
+	    boolean found = false;
+	    NodeList mappings = directory_mappings_element.getElementsByTagName(StaticStrings.MAPPING_ELEMENT);
+	    for(int i = 0; !found && i < mappings.getLength(); i++) {
+		Element mapping_element = (Element) mappings.item(i);
+		if(mapping_element.getAttribute(StaticStrings.NAME_ATTRIBUTE).equalsIgnoreCase(name)) {
+		    found = true;
+		}
+		mapping_element = null;
+	    }
+	    // Otherwise add the mapping.
+	    if(!found) {
+		Element mapping_element = general_config.createElement(StaticStrings.MAPPING_ELEMENT);
+		mapping_element.setAttribute(StaticStrings.NAME_ATTRIBUTE, name);
+		mapping_element.setAttribute(StaticStrings.FILE_ATTRIBUTE, file.toString());
+		directory_mappings_element.appendChild(mapping_element);
+		result = true;
+		mapping_element = null;
+	    }
+	    mappings = null;
+	}
+	catch (Exception exception) {
+	    Gatherer.printStackTrace(exception);
+	}
+	return result;
+    } /** addDirectoryMapping(String name, String file) **/
 
     /** The default get action retrieves the named property from the desired configuration, and returns a true or false. */
@@ -319,4 +359,30 @@
 	} */
 
+    /** Retrieve the special directory mappings associated with this collection.
+     * @return A <strong>HashMap</strong> containing mappings from names to directories.
+     */
+    public HashMap getDirectoryMappings() {
+	HashMap special_directories = new HashMap();
+	try {
+	    // Ensure the name isn't already in use.
+	    boolean found = false;
+	    NodeList mappings = directory_mappings_element.getElementsByTagName(StaticStrings.MAPPING_ELEMENT);
+	    for(int i = 0; !found && i < mappings.getLength(); i++) {
+		Element mapping_element = (Element) mappings.item(i);
+		String name = mapping_element.getAttribute(StaticStrings.NAME_ATTRIBUTE);
+		File file = new File(mapping_element.getAttribute(StaticStrings.FILE_ATTRIBUTE));
+		special_directories.put(name, file);
+		file = null;
+		name = null;
+		mapping_element = null;
+	    }
+	    mappings = null;
+	}
+	catch(Exception exception) {
+	    Gatherer.printStackTrace(exception);
+	}
+	return special_directories;
+    } /** getDirectoryMappings() */
+
     /** Retrieve the current users email. These are always stored in the general settings.
      * @return the email address, if it is set, as a String
@@ -443,4 +509,31 @@
 	return gsdl_path + "bin" + File.separator + "script" + File.separator;
     }
+
+    /** Remove a previously defined special directory mapping.
+     * @param name The name of the mapping to remove as a <strong>String</strong>.
+     * @return The <strong>File</strong> of the mapping removed.
+     */
+    public File removeDirectoryMapping(String name) {
+	File file = null;
+	try {
+	    // Ensure the name isn't already in use.
+	    boolean found = false;
+	    NodeList mappings = directory_mappings_element.getElementsByTagName(StaticStrings.MAPPING_ELEMENT);
+	    for(int i = 0; !found && i < mappings.getLength(); i++) {
+		Element mapping_element = (Element) mappings.item(i);
+		if(mapping_element.getAttribute(StaticStrings.NAME_ATTRIBUTE).equalsIgnoreCase(name)) {
+		    file = new File(MSMUtils.getValue(mapping_element));
+		    directory_mappings_element.removeChild(mapping_element);
+		    found = true;
+		}
+		mapping_element = null;
+	    }
+	    mappings = null;
+	}
+	catch(Exception error) {
+	    Gatherer.printStackTrace(error);
+	}
+	return file;
+    } /** removeDirectoryMapping(String name) */
 
     /** Export the general configuration to file. */
Index: /trunk/gli/src/org/greenstone/gatherer/collection/Collection.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/collection/Collection.java	(revision 6085)
+++ /trunk/gli/src/org/greenstone/gatherer/collection/Collection.java	(revision 6086)
@@ -62,95 +62,50 @@
  */
 public class Collection {
-	/** A reference to the BuildOptions. */
-	public BuildOptions build_options;
-	/** A reference to the Collection Design Manager. */
-	public CollectionDesignManager cdm;
-	/** A reference to the Greenstone Directory Metadata Manager. */
-	public GDMManager gdm;
-	/** A reference to the Metadata Set Manager. */
-	public MetadataSetManager msm;
-	/** <i>true</i> if the currently loaded collection has been saved since the last significant change, <i>false</i> otherwise. */
-	private boolean saved = false;
-	/** The document around which this collection class is based. */
-	private Document document;
-	/** The file the collection is in (the file may not actually exist, such in the case of a legacy collection)! */
-	private File file;
-   /** The name of the argument element. */
-   static final private String ARGUMENT = "Argument";
-   static final private String BASE_COLLECTION = "base_collection";
-	/** The name of the build element. */
-	static final private String BUILD = "Build";
-	/** The name of the build config element. */
-	static final private String BUILD_CONFIG = "BuildConfig";
-	/** The name of the collection xml template. */
-	static final private String COLLECTION_XML_TEMPLATE = "xml/template.col";
-	/** The name of the directory mappings element. */
-	static final private String DIRECTORY_MAPPINGS = "DirectoryMappings";
-	/** The name of the file attribute. */
-	static final private String FILE = "file";
-	/** The name of the import element. */
-	static final private String IMPORT = "Import";
-	/** The name of the imported attribute. */
-	static final private String IMPORTED = "imported";
-	/** The name of the mapping element. */
-	static final private String MAPPING = "Mapping";
-	/** The name of the name attribute. */
-	static final private String NAME = "name";
-	/** The name of the true value. */
-	static final private String TRUE = "true";
-	/** Constructor. */
-	public Collection(File collection_xml) {
-		this.file = collection_xml;
-		// Try to load this collections details.
-		document = Utility.parse(collection_xml, false);
-		// If that fails load the default settings for a collection.
-		if(document == null) {
-			document = Utility.parse(COLLECTION_XML_TEMPLATE, true);
-		}
-		// Point the Configuration class at our gatherer config arguments.
-		Gatherer.config.setCollectionConfiguration(document);
-		// Finally create all of the child managers that are directly dependant on a collection
-		build_options = new BuildOptions(getBuildValues(), getImportValues());
-	}
-
-	/** Add a special directory mapping. */
-	public boolean addDirectoryMapping(String name, File file) {
-	boolean result = false;
-	try {
-		Element document_element = document.getDocumentElement();
-		Element directory_mappings_element = (Element) MSMUtils.getNodeFromNamed(document_element, DIRECTORY_MAPPINGS);
-				// Ensure the name isn't already in use.
-		boolean found = false;
-		NodeList mappings = directory_mappings_element.getElementsByTagName(MAPPING);
-		for(int i = 0; !found && i < mappings.getLength(); i++) {
-		Element mapping_element = (Element) mappings.item(i);
-		if(mapping_element.getAttribute(NAME).equalsIgnoreCase(name)) {
-			found = true;
-		}
-		mapping_element = null;
-		}
-		// Otherwise add the mapping.
-		if(!found) {
-		Element mapping_element = document.createElement(MAPPING);
-		mapping_element.setAttribute(NAME, name);
-		mapping_element.setAttribute(FILE, file.toString());
-		directory_mappings_element.appendChild(mapping_element);
-		result = true;
-		mapping_element = null;
-		}
-		mappings = null;
-		directory_mappings_element = null;
-		document_element = null;
-		saved = false;
-	}
-	catch (Exception error) {
-		Gatherer.printStackTrace(error);
-	}
-	return result;
-	}
-
-	/** Destructor.
-	 * @see org.greenstone.gatherer.collection.CollectionModel */
-	public void destroy() {
+    /** A reference to the BuildOptions. */
+    public BuildOptions build_options;
+    /** A reference to the Collection Design Manager. */
+    public CollectionDesignManager cdm;
+    /** A reference to the Greenstone Directory Metadata Manager. */
+    public GDMManager gdm;
+    /** A reference to the Metadata Set Manager. */
+    public MetadataSetManager msm;
+    /** <i>true</i> if the currently loaded collection has been saved since the last significant change, <i>false</i> otherwise. */
+    private boolean saved = false;
+    /** The document around which this collection class is based. */
+    private Document document;
+    /** The file the collection is in (the file may not actually exist, such in the case of a legacy collection)! */
+    private File file;
+    /** The name of the argument element. */
+    static final private String ARGUMENT = "Argument";
+    static final private String BASE_COLLECTION = "base_collection";
+    /** The name of the build element. */
+    static final private String BUILD = "Build";
+    /** The name of the build config element. */
+    static final private String BUILD_CONFIG = "BuildConfig";
+    /** The name of the collection xml template. */
+    static final private String COLLECTION_XML_TEMPLATE = "xml/template.col";
+    /** The name of the import element. */
+    static final private String IMPORT = "Import";
+    /** The name of the imported attribute. */
+    static final private String IMPORTED = "imported";
+
+    /** Constructor. */
+    public Collection(File collection_xml) {
+	this.file = collection_xml;
+	// Try to load this collections details.
+	document = Utility.parse(collection_xml, false);
+	// If that fails load the default settings for a collection.
+	if(document == null) {
+	    document = Utility.parse(COLLECTION_XML_TEMPLATE, true);
+	}
+	// Point the Configuration class at our gatherer config arguments.
+	Gatherer.config.setCollectionConfiguration(document);
+	// Finally create all of the child managers that are directly dependant on a collection
+	build_options = new BuildOptions(getBuildValues(), getImportValues());
+    }
+    
+    /** Destructor.
+     * @see org.greenstone.gatherer.collection.CollectionModel */
+    public void destroy() {
 	cdm.destroy();
 	gdm.destroy();
@@ -161,309 +116,254 @@
 	gdm = null;
 	msm = null;
-	}
-
-   /** Determine the path to the base collection.
-	* @return the path as a String
-	*/
-   public String getBaseCollection() {
-	  return getString(BASE_COLLECTION);
-   }
-
-	/** Determine the number of documents and folders in this collection. */
-	public int getCount() {
+    }
+    
+    /** Determine the path to the base collection.
+     * @return the path as a String
+     */
+    public String getBaseCollection() {
+	return getString(BASE_COLLECTION);
+    }
+    
+    /** Determine the number of documents and folders in this collection. */
+    public int getCount() {
 	return getCount((TreeNode)Gatherer.c_man.getRecordSet().getRoot(), true, true);
-	}
-
-	/** Calculates the number of documents in this collection. */
-	public int getDocumentCount() {
+    }
+    
+    /** Calculates the number of documents in this collection. */
+    public int getDocumentCount() {
 	return getCount((TreeNode)Gatherer.c_man.getRecordSet().getRoot(), false, true);
-	}
-
-	/** Retrieve the description of this collection.
-	 * @return a String
-	 */
-	public String getDescription() {
-		if(cdm == null) {
-			return StaticStrings.EMPTY_STR;
-		}
-		CollectionMeta collection_extra_collectionmeta = cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONEXTRA_STR);
-		return collection_extra_collectionmeta.getValue(CollectionMeta.TEXT);
-	}
-
-	/** Retrieve the special directory mappings associated with this collection.
-	 * @return A <strong>HashMap</strong> containing mappings from names to directories.
-	 */
-	public HashMap getDirectoryMappings() {
-		HashMap special_directories = new HashMap();
-		try {
-			Element document_element = document.getDocumentElement();
-			Element directory_mappings_element = (Element) MSMUtils.getNodeFromNamed(document_element, DIRECTORY_MAPPINGS);
-			// Ensure the name isn't already in use.
-			boolean found = false;
-			NodeList mappings = directory_mappings_element.getElementsByTagName(MAPPING);
-			for(int i = 0; !found && i < mappings.getLength(); i++) {
-				Element mapping_element = (Element) mappings.item(i);
-				String name = mapping_element.getAttribute(NAME);
-				File file = new File(mapping_element.getAttribute(FILE));
-				special_directories.put(name, file);
-				file = null;
-				name = null;
-				mapping_element = null;
-			}
-			mappings = null;
-			directory_mappings_element = null;
-			document_element = null;
-		}
-		catch(Exception error) {
-			Gatherer.printStackTrace(error);
-		}
-		return special_directories;
-	}
-	/** Retrieve the authors email for this collection.
-	 * @return The email as a <strong>String</strong>.
-	 */
-	public String getEmail() {
-		if(cdm == null) {
-			return StaticStrings.EMPTY_STR;
-		}
-		CollectionMeta creator_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getCreator());
-		return creator_collectionmeta.getValue(CollectionMeta.TEXT);
-	}
-
-	/** Retrieve the short name for this collection.
-	 * @return The name as a <strong>String</strong>.
-	 */
-	public String getName() {
-		return file.getParentFile().getName();
-	}
-
-	/** Determine if this collection has been saved since the last major change.
-	 * @return <i>true</i> if it has been saved recently, <i>false</i> otherwise.
-	 */
-	public boolean getSaved() {
-		return saved;
-	}
-
-	/** Retrieve the title of this collection.
-	 * @return The title as a <strong>String</strong>.
-	 */
-	public String getTitle() {
-		if(cdm == null) {
-			return StaticStrings.EMPTY_STR;
-		}
-		CollectionMeta collection_name_collectionmeta = cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONNAME_STR);
-		return collection_name_collectionmeta.getValue(CollectionMeta.TEXT);
-	}
-	/** Remove a previously defined special directory mapping.
-	 * @param name The name of the mapping to remove as a <strong>String</strong>.
-	 * @return The <strong>File</strong> of the mapping removed.
-	 */
-	public File removeDirectoryMapping(String name) {
-		File file = null;
-		try {
-			Element document_element = document.getDocumentElement();
-			Element directory_mappings_element = (Element) MSMUtils.getNodeFromNamed(document_element, DIRECTORY_MAPPINGS);
-			// Ensure the name isn't already in use.
-			boolean found = false;
-			NodeList mappings = directory_mappings_element.getElementsByTagName(MAPPING);
-			for(int i = 0; !found && i < mappings.getLength(); i++) {
-				Element mapping_element = (Element) mappings.item(i);
-				if(mapping_element.getAttribute(NAME).equalsIgnoreCase(name)) {
-					file = new File(MSMUtils.getValue(mapping_element));
-					directory_mappings_element.removeChild(mapping_element);
-					found = true;
-				}
-				mapping_element = null;
-			}
-			mappings = null;
-			directory_mappings_element = null;
-			document_element = null;
-			saved = false;
-		}
-		catch(Exception error) {
-			Gatherer.printStackTrace(error);
-		}
-		return file;
-	}
-	/** Save this xml document to the given file. */
-	public void save() {
+    }
+    
+    /** Retrieve the description of this collection.
+     * @return a String
+     */
+    public String getDescription() {
+	if(cdm == null) {
+	    return StaticStrings.EMPTY_STR;
+	}
+	CollectionMeta collection_extra_collectionmeta = cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONEXTRA_STR);
+	return collection_extra_collectionmeta.getValue(CollectionMeta.TEXT);
+    }
+    
+    /** Retrieve the authors email for this collection.
+     * @return The email as a <strong>String</strong>.
+     */
+    public String getEmail() {
+	if(cdm == null) {
+	    return StaticStrings.EMPTY_STR;
+	}
+	CollectionMeta creator_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getCreator());
+	return creator_collectionmeta.getValue(CollectionMeta.TEXT);
+    }
+    
+    /** Retrieve the short name for this collection.
+     * @return The name as a <strong>String</strong>.
+     */
+    public String getName() {
+	return file.getParentFile().getName();
+    }
+    
+    /** Determine if this collection has been saved since the last major change.
+     * @return <i>true</i> if it has been saved recently, <i>false</i> otherwise.
+     */
+    public boolean getSaved() {
+	return saved;
+    }
+    
+    /** Retrieve the title of this collection.
+     * @return The title as a <strong>String</strong>.
+     */
+    public String getTitle() {
+	if(cdm == null) {
+	    return StaticStrings.EMPTY_STR;
+	}
+	CollectionMeta collection_name_collectionmeta = cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONNAME_STR);
+	return collection_name_collectionmeta.getValue(CollectionMeta.TEXT);
+    }
+
+    /** Save this xml document to the given file. */
+    public void save() {
 	Utility.export(document, file);
-	}
-
-   public void setBaseCollection(String base_collection) {
-	  set(BASE_COLLECTION, base_collection);
-   }
-
-	/** Set the value of imported to the given value.
-	 * @param value The new value for imported, <i>true</i> if the collection has been imported successfully, <i>false</i> otherwise.
-	 */
-	public void setImported(boolean value) {
+    }
+
+    public void setBaseCollection(String base_collection) {
+	set(BASE_COLLECTION, base_collection);
+    }
+    
+    /** Set the value of imported to the given value.
+     * @param value The new value for imported, <i>true</i> if the collection has been imported successfully, <i>false</i> otherwise.
+     */
+    public void setImported(boolean value) {
 	set(IMPORTED, value);
 	saved = false;
-	}
-	/** Set the value of saved to the given value.
-	 * @param value The new value for saved, <i>true</i> if the collection has been saved recently, <i>false</i> otherwise.
-	 */
-	public void setSaved(boolean value) {
+    }
+
+    /** Set the value of saved to the given value.
+     * @param value The new value for saved, <i>true</i> if the collection has been saved recently, <i>false</i> otherwise.
+     */
+    public void setSaved(boolean value) {
 	saved = value;
-	}
-	/** Set the value of title to the given value.
-	 * @param title The new <strong>String</strong> title.
-	 */
-	public void setTitle(String title) {
-		if(cdm != null) {
-			CollectionMeta collection_name_collectionmeta = cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONNAME_STR);
-			collection_name_collectionmeta.setValue(title);
-		}
-	}
-	/** Method called to return a textual representation of a class, which in this case is the collections title.
-	 * @return A <strong>String</strong> containing the collections title.
-	 */
-	public String toString() {
-		return getTitle();
-	}
-	/** Get the value of a collection argument. */
-	private boolean get(String name) {
+    }
+
+    /** Set the value of title to the given value.
+     * @param title The new <strong>String</strong> title.
+     */
+    public void setTitle(String title) {
+	if(cdm != null) {
+	    CollectionMeta collection_name_collectionmeta = cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONNAME_STR);
+	    collection_name_collectionmeta.setValue(title);
+	}
+    }
+
+    /** Method called to return a textual representation of a class, which in this case is the collections title.
+     * @return A <strong>String</strong> containing the collections title.
+     */
+    public String toString() {
+	return getTitle();
+    }
+    
+    /** Get the value of a collection argument. */
+    private boolean get(String name) {
 	boolean result = false;
 	try {
-		Element document_element = document.getDocumentElement();
-		NodeList arguments = document_element.getElementsByTagName(ARGUMENT);
-		boolean found = false;
-		for(int i = 0; !found && i < arguments.getLength(); i++) {
+	    Element document_element = document.getDocumentElement();
+	    NodeList arguments = document_element.getElementsByTagName(ARGUMENT);
+	    boolean found = false;
+	    for(int i = 0; !found && i < arguments.getLength(); i++) {
 		Element argument_element = (Element) arguments.item(i);
 		if(argument_element.getParentNode() == document_element) {
-			if(argument_element.getAttribute(NAME).equalsIgnoreCase(name)) {
+		    if(argument_element.getAttribute(StaticStrings.NAME_ATTRIBUTE).equalsIgnoreCase(name)) {
 			String value = MSMUtils.getValue(argument_element);
-			if(value.equalsIgnoreCase(TRUE)) {
-				result = true;
+			if(value.equalsIgnoreCase(StaticStrings.TRUE_STR)) {
+			    result = true;
 			}
 			found = true;
 			value = null;
-			}
+		    }
 		}
 		argument_element = null;
-		}
-		arguments = null;
-		document_element = null;
-	}
-	catch (Exception error) {
-		Gatherer.printStackTrace(error);
+	    }
+	    arguments = null;
+	    document_element = null;
+	}
+	catch (Exception error) {
+	    Gatherer.printStackTrace(error);
 	}
 	return result;
-	}
-
-	/** Get the value of a collection argument. */
-	private String getString(String name) {
+    }
+    
+    /** Get the value of a collection argument. */
+    private String getString(String name) {
 	String result = "";
 	try {
-		Element document_element = document.getDocumentElement();
-		NodeList arguments = document_element.getElementsByTagName(ARGUMENT);
-		boolean found = false;
-		for(int i = 0; !found && i < arguments.getLength(); i++) {
+	    Element document_element = document.getDocumentElement();
+	    NodeList arguments = document_element.getElementsByTagName(ARGUMENT);
+	    boolean found = false;
+	    for(int i = 0; !found && i < arguments.getLength(); i++) {
 		Element argument_element = (Element) arguments.item(i);
 		if(argument_element.getParentNode() == document_element) {
-			if(argument_element.getAttribute(NAME).equalsIgnoreCase(name)) {
+		    if(argument_element.getAttribute(StaticStrings.NAME_ATTRIBUTE).equalsIgnoreCase(name)) {
 			result = MSMUtils.getValue(argument_element);
 			found = true;
-			}
+		    }
 		}
 		argument_element = null;
-		}
-		arguments = null;
-		document_element = null;
-	}
-	catch (Exception error) {
-		Gatherer.printStackTrace(error);
+	    }
+	    arguments = null;
+	    document_element = null;
+	}
+	catch (Exception error) {
+	    Gatherer.printStackTrace(error);
 	}
 	return result;
-	}
-
-	/** Method to retrieve the current build options associated with this Collection. */
-	private Element getBuildValues() {
+    }
+    
+    /** Method to retrieve the current build options associated with this Collection. */
+    private Element getBuildValues() {
 	Element build_values_element = null;
 	try {
-		Element document_element = document.getDocumentElement();
-		Element build_config_element = (Element) MSMUtils.getNodeFromNamed(document_element, BUILD_CONFIG);
-		build_values_element = (Element) MSMUtils.getNodeFromNamed(build_config_element, BUILD);
-		build_config_element = null;
-		document_element = null;
-	}
-	catch (Exception error) {
-		Gatherer.printStackTrace(error);
+	    Element document_element = document.getDocumentElement();
+	    Element build_config_element = (Element) MSMUtils.getNodeFromNamed(document_element, BUILD_CONFIG);
+	    build_values_element = (Element) MSMUtils.getNodeFromNamed(build_config_element, BUILD);
+	    build_config_element = null;
+	    document_element = null;
+	}
+	catch (Exception error) {
+	    Gatherer.printStackTrace(error);
 	}
 	return build_values_element;
-	}
-
-	/** Count either documents or folders, depending on the state of the given boolean. */
-	private int getCount(TreeNode node, boolean count_folders, boolean count_files) {
+    }
+    
+    /** Count either documents or folders, depending on the state of the given boolean. */
+    private int getCount(TreeNode node, boolean count_folders, boolean count_files) {
 	int count = 0;
 	File file = ((FileNode)node).getFile();
 	if(file.isFile() && count_files) {
-		count++;
+	    count++;
 	}
 	else if(file.isDirectory() && count_folders) {
-		count++;
+	    count++;
 	}
 	for(int i = 0; i < node.getChildCount(); i++) {
-		count = count + getCount(node.getChildAt(i), count_folders, count_files);
+	    count = count + getCount(node.getChildAt(i), count_folders, count_files);
 	}
 	return count;
-	}
-
-	/** Method to retrieve the current import options associated with this Collection. */
-	public Element getImportValues() {
+    }
+    
+    /** Method to retrieve the current import options associated with this Collection. */
+    public Element getImportValues() {
 	Element import_values_element = null;
 	try {
-		Element document_element = document.getDocumentElement();
-		Element build_config_element = (Element) MSMUtils.getNodeFromNamed(document_element, BUILD_CONFIG);
-		import_values_element = (Element) MSMUtils.getNodeFromNamed(build_config_element, IMPORT);
-		build_config_element = null;
-		document_element = null;
-	}
-	catch (Exception error) {
-		Gatherer.printStackTrace(error);
+	    Element document_element = document.getDocumentElement();
+	    Element build_config_element = (Element) MSMUtils.getNodeFromNamed(document_element, BUILD_CONFIG);
+	    import_values_element = (Element) MSMUtils.getNodeFromNamed(build_config_element, IMPORT);
+	    build_config_element = null;
+	    document_element = null;
+	}
+	catch (Exception error) {
+	    Gatherer.printStackTrace(error);
 	}
 	return import_values_element;
-	}
-
-   /** Set the value of a collection argument. */
-   private void set(String name, boolean value) {
-	  set(name, (value ? StaticStrings.TRUE_STR : StaticStrings.FALSE_STR));
-   }
-
-   private void set(String name, String value) {
-	  try {
-	 Element document_element = document.getDocumentElement();
-	 NodeList arguments = document_element.getElementsByTagName(ARGUMENT);
-	 boolean found = false;
-	 for(int i = 0; !found && i < arguments.getLength(); i++) {
+    }
+    
+    /** Set the value of a collection argument. */
+    private void set(String name, boolean value) {
+	set(name, (value ? StaticStrings.TRUE_STR : StaticStrings.FALSE_STR));
+    }
+    
+    private void set(String name, String value) {
+	try {
+	    Element document_element = document.getDocumentElement();
+	    NodeList arguments = document_element.getElementsByTagName(ARGUMENT);
+	    boolean found = false;
+	    for(int i = 0; !found && i < arguments.getLength(); i++) {
 		Element argument_element = (Element) arguments.item(i);
 		if(argument_element.getParentNode() == document_element) {
-		   if(argument_element.getAttribute(NAME).equalsIgnoreCase(name)) {
-		  // Strip any current value nodes.
-		  while(argument_element.hasChildNodes()) {
-			 argument_element.removeChild(argument_element.getFirstChild());
-		  }
-		  // Append new value
-		  argument_element.appendChild(document.createTextNode(value));
-		  found = true;
-		   }
+		    if(argument_element.getAttribute(StaticStrings.NAME_ATTRIBUTE).equalsIgnoreCase(name)) {
+			// Strip any current value nodes.
+			while(argument_element.hasChildNodes()) {
+			    argument_element.removeChild(argument_element.getFirstChild());
+			}
+			// Append new value
+			argument_element.appendChild(document.createTextNode(value));
+			found = true;
+		    }
 		}
 		argument_element = null;
-	 }
-	 // Append it
-	 if(!found) {
+	    }
+	    // Append it
+	    if(!found) {
 		Element argument_element = document.createElement(ARGUMENT);
-		argument_element.setAttribute(NAME, name);
+		argument_element.setAttribute(StaticStrings.NAME_ATTRIBUTE, name);
 		argument_element.appendChild(document.createTextNode(value));
 		document_element.appendChild(argument_element);
 		argument_element = null;
-	 }
-	 arguments = null;
-	 document_element = null;
-	  }
-	  catch (Exception error) {
-	 Gatherer.printStackTrace(error);
-	  }
-   }
+	    }
+	    arguments = null;
+	    document_element = null;
+	}
+	catch (Exception error) {
+	    Gatherer.printStackTrace(error);
+	}
+    }
 }
Index: /trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 6085)
+++ /trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java	(revision 6086)
@@ -139,10 +139,8 @@
      */
     public void addDirectoryMapping(String name, File file) {
-	if(ready()) {
-	    // Update the information stored in the collection
-	    collection.addDirectoryMapping(name, file);
-	    // Now update the tree
-	    Gatherer.g_man.collection_pane.refreshWorkspaceTree(WorkspaceTree.MAPPED_DIRECTORIES_CHANGED);
-	}
+	// Update the information stored in the Gatherer config
+	Gatherer.config.addDirectoryMapping(name, file);
+	// Now update the tree
+	Gatherer.g_man.collection_pane.refreshWorkspaceTree(WorkspaceTree.MAPPED_DIRECTORIES_CHANGED);
     }
     /** This method calls the builcol.pl scripts via a GShell so as to not lock up the processor.
@@ -667,10 +665,6 @@
     static public FileNode[] getCollectionSpecificMappings()
     {
-	if (!ready()) {
-	    return null;
-	}
-
 	// Return any predefined special directories
-	HashMap mappings = collection.getDirectoryMappings();
+	HashMap mappings = Gatherer.config.getDirectoryMappings();
 	FileNode[] mapping_nodes = new FileNode[mappings.size()];
 	Iterator mappings_iterator = mappings.keySet().iterator();
@@ -680,5 +674,4 @@
 	    mapping_nodes[i] = new FileNode(mapping_file, mapping_name);
 	}
-
 	return mapping_nodes;
     }
@@ -1136,11 +1129,8 @@
      */
     public File removeDirectoryMapping(FileNode target) {
-	File file = null;
-	if(ready()) {
-	    // Remove from collection, remembering file
-	    file = collection.removeDirectoryMapping(target.toString());
-	    // Update tree.
-	    Gatherer.g_man.collection_pane.refreshWorkspaceTree(WorkspaceTree.MAPPED_DIRECTORIES_CHANGED);
-	}
+	// Remove from config, remembering file
+	File file = Gatherer.config.removeDirectoryMapping(target.toString());
+	// Update tree.
+	Gatherer.g_man.collection_pane.refreshWorkspaceTree(WorkspaceTree.MAPPED_DIRECTORIES_CHANGED);
 	return file;
     }
Index: /trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java	(revision 6085)
+++ /trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java	(revision 6086)
@@ -66,13 +66,15 @@
     static private void loadCollectionSpecificMappings()
     {
+	///ystem.err.print("Load Collection Specific Mappings... ");
 	// Add the current collection specific mappings
 	collection_specific_mappings = CollectionManager.getCollectionSpecificMappings();
+	///ystem.err.print("Retrieved Mappings... ");
 	if (collection_specific_mappings != null) {
 	    for (int i = 0; i < collection_specific_mappings.length; i++) {
-		SynchronizedTreeModelTools.insertNodeInto(workspace_tree_model,
-							  workspace_tree_root,
-							  collection_specific_mappings[i]);
+		///ystem.err.print("Setting " + i + " Mapping... ");
+		SynchronizedTreeModelTools.insertNodeInto(workspace_tree_model, workspace_tree_root, collection_specific_mappings[i], false);
 	    }
 	}
+	///ystem.err.println("Done.");
     }
 
Index: /trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java
===================================================================
--- /trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java	(revision 6085)
+++ /trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java	(revision 6086)
@@ -23,9 +23,9 @@
 
     public void refresh(int refresh_reason) {
-	System.err.print("WorkspaceTree::refresh()... ");
+	Gatherer.println("WorkspaceTree::refresh()... ");
 
 	// The collections in the library have changed - refresh the collect directory
 	if (refresh_reason == DragTree.LIBRARY_CONTENTS_CHANGED) {
-	    System.err.println("Reason: library contents changed.");
+	    Gatherer.println("...Reason: library contents changed.");
 	    String collect_directory_str = Gatherer.config.gsdl_path + Utility.COL_DIR;
 	    refreshEveryNodeShowingFolder(collect_directory_str);
@@ -35,5 +35,5 @@
 	// A collection has been opened/closed - reload the whole shebang
 	if (refresh_reason == DragTree.LOADED_COLLECTION_CHANGED) {
-	    System.err.println("Reason: loaded collection changed.");
+	    Gatherer.println("...Reason: loaded collection changed.");
 	    setModel(WorkspaceTreeModel.getWorkspaceTreeModel());
 	}
@@ -41,5 +41,5 @@
 	// The collection's contents have changed - refresh collection's import folder
 	if (refresh_reason == DragTree.COLLECTION_CONTENTS_CHANGED) {
-	    System.err.println("Reason: collection contents changed.");
+	    Gatherer.println("...Reason: collection contents changed.");
 	    String import_directory_str = Gatherer.c_man.getCollectionImport();
 	    refreshEveryNodeShowingFolder(import_directory_str);
@@ -48,5 +48,5 @@
 	// The method for displaying the tree has changed - redraw the tree
 	if (refresh_reason == DragTree.TREE_DISPLAY_CHANGED) {
-	    System.err.println("Reason: tree display changed.");
+	    Gatherer.println("...Reason: tree display changed.");
 	    updateUI();
 	}
@@ -54,5 +54,5 @@
 	// The collection specific mapped directories have changed - refresh only them
 	if (refresh_reason == WorkspaceTree.MAPPED_DIRECTORIES_CHANGED) {
-	    System.err.println("Reason: mapped directories changed.");
+	    Gatherer.println("...Reason: mapped directories changed.");
 	    WorkspaceTreeModel.refreshWebCacheMappings();
 	    WorkspaceTreeModel.refreshCollectionSpecificMappings();
