Changeset 11013 for trunk/gsdl3


Ignore:
Timestamp:
2005-12-20T16:36:06+13:00 (18 years ago)
Author:
kjdon
Message:

modified to work without an explicit collection - so can have e.g. a site wide cross coll search service

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/QueryAction.java

    r9965 r11013  
    5050    String service_name = (String)params.get(GSParams.SERVICE);
    5151    String collection = (String)params.get(GSParams.COLLECTION);
    52    
     52
     53    // collection may be null or empty when we are doing cross coll services
    5354    if (collection == null || collection.equals("")) {
    54         System.err.println("QueryAction Error: no collection was specified!");
    55         return page_response; // an empty response
     55        collection = null;
    5656    }
    5757   
    5858    String lang = request.getAttribute(GSXML.LANG_ATT);
    5959    String uid = request.getAttribute(GSXML.USER_ID_ATT);
    60     String to = GSPath.appendLink(collection, service_name);
     60    String to = service_name;
     61    if (collection != null) {
     62        to = GSPath.prependLink(to, collection);
     63    }
    6164   
    6265    if (request_type.indexOf("d")!=-1) {
     
    149152    Element format_elem = (Element)GSXML.getChildByTagName(format_response, GSXML.FORMAT_ELEM);
    150153    if (format_elem != null) {
    151         ///ystem.out.println("QueryAction: found a format element, adding it to the page response");
    152         // set teh format type
     154        // set the format type
    153155        format_elem.setAttribute(GSXML.TYPE_ATT, "search");
    154156        // for now just add to the response
     
    162164    // do the metadata request on the filtered list
    163165    Element mr_metadata_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
    164     to = GSPath.appendLink(collection, "DocumentMetadataRetrieve"); // Hard-wired?
     166    to = "DocumentMetadataRetrieve";
     167    if (collection != null) {
     168        to = GSPath.prependLink(to, collection);
     169    }
    165170    Element mr_metadata_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_PROCESS, to, lang, uid);
    166171    mr_metadata_message.appendChild(mr_metadata_request);
Note: See TracChangeset for help on using the changeset viewer.