Package ru.org.linux.group

Examples of ru.org.linux.group.Group


    @RequestParam("resolve") String resolved
  ) throws Exception {
    Template tmpl = Template.getTemplate(request);

    Topic message = messageDao.getById(msgid);
    Group group = groupDao.getGroup(message.getGroupId());
    User currentUser = tmpl.getCurrentUser();
    if (!group.isResolvable()) {
      throw new AccessViolationException("В данной группе нельзя помечать темы как решенные");
    }

    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("Not authorized");
View Full Code Here


    }

    Map<String, Object> params = new HashMap<>();
    params.putAll(prepareModel(form, tmpl.getCurrentUser()));

    Group group = form.getGroup();

    if (tmpl.isSessionAuthorized() && !groupPermissionService.isTopicPostingAllowed(group, tmpl.getCurrentUser())) {
      ModelAndView errorView = new ModelAndView("errors/good-penguin");
      errorView.addObject("msgHeader", "Недостаточно прав для постинга тем в эту группу");
      errorView.addObject("msgMessage", groupPermissionService.getPostScoreInfo(group));
View Full Code Here

  }

  private ImmutableMap<String, Object> prepareModel(AddTopicRequest form, User currentUser) {
    ImmutableMap.Builder<String, Object> params = ImmutableMap.builder();

    Group group = form.getGroup();

    if (group!=null) {
      params.put("group", group);
      params.put("postscoreInfo", groupPermissionService.getPostScoreInfo(group));
      Section section = sectionService.getSection(group.getSectionId());

      params.put("section", section);

      String addInfo = sectionService.getAddInfo(group.getSectionId());

      if (addInfo!=null) {
        params.put("addportal", addInfo);
      }
View Full Code Here

    Template tmpl = Template.getTemplate(request);
    HttpSession session = request.getSession();

    String image = processUploadImage(request);

    Group group = form.getGroup();

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

    params.putAll(prepareModel(form, tmpl.getCurrentUser()));

    Section section = null;

    if (group!=null) {
      section = sectionService.getSection(group.getSectionId());
    }

    User user = postingUser(tmpl, form);

    user.checkBlocked(errors);
View Full Code Here

          @PathVariable("id") int msgid,
          @RequestParam(value = "page", defaultValue = "0") int page,
          HttpServletRequest request
  ) throws Exception {
    Topic topic = topicDao.getById(msgid);
    Group group = groupDao.getGroup(topic.getGroupId());
    Section section = sectionService.getSection(group.getSectionId());

    if (!section.getUrlName().equals(sectionName)
            || !group.getUrlName().equals(groupName)
            || page<0 ) {
      throw new MessageNotFoundException(msgid);
    }

    permissionService.checkView(group, topic, AuthUtil.getCurrentUser(), false);
View Full Code Here

          boolean secure,
          User user,
          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;
View Full Code Here

    userAgent = 0;
    this.postIP = postIP;

    guid = form.getGroup().getId();

    Group group = form.getGroup();

    if (form.getLinktext()!=null) {
      linktext = StringUtil.escapeHtml(form.getLinktext());
    } else {
      linktext = null;
    }

    // url check
    if (!Strings.isNullOrEmpty(form.getUrl())) {
      url = URLUtil.fixURL(form.getUrl());
    } else {
      url = null;
    }

    // Setting Message fields
    if (form.getTitle()!=null) {
      title = StringUtil.escapeHtml(form.getTitle());
    } else {
      title = null;
    }

    sectionid = group.getSectionId();
    // Defaults
    msgid = 0;
    postscore = 0;
    sticky = false;
    deleted = false;
View Full Code Here

    if (msg.isDeleted()) {
      throw new AccessViolationException("Сообщение удалено");
    }

    Group newGrp = groupDao.getGroup(newgr);

    if (msg.getGroupId()!=newGrp.getId()) {
      messageDao.moveTopic(msg, newGrp, tmpl.getCurrentUser());
    }

    return new RedirectView(TopicLinkBuilder.baseLink(msg).forceLastmod().build());
  }
View Full Code Here

      redirectLink
        .append(topicListForm.getYear())
        .append('/')
        .append(topicListForm.getMonth());
    } else if (groupId>0) {
      Group group = groupDao.getGroup(groupId);
      redirectLink
        .append(group.getUrlName())
        .append('/');
    }

    String queryStr = topicListForm.getOffset() == null ?
        "" :
View Full Code Here

    }

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

    Group group = null;
    if (groupId != 0) {
      group = groupDao.getGroup(groupId);
      ptitle += " - " + group.getTitle();
    }

    checkRequestConditions(section, group, topicListForm);

    ModelAndView modelAndView = new ModelAndView("section-rss");
View Full Code Here

TOP

Related Classes of ru.org.linux.group.Group

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.