Ignore:
Timestamp:
2016-07-28T12:58:54+12:00 (8 years ago)
Author:
kjdon
Message:

modifying the way levels, indexes, classifier buttons are displayed. displayItem with specific lang takes priority, then displayItem with a key for dictionary lookup, then if no displayItems lookup the level/index name in hte dictionary

File:
1 edited

Legend:

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

    r29989 r30634  
    234234                Element cl = (Element) classifiers.item(i);
    235235                Element new_cl = (Element) doc.importNode(cl, false); // just import this node, not the children
    236 
    237                 //String content = cl.getAttribute(GSXML.CLASSIFIER_CONTENT_ATT);
    238 
     236                cl_list.appendChild(new_cl);
     237
     238                // have we got a displayItem for the classifier title?
     239                String text = getDisplayText(cl, GSXML.DISPLAY_TEXT_NAME, lang, "en", "metadata_names");
    239240                //get the classify title  from the database
    240241                String class_id = cl.getAttribute(GSXML.NAME_ATT);
    241242                String content = getMetadata(class_id, "Title");
    242 
    243                 cl_list.appendChild(new_cl);
    244                 String text = GSXML.getDisplayText(cl, GSXML.DISPLAY_TEXT_NAME, lang, "en");
    245                 if (text == null || text.equals(""))
    246                 {
    247                     // no display element was specified, use the metadata name
    248                     // for now this looks in the class properties file
    249                     // this needs to use a general metadata thing instead
    250                     text = getMetadataNameText(content + ".buttonname", lang);
    251                 }
    252                 if (text == null)
    253                 {
    254                     text = content;
    255                 }
    256 
     243                if (text == null || text.equals("")) {
     244               
     245                  // no display element was specified, use the metadata name
     246                  if (!content.equals("")) {
     247                   
     248                    text = getTextString(content + ".buttonname", lang, "metadata_names");
     249                    if (text == null) {
     250                     
     251                      text = content;
     252                    }
     253                  }
     254                 
     255                  if (text == null) {
     256                    text=class_id;
     257                  }
     258                }
    257259                Element cl_name = GSXML.createDisplayTextElement(doc, GSXML.DISPLAY_TEXT_NAME, text);
    258260                new_cl.appendChild(cl_name);
     
    260262                // description
    261263
    262                 String meta_name = getMetadataNameText(content, lang);
     264                String meta_name = getTextString(content, lang, "metadata_names");
    263265                if (meta_name == null)
    264266                {
Note: See TracChangeset for help on using the changeset viewer.