Comet Developer Tools


Mashups

It’s been called the essence of Web 2.0. It’s the ability to combine pieces of different web sites to create something new, something meaningful. Something for you and the people who have your tastes. Your social network. Not some mass market portal built by corporate programmers who think that they know you and your personal tastes.


Referred to as a composite web site by some and Mashup site by others, we call it amalgamating web data through the process of transcoding. Whatever. It’s about giving you the data that you want on your mobile phone or desktop browser. It’s Web 2.0. It’s about you.


Comet

It's the next generation of web server technology. Comet-enabled web servers can simultaneously update thousands of browsers with new content. So whether you need to access real-time updates in Safari on iPhone or your desktop browser, our Mashup server technology can now stream content updates on demand. Anytime new content is available; you will see the changes. And, with our support for text-to-speech Mashups, you will also be able to hear the difference.


Welcome to the <alt> Mashup server technologies: streaming Web 2.0 to your browser.



Screen Cast and PDF Version


A screen cast of our Comet developer tools is available here:


http://altmobile.com/Screencasts/1173873451589.html


If you are viewing an HTML version of this document, some images may have been corrupted during the conversion process. For best viewing, a PDF version is available here:


http://altmobile.com/pdf/Comet%20Developer%20Tools.pdf




Comet Developer Tool Features


The Comet developer tools extends the reach of our Mashup development tools to enable the development and testing of HTTP streaming Mashups for Safari on iPhone and most desktop browsers including Safari, Firefox, Internet Explorer, and Opera. Additional, widget systems based on these browsers are also supported include Dashboard, Opera Widgets, and Vista Sidebar Gadgets. And finally, single-site browsers (SSB) based on these browsers such as Mozilla Prism and Fuild.app are also supported as Mashup streaming clients.


To understand the underlying technology of our Mashup tools—and in fact to build a Mashup application—you will use our StableDOM technology. The StableDOM product documentation is located at http://altmobile.com/pdf/StableDOM.pdf. The XML Transcoding product documentation is located at http://altmobile.com/pdf/XML%20Transcoding.pdf. Review the DOM Browser product document to understand how to create enterprise Mashups that integrate SQL data, Web Services data, and HTML content. It is located at http://altmobile.com/pdf/DOM%20Browser.pdf. And finally, our Mashup monitoring and metadata implementation is documented here: http://altmobile.com/pdf/Mashup%20Tools.pdf.


Leveraging the StableDOM and code generation technologies, our Comet developer tools provide the following major capabilities:


  1. Starting and stopping an embedded version of <alt> Dynamic Mashup Server. The Dynamic Mashup Server is a Comet-enabled server using a custom version of Sun's Grizzly technology.


The standalone server version is scheduled to be released in Q2 2008, but an embedded version of the Dynamic Mashup Server is available in version 7.3 of the <alt> XML Studio.

  1. Configuring an embedded Dynamic Mashup Server to support various Comet client technologies such Multipart Comet, XHR Interactive Comet, and Forever Script Comet.

  2. Configuring an embedded Dynamic Mashup Server to support various content-type outputs such as RSS, JSON, HTML, XML, and XHTML.

  3. Configuring an embedded Dynamic Mashup Server to run on a specific port.

  4. Configuring an embedded Dynamic Mashup Server to encode images using a data URI.

  5. Configuring an embedded Dynamic Mashup Server to fetch remote content at a time interval.

  6. Configuring an embedded Dynamic Mashup Server to generate an audio version of the Mashup results using our text-to-speech technologies.

  7. A sample AJAX client implementing a Multipart Comet client.

  8. A sample AJAX client implementing a XHR Interactive Comet client.

  9. A sample AJAX client implementing a Forever Script Comet client.



Configuring the Embedded Dynamic Mashup Server to Support Comet


As mentioned earlier, starting with version 7.3 of the <alt> XML Studio, you are able to Comet-enable your Mashups. To accomplish this, generated your Mashup as a Dynamic XSL as you would normally. Then, rather than publishing it to a regular HTTP server via the various Object Server menus, select the "Grizzly Comet Server..." menu.


This is a screen shot of the popup menu for a Dynamic XSL:




