Blog to discuss Midnight Coders products, features, ideas and trends in development of Rich Internet Applications

Monday, January 19, 2009

RIA AppPuncher 1.0.1 is available

Our new client/server debugging utility for RIA applications - RIA AppPuncher - has been a great success. A lot of people have downloaded the application and provided fantastic feedback.  We have already started working on the requested features. Some of the users have experienced startup errors that prevented AppPuncher from working properly. The most common errors are shown below:

For Windows users:
  • Could not find the man class: com.tmc.rtb.ui.Application. Program will exit.
  • Exception in thread "main" java.lang.UnsatisfiedLinkError
For Mac OSX users:
  • Existing application in any way other than File > Exit does not restore proxy settings. 
Today we released a patch build of RIA AppPuncher - version 1.0.1. The build fixes all the errors listed above. It also includes the following features and bug fixes:
  • Added support for AMF0
  • All views can now render Gzip compressed content
  • Fetched XML content is now rendered in a structured view
  • Methods re-invoked from AppPuncher UI now use different icon
  • Uninstaller now deletes all the files added by the installer
  • Selecting a session in the treeview select the corresponding session tab 
  • When a session is cleared contents of the request/response panels is cleared too
Please download the new release and make sure to let us know how you like it and what we could do better or differently.

Thursday, January 15, 2009

Diagnosing AppPuncher start-up errors

If you are experiencing an error launching AppPuncher on Windows, we would like to ask you to help us diagnosing it.  There are two errors some users have reported:
  • Could not find the man class: com.tmc.rtb.ui.Application. Program will exit.
  • Exception in thread "main" java.lang.UnsatisfiedLinkError
Please do the following to help us with troubleshooting:
  1. Open a command prompt window and change to /Program Files/AppPuncher 
  2. Run the following command: java -jar lib/AppPuncher.jar 
  3. Send us the output you get. Please use puncherbeta@themidnightcoders.com
Thank you for your help!

Thursday, January 08, 2009

Generating PDF documents from Flex

A few weeks ago we released a fantastic addition to our family of products - WebORB PDF Generator. I have not had a chance to describe the product in this blog, so consider this an introduction. This post will focus primarily on Flex, though the product supports all major rich client types including Silverlight, Flash and AJAX. 
Creating a PDF document from Flex using WebORB PDF Generator could not be simpler. The product generates documents using templates. In case of Flex, a template can be created using Flex Builder. Simply create an MXML component (you can use Canvas as the parent class). Lay out basic components to create a template. To generate a PDF document document from the template, create an instance of the MXML component and call the PDF Generator service using our API. Here's an example of a very basic template:

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
  <mx:Label text="DataGird with server-side data:" x="10" y="10"/>
  <mx:DataGrid id="customersGrid" left="10" right="10" fontSize="10"
      bottom="10" top="30"
      dataProvider="{'method:Weborb.Examples.DataBinding.getCustomers()'}" > 
      <mx:columns>
          <mx:DataGridColumn dataField="COMPANYNAME" headerText="Company" />
          <mx:DataGridColumn dataField="CONTACTNAME" headerText="Name"/>
          <mx:DataGridColumn dataField="PHONE" headerText="Phone Number" />
      </mx:columns>
  </mx:DataGrid>    
</mx:Canvas>

The template uses the DataGrid component to render a table in PDF document created from it. Notice the dataProvider attribute of the DataGrid component:

dataProvider="{'method:Weborb.Examples.DataBinding.getCustomers()'}"

The dataProvider references a method which will be invoked by the PDF Generator service and the returned data will go into the PDF document.

Suppose the MXML component's name is MyTemplate.mxml. To create a PDF document using that template from Flex, use the following code:

var pdfGenerator:PDFGenerator = new PDFGenerator( this );
var template:MyTemplate = new MyTemplate();
pdfGenerator.generatePDF( template );

PDF Generator creates a document and returns the document URL to the Flex client. The default implementation opens the URL in a new window. This behavior can be overridden with a responder object:

var myResponder:PDFResponder = new PDFResponder( gotURL, gotError );
pdfGenerator.generatePDF( template, myResponder );


You can use the following Flex components to create templates:
  • DataGrid - will be used to display tabular data
  • List - displays linear (single column) lists
  • HRule, VRule - display vertical or horizontal lines (you can select widht, height, color, etc)
  • TextInput, TextArea - can be used to create PDF Forms in your PDF document
  • Image - will render a bitmap image in the document
  • any charting component - will render chart in the PDF
  • our own FlashContent component - will render Flash content in the resulting PDF document
  • TabNavigator or Accordion - to create PDF documents with different layouts for each page
