[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
How to include custom clientliterals?  XML
Forum Index -> Development
Author Message
msailer

Power User

Joined: 22/06/2015 12:17:44
Messages: 112
Offline

Hi,

In eclnt.jar there are some clientliterals.properties files for the client side translations. When we want to include custom languages like spanish, swedish etc. is the only way to pack it inside of the eclnt.jar or can we put them somewhere else?

BR Manuel
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5524
Offline

Hi,

in the Swing client there is some extension, that allows to update literals from the server side:

1. implement (server) interface IClientLiteralServerLoader

Code:
 public interface IClientLiteralServerLoader
 {
     /**
      * @param language
      * Client language.
      * 
      * @param country
      * Client country.
      * 
      * @param request
      * The request that was triggered from client side in order to read
      * the literals and which is the enviornment in which this method call
      * is executed. By accessing the request you may access e.g. the server
      * side session information.
      * 
      * @return
      */
     List<LiteralInfo> loadLiteralInfos(String language, String country, HttpServletRequest request);
 }


2. register the class of your implementation in system.xml:

Code:
 
 ...
 <clientliteralserverloader name="YOURCLASSNAME"/>
 ...
 



Please note that this processing is not supported in other clients. For the RISC-client it is much easier, because you can directly insert the corresponding JavaScript definitions. Check here the "Developer's Guide - RISC Addons", chapter "Multi Language / Internationalization" (http://www.captaincasa.com/pdf/eclnt_risc_developersguide_addon.pdf)

(And of course you can go the way as well, to add own language property files to the Swing jars.)

Regards, Björn


Björn Müller, CaptainCasa GmbH
msailer

Power User

Joined: 22/06/2015 12:17:44
Messages: 112
Offline

I knew there was an easier way Thank you!
msailer

Power User

Joined: 22/06/2015 12:17:44
Messages: 112
Offline

Could it be that I need to register a Servlet in the web.xml?

I tried

<servlet id="ClientLiteralServlet">
<servlet-name>ClientLiteralServlet</servlet-name>
<servlet-class>org.eclnt.jsfserver.clientliteralloader.ClientLiteralServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-name>ClientLiteralServlet</servlet-name>
<url-pattern>*.ccclientliterals</url-pattern>
</servlet-mapping>


EDIT: Found it: <argument>loadclientliteralsfromserver=true</argument> needs to be included in the jnlp

 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team