Changeset 12075
- Timestamp:
- 2006-07-07T11:29:30+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/Level.java
r9996 r12075 33 33 import org.w3c.dom.*; 34 34 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) . 38 36 */ 39 37 public class Level … … 58 56 */ 59 57 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); 61 59 this.element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, level); 62 60 } … … 104 102 return element.getAttribute(CollectionConfiguration.NAME_ATTRIBUTE); 105 103 } 106 107 /** Retrieve the display name108 */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 }116 104 117 105 /** 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!) … … 155 143 */ 156 144 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(); 173 146 } 174 147 }
Note:
See TracChangeset
for help on using the changeset viewer.