...
Download and install Okapi Longhorn as shown here: http://okapiframework.org/wiki/index.php?title=Longhorn#Download_and_Installation.
If you have a working and running Tomcat that has autoDeploy set to "true" in the /etc/tomcat9/server.xml file, than to deploy your okapi-longhorn.war file you can simply copy it to the webapps-folder of your Tomcat installation (on Ubuntu this is located under /var/lib/tomcat9/webapps). You may have to set the file access rights of the war file, so that Tomcat can handle the file and you may need to restart Tomcat.
Important hints for OpenJDK
OpenJDK is the Java runtime usually used on Linux for Tomcat. Since May 2022 there is an OpoenJDK update for most java versions, where new limits for certain xpath recursions are introduced.
This leads to problems, when using Okapi with the XML ITS filter.
Therefore you should add the following increased limit to the startup java settings of your tomcat:
-Djdk.xml.xpathExprOpLimit=200
For doing this, open the setenv.sh file in the bin directory of the CATALINA_HOME directory of your tomcat installation.
Under Ubuntu you should find that directory at /usr/share/tomcat9/bin
If there is no file setenv.sh in this directory, create it as empty file with the rights 755.
Then add to it the following lines:
Code Block |
---|
#!/bin/sh
export JAVA_OPTS="-Djdk.xml.xpathExprOpLimit=200" |
Restart tomcat.
Important hints for Okapi with Tomcat9
...
Translate5 Configuration of the Okapi Plug-In
Config name | Values | Default | Description | |
---|---|---|---|---|
runtimeOptions.plugins.Okapi.api.urlserver | string | map | Available okapi instances with unique names. Do not change the name after the instance is assigned to a task. {"okapi-longhorn":"Url used for Okapi api. In default Okapi setup this should be http://localhost:8080/okapi-longhorn/"} | |
runtimeOptions.plugins.Okapi.serverUsed | string | Okapi server used for the a task. All available values are automatically generated out of the runtimeOptions.plugins.Okapi.server config | ||
runtimeOptions.plugins.Okapi.tikal.executable | string | This usually is left empty, because in the default setup of translate5 you do not use Okapi Tikal, but Okapi Longhorn for conversion. | ||
runtimeOptions.worker.editor_Plugins_Okapi_Worker.maxParallelWorkers | integer | 3 | Max parallel running workers of the Okapi worker |
The above configurations must be set in the Zf_configuration table of your translate5 instance.
In addition the translate5's Okapi plug-in (which is already part of your installed translate5 instance) must be enabled in your translate5 instance.
To do so, find the right configuration option in your SQL database by executing the following select statement:
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT * FROM `Zf_configuration` WHERE `name` LIKE 'runtimeOptions.plugins.active' |
Activate translate5's okapi plug-in by adding it to the json array of this config option.
Therefore if the current value column of your config row looks like this
Code Block | ||
---|---|---|
| ||
["editor_Plugins_Transit_Bootstrap","editor_Plugins_TermTagger_Bootstrap","editor_Plugins_ChangeLog_Init","editor_Plugins_SpellCheck_Init","editor_Plugins_MatchAnalysis_Init","editor_Plugins_NecTm_Init","editor_Plugins_DeepL_Init","editor_Plugins_PangeaMt_Init"] |
Then add the okapi plug-in like this both, execute the following code block. Be careful to change the contents to which "value" will be set in the sql-statements to your needs, if the plug-ins you want to activate or the URL for Okapi is different on your installation. Best look for the existing value of your plug-in configuration and simply add the Okapi Bootstrap-Class "editor_Plugins_Okapi_Init".
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
-- activate plug-in (be careful and watch, if the active plug-ins in the SQL match your needs) UPDATE `Zf_configuration` SET `value` = '[\"editor_Plugins_NoMissingTargetTerminologyOkapi_BootstrapInit\",\"editor_Plugins_Transit_Bootstrap\",\"editor_Plugins_TermTagger_Bootstrap\",\"editor_Plugins_ChangeLog_Init\",\"editor_Plugins_SpellCheck_Init\",\"editor_Plugins_OkapiMatchAnalysis_Init\"]' WHERE `Zf_configuration`.`name` = 'runtimeOptions.plugins.active'; -- configure Okapi URL UPDATE `Zf_configuration` SET `value` = "http://localhost:8080/okapi-longhorn/" WHERE `name` = 'runtimeOptions.plugins.Okapi.api.url'; |
Then update your configuration to make translate5 point to the URL, where your Okapi instance is located, in translate5 interface navigate to http://translate5.local/editor/#preferences/adminConfigGrid and first add your okapi server url(s) (runtimeOptions.plugins.Okapi.server) with unique name and then set this server to be used for all new imports (runtimeOptions.plugins.Okapi.serverUsed)