cancel
Showing results for 
Search instead for 
Did you mean: 

Getting list of available portal languages

Former Member
0 Kudos

Hi,

is there a way to retrieve the available languages in the portal ?

I already looked at :

Interface <a href="https://media.sdn.sap.com/javadocs/NW04/SP12/prtsupp/com/sapportals/admin/wizardframework/util/ILocaleListService.html#method_summary">ILocaleListService</a> :


	  Locale locale = req.getUser().getLocale();
	  List ls = ILocaleListService.getListOfLocalesOrderedByDisplayName(locale);

1) This is unfortunately the interface. When clickining in the javadocs on 'use' it appears nowhere to be used.

2) Would using the <a href="https://help.sap.com/javadocs/NW04S/current/se/com/sap/security/api/UMFactory.html">UMFactory.getproperties()</a> be an alternative?

I would prefer to use method 1) though.

Thanks for the help,

Kevin

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello Kevin,

Check this:

ILocaleListService localeListService =

(ILocaleListService) PortalRuntime.getRuntimeResources().getService(ILocaleListService.KEY);

Greetings,

Praveen Gudapati

p.s. Points are always welcome for helpful answers

Former Member
0 Kudos

Thanks for the quick replies 🐵

I made the changes to the code, now I get an iView runtime error :


Caused by: java.lang.NoClassDefFoundError: com/sapportals/admin/wizardframework/util/ILocaleListService
	at z.imec.km.proxy.navigation.language.navigationProxy.checkLocale(navigationProxy.java:101)
	at z.imec.km.proxy.navigation.language.navigationProxy.doOnNodeReady(navigationProxy.java:61)
	at com.sapportals.portal.prt.component.AbstractPortalComponent.handleEvent(AbstractPortalComponent.java:388)
	at com.sapportals.portal.prt.pom.ComponentNode.handleEvent(ComponentNode.java:252)
	at com.sapportals.portal.prt.pom.PortalNode.fireEventOnNode(PortalNode.java:369)
	at com.sapportals.portal.prt.pom.AbstractNode.addChildNode(AbstractNode.java:340)
	at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:642)
	... 21 more

My portalapp.xml looks like this :

    	<property name="SharingReference" value="com.sap.km.application"/>

My project in NW2004S dev studio SP10 has the com.sap.portal.admin.wizardframework_api.jar added to build path. Seems like this one is missing when running the iView in the portal. Do I need to add some reference to the portalapp.xml or include the jar file in my project?

If you want, I can send you the devstudio project code.

0 Kudos

Hi Kevin,

You should have com.sap.portal.admin.wizardframework in your SharingReference:

<property name="SharingReference" value="com.sap.km.application, com.sap.portal.admin.wizardframework"/>

Greetings,

Praveen Gudapati

Former Member
0 Kudos

Yes, I just found it through help.sap.com : <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/42/bf4172cb951d66e10000000a1553f6/frameset.htm">portalapp.xml</a>

Thanks to both of you for the quick help, awarded both of you points!

Answers (1)

Answers (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Hi,

This is a portal service. Use the PortalRuntime class to instantiate it, like any portal service, as follows:

IClientNavigationGenerator service = (IClientNavigationGenerator) PortalRuntime.getRuntimeResources().getService(INavigationService.KEY);

Hope that helps.

Daniel