Shared Configuration

There is a JSON file (usually [filemanager-dir]/scripts/filemanager.config.json copied from [filemanager-dir]/scripts/filemanager.config.json.default) for sharing the configuration between the frontend (javascript filemanager) and the backend (C5Connector.Java). It's important to understand the settings of the configuration file. Details about that can be found at the wiki page Filemanager configuration file.

The most important setting for C5Connector.Java is options#lang, it must be set to 'java'!

Hint:
To avoid interoperability issues with regular expressions (e.g. excludes#unallowed_folders_REGEXP), all regex' have been moved to the Configuration of C5Connector.Java.

Changes on the configuration file ([filemanager-dir]/scripts/filemanager.config.json) are globally and for all users of your webapp!

Request-Based Configuration

An outstanding feature of C5Connector.Java is the possibility of a request-based (user-based) configuration. For this purpose the filter FilemanagerConfigFilter is provided. It will be used to build and deliver the configuration based on codes.thischwa.c5c.filemanager.FilemanagerConfig. It is the corresponding object-oriented map of the shared configuration file.

Add the following lines to the web.xml to enable the filter:

<filter>
        <filter-name>ConfigFilter</filter-name>
        <filter-class>codes.thischwa.c5c.FilemanagerConfigFilter</filter-class>
</filter>
<filter-mapping>
        <filter-name>ConfigFilter</filter-name>
        <url-pattern>/filemanager/scripts/*</url-pattern>
</filter-mapping>

Assuming the filemanager is installed in the /filemanager folder of your webapp and the codes.thischwa.c5c.FilemanagerConfigFilter has been given the name 'ConfigFilter'.
Now the codes.thischwa.c5c.FilemanagerConfigFilter uses the default implementation of the codes.thischwa.c5c.requestcycle.FilemanagerConfigBuilder to get the configuration. This will be transferred to JSON automatically.

To see how to change the configuration by Java, see Extending the FilemanagerConfigBuilder.