/*
* Initialise the locale handler
*/
LocaleHandler.getInstance().initialize(configuration);
final Locale locale = new Locale(configuration.getString("widget.default.locale"));
final Messages localizedMessages = LocaleHandler.getInstance().getResourceBundle(locale);
/*
* load the opensocial.properties file and put it into this context
* as an attribute 'opensocial' available to all resources
*/
File localOpenSocialPropsFile = new File(System.getProperty("user.dir") + File.separator + "local.opensocial.properties");
PropertiesConfiguration localOpenSocialConfiguration = new PropertiesConfiguration(localOpenSocialPropsFile);
CompositeConfiguration opensocialConfiguration = new CompositeConfiguration();
opensocialConfiguration.addConfiguration(localOpenSocialConfiguration);
opensocialConfiguration.addConfiguration(new PropertiesConfiguration("opensocial.properties"));
context.setAttribute("opensocial", (Configuration) opensocialConfiguration);
/*
* Load installed features
*/
Features.loadFeatures(context);
/*
* Run diagnostics
*/
Diagnostics.run(context, configuration);
/*
* Start hot-deploy widget watcher
*/
if (configuration.getBoolean("widget.hot_deploy")) {
startWatcher(context, configuration, localizedMessages);
} else {
_logger.info(localizedMessages.getString("WidgetHotDeploy.0"));
}
}
catch (ConfigurationException ex) {
_logger.error("ConfigurationException thrown: "+ ex.toString());
}