Package ru.org.linux.section

Examples of ru.org.linux.section.Section


  }

  private Map<String, Object> getNewsSection(HttpServletRequest request, String tag) throws TagNotFoundException {
    Template tmpl = Template.getTemplate(request);

    Section newsSection = sectionService.getSection(Section.SECTION_NEWS);

    List<Topic> newsTopics = topicListService.getTopicsFeed(
            newsSection,
            null,
            tag,
View Full Code Here


  private Map<String, Object> getGallerySection(String tag, int tagId, Template tmpl) throws TagNotFoundException {
    List<PreparedGalleryItem> list = imageDao.prepare(imageDao.getGalleryItems(GALLERY_COUNT, tagId));

    ImmutableMap.Builder<String, Object> out = ImmutableMap.builder();
    Section section = sectionService.getSection(Section.SECTION_GALLERY);

    if (tmpl.isSessionAuthorized()) {
      out.put("addGallery", AddTopicController.getAddUrl(section, tag));
    }
View Full Code Here

    return out.build();
  }

  private ImmutableMap<String, Object> getForumSection(@Nonnull String tag, int tagId) throws TagNotFoundException {
    Section forumSection = sectionService.getSection(Section.SECTION_FORUM);

    TopicListDto topicListDto = new TopicListDto();

    topicListDto.setSection(forumSection.getId());
    topicListDto.setCommitMode(TopicListDao.CommitMode.POSTMODERATED_ONLY);

    topicListDto.setTag(tagId);

    topicListDto.setLimit(FORUM_TOPIC_COUNT);
View Full Code Here

    int sectionid,
    String groupName
  ) throws Exception {
    ModelAndView mv = new ModelAndView("view-news-archive");

    Section section = sectionService.getSection(sectionid);
    mv.getModel().put("section", section);

    Group group = null;
    if (groupName!=null) {
      group = groupDao.getGroup(section, groupName);
View Full Code Here

    @RequestParam(value = "offset", defaultValue = "0") int offset,
    @RequestParam(value = "section", defaultValue = "0") int sectionId
  ) throws Exception {
    ModelAndView modelAndView = new ModelAndView("tag-topics");

    Section section;

    if (sectionId!=0) {
      section = sectionService.getSection(sectionId);
      modelAndView.addObject("section", section);
    } else {
View Full Code Here

    if (!permissionService.isDeletable(msg, tmpl.getCurrentUser())) {
      throw new AccessViolationException("Вы не можете удалить это сообщение");
    }

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

    HashMap<String, Object> params = new HashMap<>();
    params.put("bonus", !section.isPremoderated() && !msg.isDraft());
    params.put("author", userDao.getUser(msg.getUid()));
    params.put("msgid", msgid);
    params.put("draft", msg.isDraft());
    params.put("uncommited", section.isPremoderated() && !msg.isCommited());

    return new ModelAndView("delete", params);
  }
View Full Code Here

   * Возвращает последние объекты галереи.
   *
   * @return список GalleryDto объектов
   */
  public List<GalleryItem> getGalleryItems(int countItems) {
    final Section gallery = sectionService.getSection(Section.SECTION_GALLERY);

    String sql = "SELECT t.msgid, t.stat1,t.title, t.userid, t.urlname, images.icon, images.original, images.id AS imageid, t.commitdate " +
            "FROM (SELECT topics.id AS msgid, topics.stat1, topics.title, userid, urlname, topics.commitdate " +
            "FROM topics JOIN groups ON topics.groupid = groups.id WHERE topics.moderate AND section="+Section.SECTION_GALLERY+ " " +
            "AND NOT topics.deleted AND commitdate IS NOT NULL ORDER BY commitdate DESC LIMIT ?) " +
View Full Code Here

   * Возвращает последние объекты галереи.
   *
   * @return список GalleryDto объектов
   */
  public List<GalleryItem> getGalleryItems(int countItems, int tagId) throws TagNotFoundException {
    final Section gallery = sectionService.getSection(Section.SECTION_GALLERY);

    String sql = "SELECT t.msgid, t.stat1,t.title, t.userid, t.urlname, images.icon, images.original, images.id AS imageid, t.commitdate " +
            "FROM (SELECT topics.id AS msgid, topics.stat1, topics.title, userid, urlname, topics.commitdate " +
            "FROM topics JOIN groups ON topics.groupid = groups.id WHERE topics.moderate AND section="+Section.SECTION_GALLERY+ " " +
            "AND NOT topics.deleted AND commitdate IS NOT NULL AND topics.id IN (SELECT msgid FROM tags WHERE tagid=?) ORDER BY commitdate DESC LIMIT ?) " +
View Full Code Here

  ) {
    Template tmpl = Template.getTemplate(request);

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

    Section section = null;
    if (sectionId != 0) {
      section = sectionService.getSection(sectionId);
      modelAndView.addObject("section", section);
      modelAndView.addObject("addlink", AddTopicController.getAddUrl(section));
    }

    response.setDateHeader("Expires", new Date(System.currentTimeMillis() - 20 * 3600 * 1000).getTime());
    response.setDateHeader("Last-Modified", new Date(System.currentTimeMillis() - 120 * 1000).getTime());

    String title;

    switch (sectionId) {
      case Section.SECTION_NEWS:
        title = "Неподтвержденные новости";
        break;
      case Section.SECTION_POLLS:
        title = "Неподтвержденные опросы";
        break;
      case Section.SECTION_GALLERY:
        title = "Неподтвержденные изображения";
        break;
      case 0:
        title = "Просмотр неподтвержденных сообщений";
        break;
      default:
        title = "Неподтвержденные: "+section.getName();
        break;
    }

    modelAndView.addObject("title", title);

View Full Code Here

  ) throws Exception {
    if(cid != null) {
      return jumpMessage(request, msgid, cid);
    }

    Section section = sectionService.getSectionByName(sectionName);

    boolean rss = request.getParameter("output") != null && "rss".equals(request.getParameter("output"));

    if (rss) {
      return getMessageRss(section, request, response, groupName, msgid);
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.