Package org.nemesis.forum

Examples of org.nemesis.forum.ProfileManager


   
    try {
       
       
        ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
        ProfileManager manager = forumFactory.getProfileManager();
        User user = manager.getUser(getAuthToken(request).getUserID());
         
        Group group = manager.getGroup(request.getParameter("group"));
        request.setAttribute("id",group.getID()+"";
        User  u = manager.getUser(request.getParameter("username"));
        // add user as an administrator of the group
        group.removeAdministrator(u);
         
       
    } catch (NotFoundException e) {
View Full Code Here


   
    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

   
    try {
        try {
         
          ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
          ProfileManager manager = forumFactory.getProfileManager();
          User u = manager.getUser(Integer.parseInt(request.getParameter("id")));
          manager.deleteUser(u);
          errors.add("general"new ActionError("delUser.confirm"));
         
        }
        catch( NotFoundException fnfe ) {
          errors.add("general"new ActionError("delUser.notFound"));         
View Full Code Here

   
    try {
       
       
        ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
        ProfileManager manager = forumFactory.getProfileManager();
        User user = manager.getUser(getAuthToken(request).getUserID());
         
        Group group = manager.getGroup((String)PropertyUtils.getSimpleProperty(form, "group"));
        request.setAttribute("id",group.getID()+"";
        User  u = manager.getUser((String)PropertyUtils.getSimpleProperty(form, "username"));
        //check permission
        checkPermission(request,OperationConstants.ADD_GROUP_MEMBER,group);
        // add user as an administrator of the group
        group.addMember(u);
       
View Full Code Here

      }

      List v = new Vector();

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      ProfileManager manager = forumFactory.getProfileManager();

      Iterator userIterator = null;
      if (request.getParameter("query") != null) {

        //::TODO::search, not very nice
        String query = request.getParameter("query");
        userIterator = manager.users();
        List tempListe = new ArrayList();
        User userTemp = null;
        int c = 0;
        while (userIterator.hasNext()) {
          userTemp = (User) userIterator.next();
          if (userTemp.getName().toLowerCase().indexOf(query.toLowerCase()) > -1
            || userTemp.getUsername().toLowerCase().indexOf(query.toLowerCase()) > -1
            || userTemp.getEmail().toLowerCase().indexOf(query.toLowerCase()) > -1) {
            //match
            if(c >= start && c<(start+maxPageItems)){
              tempListe.add(userTemp);
            }
            c++;
           
          }
        }
        userIterator = tempListe.iterator();
        request.setAttribute("nbItems", new Integer(c));
        request.setAttribute("query", query);
      } else {
        userIterator = manager.users(start, maxPageItems);
        request.setAttribute("nbItems", new Integer(manager.getUserCount()));
      }
      //populate
      String temp = null;
      UserBean ub = null;
      User user = null;
View Full Code Here

    
    try {
         
       
        ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
        ProfileManager manager = forumFactory.getProfileManager();
        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());
View Full Code Here

    }

    try {

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      ProfileManager manager = forumFactory.getProfileManager();
      User user = manager.getUser(getAuthToken(request).getUserID());
      try {
        UserBean ub = (UserBean) PropertyUtils.getProperty(form, "userBean");
        User u = manager.createUser(ub.getUserName(), ub.getPassword(), ub.getEmail());
        u.setEmailVisible(ub.isEmailVisible());
        u.setName(ub.getName());
        u.setNameVisible(ub.isNameVisible());

        //properties
View Full Code Here

    }

    try {

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      ProfileManager manager = forumFactory.getProfileManager();
      User user = manager.getUser(getAuthToken(request).getUserID());
      try {

        //retrieve the user
        User u = manager.getUser(getUser(request));

        //first, populate
        if (request.getParameter("userBean.userName") == null) {
          UserBean ub = new UserBean();
          ub.setId(u.getID());
View Full Code Here

      }

      List v = new Vector();

      ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
      ProfileManager manager = forumFactory.getProfileManager();

      Iterator forumIterator = null;
      if (request.getParameter("query") != null) {

        // ::TODO::search, not very nice
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_USER_PERMISSION, forum);
     
      ProfileManager manager = forumFactory.getProfileManager();
      User user = manager.getUser( Integer.parseInt(request.getParameter("actor")));
       
 
      int perm=Integer.parseInt(request.getParameter("type"));
      if(perm==Constants.FORUM_ADMIN && ! SecurityTools.isSystemAdmin(getAuthToken(request))){
         throw new UnauthorizedException();
View Full Code Here

TOP

Related Classes of org.nemesis.forum.ProfileManager

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.