We have put together an example demonstrating all the supported Flex components in various sample templates.

WebORB for Java v.3.0.1

We just released a new maintenance build of WebORB for Java with the following bug fixes:
  • Fixed a problem with packaging of the WebORB WAR file which prevented deployments into WebSphere and other Java EE servers
  • Fixed a problem in Silverlight examples (previous version was using the Beta 2 compilation of Silverlight client)
  • Fixed a probem in the WDMF XSLT templates described in this thread.
  • Fixed a problem in request parsing when AS3 Flash client sends an invocation with more than one argument using the NetConnection class
The new release is available for immediate download.

Tuesday, January 06, 2009

AppPuncher - Client/server debugging system for Flex, Flash and Silverlight

Whenever you develop an RIA using Flex, Flash, AJAX or Silverlight, odds are you would need to inspect client/server traffic, understand what goes on the wire and diagnose communication problems. Additionally, any online application must be thoroughly tested to understand its concurrency limits and server capacity. We have received a lot of requests from our customers and the users of WebORB to help out with either load testing of their applications or diagnose client/server communication issues. We engaged in several consulting projects to assist customers with QA and that's how the idea for AppPuncher was born. Today I am happy to announce that AppPuncher Debugger Edition is available for download.

So what is AppPuncher? In short, it is a QA system for RIAs. It can help you debug client/server traffic. It can do stress testing and regression testing. It can record and replay all the requests a client is issuing and report any discrepancies in server responses. The product is available in several editions. (The Debugger Edition is available now). See the AppPuncher feature comparison chart.

What can the Debugger Edition do?
The product will run next to your RIA browser-based client and register itself as a proxy server. Internet Explorer and Google Chrome should automatically recognize the proxy and will route all the client requests through AppPuncher.  Firefox requires AppPuncher Firefox extension.

When you start AppPuncher, you can choose the type of test you would like to run (it is limited to the 'Debugging Session' for now, but soon you will be able to use the product to run all supported types of tests). The start screen looks as shown below:


AppPuncher also starts one debugging session by default:


Structured or Sequencial View Types
Once the browser makes any request, AppPuncher will visualize it in two formats: 
  • Structure View - displays all requests in a tree hierarchy ordered by the site they are sent to. 
  • Sequence View - all requests are shown in the same order they are sent.
Structure view:

Sequence View:

AMF Request/Response Visualization
The example above shows requests for static files - images, JavaScript and flash content. Additionally, AppPuncher will detect remoting requests and display information related to the method invocations as shown below: 

Once you select a node in either Structure or Sequence View, the contents of the request and response will show up in the panels on the right.  If you select a remoting method as shown above (the selected method is getCustomers from an invocation of the Weborb.Examples.DataBinding class), the Request and Response panels will display the following:


Request/Response Multiple View Type Support
Notice both request and response can be displayed in different views. A view can be selected using the View drop-down list:

Visualization Optimizations
Views can be selected independently for requests and responses, but it is also possible to automatically select the same view type by clicking the "Correlate Response and Request Views" checkbox located above the Request panel. When the check box is selected and you change the view for Request, the Response panel will automatically select the same view type:

AMF Requests and Responses displayed in AppPuncher can be compressed to show just the data from the request body (method arguments) as well as response body (return value) by selecting the "Body Only" checkbox located under Request and Response panels:


Debugging Remoting Requests
Once an invocation is captured by AppPuncher, it can be repeated with altered argument values. Double click an argument value in the Request panel (make sure you use the AMF view) and click the Invoke button to make a new invocation with modified arguments list:

The new invocation will show up in the AppPuncher list and can be inspected using the same Request and Response panels.

Request/Response Search and Filtering
In any debuging session it may be important to find a specific request. AppPuncher has a powerful search and filtering mechanism. Search is dynamic and will locate all matching requests as you type a search query. 


Filtering allows display of requests and responses of  specific content-types. In addition to well-known content types, AppPuncher automatically adds any new ones  to the list of filters. 


We are working hard on adding new features to AppPuncher. The plan is to release the remaining editions (Regression, Stress and Ultimate in the next couple of months). We would love to hear your feedback on using the product. Download your copy today and please let us know how you like it and what we could do better.