Changeset 33308


Ignore:
Timestamp:
2019-07-08T15:21:43+12:00 (5 years ago)
Author:
kjdon
Message:

now you can set hidden='true' to an index element in collectionConfig.xml. The index will be built, but it won't be sent back as an option for the index param in a search page. use for eg map data indexes that you don't need to display to the user

File:
1 edited

Legend:

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

    r30668 r33308  
    196196                    continue;
    197197                }
    198 
    199                 // get the display elements if any - displayName
    200                 NodeList display_names = node_extra.getElementsByTagName(GSXML.DISPLAY_TEXT_ELEM);
    201                 if (display_names != null)
    202                 {
    203                     for (int j = 0; j < display_names.getLength(); j++)
    204                     {
    205                         Element e = (Element) display_names.item(j);
    206                         ind.appendChild(owner.importNode(e, true));
    207                     }
     198                if (node_extra.getAttribute("hidden").equals("true")) {
     199                  ind.setAttribute("hidden", "true");
     200                } else {
     201                  // get the display elements if any - displayName
     202                  NodeList display_names = node_extra.getElementsByTagName(GSXML.DISPLAY_TEXT_ELEM);
     203                  if (display_names != null)
     204                    {
     205                      for (int j = 0; j < display_names.getLength(); j++)
     206                    {
     207                      Element e = (Element) display_names.item(j);
     208                      ind.appendChild(owner.importNode(e, true));
     209                    }
     210                    }
    208211                }
    209212            } // for each index
     
    251254            {
    252255                continue;
     256            }
     257            if (index.getAttribute("hidden").equals("true")) {
     258              // don't add in hidden ones
     259              continue;
    253260            }
    254261            index_ids.add(shortname);
Note: See TracChangeset for help on using the changeset viewer.