Changeset 36162


Ignore:
Timestamp:
2022-05-09T14:43:14+12:00 (5 months ago)
Author:
kjdon
Message:

added code for sortfields and facets. its going wrong though, so needs work

File:
1 edited

Legend:

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

    r20443 r36162  
    4646    public static final String TYPE_PARTITION = "partition";
    4747    public static final String TYPE_LANGUAGE = "language";
    48 
     48  public static final String TYPE_SORTFIELD = "sortfield";
     49  public static final String TYPE_FACET = "facet";
     50 
    4951  // the following are special and should not be translated
    5052  public static final String METADATA_INDEX = "ex.metadata";
     
    148150        }
    149151    }
    150    
     152    ArrayList sortfields = CollectionDesignManager.index_manager.getSortFields();
     153    if (sortfields != null) {
     154        int sortfields_size = sortfields.size();
     155        for (int i=0; i<sortfields_size; i++) {
     156              String sf_id = ((Index)sortfields.get(i)).getID();
     157              SearchMetadataEntry sme = new SearchMetadataEntry(sf_id, TYPE_SORTFIELD);
     158        entries.add(sme);
     159        }
     160    }
     161    ArrayList facets = CollectionDesignManager.index_manager.getFacets();
     162    if (facets != null) {
     163        int facets_size = facets.size();
     164        for (int i=0; i<facets_size; i++) {
     165              String facet_id = ((Index)sortfields.get(i)).getID();
     166              SearchMetadataEntry sme = new SearchMetadataEntry(facet_id, TYPE_FACET);
     167        entries.add(sme);
     168        }
     169    }
     170
     171       
    151172    ArrayList partitions = CollectionDesignManager.subcollectionindex_manager.getSubcollectionIndexes();
    152173    if (partitions != null) {
Note: See TracChangeset for help on using the changeset viewer.