* @throws Exception
*/
protected ActionForward doUpdate(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
AlbumForm album = (AlbumForm) form;
String errMsg = null;
if (StringUtils.isEmpty(album.getName())) {
errMsg = getMessage(request, null, "error.album_name_required");
} else if (album.getType() == AlbumBean.TYPE_VERIFIED
&& StringUtils.isEmpty(album.getVerifyCode())) {
errMsg = getMessage(request, null,
"error.album_verifycode_required");
} else if (DLOGSecurityManager.IllegalGlossary.existIllegalWord(album.getName())){
errMsg = getMessage(request, null, "error.illegal_glossary");
} else if (DLOGSecurityManager.IllegalGlossary.existIllegalWord(album.getDesc())){
errMsg = getMessage(request, null, "error.illegal_glossary");
} else {
try {
AlbumBean abean = AlbumDAO.getAlbumByID(album.getId());
abean.setName(super.autoFiltrate(abean.getSite(), album.getName()));
if (StringUtils.isNotEmpty(album.getDesc())){
String desc = super.autoFiltrate(abean.getSite(), album.getDesc());
abean.setDesc(super.filterScriptAndStyle(desc));
}
else
abean.setDesc(null);
abean.setType(album.getType());
if (StringUtils.isNotEmpty(album.getVerifyCode())
&& abean.getType() == AlbumBean.TYPE_VERIFIED) {
abean.setVerifyCode(album.getVerifyCode());
} else {
abean.setVerifyCode(null);
}
//�����������
if(album.getCatalog()>0){
if(abean.getCatalog()==null)
abean.setCatalog(new TypeBean(album.getCatalog()));
else if(abean.getCatalog().getId()!=album.getCatalog())
abean.setCatalog(new TypeBean(album.getCatalog()));
}
else if(abean.getCatalog()!=null){
abean.setCatalog(null);
}
AlbumDAO.flush();
} catch (Exception e) {
errMsg = getMessage(request, null, "error.database", e
.getMessage());
}
}
ActionForward page = null;
if (errMsg != null)
page = makeForward(mapping.findForward("album_edit"), album.getSid(),
"aid", album.getId());
else
page = makeForward(mapping.findForward(ALBUMS),album.getSid(),"aid",album.getId());
return msgbox(mapping, form, request, response, errMsg, page.getPath());
}