public ActionForward modify(ActionMapping mapping, ActionForm form,HttpServletRequest req, HttpServletResponse resp) {
BlogInteractionEnterOrEditForm f = (BlogInteractionEnterOrEditForm)form;
MessageResources resources = getResources(req);
if (f.getSortLabel() == null || f.getSortLabel().equals("")){
throw new InputException(resources.getMessage(locale, "smssvc.labelMustBeProvided"));
}
long commandEntryId = f.getCommandEntryId();
CommandEntryManager commandEntryManager = new CommandEntryManager(locale, session);
CommandEntry commandEntry = commandEntryManager.getCommandEntry(commandEntryId);
if (commandEntry == null || !(commandEntry instanceof BlogCommandEntry)){
throw new InputException(getResources(req).getMessage(locale, "smssvc.editedInteractionDoesNotExistAnymore")); // may have been deleted
}
BlogCommandEntry blogCommandEntry = (BlogCommandEntry)commandEntry;
checkAccessRights(req, blogCommandEntry.getGroup());
commandEntryManager.evict(blogCommandEntry); // do not modify in this session yet (might be erroneous)
blogCommandEntry.setSortLabel(f.getSortLabel());
if (f.getBlogId() > 0) {
BlogManager blogMgr = new BlogManager(locale, session);
Blog blog = blogMgr.getBlog(f.getBlogId());
if (blog == null) {
throw new InputException(resources.getMessage(locale, "smssvc.selectedBlogNotFound"));
}
blogCommandEntry.setBlog(blog);
} else {
blogCommandEntry.setBlog(null);
}