Changeset 5692 for trunk/gsdl3


Ignore:
Timestamp:
2003-10-21T11:09:58+13:00 (21 years ago)
Author:
kjdon
Message:

doc format stuff now comes with content service, added another structure option for entire structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Retrieve.java

    r5408 r5692  
    6666    protected static final String STRUCT_CHILDREN = "children";
    6767    protected static final String STRUCT_DESCENDS = "descendants";
     68    protected static final String STRUCT_ENTIRE = "entire";
    6869
    6970    protected static final String INFO_NUM_SIBS = "numSiblings";
     
    125126    // the classifiers
    126127    extractExtraClassifierInfo(info, extra_info);
     128   
    127129    this.config_info = info;
    128130   
     
    173175    Element display_format = (Element)GSXML.getNodeByPath(extra_info, path);
    174176    if (display_format != null) {
    175         this.format_info_map.put(DOCUMENT_METADATA_RETRIEVE_SERVICE, this.doc.importNode(display_format, true));
     177        this.format_info_map.put(DOCUMENT_CONTENT_RETRIEVE_SERVICE, this.doc.importNode(display_format, true));
    176178        // shoudl we make a copy?
    177179    }
     
    502504    boolean want_descendants = false;
    503505
     506    boolean want_entire_structure = false;
    504507    // Process the request parameters
    505508    NodeList params = param_list.getElementsByTagName(GSXML.PARAM_ELEM);
     
    524527        else if (p_value.equals(STRUCT_DESCENDS))
    525528            want_descendants = true;
     529        else if (p_value.equals(STRUCT_ENTIRE))
     530            want_entire_structure = true;
    526531        else
    527532            System.err.println("GS2Retrieve Warning: Unknown value \"" + p_value + "\".");
     
    558563        doc.setAttribute(GSXML.NODE_ID_ATT, doc_id);
    559564
    560 
     565       
    561566        if (want_info) {
    562567
     
    576581        Element structure_elem = this.doc.createElement(GSXML.NODE_STRUCTURE_ELEM);
    577582        doc.appendChild(structure_elem);
     583       
     584        if (want_entire_structure) {
     585            String top_id = OID.getTop(doc_id);
     586            Element top_node = createDocNode(top_id, true, false);
     587            addDescendants(top_node, top_id, true);
     588            structure_elem.appendChild(top_node);
     589            continue; // with the next document, we dont need to do any more here
     590        }
    578591       
    579592        // Add the requested structure information
Note: See TracChangeset for help on using the changeset viewer.