on 09-19-2008 8:56 AM
Hello!
Can s.o. tell me how to get the user from doContent()-Area within an AbstractPortalComponent (not JSPDynPage). I saw that there is an Interface IUserContext, in some example i saw another Interface "IUser", but that is not reachable for me.
Hello Karpenstein,
Why is IUser not reachable for you?
Usually you would use that exact object to get User information.
IUserFactory userFact = UMFactory.getUserFactory();
userFact.getUser(String uniqueID)
The package that you need to import is com.sap.security.api.*;
Hope that helps.
Cheers,
Hermann
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
...
import com.sap.security.api.IUser;
import com.sap.security.api.IUserFactory;
import com.sap.security.api.UMFactory;
import com.sapportals.portal.prt.component.AbstractPortalComponent;
import com.sapportals.portal.prt.component.IPortalComponentRequest;
import com.sapportals.portal.prt.component.IPortalComponentResponse;
...
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
{
...
IUserFactory userFact = UMFactory.getUserFactory();
IUser me = request.getUser();
...
String accessid = me.getUniqueName();
String uniqueid = me.getUniqueID();
String name = me.getDisplayName();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you have some different methods, choose the one which fits more to your requirements:
getUniqueName() --> will display access ID
getUid() or getUniqueID() --> will display unique ID
getDisplayName() --> will display surname and name
as has told Hermann do the import com.sap.security.api.*; where you have included import com.sap.security.api.IUser; which is the package you need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.