Package org.osforce.connect.entity.discussion

Examples of org.osforce.connect.entity.discussion.Topic


      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())) {
      Topic topic = topicService.getTopic(activity.getLinkedId());
      model.put("topic", topic);
    } else if(StringUtils.equals(Reply.NAME, activity.getEntity())) {
      Reply reply = replyService.getReply(activity.getLinkedId());
      model.put("reply", reply);
    } else if(StringUtils.equals(TeamMember.NAME, activity.getEntity())) {
View Full Code Here


    if(reply.getModifiedId()!=null) {
      User modifiedBy = userDao.get(reply.getModifiedId());
      reply.setModifiedBy(modifiedBy);
    }
    if(reply.getTopicId()!=null) {
      Topic topic = topicDao.get(reply.getTopicId());
      reply.setTopic(topic);
    }
    if(reply.getQuoteId()!=null) {
      Reply quote = replyDao.get(reply.getQuoteId());
      reply.setQuote(quote);
View Full Code Here

  }
 
  @RequestMapping("/detail-view")
  @Permission({"topic-view"})
  public String doDetailVIew(@RequestParam Long topicId, Model model) {
    Topic topic = topicService.getTopic(topicId);
    // count favorite
    Long favorite = linkService.countLinks(Link.TYPE_FAVORITE, topicId, Topic.NAME);
    topic.setFavorite(favorite);
    model.addAttribute(AttributeKeys.TOPIC_KEY_READABLE, topic);
    return "discussion/topic-detail";
  }
View Full Code Here

  }
 
  @RequestMapping("/list-view")
  @Permission({"reply-view"})
  public String doListView(@RequestParam Long topicId, Page<Reply> page, Model model) {
    Topic topic = topicService.viewTopic(topicId);
    page = replyService.getReplyPage(page, topicId);
    if(page.getResult().isEmpty()) {
      return "commons/blank";
    }
    model.addAttribute(AttributeKeys.TOPIC_KEY_READABLE, topic);
View Full Code Here

      if(replyId!=null) {
        reply = replyService.getReply(replyId);
      }
      model.addAttribute(AttributeKeys.REPLY_KEY_READABLE, reply);
    }
    Topic topic = topicService.getTopic(topicId);
    model.addAttribute(AttributeKeys.TOPIC_KEY_READABLE, topic);
    return "discussion/reply-form";
  }
View Full Code Here

  }

  @Override
  protected void doTask(Map<Object, Object> context) throws Exception {
    Long topicId = (Long) context.get("topicId");
    Topic topic = topicService.getTopic(topicId);
    String template = (String) context.get("template");
    Activity activity = new Activity();
    activity.setLinkedId(topicId);
    activity.setEntity(Topic.NAME);
    activity.setType(Topic.NAME);
    activity.setDescription(template);
    activity.setFormat(Activity.FORMAT_FTL);
    activity.setProjectId(topic.getForum().getProjectId());
    activity.setEnteredId(topic.getModifiedId());
    activityService.createActivity(activity);
  }
View Full Code Here

  }

  @AfterReturning("execution(* org.osforce.connect.service.discussion.TopicService.createTopic(..)) ||"
      + "execution(* org.osforce.connect.service.discussion.TopicService.updateTopic(..))")
  public void updateTopic(JoinPoint jp) {
    Topic topic = (Topic) jp.getArgs()[0];
    Map<Object, Object> context = CollectionUtil.newHashMap();
    context.put("topicId", topic.getId());
    context.put("template", TEMPLATE_TOPIC_UPDATE);
    topicActivityStreamTask.doAsyncTask(context);
  }
View Full Code Here

  }
 
  @Override
  protected void doTask(Map<Object, Object> context) throws Exception {
    Long topicId = (Long) context.get("topicId");
    Topic topic = topicService.getTopic(topicId);
    Statistic statistic = statisticService.getStatistic(Statistic.TYPE_VIEW, topicId, Topic.NAME);
    if(statistic==null) {
      statistic = new Statistic(Statistic.TYPE_VIEW, topicId, Topic.NAME);
    }
    statistic.countAdd();
    statistic.setProjectId(topic.getForum().getProject().getId());
    statisticService.createStatistic(statistic);
  }
View Full Code Here

TOP

Related Classes of org.osforce.connect.entity.discussion.Topic

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.