Changeset 3491


Ignore:
Timestamp:
2002-10-25T16:33:34+13:00 (22 years ago)
Author:
kjdon
Message:

actions all use cgi arg long names now, not short names

Location:
trunk/gsdl3/src/java/org/greenstone/gsdl3/action
Files:
5 edited

Legend:

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

    r3467 r3491  
    3838    HashMap params = GSXML.extractParams(cgi_paramList);
    3939
    40     String collection = (String)params.get("c");
    41     String service_name=(String)params.get("sn");
     40    String collection = (String)params.get("collection");
     41    String service_name=(String)params.get("serviceName");
    4242    service_name+= "Applet";
    4343   
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/BrowseAction.java

    r3467 r3491  
    5252    HashMap params = GSXML.extractParams(cgi_paramList);
    5353
    54     String collection = (String)params.get("c");
     54    String collection = (String)params.get("collection");
    5555    if (collection == null || collection.equals("")) {
    5656        return GSHTML.errorPage("classifierbrowse, need to specify a collection!");
     
    8383
    8484    // if there is a cl field in the cgi params, get the classifier info
    85     String node = (String)params.get("cl");
     85    String node = (String)params.get("classifier");
    8686
    8787    if (node==null|| node.equals("")) {
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/PageAction.java

    r3467 r3491  
    9494    protected String aboutPage(Element page, Element request) {
    9595
    96     // get the params out
    97     HashMap params = GSXML.extractParams((Element)GSXML.getNodeByPath(request, "paramList"));
    98     String coll_name = (String)params.get("c");
     96    // extract the params from the cgi-request,
     97    // first convert short to long names
     98    Element cgi_paramList = (Element)GSXML.getChildByTagName(request, "paramList");
     99    cgi_.toLong(cgi_paramList);
     100    HashMap params = GSXML.extractParams(cgi_paramList);
     101   
     102    String coll_name = (String)params.get("collection");
    99103    if (coll_name == null || coll_name.equals("")) {
    100         coll_name = (String)params.get("sc"); // cluster name
     104        coll_name = (String)params.get("serviceCluster"); // cluster name
    101105    }
    102106    if (coll_name == null || coll_name.equals("")) {
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/QueryAction.java

    r3467 r3491  
    6363    HashMap params = GSXML.extractParams(cgi_paramList);
    6464
    65     String collection = (String)params.get("c");
     65    String collection = (String)params.get("collection");
    6666    if (collection == null || collection.equals("")) {
    6767        return GSHTML.errorPage("textquery, need to specify a colleciton!");
     
    9494    else {
    9595        System.out.println("pl name is "+pl.getNodeName());
    96     }
    97     Element imported_paramList = (Element)doc_.importNode(pl, true);
    98     // convert the name to short
    99     cgi_.addShortNames(imported_paramList);
    100 
    101     description.appendChild(imported_paramList);
    102    
    103     // for each param in page_request, set the current value if present
    104     //actually, prob dont need to know the default value, just which one to display - overwrite the default att?
    105    
    106     Element param = (Element)imported_paramList.getFirstChild();
    107     while (param !=null) {
    108         if (param.getNodeName().equals("param")) { // just in case
    109         String name = param.getAttribute("name");
    110         String current = (String)params.get(name);
    111         if (current !=null && !current.equals("")) {
    112             param.setAttribute("default", current);
     96   
     97        Element imported_paramList = (Element)doc_.importNode(pl, true);
     98        // convert the name to short
     99        cgi_.addShortNames(imported_paramList);
     100
     101        description.appendChild(imported_paramList);
     102   
     103        // for each param in page_request, set the current value if present
     104        //actually, prob dont need to know the default value, just which one to display - overwrite the default att?
     105       
     106        Element param = (Element)imported_paramList.getFirstChild();
     107        while (param !=null) {
     108        if (param.getNodeName().equals("param")) { // just in case
     109            String name = param.getAttribute("name");
     110            String current = (String)params.get(name);
     111            if (current !=null && !current.equals("")) {
     112            param.setAttribute("default", current);
     113            }
    113114        }
     115        param = (Element)param.getNextSibling();
    114116        }
    115         param = (Element)param.getNextSibling();
    116     }
    117    
     117    }
    118118    cgi_request.appendChild(description);
    119119   
    120120    // check the query string
    121     String query = (String)params.get("q");
     121    String query = (String)params.get("query");
    122122
    123123    if (query==null|| query.equals("")) {
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/ResourceAction.java

    r3467 r3491  
    3333    HashMap params = GSXML.extractParams(cgi_paramList);
    3434
    35     String resource_name = (String)params.get("r");
     35    String resource_name = (String)params.get("resource");
    3636    if (resource_name == null || resource_name.equals("")) {
    3737        // no doc to show
     
    5656    mr_request.setAttribute("type", "query");
    5757    mr_request.setAttribute("resourceType", "core");
    58     String to = (String)params.get("c"); // collection name
     58    String to = (String)params.get("collection"); // collection name
    5959    to = GSPath.appendLink(to, "ResourceRetrieve");
    6060    mr_request.setAttribute("to", to);
Note: See TracChangeset for help on using the changeset viewer.