cancel
Showing results for 
Search instead for 
Did you mean: 

Get current portal role that the application running underneath

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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/<SID>/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.

Former Member
0 Kudos

Hello Rajit,

The sharing reference solved problem.

Thanks and regard.

Maya.

p.s.

I reward points for the helpful answers.

Former Member
0 Kudos

Hi Rajit,

I also want to get current role that the application running in WEBDYNPRO.

I am using the same thing:

*NavigationEventsHelperService navHelperService = (NavigationEventsHelperService) PortalRuntime.getRuntimeResources().getService(NavigationEventsHelperService.KEY);*

*String launchNode = navHelperService.getCurrentLaunchNavNode(request).getName();*

but getting error for request object and Portalruntime class object.These both are undefined.

Please suggest me how can I resolve this problem.

Thanks

Arun

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Suresh,

I know already how to retrieve ALL roles of a user. This technique is not what I need. Inside the WebDynpro application, I need to know which one, specific role that the user is positioned on in the portal when the application is invoked.

Thanks,

Maya.

roberto_tagliento
Active Contributor
0 Kudos

You can access to this information from ABAP side of your NetWeaver system.

Former Member
0 Kudos

Hi Roberto,

I develop on Java WAS, so ABAP not relevant.

Any body else have any suggestion?

Thanks ahead,

Maya.