Changeset 36190


Ignore:
Timestamp:
2022-05-16T14:45:49+12:00 (5 months ago)
Author:
kjdon
Message:

updated to use new SearchMeta instead of collectionmeta

File:
1 edited

Legend:

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

    r36173 r36190  
    121121     * @see org.greenstone.gatherer.collection.CollectionManager
    122122     */
    123     protected void addIndex(Index index, CollectionMeta metadatum) {
     123    protected void addIndex(Index index, SearchMeta metadatum) {
    124124    ///ystem.err.println("Adding an index: " + index.toString());
    125125    if(!contains(index)) {
    126         CollectionDesignManager.collectionmeta_manager.addMetadatum(metadatum);
     126        CollectionDesignManager.searchmeta_manager.addMetadatum(metadatum);
    127127        // Retrieve the currently last index
    128128        if(getSize() > 0) {
     
    235235    if(index != null) {
    236236        // Remove any current metadata from this index
    237         CollectionDesignManager.collectionmeta_manager.removeMetadata(StaticStrings.STOP_CHARACTER + index.getID());
     237        //CollectionDesignManager.searchmeta_manager.removeMetadata(StaticStrings.STOP_CHARACTER + index.getID());
     238        CollectionDesignManager.searchmeta_manager.removeMetadata(index.getID(), SearchMeta.TYPE_INDEX);
    238239        // Remove the index
    239240        remove(index);
     
    257258       different name, or may be a new index altogether */
    258259    protected void replaceIndex(Index old_index, Index new_index,
    259                   CollectionMeta coll_meta) {
     260                  SearchMeta coll_meta) {
    260261    if (old_index == null || new_index == null || coll_meta == null) {
    261262        return;
     
    266267    }
    267268    // Remove the old index coll meta
    268     CollectionDesignManager.collectionmeta_manager.removeMetadata(StaticStrings.STOP_CHARACTER + old_index.getID());
     269    CollectionDesignManager.searchmeta_manager.removeMetadata(/*StaticStrings.STOP_CHARACTER +*/ old_index.getID(), old_index.getType());
    269270    // Add the new coll meta
    270     CollectionDesignManager.collectionmeta_manager.addMetadatum(coll_meta);
     271    CollectionDesignManager.searchmeta_manager.addMetadatum(coll_meta);
    271272
    272273    // get the position of the old one
     
    719720        }
    720721       
    721         protected CollectionMeta generateCollectionMeta(Index index) {
    722         CollectionMeta metadatum = new CollectionMeta(StaticStrings.STOP_CHARACTER + index.getID());
     722        protected SearchMeta generateSearchMeta(Index index) {
     723        SearchMeta metadatum = new SearchMeta(/*StaticStrings.STOP_CHARACTER +*/ index.getID(), index.getType());
    723724        if (use_macro_as_display_name(index.getID())) {
    724725            metadatum.setValue(get_macro_name(index.getID()));
     
    727728        }
    728729                // is this right? Index vs index
    729                 metadatum.setType(index_element_name);
     730                //metadatum.setType(index_element_name);
    730731        return metadatum;
    731732        }
     
    739740            if (index != null) {
    740741           
    741             CollectionMeta metadatum = generateCollectionMeta(index);
     742            SearchMeta metadatum = generateSearchMeta(index);
    742743            // Add the index
    743744            addIndex(index, metadatum);
     
    768769            Index index = generateNewIndex();
    769770            if (index != null) {
    770             CollectionMeta metadatum = generateCollectionMeta(index);
     771            SearchMeta metadatum = generateSearchMeta(index);
    771772            // replace the index
    772773            replaceIndex((Index) index_list.getSelectedValue(), index, metadatum);
Note: See TracChangeset for help on using the changeset viewer.