Package com.ponxu.blog4j.model

Examples of com.ponxu.blog4j.model.Post


*
* @author xwz
*/
public class PageDetail extends BlogHandler {
  public void get(String url) {
    Post page = postService.getByUrl(url);
    if (page == null) {
      renderString("找不到页面!");
      return;
    }
   
View Full Code Here


*
* @author xwz
*/
public class PostDetail extends BlogHandler {
  public void get(int id) {
    Post post = postService.getById(id);
    if (post == null) {
      renderString("找不到文章!");
      return;
    }
   
View Full Code Here

*
* @author xwz
*/
public class PostEdit extends AdminOAuthHandler {
  public void get(int id) {
    Post post = preparePost(id);
    if (post == null) {
      renderString("找不到文章!");
      return;
    }

View Full Code Here

    putVal("tags", tagService.queryAll());
    renderTemplate(FTL.admin.POST_EDIT);
  }

  public void post(int id) {
    Post post = preparePost(id);
    post.setTitle(getParam("title"));
    post.setUrl(getParam("url"));
    post.setContent(getParam("content"));
    post.setTop(getIntParam("top", 0));
    post.setStatus(getParam("status"));
    post.setType(getParam("type"));
    int[] tagIds = getIntParams("tagid");

    if (id == 0) {
      id = postService.add(post, tagIds);
    } else {
View Full Code Here

    renderString(String.valueOf(id));
  }

  private Post preparePost(int id) {
    Post post = null;
    if (id > 0) {
      post = postService.getById(id);
    } else {
      post = postService.getLatestDraft();
      if (post == null)
        post = new Post();
    }
    return post;
  }
View Full Code Here

TOP

Related Classes of com.ponxu.blog4j.model.Post

Copyright © 2018 www.massapicom. 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.