Shopping Mashup

By Vaibhav Choudhary, April 24, 2009

With the JavaFX technology it is easy to build your own customized JavaFX Mashup with Delicious and Yahoo Shopping Webservices.

Understanding the Code

The code shown in Figure 1 creates 3D Pie Chart, Delicious, and Yahoo Shopping. The user can map his or her Delicious tags to Pie Chart. Clicking Pie Chart gives information about the latest product available for that tag, for example, books on Java.

Source Code

public class ProductInformation {
    public var productImage: String[];
    public var priceFrom:String[];
    public var priceTo: String[];
    public var productName:String[];
    public var username: String;
    var url;
    var p: PullParser;
    var h: HttpRequest;
	...
	...

Figure 1: ProductInformation.fx Class

Source Code

public class TagInformation {
    public var tag: String[]=[];
    public var tagCount: Integer[]=[];
    var bk: ProductInformation;
    public var username: String = "javafx";  // for this sample it's javafx
    var url;
    var p: PullParser;
    var h: HttpRequest;
	...
	...

Figure 2: TagInformation.fx Class

Changing data member information such as a usernme is easy in TagInformation.fx

From this sample, the user can see the integration of two web services and the creation of a mashup. The user normally tags his or her best links in Delicious and wants to see the latest book or product available for those tags. This sample simplifies the screen and shows the complete data on a single screen. The user can click a pie slice to see the book or product available. Clicking a book shows details such as price and product name at the bottom of the screen. The user also can see the carousel view of the book by clicking the left and right buttons.