Ignore:
Timestamp:
2016-06-02T14:11:02+12:00 (8 years ago)
Author:
kjdon
Message:

added ability for teh collectionConfig.xml file to carry additional stuff. Can have extraInfo element at the top level (inside collectionConfig). For now this is used to add extra items to the navigation bar (<navigationTab type=external-link

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java

    r28966 r30553  
    9393
    9494    protected Element display_item_list = null;
     95  /** extra stuff */
     96  protected Element extra_info = null;
    9597  /** default values for servlet params */
    9698  protected Element library_param_list = null;
     
    146148        this.library_param_list = this.desc_doc.createElement(GSXML.LIBRARY_PARAM_ELEM+GSXML.LIST_MODIFIER);
    147149        this.service_list = this.desc_doc.createElement(GSXML.SERVICE_ELEM + GSXML.LIST_MODIFIER);
     150        this.extra_info = this.desc_doc.createElement(GSXML.EXTRA_INFO_ELEM);
    148151        //this.plugin_item_list = this.desc_doc.createElement(GSXML.PLUGIN_ELEM + GSXML.LIST_MODIFIER);
    149152    }
     
    273276          }
    274277        }
    275 
    276   }
     278       
     279        // get any extra info
     280        Element info = (Element) GSXML.getChildByTagName(service_cluster_info, GSXML.EXTRA_INFO_ELEM);
     281        if (info != null) {
     282          if (!addExtraInfo(info)) {
     283            logger.error("couldn't add extra info");
     284          }
     285        }
     286
     287    }
    277288    /**
    278289     * adds metadata from a metadataList into the metadata_list xml
     
    336347        return true;
    337348    }
     349
     350  protected boolean addExtraInfo(Element info) {
     351    if (info == null) {
     352      return false;
     353    }
     354    NodeList children = info.getChildNodes();
     355    for(int i=0; i<children.getLength(); i++) {
     356      this.extra_info.appendChild(this.desc_doc.importNode(children.item(i), true));
     357    }
     358    return true;
     359  }
    338360
    339361    // protected boolean addPlugins(Element plugin_list)
     
    652674                description.appendChild(result_doc.importNode(this.metadata_list, true));
    653675                description.appendChild(result_doc.importNode(this.library_param_list, true));
     676                description.appendChild(result_doc.importNode(this.extra_info, true));
    654677                //description.appendChild(this.plugin_item_list);
    655678                return response;
     
    682705                      description.appendChild(result_doc.importNode(this.library_param_list, true));
    683706                    }
     707                    else if (info.equals(GSXML.EXTRA_INFO_ELEM)) {
     708                      description.appendChild(result_doc.importNode(this.extra_info, true));
     709                    }
    684710                }
    685711            }
     
    769795         * }
    770796         */
     797
    771798        if (type.equals(GSXML.REQUEST_TYPE_SYSTEM))
    772799        {
     
    780807        return response;
    781808    }
    782 
    783809    protected Element processSystemRequest(Element request)
    784810    {
Note: See TracChangeset for help on using the changeset viewer.