on 04-05-2012 7:00 PM
I got the answer,
String [] ds = user.getAttribute(IPrincipal.DEFAULT_NAMESPACE, IPrincipal.DATASOURCE);
log("User data source -- "
+ ds[0]);You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please find the below links for UME API.
2. http://scn.sap.com/thread/2020907
Hope this helps.
Thanks,
Santosh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ranjith
What is the need to know the datasource ar runtime?? Its already known while configuration..
Anyways, you can get it from the IUser Object ...This object has a Constant Field - Datasource
The code could be -
Iuser userObj = UMFactory.getUserFactory().GetUser() <thru logon id or something>
read the datasource contant from the object..
Else, get the datasource from the Unique ID of the User....The unique ID contains a format
<DatasourceName.UserID> if I remember correctly.
Give it a try and see if it works..
Sandip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandip,
UME is configured to pull data from 2 data sources (LDAP, EXTERNAL_LDAP). My objective is to get all users from the data source EXTERNAL_LDAP.
user.getUniqueName() -- is returning just the userid.
user.getUniqueID() -- is returning "USER.EXTERNAL_LDAP.<userid>"
So, I thought of getting all the users using
ISearchResult result = userFactory.getUniqueIDs();
and then looping result to get only those users that start with "USER.EXTERNAL_LDAP". But somehow this code is not working fine in all environments. I get the results in sandbox and dev but when I try to run the code in QA, I get only 400 users at a time.
Can you please help me with this ?
I also tried this code to just retrive users from EXTERNAL_LDAP.
IUserFactory userFactory = UMFactory.getUserFactory();
ISearchResult result = userFactory.getUniqueIDs();
log(result.size());
IUserSearchFilter sf = userFactory.getUserSearchFilter();
sf.setUniqueName("*USER.EXTERNAL_LDAP.*", ISearchAttribute.LIKE_OPERATOR, false);
ISearchResult sr = userFactory.searchUsers(sf);
log(sr.size());
result -- returns all the users from LDAP & EXTERNAL_LDAP.
sr - returns 0
As I mentioned earlier, as user.getUniqueName() is not giving me the result in the format, "USER.EXTERNAL_LDAP.<userid>", I am not able to use this code to filter the users based on uniquename. Also, I dont see any search filter like sf.setUniquerID(...)
Please help. !!
User | Count |
---|---|
76 | |
10 | |
9 | |
9 | |
6 | |
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.