User Tools

Site Tools


en:user:interfaces

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:interfaces [2018/07/31 01:27] kjdonen:user:interfaces [2019/09/22 23:24] kjdon
Line 11: Line 11:
 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 ''$GSDL3HOME/ Most of an interface is defined by XSLT files, which are stored in ''$GSDL3HOME/
 interfaces/<interface-name>/transform''. These can be changed and the changes interfaces/<interface-name>/transform''. These can be changed and the changes
Line 43: Line 43:
 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====+==== 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 
 +''$GSDL3HOME/WEB-INF/classes''. Each interface has one named ''interface_name.properties'' 
 +(where 'name' is the interface name, for example, ''interface_default.properties'', 
 +or ''interface_classic.properties''). Each service class has one with the same 
 +name as the class (e.g. ''GS2Search.properties''). To add another language all of 
 +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 
 +''interface_default.properties'' would be named ''interface_default_fr.properties''
 +Keys will be looked up in the properties file closest to the specified language. 
 +For example, if language ''fr_CA'' was specified (French language, country Canada), 
 +and the default locale was ''en_GB'', Java would look at properties files in the following order,  
 +until it found the key: ''XXX_fr_CA.properties'', ''XXX_fr.properties'', 
 +''XXX_en_GB.properties'', then ''XXX_en.properties'', and finally the default ''XXX.properties''
 + 
 +These new files are available straight away. To use the new language, add e.g. 
 +''l=fr'' to the arguments in the URL. To get Greenstone to add it in to the list of 
 +languages on the preferences page, an entry needs to be added into the languages 
 +list in the ''interfaceConfig.xml'' file. Modification of this file 
 +requires a restart of the Tomcat server for the changes to be recognized. 
 + 
 + 
 +===== Creating a new interface=====
 {{ :en:exampleinterface.png?direct&400|}} {{ :en:exampleinterface.png?direct&400|}}
 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 103:
 </code> </code>
  
-===== Interface configuration file =====+==== Interface configuration file ====
  
 The interface configuration file ''interfaceConfig.xml'' lists all the actions that the interface knows about at the start (other ones can be loaded dynamically). **Actions** create the web pages for the library: there is generally one Action per type of page. For example, a query action produces the pages for searching, while a document action displays the documents. The configuration file specifies what short name each action maps to (this is used in library URLs for the //a//, i.e. action, parameter) e.g. QueryAction should use ''a=q''. If the interface uses XSLT, it specifies what XSLT file should be used for each action and possibly each subaction. This makes it easy for developers to implement and use different actions and/or XSLT files without recompilation. The server must be restarted, however. The interface configuration file ''interfaceConfig.xml'' lists all the actions that the interface knows about at the start (other ones can be loaded dynamically). **Actions** create the web pages for the library: there is generally one Action per type of page. For example, a query action produces the pages for searching, while a document action displays the documents. The configuration file specifies what short name each action maps to (this is used in library URLs for the //a//, i.e. action, parameter) e.g. QueryAction should use ''a=q''. If the interface uses XSLT, it specifies what XSLT file should be used for each action and possibly each subaction. This makes it easy for developers to implement and use different actions and/or XSLT files without recompilation. The server must be restarted, however.
Line 85: Line 113:
   * **berryBaskets**: Whether berry basket functionality is available or not   * **berryBaskets**: Whether berry basket functionality is available or not
   * **displayAnnotationService**: Whether any annotation services (specified in the site config file) should be displayed with a document or not.   * **displayAnnotationService**: Whether any annotation services (specified in the site config file) should be displayed with a document or not.
-===== Using new interface =====+==== Using the new interface ====
  
 To use a new interface, the ''$GSDL3HOME/WEB-INF/web.xml'' file must be edited: To use a new interface, the ''$GSDL3HOME/WEB-INF/web.xml'' file must be edited:
 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#Servlets|more about servlets]]):+servlet instantiation to the file ([[en:developer:web_services|more about servlets]]):
  
 <code xml> <code xml>
Line 130: Line 158:
  
  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 
-''$GSDL3HOME/WEB-INF/classes''. Each interface has one named ''interface_name.properties'' 
-(where 'name' is the interface name, for example, ''interface_default.properties'', 
-or ''interface_classic.properties''). Each service class has one with the same 
-name as the class (e.g. ''GS2Search.properties''). To add another language all of 
-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 
-''interface_default.properties'' would be named ''interface_default_fr.properties''. 
-Keys will be looked up in the properties file closest to the specified language. 
-For example, if language ''fr_CA'' was specified (French language, country Canada), 
-and the default locale was ''en_GB'', Java would look at properties files in the following order,  
-until it found the key: ''XXX_fr_CA.properties'', ''XXX_fr.properties'', 
-''XXX_en_GB.properties'', then ''XXX_en.properties'', and finally the default ''XXX.properties''. 
- 
-These new files are available straight away —to use the new language, add e.g. 
-''l=fr'' to the arguments in the URL. To get Greenstone to add it in to the list of 
-languages on the preferences page, an entry needs to be added into the languages 
-list in the ''interfaceConfig.xml'' file. Modification of this file 
-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:gs3_sample_interface_modifications|sample interface modifications]]
   * [[http://wiki.greenstone.org/wiki/images/7/71/Skins_Doc.pdf|Greenstone 3 Interface Transformations Library: Basic Documentation]] //Maxime Roüast//   * [[http://wiki.greenstone.org/wiki/images/7/71/Skins_Doc.pdf|Greenstone 3 Interface Transformations Library: Basic Documentation]] //Maxime Roüast//
   * Tutorials on creating a new interface:   * Tutorials on creating a new interface:
en/user/interfaces.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1