HttpServletRequest request,
HttpServletResponse response) throws RollerException {
ActionMessages resultMsg = new ActionMessages();
ActionForward forward = mapping.findForward("weblogEdit.page");
ActionErrors errors = new ActionErrors();
WeblogEntryData entry = null;
try {
WeblogEntryFormEx form = (WeblogEntryFormEx)actionForm;
String entryid = form.getId();
if ( entryid == null ) {
entryid =
request.getParameter(RollerRequest.WEBLOGENTRYID_KEY);
}
Roller roller = RollerFactory.getRoller();
RollerContext rctx= RollerContext.getRollerContext();
WeblogManager wmgr= roller.getWeblogManager();
entry = wmgr.getWeblogEntry(entryid);
RollerSession rses = RollerSession.getRollerSession(request);
if (rses.isUserAuthorizedToAuthor(entry.getWebsite())) {
// Run entry through registered PagePlugins
PagePluginManager ppmgr = roller.getPagePluginManager();
Map plugins = ppmgr.createAndInitPagePlugins(
entry.getWebsite(),
RollerContext.getRollerContext().getServletContext(),
RollerContext.getRollerContext().getAbsoluteContextUrl(request),
new VelocityContext());
String content = "";
if (!StringUtils.isEmpty(entry.getText())) {
content = entry.getText();
} else {
content = entry.getSummary();
}
content = ppmgr.applyPagePlugins(entry, plugins, content, true);
String title = entry.getTitle();
String excerpt = StringUtils.left( Utilities.removeHTML(content),255 );
String url = rctx.createEntryPermalink(entry, request, true);
String blog_name = entry.getWebsite().getName();
if (form.getTrackbackUrl() != null) {
// by default let all trackbacks to be sent
boolean allowTrackback = true;