Package org.uned.agonzalo16.bitacora.domain

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


    return "redirect:/admin/user/list";
  }

  @RequestMapping(method = RequestMethod.GET, value = "/activate/{id}")
  public String activate(@PathVariable("id") Long id) {
    User user = userDao.get(id);

    if (user.getType() != UserType.ADMIN.getType()) {
      user.setActive(true);
      userDao.merge(user);
    }
    return "redirect:/admin/user/show/" + id;
  }
View Full Code Here


    return "redirect:/admin/user/show/" + id;
  }

  @RequestMapping(method = RequestMethod.GET, value = "/desactivate/{id}")
  public String desactivate(@PathVariable("id") Long id) {
    User user = userDao.get(id);

    if (user.getType() != UserType.ADMIN.getType()) {
      user.setActive(false);
      userDao.merge(user);
    }
    return "redirect:/admin/user/show/" + id;
  }
View Full Code Here

    if (result.hasErrors()) {
      return "user/pass";
    }

    User user = userDao.get(form.getId());
    user.setPassword(form.getNewPassword());

    userDao.merge(user);

    logger.debug("User password updated with id " + user.getId());

    return "redirect:/admin/user/show/" + form.getId();
  }
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

TOP

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

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.