en:user_advanced:gs3_search_field_display
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:user_advanced:gs3_search_field_display [2018/12/10 00:36] – [Dictionary Customization] kjdon | en:user_advanced:gs3_search_field_display [2018/12/10 01:23] (current) – removed kjdon | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Customising the field list display in Greenstone 3====== | ||
- | |||
- | Note, main dictionaries are found in web/ | ||
- | |||
- | ==== Levels==== | ||
- | |||
- | < | ||
- | |||
- | This will be displayed using level.section from the ServiceRack.properties dictionary. | ||
- | |||
- | < | ||
- | <level name=" | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | </ | ||
- | |||
- | For english, the lang=en displayItem will be used, as it matches the current lang. | ||
- | For languages where there is not a specific displayItem, | ||
- | |||
- | (See getDisplayText in service/ | ||
- | |||
- | ==== Indexes ==== | ||
- | |||
- | Display values for indexes are done in a similar way to levels, except that the values are looked up in metadata_names.properties, | ||
- | |||
- | < | ||
- | |||
- | No displayItems, | ||
- | |||
- | < | ||
- | <index name=" | ||
- | < | ||
- | < | ||
- | </ | ||
- | </ | ||
- | |||
- | For English, we will display book titles. For other languages we will display the value from the dictionary for Title.buttonname. | ||
- | |||
- | ==== Classifiers ==== | ||
- | |||
- | The navigation tab for each classifier is also customisable. By default, the code will get the Title metadata for the classifier from the collection database (eg index/ | ||
- | |||
- | DisplayItems can be used here too, in a similar way to the indexes and levels. | ||
- | |||
- | ==== 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. | ||
- | |||
- | We use a custom classloader to find dictionary files (util/ | ||
- | If the code is looking for eg ServiceRack.properties, | ||
- | This enables a collection to customise the values without affecting other collections. | ||
- | |||
- | getTextString() (in services/ | ||
- | |||
- | In some cases, a dictionary name is passed in to getTextString() (e.g. metadata_names). In this case, we look for metadata_names dictionary using the CollectionClassLoader, | ||
- | |||
- | In the majority of cases, we will try various named dictionaries to try and find the key. It starts with the current class name, then tries up the class hierarchy until it gets to ServiceRack (which is the base class for all ServiceRacks. Once it gets to looking in ServiceRack.properties, | ||
- | |||
- | In this way different services can override values. | ||
- | For example, if GS2MGPPSearch is looking up the value for level.section, | ||
- | |||
- | GS2MGPPSearch.properties: | ||
- | AbstractGS2FieldSearch.properties: | ||
- | AbstractGs2TextSearch.properties: | ||
- | ServiceRack.properties: | ||
- | ServiceRack.properties: | ||
en/user_advanced/gs3_search_field_display.1544402178.txt.gz · Last modified: 2018/12/10 00:36 by kjdon