BookmarksPageModel pageModel = new BookmarksPageModel(
request, response, mapping, (BookmarksForm)actionForm);
WebsiteData website = pageModel.getFolder().getWebsite();
if (RollerSession.getRollerSession(request).isUserAuthorizedToAuthor(website))
{
BookmarkManager bmgr = roller.getBookmarkManager();
BookmarksForm form = (BookmarksForm)actionForm;
mLogger.debug("Deleting folders and bookmarks.");
String folders[] = form.getSelectedFolders();
if (null != folders)
{
for (int i = 0; i < folders.length; i++)
{
FolderData fd = bmgr.getFolder(folders[i]);
bmgr.removeFolder(fd); // removes child folders and bookmarks too
}
}
BookmarkData bookmark = null;
String bookmarks[] = form.getSelectedBookmarks();
if (null != bookmarks)
{
for (int j = 0; j < bookmarks.length; j++)
{
bookmark = bmgr.getBookmark(bookmarks[j]);
bmgr.removeBookmark(bookmark);
}
}
RollerFactory.getRoller().flush();
CacheManager.invalidate(website);