Changeset 36302


Ignore:
Timestamp:
2022-07-22T11:00:21+12:00 (3 weeks ago)
Author:
kjdon
Message:

language indexes should use searchmeta not collectionmeta

File:
1 edited

Legend:

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

    r18412 r36302  
    108108    if(!contains(language)) {
    109109        // need to add a pseudo metadata
    110         CollectionMeta metadatum = new CollectionMeta(StaticStrings.STOP_CHARACTER + language.getCode());
     110        SearchMeta metadatum = new SearchMeta(language.getCode(), SearchMeta.TYPE_LANGUAGE);
    111111        metadatum.setValue(language.getName());
    112         CollectionDesignManager.collectionmeta_manager.addMetadatum(metadatum);
     112        CollectionDesignManager.searchmeta_manager.addMetadatum(metadatum);
    113113        add(getSize(), language);
    114114    }
     
    214214    remove(language);
    215215    // Remove any collection metadata for this language
    216     CollectionDesignManager.collectionmeta_manager.removeMetadata(StaticStrings.STOP_CHARACTER + language.getCode());
     216    CollectionDesignManager.searchmeta_manager.removeMetadata(language.getCode(), SearchMeta.TYPE_LANGUAGE);
    217217    if(default_language != null && default_language.equals(language)) {
    218218        setDefault(null);
     
    221221
    222222    private void replaceLanguage(Language old_language, Language new_language) {
    223     // Remove old lang collection meta
    224     CollectionDesignManager.collectionmeta_manager.removeMetadata(StaticStrings.STOP_CHARACTER + old_language.getCode());
     223    // Remove old lang search meta
     224    CollectionDesignManager.searchmeta_manager.removeMetadata(old_language.getCode(), SearchMeta.TYPE_LANGUAGE);
    225225    // Add new one
    226     CollectionMeta metadatum = new CollectionMeta(StaticStrings.STOP_CHARACTER + new_language.getCode());
     226    SearchMeta metadatum = new SearchMeta(new_language.getCode(), SearchMeta.TYPE_LANGUAGE);
    227227    metadatum.setValue(new_language.getName());
    228     CollectionDesignManager.collectionmeta_manager.addMetadatum(metadatum);
     228    CollectionDesignManager.searchmeta_manager.addMetadatum(metadatum);
    229229    if(default_language != null && default_language.equals(old_language)) {
    230230        setDefault(new_language);
Note: See TracChangeset for help on using the changeset viewer.