Skip to content

Overriding the texts of the interface ​

This page describes how to override the texts displayed by the S-Filer Portal web interface — labels, titles, buttons, messages — without modifying the files of the web application. This feature, available since version 4.19.0, is useful to adapt the terminology of the interface to your organization or to fine-tune a specific wording.

How it works ​

All the texts of the web interface come from resource bundles: .properties files embedded in the web application, with one file per language. Before displaying a text, S-Filer Portal first checks if an override is defined for it in the ResourceBundlePropertyOverride table of the database. If an override exists for the requested bundle, language and key, the value from the database is displayed instead of the value from the .properties file.

The overrides are stored in the database, so they apply to all the gateways of the installation and they are preserved when S-Filer Portal is updated.

The ResourceBundlePropertyOverride table ​

The ResourceBundlePropertyOverride table contains the following columns:

ColumnTypeDescription
IDnumberPrimary key of the row, filled automatically by the database.
BUNDLENAMEtext (256)Fully qualified name of the resource bundle containing the text, e.g. com.okiok.sfiler.java.gui.web.action.Logout.
LANGUAGEtext (2)Two-letter code of the language to override: en, fr, es, de or it.
PROPERTYKEYtext (256)Key of the text in the resource bundle, e.g. logout.signed.in.again.message.
PROPERTYVALUEtext (2048)The new text to display.

The four data columns (BUNDLENAME, LANGUAGE, PROPERTYKEY and PROPERTYVALUE) are declared NOT NULL: an insert that omits one of them, or that sets it to NULL, is rejected by the database. ID is filled automatically, so leaving it out of the insert is normal.

A unique index (IDX_RESOURCEBUNDLEPROPERTYOVERRIDE_BUNDLENAME_LANG_PROPKEY) guarantees that there can only be one override per combination of bundle, language and key. To change an existing override, update the existing row instead of inserting a new one.

Finding the bundle name and the property key ​

The resource bundles are located in the web application deployed on the gateway, under .../sfiler-gateway/gateway/webapps/sfiler-gui-ajax/WEB-INF/classes. The bundles containing the texts of the interface are under the com/okiok/sfiler/java/gui sub-folders.

To find the text you want to override, search the .properties files of your language for the current text. The name of the file gives you the bundle name and the language, and the line gives you the key. For example, the file:

com/okiok/sfiler/java/gui/web/action/Logout_fr.properties

corresponds to the bundle com.okiok.sfiler.java.gui.web.action.Logout for the language fr, and the line:

properties
logout.signed.in.again.message=Cliquer ici pour vous connecter.

gives the key logout.signed.in.again.message.

Warning

Texts that are shared by several pages are located in files named package_<language>.properties. The bundle name of these files ends with .package, e.g. com.okiok.sfiler.java.gui.web.action.package.

Some texts contain placeholders such as {0} or {1} that are replaced at display time (for example by a file name or a number). Make sure to keep these placeholders in your overridden value.

Adding an override ​

An override is added by inserting a row in the ResourceBundlePropertyOverride table with a database client. For example, to override the text of the "sign in again" link of the logout page in French:

sql
INSERT INTO ResourceBundlePropertyOverride (BUNDLENAME, LANGUAGE, PROPERTYKEY, PROPERTYVALUE)
VALUES ('com.okiok.sfiler.java.gui.web.action.Logout', 'fr', 'logout.signed.in.again.message', 'Me connecter.');

To override the same text for every language of the interface, insert one row per language.

To remove an override and return to the standard text, simply delete the row.

Deploying a set of overrides ​

A customization delivered as a theme usually comes with its overrides already written as a SQL script, named properties.sql and packaged in my-theme-properties.zip. The script is a DELETE followed by a single INSERT listing every override of the theme.

Run it with the SQL client of your database engine (sqlcmd, SQL Server Management Studio, SQL*Plus, mysql), connected to the S-Filer Portal database. The script is not run by the S-Filer Config CLI.

Important

The delivered script starts with a DELETE FROM ResourceBundlePropertyOverride without a WHERE clause: it erases every existing override before inserting its own. On an installation that already has overrides (from an earlier theme, or added by hand), running the script as-is discards them.

Before running it, export the current content of the table and merge the two sets of overrides rather than replacing one with the other.

Warning

These scripts are normally written for SQL Server: identifiers in square brackets and go batch separators. Adapt the syntax for Oracle, MySQL or MariaDB, and on Oracle supply the ID column from the S_RESOURCEBUNDLEPROPERTYOVERRIDE sequence.

When changes take effect ​

The web interface loads the overrides in a cache that is refreshed automatically every 5 minutes, at the same time as the rest of its configuration. A new or modified override is therefore visible within about 5 minutes of the change in the database, without restarting any component. To apply a change immediately, restart the gateway.

Limitations and warnings ​

Important

This feature involves inserting data directly in the S-Filer Portal database. Make sure you have a backup of the database and validate your changes in a non-production environment first.

The overridden values are displayed by the web interface as they are stored. Only insert content that you trust; never insert texts that come from an untrusted source.

  • The overrides only apply to the texts of the web interface. Texts sent by the server, such as email notifications, are not affected.
  • The overrides are preserved when S-Filer Portal is updated, but the keys and bundle names may change from one version to another. After an update, validate that your overrides still match existing keys.