ActionForm actionForm,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
RollerRequest rreq = RollerRequest.getRollerRequest(request);
WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
WeblogCategoryFormEx form = (WeblogCategoryFormEx)actionForm;
BasePageModel pageModel = null;
WeblogCategoryData parentCat = null;
if (null!=rreq.getWeblogCategory() && null==request.getParameter("correct"))
{
// If request specifies Category and we are not correcting an
// already submitted form then load that Category into the form.
WeblogCategoryData cd = rreq.getWeblogCategory();
form.copyFrom(cd, request.getLocale());
request.setAttribute("state","edit");
parentCat = cd.getParent();
pageModel = new BasePageModel(
"categoryForm.edit.title", request, response, mapping);
pageModel.setWebsite(cd.getWebsite());
}
else if (null != request.getParameter("correct"))
{
// We are correcting a previously submtted form.
// already submitted form then load that Category into the form.
WeblogCategoryData cd = rreq.getWeblogCategory();
request.setAttribute("state","correcting");
parentCat = wmgr.getWeblogCategory(cd.getId());
pageModel = new BasePageModel(
"categoryForm.correct.title", request, response, mapping);