Package org.osforce.connect.entity.blog

Examples of org.osforce.connect.entity.blog.Post


    Map<Object, Object> model = CollectionUtil.newHashMap();
    if(StringUtils.equals(Profile.NAME, activity.getEntity())) {
      Profile profile = profileService.getProfile(activity.getLinkedId());
      model.put("profile", profile);
    } else if(StringUtils.equals(Post.NAME, activity.getEntity())) {
      Post blogPost = postService.getPost(activity.getLinkedId());
      model.put("post", blogPost);
    } else if(StringUtils.equals(Forum.NAME, activity.getEntity())){
      Forum forum = forumService.getForum(activity.getLinkedId());
      model.put("forum", forum);
    } else if(StringUtils.equals(Topic.NAME, activity.getEntity())) {
View Full Code Here


 
  @RequestMapping("/detail-view")
  @Permission({"post-view"})
  public String doDetailView(@RequestParam Long postId,
      @RequestAttr User user, Model model) {
    Post post = postService.viewPost(postId);
    model.addAttribute(AttributeKeys.BLOG_POST_KEY_READABLE, post);
    return "blog/post-detail";
  }
View Full Code Here

  }

  @AfterReturning("execution(* org.osforce.connect.service.blog.PostService.createPost(..)) ||"
      + "execution(* org.osforce.connect.service.blog.PostService.updatePost(..))")
  public void updateBlogPost(JoinPoint jp) {
    Post post = (Post) jp.getArgs()[0];
    Map<Object, Object> context = CollectionUtil.newHashMap();
    context.put("postId", post.getId());
    context.put("template", TEMPLATE_POST_UPDATE);
    postActivityStreamTask.doAsyncTask(context);
  }
View Full Code Here

  }
 
  @Override
  protected void doTask(Map<Object, Object> context) throws Exception {
    Long postId = (Long) context.get("postId");
    Post post = postService.getPost(postId);
    Statistic statistic = statisticService.getStatistic(Statistic.TYPE_VIEW, postId, Post.NAME);
    if(statistic==null) {
      statistic = new Statistic(Statistic.TYPE_VIEW, postId, Post.NAME);
    }
    statistic.countAdd();
    statistic.setProjectId(post.getProjectId());
    statisticService.createStatistic(statistic);
  }
View Full Code Here

  }

  @Override
  protected void doTask(Map<Object, Object> context) throws Exception {
    Long postId = (Long) context.get("postId");
    Post post = postService.getPost(postId);
    String templateName = (String) context.get("template");
    Activity activity = new Activity();
    activity.setLinkedId(postId);
    activity.setEntity(Post.NAME);
    activity.setType(Post.NAME);
    activity.setDescription(templateName);
    activity.setFormat(Activity.FORMAT_FTL);
    activity.setProjectId(post.getProjectId());
    activity.setEnteredId(post.getModifiedId());
    activityService.createActivity(activity);
  }
View Full Code Here

TOP

Related Classes of org.osforce.connect.entity.blog.Post

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.