Ignore:
Timestamp:
2003-07-02T16:36:06+12:00 (21 years ago)
Author:
kjdon
Message:

now looks for metadata names from format statements

File:
1 edited

Legend:

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

    r4696 r4857  
    1111
    1212import java.util.HashMap;
     13import java.util.HashSet;
    1314import java.util.Vector;
    1415import java.util.Map;
     
    8586    }
    8687   
     88    HashSet metadata_names = new HashSet();
     89    // add in the default elements
     90    metadata_names.add("Title");
    8791    // add in the format info to the stylesheet if there is any
    8892    Element format_elem = (Element)GSXML.getChildByTagName(format_response, GSXML.FORMAT_ELEM);
    8993    if (format_elem != null) {
    90         System.out.println("QueryAction: found a format element, adding it to the page response");
     94        ///ystem.out.println("QueryAction: found a format element, adding it to the page response");
    9195        // set teh format type
    9296        format_elem.setAttribute(GSXML.TYPE_ATT, "search");
    9397        // for now just add to the response
    9498        page_response.appendChild(doc_.importNode(format_elem, true));
     99        extractMetadataNames(format_elem, metadata_names);
    95100    }
    96 
     101   
    97102
    98103    // do the query
     
    146151    // just get all for now - the receptionist should perhaps pass in some
    147152    // metadata that it wants, and QueryAction should look through the format stuff to see if there is any other?
    148     Element dm_param_list  = doc_.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
    149     Element param = doc_.createElement(GSXML.PARAM_ELEM);
    150     dm_param_list.appendChild(param);
    151     param.setAttribute(GSXML.NAME_ATT, "metadata");
    152     param.setAttribute(GSXML.VALUE_ATT, "all");
     153   
     154    Element dm_param_list  = createMetadataParamList(metadata_names);
     155   
    153156    mr_metadata_request.appendChild(dm_param_list);
    154157   
Note: See TracChangeset for help on using the changeset viewer.