Package org.jresearch.gossip.beans.forum

Examples of org.jresearch.gossip.beans.forum.Forum


        try {

            boolean announce = false;
            boolean isUserMod = dao.checkMod(Integer.parseInt(messageForm
                    .getFid()), user);
            Forum currForum = dao.getForumInfo(Integer.parseInt(messageForm
                    .getFid()));

            //      check access rights if forum invisible
            if ((currForum.getLocked() == IConst.Forum.STATUS_INVISIBLE)
                    && (user.getStatus() < Integer.parseInt(Configurator
                            .getInstance().get(IConst.CONFIG.INVADER1)))) { return (mapping
                    .findForward(IConst.TOKEN.DENIED)); }

            //      check access rights if forum topics are locked
            if (((currForum.getLocked() == IConst.Forum.STATUS_TOPICS_LOCKED) && messageForm
                    .getTid().equals(""))
                    && (!isUserMod)) { return (mapping
                    .findForward(IConst.TOKEN.DENIED)); }

            // insert new thread if it is necessary
            if (messageForm.getTid().equals("")) {
                messageForm.setTid(dao.insertNewThread(messageForm.getFid()));

                announce = ((dao.isUserMod(user.getName()) || (user.getStatus() > 7)) && IConst.VALUES.TRUE
                        .equals(messageForm.getAnnounce()));
            }

            // check user access rights if current topic or completely forum is
            // locked
            if ((dao.getThreadInfo(Integer.parseInt(messageForm.getTid()))
                    .getLocked() == IConst.Topic.STATUS_LOCKED || currForum
                    .getLocked() == IConst.Forum.STATUS_COMPLETELY_LOCKED)
                    && (!isUserMod)) { return (mapping
                    .findForward(IConst.TOKEN.DENIED)); }

            // mark username for not registered users
View Full Code Here


                ArrayList forums = ((Group) it.next()).getForums();
                Iterator itr = forums.iterator();

                while (itr.hasNext()) {
                    Forum forum = (Forum) itr.next();
                    StringBuffer option = new StringBuffer("<option value=\"");

                    if (this.addUrl) {
                        StringBuffer href = new StringBuffer(
                                "ShowForum.do?fid=");
                        href.append(forum.getForumid());
                        option.append(response.encodeURL(href.toString()));
                    } else {
                        option.append(forum.getForumid());
                    }

                    option.append("\" title=\"");
                    option.append(HtmlCodec.encode(forum.getTitle()));
                    option.append("\" ");
                    option.append((forum.getForumid() == fid) ? "selected" : "");
                    option.append(" >");
                    option.append(HtmlCodec.encode(forum.getTitle()));
                    option.append("</option>");
                    out.println(option.toString());
                }
            }
        } catch (Exception ex) {
View Full Code Here

        User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
        int fid = Integer.parseInt(pfForm.getFid());

        try {
         
            Forum currForum = dao.getForumInfo(fid);

            //check access rights if forum invisible
            if ((currForum.getLocked() == IConst.Forum.STATUS_INVISIBLE) &&
                    (user.getStatus() < Integer.parseInt(
                        Configurator.getInstance().get(IConst.CONFIG.INVADER1)))) {
                return (mapping.findForward(IConst.TOKEN.DENIED));
            }
View Full Code Here

                int id = Integer.parseInt(fid);
                recordsData = dao.getLastTopics(id,
                        Integer.parseInt(Configurator.getInstance().get(IConst.CONFIG.RSS_MAX_ITEM_COUNT)),
                        cl.getTime());

                Forum currForum = dao.getForumInfo(id);
                currForum.setForumid(id);
                request.setAttribute(IConst.REQUEST.CURR_FORUM, currForum);
                forward = "rss_forum_page";
            }

            //TODO - set pubDate
View Full Code Here

    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    int fid = Integer.parseInt(ptForm.getFid());
    int tid = Integer.parseInt(ptForm.getFid());
    try {
     
      Forum currForum = dao.getForumInfo(fid);
      //      check access rights if forum invisible
      if ((currForum.getLocked() == IConst.Forum.STATUS_INVISIBLE)
          && (user.getStatus() < Integer.parseInt(Configurator
              .getInstance().get(IConst.CONFIG.INVADER1)))) {
        return (mapping.findForward(IConst.TOKEN.DENIED));
      }
      request.setAttribute(IConst.REQUEST.CURR_FORUM, currForum);
View Full Code Here

    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    try {
     
      int fid = Integer.parseInt(pmForm.getFid());
      boolean isUserMod = dao.checkMod(fid, user);
      Forum currForum = dao.getForumInfo(fid);
      //      check access rights if forum invisible
      getServlet().log("check access rights if forum invisible");
      if ((currForum.getLocked() == IConst.Forum.STATUS_INVISIBLE)
          && (user.getStatus() < Integer.parseInt(Configurator
              .getInstance().get(IConst.CONFIG.INVADER1)))) {
        return (mapping.findForward(IConst.TOKEN.DENIED));
      }
      Topic currThread = dao.getThreadInfo(Integer.parseInt(pmForm
          .getTid()));
      // check user access rights if current topic or completely forum is
      // locked
      getServlet()
          .log(
              "check user access rights if current topic or completely forum is locked");
      if (((currThread.getLocked() == IConst.Topic.STATUS_LOCKED) || (currForum
          .getLocked() == IConst.Forum.STATUS_COMPLETELY_LOCKED))
          && (!isUserMod)) {
        return (mapping.findForward(IConst.TOKEN.DENIED));
      }
      session.setAttribute(IConst.REQUEST.CURR_THREAD, currThread);
View Full Code Here

        ProcessForumForm pfForm = (ProcessForumForm) form;

        try {
           

            Forum forum = dao.getForumInfo(Integer.parseInt(pfForm.getFid()));
            ForumForm forumForm = new ForumForm();
            forumForm.setForum_desc(forum.getDescription());
            forumForm.setForum_name(forum.getTitle());
            forumForm.setForumid(pfForm.getFid());
            forumForm.setGroupid(Integer.toString(forum.getGroupid()));
            forumForm.setForum_sort(forum.getSort());
            request.setAttribute("forumForm", forumForm);
        } catch (SQLException sqle) {
            getServlet().log("Connection.process", sqle);
            throw new SystemException(sqle);
        }
View Full Code Here

        try {
           

            boolean isUserMod = dao.checkMod(Integer.parseInt(
                        messageForm.getFid()), user);
            Forum currForum = dao.getForumInfo(Integer.parseInt(
                        messageForm.getFid()));

            //      check access rights if forum invisible
            if ((currForum.getLocked() == IConst.Forum.STATUS_INVISIBLE) &&
                    (user.getStatus() < Integer.parseInt(
                        Configurator.getInstance().get(IConst.CONFIG.INVADER1)))) {
                return (mapping.findForward(IConst.TOKEN.DENIED));
            }

            Topic currThread = dao.getThreadInfo(Integer.parseInt(
                        messageForm.getTid()));

            // check user access rights if current topic or completely forum is locked
            if (((currThread.getLocked() == IConst.Topic.STATUS_LOCKED) ||
                    (currForum.getLocked() == IConst.Forum.STATUS_COMPLETELY_LOCKED)) &&
                    (!isUserMod)) {
                return (mapping.findForward(IConst.TOKEN.DENIED));
            }

            Message mess = dao.getMessage(messageForm.getMid());
View Full Code Here

    public Forum getForumInfo(int forumid) throws SQLException {
        Connection connection = this.dataSource.getConnection();
        PreparedStatement st = connection.prepareStatement(dbDriver
                .getQueries().getForumQueries().getSql_FORUM_INFO());
        ResultSet rs = null;
        Forum _forum = new Forum();

        try {
            st.setInt(1, forumid);
            rs = (ResultSet) st.executeQuery();

            if (rs.next()) {
                _forum.setLocked(rs.getInt("locked"));
                _forum.setTitle(rs.getString("forumtitle"));
                _forum.setDescription(rs.getString("forumdesc"));
                _forum.setSort(rs.getString("forum_sort"));
                _forum.setGroupid(rs.getInt("groupid"));
            }

            return _forum;
        } finally {
            if (rs != null) {
View Full Code Here

        try {
            st.setInt(1, group.getGroupid());
            rs = (ResultSet) st.executeQuery();

            while (rs.next()) {
                Forum forum = new Forum();
                forum.setDescription(rs.getString("forumdesc"));
                forum.setForumid(rs.getInt("forumid"));
                forum.setLocked(rs.getInt("locked"));
                forum.setTitle(rs.getString("forumtitle"));

                if (filled) {
                    forum.setThreadsCount(countForumTopics(forum.getForumid(),
                            st3));
                    setLastMessage(forum, st2);
                }

                group.addForum(forum);
View Full Code Here

TOP

Related Classes of org.jresearch.gossip.beans.forum.Forum

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.