Changeset 3469 for trunk/gsdl3


Ignore:
Timestamp:
2002-10-16T09:31:28+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
also small changes

File:
1 edited

Legend:

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

    r3387 r3469  
    109109    Document message_doc = converter_.getDOM(xml_in);
    110110    Element message = message_doc.getDocumentElement();
    111    
    112     NodeList requests = message.getElementsByTagName("request");
    113     if (requests.getLength()==0) {
    114         return GSHTML.errorPage("no requests in the message");
     111    // there should only be one request per message
     112    Element request = (Element)GSXML.getChildByTagName(message, "request");
     113    if (request == null) {
     114        return GSHTML.errorPage("no request in the message");
    115115    }
    116116
    117     //  should only be one request
    118     Element req = (Element)requests.item(0);
    119     String type = req.getAttribute("type"); // returns "" if no att of this name
     117    String type = request.getAttribute("type"); // returns "" if no att of this name
    120118    if (!type.equals("action")) {
    121119        return GSHTML.errorPage("wrong type in request - should be action");
    122     }
    123     String info = req.getAttribute("info");
    124     String action = GSPath.getFirstLink(info);
     120    }   
     121
     122    String action = request.getAttribute("action");
    125123    if (action.equals("")) {
    126124        return GSHTML.errorPage(" no action specified");
     
    143141    String page = a.process(message);
    144142    return page;
    145     // just pass a string for now - better to pass the doc cos already
    146     // parsed it, but we want a string back
    147     //String page = mi.process(xml_in);
    148    
    149     // output the page
    150     //return page;
    151143    }
    152144
Note: See TracChangeset for help on using the changeset viewer.