User Tools

Site Tools


en:user_advanced:gs3_displayitems

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:user_advanced:gs3_displayitems [2018/12/10 00:51] kjdonen:user_advanced:gs3_displayitems [2018/12/10 01:26] kjdon
Line 15: Line 15:
   - Dictionary lookup: <displayItem name="name" key="level.section"/>   - Dictionary lookup: <displayItem name="name" key="level.section"/>
  
-The main dictionaries  
-=====Search page customisation ===== 
  
 Note, main dictionaries are found in web/WEB-INF/classes, java source code is found in src/java/org/greenstone/gsdl3 Note, main dictionaries are found in web/WEB-INF/classes, java source code is found in src/java/org/greenstone/gsdl3
 +
 +
 +=====Customising the field list display in Greenstone 3=====
  
 ==== Levels==== ==== Levels====
Line 24: Line 25:
 <code><level name="section"/></code> <code><level name="section"/></code>
  
-This will be displayed using level.section from the ServiceRack.properties dictionary. +By default, the text for this will come from level.section in the ServiceRack.properties dictionary. 
 +We can customise it, e.g.
 <code> <code>
 <level name="section"> <level name="section">
Line 34: Line 35:
 </code> </code>
  
-For english, the lang=en displayItem will be used, as it matches the current lang.+For english, the lang=en displayItem will be used, as it matches the current language.
 For languages where there is not a specific displayItem, it will use one with a key (if present). This key (level.chapter) is looked up in the ServiceRack.properties dictionary (for the approprate language). If it can find a value, then this will be used. If no value is found, then the first displayItem will be used as a default (in this case, the french version). If for some reason, no displayItem values are found (eg if only a key type one is present and the key hasn't been defined), then it will default to using level.section from the ServiceRack dictionary. For languages where there is not a specific displayItem, it will use one with a key (if present). This key (level.chapter) is looked up in the ServiceRack.properties dictionary (for the approprate language). If it can find a value, then this will be used. If no value is found, then the first displayItem will be used as a default (in this case, the french version). If for some reason, no displayItem values are found (eg if only a key type one is present and the key hasn't been defined), then it will default to using level.section from the ServiceRack dictionary.
  
Line 64: Line 65:
 ==== Dictionary Customization ==== ==== Dictionary Customization ====
  
-To get language specific strings in Java we use ResourceBundle dictionaries. If asked for a key from a specific dictionary in a specific language, Java will load the dictionary and look up the key. It has a chain or languages it tries. The specified language, a family related language (I think) , the default language.+To get language specific strings in Java we use ResourceBundle dictionaries. If asked for a key from a specific dictionary in a specific language, Java will load the dictionary and look up the key. It has a chain of languages it tries. The specified language, a family related language (I think), the default language.
  
 We use a custom classloader to find dictionary files (util/CollectionClassLoader.java). We use a custom classloader to find dictionary files (util/CollectionClassLoader.java).
en/user_advanced/gs3_displayitems.txt · Last modified: 2023/12/21 07:40 by kjdon