Examples of SystemUserImpl


Examples of org.infoglue.cms.entities.management.impl.simple.SystemUserImpl

   *   Get the SystemUser with the userName
   */
  
  public SystemUserImpl getSystemUserWithName(String userName, Database dbthrows SystemException, Bug, Exception
  {
    SystemUserImpl systemUser = (SystemUserImpl)db.load(org.infoglue.cms.entities.management.impl.simple.SystemUserImpl.class, userName);
      //logger.warn("found one systemUser:" + systemUser.getFirstName());
     
    return systemUser;   
  }
View Full Code Here

Examples of org.infoglue.cms.entities.management.impl.simple.SystemUserImpl

      {
        logger.error("Error generating password:" + e.getMessage());
      }
    }
     
      SystemUser systemUser = new SystemUserImpl();
        systemUser.setValueObject(systemUserVO);
        systemUser = (SystemUser) createEntity(systemUser);
        return systemUser.getValueObject();
    }    
View Full Code Here

Examples of org.infoglue.cms.entities.management.impl.simple.SystemUserImpl

      {
        logger.error("Error generating password:" + e.getMessage());
      }
    }
   
      SystemUser systemUser = new SystemUserImpl();
        systemUser.setValueObject(systemUserVO);
        systemUser = (SystemUser) createEntity(systemUser, db);
       
        return systemUser;
    }    
View Full Code Here

Examples of org.infoglue.cms.entities.management.impl.simple.SystemUserImpl

      {
          logger.info("Changing user name for user: '" + userName + "' to '" + newUserName + "'");

          SystemUserVO newSystemUserVO = user.getValueObject();
          newSystemUserVO.setUserName(newUserName);
          SystemUser newSystemUser = new SystemUserImpl();
          newSystemUser.setValueObject(newSystemUserVO);
          newSystemUser = (SystemUser) createEntity(newSystemUser, db);

          // Add roles
          List<RoleVO> roleVOs = RoleController.getController().getRoleVOList(userName, db);
          logger.info("Adding roles in user name change. Number of roles: " + roleVOs.size());
          for (RoleVO roleVO : roleVOs)
          {
            if (logger.isDebugEnabled())
            {
              logger.debug("Handling role (" + roleVO.getRoleName() + ") in user name change. User name, from: '" + userName + "', to '" + newUserName + "'");
            }
            RoleController.getController().addUser(roleVO.getRoleName(), newSystemUser.getUserName(), db);
            RoleController.getController().removeUser(roleVO.getRoleName(), userName, db);
          }

          // Add groups
          List<GroupVO> groupVOs = GroupController.getController().getGroupVOList(userName, db);
          logger.info("Adding groups in user name change. Number of groups: " + groupVOs.size());
          for (GroupVO groupVO : groupVOs)
          {
            if (logger.isDebugEnabled())
            {
              logger.debug("Handling group (" + groupVO.getGroupName() + ") in user name change. User name, from: '" + userName + "', to '" + newUserName + "'");
            }
            GroupController.getController().addUser(groupVO.getGroupName(), newSystemUser.getUserName(), db);
            GroupController.getController().removeUser(groupVO.getGroupName(), userName, db);
          }

          // Add access rights
          @SuppressWarnings("unchecked")
      List<AccessRightUser> accessRightUserList = AccessRightController.getController().getAccessRightUserList(userName, db);

          logger.debug("Updating access rights for user name change. Number of access rights: " + accessRightUserList.size());
          Iterator<AccessRightUser> i = accessRightUserList.iterator();
        while(i.hasNext())
          {
              AccessRightUser accessRightUser = i.next();
              //accessRightUser.setUserName(newUserName);
              AccessRight accessRight = accessRightUser.getAccessRight();

          AccessRightUserVO accessRightUserVO = new AccessRightUserVO();
          accessRightUserVO.setUserName(newSystemUser.getUserName());
          AccessRightUser newAccessRightUser = AccessRightController.getController().createAccessRightUser(db, accessRightUserVO, accessRight);
          accessRight.getUsers().add(newAccessRightUser);

          deleteEntity(AccessRightUserImpl.class, accessRightUser.getAccessRightUserId(), db);
          }
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.