throws Exception {
ActionErrors errors = new ActionErrors();
ActionMessages messages = new ActionMessages();
ActionForward forward = mapping.findForward("editWebsite");
try {
WebsiteFormEx form = (WebsiteFormEx)actionForm;
WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
UserManager umgr = RollerFactory.getRoller().getUserManager();
WebsiteData wd = umgr.getWebsite(form.getId());
// Set website in request, so subsequent action gets it
RollerRequest.getRollerRequest(request).setWebsite(wd);
RollerSession rollerSession = RollerSession.getRollerSession(request);
if ( rollerSession.isUserAuthorizedToAdmin(wd)) {
checkBlacklist(errors, messages, form.getBlacklist());
if (errors.isEmpty()) {
// ensure getEnabled can't be changed
form.setEnabled(wd.getEnabled());
form.copyTo(wd, request.getLocale());
// ROL-485: comments not be allowed on inactive weblogs
if (wd.getActive() != null && !wd.getActive().booleanValue()) {
wd.setAllowComments(Boolean.FALSE);
messages.add(null, new ActionMessage(
"websiteSettings.commentsOffForInactiveWeblog"));
}
umgr.saveWebsite(wd);
// ROL-1050: apply comment defaults to existing entries
if (form.getApplyCommentDefaults() != null && form.getApplyCommentDefaults().booleanValue()) {
wmgr.applyCommentDefaultsToEntries(wd);
}
RollerFactory.getRoller().getRefererManager().applyRefererFilters(wd);
RollerFactory.getRoller().flush();
messages.add(null,
new ActionMessage("websiteSettings.savedChanges"));
request.getSession().setAttribute(
RollerRequest.WEBSITEID_KEY, form.getId());
// Clear cache entries associated with website
CacheManager.invalidate(wd);
actionForm.reset(mapping,request);