FolderData fd = rreq.getFolder();
form.copyFrom(fd, request.getLocale());
parentFolder = fd.getParent();
BasePageModel pageModel = new BasePageModel(
"folderForm.add.title", request, response, mapping);
pageModel.setWebsite(parentFolder.getWebsite());
request.setAttribute("model", pageModel);
}
else if (null != request.getParameter("correct"))
{
// We are correcting a previously submtted form.
request.setAttribute("state","correcting");
String parentId = request.getParameter(RequestConstants.PARENT_ID);
parentFolder = bmgr.getFolder(parentId);
BasePageModel pageModel = new BasePageModel(
"folderForm.correct.title", request, response, mapping);
pageModel.setWebsite(parentFolder.getWebsite());
request.setAttribute("model", pageModel);
}
else
{
// We are adding a new bookmark
request.setAttribute("state","add");
String parentId = request.getParameter(RequestConstants.PARENT_ID);
parentFolder = bmgr.getFolder(parentId);
BasePageModel pageModel = new BasePageModel(
"folderForm.add.title", request, response, mapping);
pageModel.setWebsite(parentFolder.getWebsite());
request.setAttribute("model", pageModel);
}
request.setAttribute(RequestConstants.PARENT_ID, parentFolder.getId());
request.setAttribute("parentFolder", parentFolder);