Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java	(revision 11228)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java	(revision 11229)
@@ -73,11 +73,17 @@
 	this.short_service_info.appendChild(dmr_service);
 
-	// add in the default format statement
-	String format_info = "<format xmlns:gsf='http://www.greenstone.org/greenstone3/schema/ConfigFormat' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'><gsf:template match='documentNode'><td><a><xsl:attribute name='href'>?a=d&amp;c=<xsl:value-of select='@collection'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test=\"@nodeType='leaf'\">&amp;sib=1</xsl:if>&amp;dt=<xsl:value-of select='@docType'/>&amp;p.a=q&amp;&amp;p.s="+TEXT_QUERY_SERVICE+"&amp;p.c=";
-	if (this.cluster_name!=null) {
-	    format_info += this.cluster_name;
-	}
-	format_info += "</xsl:attribute><gsf:icon/></a></td><td><gsf:metadata name='Title'/> (<xsl:value-of select='@collection'/>, rank:<xsl:value-of select='@rank'/>) </td></gsf:template></format>";
-	this.format_info_map.put(TEXT_QUERY_SERVICE, this.doc.importNode(this.converter.getDOM(format_info).getDocumentElement(), true));
+	// get any format info
+	Element format_info = (Element)GSXML.getChildByTagName(info, GSXML.FORMAT_ELEM);
+	if (format_info != null) {
+	    this.format_info_map.put(TEXT_QUERY_SERVICE, this.doc.importNode(format_info, true));
+	} else {
+	    // add in a default format statement
+	    String format_string = "<format xmlns:gsf='http://www.greenstone.org/greenstone3/schema/ConfigFormat' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'><gsf:template match='documentNode'><td><a><xsl:attribute name='href'>?a=d&amp;c=<xsl:value-of select='@collection'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test=\"@nodeType='leaf'\">&amp;sib=1</xsl:if>&amp;dt=<xsl:value-of select='@docType'/>&amp;p.a=q&amp;&amp;p.s="+TEXT_QUERY_SERVICE+"&amp;p.c=";
+	    if (this.cluster_name!=null) {
+		format_string += this.cluster_name;
+	    }
+	    format_string += "</xsl:attribute><gsf:icon/></a></td><td><gsf:metadata name='Title'/> (<xsl:value-of select='@collection'/>) </td></gsf:template></format>";
+	    this.format_info_map.put(TEXT_QUERY_SERVICE, this.doc.importNode(this.converter.getDOM(format_string).getDocumentElement(), true));
+	}
 	return true;
     }
@@ -104,5 +110,5 @@
 		    initCollectionList();
 		}
-		Element param = GSXML.createParameterDescription(this.doc, COLLECTION_PARAM, getTextString("param."+COLLECTION_PARAM, lang), GSXML.PARAM_TYPE_ENUM_MULTI, null, coll_ids_list, coll_names_list);
+		Element param = GSXML.createParameterDescription(this.doc, COLLECTION_PARAM, getTextString("param."+COLLECTION_PARAM, lang), GSXML.PARAM_TYPE_ENUM_MULTI, "all", coll_ids_list, coll_names_list);
 		param_list.appendChild(param);
 		// query param
@@ -140,17 +146,26 @@
 
 	// get the collection list
+	String [] colls_list;
 	Element coll_param = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT,  COLLECTION_PARAM);
-	String coll_list = GSXML.getValue(coll_param);
-	
-	String [] colls = coll_list.split(",");
+	if (coll_param == null) {
+	    colls_list = coll_ids_list;
+	} else {
+	    String coll_list = GSXML.getValue(coll_param);
+	    if (coll_list.equals("all") || coll_list.equals("")) {
+		colls_list = coll_ids_list;
+	    } else {
+		colls_list = coll_list.split(",");
+	    }
+	}
+	
 	Element query_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
 	// we are sending the same request to each collection - build up the to
 	// attribute for the request
 	StringBuffer to_att = new StringBuffer();
-	for (int i=0; i<colls.length; i++) {
+	for (int i=0; i<colls_list.length; i++) {
 	    if (i>0) {
 		to_att.append(",");
 	    }
-	    to_att.append(GSPath.appendLink(colls[i], "TextQuery"));
+	    to_att.append(GSPath.appendLink(colls_list[i], "TextQuery"));
 	    
 	}
@@ -266,4 +281,6 @@
 	    return false;
 	}
+	valid_colls.add(0, "all");
+	valid_coll_names.add(0, getTextString("param."+COLLECTION_PARAM+".all", "en" ));
 	this.coll_ids_list = new String[1];
 	this.coll_names_list = new String[1];
