use of org.b3log.solo.service.PreferenceMgmtService in project solo by b3log.
the class SoloServletListener method loadPreference.
/**
* Loads preference.
*
* <p>
* Loads preference from repository, loads skins from skin directory then sets it into preference if the skins
* changed.
* </p>
*/
private void loadPreference() {
Stopwatchs.start("Load Preference");
LOGGER.debug("Loading preference....");
final PreferenceQueryService preferenceQueryService = beanManager.getReference(PreferenceQueryService.class);
JSONObject preference;
try {
preference = preferenceQueryService.getPreference();
if (null == preference) {
LOGGER.info("Please open browser and visit [" + Latkes.getServePath() + "] to init your Solo, " + "and then enjoy it :-p");
return;
}
final PreferenceMgmtService preferenceMgmtService = beanManager.getReference(PreferenceMgmtService.class);
preferenceMgmtService.loadSkins(preference);
} catch (final Exception e) {
LOGGER.log(Level.ERROR, e.getMessage(), e);
throw new IllegalStateException(e);
}
Stopwatchs.end();
}
Aggregations