if (blogEntry == null) {
return new NotFoundView();
}
if (submit.equals("Edit")) {
return new ForwardView("/editBlogEntry.secureaction?entry=" + id);
} else if (submit.equals("Publish") || submit.equals("Unpublish")) {
getModel().put(Constants.BLOG_ENTRY_KEY, blogEntry);
return new PublishBlogEntryView();
} else if (submit.equals("Clone")) {
return new ForwardView("/addBlogEntry.secureaction?entryToClone=" + blogEntry.getId());
} else if (confirm != null && confirm.equals("true")) {
if (submit.equalsIgnoreCase("Remove")) {
try {
service.removeBlogEntry(blogEntry);
blog.info("Blog entry \"" + StringUtils.transformHTML(blogEntry.getTitle()) + "\" removed.");
} catch (BlogServiceException be) {
throw new ServletException(be);
}
return new ForwardView("/viewHomePage.action");
}
}
return new RedirectView(blogEntry.getLocalPermalink());
}