Examples of Forum


Examples of org.nemesis.forum.Forum

    boolean isUser = !isAnonymous;

    ForumPermissions finalPermissions = ForumPermissions.none();
    // check each forum for a specific permission
    Iterator allForums = this.forums();
    Forum forum;
    ForumPermissions forumUserPermissions;
    while (allForums.hasNext()) {
      forum = (Forum) allForums.next();
      forumUserPermissions = getUserPermissions(userID, forum.getID());
      finalPermissions = new ForumPermissions(finalPermissions, forumUserPermissions);
    }

    //Step 1 - Get permissions for the User. This includes anonymous
    //perms, "special user" perms, and the specific perms for the user.
View Full Code Here

Examples of org.nemesis.forum.Forum

   */
  public void cleanDatabase() {
    //Iterate through all forums, threads to delete unwanted messages.
    Iterator forums = forums();
    while (forums.hasNext()) {
      Forum forum = (Forum) forums.next();
      Iterator threads = forum.threads();
      while (threads.hasNext()) {
        try {
          ForumThread thread = (ForumThread) threads.next();
          Iterator messages = thread.messages();
          while (messages.hasNext()) {
View Full Code Here

Examples of org.nemesis.forum.Forum

  /**
   * Returns the next Forum the user has READ access for.
   */
  public Object next() throws NoSuchElementException {
    Forum forum = null;
    currentIndex++;
    if (currentIndex >= forums.length) {
      throw new java.util.NoSuchElementException();
    }
    try {
View Full Code Here

Examples of org.nemesis.forum.Forum

  public int nextIndex() {
    return currentIndex + 1;
  }

  public Object previous() throws NoSuchElementException {
    Forum forum = null;
    currentIndex--;
    if (currentIndex < 0) {
      currentIndex++;
      throw new NoSuchElementException();
    }
View Full Code Here

Examples of org.nemesis.forum.Forum

    try {
        try {
         
          ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
          ProfileManager manager = forumFactory.getProfileManager();
          Forum f = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
          forumFactory.deleteForum(f);
         
          errors.add("general"new ActionError("delForum.confirm"));
         
        }
View Full Code Here

Examples of org.nemesis.forum.Forum

   
    ActionErrors errors = new ActionErrors();
   
    try {
        ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
        Forum forum = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
        //check permission
        checkPermission(request,OperationConstants.LIST_FORUM_CONTENT,forum);
       
        ForumThread t=forum.getThread(Integer.parseInt(request.getParameter("threadID")));
        t.setApproved(!t.isApproved());
        t.getRootMessage().setApproved(t.isApproved());
       
       
    } catch (Exception e) {
View Full Code Here

Examples of org.nemesis.forum.Forum

    ActionErrors errors = new ActionErrors();

    try {

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      Forum forum = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
      request.setAttribute("id", request.getParameter("id"));
      //check permission
      checkPermission(request, OperationConstants.EDIT_FORUM_FILTER, forum);
     
      MessageFilter filter= forum.getForumMessageFilters()[Integer.parseInt(request.getParameter("edit"))];
      Enumeration props = filter.getFilterPropertyNames();
      while( props.hasMoreElements() ) {
        String propName = (String)props.nextElement();
        String propValue = request.getParameter(propName);
        if( propValue != null ) {
View Full Code Here

Examples of org.nemesis.forum.Forum

    ActionErrors errors = new ActionErrors();
    boolean isRootmessage=false;
    try {

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      Forum forum = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
      request.setAttribute("id", request.getParameter("id"));
      //check permission
      checkPermission(request, OperationConstants.DELETE_MESSAGE, forum);
     
      ForumThread t=forum.getThread( Integer.parseInt(request.getParameter("threadID")));
      Message m=t.getMessage( Integer.parseInt(request.getParameter("messageID")));
     
      if(t.getRootMessage().getID()==(m.getID()))isRootmessage=true;
     
      t.deleteMessage(m);
View Full Code Here

Examples of org.nemesis.forum.Forum

        User user = manager.getUser(getAuthToken(request).getUserID());
        try {
         
          ForumBean fb=(ForumBean)PropertyUtils.getProperty(form, "forumBean");
          ForumFactory ff =ForumFactory.getInstance(getAuthToken(request));
          Forum f =ff.createForum(fb.getName(),fb.getDescription());
         
          //ForumPermissions permissions = forumFactory.getPermissions(getAuthToken(request));
          //boolean isSystemAdmin = permissions.get(ForumPermissions.SYSTEM_ADMIN);
          //boolean isUserAdmin   = permissions.get(ForumPermissions.FORUM_ADMIN);
         
          //f.addUserPermission(user,Constants.FORUM_ADMIN);
          f.addUserPermission(user,Constants.READ);
          f.addUserPermission(user,Constants.MODERATOR);
          f.addUserPermission(user,Constants.CREATE_THREAD);
          f.addUserPermission(user,Constants.CREATE_MESSAGE);
          f.addUserPermission(user,Constants.FORUM_ADMIN);
          //if(SecurityTools.isSystemAdmin(getAuthToken(request)))
          //f.addUserPermission(user,Constants.SYSTEM_ADMIN);
         
          f.setModerationType(fb.getModerationType());
         
          //properties
          String temp=null;
          for(Iterator it=fb.getProperties().keySet().iterator();it.hasNext();){
            temp=(String)it.next();
            f.setProperty(temp,(String)fb.getProperties().get(temp));
          }
         
         
        }
        catch( AlreadyExistsException aee ) {
View Full Code Here

Examples of org.nemesis.forum.Forum

            + " in DbForumMessage.getForumThread()."
            + " You may wish to delete the message from your database.");
        return null;
      }

      Forum forum = null;
      ForumThread thread = null;
      try {
        forum = factory.getForum(forumID);
        //Now, get the thread
        thread = forum.getThread(threadID);
      } catch (Exception e) {
        log.error("",e);
        return null;
      }
      this.thread = thread;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.