Examples of BlogEntryFormView


Examples of net.sourceforge.pebble.web.view.impl.BlogEntryFormView

    ValidationContext validationContext = new ValidationContext();
    blogEntry.validate(validationContext);
    getModel().put("validationContext", validationContext);
    getModel().put(Constants.BLOG_ENTRY_KEY, blogEntry);

    return new BlogEntryFormView();
  }
View Full Code Here

Examples of net.sourceforge.pebble.web.view.impl.BlogEntryFormView

    getModel().put("validationContext", context);
    getModel().put(Constants.BLOG_ENTRY_KEY, blogEntry);

    if (context.hasErrors())  {
      return new BlogEntryFormView();
    } else {
      BlogService service = new BlogService();
      try {
        service.putBlogEntry(blogEntry);
        blog.info("Blog entry <a href=\"" + blogEntry.getLocalPermalink() + "\">" + blogEntry.getTitle() + "</a> saved.");
        getModel().put(Constants.BLOG_ENTRY_KEY, blogEntry);
        return new RedirectView(blogEntry.getLocalPermalink());
      } catch (BlogServiceException be) {
        log.error(be.getMessage(), be);
        context.addError(be.getMessage());
        be.printStackTrace();
        return new BlogEntryFormView();
      }
    }
  }
View Full Code Here

Examples of net.sourceforge.pebble.web.view.impl.BlogEntryFormView

    entry.setAuthor(SecurityUtils.getUsername());

    getModel().put(Constants.BLOG_ENTRY_KEY, entry);

    return new BlogEntryFormView();
  }
View Full Code Here

Examples of net.sourceforge.pebble.web.view.impl.BlogEntryFormView

    if (blogEntry == null) {
      return new NotFoundView();
    } else {
      getModel().put(Constants.BLOG_ENTRY_KEY, blogEntry);
      return new BlogEntryFormView();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.