Ignore:
Timestamp:
2008-08-08T13:23:59+12:00 (16 years ago)
Author:
davidb
Message:

Changed 'Element process(Element)' in ModuleInterface to 'Node process(Node)'. After some deliberation is was decided this is a more useful (generic) layer of the DOM to pass information around in. Helps with the DocType problem when producing XSL Transformed pages, for example. When this was an Element, it would loose track of its DocType. Supporting method provided in XMLConverter 'Element nodeToElement(Node)' which checks a nodes docType and casts to Element if appropriate, or if a Document, typecasts to that and then extracts the top-level Element. With this fundamental change in ModuleInterface, around 20 files needed to be updated (Actions, Services, etc) that build on top of 'process()' to reflect this change, and use nodeToElement where necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java

    r15945 r16688  
    372372
    373373    Document doc = this.converter.getDOM(in);
    374     Element e = doc.getDocumentElement();
    375    
    376     Element res = process(e);
     374   
     375    Node res = process(doc);
    377376    return this.converter.getString(res);
    378377   
     
    382381     *
    383382     */
    384     public Element process(Element message) {
     383    public Node process(Node message_node) {
     384
     385    Element message = this.converter.nodeToElement(message_node);
    385386
    386387    NodeList requests = message.getElementsByTagName(GSXML.REQUEST_ELEM);
     
    428429        Element single_message = mess_doc.createElement(GSXML.MESSAGE_ELEM);
    429430        single_message.appendChild(request);
    430         Element response_message = ((ModuleInterface)this.service_map.get(service)).process(single_message);
     431        Node response_message = ((ModuleInterface)this.service_map.get(service)).process(single_message);
    431432        if (response_message != null) {
    432433            Element response = (Element) GSXML.getChildByTagName(response_message, GSXML.RESPONSE_ELEM);
Note: See TracChangeset for help on using the changeset viewer.