# Customization Guide

Openfire provides ways to customize application code as well as the Admin console, while maintaining that code in a separate location from the distribution source. The base code and custom code are integrated during the build process.

## File Structure

To cusomize files, create the following file structure in your `openfireHome` directory (where all the source files are on your filesystem).

    custom/
    | - overlay.properties       <- Properties file to replace text in i18n files (optional)
    | - source/                  <- Directory to place java source files to be overridden
    | - webapp/                  <- Directory to place any web file (image, CSS or jsp)

In the `custom/source` directory, mirror the contents under the `src/java` directory. Any files you place under `custom/source` will override the current source files in the build. For example, to override the class `org.jivesoftware.openfire.Channel` you would place a Channel.java file under the directory `custom/source/org/jivesoftware/openfire/`

In the `custom/webapp` directory, mirror the contents of the `src/web` directory. Any files you place there will override the current source files in the build. For example, if you want to modify `src/web/login.jsp` then add login.jsp to the directory `custom/webapp`.

Currently, overridden files will simply be included in the built war or jar files. We have not added functionality to bundle these changes in a separate jar file.

## Overlay Properties File

The i18n files have been modified to be as generic as possible (not to mention this project by name). In cases where that could not be avioded, two keys are responsible. We have made it possible to modify these keys by means of an optional properties file, `overlay.properties` which you place in your `custom/` folder. If you want to override these default properties just create this file. The build will continue to work if you haven't created the file.

The overlay.properties file will currently replace the following keys in the i18n files. Note: this properties file should follow the java.util.Properties text file format.

- title - Title key (usually in the title bar of an HTML page)
- short.title - Short title, also used frequently

## Build

Simply build the application as normal. You may need to run the ant `clean` task for your changes to be picked up.