*/
protected ActionForward doUpdateCatalog(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception
{
CatalogForm catalog = (CatalogForm) form;
String errMsg = null;
if (StringUtils.isEmpty(catalog.getName()))
errMsg = getMessage(request, null, "error.empty_not_allowed");
else if(DLOGSecurityManager.IllegalGlossary.existIllegalWord(catalog.getName()))
errMsg = getMessage(request, null, "error.illegal_glossary");
else if(DLOGSecurityManager.IllegalGlossary.existIllegalWord(catalog.getDetail()))
errMsg = getMessage(request, null, "error.illegal_glossary");
else {
try {
CatalogBean cbean = CatalogDAO.getCatalogByID(catalog.getId());
cbean.setName(super.autoFiltrate(cbean.getSite(), catalog.getName()));
if(StringUtils.isNotEmpty(catalog.getDetail())){
String detail = super.autoFiltrate(cbean.getSite(), catalog.getDetail());
cbean.setDetail(super.filterScriptAndStyle(detail));
}
cbean.setType(catalog.getType());
int logCount = CatalogDAO.getDiaryCount(catalog.getId(), false,
DiaryBean.STATUS_NORMAL);
cbean.setArticleCount(logCount);
//�����������
if(catalog.getCatalog()>0){
if(cbean.getCatalog()==null)
cbean.setCatalog(new TypeBean(catalog.getCatalog()));
else if(cbean.getCatalog().getId()!=catalog.getCatalog())
cbean.setCatalog(new TypeBean(catalog.getCatalog()));
}
else if(cbean.getCatalog()!=null){
cbean.setCatalog(null);
}
CatalogDAO.flush();
} catch (Exception e) {
errMsg = getMessage(request, null, "error.database", e
.getMessage());
}
}
ActionForward page = null;
if(errMsg!=null)
page = makeForward(mapping.findForward(CATALOGS), catalog
.getSid(), "cat_id=" + catalog.getId() + "#edit");
else
page = makeForward(mapping.findForward(CATALOGS), catalog.getSid());
return msgbox(mapping, form, request, response, errMsg, page.getPath());
}