Changeset 32083 for main/trunk


Ignore:
Timestamp:
11/27/17 12:44:16 (3 years ago)
Author:
kjdon
Message:

getFacets now includes a lang arg, so we can get teh correct displayName for the facet. when we get a facet back, look for the display name in it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java

    r30633 r32083  
    772772        if(does_faceting)
    773773        {
    774             ArrayList<FacetWrapper> facets = getFacets(query_result);
     774          String lang = request.getAttribute(GSXML.LANG_ATT);
     775          ArrayList<FacetWrapper> facets = getFacets(query_result, lang);
    775776            if(facets != null)
    776777            {
     
    782783                    Element facet_elem = result_doc.createElement(GSXML.FACET_ELEM);
    783784                    facet_elem.setAttribute(GSXML.NAME_ATT, currentFacet.getName());
     785                    String display_name = currentFacet.getDisplayName();
     786                    if (display_name != null && !display_name.equals("")) {
     787                      facet_elem.appendChild(GSXML.createDisplayTextElement(result_doc, GSXML.DISPLAY_TEXT_NAME, display_name));
     788                    }
    784789                    facet_list.appendChild(facet_elem);
    785790                   
     
    824829   
    825830    /** get the list of facets */
    826     abstract protected ArrayList<FacetWrapper> getFacets(Object query_result);
     831  abstract protected ArrayList<FacetWrapper> getFacets(Object query_result, String lang);
    827832   
    828833    /** get the map of highlighting snippets */
Note: See TracChangeset for help on using the changeset viewer.