cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract user id and full name from the wtgroups

RajeshBalasunda
1-Newbie

How to extract user id and full name from the wtgroups


We have users created in different groups based on their sites. I would like to extract their user id and their full name from each of these groups. I tried to do this with the report manager (8.0 M020) but I am not able to get theresultsprobably becuasethere is no relationship between the wtuser and wtgroup in the database. Does anyone know how I can extract this information otherwise.

Regards,

Rajesh Balasundaram

2 REPLIES 2

Hi Rajesh,

With the following java code you can get the groups and users information.

WTOrganization wtorg = WTOrganization.newWTOrganization("<org name=">");
DirectoryContextProvider directoryContextProvider = (DirectoryContextProvider) wtorg;

Enumeration windchillGroups = OrganizationServicesHelper.manager.findLikeGroups("*", directoryContextProvider);
while (windchillGroups.hasMoreElements()) {
WTGroup wtgroup = (WTGroup) windchillGroups.nextElement();
System.out.print( wtgroup.getName()+ ":");
Enumeration usersEnum =wtgroup.members();
while(usersEnum.hasMoreElements()){
WTUser user = (WTUser)usersEnum.nextElement();
System.out.print(user.getName()+"->"+ user.getFullName()+" , ");
}
System.out.println("\n");
}

Regards,

Prathap

In Reply to Rajesh Balasundaram:



We have users created in different groups based on their sites. I would like to extract their user id and their full name from each of these groups. I tried to do this with the report manager (8.0 M020) but I am not able to get theresultsprobably becuasethere is no relationship between the wtuser and wtgroup in the database. Does anyone know how I can extract this information otherwise.

Regards,

Rajesh Balasundaram

Hi Prathap,

 

How can I extract the same result fromSQL DB??

please share.

 

Thanks in advance

Regards,

Pranet

Announcements