us site
developer center
search

Archive for the ‘Development’ Category

A Guide to Java MessageFormat (or, How I Learned to Stop Worrying and Love Macros)

Wednesday, December 10th, 2008

While working on an application for a client, I encountered some issues with Java’s MessageFormat. In particular, I needed to pass MessageFormat a string that contained single-quotes and curly braces that would be treated literally. This is an issue, because single-quotes and curly braces are special characters in MessageFormat land.

MessageFormat is designed to allow you to dynamically create a string based on a static pattern and a set of inputs. For example, this is from the MessageFormat JavaDoc:

 Object[] testArgs = {new Long(3), "MyDisk"};

 MessageFormat form = new MessageFormat(
     "The disk \"{1}\" contains {0} file(s).");

 System.out.println(form.format(testArgs));

 // output, with different testArgs
 output: The disk "MyDisk" contains 0 file(s).
 output: The disk "MyDisk" contains 1 file(s).
 output: The disk "MyDisk" contains 1,273 file(s).

(more…)

Tutorial: Hibernate, DWR and dojo.E

Monday, October 6th, 2008

I just presented a tutorial on Friday on using Direct Web Remoting, Hibernate and dojo.E.  It’s a very simple demo, but demonstrates the power of these three technologies combined to create simple, dynamic Java applications very quickly. The tutorial is available on SlideShare.

DWR, Hibernate and Dojo.E - A Tutorial

View SlideShare presentation or Upload your own. (tags: tutorials tutorial)

Note that there is a bug that obscures the URL for the SVN project.  The URL is http://source.nexaweb.com/svn/repos/trunk/tutorials/ajax/DWRExample/.

You can check out the project via SVN using this URL.

Also, to copy and paste the code snippets, download the document and open directly in PowerPoint. When copying and pasting, watch out for “smart quotes”. Some of the quotation characters in the PPT have been replaced with “smart quotes”, which are not recognized by XML parsers.

This will get even more exciting with the new features of DWR 3.0, which will add a RESTful layer to DWR’s remoting.  To learn more about DWR 3.0, I recommend Joe Walker’s presentation from The Ajax Experience last week.  He’s the lead developer for DWR.

Joel Barciauskas

New version of Studio - beta available

Monday, March 3rd, 2008

We’ve been working hard on a new version of our development environment and we’re releasing a beta into the world.

Some highlights:

  1. Data, data, data - all work flows that interact with data integration have been overhauled
  2. Supporting users that have their own Eclipse environment and don’t want ours
  3. Editing our “macros” - declarative modification blocks that can be executed on the client
  4. Supporting JSON visualization for data sources
  5. Results from usability testing has been added in
  6. and more…

If you would like to take the beta for a spin, email our support department.

Rob Gagne

Using the Dojo XML Parser

Tuesday, February 5th, 2008

I have spent the last few weeks building examples using XML on top of dojo, including an XML version of the mail application (you can see it here http://trac.dojotoolkit.org/ticket/5766).

(more…)

dojo xml parser

Sunday, January 6th, 2008

We’ve been using dojo for a while now as part of our Ajax product offering. We’re currently in the process of upgrading from 0.4 to the shiny new dojo 1.0; as part of that we have developed some things that may be useful outside of the Nexaweb product. One of these is a processor, which uses the dojo parser, to read xml and uses it to create dojo components.

For example:

<ui xmlns:dijit=”dijit”>
<dijit:form.Button label=”Hello, World!”/>
</ui>

<ui xmlns:dijit=”dijit.form”>
<dijit:Button label=”Hello, World!”/>
</ui>

would both create a dojo button with the (grammatically correct) “Hello, World!”. The path to the component is the combination of the xml namespace and the element name. An event handler could be added simply by adding an onclick attribute.

HTML can be mixed in using its own namespace:

<ui xmlns:dijit=”dijit” xmlns:html=”html”>
<html:p>HTML before</html:p>
<dijit:form.Button label=”Hello, World!”/>
</ui>

These are all included in an HTML file through the <script/> tag, either inline or via the src attribute.

Why is this useful? It flips the ui description to a full declarative approach from either JavaScript or JavaScript + a div. This has some advantage: can be easier to write and maintain, the dojo part can be seperated from the rest of the HTML, easier to share, can be machine generated or schema validated for correctness, etc.

It’s not all peaches and cream - the declarations get longer and there is another, very short, step before the component is on the screen - but for many the benefits can outweigh the disadvantages.

You can try it yourself by downloading it here. Feedback and thoughts appreciated. More examples on their way.

- Rob Gagne

MR released

Sunday, January 6th, 2008

For those on Platform 4.2 we’ve released a new maintenance release. This focuses on some fixes for dynamic layout in flow panes and a new API that helps keep track of the UI update lock count for freezing the screen rendering - something you don’t think about until you need to do it. See the release notes page on the dev center for more info.

- Rob Gagne

Welcome

Sunday, January 6th, 2008

Hi Everyone,

Welcome to the new blogroll for Nexaweb. We’ve been blogging for a while now elsewhere (rockstarapps.com and coachwei.com) but these are the first Nexaweb hosted blog sites. You can read about new things coming out of engineering, marketing and our community folks as well as the business side of things.

Enjoy!

- Rob Gagne