Changeset 28969 for main

Show
Ignore:
Timestamp:
14.04.2014 14:25:09 (6 years ago)
Author:
kjdon
Message:

removing this.doc. Haven't tested as can't compile properly without Fedora/Google classes. But there are no errors regarding this.doc. Also, not sure if these have been updated properly after restructuring around AbstractSearch?. Will need testing properly if they are to be used again.

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraSearch.java.tmp

    r28966 r28969  
    6969    public FedoraSearch() 
    7070    { 
     71      QUERY_SERVICE = "TextQuery"; 
    7172    } 
    7273     
     
    8687        return false; 
    8788    } 
    88     Element tq_service = this.doc.createElement(GSXML.SERVICE_ELEM); 
     89    Element tq_service = this.desc_doc.createElement(GSXML.SERVICE_ELEM); 
    8990    tq_service.setAttribute(GSXML.TYPE_ATT, GSXML.SERVICE_TYPE_QUERY); 
    90     tq_service.setAttribute(GSXML.NAME_ATT, TEXT_QUERY_SERVICE); 
     91    tq_service.setAttribute(GSXML.NAME_ATT, QUERY_SERVICE); 
    9192    this.short_service_info.appendChild(tq_service); 
    9293    //does_paging = true; 
     
    9697    Element format = (Element) GSXML.getNodeByPath(extra_info, path); 
    9798    if (format != null) { 
    98         this.format_info_map.put(TEXT_QUERY_SERVICE, this.doc.importNode(format, true)); 
     99        this.format_info_map.put(QUERY_SERVICE, this.desc_doc.importNode(format, true)); 
    99100    } 
    100101    return true; 
     
    104105    protected Element processTextQuery(Element request) { 
    105106    // Create a new (empty) result message 
    106     Element result = this.doc.createElement(GSXML.RESPONSE_ELEM); 
    107     result.setAttribute(GSXML.FROM_ATT, TEXT_QUERY_SERVICE); 
     107    Document result_doc = XMLConverter.newDOM(); 
     108    Element result = result_doc.createElement(GSXML.RESPONSE_ELEM); 
     109    result.setAttribute(GSXML.FROM_ATT, QUERY_SERVICE); 
    108110    result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS); 
    109111     
    110     Element doc_node_list = this.doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER); 
     112    Element doc_node_list = result_doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER); 
    111113    result.appendChild(doc_node_list); 
    112114     
     
    178180            String[] language = o.getLanguage(); 
    179181 
    180             Element doc_node = this.doc.createElement(GSXML.DOC_NODE_ELEM); 
     182            Element doc_node = result_doc.createElement(GSXML.DOC_NODE_ELEM); 
    181183            doc_node_list.appendChild(doc_node); 
    182184             
    183             Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
     185            Element metadata_list = result_doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
    184186            doc_node.appendChild(metadata_list); 
    185187             
     
    206208    } 
    207209         
    208     Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
     210    Element metadata_list = result_doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
    209211    result.appendChild(metadata_list); 
    210212     
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GoogleSearch.java.tmp

    r28966 r28969  
    3636/** 
    3737 * 
    38  * @author <a href="mailto:chi@cs.waikato.ac.nz">Chi-Yu Huang</a> 
    3938 * 
    4039 */ 
     
    5756    public GoogleSearch() 
    5857    { 
     58      QUERY_SERVICE = "TextQuery"; 
    5959    } 
    6060         
     
    120120     
    121121    // Create a new (empty) result message 
    122     Element result = this.doc.createElement(GSXML.RESPONSE_ELEM); 
    123     result.setAttribute(GSXML.FROM_ATT, TEXT_QUERY_SERVICE); 
     122    Document result_doc = XMLConverter.newDOM(); 
     123    Element result = result_doc.createElement(GSXML.RESPONSE_ELEM); 
     124    result.setAttribute(GSXML.FROM_ATT, QUERY_SERVICE); 
    124125    result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS); 
    125     Element doc_node_list = this.doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER); 
     126    Element doc_node_list = result_doc.createElement(GSXML.DOC_NODE_ELEM+GSXML.LIST_MODIFIER); 
    126127    result.appendChild(doc_node_list); 
    127     Element query_metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
     128    Element query_metadata_list = result_doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
    128129    result.appendChild(query_metadata_list); 
    129130 
     
    200201        GoogleSearchResultElement[] details = google_result.getResultElements(); 
    201202        for (int i=0; i<details.length; i++){ 
    202         Element doc_node = this.doc.createElement(GSXML.DOC_NODE_ELEM); 
     203        Element doc_node = result_doc.createElement(GSXML.DOC_NODE_ELEM); 
    203204        doc_node_list.appendChild(doc_node); 
    204205         
    205         Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
     206        Element metadata_list = result_doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
    206207        doc_node.appendChild(metadata_list); 
    207208