* @param defaultExt The default used when the default defined in the
* properties file is missing or misconfigured.
*/
protected void initConfiguration(String defaultExt)
{
Configuration config = getConfiguration();
/*
* Should modify the configuration class to take defaults
* here, should have to do this.
*/
String[] fileExtensionAssociations =
config.getStringArray(TEMPLATE_EXTENSIONS);
if (fileExtensionAssociations == null ||
fileExtensionAssociations.length == 0)
{
fileExtensionAssociations = new String[1];
fileExtensionAssociations[0] = config.getString(
DEFAULT_TEMPLATE_EXTENSION, defaultExt);
}
configuration.put(TEMPLATE_EXTENSIONS, fileExtensionAssociations);
/*
* We need some better error checking here and should probably
* throw an exception here if these things aren't set
* up correctly.
*/
configuration.put(DEFAULT_PAGE, config.getString(DEFAULT_PAGE));
configuration.put(DEFAULT_SCREEN, config.getString(DEFAULT_SCREEN));
configuration.put(DEFAULT_LAYOUT, config.getString(DEFAULT_LAYOUT));
configuration.put(DEFAULT_NAVIGATION,
config.getString(DEFAULT_NAVIGATION));
configuration.put(DEFAULT_ERROR_SCREEN,
config.getString(DEFAULT_ERROR_SCREEN));
configuration.put(DEFAULT_LAYOUT_TEMPLATE,
config.getString(DEFAULT_LAYOUT_TEMPLATE));
}