Tuesday, April 30, 2013

Using the Localized Resource Builder

Last week I had to use the localized resource builder for localizing an application for one of my clients. After searching a while I did find an article about the topic, and although it didn't meet my needs, it did point me in the right direction.

Localize with the Data Page Builder
Here's the scenario - I have a custom HTML page that has descriptive text to be localized. This is easily accomplished by adding a second data page builder (the first is for the data on the page) that points to the variable created by the localized resource builder.

Here's the HTML I used for page1:
    <head><title>Default Test Page</title></head>
            <div name="contact">
              <span name="name_label"/>
              <span name="name"></span>
              <span name="phone_label"/>
              <span name="phone"></span>
            <span name="btn"/>

and here's the default resource bundle:
button_label=click me
phone_label=Phone number:
I create a data page builder and point to the variable Variables/LocaleData created by the local resource builder:

When I run the model I get this output:

To test for French language I add a new resource bundle:
button_label=clique moi
phone_label=Numero de telephone:

and change the language to fr:
resulting in this output:

Monday, April 1, 2013

Deploying WARs With a Script

I've wanted to figure this out for a long time and yesterday I finally put together a script that updates a WAR to WebSphere. I have WebSphere Portal running locally on my development box and running the following command will use wsadmin to update a freshly built WAR to the server:

sudo /opt/IBM/WPS8/WebSphere/wp_profile/bin/ -conntype SOAP -user wpsadmin -password wpsadmin -c "\$AdminApp update POC_WS_war app {-operation update -contents /home/dsixe/WEF/POC_WS.war}"

It took me a while to find out why my script wasn't working, the $AdminApp command requires a \ prefix on non-windows platforms. I initially thought that somebody else would have published a clear example of how to deploy with a script, but I just couldn't find one with repeated google searches (at least none that had the \ prefix).