Changeset 10964 for trunk/gli


Ignore:
Timestamp:
2005-11-30T15:51:10+13:00 (18 years ago)
Author:
kjdon
Message:

default index doesn't need a level now, fixed a couple of bugs. index list now displays metadata display name not identifier

File:
1 edited

Legend:

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

    r10345 r10964  
    183183        }
    184184        sources = null;
    185         id = id_buffer.substring(0, id_buffer.length() - 1);
     185        if (id_buffer.length()==0) {
     186        id = "";
     187        } else {
     188        id = id_buffer.substring(0, id_buffer.length() - 1);
     189        }
    186190    }
    187191    return id;
     
    208212        Element content_element = (Element) content_elements.item(i);
    209213        String metadata_element_name_full = (String) content_element.getAttribute(CollectionConfiguration.NAME_ATTRIBUTE);
    210         MetadataElement metadata_element = MetadataTools.getMetadataElementWithDisplayName(metadata_element_name_full);
     214        //MetadataElement metadata_element = MetadataTools.getMetadataElementWithDisplayName(metadata_element_name_full);
     215        MetadataElement metadata_element = MetadataTools.getMetadataElementWithName(metadata_element_name_full);
    211216        if (metadata_element != null) {
    212217            sources.add(metadata_element);
     
    244249    // System.err.println("SetLevel(" + new_level + ")");
    245250    if(element != null && element.getNodeName().equals(CollectionConfiguration.INDEX_DEFAULT_ELEMENT)) {
    246         element.setAttribute(CollectionConfiguration.LEVEL_ATTRIBUTE, LEVEL[new_level]);
     251        if (0 <= new_level && new_level < 3) {
     252        element.setAttribute(CollectionConfiguration.LEVEL_ATTRIBUTE, LEVEL[new_level]);
     253        } else {
     254        element.setAttribute(CollectionConfiguration.LEVEL_ATTRIBUTE, "");
     255        }
    247256        this.id = null; // Regenerate ID.
    248257        this.level = new_level;
Note: See TracChangeset for help on using the changeset viewer.