on 08-23-2010 6:43 AM
Dear Experts,
I have written following code to fetch the portal user in my WDJ. This code works fine for the Users in UME database but for LDAP user i am not getting the desired result.
try {
String str_ID = wdContext.currentContextElement().getUser_ID();
ISearchResult rst = UMFactory.getUserFactory().getUniqueIDs();
IUserFactory usf = UMFactory.getUserFactory();
IUser iuser = null;
int i = 0;
boolean found = false;
while (rst.hasNext()) {
iuser = UMFactory.getUserFactory().getUser(rst.next().toString()); String uID = iuser.getUniqueName();
if(uID.equals(str_ID)) {
wdComponentAPI.getMessageManager().reportSuccess(uID);
found = true;
break;
}
}
if(found) {
wdComponentAPI.getMessageManager().reportSuccess("Hahahaha.....User Found");
} else {
wdComponentAPI.getMessageManager().reportSuccess("User Does Not exists");
}
} catch (Exception e) {
wdComponentAPI.getMessageManager().reportException(e.getMessage(), true);
}
Please help..
Thanks in Advance.
Regards,
M.D.Sahu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your quick reply.
Sorry to say but I am not very much clear about where should i put the above code in my prg.
Actually In my Portal more than 2 LDAPs are connected and by giving the User ID in my WDJ applicaiton i wanted to know from which LDAP the user belongs to. To achieve this i wanted to process every userID in the both the LDAP and compare the user user given ID with it.Please let me know if anything is not clear.
Thanks,
M.D.Sahu
Hi M.D.Sahu
Please refer the [Wikki -1|http://wiki.sdn.sap.com/wiki/display/WDJava/Check%2ball%2bUsers%2bwho%2bhave%2blogged%2binto%2bportal%2b-%2bwebdynpro%2bappl] amd [Wikki - 2|http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=16442] and [Blog |http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1789] [original link is broken] [original link is broken] [original link is broken]; to accomplish your requriement.
Hope it will helps
Regards
Arun Jaiswal
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.