How to edit Filter and Steps Parameters using GUI

From Okapi Framework
Revision as of 05:23, 26 January 2022 by Mihnita (talk | contribs)
Jump to navigation Jump to search

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.

File:Tikal e.png

Select an existing filter and configuration that you want to start with, then click “Create…”.

You will be asked for a name:

Tikal create cfg.png

A new window will open, allowing the friendly editing of all the parameters for that filter.

Tikal edit cfg.png

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.

File:Tikal e custom cfg.png

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.

File:Tikal usage.png

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)

Rainbow pipeline add step.png

You will get a GUI dialog where you can edit the parameters:

Rainbow edit step.png

You can then save the pipeline (which you can of course load):

Rainbow save pipeline.png

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:

Fprm content.png

And this is an example of what a pipeline file looks like:

Pln content.png

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.