How to get the Language settings in ops deployed in liferay

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get the Language settings in ops deployed in liferay

asenthil.xforms
Hi,
  I am new to ops xforms. I have ops 3.5.1 deployed in liferay. I want to get the language settings selected from liferay 4.2.2. Its urgent can you please help me without fail.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: How to get the Language settings in ops deployed in liferay

Erik Bruchez
Administrator
Do you know how are these settings are exposed to portlet applications?
Are those portlet preferences, or is there a different mechanism?

-Erik




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: How to get the Language settings in ops deployed in liferay

Erik Bruchez
Administrator
Senthilvel,
 >
 >   <%
 >           Locale locale = renderRequest.getLocale();
 >           ResourceBundle res = portletConfig.getResourceBundle (locale);
 >           String language = locale.getLanguage();
 >           out.println(language);
 >    %>

You can use at least two different ways: you could use the Java
processor:

   http://www.orbeon.com/ops/doc/processors-java

The Java code would contain something like this:

   ExternalContext externalContext
     = (ExternalContext)
pipelineContext.getAttribute(PipelineContext.EXTERNAL_CONTEXT);

   String language = externalContext
     .getRequest()
     .getLocale()
     .getLanguage();

Then you would output the result as XML.

You could also probaly access this by calling Java from XSLT, using
the oxf:unsafe-xslt processor and Saxon's mechanisms to call Java
code:

   http://www.saxonica.com/documentation/extensibility/functions.html

You would be trying to write the equivalent of:

   org.orbeon.oxf.pipeline.StaticExternalContext
     .getStaticContext()
     .getExternalContext()
     .getRequest()
     .getLocale()
     .getLanguage()

I think the best solution would be for the oxf:request processor to
support outputting locale information, but this is a little bit of
code to write in RequestGenerator.java.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws