Skip to Content
avatar image
Former Member

not able to add new properties in portalapp.xml

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Nov 22, 2007 at 12:20 PM

    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

    PORTAL:sap.com/com.sap.portal.usermapping>

    Try to run the application again and tell me if you get any errors.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Nov 27, 2007 at 01:35 PM

    Hi Murtaza,

    Can you share your email id with me?

    my email id is ali52.bang@gmail.com

    Waiting for your reply

    Regards,

    Ali

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 27, 2007 at 01:56 PM

    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

    Add comment
    10|10000 characters needed characters exceeded