Changeset 28855

Show
Ignore:
Timestamp:
27.02.2014 13:50:54 (6 years ago)
Author:
kjdon
Message:

changed to use new DOM for response xml rather than the request DOM. And fixed up a place where appending node in wrong document.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java

    r28382 r28855  
    2727    { 
    2828        Element message = this.converter.nodeToElement(message_node); 
    29         Document doc = message.getOwnerDocument(); 
     29        Document doc = this.converter.newDOM(); 
    3030         
    3131        Element request = (Element) GSXML.getChildByTagName(message, GSXML.REQUEST_ELEM); 
     
    5151        if (page_name.equals(HOME_PAGE)) 
    5252        { 
    53             response = homePage(request); 
     53          response = homePage(request); 
    5454            //} else if (page_name.equals(ABOUT_PAGE)) { 
    5555        } 
    5656        else if (page_name.equals(ABOUT_PAGE) || page_name.equals(PREFS_PAGE)) 
    5757        { 
    58             response = aboutPage(request); 
     58          response = aboutPage(request); 
    5959            //}else if (page_name.equals(PREFS_PAGE)) { 
    6060            //response = prefsPage(request); 
     
    6262        else if (page_name.equals(GLI4GS3_PAGE)) 
    6363        { 
    64             response = gli4gs3Page(request); 
     64          response = gli4gs3Page(request); 
    6565        } 
    6666        else 
    6767        { // unknown page 
    68             response = unknownPage(request); 
     68          response = unknownPage(request); 
    6969        } 
    7070 
     
    7878        if (globalFormat != null) 
    7979        { 
    80             response.appendChild(globalFormat); 
     80          response.appendChild(response.getOwnerDocument().importNode(globalFormat, true)); 
    8181        } 
    8282 
     
    8787    } 
    8888 
    89     protected Element homePage(Element request) 
    90     { 
    91         Document doc = request.getOwnerDocument(); 
     89  protected Element homePage(Element request) 
     90    { 
     91      Document doc = this.converter.newDOM(); 
    9292         
    9393        UserContext userContext = new UserContext(request); 
     
    154154    protected Element aboutPage(Element request) 
    155155    { 
    156         Document doc = request.getOwnerDocument(); 
     156      Document doc = this.converter.newDOM(); 
    157157         
    158158        UserContext userContext = new UserContext(request); 
     
    238238    protected Element unknownPage(Element request) 
    239239    { 
    240         Document doc = request.getOwnerDocument(); 
     240      Document doc = this.converter.newDOM(); 
    241241         
    242242        UserContext userContext = new UserContext(request); 
     
    326326    protected Element gli4gs3Page(Element request) 
    327327    { 
    328         Document doc = request.getOwnerDocument(); 
     328      Document doc = this.converter.newDOM(); 
    329329         
    330330        String lang = request.getAttribute(GSXML.LANG_ATT);