Obtaining translations from Maximo

I have an application that connects to Maximo via RMI and needed to use Maximo's translation engine. This post explains how to do this.

In this example we'll get Maximo's greeting message.

    psdi.util.MXSession mxSession = (...);
    (...)
    // LANGCODE
    String langCode = "PT";
    // Name of the user currently logged in, to present in the message.
    String usrDisplayName[] = { mxSession.getUserInfo().getDisplayName() };
    // MAXMESSAGE object constructor with the target langcode.
    psdi.mbo.MaxMessage message = new MaxMessage(langCode);
    // Message group
    message.setGroup("login");
    // Message key
    message.setKey("welcomeusername");
    // Obtain Maximo's message text using the MXSession instance used to connect to Maximo.
    msgS = mxSession.getMessage("login", "welcomeusername");
    // Fill in the messages parameters
    message.setValue(msgS);
    // Get the translated text.
    msgS = message.getMessage(usrDisplayName);
    // Print the message
    System.out.println(msgS);





Reblog this post [with Zemanta]

0 comments:

Post a Comment