- Timestamp:
- 2022-05-16T14:45:49+12:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/cdm/BaseIndexManager.java
r36173 r36190 121 121 * @see org.greenstone.gatherer.collection.CollectionManager 122 122 */ 123 protected void addIndex(Index index, CollectionMeta metadatum) {123 protected void addIndex(Index index, SearchMeta metadatum) { 124 124 ///ystem.err.println("Adding an index: " + index.toString()); 125 125 if(!contains(index)) { 126 CollectionDesignManager. collectionmeta_manager.addMetadatum(metadatum);126 CollectionDesignManager.searchmeta_manager.addMetadatum(metadatum); 127 127 // Retrieve the currently last index 128 128 if(getSize() > 0) { … … 235 235 if(index != null) { 236 236 // 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); 238 239 // Remove the index 239 240 remove(index); … … 257 258 different name, or may be a new index altogether */ 258 259 protected void replaceIndex(Index old_index, Index new_index, 259 CollectionMeta coll_meta) {260 SearchMeta coll_meta) { 260 261 if (old_index == null || new_index == null || coll_meta == null) { 261 262 return; … … 266 267 } 267 268 // 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()); 269 270 // Add the new coll meta 270 CollectionDesignManager. collectionmeta_manager.addMetadatum(coll_meta);271 CollectionDesignManager.searchmeta_manager.addMetadatum(coll_meta); 271 272 272 273 // get the position of the old one … … 719 720 } 720 721 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()); 723 724 if (use_macro_as_display_name(index.getID())) { 724 725 metadatum.setValue(get_macro_name(index.getID())); … … 727 728 } 728 729 // is this right? Index vs index 729 metadatum.setType(index_element_name);730 //metadatum.setType(index_element_name); 730 731 return metadatum; 731 732 } … … 739 740 if (index != null) { 740 741 741 CollectionMeta metadatum = generateCollectionMeta(index);742 SearchMeta metadatum = generateSearchMeta(index); 742 743 // Add the index 743 744 addIndex(index, metadatum); … … 768 769 Index index = generateNewIndex(); 769 770 if (index != null) { 770 CollectionMeta metadatum = generateCollectionMeta(index);771 SearchMeta metadatum = generateSearchMeta(index); 771 772 // replace the index 772 773 replaceIndex((Index) index_list.getSelectedValue(), index, metadatum);
Note:
See TracChangeset
for help on using the changeset viewer.