Package org.uned.agonzalo16.bitacora.service.security

Examples of org.uned.agonzalo16.bitacora.service.security.AuthenticatedUser


  }

  @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

    if (session.getAttribute("userAttribute") != null) {
      return true;
    }

    AuthenticatedUser user = authenticationProvider.getCurrentUserDetails();
    if (user != null) {
      logger.info("Selecting user info: " + user);
      session.setAttribute("userAttribute", user);
    }
View Full Code Here

  private AuthenticationProvider authenticationProvider;

  @RequestMapping({ "/" })
  public String index(@RequestParam(value = "articlesPage", defaultValue = "0", required = false) int articlesPage,
      @RequestParam(value = "blogsPage", defaultValue = "0", required = false) int blogsPage, @RequestParam(value = "tab", defaultValue = "0", required = false) int tabNumber, Model model) {
    AuthenticatedUser user = authenticationProvider.getCurrentUserDetails();
    model.addAttribute("articlesPage", articlesPage);
    model.addAttribute("blogsPage", blogsPage);
    model.addAttribute("tabNumber", tabNumber);

    if (user == null) {
View Full Code Here

    List<Blog> blogs = searchService.searchBlogs(query);
    model.addAttribute("articles", articles);
    model.addAttribute("blogs", blogs);
    model.addAttribute("query", query);

    AuthenticatedUser user = authenticationProvider.getCurrentUserDetails();

    if (user == null) {
      return "search";
    } else {
      return "registerSearch";
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.service.security.AuthenticatedUser

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.