How to edit Filter and Steps Parameters using GUI
In Okapi there is a consistent way to configure both filters, and steps.
And that is by using IParameters
As a developer
You can of course do it from code, something like this:
Parameters params = filter.getParameters(); // You have getters and setters params.setFoo(newFooValue); params.setBar(newBarValue);
Or you can create a configuration file, store it, and load it using params.load(...)
.
And you have both javadoc
(for example)
and an IDE to help you.
As a user
But what are you supposed to do as a user?
You downloaded the Okapi applications (maybe from here or here), and you are trying to use them.
There is an easy way to edit parameters using a friendly graphical user interface (gui).
But it might be a bit difficult to find.
Filters, creating and editing custom configurations
For this you need to be able to run the tikal
application from command line.
But where can you find it?
It is in the same place with the other Okapi application that you extracted from the zip when you downloaded.
On Linux and macos you need to run tikal.sh
, on Windows tikal.exe
(so every time you see “run tikal” it means that you need to use the proper file extension)
From command line run
tikal -e
This will open a GUI window with a list of all the filters, including configurations.
Select an existing filter and configuration that you want to start with, then click “Create…”.
You will be asked for a name:
A new window will open, allowing the friendly editing of all the parameters for that filter.
The result will be saved in a configuration file, with the extension .fprm
, and the name
starting with the filter ID.
For example okf_html@my_custom_cfg.fprm
That is a file you can share, store, backup, etc.
If you want to edit the configuration file later on, you can either use
a text editor (dangerous), or open it again in tikal
and edit using the GUI.
So, from command line run
tikal -e -fc <config_file>
With the example above
tikal -e -fc okf_html@my_custom_cfg
File:Tikal modify existing cfg.png
Or you can run tikal -e
.
The custom configuration will show in the list, and you can “Edit…” / “Create…” / “Delete…” it.
You can now use the configuration with tikal
, for all the steps that take a -fc
parameter.
For example extract:
tikal -x -fc okf_html@my_custom_cfg <file_to_extract>
and then merge:
tikal -m -fc okf_html@my_custom_cfg <xliff_file_to_merge>
Similar for all the others options.
Just run tikal
(or tikal.sh
) without any arguments to see the up to date usage.
Steps, configuring them
Start the Rainbow application, then create a pipeline
File:Rainbow edit pipeline.png
Click the “Add Step…” button, and select a step (the one you want to configure)
You will get a GUI dialog where you can edit the parameters:
You can then save the pipeline (which you can of course load):
The file is saved with a .pln
extension.
Content examples
If you want to “live dangerously” you can edit the configuration files using any text editor.
The Filter parameters are documented at “Filters”.
The Steps parameters are also documented at “Steps”.
But there is no 100% that the pages are up to date.
We try, but we are not perfect :-)
This is an example of what a filter configuration file looks like:
And this is an example of what a pipeline file looks like:
Note: not all configuration files look the same.
Many use .properties
files, but some use an yaml
format,
and some use an .xml
with ITS 2.0 rules.