HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
ActionForward forward = mapping.findForward("Bookmarks");
BookmarkFormEx form = (BookmarkFormEx)actionForm;
RollerRequest rreq = RollerRequest.getRollerRequest(request);
BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
BookmarkData bd = null;
if (null != form.getId() && !form.getId().trim().equals(""))
{
bd = bmgr.getBookmark(form.getId());
}
else
{
bd = new BookmarkData();
FolderData fd = bmgr.getFolder(
request.getParameter(RequestConstants.FOLDER_ID));
bd.setFolder(fd);
}
RollerSession rses = RollerSession.getRollerSession(request);
if (bd.getFolder().getWebsite().hasUserPermissions(
rses.getAuthenticatedUser(), PermissionsData.AUTHOR))
{
form.copyTo(bd, request.getLocale());
bmgr.saveBookmark(bd);
RollerFactory.getRoller().flush();
CacheManager.invalidate(bd);