Changeset 3802

Show
Ignore:
Timestamp:
05.03.2003 14:05:46 (17 years ago)
Author:
mdewsnip
Message:

Modified to use the DocumentMetadataRetrieve? service.

Files:
1 modified

Legend:

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

    r3766 r3802  
    145145         
    146146         
     147    System.out.println("Query request: " + converter_.getString(mr_query_request)); 
    147148    Element mr_query_response = (Element)mr_.process(mr_query_message); 
    148     // System.out.println("Query response: " + converter_.getString(mr_query_response)); 
     149    System.out.println("Query response: " + converter_.getString(mr_query_response)); 
    149150 
    150151    Element query_result_metadata_list = (Element) GSXML.getNodeByPath(mr_query_response, "response/metadataList"); 
     
    157158        System.err.println("Warning: No query term information.\n"); 
    158159    } 
     160    System.out.println("Query term info:\n" + converter_.getString(query_term_info_list)); 
    159161 
    160162    // this result is the list of docs. 
     
    189191    mr_metadata_request.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_QUERY); 
    190192    mr_metadata_request.setAttribute(GSXML.LANG_ATT, page.getAttribute(GSXML.LANG_ATT)); 
    191     to = GSPath.appendLink(collection, "MetadataRetrieve"); 
     193    to = GSPath.appendLink(collection, "DocumentMetadataRetrieve"); // Hard-wired? 
    192194    mr_metadata_request.setAttribute(GSXML.TO_ATT, to); 
    193      
     195 
     196    // Create a parameter list to specify the required metadata information 
     197    Element dm_param_list = doc_.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER); 
     198    mr_metadata_request.appendChild(dm_param_list); 
     199    Element dm_param = doc_.createElement(GSXML.PARAM_ELEM); 
     200    dm_param_list.appendChild(dm_param); 
     201    dm_param.setAttribute(GSXML.NAME_ATT, "metadata"); 
     202    dm_param.setAttribute(GSXML.VALUE_ATT, "Title"); 
     203 
    194204    Element meta_content = doc_.createElement(GSXML.CONTENT_ELEM); 
    195205    mr_metadata_request.appendChild(meta_content); 
     
    198208    meta_content.appendChild(doc_.importNode(document_list, true)); 
    199209     
    200     // the second part of the content is the metadata list 
    201     Element metadata_list = doc_.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
    202     Element title = doc_.createElement(GSXML.METADATA_ELEM); 
    203     title.setAttribute(GSXML.NAME_ATT, "Title"); 
    204     metadata_list.appendChild(title); 
    205     meta_content.appendChild(metadata_list); 
    206      
    207     // System.out.println("Metadata message: " + converter_.getString(mr_metadata_message)); 
     210    // System.out.println("Metadata request: " + converter_.getString(mr_metadata_message)); 
    208211    Element mr_metadata_response = (Element)mr_.process(mr_metadata_message); 
    209212