Package org.nemesis.forum

Examples of org.nemesis.forum.ForumThread


  public ForumThreadIteratorProxy(Iterator iterator, Authorization authorization, ForumPermissions permissions) {
    super(iterator, authorization, permissions);
  }

  public Object next() throws NoSuchElementException {
    ForumThread thread = (ForumThread) iterator.next();
    return new ForumThreadProxy(thread, authorization, permissions);
  }
View Full Code Here


    ForumFactory forumFactory = ForumFactory.getInstance(auth);
    if(! forumFactory.getPermissions(auth).get(Constants.SYSTEM_ADMIN)) throw new UnauthorizedException();
    //ok system admin
    flush(auth);
    Forum f=null;
    ForumThread ft=null;
    for(Iterator it=forumFactory.forums();it.hasNext();){
      f=(Forum)it.next();
      for(Iterator it2=f.threads();it2.hasNext();){
        ft=(ForumThread)it2.next();
        index(ft.getRootMessage());
      }
    }
   
   
  }
View Full Code Here

    cacheManager.remove(DbCacheManager.FORUM_ID_CACHE, forum.getName());

    //Delete all messages and threads in the forum.
    Iterator threads = forum.threads();
    while (threads.hasNext()) {
      ForumThread thread = (ForumThread) threads.next();
      forum.deleteThread(thread);
    }

    //Now, delete all filters associated with the forum. We delete in
    //reverse order since filter indexes will change if we don't delete
View Full Code Here

    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()) {
            try {
              Message message = (Message) messages.next();
              if (/*message.getSubject() == null ||*/
                message.getBody() == null) {
               
                thread.deleteMessage(message);
              }
            } catch (Exception me) {
              log.error("",me);
            }
          }
View Full Code Here

  public boolean hasPrevious() {
    return (currentIndex > 0);
  }

  public Object next() throws java.util.NoSuchElementException {
    ForumThread thread = null;
    currentIndex++;
    if (currentIndex >= threads.length) {
      currentIndex--;
      throw new java.util.NoSuchElementException();
    }
View Full Code Here

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

  public Object previous() throws java.util.NoSuchElementException {
    ForumThread thread = null;
    currentIndex--;
    if (currentIndex < 0) {
      currentIndex++;
      throw new java.util.NoSuchElementException();
    }
View Full Code Here

    return forum.propertyNames();
  }

  public ForumThread createThread(Message rootMessage) throws UnauthorizedException {
    if (permissions.get(Constants.CREATE_THREAD)) {
      ForumThread thread = forum.createThread(rootMessage);
      return new ForumThreadProxy(thread, authorization, permissions);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

      throw new UnauthorizedException();
    }
  }

  public ForumThread getThread(int threadID) throws ForumThreadNotFoundException {
    ForumThread thread = forum.getThread(threadID);
    //Apply protection proxy and return.
    return new ForumThreadProxy(thread, authorization, permissions);
  }
View Full Code Here

        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) {
      String eid=this.getClass().getName()+"_"+System.currentTimeMillis();
      log.error("eid:"+eid +"\nsessionID" +request.getSession().getId(),e;     
View Full Code Here

      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);
     

    } catch (ForumNotFoundException e) {
      errors.add("general", new ActionError("content.forumNotFound"));
    } catch (ForumThreadNotFoundException e) {
View Full Code Here

TOP

Related Classes of org.nemesis.forum.ForumThread

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.