Ignore:
Timestamp:
2003-01-17T10:45:27+13:00 (21 years ago)
Author:
kjdon
Message:

changes to cgi args: a=action, sa=subaction, s=servicename, rt=request-type (d for display, r for request, s for status) ro=request-only (dont process the page using xslt, just pass back the xml)

File:
1 edited

Legend:

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

    r3645 r3682  
    3333       page.appendChild(doc_.importNode(GSXML.getChildByTagName(message, GSXML.CONFIGURATION_ELEM), true));
    3434
    35     // query type is the subaction
    36     String query_type = request.getAttribute(GSXML.SUBACTION_ATT) + "Query";
    37    
    38     // for now assume all queries can be handled by basic query
    39     return basicQuery(page, request, query_type);
    40    
     35       // if want to have a different type of query here, check the subaction att of request
     36
     37       // for now assume all queries can be handled by basic query
     38       return basicQuery(page, request);
     39       
    4140    }
    4241   
     
    4544     * params to the service, then gets the titles for any results
    4645     */
    47     protected Element basicQuery(Element page, Element request, String service_name) {
     46    protected Element basicQuery(Element page, Element request) {
    4847
    4948    // check that the stylesheet is present - cant output the page without one.
     
    5857   
    5958    HashMap params = GSXML.extractParams(cgi_param_list);
    60 
     59   
     60    String request_type = (String)params.get(GSCGI.REQUEST_TYPE_ARG);
     61    String service_name = (String)params.get(GSCGI.SERVICE_ARG);
    6162    String collection = (String)params.get(GSCGI.COLLECTION_ARG);
    6263    if (collection == null || collection.equals("")) {
     
    122123    page.appendChild(description);
    123124
    124     // now we always do the query - we have no way of knowing whether
    125     // a query was specified or not cos we cant assume that q is the
    126     // query string - maybe we could check that any required params have
    127     // a value??
    128    
     125    // just a display request
     126    if (request_type.equals("d")) {
     127        // output the page
     128        // process using the stylesheet
     129        Document style_doc = converter_.getDOM(new File(stylesheet));
     130        GSXSLT.absoluteIncludePaths(style_doc, config_);
     131        return (Element)transformer_.transform(style_doc, page);   
     132    }
     133       
     134    // do the query
    129135    Element mr_query_message = doc_.createElement(GSXML.MESSAGE_ELEM);
    130136    Element mr_query_request = doc_.createElement(GSXML.REQUEST_ELEM);
Note: See TracChangeset for help on using the changeset viewer.