Ignore:
Timestamp:
2003-01-06T15:23:47+13:00 (21 years ago)
Author:
kjdon
Message:

actions tidied up a bit, ResourceAction changed to DocumentAction, BuildAction removed, more general ProcessAction added

File:
1 edited

Legend:

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

    r3603 r3645  
    5959    HashMap params = GSXML.extractParams(cgi_param_list);
    6060
    61     String collection = (String)params.get("collection");
     61    String collection = (String)params.get(GSCGI.COLLECTION_ARG);
    6262    if (collection == null || collection.equals("")) {
    6363        System.err.println("QueryAction Error: no collection was specified!");
     
    7777
    7878    Element mr_info_response = (Element) mr_.process(mr_info_message);
    79     System.out.println("describe response from query=");
    80     System.out.println(converter_.getString(mr_info_response));
    8179    String path = GSXML.RESPONSE_ELEM;
    8280    path = GSPath.appendLink(path, GSXML.SERVICE_ELEM);
     
    8785        System.out.println("adding shortnames");
    8886        // add short names to the params in the param list
    89         cgi_.addShortNames(pl);
     87        cgi_.paramListAddShortNames(pl);
    9088        // for each param in the description, overwrite teh default value with the currently set value if present
    9189        Element param = (Element)pl.getFirstChild();
     
    116114        }
    117115    }
    118     System.out.println(converter_.getString(pl));
    119116   
    120117    // part of the data for the description is the cgi-params
     
    148145    // for now, just create a whole new request
    149146   
    150     // check that there are some resources - for now check the list, but later should use a numdocs metadata elem
     147    // check that there are some documents - for now check the list, but later should use a numdocs metadata elem
    151148    path = GSXML.RESPONSE_ELEM;
    152149    path = GSPath.appendLink(path, GSXML.CONTENT_ELEM);
    153     path = GSPath.appendLink(path, GSXML.RESOURCE_ELEM+GSXML.LIST_MODIFIER);
    154    
    155     Element resource_list = (Element)GSXML.getNodeByPath(mr_query_response,
    156                                  path); // resourceList not present if no docs found
    157     if (resource_list == null) {
     150    path = GSPath.appendLink(path, GSXML.DOCUMENT_ELEM+GSXML.LIST_MODIFIER);
     151   
     152    Element document_list = (Element)GSXML.getNodeByPath(mr_query_response,
     153                                 path); // documentList not present if no docs found
     154    if (document_list == null) {
    158155       
    159156        Element result_response = (Element)GSXML.getChildByTagName(mr_query_response, GSXML.RESPONSE_ELEM);
     
    182179   
    183180    // the first part of the content is the doc list
    184     meta_content.appendChild(doc_.importNode(resource_list, true));
     181    meta_content.appendChild(doc_.importNode(document_list, true));
    185182   
    186183    // the second part of the content is the metadata list
Note: See TracChangeset for help on using the changeset viewer.