on 11-22-2007 11:16 AM
Hi All,
I want to access IUserMapping in my WD application.
I got the hint for doing this from sdn. After following the steps I came across a PortalRuntime Error.
sdn forums suggested that I need to make an entry for sharing references in my portalapp.xml file but whenever I make those changes and deploy the application I find that those changes are removed from portalapp.xml
Following is the code I am using to get the data:
String systemalias = "EC1";
IWDClientUser user = WDClientUser.getLoggedInClientUser();
IUser iuser = user.getSAPUser();
IUserMappingService userMappingService = (IUserMappingService)PortalRuntime.getRuntimeResources().getService(IUserMappingService.KEY);
// get current user's credentials
IUserMappingData mappingData = userMappingService.getMappingData (systemalias, iuser);
Map credentials = new HashMap ();
try {
mappingData.enrich (credentials);
String mappedPassword = credentials.get("UMAP_KEY_PASSWORD").toString();
String mappedUserId = credentials.get("UMAP_KEY_USER").toString();
wdComponentAPI.getMessageManager().reportSuccess("User:"+mappedUserId);
wdComponentAPI.getMessageManager().reportSuccess("Password:"+mappedPassword);
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);
}
Following is the property that I need to add in my portalapp.xml file
<property name="PrivateSharingReference" value="com.sap.portal.htmlb,com.sap.portal.usermapping"/>
Any expert comments on this.
Regards,
Murtuza
Hi,
This code works for me:
IUserMapping userMapping = UMFactory.getUserMapping();
IUserMappingData iumd = userMapping.getUserMappingData(sys, sapUser);
try {
iumd.enrich(map);
} catch (Exception e)
{}
I didn't use any sharing reference because I don't use a portal service just UME API.
Regards,
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murtaza,
Can you share your email id with me?
my email id is ali52.bang@gmail.com
Waiting for your reply
Regards,
Ali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, I don't think that in web dynpro projects you can add sharing references directly to file portalapps.xml.
You should right click your wd project , open properties item and then choose web dynpro references. The last tab is sharing references, click on add button and type
<b>PORTAL:sap.com/com.sap.portal.usermapping</b>
Try to run the application again and tell me if you get any errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.