Configuration selectors
When developing an application, it is often necessary to have a different set of configuration options than when the application is deployed. It is also useful during the development process, since there may be several developers, all testing the software on different computers with different setups.
The configuration system in RIFE has a solution for this as well. The Config participant is able to choose from a set of different configuration files depending on the host name, operating system or user name.
<participant param="XmlSelectorHostname">ParticipantConfig</participant>
Here the configuration participant is going to look for the file config-{host}.xml. In other situations it might be different configure settings depending on operating system, where the selector name would be XmlSelectorOs. If configure settings depend on the username the selector XmlSelectorUser is used.
When using a configuration selector, the different configuration files must be named according to a certain pattern:
The host, OS, and user strings are normalized to use all lower case letters and with any dots and spaces ('.' and ' ') replaced with underscore ('_') characters.
Configuration file inclusion
When using configuration selectors, not all parameters are necessarily different between different setups. In those cases it's often preferred to keep those common settings in a separate file that is shared by the different configuration files. RIFE supports inclusion of files in configuration files. This makes it possible for all the selector specific files to include the same common configuration file.
<include file="rep/config-common.xml"/>
Now only one file has to be edited to change the common options instead of each of the selector specific files.
Notes
If you aren't sure what your hostname (or OS, or user) is, set the participant parameter as indicated above, and start the web application. RIFE will generate an error indicating any files it cannot find.
References
Version
At least since RIFE 1.0.