Package edu.uga.galileo.voci.bo

Examples of edu.uga.galileo.voci.bo.User


    }

    // if no errors occurred update role record
    if ((!isErrors) && (fieldMessages.size() == 0)) {
      try {
        User sessionUser = (User) request.getSession().getAttribute(
            "user");
        roleManager.updateRole(new ProjectManager().getProject(command
            .getProject()), sessionUser, role, oldContent);
        // if update was successful send messages....
        request.setAttribute("successMessage",
View Full Code Here


   * @see javax.servlet.http.HttpSessionListener#sessionDestroyed(javax.servlet.http.HttpSessionEvent)
   */
  public void sessionDestroyed(HttpSessionEvent arg0) {
    HttpSession session = arg0.getSession();
    if (session.getAttribute("user") != null) {
      User user = (User) session.getAttribute("user");
      ContentLockManager.unlockAllUserContent(user);
      session.setAttribute("user", null);
    }
    SessionTracker.removeSession(session);
  }
View Full Code Here

   *            The userId.
   * @return The user object.
   */
  public User getUserById( int userId, Command command ) throws NoSuchUserException, NoSuchRoleException
  {
    User user = new User();
    RoleManager roleManager = new RoleManager();
    ArrayList<String> fullListRoleNames = new ArrayList<String>();
    String[] roleNames = null;
    try
    {
      user = udao.getUserByUserId(userId);
      // set full role list and list of roles attached to user
      fullListRoleNames = roleManager.getFullListRoleNames(new ProjectManager().getProjectID(command.getProject()));
      roleNames = (String[]) fullListRoleNames.toArray(new String[fullListRoleNames.size()]);
      user.setfullListRoleNames(roleNames);
      user.setRoles(roleManager.getRolesByUserId(userId));
    }
    catch( NoSuchRoleException noRoleEx )
    {
      Logger.error("\n Couldn't set full roles list for user... \n", noRoleEx);
      throw new NoSuchRoleException("Couldn't find full roles list");
View Full Code Here

   *
   */
  public boolean isUserExist( String userName )
  {
    boolean isUser = true;
    User testUser = null;

    try
    {
      testUser = udao.getUserByUserName(userName);
      if (testUser == null)
View Full Code Here

   * @param user
   *            The {@link edu.uga.galileo.voci.bo.User} object being updated.
   */
  public void addUser( User adminUser, User user, int projectId ) throws NoSuchUserException, RoleUpdateAddException
  {
    User user2 = new User();
    try
    {
      udao.addNewUser(user);
      // get user id for the user just added
      if (user.getRoles() != null)
      {
        user2 = udao.getUserByUserName(user.getUserName().toLowerCase());
        user.setUserId(user2.getUserId());
        new RoleManager().addRole2User(user);
      }

      AuditLogManager alm = new AuditLogManager();
      alm.addRecord(projectId, ContentType.USER, user.getUserId(), adminUser.getUserName(), "{New User created}");
View Full Code Here

   *             database.
   */
  public User getUser( String username, String password ) throws NoSuchUserException, PasswordFailureException,
      InactiveUserException
  {
    User user = udao.getUser(username, password);
    try
    {
      ArrayList<String> projects = DAOFactory.getProjectDAO().getProjectList();
      if ((projects != null) && (projects.size() > 0))
      {
        for( String project : projects )
        {
          user.addAdminRoles(project, udao.getUserAdminRoles(user, project));
        }
      }
    }
    catch( NoAvailableDAOException e )
    {
      Logger.fatal("Couldn't get a project DAO: User will have no admin rights.", e);
    }
    user.setIsSysAdmin(udao.isSysAdmin(user));
    user.setUserPreferences(udao.getUserPreferences(user));

    return user;
  }
View Full Code Here

      if (!(((User) vboToSessionMap.get(key).getAttribute("user"))
          .getUserId() == (((User) session.getAttribute("user")))
          .getUserId())) {
        Logger.debug("another user has the lock");
        HttpSession otherSession = vboToSessionMap.get(key);
        User otherUser = (User) otherSession.getAttribute("user");
        throw new ContentLockedException(
            "The requested content is locked to user "
                + otherUser.getUserName()
                + " ("
                + (((otherUser.getFirstName() == null) || (otherUser
                    .getFirstName().trim().length() == 0)) ? "NoFirstName"
                    : otherUser.getFirstName())
                + " "
                + (((otherUser.getLastName() == null) || (otherUser
                    .getLastName().trim().length() == 0)) ? "NoLastName"
                    : otherUser.getLastName())
                + " ... "
                + (((otherUser.getEmail() == null) || (otherUser
                    .getEmail().trim().length() == 0)) ? "NoEmail"
                    : otherUser.getEmail())
                + "/"
                + (((otherUser.getPhone() == null) || (otherUser
                    .getPhone().trim().length() == 0)) ? "NoPhone"
                    : otherUser.getPhone()) + ")");
      } else {
        Logger.debug("user already has lock");
      }
    } else {
      Logger.debug("adding lock");
View Full Code Here

TOP

Related Classes of edu.uga.galileo.voci.bo.User

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.