Examples of Article


Examples of cn.songxinqiang.weixin4j.response.model.Article

   *            图文消息对象
   * @return xml
   */
  public String newsMessageToXml(ResponseNewsMessage newsMessage) {
    xstream.alias("xml", newsMessage.getClass());
    xstream.alias("item", new Article().getClass());
    return xstream.toXML(newsMessage);
  }
View Full Code Here

Examples of com.appspot.finajjarane.framework.entities.Article

  IArticleDao articleDao;

  @Override
  public boolean articleCreateNew(ArticleModel articleModel) throws Exception {

    Article article = ArticleModelToArticle(articleModel);
    return articleDao.add(article);

  }
View Full Code Here

Examples of com.appspot.finajjarane.framework.entities.Article

  }

  @Override
  public boolean articleUpdate(ArticleModel articleModel) throws Exception {
    Article article = ArticleModelToArticle(articleModel);
    try {
      articleDao.merge(article);
      return true;
    } catch (Exception e) {
      return false;
View Full Code Here

Examples of com.appspot.finajjarane.framework.entities.Article

  }

  @Override
  public ArticleModel getArticle(Long idthrows Exception{

    Article article = this.articleDao.findByKey(id);
    return ArticleToArticleModel(article);

  }
View Full Code Here

Examples of com.appspot.finajjarane.framework.entities.Article

   * @param articleModel
   * @return Article
   */
  private Article ArticleModelToArticle(ArticleModel articleModel){

    Article article = new Article();
    List<Category> tags = new ArrayList<Category>();


    for(String tagModel : articleModel.getTags()){
      if(null==tagModel || tagModel.isEmpty()){
        continue;
      }
      tags.add(new Category(tagModel));
    }

    article.setId(articleModel.getId());
    article.setTitle(articleModel.getTitle());
    article.setTags(tags);
    article.setBody(new Text(articleModel.getBody()));
    article.setLang(articleModel.getLang());
    article.setPublishedDate(new Date());
    article.setImageSmall(articleModel.getImageSmall());
    article.setImageCarousel(articleModel.getImageCarousel());


    return article;

  }
View Full Code Here

Examples of com.avaje.tests.model.basic.Article

  @Test
  public void test() {

    Section s0 = new Section("some content");
    Article a0 = new Article("art1", "auth1");
    a0.addSection(s0);

    Ebean.save(a0);

    Article ar1 = Ebean.find(Article.class).setReadOnly(true).setId(a0.getId()).findUnique();

    Assert.assertNotNull(ar1);
    Assert.assertTrue("readonly", Ebean.getBeanState(ar1).isReadOnly());

    List<Section> ar1sections = ar1.getSections();
    Assert.assertEquals(1, ar1sections.size());

    Section s2 = ar1sections.get(0);
    Assert.assertTrue("readonly cascading", Ebean.getBeanState(s2).isReadOnly());

    Ebean.runCacheWarming(Article.class);

    Article ar0 = Ebean.find(Article.class, a0.getId());

    Assert.assertNotNull(ar0);
    Assert.assertFalse(Ebean.getBeanState(ar0).isReadOnly());

    List<Section> ar0sections = ar0.getSections();
    Section s1 = ar0sections.get(0);
    Assert.assertFalse(Ebean.getBeanState(s1).isReadOnly());

  }
View Full Code Here

Examples of com.avaje.tests.model.basic.Article

public class TestDeleteCascadingOneToMany extends TestCase {

  public void testDeleteCascadingOneToMany() {
    Section s0 = new Section("some content");
    Article a0 = new Article("art1","auth1");
    a0.addSection(s0);

    Ebean.save(a0);

    Ebean.delete(a0);
  }
View Full Code Here

Examples of com.dodo.blog.model.Article

    @GetModel( name = ARTICLE_FORM )
    public Article getModel()
    {
        Long id = getLongParameter( ARTICLE_ID );

        Article article;
        if ( id != null )
        {
            article = articleService.getArticleById( id );
        }
        else
        {
            article = new Article();
        }

        return article;
    }
View Full Code Here

Examples of com.dream.domain.article.Article

        return ValidateUtil.isEmptyText(this.guid);
    }

    public Article toNewArticle() {
        User user = SecurityUtil.currentUser();
        return new Article(this.title, this.content, this.category, user);
    }
View Full Code Here

Examples of com.etown.model.Article

      }
    }
  }
 
  public static void main(String[] args) {
    Article article = new Article();
    article.setArticleId(1);
    article.setTitle("测试");
    article.setContent("The FileReader class creates a Reader that you can use to read the contents of a file。 Its two most commonly used constructors are shown here:");
    article.setPubDate(new Date());
    article.setModifyDate(new Date());
    article.setUserId(1231);
    try {
      PreProcessor.Process(article);
    } catch (Exception e) {
      e.printStackTrace();
    }
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.