Skip to Content
author's profile photo Former Member
Former Member

Get current portal role that the application running underneath

My application is available from numerous portal roles. The application needs to know at runtime, which role the user is currently positioned on.

I tried this coding:

<b>NavigationEventsHelperService navHelperService = (NavigationEventsHelperService) PortalRuntime.getRuntimeResources().getService(NavigationEventsHelperService.KEY);

String launchNode = navHelperService.getCurrentLaunchNavNode(request).getName();</b>

but on runtime I got this exception:

<b>java.lang.NoClassDefFoundError: com/sapportals/portal/navigation/NavigationEventsHelperService</b>

I think I should indicate on portalapp.xml on SharingReference, the jar name.

But unfortunately I don't know what is name.

Please your help.

Regards,

Maya.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 05:26 PM

    Hi,

    If your development is webdynpro, give the sharing reference as

    PORTAL:com.sap.portal.navigation.helperservice

    If you want the jar, its in this location on the server:

    /usr/sap/ /JC00/j2ee/cluster/server0/apps/ sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/com.sap.portal.navigation.helperservice/lib

    and the jar is com.sap.portal.navigation.helperservice_api.jar.

    Thanks,

    Rajit

    Award points if helpful.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Arun,

      I also have the same requirement. Have you got the solution? BTW, the Request object thing you mentioned is not applicable in WebDynpro. In WebDynpro, something else needs to be done.

      Guys, please help!

      Thanks in advance.

      Regards,

      -Vaibhav

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 12:22 PM

    Hi,

    Try this code

    IWDClientUser user = WDClientUser.getCurrentUser();

    IUser userID = user.getSAPUser();

    String Userrole=new String();

    for (Iterator iter = userID.getRoles(true); iter.hasNext();) {

    IRole role = UMFactory.getRoleFactory().getRole((String) iter.next());

    Userrole=role.getUniqueName();

    }

    if(Userrole.equalsIgnoreCase("Administrator"))

    // TO DO

    Regards

    Suresh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.