 | Level: Intermediate Greg Brown (gkbrown@mac.com), Senior Software Engineer, VMWare
13 Oct 2009 Apache Pivot is an open source platform for building rich internet applications (RIAs) in a Java™ environment. It combines the enhanced productivity and usability features of a modern RIA toolkit with the robustness of the industry-standard Java platform. Apache Pivot applications take advantage of WTKX, an XML-based language for user interface design, which makes the application's output easy to visualize. In this tutorial, you will follow the implementation of a simple but practical Pivot application that allows a user to execute searches against the contents of the iTunes Store.
Before you start
This tutorial assumes some familiarity with common Web development concepts and technologies, including Java technology, XML, JSON, JavaScript, and HTTP. By the end of the tutorial, the reader will understand how these skills can be readily applied to building Pivot applications.
About this tutorial
 |
Frequently used terms
- Ajax: Asynchronous JavaScript + XML
- API: Application programming interface
- CSV: Comma separated value
- GUI: Graphical User Interface
- HTML: HyperText Markup Language
- HTTP: Hypertext Transfer Protocol
- JSON: JavaScript Object Notation
- JVM: Java Virtual Machine
- REST: Representational State Transfer
- UI: User Interface
- URL: Uniform Resource Locator
- W3C: World Wide Web Consortium
- XHTML: Extensible HyperText Markup Language
- XML: Extensible Markup Language
|
|
Like other RIA development platforms, Apache Pivot includes a number of features that make building modern GUI applications much easier, including a declarative user interface, data binding, visual effects and transitions, and Web services integration. Pivot applications are built using a combination of Java technology and an XML-based markup language called WTKX. Java Virtual Machine scripting languages are also supported. You can run applications either in a Web browser using the Java plugin or as standalone (optionally offline) desktop applications.
In this tutorial, you will implement a simple but practical Pivot application that allows a user to execute searches against the contents of the iTunes Store. I begin with an introduction to the Pivot platform, followed by an overview of the iTunes search API, and then go on to present the demo application. Along the way I cover how to:
- Create the user interface declaration in WTKX, Pivot's XML-based UI markup language
- Process JSON data using Pivot's built-in support for JSON serialization
- Handle user interface events in JavaScript
Prerequisites
The example code in this tutorial is based upon Pivot 1.3 release, which requires the Java 6 (or higher) SDK. You can download Pivot 1.3 as binaries or source; the source distribution contains a BUILD file that describes how to build the project.
Source code for the demo application is distributed with the platform. All code samples are released under the Apache Software License, Version 2.0.
See Resources for links to download the example code, Pivot 1.3, the Java 6 SDK, and the demo application.
|  |