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
en:user_advanced:gs3_displayitems [2018/12/10 00:51] kjdonen:user_advanced:gs3_displayitems [2023/12/21 07:40] (current) – [Display Item format] kjdon
Line 1: Line 1:
 +
 +
 +
 ====== Display Items in Greenstone 3====== ====== Display Items in Greenstone 3======
  
Line 12: Line 15:
 Display items can be specified in several ways: Display items can be specified in several ways:
  
-  - Straight language dependent text: <displayItem name="name" lang="en" value="My Recipe Collection"/> +  - Straight language dependent text: <displayItem name="name" lang="en">My Recipe Collection</displayItem
-  - Dictionary lookup: <displayItem name="name" key="level.section"/>+  - Dictionary lookup: <displayItem name="name" key="level.section"/> - This has an optional dictonary attribute, if you want to specify the dictionary file.
  
-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 search fields =====
  
 ==== Levels==== ==== Levels====
Line 24: Line 28:
 <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 38:
 </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 62: Line 66:
 DisplayItems can be used here too, in a similar way to the indexes and levels.  DisplayItems can be used here too, in a similar way to the indexes and levels. 
  
-==== Dictionary Customization ====+===== Understanding the Dictionaries =====
  
-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).
Line 84: Line 88:
 ServiceRack.properties:GS2MGPPSearch.level.section\\ ServiceRack.properties:GS2MGPPSearch.level.section\\
 ServiceRack.properties:level.section\\ ServiceRack.properties:level.section\\
- 
  
en/user_advanced/gs3_displayitems.1544403096.txt.gz · Last modified: 2018/12/10 00:51 by kjdon