Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Localization

    Using "v9.0p_2013-07-24/PowerEdition Deployment"

    We want to localize our screens defined using Component XML. But in our application we don’t have message properties. Instead of it we defined our messages in database and getting them on the basis of supplied keys.

    How can we achieve this. Your thoughts/inputs valued here.

    Thanks,
    Deepak Singh

    #2
    There are several possible approaches, but a common one is to subclass ListResourceBundle and implement getContents() by performing database operations to fetch the messages.

    Comment


      #3
      I am using below code to perform fetch operation using DMI but getting the error. Please let me know the right approach to achieve this.
      Code:
      public class ContactUsResource extends ListResourceBundle{
      
      	@Override
      	protected Object[][] getContents() {
      		
      		Criteria lobjLabelCriteria = new Criteria();
      		lobjLabelCriteria.addCriteria("strScreenName", "ES_WT_CONTACT_US");
      		
      		DataSource.get("AWCScreenProperties").fetchData(lobjLabelCriteria, new DSCallback() 
              {
                  public void execute(DSResponse response, Object rawData, DSRequest request) 
                  {
                       try {
                           if(response.getDataAsRecordList() != null && response.getDataAsRecordList().getLength() > 0){
                          	 
                           }
                      } catch (Exception e) {
                          e.printStackTrace();
                      }
                  }
              },new DSRequest());
      
      ….
      ….
      }
      Error
      Code:
      [ERROR] [gwt] - 04:56:37.841:XRP8:WARN:Log:java.lang.UnsatisfiedLinkError: com.smartgwt.client.util.JSOHelper.createObject()Lcom/google/gwt/core/client/JavaScriptObject;
      	at com.smartgwt.client.util.JSOHelper.createObject(Native Method)
      	at com.smartgwt.client.core.DataClass.<init>(DataClass.java:35)
      	at com.smartgwt.client.data.Criteria.<init>(Criteria.java:42)
      	at com.archway.smartgwt.client.ContactUsResource.getContents(ContactUsResource.java:19)
      	at java.util.ListResourceBundle.loadLookup(ListResourceBundle.java:171)
      	at java.util.ListResourceBundle.handleGetObject(ListResourceBundle.java:106)
      	at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
      	at java.util.ResourceBundle.getString(ResourceBundle.java:334)
      	at com.isomorphic.util.LocaleMessage.getMessage(LocaleMessage.java:36)
      	at com.isomorphic.js.JSTranslater.convertSimple(JSTranslater.java:801)
      	at com.isomorphic.js.JSTranslater.convert(JSTranslater.java:671)
      	at com.isomorphic.js.JSTranslater.convert(JSTranslater.java:649)
      	at com.isomorphic.js.JSTranslater.convert(JSTranslater.java:640)
      	at com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1118)
      	at com.isomorphic.js.JSTranslater.convert(JSTranslater.java:711)
      	at com.isomorphic.js.JSTranslater.convert(JSTranslater.java:649)
      	at com.isomorphic.js.JSTranslater.toJS(JSTranslater.java:611)
      	at com.isomorphic.datasource.IsomorphicXML$1.toJSON(IsomorphicXML.java:116)
      	at com.isomorphic.js.JSTranslater.convert(JSTranslater.java:706)
      	at com.isomorphic.js.JSTranslater.convert(JSTranslater.java:649)
      	at com.isomorphic.js.JSTranslater.toJS(JSTranslater.java:611)
      	at com.isomorphic.datasource.IsomorphicXML$1.toJSON(IsomorphicXML.java:116)
      	at com.isomorphic.js.JSTranslater.convert(JSTranslater.java:706)
      	at com.isomorphic.js.JSTranslater.convert(JSTranslater.java:649)
      	at com.isomorphic.js.JSTranslater.toJS(JSTranslater.java:611)
      	at com.isomorphic.xml.XML.toJS(XML.java:408)
      	at com.isomorphic.xml.XML.toJS(XML.java:385)
      	at com.isomorphic.servlet.ScreenLoaderServlet.loadScreen(ScreenLoaderServlet.java:175)
      	at com.isomorphic.servlet.ScreenLoaderServlet.processRequest(ScreenLoaderServlet.java:102)
      	at com.isomorphic.servlet.ScreenLoaderServlet.doPost(ScreenLoaderServlet.java:40)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
      	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:324)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
      Thanks,
      Deepak Singh

      Comment


        #4
        You've got a mixture of server-side classes (com.isomorphic namespace) and client-side classes (com.smartgwt namespace) being used in the same code. You should be using the server-side classes only in a DMI.

        Comment

        Working...
        X