Changeset 12075


Ignore:
Timestamp:
2006-07-07T11:29:30+12:00 (18 years ago)
Author:
kjdon
Message:

Level no longer knows anything about CollectionMeta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/Level.java

    r9996 r12075  
    3333import org.w3c.dom.*;
    3434
    35 /** This class represents a single search type setting which means that, at the moment, it is either based on an Content element containing the string 'plain' or one on the string 'form'. The ordering of these elements within the Level element is important.
    36  * @author John Thompson, Greenstone Digital Library, University of Waikato
    37  * @version 2.4
     35/** This class represents a level (for mgpp and lucene collecitons) .
    3836 */
    3937public class Level
     
    5856     */
    5957    public Level(String level) {
    60     this.element = CollectionDesignManager.collect_config.document.createElement(CollectionConfiguration.CONTENT_ELEMENT);
     58    this.element = CollectionDesignManager.collect_config.document.createElement(CollectionConfiguration.LEVEL_ELEMENT);
    6159    this.element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, level);
    6260    }
     
    104102    return element.getAttribute(CollectionConfiguration.NAME_ATTRIBUTE);
    105103    }
    106 
    107     /** Retrieve the display name
    108      */
    109     public String getName() {
    110     CollectionMeta metadatum = CollectionDesignManager.collectionmeta_manager.getMetadatum(CollectionConfiguration.STOP_CHARACTER + getLevel(), false);
    111     if(metadatum != null) {
    112         return metadatum.getValue(CollectionMeta.TEXT);
    113     }
    114     return "";
    115     }
    116104   
    117105   /** Determine is this command has been assigned, either because it already existed in the collection configuration, or because it has been explicitly set by the user. Non-assigned entries imply they have been added by the GLI to ensure consistancy (and avoid NPE's!)
     
    155143     */
    156144    public String toString() {
    157     String text ="";
    158     if(element == null) {
    159         text = "#Error";
    160     }
    161     else {
    162         String level = getLevel();
    163         StringBuffer text_buffer = new StringBuffer(level);
    164         text_buffer.append(" \"");
    165         text_buffer.append(getName());
    166         text_buffer.append("\"");
    167    
    168         text = text_buffer.toString();
    169         text_buffer = null;
    170     }
    171    
    172     return text;
     145    return getLevel();
    173146    }
    174147}
Note: See TracChangeset for help on using the changeset viewer.