on 09-14-2005 10:43 AM
Hi all,
Can some one give me pointers or some sample code to the API of web dynpro using which we can get all the list of users in the portal and also the list of users in a particular group??
This would be of great help for me.
Thank you.
Regards,
Narahari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Narahari,
You can retrieve the users specific to a group by this code :
IGroup grp = UMFactory.getGroupFactory().getGroup(UniquegroupID);
Iterator users = grp.getUserMembers(true);
while(users.hasNext())
{
String unique_user = (String) users.next();
IUser user = UMFactory.getUserFactory().getUser(unique_user);
wdComponentAPI.getMessageManager().reportSuccess("User in group::"grp.getDisplayName()"::"+user.getDisplayName());
}
If you need to retrieve all the groups you can use :-
IGroupSearchFilter filter = UMFactory.getGroupFactory().getGroupSearchFilter();
ISearchResult result = UMFactory.getGroupFactory().searchGroups(filter);
while(result.hasNext())
{
IGroup grp = UMFactory.getGroupFactory().getGroup(result.next().toString());
wdComponentAPI.getMessageManager().reportSuccess("Group::"+grp.getDisplayName());
}
But before using all these, you need to add security.api.jar to your build path. For this In your NWDS, navigate to Your_project->properties->Java Build path->Libraries->Add variable->Click on Eclipse Home->extend->plugins->com.sap.security->lib->com.sap.security.api.jar.
Hope this helps,
Best Regards,
Nibu.
Message was edited by: Nibu Wilson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nibu,
I have used the code that you have given me in this case. It works perfectly when i build locally and deploy it directly onto the development system.
But i am getting syntax errors while doing a DC level build and while activating the DC before moving it to the next system.
I used the Add variable option that you have suggested. But it also doesn't work.
could you please tell me if there is any other way dealing with this problem.
Regards,
Narahari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Narahari,
The following code will display all the users registered with the portal :
ISearchResult rst=UMFactory.getUserFactory().getUniqueIDs();
IUser iuser=null;
while(rst.hasNext())
{
iuser=UMFactory.getUserFactory().getUser(rst.next().toString());
wdComponentAPI.getMessageManager().reportSuccess("User::"+iuser.getDisplayName());
}
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Narahari,
Keywords: UME, UMFactory, IUserFactory
Search NW documentation (for API) and SDN for examples.
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.