Package ru.org.linux.section

Examples of ru.org.linux.section.Section


    HttpServletRequest request,
    TopicListRequest topicListForm,
    String groupName,
    HttpServletResponse response
  ) throws Exception {
    Section section = sectionService.getSection(topicListForm.getSection());

    Group group = groupDao.getGroup(section, groupName);

    ModelAndView modelAndView = mainTopicsFeedHandler(
      request,
      topicListForm,
      response,
      group
    );

    StringBuilder ptitle = new StringBuilder();

    ptitle.append(section.getName());
    if (group != null) {
      ptitle.append(" - ").append(group.getTitle());
    }

    modelAndView.addObject("ptitle", ptitle.toString());
View Full Code Here


    reindexMessage(msgUpdate.getMsgid(), msgUpdate.isWithComments());
  }

  private boolean isTopicVisible(Topic msg) {
    Section section = sectionService.getSection(msg.getSectionId());

    if (section.isPremoderated() && !msg.isCommited()) {
      return false;
    }

    return !msg.isDeleted() && !msg.isDraft();
  }
View Full Code Here

  }

  private void updateMessage(Topic topic) {
    Map<String, Object> doc = new HashMap<>();

    Section section = sectionService.getSection(topic.getSectionId());
    Group group = groupDao.getGroup(topic.getGroupId());
    User author = userDao.getUserCached(topic.getUid());

    doc.put("section", section.getUrlName());
    doc.put("topic_author", author.getNick());
    doc.put("topic_id", topic.getId());
    doc.put("author", author.getNick());
    doc.put("group", group.getUrlName());
View Full Code Here

  }

  private IndexRequestBuilder processComment(Topic topic, Comment comment, String message) {
    Map<String, Object> doc = new HashMap<>();

    Section section = sectionService.getSection(topic.getSectionId());
    Group group = groupDao.getGroup(topic.getGroupId());
    User author = userDao.getUserCached(comment.getUserid());
    User topicAuthor = userDao.getUserCached(topic.getUid());

    doc.put("section", section.getUrlName());
    doc.put("topic_author", topicAuthor.getNick());
    doc.put("topic_id", topic.getId());
    doc.put("author", author.getNick());
    doc.put("group", group.getUrlName());
View Full Code Here

    when(user.getId()).thenReturn(13);

    // проверка что данные в mock user верные
    assertTrue(user.isModerator());

    Section sectionModerate = mock(Section.class);
    when(sectionModerate.isPremoderated()).thenReturn(true);
    Section sectionNotModerate = mock(Section.class);
    when(sectionNotModerate.isPremoderated()).thenReturn(false);

    SectionService sectionService = mock(SectionService.class);
    when(sectionService.getSection(1)).thenReturn(sectionModerate);
    when(sectionService.getSection(2)).thenReturn(sectionNotModerate);
View Full Code Here

  GroupDao groupDao;

  @Test
  public void groupsTest()
      throws Exception {
    Section sectionDto = mock(Section.class);
    when(sectionDto.getId()).thenReturn(Section.SECTION_FORUM);

    List<Group> groupDtoList = groupDao.getGroups(sectionDto);
    assertEquals(16, groupDtoList.size());

    Group groupDto = groupDao.getGroup(sectionDto, "general");
View Full Code Here

  @Override
  public List<Section> getAllSections() {
    List<Section> sectionList = new ArrayList<>();

    sectionList.add(new Section("Section 1", false, true, 1, false, "SECTION", TopicPermissionService.POSTSCORE_UNRESTRICTED));
    sectionList.add(new Section("Section 2", false, true, 2, false, "GROUP", TopicPermissionService.POSTSCORE_UNRESTRICTED));
    sectionList.add(new Section("Section 3", true, true, 3, false, "SECTION", TopicPermissionService.POSTSCORE_UNRESTRICTED));
    sectionList.add(new Section("Section 5", false, false, 5, true, "SECTION", TopicPermissionService.POSTSCORE_UNRESTRICTED));

    return sectionList;
  }
View Full Code Here

TOP

Related Classes of ru.org.linux.section.Section

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.