Changeset 11229 for trunk/gsdl3
- Timestamp:
- 2006-02-09T15:13:12+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java
r11014 r11229 73 73 this.short_service_info.appendChild(dmr_service); 74 74 75 // add in the default format statement 76 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&c=<xsl:value-of select='@collection'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test=\"@nodeType='leaf'\">&sib=1</xsl:if>&dt=<xsl:value-of select='@docType'/>&p.a=q&&p.s="+TEXT_QUERY_SERVICE+"&p.c="; 77 if (this.cluster_name!=null) { 78 format_info += this.cluster_name; 79 } 80 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>"; 81 this.format_info_map.put(TEXT_QUERY_SERVICE, this.doc.importNode(this.converter.getDOM(format_info).getDocumentElement(), true)); 75 // get any format info 76 Element format_info = (Element)GSXML.getChildByTagName(info, GSXML.FORMAT_ELEM); 77 if (format_info != null) { 78 this.format_info_map.put(TEXT_QUERY_SERVICE, this.doc.importNode(format_info, true)); 79 } else { 80 // add in a default format statement 81 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&c=<xsl:value-of select='@collection'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test=\"@nodeType='leaf'\">&sib=1</xsl:if>&dt=<xsl:value-of select='@docType'/>&p.a=q&&p.s="+TEXT_QUERY_SERVICE+"&p.c="; 82 if (this.cluster_name!=null) { 83 format_string += this.cluster_name; 84 } 85 format_string += "</xsl:attribute><gsf:icon/></a></td><td><gsf:metadata name='Title'/> (<xsl:value-of select='@collection'/>) </td></gsf:template></format>"; 86 this.format_info_map.put(TEXT_QUERY_SERVICE, this.doc.importNode(this.converter.getDOM(format_string).getDocumentElement(), true)); 87 } 82 88 return true; 83 89 } … … 104 110 initCollectionList(); 105 111 } 106 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);112 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); 107 113 param_list.appendChild(param); 108 114 // query param … … 140 146 141 147 // get the collection list 148 String [] colls_list; 142 149 Element coll_param = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, COLLECTION_PARAM); 143 String coll_list = GSXML.getValue(coll_param); 144 145 String [] colls = coll_list.split(","); 150 if (coll_param == null) { 151 colls_list = coll_ids_list; 152 } else { 153 String coll_list = GSXML.getValue(coll_param); 154 if (coll_list.equals("all") || coll_list.equals("")) { 155 colls_list = coll_ids_list; 156 } else { 157 colls_list = coll_list.split(","); 158 } 159 } 160 146 161 Element query_message = this.doc.createElement(GSXML.MESSAGE_ELEM); 147 162 // we are sending the same request to each collection - build up the to 148 163 // attribute for the request 149 164 StringBuffer to_att = new StringBuffer(); 150 for (int i=0; i<colls .length; i++) {165 for (int i=0; i<colls_list.length; i++) { 151 166 if (i>0) { 152 167 to_att.append(","); 153 168 } 154 to_att.append(GSPath.appendLink(colls [i], "TextQuery"));169 to_att.append(GSPath.appendLink(colls_list[i], "TextQuery")); 155 170 156 171 } … … 266 281 return false; 267 282 } 283 valid_colls.add(0, "all"); 284 valid_coll_names.add(0, getTextString("param."+COLLECTION_PARAM+".all", "en" )); 268 285 this.coll_ids_list = new String[1]; 269 286 this.coll_names_list = new String[1];
Note:
See TracChangeset
for help on using the changeset viewer.