Changeset 3467


Ignore:
Timestamp:
2002-10-16T09:27:55+13:00 (22 years ago)
Author:
kjdon
Message:

the xml representation of cgi args now has two attributes 'action' and 'subaction', instead of the single 'info' attribute

Location:
trunk/gsdl3/src/java/org/greenstone/gsdl3
Files:
6 edited

Legend:

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

    r3438 r3467  
    5252    config_.createXML();
    5353   
    54     // new message router - create it and pass a handle to recept.
     54    // new message router - create it and pass reference to recept.
    5555    // the servlet wont use this directly
    5656    message_router_ = new MessageRouter();
     
    8585        // display the home page
    8686        // a=p&p=home
    87         xml_request +="<request type='action' output='html' info='p/home'/>";
     87        xml_request +="<request type='action' output='html' action='p' subaction='home'/>";
    8888    } else {
    8989        String subaction = request.getParameter("sa");
    90         xml_request += "<request type='action' info='"+action;
     90        xml_request += "<request type='action' action='"+action+"'";
    9191        if (subaction != null) {
    92         xml_request += "/"+subaction;
     92        xml_request += " subaction='"+subaction+"'";
    9393        }
    94         xml_request += "'><paramList>";
     94        xml_request += "><paramList>";
    9595        Enumeration params = request.getParameterNames();
    9696        while(params.hasMoreElements()) {
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/AppletAction.java

    r3460 r3467  
    2626
    2727    Element request = (Element)message.getElementsByTagName("request").item(0);
    28     // the applet info is like a/d = applet/display
    29     String info = request.getAttribute("info");
    30     // remove the a/ bit
    31     info = GSPath.removeFirstLink(info);
    32     String request_type = GSPath.getFirstLink(info); // should be 'd' or 'r'
     28
     29    // subaction is display/request
     30    String request_type = request.getAttribute("subaction"); // should be 'd' or 'r'
    3331    if (!request_type.equals("d")&&!request_type.equals("r")) {
    3432        return GSHTML.errorPage("the sa arg to a=a should be d or r!!");
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/BrowseAction.java

    r3459 r3467  
    2525    Element request = (Element)message.getElementsByTagName("request").item(0);
    2626   
    27     String info = request.getAttribute("info");
    28     // remove the b/ bit
    29     info = GSPath.removeFirstLink(info);
    30     String browse_type = GSPath.getFirstLink(info);
     27    // the browse type is the subaction
     28    String browse_type = request.getAttribute("subaction");
    3129   
    3230    if (browse_type.equals("classifier")) {
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/PageAction.java

    r3455 r3467  
    1717   
    1818    Element request = (Element)message.getElementsByTagName("request").item(0);
    19     String info = request.getAttribute("info");
    20     // remove the page/ bit
    21     info = GSPath.removeFirstLink(info);
    22     String page_name = GSPath.getFirstLink(info);
     19    // the page name is the subaction
     20    String page_name = request.getAttribute("subaction");
    2321
    2422    // create the return page tree
     
    8785    Document style_doc = converter_.getDOM(new File(stylesheet));
    8886    GSXSLT.absoluteIncludePaths(style_doc, config_);
     87    //System.out.println("page=");
     88    //System.out.println(converter_.getString(page));
    8989    return transformer_.transform(style_doc, page);   
    9090   
     
    9797    HashMap params = GSXML.extractParams((Element)GSXML.getNodeByPath(request, "paramList"));
    9898    String coll_name = (String)params.get("c");
     99    if (coll_name == null || coll_name.equals("")) {
     100        coll_name = (String)params.get("sc"); // cluster name
     101    }
     102    if (coll_name == null || coll_name.equals("")) {
     103        return GSHTML.errorPage("about page - need to specify coll name or cluster name");
     104    }
    99105
    100106    Element coll_about_message = doc_.createElement("message");
     
    108114    Element coll_about_response = (Element)mr_.process(coll_about_message);
    109115
    110 
     116    //  System.out.println("coll response=");
     117    //System.out.println(converter_.getString(coll_about_response));
    111118    // add the response to the page
    112119    page.appendChild(doc_.importNode(GSXML.getChildByTagName(coll_about_response, "response"), true));
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/QueryAction.java

    r3455 r3467  
    3030
    3131    Element request = (Element)message.getElementsByTagName("request").item(0);
    32     String info = request.getAttribute("info");
    33     // remove the q/ bit
    34     info = GSPath.removeFirstLink(info);
    35     String query_type = GSPath.getFirstLink(info);
     32    // query type is teh subaction
     33    String query_type = request.getAttribute("subaction");
    3634   
    3735    if (query_type.equals("")) {
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/action/ResourceAction.java

    r3455 r3467  
    2525    }
    2626
    27     // for now, info="r" eventually we may want to change to r/text r/assoc
    28     // or something
     27    // for now, no subaction eventually we may want to have subactions such as text assoc or something ?
     28   
    2929    Element request = (Element)message.getElementsByTagName("request").item(0);
    3030
Note: See TracChangeset for help on using the changeset viewer.