Package org.j2cms.model.article

Examples of org.j2cms.model.article.Article


  @Actions({
    @Action("save")
  })
  public String save(){
    this.entity.setArticle (new Article(articleID));
    this.entity.setUser(new User(userID));
    entityService.save(this.entity);
    return SUCCESS;
  }
View Full Code Here


    int count=0;
    try {
      for (Integer id:ids)
      {
        String htmlName = id+".html";
        Article entity=entityService.find(id);
        if(entity!=null&&entity.getCheckState()==CheckState.pass){
          map.put("entity",entity);
          createHtml.init(ftl, htmlName, map, relaPath);
          count++;
        }
      }
View Full Code Here

  }
  @Test public void save()
  {
    for(int i=1;i<50;i++)
    {
      Article article = new Article();
      article.setTitle(i+"关于J2CMS");
      article.setContent("<p>&nbsp;&nbsp;J2CMS是一款JAVAEE平台的开源内容管理系统.继承java强大、稳定、安全、高效、跨平台等多方面的优点,结合mysql数据库开发. 懂html就能建站,提供最便利、合理的使用方式.<br />");
      article.setAuthor("郭涛");
      article.setOrigin("本站");
      article.setUser(new User(1));
      article.setGroup(new Group(5));
      article.setChannel(new Channel(7));
      article.setReleaseDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
      article.setCommentCount(200+i);
      article.setVisitTotal(100+i);
      article.setCheckState(CheckState.pass);     
         
      articleService.save(article);     
    }

  }
View Full Code Here

    }

  }
  @Test public void update()
  {
    Article article = articleService.find(1);
    article.setTitle("标题1");
    article.setChannel(channelService.find(1));
    articleService.update(article);
  }
View Full Code Here

    article.setChannel(channelService.find(1));
    articleService.update(article);
  }
  @Test public void update2()
  {
    Article article = articleService.find(1);
    article.setTitle("标题111");
    article.setChannel(channelService.find(1));
    articleService.update(article);
  }
View Full Code Here

TOP

Related Classes of org.j2cms.model.article.Article

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.