cancel
Showing results for 
Search instead for 
Did you mean: 

not able to add new properties in portalapp.xml

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member182374
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Murtaza,

Can you share your email id with me?

my email id is ali52.bang@gmail.com

Waiting for your reply

Regards,

Ali

Ronib
Participant
0 Kudos

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.

Former Member
0 Kudos

Hi,

I tried doing that but it still gives me the error that I am getting.

java.lang.NoClassDefFoundError: com/sapportals/portal/prt/runtime/PortalRuntime

Regards,

Murtuza