Package org.uned.agonzalo16.bitacora.domain

Examples of org.uned.agonzalo16.bitacora.domain.Message


    assertNull("The entity has been deleted", messageDao.get(newMsg.getId()));
  }

  @Test
  public void testFidByOrigin() {
    User user1 = createUser();
    User user2 = createUser();
    for (int i = 0; i < 10; i++) {
      Message msg = new Message();
      msg.setCreationDate(new Date());
      msg.setSubject("subject " + i);
      msg.setContent("content");
View Full Code Here


    assertEquals("20 messages to user 1", messageDao.findByDestination(user1).size(), 20);
  }

  @Test
  public void testFindRead() {
    User user1 = createUser();
    User user2 = createUser();
    for (int i = 0; i < 10; i++) {
      Message msg = new Message();
      msg.setCreationDate(new Date());
      msg.setSubject("subject " + i);
      msg.setContent("content");
View Full Code Here

    for (Article article : articles) {
      dates.add(article.getCreationDate());
    }
    model.addAttribute("dates", dates);

    AuthenticatedUser user = authenticationProvider.getCurrentUserDetails();

    if (user == null) {
      return "blog/show";
    } else {
      model.addAttribute("comment", new CommentForm(id));
View Full Code Here

  }

  @Override
  public int doStartTag() throws JspException {

    AuthenticatedUser principal = authenticationProvider.getCurrentUserDetails();
    User user = userDao.get(principal.getId());

    pageContext.setAttribute(var, messageDao.findNotReadByDestination(user));
    return SKIP_BODY;
  }
View Full Code Here

  @RequestMapping(method = RequestMethod.GET, value = "/{id}")
  public String show(@PathVariable("id") Long id, Model model) {
    model.addAttribute("article", articleDao.get(id));

    AuthenticatedUser user = authenticationProvider.getCurrentUserDetails();

    if (user == null) {
      return "article/show";
    } else {
      model.addAttribute("comment", new CommentForm(id));
View Full Code Here

  }

  @Override
  public int doStartTag() throws JspException {

    AuthenticatedUser principal = authenticationProvider.getCurrentUserDetails();
    User user = userDao.get(principal.getId());

    List<BlogContribution> blogs = blogContributionDao.findByUser(user);
    Collections.sort(blogs, new Comparator<BlogContribution>() {
      @Override
      public int compare(BlogContribution b1, BlogContribution b2) {
View Full Code Here

  }

  @Override
  public int doStartTag() throws JspException {

    AuthenticatedUser principal = authenticationProvider.getCurrentUserDetails();
    if (principal == null) {
      return SKIP_BODY;
    }

    User user = userDao.get(principal.getId());

    List<BlogContribution> blogs = blogContributionDao.findByUser(user);
    for (BlogContribution bc : blogs) {
      if (bc.getBlog().equals(blog)) {
        return EVAL_BODY_INCLUDE;
View Full Code Here

    AuthenticatedUser user = authenticationProvider.getCurrentUserDetails();

    if (user == null) {
      return "blog/show";
    } else {
      model.addAttribute("comment", new CommentForm(id));
      return "blog/showAndMenu";
    }
  }
View Full Code Here

    AuthenticatedUser user = authenticationProvider.getCurrentUserDetails();

    if (user == null) {
      return "article/show";
    } else {
      model.addAttribute("comment", new CommentForm(id));
      return "article/showAndComments";
    }
  }
View Full Code Here

    Collections.sort(totalCount);

    // coger los 5 con m�s comentarios
    List<FeaturedArticle> articles = new ArrayList<FeaturedArticle>(5);
    for (ArticleCount article : totalCount) {
      articles.add(new FeaturedArticle(article.getArticle(), commentDao.countByArticle(article.getArticle())));

      if (articles.size() == 5) {
        break;
      }
    }
View Full Code Here

TOP

Related Classes of org.uned.agonzalo16.bitacora.domain.Message

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.