And once you select the "Grizzly Comet Server..." you will be presented with the following Comet configuration dialog:




Defining Comet Type

The Dynamic Mashup Server allows you to configure the server to support several Comet client technologies including the following:


  1. Forever Script. Choose this option for the following browsers: Mozilla-based browsers such as Mozilla Prism, Firefox, and of course Mozilla. Safari-based browsers are also supported such as Safari on iPhone and Safari on Mac and Windows.

  2. XHR Interactive. Also known as, "Ready State 3", choose this option for the following browsers: Mozilla-based browsers such as Mozilla Prism, Firefox, and of course Mozilla. Safari-based browsers are also supported such as Safari on iPhone and Safari on Mac and Windows.

  3. Mozilla Multipart. Choose this option for the following browsers: Mozilla-based browsers such as Mozilla Prism, Firefox, and of course Mozilla.


Here is a screen shot of your Comet type options:







Defining MIME Content-Type

The Dynamic Mashup Server allows you to define the MIME content-type of your Mashup content. Said differently, you can specify the output type of your Mashup. The Code Generation will generate any additional markup or translate to other data formats as required. The following output types may be specified:


  1. JSON. Choose this option so that the Dynamic Mashup Server will transform the output from the Dynamic XSL into JSON. The Dynamic Mashup Server will also set the HTTP content-type to application/json.

  2. RSS. Choose this option so that the Dynamic Mashup Server will transform the output from your Dynamic XSL into RSS. The Dynamic Mashup Server will also set the HTTP content-type to application/rss+xml.


The following screen shot uses FireFox to view the feed:




As seen above, the feed will contain 1 item. This item will contain the first child of the BODY element wrapped in a CDATA node.


The following screen shot shows the Mashup RSS feed document:



The above screen shot uses our DOM Browser to visualize the RSS document. This visualization also shows another of our enterprise XML technologies: XML analytics. Here we see the number of child nodes and node type information. For XML visualization, our DOM Browser product documentation is found at: http://altmobile.com/pdf/DOM%20Browser.pdf. And for XML analytics, our Node Insight product documentation is found here: http://altmobile.com/pdf/Node%20Insight.pdf



  1. XML. Choose this option so that the Dynamic Mashup Server will set the HTTP content-type to text/xml. When consuming HTML Mashup content using AJAX, this output format enables you to access an XML document using both the XMLHttpRequest.responseXML and XMLHttpRequest.responseText properties.


Currently, the Dynamic Mashup Server does not automatically rewrite HTML URLs found in attributes such as SRC and HREF into valid XML for dynamic Mashup content. For static Mashup content extracted using our developer tools, values in these attributes are correctly rewritten. Consequently, if you do not properly encode these attributes in your Dynamic XSL, you may have to access your Mashup content using the XMLHttpRequest.responseText property.


Of course, if your Mashup content is sourced from remote XML data, for example an XML database or web service, then there should be no need to rewrite parts of the output document.


  1. XHTML. Choose this option so that the Dynamic Mashup Server will set the HTTP content-type to application/xhtml+xml. Though this configuration is not advised for desktop browser clients, mobile phone browsers and future HTML5 clients should be able to correctly process this type of content.

  2. HTML. Choose this option so that the Dynamic Mashup Server will set the HTTP content-type to text/html. This is the default MIME content type used.


Here is a screen shot of your MIME content-type options:






Define the Port


The Dynamic Mashup Server allows you to specify on which port to run. As with our all of our embedded HTTP server technologies, specifying port 0 will have the operating system auto-start a randomly available port.



Encoding Images Using data URI


The Dynamic Mashup Server allows you to dynamically encode images using the data: URI scheme by dynamically detecting the remote image type either by its file extension or by reading its bytes. This is accomplished by our Image Transcoding and Code Generation technologies.


This feature is often useful in the following situations:


  1. Speed. The image(s) are on a slow server or slow network and it’s faster to encode them on the Dynamic Mashup Server rather than have the browser retrieve the image(s).

  2. Protected images. Many servers will not allow remote access/links to their images. Since the Dynamic Mashup Server contains an embedded HTML browser, the remote image server treats it as a valid client thus allowing it access to its images.

  3. Browser-based image manipulation.



