Ignore:
Timestamp:
2011-08-12T09:57:26+12:00 (13 years ago)
Author:
sjm84
Message:

Adding in the server-side code for the Document Maker as well as several other enhancements

File:
1 edited

Legend:

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

    r24254 r24393  
    574574     * <docNode nodeId='xxx' nodeType='leaf' docType='hierarchy'/>
    575575     */
    576     protected Element createDocNode(String node_id, int offset) {
     576    protected Element createDocNode(String node_id) {
    577577    Element node = this.doc.createElement(GSXML.DOC_NODE_ELEM);
    578578    node.setAttribute(GSXML.NODE_ID_ATT, node_id);
     
    587587    String node_type = getNodeType(node_id, doc_type); 
    588588    node.setAttribute(GSXML.NODE_TYPE_ATT, node_type);
    589    
    590     // mdoffset information stored in DB determines which of multiple values for
    591     // a metadata needs to be displayed when a classifier is built on that metadata
    592     node.setAttribute(GSXML.NODE_MDOFFSET_ATT, Integer.toString(offset));
    593589    return node;
    594590    }
     
    625621    ArrayList child_ids = getChildrenIds(node_id);
    626622    if (child_ids==null) return;
    627    
    628     // get a list of all mdoffsets at this point
    629     ArrayList child_offsets = getOffsetsForChildrenIds(node_id);
    630     // make sure that if it's doesn't match up with child_ids in length,
    631     // it is padded with 0s to make up the length
    632     if(child_offsets == null) {
    633         child_offsets = new ArrayList(child_ids.size());
    634     }
    635     if(child_offsets.size() < child_ids.size()) {
    636         Integer zero = new Integer(0);
    637         for(int i = child_offsets.size()-1; i < child_ids.size(); i++) {
    638         child_offsets.add(zero);
    639         }
    640     }
    641 
    642623    for (int i=0; i< child_ids.size(); i++) {
    643624        String child_id = (String)child_ids.get(i);
    644         int child_offset = ((Integer)child_offsets.get(i)).intValue(); // counts both docnodes and classnodes at the childlevel, is this right?
    645625        Element child_elem;
    646626        if (isDocumentId(child_id)) {
    647         child_elem = createDocNode(child_id, child_offset);
     627        child_elem = createDocNode(child_id);
    648628        } else {
    649629        child_elem = createClassifierNode(child_id);
     
    704684    }
    705685
    706     /** Override to get a list of mdoffsets of children. Return null if no children or if no mdoffsets for them */
    707     protected ArrayList getOffsetsForChildrenIds(String node_id) {
    708     return null;
    709     }
    710 
    711686    /** if id ends in .fc, .pc etc, then translate it to the correct id */
    712687    abstract protected String translateId(String node_id);
Note: See TracChangeset for help on using the changeset viewer.