search/engine/api/src/main/java/net/sf/mmm/search/view/base/AbstractSearchServlet.java
/**
   * This method updates the {@link #getEntryTypeViews() entry type views}. <br>
   * The {@link SearchEngineConfiguration} defines the {@link SearchEntryType}s. For this view these
   * {@link SearchEntryType}s are reduced to those types that actually exist in the search-index. Then they
   * are {@link SearchEntryTypeViewBean#combine(SearchEntryType, long) combined} and finally sorted according
   * to the {@link SearchEntryType#getTitle() title}. <br>
   * This way the view can present the proper titles of the types and the search can filter even on combined
   * types.
   */
This method updates the  #getEntryTypeViews() entry type views.
This method updates the #getEntryTypeViews () entry type views .
private void updateEntryTypeViews() {
    SearchEntryTypeContainer typeContainer = this.configurationHolder.getBean().getEntryTypes();
    Map<String, SearchEntryTypeViewBean> title2viewMap = new HashMap<String, SearchEntryTypeViewBean>();
    SearchEntryType anyType = null;
    for (SearchEntryType type : typeContainer) {
      String id = type.getId();
      if (SearchEntryType.ID_ANY.equals(id)) {
        anyType = type;
      } else {
        long count = this.searchEngine.count(SearchEntry.FIELD_TYPE, id);
        if (count > 0) {
          String title = type.getTitle();
          SearchEntryTypeViewBean view = title2viewMap.get(title);
          if (view == null) {
            view = new SearchEntryTypeViewBean();
            title2viewMap.put(title, view);
          }
          view.combine(type, count);
        }
      }
    }
    List<String> titles = new ArrayList<String>(title2viewMap.keySet());
    Collections.sort(titles);
    SearchEntryTypeViewBean anyView = new SearchEntryTypeViewBean();
    if (anyType == null) {
      anyType = SearchEntryTypeDefaults.getEntryTypeAny();
    }
    anyView.combine(anyType, this.searchEngine.getTotalEntryCount());
    List<SearchEntryTypeViewBean> viewList = new ArrayList<SearchEntryTypeViewBean>();
    viewList.add(anyView);
    for (String title : titles) {
      viewList.add(title2viewMap.get(title));
    }
    this.id2viewMap = new HashMap<String, SearchEntryTypeViewBean>(viewList.size());
    for (SearchEntryTypeViewBean view : viewList) {
      this.id2viewMap.put(view.getId(), view);
    }
    this.entryTypeViews = viewList;
  }
private void updateEntryTypeViews ( ) { SearchEntryTypeContainer typeContainer = this . configurationHolder . getBean ( ) . getEntryTypes ( ) ; Map < String , SearchEntryTypeViewBean > title2viewMap = new HashMap < String , SearchEntryTypeViewBean > ( ) ; SearchEntryType anyType = null ; for ( SearchEntryType type : typeContainer ) { String id = type . getId ( ) ; if ( SearchEntryType . ID_ANY . equals ( id ) ) { anyType = type ; } else { long count = this . searchEngine . count ( SearchEntry . FIELD_TYPE , id ) ; if ( count > 0 ) { String title = type . getTitle ( ) ; SearchEntryTypeViewBean view = title2viewMap . get ( title ) ; if ( view == null ) { view = new SearchEntryTypeViewBean ( ) ; title2viewMap . put ( title , view ) ; } view . combine ( type , count ) ; } } } List < String > titles = new ArrayList < String > ( title2viewMap . keySet ( ) ) ; Collections . sort ( titles ) ; SearchEntryTypeViewBean anyView = new SearchEntryTypeViewBean ( ) ; if ( anyType == null ) { anyType = SearchEntryTypeDefaults . getEntryTypeAny ( ) ; } anyView . combine ( anyType , this . searchEngine . getTotalEntryCount ( ) ) ; List < SearchEntryTypeViewBean > viewList = new ArrayList < SearchEntryTypeViewBean > ( ) ; viewList . add ( anyView ) ; for ( String title : titles ) { viewList . add ( title2viewMap . get ( title ) ) ; } this . id2viewMap = new HashMap < String , SearchEntryTypeViewBean > ( viewList . size ( ) ) ; for ( SearchEntryTypeViewBean view : viewList ) { this . id2viewMap . put ( view . getId ( ) , view ) ; } this . entryTypeViews = viewList ; }
This method updates the {@link #getEntryTypeViews() entry type views}.
This method updates the { @link #getEntryTypeViews () entry type views } .
// check if type exists in index... // do we need locale and collator here?