The following is a Firefox and Fire Bug screen shot of this capability:




For static Mashup content, you can generate data URI encoded IMGs using the Mashup Monitor tool. Its product documentation is found here: http://altmobile.com/pdf/Mashup%20Tools.pdf. You can also encode local images using our JSON/JavaScript developer tools and its product documentation is found here: http://altmobile.com/pdf/JSON%20Tools.pdf



Announce Mashup Results


The Dynamic Mashup Server allows you to instruct it to generate an audio AIFF file of your Mashup results. Currently, we support the following speech synthesis engines:


  1. Sun Labs' Free-TTS. This option is available on all platforms. Free-TTS provides middle-of-the-road voice quality.

  2. Apple's speech synthesis technology. This option is only available when running the Dynamic Mashup Server on a Mac. The voice quality on Mac OS X 10.5 Leopard is generally recognized as the best in industry.


You may configure which text-to-speech engine to use by modifying the webSdk.xml configuration file. The speech-synthesis element has the use-native-tts and default-tts-voice attributes as seen in this XML visualization:


The above screen shot uses our DOM Browser to visualize the webSdk.xml configuration file. For more information on XML visualization, our DOM Browser product documentation is found at: http://altmobile.com/pdf/DOM%20Browser.pdf.



Our Code Generation technology will append an EMBED element to your Mashup result with a link to the audio file.


This capability is only available for the following content-output types: RSS, XML, HTML, and XHTML but not JSON.




Fetch Increment


The Dynamic Mashup Server allows you to define the time interval on which it will execute your Dynamic XSL to fetch and transform the remote content. This increment is specified in seconds.



It is important to ensure that the frequency at which you fetch from remote web site(s) (and generate the audio file, encode images, etc) is longer than the time it takes to listen to your Mashup results. If not, the audio will be truncated by the new content being pushed to the client.


After the executing the Dynamic XSL and any other post execution options such as text-to-speech generation, image encoding, and last update information insertion; the Comet technology then broadcasts the update to all connected clients.




The first time you see the simultaneous update of your iPhone and desktop browsers, you will really appreciate the beauty of Comet-enabled Mashups.




Show Last Update


The Dynamic Mashup Server allows you to instruct our Code Generation technology to append a SCRIPT element to your Mashup result to display the time that the Mashup was rendering in the browser.



Sample AJAX Client Implementing Multipart Comet


To help you implement your own Comet clients, we provide sample AJAX code. Here is a screen shot of a Multipart Comet client:






This client is auto-launched from the Comet Configuration dialog.


The HTML file is found at your_install_dir/ALTMobile/objSvr/comet/windows_js_1.3/samples/multipart-comet_tts_encode_time.html


The JavaScript file is found at your_install_dir/ALTMobile/objSvr/comet/windows_js_1.3/javascripts/mozMultipart.js


The options shown in the browser do not correspond to those specified on the Comet configuration dialog.


Sample AJAX Client Implementing XHR Interactive Comet


To help you implement your own Comet clients, we provide sample AJAX code. Here is a screen shot of a XHR Interactive Comet client:







This client is auto-launched from the Comet Configuration dialog.



The HTML file is found at your_install_dir/ALTMobile/objSvr/comet/windows_js_1.3/samples/xhrInteractive-comet_tts_encode_time.html



The JavaScript code is found in your_install_dir/ALTMobile/objSvr/comet/windows_js_1.3/javascripts/readystate.js





The options shown in the browser do not correspond to those specified on the Comet configuration dialog.



Sample AJAX Client Implementing Forever Script Comet


To help you implement your own Comet clients, we provide sample AJAX code. Here is a screen shot of a Forever Script Comet client:





This client is auto-launched from the Comet Configuration dialog.




The HTML file is found at your_install_dir/ALTMobile/objSvr/comet/windows_js_1.3/samples/everScript-comet_tts_encode_time.html


The JavaScript code is found in your_install_dir/ALTMobile/objSvr/comet/windows_js_1.3/javascripts/everScript.js


The options shown in the browser do not correspond to those specified on the Comet configuration dialog.