List systemUsers = SystemUserController.getController().getSystemUserVOList(db);
Iterator systemUserListIterator = systemUsers.iterator();
while(systemUserListIterator.hasNext())
{
SystemUserVO systemUser = (SystemUserVO)systemUserListIterator.next();
List<InfoGlueRole> roles = new ArrayList<InfoGlueRole>();
List<RoleVO> roleVOList = RoleController.getController().getRoleVOList(systemUser.getUserName(), db);
for(RoleVO role : roleVOList)
{
InfoGlueRole infoGlueRole = new InfoGlueRole(role.getRoleName(), role.getRoleName(), role.getDescription(), role.getSource(), role.getIsActive(), role.getModifiedDateTime(), this);
roles.add(infoGlueRole);
}
List<InfoGlueGroup> groups = new ArrayList<InfoGlueGroup>();
List<GroupVO> groupVOList = GroupController.getController().getGroupVOList(systemUser.getUserName(), db);
for(GroupVO group : groupVOList)
{
InfoGlueGroup infoGlueGroup = new InfoGlueGroup(group.getGroupName(), group.getGroupName(), group.getDescription(), group.getSource(), group.getGroupType(), group.getIsActive(), group.getModifiedDateTime(), this);
groups.add(infoGlueGroup);
}
InfoGluePrincipal infoGluePrincipal = new InfoGluePrincipal(systemUser.getUserName(), systemUser.getUserName(), systemUser.getFirstName(), systemUser.getLastName(), systemUser.getEmail(), systemUser.getSource(), systemUser.getIsActive(), systemUser.getModifiedDateTime(), roles, groups, new HashMap(), false, this);
users.add(infoGluePrincipal);
}
commitTransaction(db);
}
catch (Exception e)
{
logger.error("An error occurred so we should not complete the transaction:" + e);
rollbackTransaction(db);
throw new SystemException("An error occurred so we should not complete the transaction:" + e, e);
}
}
else
{
List systemUsers = SystemUserController.getController().getSystemUserList(transactionObject);
Iterator systemUserListIterator = systemUsers.iterator();
while(systemUserListIterator.hasNext())
{
SystemUser systemUser = (SystemUser)systemUserListIterator.next();
List<InfoGlueRole> roles = new ArrayList<InfoGlueRole>();
List<RoleVO> roleVOList = RoleController.getController().getRoleVOList(systemUser.getUserName(), transactionObject);
for(RoleVO role : roleVOList)
{
InfoGlueRole infoGlueRole = new InfoGlueRole(role.getRoleName(), role.getRoleName(), role.getDescription(), role.getSource(), role.getIsActive(), role.getModifiedDateTime(), this);
roles.add(infoGlueRole);
}
List<InfoGlueGroup> groups = new ArrayList<InfoGlueGroup>();
List<GroupVO> groupVOList = GroupController.getController().getGroupVOList(systemUser.getUserName(), transactionObject);
for(GroupVO group : groupVOList)
{
InfoGlueGroup infoGlueGroup = new InfoGlueGroup(group.getGroupName(), group.getGroupName(), group.getDescription(), group.getSource(), group.getGroupType(), group.getIsActive(), group.getModifiedDateTime(), this);
groups.add(infoGlueGroup);
}
InfoGluePrincipal infoGluePrincipal = new InfoGluePrincipal(systemUser.getUserName(), systemUser.getUserName(), systemUser.getFirstName(), systemUser.getLastName(), systemUser.getEmail(), systemUser.getSource(), systemUser.getIsActive(), systemUser.getModifiedDateTime(), roles, groups, new HashMap(), false, this);
users.add(infoGluePrincipal);
}
}