Changeset 14640

Show
Ignore:
Timestamp:
10.10.2007 17:41:52 (12 years ago)
Author:
anna
Message:

Added the buildType of a collection to its description, to generate ct param.

Location:
greenstone3/trunk/src/java/org/greenstone/gsdl3/collection
Files:
2 modified

Legend:

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

    r14208 r14640  
    5757    /** time when this collection was built */ 
    5858    protected long lastmodified = 0; 
    59  
     59     
    6060    /** An element containing the serviceRackList element of buildConfig.xml, used to determine whether it contains 
    6161     *  the OAIPMH serviceRack  
     
    9898        return false; 
    9999    } 
     100     
     101    // get the collection type attribute 
     102    Element search = (Element) GSXML.getChildByTagName(coll_config_xml, GSXML.SEARCH_ELEM);  
     103    if(search!=null) { 
     104        col_type = search.getAttribute(GSXML.TYPE_ATT); 
     105    } 
     106     
    100107    // process the metadata and display items 
    101108    findAndLoadInfo(coll_config_xml, build_config_xml); 
     
    182189    protected boolean findAndLoadInfo(Element coll_config_xml,  
    183190                      Element build_config_xml){ 
    184        
     191               
    185192      // metadata 
    186193      Element meta_list = (Element)GSXML.getChildByTagName(coll_config_xml, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java

    r14223 r14640  
    6060    /** The name of the cluster - for a collection, this is the collection name*/ 
    6161    protected String cluster_name = null; 
     62    /** collection type : mg or mgpp */ 
     63    protected String col_type = ""; 
    6264 
    6365    /** a reference to the message router */ 
     
    109111    this.cluster_name = name;    
    110112    this.description.setAttribute(GSXML.NAME_ATT, name); 
    111     }   
     113    } 
    112114 
    113115    public void setMessageRouter(MessageRouter m) { 
     
    170172     
    171173    public boolean configure(Element service_cluster_info) { 
    172      
     174     
    173175    // get the metadata - for now just add it to the list 
    174176    Element meta_list = (Element) GSXML.getChildByTagName(service_cluster_info, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 
     
    468470        // create the collection element 
    469471        Element description = (Element)this.description.cloneNode(false); 
     472        // set collection type : mg or mgpp 
     473        description.setAttribute(GSXML.TYPE_ATT, col_type); 
     474 
    470475        response.appendChild(description); 
    471476        // check the param list 
    472477        Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER); 
    473         if (param_list == null) { 
    474         addAllDisplayInfo(description, lang); 
     478        if (param_list == null) {                
     479        addAllDisplayInfo(description, lang);                
    475480        description.appendChild(this.service_list); 
    476481        description.appendChild(this.metadata_list); 
     
    481486        // go through the param list and see what components are wanted 
    482487        NodeList params = param_list.getElementsByTagName(GSXML.PARAM_ELEM); 
    483         for (int i=0; i<params.getLength(); i++) { 
    484          
    485         Element param = (Element)params.item(i); 
     488        for (int i=0; i<params.getLength(); i++) {       
     489         
     490        Element param = (Element)params.item(i);                 
    486491        // Identify the structure information desired 
    487492        if (param.getAttribute(GSXML.NAME_ATT).equals(GSXML.SUBSET_PARAM)) {