// run validation
myValidate();
if(!hasActionErrors()) try {
WeblogManager wmgr = WebloggerFactory.getWeblogger().getWeblogManager();
UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
Weblog weblog = getActionWeblog();
getBean().copyTo(weblog);
// if blogger category changed then lookup new cat and set it
if(getBean().getBloggerCategoryId() != null &&
!weblog.getBloggerCategory().getId().equals(getBean().getBloggerCategoryId())) {
weblog.setBloggerCategory(wmgr.getWeblogCategory(getBean().getBloggerCategoryId()));
}
// ROL-485: comments not allowed on inactive weblogs
if(!weblog.getActive()) {
weblog.setAllowComments(Boolean.FALSE);
addMessage("websiteSettings.commentsOffForInactiveWeblog");
}
// if blog has unchecked 'show all langs' then we must make sure
// the multi-language blogging option is enabled.
// TODO: this should be properly reflected via the UI
if(!weblog.isShowAllLangs() && !weblog.isEnableMultiLang()) {
weblog.setEnableMultiLang(true);
}
// save config
umgr.saveWebsite(weblog);
// ROL-1050: apply comment defaults to existing entries
if(getBean().getApplyCommentDefaults()) {
wmgr.applyCommentDefaultsToEntries(weblog);
}
// apply referer filters
WebloggerFactory.getWeblogger().getRefererManager().applyRefererFilters(weblog);