Monday, June 17, 2013

OOTB WebCenter Portal Multilingual Support on Chinese/Thai Language

According to the Oracle document, WebCenter Spaces provides out-of-the-box translations for 27 languages and 100 different locales. These 27 languages are available after the WebCenter installation and no additional developments/configurations are needed.



There are two ways to see the translated WebCenter Space. One is via the provided language changer UI on the Space page header. The other is via the browser locale setting.

For the WebCenter framework application, the 27 languages are also available for those build-in services and features.Since the framework application doesn't have the out-of-the-box language changer UI but you can always set your preferred locale in your client browser.

For example, here is a snapshot of the admin page of a WebCenter framework application displaying in English language.



Now I change my preferred browser display language to Spanish (ES).



Refresh the portal page and I can get it displaying in Spanish.



Again I change my preferred language to Chinese (zh-cn). Refresh the portal page and now I can get it like the following. The page is still displaying in English.


It looks to me is an Oracle bug, simply because all other languages can display fine except for this one. But a quick fix on the issue is to add the following to the faces-config.xml of your framework application:

   <application>
    <locale-config>
      <default-locale>en</default-locale>
      <supported-locale>zh-CN</supported-locale>
    </locale-config>

   </application>

After adding the above, redeploy your application and you should be able to get the Chinese language working fine.


Except Chinese language, Thai is also another one which is not working automatically. But it can be fixed by adding the following to the faces-config.xml as well.

       <supported-locale>th-TH</supported-locale>

If you found there is another language not automatically changed after you change the browser language setting, it should also be fixed by adding the supported-locale tag into the faces-config.xml

Sunday, June 9, 2013

JSP with scriptlet cannot be consumed by WebCenter

I recently came across a scenario to consume the JSP file from WebCenter. It's not a usual scenario but it could be an option in the customer's environment. The customer has some JSP files stored in file system and consumed by some other Portal platform other than WebCenter. The JSP files contain conditional check in the scriptlet to display output dynamically. Now WebCenter is going to replace the old platform and options are discussed to how to consume the JSP files on the files systems.

One option, of course, is to convert the JSP files into content files stored in the WebCenter Content server. This will need some additional work on the content server side to prepare the JSP file counterpart. If the logic in the JSP scriplet can be handled by content server side, then it could be an easier job. If not, multiple content files will be needed for one JSP file conversion.

Let's look at the second option, which is to consume the JSP file directly from the file systems like it is consumed in the old platform. This option sounds straightforward and no extra work needed to prepare the files. But when actually consuming the JSP files from WebCenter Portal, you would get an error message - "Java code in jsp source file is not allowed in ojsp.next mode". While doing some research, there is oracle doc1067696.1 addressing this problem.

The cause of the problem is for WebCenter application, the weblogic-application.xml has the following setting:

<library-ref>
            <library-name>oracle.jsp.next</library-name>
</library-ref>


And, OJSP doesn't support scriptlets in its "next" mode.

Yet I am not able to find more details on the ojsp.next mode.

The conclusion is JSP file with scriptlet cannot be consumed from WebCenter 11.1.1.x series.