Package org.nemesis.forum

Examples of org.nemesis.forum.Forum


    } else
      throw new UnauthorizedException();
  }

  public Forum getForum() {
    Forum forum = thread.getForum();
    return new ForumProxy(forum, authorization, permissions);
  }
View Full Code Here


    //Dummy call to super-class. This specialized iterator proxy doesn't
    //use the superclass like the other iterators do.
    super(iterator, authorization, permissions);

    while (iterator.hasNext()) {
      Forum forum = (Forum) iterator.next();
      ForumPermissions forumPermissions = forum.getPermissions(authorization);
      //Create a new permissions object with the combination of the
      //permissions of this object and tempPermissions.
      //Check and see if the user has READ permissions. If not, throw an
      //an UnauthorizedException.
      if (forumPermissions.get(Constants.SYSTEM_ADMIN)
View Full Code Here

    }

    try {

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      Forum forum = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
      //check permission
      checkPermission(request, OperationConstants.EDIT_MESSAGE,forum);

     
      //first, populate
      if (request.getParameter("messageBean.subject") == null) {
        MessageBean mb = new MessageBean();
        Message m =forum.getThread(Integer.parseInt(request.getParameter("threadID"))).getMessage(Integer.parseInt(request.getParameter("messageID")));

       
        mb.setForumID( Integer.parseInt(request.getParameter("id")));
        mb.setThreadID( Integer.parseInt(request.getParameter("threadID")));
        mb.setMessageID( m.getID());
        mb.setSubject( m.getSubject());
        mb.setContent( m.getBody());
       
        PropertyUtils.setProperty(form, "messageBean", mb);
        return mapping.findForward("view");
      }
     
      //save
      MessageBean mb = (MessageBean) PropertyUtils.getSimpleProperty(form, "messageBean");
      Message m =forum.getThread(mb.getThreadID()).getMessage(mb.getMessageID());
      m.setSubject(mb.getSubject());
      m.setBody(mb.getContent());
     

    } catch (NumberFormatException aee) {
View Full Code Here

    try {

      List v = new Vector();

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      Forum forum = forumFactory.getForum(Integer.parseInt(request.getParameter("id")));
      //check permission
      checkPermission(request, OperationConstants.LIST_FORUM_CONTENT, forum);

      ForumBean fb = new ForumBean();
      fb.setId(forum.getID());
      fb.setName(forum.getName());
      //fb.setApprovedMessages();
      //fb.setApprovedThreads();
      //fb.setThreads(forum.getThreadCount());
      //fb.setMessages(forum.getMessageCount());
      request.setAttribute("fb", fb);

      ForumThread thread = forum.getThread(Integer.parseInt(request.getParameter("threadID")));
      ThreadBean tb = new ThreadBean();
      tb.setId(thread.getID());
      tb.setForumID(forum.getID());
      tb.setCreationDate(thread.getCreationDate());
      tb.setModifiedDate(thread.getModifiedDate());
      tb.setApproved(thread.isApproved());
     
      tb.setNotApprovedMessages(thread.getMessageCount(false));
View Full Code Here

    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.ADD_USER_PERMISSION, forum);
     
      ProfileManager manager = forumFactory.getProfileManager();
     
      User user =null;
      if(! "null".equals(request.getParameter("ou")) ){
        user = manager.getUser(Integer.parseInt(request.getParameter("ou")));
      }else{
        user = manager.getUser(request.getParameter("actor"));
      }
     
     
      int perm=Integer.parseInt(request.getParameter("type"));
      if(perm==Constants.FORUM_ADMIN && ! SecurityTools.isSystemAdmin(getAuthToken(request))){
         throw new UnauthorizedException();
      }

      forum.addUserPermission(user, perm);
     
    } catch (NotFoundException e) {
      errors.add("general", new ActionError("forumPermission.NotFound"));
    } catch (UnauthorizedException ue) {
      errors.add("general", new ActionError("forumPermission.Unauthorized"));
View Full Code Here

    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.DELETE_THREAD, forum);

      forum.deleteThread(forum.getThread( Integer.parseInt(request.getParameter("threadID"))));

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

TOP

Related Classes of org.nemesis.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.