en:user:interfaces
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:user:interfaces [2018/07/31 01:27] – kjdon | en:user:interfaces [2023/03/13 01:46] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | |||
+ | |||
======Customizing the Greenstone 3 interface ====== | ======Customizing the Greenstone 3 interface ====== | ||
Format statements in the collection configuration files provide a way to change | Format statements in the collection configuration files provide a way to change | ||
Line 11: | Line 14: | ||
add a new language translation of an interface. | add a new language translation of an interface. | ||
- | ==== Modifying an existing interface==== | + | ===== Modifying an existing interface===== |
Most of an interface is defined by XSLT files, which are stored in '' | Most of an interface is defined by XSLT files, which are stored in '' | ||
interfaces/< | interfaces/< | ||
Line 43: | Line 46: | ||
can be useful when you are trying to write some new XSLT statements. | can be useful when you are trying to write some new XSLT statements. | ||
- | ==== Creating a new interface==== | + | ==== How to change just one template ==== |
+ | |||
+ | You might like to make changes to the interface, but restrict them to a subset of the library. There are different ways to change a template. | ||
+ | For example, suppose we wanted to change what gets displayed on the about page for the collection description. If we look at the transform/ | ||
+ | < | ||
+ | < | ||
+ | .... | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | We might decide that we don't want the default behaviour for the coll-description template and we want to change it. | ||
+ | |||
+ | - Edit the XSL file in web/ | ||
+ | - Edit the XSL file in web/ | ||
+ | - Edit the XSL in web/ | ||
+ | |||
+ | The new about.xsl file doesn' | ||
+ | |||
+ | For example, this might be the collection' | ||
+ | < | ||
+ | <?xml version=" | ||
+ | < | ||
+ | xmlns: | ||
+ | xmlns: | ||
+ | xmlns: | ||
+ | xmlns: | ||
+ | extension-element-prefixes=" | ||
+ | exclude-result-prefixes=" | ||
+ | |||
+ | |||
+ | | ||
+ | < | ||
+ | displayItem[@name=' | ||
+ | < | ||
+ | metadataList/ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Changing the interface language==== | ||
+ | The interface language can be changed by going to the preferences page, and | ||
+ | choosing a language from the list, which includes all languages into which the | ||
+ | interface has been translated. | ||
+ | |||
+ | It is easy to add a new interface language to Greenstone. Language specific | ||
+ | text strings are separated out from the rest of the system to allow for easy incorporation of new languages. These text strings are contained in Java resource bundle | ||
+ | properties files. These are plain text files consisting of key-value pairs, located in | ||
+ | '' | ||
+ | (where ' | ||
+ | or '' | ||
+ | name as the class (e.g. '' | ||
+ | the base .properties files must be translated. The translated files keep the same | ||
+ | names, but with a language extension added. For example, a French version of | ||
+ | '' | ||
+ | Keys will be looked up in the properties file closest to the specified language. | ||
+ | For example, if language '' | ||
+ | and the default locale was '' | ||
+ | until it found the key: '' | ||
+ | '' | ||
+ | |||
+ | These new files are available straight away. To use the new language, add e.g. | ||
+ | '' | ||
+ | languages on the preferences page, an entry needs to be added into the languages | ||
+ | list in the '' | ||
+ | requires a restart of the Tomcat server for the changes to be recognized. | ||
+ | |||
+ | |||
+ | ===== Creating a new interface===== | ||
{{ : | {{ : | ||
Instead of modifying an existing interface, you can also create a new interface. Creating | Instead of modifying an existing interface, you can also create a new interface. Creating | ||
Line 75: | Line 151: | ||
</ | </ | ||
- | ===== Interface configuration file ===== | + | ==== Interface configuration file ==== |
The interface configuration file '' | The interface configuration file '' | ||
Line 85: | Line 161: | ||
* **berryBaskets**: | * **berryBaskets**: | ||
* **displayAnnotationService**: | * **displayAnnotationService**: | ||
- | ===== Using a new interface | + | ==== Using the new interface ==== |
To use a new interface, the '' | To use a new interface, the '' | ||
either change the interface that a current servlet instance is using, or add another | either change the interface that a current servlet instance is using, or add another | ||
- | servlet instantiation to the file ([[web services# | + | servlet instantiation to the file ([[en: |
<code xml> | <code xml> | ||
Line 130: | Line 206: | ||
The Tomcat server must be restarted for this to take effect. | The Tomcat server must be restarted for this to take effect. | ||
- | |||
- | ==== Changing the interface language==== | ||
- | The interface language can be changed by going to the preferences page, and | ||
- | choosing a language from the list, which includes all languages into which the | ||
- | interface has been translated. | ||
- | |||
- | It is easy to add a new interface language to Greenstone. Language specific | ||
- | text strings are separated out from the rest of the system to allow for easy incorporation of new languages. These text strings are contained in Java resource bundle | ||
- | properties files. These are plain text files consisting of key-value pairs, located in | ||
- | '' | ||
- | (where ' | ||
- | or '' | ||
- | name as the class (e.g. '' | ||
- | the base .properties files must be translated. The translated files keep the same | ||
- | names, but with a language extension added. For example, a French version of | ||
- | '' | ||
- | Keys will be looked up in the properties file closest to the specified language. | ||
- | For example, if language '' | ||
- | and the default locale was '' | ||
- | until it found the key: '' | ||
- | '' | ||
- | |||
- | These new files are available straight away to use the new language, add e.g. | ||
- | '' | ||
- | languages on the preferences page, an entry needs to be added into the languages | ||
- | list in the '' | ||
- | requires a restart of the Tomcat server for the changes to be recognized. | ||
===== Additional Resources ===== | ===== Additional Resources ===== | ||
- | * [[en:sample_interface_modifications|sample interface modifications]] | + | * [[en:user: |
* [[http:// | * [[http:// | ||
* Tutorials on creating a new interface: | * Tutorials on creating a new interface: | ||
Line 166: | Line 215: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | * [[en: | ||
en/user/interfaces.1533000438.txt.gz · Last modified: 2018/07/31 01:27 by kjdon