Package ru.org.linux.spring.dao

Examples of ru.org.linux.spring.dao.MessageText


    }
    Comment original = commentRequest.getOriginal();
    if (original == null) {
      throw new ServletParameterException("Комментарий на задан");
    }
    MessageText messageText = msgbaseDao.getMessageText(original.getId());
    commentRequest.setMsg(messageText.getText());
    commentRequest.setTitle(original.getTitle());

    return new ModelAndView("edit_comment");
  }
View Full Code Here


  private PreparedComment prepareComment(
          @Nonnull Comment comment,
          boolean secure
  ) throws UserNotFoundException {
    MessageText messageText = msgbaseDao.getMessageText(comment.getId());
    return prepareComment(messageText, comment, null, secure, null, null);
  }
View Full Code Here

          @Nonnull List<Comment> list,
          boolean secure
  ) throws UserNotFoundException {
    List<PreparedRSSComment> commentsPrepared = new ArrayList<>(list.size());
    for (Comment comment : list) {
      MessageText messageText = msgbaseDao.getMessageText(comment.getId());

      commentsPrepared.add(prepareRSSComment(messageText, comment, secure));
    }
    return commentsPrepared;
  }
View Full Code Here

            )
    );

    List<PreparedComment> commentsPrepared = new ArrayList<>(list.size());
    for (Comment comment : list) {
      MessageText text = texts.get(comment.getId());

      commentsPrepared.add(prepareComment(text, comment, comments, secure, tmpl, topic));
    }
    return commentsPrepared;
  }
View Full Code Here

    msgbaseDao.updateMessage(oldComment.getId(), commentBody);

    /* кастование пользователей */
    Set<User> newUserRefs = lorCodeService.getReplierFromMessage(commentBody);

    MessageText messageText = msgbaseDao.getMessageText(oldComment.getId());
    Set<User> oldUserRefs = lorCodeService.getReplierFromMessage(messageText.getText());
    Set<User> userRefs = new HashSet<>();
    /* кастовать только тех, кто добавился. Существующие ранее не кастуются */
    for (User user : newUserRefs) {
      if (!oldUserRefs.contains(user)) {
        userRefs.add(user);
View Full Code Here

    Map<String, Object> params = new HashMap<>();

    List<TagRef> tags = topicTagService.getTagRefs(topic);

    MessageText messageText = msgbaseDao.getMessageText(topic.getId());
    String plainText = lorCodeService.extractPlainText(messageText);

    Future<List<List<MoreLikeThisTopic>>> moreLikeThis = moreLikeThisService.search(topic, tags, plainText);

    PreparedTopic preparedMessage = messagePrepareService.prepareTopic(
            topic,
            tags,
            request.isSecure(),
            tmpl.getCurrentUser(),
            messageText
    );

    Group group = preparedMessage.getGroup();

    if (!group.getUrlName().equals(groupName) || group.getSectionId() != section.getId()) {
      return new ModelAndView(new RedirectView(topic.getLink()));
    }

    boolean showDeleted = request.getParameter("deleted") != null;
    if (showDeleted) {
      page = -1;
    }

    if (!tmpl.isModeratorSession()) {
      if (showDeleted && !"POST".equals(request.getMethod())) {
        return new ModelAndView(new RedirectView(topic.getLink()));
      }
    }

    if (page == -1 && !showDeleted) {
      return new ModelAndView(new RedirectView(topic.getLink()));
    }

    int pages = topic.getPageCount(tmpl.getProf().getMessages());

    if (page >= pages && (page > 0 || pages > 0)) {
      if (pages==0) {
        return new ModelAndView(new RedirectView(topic.getLink()));
      } else {
        return new ModelAndView(new RedirectView(topic.getLinkPage(pages - 1)));
      }
    }

    if (showDeleted) {
      if (!tmpl.isSessionAuthorized()) {
        throw new BadInputException("Вы уже вышли из системы");
      }
    }

    params.put("showDeleted", showDeleted);

    User currentUser = AuthUtil.getCurrentUser();

    permissionService.checkView(group, topic, currentUser, showDeleted);

    params.put("message", topic);
    params.put("preparedMessage", preparedMessage);

    if (topic.isExpired()) {
      response.setDateHeader("Expires", System.currentTimeMillis() + 30 * 24 * 60 * 60 * 1000L);
    }

    CommentList comments = commentService.getCommentList(topic, showDeleted);

    if (messageText.isLorcode()) {
      params.put("ogDescription", lorCodeService.trimPlainText(plainText, 250, true));
    }

    params.put("page", page);
    params.put("group", group);
View Full Code Here

    Map<String, Object> params = new HashMap<>();

    List<TagRef> tags = topicTagService.getTagRefs(topic);

    MessageText messageText = msgbaseDao.getMessageText(topic.getId());

    PreparedTopic preparedMessage = messagePrepareService.prepareTopic(
            topic,
            tags,
            request.isSecure(),
View Full Code Here

    List<PreparedUserEvent> prepared = new ArrayList<>(events.size());

    for (UserEvent event : events) {
      String text;
      if (readMessage) {
        MessageText messageText;

        if (event.isComment()) {
          messageText = msgbaseDao.getMessageText(event.getCid());
        } else { // Топик
          messageText = msgbaseDao.getMessageText(event.getMsgid());
        }

        text = lorCodeService.prepareTextRSS(messageText.getText(), secure, messageText.isLorcode());
      } else {
        text = null;
      }

      User commentAuthor;
View Full Code Here

            tags,
            false,
            newPoll!=null?pollPrepareService.preparePollPreview(newPoll):null,
            secure,
            null,
            new MessageText(text, true),
            image
    );
  }
View Full Code Here

TOP

Related Classes of ru.org.linux.spring.dao.MessageText

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.