source: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java@ 30630

Last change on this file since 30630 was 30630, checked in by kjdon, 8 years ago

getDisplayText has moved classes

  • Property svn:keywords set to Author Date Id Revision
File size: 20.3 KB
Line 
1/*
2 * CrossCollectionSearch.java
3 * Copyright (C) 2002 New Zealand Digital Library, http://www.nzdl.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19package org.greenstone.gsdl3.service;
20
21import java.util.ArrayList;
22import java.util.HashMap;
23import java.util.Iterator;
24import java.util.Map;
25import java.util.Set;
26
27import org.apache.log4j.Logger;
28import org.greenstone.gsdl3.util.GSPath;
29import org.greenstone.gsdl3.util.GSXML;
30import org.greenstone.gsdl3.util.UserContext;
31import org.greenstone.gsdl3.util.XMLConverter;
32
33import org.w3c.dom.Document;
34import org.w3c.dom.Element;
35import org.w3c.dom.Node;
36import org.w3c.dom.NodeList;
37
38/**
39 *
40 */
41
42public class CrossCollectionSearch extends ServiceRack
43{
44
45 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.CrossCollectionSearch.class.getName());
46 protected static final String QUERY_PARAM = "query";
47 protected static final String COLLECTION_PARAM = "collection";
48 protected static final String MAXDOCS_PARAM = "maxDocs"; // matches standard maxDocs, but in this case, means max docs per collection
49 protected static final String HITS_PER_PAGE_PARAM = "hitsPerPage";
50 protected static final String MAXDOCS_DEFAULT = "20";
51 // the services on offer - these proxy the actual collection ones
52 protected static final String TEXT_QUERY_SERVICE = "TextQuery";
53 protected static final String DOCUMENT_METADATA_RETRIEVE_SERVICE = "DocumentMetadataRetrieve";
54
55 protected String[] coll_ids_list = null;
56 protected String[] coll_ids_list_no_all = null;
57 // maps lang to coll names list
58 protected HashMap<String, String[]> coll_names_map = null;
59
60 //protected String[] coll_names_list = null;
61
62 /** constructor */
63 public CrossCollectionSearch()
64 {
65 }
66
67 public boolean configure(Element info, Element extra_info)
68 {
69 // any parameters? colls to include??
70 logger.info("Configuring CrossCollectionSearch...");
71 // query service
72 Element ccs_service = this.desc_doc.createElement(GSXML.SERVICE_ELEM);
73 ccs_service.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_QUERY);
74 ccs_service.setAttribute(GSXML.NAME_ATT, TEXT_QUERY_SERVICE);
75 this.short_service_info.appendChild(ccs_service);
76
77 // metadata service
78 Element dmr_service = this.desc_doc.createElement(GSXML.SERVICE_ELEM);
79 dmr_service.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_RETRIEVE);
80 dmr_service.setAttribute(GSXML.NAME_ATT, DOCUMENT_METADATA_RETRIEVE_SERVICE);
81 this.short_service_info.appendChild(dmr_service);
82
83 // get any format info
84 Element format_info = (Element) GSXML.getChildByTagName(info, GSXML.FORMAT_ELEM);
85 if (format_info != null)
86 {
87 this.format_info_map.put(TEXT_QUERY_SERVICE, this.desc_doc.importNode(format_info, true));
88 }
89 else
90 {
91 // add in a default format statement
92 //"xmlns:gsf='" + GSXML.GSF_NAMESPACE + "' xmlns:xsl='" + GSXML.XSL_NAMESPACE + "
93 String format_string = "<format "+GSXML.STD_NAMESPACES_ATTS + "><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;p.s=" + TEXT_QUERY_SERVICE + "&amp;p.c=";
94 if (this.cluster_name != null)
95 {
96 format_string += this.cluster_name;
97 }
98 format_string += "</xsl:attribute><gsf:icon/></a></td><td><gsf:metadata name='Title'/> (<xsl:value-of select='@collection'/>) </td></gsf:template></format>";
99 this.format_info_map.put(TEXT_QUERY_SERVICE, this.desc_doc.importNode(this.converter.getDOM(format_string).getDocumentElement(), true));
100 }
101 return true;
102 }
103
104 protected Element getServiceDescription(Document doc, String service, String lang, String subset)
105 {
106 if (service.equals(TEXT_QUERY_SERVICE))
107 {
108
109 Element ccs_service = doc.createElement(GSXML.SERVICE_ELEM);
110 ccs_service.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_QUERY);
111 ccs_service.setAttribute(GSXML.NAME_ATT, TEXT_QUERY_SERVICE);
112
113 // display info
114 if (subset == null || subset.equals(GSXML.DISPLAY_TEXT_ELEM + GSXML.LIST_MODIFIER))
115 {
116 ccs_service.appendChild(GSXML.createDisplayTextElement(doc, GSXML.DISPLAY_TEXT_NAME, getTextString(TEXT_QUERY_SERVICE + ".name", lang)));
117 ccs_service.appendChild(GSXML.createDisplayTextElement(doc, GSXML.DISPLAY_TEXT_SUBMIT, getTextString(TEXT_QUERY_SERVICE + ".submit", lang)));
118 ccs_service.appendChild(GSXML.createDisplayTextElement(doc, GSXML.DISPLAY_TEXT_DESCRIPTION, getTextString(TEXT_QUERY_SERVICE + ".description", lang)));
119 }
120 // param info
121 if (subset == null || subset.equals(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER))
122 {
123 Element param_list = doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
124 // collection list
125 if (coll_ids_list == null)
126 {
127 initCollectionList(lang);
128 }
129 if (!coll_names_map.containsKey(lang))
130 {
131 addCollectionNames(lang);
132 }
133 Element param = GSXML.createParameterDescription(doc, COLLECTION_PARAM, getTextString("param." + COLLECTION_PARAM, lang), GSXML.PARAM_TYPE_ENUM_MULTI, "all", coll_ids_list, coll_names_map.get(lang));
134 param_list.appendChild(param);
135 // max docs param
136 param = GSXML.createParameterDescription(doc, MAXDOCS_PARAM, getTextString("param." + MAXDOCS_PARAM, lang), GSXML.PARAM_TYPE_INTEGER, MAXDOCS_DEFAULT, null, null);
137 param_list.appendChild(param);
138 // query param
139 param = GSXML.createParameterDescription(doc, QUERY_PARAM, getTextString("param." + QUERY_PARAM, lang), GSXML.PARAM_TYPE_STRING, null, null, null);
140 param_list.appendChild(param);
141 ccs_service.appendChild(param_list);
142 }
143
144 logger.debug("service description=" + this.converter.getPrettyString(ccs_service));
145 return ccs_service;
146 }
147 // these ones are probably never called, but put them here just in case
148 Element service_elem = doc.createElement(GSXML.SERVICE_ELEM);
149 service_elem.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_RETRIEVE);
150 service_elem.setAttribute(GSXML.NAME_ATT, service);
151 return service_elem;
152
153 }
154
155 protected Element processTextQuery(Element request)
156 {
157 // Create a new (empty) result message
158 Document result_doc = XMLConverter.newDOM();
159 Element result = result_doc.createElement(GSXML.RESPONSE_ELEM);
160 result.setAttribute(GSXML.FROM_ATT, TEXT_QUERY_SERVICE);
161 result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
162
163 UserContext userContext = new UserContext(request);
164
165 // Get the parameters of the request
166 Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
167 if (param_list == null)
168 {
169 logger.error("TextQuery request had no paramList.");
170 return result; // Return the empty result
171 }
172
173 // get the collection list
174 String[] colls_list = coll_ids_list_no_all;
175 Element coll_param = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, COLLECTION_PARAM);
176 if (coll_param != null)
177 {
178 String coll_list = GSXML.getValue(coll_param);
179 if (!coll_list.equals("all") && !coll_list.equals(""))
180 {
181 colls_list = coll_list.split(",");
182 }
183 }
184
185 String maxdocs = MAXDOCS_DEFAULT;
186 Element maxdocs_param = GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, MAXDOCS_PARAM);
187 if (maxdocs_param != null) {
188 maxdocs = GSXML.getValue(maxdocs_param);
189 }
190
191 Document msg_doc = XMLConverter.newDOM();
192 Element query_message = msg_doc.createElement(GSXML.MESSAGE_ELEM);
193 // we are sending the same request to each collection - build up the to
194 // attribute for the request
195 StringBuffer to_att = new StringBuffer();
196 for (int i = 0; i < colls_list.length; i++)
197 {
198 if (i > 0)
199 {
200 to_att.append(",");
201 }
202 to_att.append(GSPath.appendLink(colls_list[i], "TextQuery"));
203
204 }
205 // send the query to all colls
206 Element query_request = GSXML.createBasicRequest(msg_doc, GSXML.REQUEST_TYPE_PROCESS, to_att.toString(), userContext);
207 query_message.appendChild(query_request);
208 // should we add params individually?
209 Element new_param_list = msg_doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
210 query_request.appendChild(new_param_list);
211 new_param_list.appendChild(msg_doc.importNode(GSXML.getNamedElement(param_list, GSXML.PARAM_ELEM, GSXML.NAME_ATT, QUERY_PARAM), true));
212
213 // for cross coll search, we only want maxdocs from each collection
214 // some colls use maxdocs, some use hits per page so lets send both
215 new_param_list.appendChild(GSXML.createParameter(msg_doc, MAXDOCS_PARAM, maxdocs));
216 new_param_list.appendChild(GSXML.createParameter(msg_doc, HITS_PER_PAGE_PARAM, maxdocs));
217 Element query_result = (Element) this.router.process(query_message);
218
219 // create the doc list for the response
220 Element doc_node_list = result_doc.createElement(GSXML.DOC_NODE_ELEM + GSXML.LIST_MODIFIER);
221 result.appendChild(doc_node_list);
222
223 NodeList responses = query_result.getElementsByTagName(GSXML.RESPONSE_ELEM);
224 int num_docs = 0;
225 for (int k = 0; k < responses.getLength(); k++)
226 {
227 String coll_name = GSPath.removeLastLink(((Element) responses.item(k)).getAttribute(GSXML.FROM_ATT));
228 NodeList nodes = ((Element) responses.item(k)).getElementsByTagName(GSXML.DOC_NODE_ELEM);
229 if (nodes == null || nodes.getLength() == 0)
230 continue;
231 num_docs += nodes.getLength();
232 Element last_node = null;
233 Element this_node = null;
234 for (int n = 0; n < nodes.getLength(); n++)
235 {
236 this_node = (Element) nodes.item(n);
237 this_node.setAttribute("collection", coll_name);
238 if (k == 0)
239 {
240
241 doc_node_list.appendChild(result_doc.importNode(this_node, true));
242 }
243 else
244 {
245 if (last_node == null)
246 {
247 last_node = (Element) GSXML.getChildByTagName(doc_node_list, GSXML.DOC_NODE_ELEM);
248 }
249 last_node = GSXML.insertIntoOrderedList(doc_node_list, GSXML.DOC_NODE_ELEM, last_node, this_node, "rank", true);
250 }
251
252 }
253 }
254 // just send back num docs returned. Too hard to work out number of matches etc as each index type
255 // does it differently
256 Element metadata_list = result_doc.createElement(GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER);
257 result.appendChild(metadata_list);
258 GSXML.addMetadata(metadata_list, "numDocsReturned", "" + num_docs);
259 return result;
260 }
261
262 // protected Element processAdvTextQuery(Element request)
263 // {
264
265 // }
266 protected boolean initCollectionList(String lang)
267 {
268 UserContext userContext = new UserContext();
269 userContext.setLanguage(lang);
270 userContext.setUserID("");
271
272 // first, get the message router info
273 Document msg_doc = XMLConverter.newDOM();
274 Element coll_list_message = msg_doc.createElement(GSXML.MESSAGE_ELEM);
275 Element coll_list_request = GSXML.createBasicRequest(msg_doc, GSXML.REQUEST_TYPE_DESCRIBE, "", userContext); // uid
276 coll_list_message.appendChild(coll_list_request);
277 logger.debug("coll list request = " + this.converter.getPrettyString(coll_list_request));
278 Element coll_list_response = (Element) this.router.process(coll_list_message);
279 if (coll_list_response == null)
280 {
281 logger.error("couldn't query the message router!");
282 return false;
283 }
284 logger.debug("coll list response = " + this.converter.getPrettyString(coll_list_response));
285 // second, get some info from each collection. we want the coll name
286 // and whether its got a text query service
287
288 NodeList colls = coll_list_response.getElementsByTagName(GSXML.COLLECTION_ELEM);
289 // we can send the same request to multiple collections at once by using a comma separated list
290 Element metadata_message = msg_doc.createElement(GSXML.MESSAGE_ELEM);
291 StringBuffer colls_sb = new StringBuffer();
292 for (int i = 0; i < colls.getLength(); i++)
293 {
294 Element c = (Element) colls.item(i);
295 String name = c.getAttribute(GSXML.NAME_ATT);
296 if (i != 0)
297 {
298 colls_sb.append(",");
299 }
300 colls_sb.append(name);
301 //Element metadata_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_DESCRIBE, name, userContext);
302 //metadata_message.appendChild(metadata_request);
303 }
304
305 Element metadata_request = GSXML.createBasicRequest(msg_doc, GSXML.REQUEST_TYPE_DESCRIBE, colls_sb.toString(), userContext);
306 metadata_message.appendChild(metadata_request);
307 logger.debug("metadata request = " + this.converter.getPrettyString(metadata_message));
308 Element metadata_response = (Element) this.router.process(metadata_message);
309 logger.debug("metadata response = " + this.converter.getPrettyString(metadata_response));
310 NodeList coll_responses = metadata_response.getElementsByTagName(GSXML.RESPONSE_ELEM);
311 ArrayList<String> valid_colls = new ArrayList<String>();
312 ArrayList<String> valid_coll_names = new ArrayList<String>();
313 for (int i = 0; i < coll_responses.getLength(); i++)
314 {
315 Element response = (Element) coll_responses.item(i);
316 Element coll = (Element) GSXML.getChildByTagName(response, GSXML.COLLECTION_ELEM);
317 Element service_list = (Element) GSXML.getChildByTagName(coll, GSXML.SERVICE_ELEM + GSXML.LIST_MODIFIER);
318 if (service_list == null)
319 continue;
320 Element query_service = GSXML.getNamedElement(service_list, GSXML.SERVICE_ELEM, GSXML.NAME_ATT, TEXT_QUERY_SERVICE); // should be AbstractTextSearch.TEXT_QUERY_SERVICE
321 if (query_service == null)
322 continue;
323 // use the name of the response in case we are talking to a remote collection, not the name of the collection.
324 String coll_id = response.getAttribute(GSXML.FROM_ATT);
325 String coll_name = getDisplayText(coll, GSXML.DISPLAY_TEXT_NAME, lang, "en");
326 valid_colls.add(coll_id);
327 valid_coll_names.add(coll_name);
328 }
329
330 this.coll_names_map = new HashMap<String, String[]>();
331
332 // ids no all has the list without 'all' option.
333 this.coll_ids_list_no_all = new String[1];
334 this.coll_ids_list_no_all = valid_colls.toArray(coll_ids_list_no_all);
335
336 valid_colls.add(0, "all");
337 valid_coll_names.add(0, getTextString("param." + COLLECTION_PARAM + ".all", lang));
338
339 this.coll_ids_list = new String[1];
340 this.coll_ids_list = valid_colls.toArray(coll_ids_list);
341
342 String[] coll_names_list = new String[1];
343 coll_names_list = valid_coll_names.toArray(coll_names_list);
344 this.coll_names_map.put(lang, coll_names_list);
345 return true;
346 }
347
348 protected void addCollectionNames(String lang)
349 {
350
351 UserContext userContext = new UserContext();
352 userContext.setLanguage(lang);
353 userContext.setUserID("");
354
355 ArrayList<String> coll_names = new ArrayList<String>();
356 coll_names.add(getTextString("param." + COLLECTION_PARAM + ".all", lang));
357
358 // need to request MR for collection descriptions
359 Document msg_doc = XMLConverter.newDOM();
360 Element metadata_message = msg_doc.createElement(GSXML.MESSAGE_ELEM);
361
362 // get a comma separated list of coll ids to send to MR
363 // the first item is the place holder for 'all'
364 StringBuffer colls_sb = new StringBuffer();
365 for (int i = 1; i < coll_ids_list.length; i++)
366 {
367 if (i != 1)
368 {
369 colls_sb.append(",");
370 }
371 colls_sb.append(coll_ids_list[i]);
372 }
373 Element metadata_request = GSXML.createBasicRequest(msg_doc, GSXML.REQUEST_TYPE_DESCRIBE, colls_sb.toString(), userContext);
374 // param_list to request just displayTextList
375 Element param_list = msg_doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
376 Element param = GSXML.createParameter(msg_doc, GSXML.SUBSET_PARAM, GSXML.DISPLAY_TEXT_ELEM + GSXML.LIST_MODIFIER);
377 param_list.appendChild(param);
378 metadata_request.appendChild(param_list);
379 metadata_message.appendChild(metadata_request);
380 logger.debug("coll names metadata request = " + this.converter.getPrettyString(metadata_message));
381 Element metadata_response = (Element) this.router.process(metadata_message);
382 logger.debug("coll names metadata response = " + this.converter.getPrettyString(metadata_response));
383 NodeList coll_responses = metadata_response.getElementsByTagName(GSXML.RESPONSE_ELEM);
384 for (int i = 0; i < coll_responses.getLength(); i++)
385 {
386 Element response = (Element) coll_responses.item(i);
387 Element coll = (Element) GSXML.getChildByTagName(response, GSXML.COLLECTION_ELEM);
388 String coll_name = getDisplayText(coll, GSXML.DISPLAY_TEXT_NAME, lang, "en");
389 coll_names.add(coll_name);
390 }
391
392 String[] coll_names_list = new String[1];
393 coll_names_list = coll_names.toArray(coll_names_list);
394 this.coll_names_map.put(lang, coll_names_list);
395
396 }
397
398 protected Element processDocumentMetadataRetrieve(Element request)
399 {
400 // Create a new (empty) result message
401 Document result_doc = XMLConverter.newDOM();
402 Element result = result_doc.createElement(GSXML.RESPONSE_ELEM);
403 result.setAttribute(GSXML.FROM_ATT, DOCUMENT_METADATA_RETRIEVE_SERVICE);
404 result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
405
406 UserContext userContext = new UserContext(request);
407 // Get the parameters of the request
408 Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
409 if (param_list == null)
410 {
411 logger.error("DocumentMetadataRetrieve request had no paramList.");
412 return result; // Return the empty result
413 }
414
415 NodeList query_doc_list = request.getElementsByTagName(GSXML.DOC_NODE_ELEM);
416 if (query_doc_list.getLength() == 0)
417 {
418 logger.error("DocumentMetadataRetrieve request had no documentNodes.");
419 return result; // Return the empty result
420 }
421
422 // the resulting doc node list
423 Element result_node_list = result_doc.createElement(GSXML.DOC_NODE_ELEM + GSXML.LIST_MODIFIER);
424 result.appendChild(result_node_list);
425
426
427 // organise the nodes into collection lists
428 HashMap<String, Node> coll_map = new HashMap<String, Node>();
429
430 for (int i = 0; i < query_doc_list.getLength(); i++)
431 {
432 Element doc_node = (Element) query_doc_list.item(i);
433 String coll_name = doc_node.getAttribute("collection");
434 Element coll_items = (Element) coll_map.get(coll_name);
435 if (coll_items == null)
436 {
437 coll_items = result_doc.createElement(GSXML.DOC_NODE_ELEM + GSXML.LIST_MODIFIER);
438 coll_map.put(coll_name, coll_items);
439 }
440 coll_items.appendChild(result_doc.importNode(doc_node, true));
441 }
442
443 // create teh individual requests
444 Document msg_doc = XMLConverter.newDOM();
445 Element meta_request_message = msg_doc.createElement(GSXML.MESSAGE_ELEM);
446 // get all the metadata params
447 Element new_param_list = msg_doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
448 Element param = GSXML.createParameter(msg_doc, "metadata", "Title");
449 new_param_list.appendChild(param);
450
451 Set mapping_set = coll_map.entrySet();
452 Iterator iter = mapping_set.iterator();
453
454 while (iter.hasNext())
455 {
456 Map.Entry e = (Map.Entry) iter.next();
457 String cname = (String) e.getKey();
458 Element doc_nodes = (Element) e.getValue();
459 Element meta_request = GSXML.createBasicRequest(msg_doc, GSXML.REQUEST_TYPE_PROCESS, GSPath.appendLink(cname, DOCUMENT_METADATA_RETRIEVE_SERVICE), userContext);
460 meta_request.appendChild(msg_doc.importNode(doc_nodes, true));
461 meta_request.appendChild(new_param_list.cloneNode(true));
462 meta_request_message.appendChild(meta_request);
463
464 }
465
466 Node meta_result_node = this.router.process(meta_request_message);
467 Element meta_result = GSXML.nodeToElement(meta_result_node);
468
469 // now need to put the doc nodes back in the right order
470 // go through the original list again. keep an element pointer to
471 // the next element in each collections list
472 NodeList meta_responses = meta_result.getElementsByTagName(GSXML.RESPONSE_ELEM);
473 for (int i = 0; i < meta_responses.getLength(); i++)
474 {
475 String collname = GSPath.removeLastLink(((Element) meta_responses.item(i)).getAttribute(GSXML.FROM_ATT));
476 Element first_elem = (Element) GSXML.getNodeByPath(meta_responses.item(i), "documentNodeList/documentNode");
477 coll_map.put(collname, first_elem);
478 }
479
480 for (int i = 0; i < query_doc_list.getLength(); i++)
481 {
482 Element doc_node = (Element) query_doc_list.item(i);
483 Element new_node = (Element) result_doc.importNode(doc_node, false);
484 result_node_list.appendChild(new_node);
485 String coll_name = doc_node.getAttribute("collection");
486
487 Element meta_elem = (Element) coll_map.get(coll_name);
488 GSXML.mergeMetadataLists(new_node, meta_elem);
489 coll_map.put(coll_name, meta_elem.getNextSibling());
490 }
491 return result;
492 }
493}
Note: See TracBrowser for help on using the repository browser.