*/
protected ActionForward doUpdateFuncs(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
SiteForm f_site = (SiteForm)form;
super.validateClientId(request, f_site);
ActionMessages msgs = new ActionMessages();
SiteBean site = super.getSiteBean(request);
if(site!=null){
//TODO: ���Ƴ���
// Diary
if (StringUtils.isEmpty(f_site.getDiaryName()))
site.setDiary(null);
else
site.setDiary(super.autoFiltrate(site, f_site.getDiaryName()));
site
.getFunctionStatus()
.setDiary(
(f_site.getStatusDiary() == 1) ? FunctionStatus.STATUS_NORMAL
: FunctionStatus.STATUS_CLOSED);
// Photo
if (StringUtils.isEmpty(f_site.getPhotoName()))
site.setPhoto(null);
else
site.setPhoto(super.autoFiltrate(site, f_site.getPhotoName()));
site
.getFunctionStatus()
.setPhoto(
(f_site.getStatusPhoto() == 1) ? FunctionStatus.STATUS_NORMAL
: FunctionStatus.STATUS_CLOSED);
// Music
if (StringUtils.isEmpty(f_site.getMusicName()))
site.setMusic(null);
else
site.setMusic(super.autoFiltrate(site, f_site.getMusicName()));
site
.getFunctionStatus()
.setMusic(
(f_site.getStatusMusic() == 1) ? FunctionStatus.STATUS_NORMAL
: FunctionStatus.STATUS_CLOSED);
// BBS
if (StringUtils.isEmpty(f_site.getForumName()))
site.setForum(null);
else
site.setForum(super.autoFiltrate(site, f_site.getForumName()));
site
.getFunctionStatus()
.setForum(
(f_site.getStatusForum() == 1) ? FunctionStatus.STATUS_NORMAL
: FunctionStatus.STATUS_CLOSED);
// Guestbook
if (StringUtils.isEmpty(f_site.getGuestbookName()))
site.setGuestbook(null);
else
site.setGuestbook(super.autoFiltrate(site, f_site
.getGuestbookName()));
site
.getFunctionStatus()
.setGuestbook(
(f_site.getStatusGuestbook() == 1) ? FunctionStatus.STATUS_NORMAL
: FunctionStatus.STATUS_CLOSED);
site.setLastTime(new Date());
try{
SiteDAO.updateSite(site);
}catch(Exception e){
context().log("Update site's functions failed.", e);
msgs.add("site", new ActionMessage("error.database", e.getMessage()));
}
}
if(!msgs.isEmpty()){
saveMessages(request, msgs);
return mapping.findForward("funcs-setting");
}
return makeForward(mapping.findForward("settings"), f_site.getSid());
}