Package ru.org.linux.section

Examples of ru.org.linux.section.Section


            message,
            request.getHeader("User-Agent"),
            group
    );

    Section section = sectionService.getSection(group.getSectionId());

    if (section.isImagepost() && scrn == null) {
      throw new ScriptErrorException("scrn==null!?");
    }

    if (scrn!=null) {
      Screenshot screenShot = scrn.moveTo(siteConfig.getHTMLPathPrefix() + "/gallery", Integer.toString(msgid));

      imageDao.saveImage(
              msgid,
              "gallery/" + screenShot.getMainFile().getName(),
              "gallery/" + screenShot.getIconFile().getName()
      );
    }

    if (section.isPollPostAllowed()) {
      pollDao.createPoll(Arrays.asList(form.getPoll()), form.isMultiSelect(), msgid);
    }

    List<String> tags = TagName.parseAndSanitizeTags(form.getTags());

    topicTagService.updateTags(msgid, ImmutableList.<String>of(), tags);

    if (!previewMsg.isDraft()) {
      if (section.isPremoderated()) {
        sendEvents(message, msgid, ImmutableList.<String>of(), user.getId());
      } else {
        sendEvents(message, msgid, tags, user.getId());
      }
    }
View Full Code Here


          Map<Integer, Integer> editorBonus
  )  {
    boolean modified = topicDao.updateMessage(oldMsg, newMsg, user, newTags, newText);

    if (!newMsg.isDraft() && !newMsg.isExpired()) {
      Section section = sectionService.getSection(oldMsg.getSectionId());

      if (sendTagEventsNeeded(section, oldMsg, commit)) {
        sendEvents(newText, oldMsg.getId(), newTags, oldMsg.getUid());
      } else {
        sendEvents(newText, oldMsg.getId(), ImmutableList.<String>of(), oldMsg.getUid());
View Full Code Here

          MessageText text,
          @Nullable Image image) {
    try {
      Group group = groupDao.getGroup(message.getGroupId());
      User author = userDao.getUserCached(message.getUid());
      Section section = sectionService.getSection(message.getSectionId());

      DeleteInfo deleteInfo;
      User deleteUser;
      if (message.isDeleted()) {
        deleteInfo = deleteInfoDao.getDeleteInfo(message.getId());

        if (deleteInfo!=null) {
          deleteUser = userDao.getUserCached(deleteInfo.getUserid());
        } else {
          deleteUser = null;
        }
      } else {
        deleteInfo = null;
        deleteUser = null;
      }

      PreparedPoll preparedPoll;

      if (section.isPollPostAllowed()) {
        if (poll==null) {
          preparedPoll = pollPrepareService.preparePoll(message, user);
        } else {
          preparedPoll = poll;
        }
      } else {
        preparedPoll = null;
      }

      User commiter;

      if (message.getCommitby()!=0) {
        commiter = userDao.getUserCached(message.getCommitby());
      } else {
        commiter = null;
      }

      EditInfoSummary editInfoSummary = editHistoryService.editInfoSummary(message.getId(), EditHistoryObjectTypeEnum.TOPIC);

      User lastEditor;
      int editCount;
      Date lastEditDate;

      if (editInfoSummary.editCount() > 0) {
        BriefEditInfo editHistoryDto = editInfoSummary.lastEditInfo().get();
        lastEditor = userDao.getUserCached(editHistoryDto.editor());
        editCount = editInfoSummary.editCount();
        lastEditDate = editHistoryDto.editdate();
      } else {
        lastEditDate = null;
        lastEditor = null;
        editCount = 0;
      }

      String processedMessage;

      if (text.isLorcode()) {
        if (minimizeCut) {
          String url = siteConfig.getMainUrl() + message.getLink();
          processedMessage = lorCodeService.parseTopicWithMinimizedCut(
                  text.getText(),
                  url,
                  secure,
                  ! topicPermissionService.followInTopic(message, author)
          );
        } else {
          processedMessage = lorCodeService.parseTopic(text.getText(), secure, ! topicPermissionService.followInTopic(message, author));
        }
      } else {
        processedMessage = "<p>" + text.getText();
      }

      PreparedImage preparedImage = null;

      if (section.isImagepost() || section.isImageAllowed()) {
        if (message.getId()!=0) {
          image = imageDao.imageForTopic(message);
        }

        if (image != null) {
View Full Code Here

  ) throws Exception {
    TopicListController.setExpireHeaders(response, null, null);

    ModelAndView modelAndView = new ModelAndView();

    Section section = null;
    if (sectionId != 0) {
      section = sectionService.getSection(sectionId);
    }

    User user = getUserByNickname(modelAndView, nick);
View Full Code Here

    }

    ModelAndView mv = new ModelAndView("mtn");

    Topic topic = messageDao.getById(msgid);
    Section section = sectionService.getSection(Section.SECTION_FORUM);

    mv.getModel().put("message", topic);
    mv.getModel().put("groups", groupDao.getGroups(section));
    mv.getModel().put("author", userDao.getUserCached(topic.getUid()));
View Full Code Here

    }

    ModelAndView mv = new ModelAndView("mtn");

    Topic topic = messageDao.getById(msgid);
    Section section = sectionService.getSection(topic.getSectionId());

    mv.getModel().put("message", topic);
    mv.getModel().put("groups", groupDao.getGroups(section));
    mv.getModel().put("author", userDao.getUserCached(topic.getUid()));
View Full Code Here

    HttpServletRequest request,
    TopicListRequest topicListForm,
    HttpServletResponse response,
    @Nullable Group group
  ) throws Exception {
    Section section = null;
    if (topicListForm.getSection() != null && topicListForm.getSection()!=0) {
      section = sectionService.getSection(topicListForm.getSection());
    }

    checkRequestConditions(section, group, topicListForm);
    Template tmpl = Template.getTemplate(request);

    ModelAndView modelAndView = new ModelAndView("view-news");

    modelAndView.addObject("group", group);

    modelAndView.addObject("url", "view-news.jsp");
    if (section != null) {
      modelAndView.addObject("section", section);

      modelAndView.addObject("archiveLink", section.getArchiveLink());
    }

    setExpireHeaders(response, topicListForm.getYear(), topicListForm.getMonth());

    modelAndView.addObject("navtitle", calculateNavTitle(section, group, topicListForm));
View Full Code Here

    @PathVariable int month,
    HttpServletResponse response
  ) throws Exception {
    TopicListRequest topicListForm = new TopicListRequest();

    Section sectionObject = sectionService.getSectionByName(section);
    topicListForm.setSection(sectionObject.getId());
    topicListForm.setYear(year);
    topicListForm.setMonth(month);

    ModelAndView modelAndView = mainTopicsFeedHandler(request, topicListForm, response, null);
View Full Code Here

    TopicListRequest topicListForm,
    @RequestParam(value="group", defaultValue = "0") int groupId
  ) throws Exception {
    StringBuilder redirectLink = new StringBuilder();

    Section section = sectionService.getSection(topicListForm.getSection());

    redirectLink.append(section.getNewsViewerLink());

    if (topicListForm.getYear() != null && topicListForm.getMonth() != null) {
      redirectLink
        .append(topicListForm.getYear())
        .append('/')
View Full Code Here

            groupId == 0 && !notalks && !tech && !feedBurner
      && request.getParameter("noredirect") == null) {
      return new ModelAndView(new RedirectView("http://feeds.feedburner.com/org/LOR"));
    }

    Section section = sectionService.getSection(topicListForm.getSection());
    String ptitle = section.getName();

    Group group = null;
    if (groupId != 0) {
      group = groupDao.getGroup(groupId);
      ptitle += " - " + group.getTitle();
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.