on 11-23-2006 7:53 PM
Hi,
I'm just developing a web dynpro to analyze folder structures in km. Now I want to create an IResource object. For this I need the current User (com.sapportals.portal.security.usermanagement.IUser).
How can I get the User? I looked for such method in wdThis. But I didn't found anything.
Regards,
Gerhard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
Try this
�� Searching for UME objects consists of:
1. Creating a search filter from the UserFactory
2. Setting the Search Attributes for the search
3. Invoking the search
4. Iterating through the search result
�� The result of the search is of type ISearchResult and returns an
iterator containing the UniqueIds of the principals returned
�� The search result also contains the state of the search:
SEARCH_RESULT_INCOMPLETE
SEARCH_RESULT_OK
SEARCH_RESULT_UNDEFINED
SEARCH_RESULT_EXCEEDED
TIME_LIMIT_EXCEEDED
Searching for Users
IUserFactory userFact = UMFactory.getUserFactory();
IUserSearchFilter userFilt = userFact.getUserSearchFilter();
userFilt.setLastName("Sm?th*");
ISearchResult result = userFact.searchUsers(userFilt);
if (result.getState() == ISearchResult.SEARCH_RESULT_OK) {
while (result.hasNext()) {
String uniqId = (String) result.next();
IUser thisUser = userFact.getUser(uniqId);
String name = thisUser.getDisplayName();
...
}
} else {
// print error or warning
}
Returns UniqueID of user
Use the UniqueID to obtain an instance
Please import com.sap.security.api.*;
Regards
Nidhideep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gerhard,
To get the current portal user use com.sap.security.api.jar
String strUserID = null;
try{
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.wdUser.getSAPUser();
if(user !=null)
{
IUserAccount[] act = user.getUserAccounts();
if(act[0] != null)
{
strUserID = act[0].getLogonUid();// holds the current portal ID
}
}
}catch(Exception e)
{
}
Hope it helps.
Regards,
Lakshminarayana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gerhard
U need to add com.sap.security.sda in your java build path.
And then you'll get IUser interface.
Thanks
Srikant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.