Changeset 3817


Ignore:
Timestamp:
2003-03-10T10:46:04+13:00 (21 years ago)
Author:
mdewsnip
Message:

Modified to use documentNodes instead of documents.

File:
1 edited

Legend:

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

    r3801 r3817  
    5050    String to;
    5151    String document_name = (String) params.get(GSCGI.DOCUMENT_ARG);
    52     System.out.println("Document name: " + document_name);
    5352    if (document_name == null || document_name.equals("")) {
    5453        System.err.println("DocumentAction Error: no document specified!");
     
    8887
    8988    // Process the document structure retrieve message
    90     System.out.println("(DocumentAction) Structure request:\n" + converter_.getString(ds_message));
     89    // System.out.println("(DocumentAction) Structure request:\n" + converter_.getString(ds_message));
    9190    Element ds_response = (Element) mr_.process(ds_message);
    92     System.out.println("(DocumentAction) Structure response:\n" + converter_.getString(ds_response));
     91    // System.out.println("(DocumentAction) Structure response:\n" + converter_.getString(ds_response));
    9392
    9493    Element ds_response_content = (Element) GSXML.getNodeByPath(ds_response, "response/content");
     
    127126    NodeList doc_nodes = ds_response_document.getElementsByTagName(GSXML.DOC_NODE_ELEM);
    128127    for (int i = 0; i < doc_nodes.getLength(); i++) {
    129         Node doc_node = doc_nodes.item(i);
    130         Node doc_node_id = doc_node.getAttributes().getNamedItem(GSXML.DOC_NODE_ID_ATT);
    131         String dm_doc_id = doc_node_id.getNodeValue();
    132         dm_doc_list.appendChild(GSXML.createDocumentElement(doc_, dm_doc_id));
    133     }
    134 
    135     System.out.println("(DocumentAction) Metadata request:\n" + converter_.getString(dm_request));
     128        Element doc_node = (Element) doc_nodes.item(i);
     129        String doc_node_id = doc_node.getAttribute(GSXML.DOC_NODE_ID_ATT);
     130
     131        // Add the documentNode to the list
     132        Element dm_doc_node = doc_.createElement(GSXML.DOC_NODE_ELEM);
     133        dm_doc_list.appendChild(dm_doc_node);
     134        dm_doc_node.setAttribute(GSXML.DOC_NODE_ID_ATT, doc_node_id);
     135        dm_doc_node.setAttribute(GSXML.DOC_NODE_TYPE_ATT,
     136                     doc_node.getAttribute(GSXML.DOC_NODE_TYPE_ATT));
     137    }
     138
     139    // System.out.println("(DocumentAction) Metadata request:\n" + converter_.getString(dm_request));
    136140    Element dm_response = (Element) mr_.process(dm_message);
    137     System.out.println("(DocumentAction) Metadata response:\n" + converter_.getString(dm_response));
     141    // System.out.println("(DocumentAction) Metadata response:\n" + converter_.getString(dm_response));
    138142
    139143    Element dm_response_content = (Element) GSXML.getNodeByPath(dm_response, "response/content");
     
    169173    dc_doc.setAttribute(GSXML.NAME_ATT, document_name);
    170174
    171     System.out.println("(DocumentAction) Content request:\n" + converter_.getString(dc_request));
     175    // System.out.println("(DocumentAction) Content request:\n" + converter_.getString(dc_request));
    172176    Element dc_response = (Element) mr_.process(dc_message);
    173     System.out.println("(DocumentAction) Content response:\n" + converter_.getString(dc_response));
     177    // System.out.println("(DocumentAction) Content response:\n" + converter_.getString(dc_response));
    174178
    175179    Element dc_response_doc_content = (Element) GSXML.getNodeByPath(dc_response, "response/content/documentList/document/content");
     
    201205    response.appendChild(doc_.importNode(ds_response_content, true));
    202206
    203     System.out.println("Finished page: " + converter_.getString(page));
     207    // System.out.println("Finished page: " + converter_.getString(page));
    204208
    205209
Note: See TracChangeset for help on using the changeset viewer.