Changeset 13956


Ignore:
Timestamp:
2007-03-01T15:15:50+13:00 (17 years ago)
Author:
shaoqun
Message:

changed code to make it work on the new collectionConfig.xml and buildConfig.xml

File:
1 edited

Legend:

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

    r13270 r13956  
    8484
    8585    logger.info("Configuring AbstractBrowse...");
    86     this.config_info = info;
    87 
    88     if (macro_resolver != null) {
     86    this.config_info = info;
     87        if (macro_resolver != null) {
    8988        macro_resolver.setSiteDetails(this.site_http_address, this.cluster_name);
    9089        // set up the macro resolver
     
    196195        Element cl = (Element)classifiers.item(i);
    197196        Element new_cl = (Element)this.doc.importNode(cl, false); // just import this node, not the children
    198         String content = cl.getAttribute(GSXML.CLASSIFIER_CONTENT_ATT);
    199         cl_list.appendChild(new_cl);
     197           
     198            //String content = cl.getAttribute(GSXML.CLASSIFIER_CONTENT_ATT);
     199       
     200        //get the classify title  from the database
     201             String class_id =  cl.getAttribute(GSXML.NAME_ATT);
     202         String content = getMetadata(class_id,"Title");
     203
     204                cl_list.appendChild(new_cl);
    200205        String text = GSXML.getDisplayText(cl,
    201206                           GSXML.DISPLAY_TEXT_NAME,
     
    211216        }
    212217       
     218       
    213219        Element cl_name = GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_NAME, text);
    214220        new_cl.appendChild(cl_name);
     
    257263        Element cl = (Element)classifiers.item(i);
    258264        String name = cl.getAttribute(GSXML.NAME_ATT);
    259         Element node_extra = GSXML.getNamedElement(config_browse,
    260                                GSXML.CLASSIFIER_ELEM,
    261                                GSXML.NAME_ATT,
    262                                name);
     265
     266        //Element node_extra = GSXML.getNamedElement(config_browse,
     267        //                         GSXML.CLASSIFIER_ELEM,
     268        //                         GSXML.NAME_ATT,
     269        //                         name);
     270            //now use the position to get the node - CL1
     271            int position = Integer.parseInt(name.substring(2));
     272        Element node_extra = null;
     273            NodeList cls = config_browse.getElementsByTagName(GSXML.CLASSIFIER_ELEM);
     274            if (position >0 && position <= cls.getLength()) {
     275            node_extra  = (Element) cls.item((position -1));
     276        }
     277
    263278        if (node_extra == null) {
    264279        logger.error("GS2REtrieve: haven't found extra info for classifier named "+name);
     
    698713                           boolean all_metadata,
    699714                           ArrayList metadata_names);
     715
     716    /** get the particular metadata (identified by the metadata name) for the classifier node node_id
     717     *
     718     */
     719    abstract protected String getMetadata(String node_id, String metadata_name);
     720
    700721
    701722    /** returns the structural information asked for.
Note: See TracChangeset for help on using the changeset viewer.