cancel
Showing results for 
Search instead for 
Did you mean: 

Reading iview personalization language in Web Dynpro java

Former Member
0 Kudos

HI

How can i read Iview personalization language in webdynpro java netweaver 7 enviroement?

WDWebContextAdapter.getWebContextAdapter().getRequestParameter("sap-locale") is deprecated it seems.

regards

PG

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi

i tried this as well, but there is no parameter with name 'sap-locale'.

Thanks anyways..

regards

Pranav

Former Member
0 Kudos

Hi Pranav,

Try this code to get the parameter names in your application..

Enumeration Enum=WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameterNames();

for (Enumeration e = Enum ; e.hasMoreElements() {

wdComponentAPI.getMessageManager().reportSuccess("Parameter Name::"+e.nextElement());

}

Then Try to set the parameter like this and get the value..

wdComponentAPI.getMessageManager().reportSuccess("Value"+WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("ParameterName"));

Best Wishes

Idhaya R

Former Member
0 Kudos

Hi

Now i can see sap-locale parameter coming in, but only for the first time iview is loaded. For further user, i am storing the language value in context.

regards

Pranav Goswami

Former Member
0 Kudos

Hi pranav,

What is the parameter that you are using to store the language in the iview.

What is the problem that you are facing now? Can you kindly elobarte.

Best Wishes

Idhaya R

Former Member
0 Kudos

Hi..

Problem was that sap-locale parameter was found only when iview was loaded for first time. to make use of language detail in action handler i stored it in context within init method. now my application is working.

regards

Pranav

Former Member
0 Kudos

Hi Pranav,

Try using this code

WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("sap-locale");

Best Wishes

Idhaya R

Former Member
0 Kudos

Hi Prashant..

Thanks for the information. But I might not need properties of PCD object.

Every user sees the iview and changes the language by personalization. So the Language field is associated not only with PCD iview but also with the logged in user.

Basically We require personalized Iview details, which might be found in request object. still not sure.

regards

Pranav

Former Member
0 Kudos

Hi

Thanks, but this doesn't solve the problem.

Your solution is returning the user language, but iview language can also be personalized. I need to find iview personalization language.

regards

Pranav

pravesh_verma
Active Contributor
0 Kudos

Hi Pranav,

In that case why dont you try to use the PCD API to access iView properties

Check this link:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/314ae7a5-0c01-0010-c198-9c7...

/people/daniel.wroblewski/blog/2006/08/15/pcd-ii-creating-portal-objects

You would require following jars for accessing PCD data:

com.sap.portal.usermanagementapi.jar,

com.sap.portal.pcd.glserviceapi.jar,

com.sap.portal.ivs.api_iview_api.jar

This thread contains the links for accessig the PCD content properties. Please check this as well:

I hope this solves the issue.

Thanks and Regards,

Pravesh

pravesh_verma
Active Contributor
0 Kudos

Hi Pranav,

Try this code:


String lang = WDClientUser.getLoggedInClientUser().getLocale().getDisplayLanguage();

If the above code doed not give you correct values please try this as well:


String lang = WDClientUser.getCurrentUser().getLocale().getDisplayLanguage();

I hope this solves the issue. Please revert back if you do not get the corerct values.

Thanks and Regards,

Pravesh