Changeset 12088
- Timestamp:
- 2006-07-07T13:06:01+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/Format.java
r10421 r12088 41 41 42 42 /** The default features (not all of these are in the Greenstone Developer's Guide). */ 43 static final public String DEFAULT_FEATURES[] = { "", "AllowExtendedOptions", "Document", "DocumentArrowsBottom", "DocumentArrowsTop", "DocumentButtons", "DocumentContents", "DocumentHeading", "DocumentImages", "DocumentText", "DocumentTitles", "DocumentUseHTML", "RelatedDocuments", "Search" };43 static final public String DEFAULT_FEATURES[] = { "", "AllowExtendedOptions", "Document", "DocumentArrowsBottom", "DocumentArrowsTop", "DocumentButtons", "DocumentContents", "DocumentHeading", "DocumentImages", "DocumentText", "DocumentTitles", "DocumentUseHTML", "RelatedDocuments", "Search", "SearchTypes" }; 44 44 /** The list of known feature parts. */ 45 45 static final public String DEFAULT_PARTS[] = { "", "DateList", "HList", "VList" }; … … 76 76 /** We keep a copy of the part because its slightly more computationally tricky to calculate. */ 77 77 private String part = null; 78 /** We keep a copy of the feature name */ 79 private String feature_name = null; 78 80 /** Cached result of toString. */ 79 81 private String text = null; … … 166 168 } 167 169 else if(element != null) { 168 String name = element.getAttribute(CollectionConfiguration.NAME_ATTRIBUTE); 169 // Remove part 170 String part = getPart(); 171 String feature; 172 if(part != null) { 173 feature = name.substring(0, name.length() - part.length()); 174 } 175 else { 176 feature = name; 177 } 178 part = null; 179 name = null; 170 String feature = getFeatureName(); 180 171 // If the feature now refers to a classifier, retrieve it. 181 172 if(feature.toUpperCase().startsWith(Classifier.CLASSIFIER_PREFIX)) { … … 197 188 } 198 189 190 public String getFeatureName() { 191 if (feature_name == null) { 192 String name = element.getAttribute(CollectionConfiguration.NAME_ATTRIBUTE); 193 // Remove part 194 String part = getPart(); 195 if(part != null) { 196 feature_name = name.substring(0, name.length() - part.length()); 197 } 198 else { 199 feature_name = name; 200 } 201 part = null; 202 name = null; 203 } 204 return feature_name; 205 206 } 199 207 public String getName() { 200 208 if(element != null) { … … 273 281 if(feature instanceof Classifier) { 274 282 classifier = (Classifier) feature; 283 feature_name = classifier.getPositionString(); 275 284 element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, classifier.getPositionString() + part); 276 285 } 277 286 else { 287 feature_name = feature.toString(); 278 288 element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, feature.toString() + part); 279 289 } … … 344 354 if(classifier != null) { 345 355 element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, classifier.getPositionString() + getPart()); 356 feature_name = classifier.getPositionString(); 346 357 text = null; 347 358 }
Note:
See TracChangeset
for help on using the changeset viewer.