Wizard API updated!
Tim Boudreau has released a new version of the Swing Wizard library (version 0.997) that fixes the WizardException bug reported in JavaWorld's recent Open Source Java Project profile. The article's examples have been reworked to test out the new, improved WizardException. Thanks, Tim, for this helpful fix!
Open Source Java Projects: The Wizard API

Newsletter sign-up

Sign up for our technology specific newsletters.

Enterprise Java
View all newsletters

Email Address:

Serve clients' specific protocol requirements with Brazil, Part 5

Manage users and content with Brazil

In Parts 1 through 4 of this series, I discussed how to use the Brazil technology to process content from various nontraditional sources, how to add to that content, and how to deliver that content to users implementing different delivery mechanisms and networks, such as applets, Java Reliable Multicast Service (JRMS), wireless clients, and plain HTML. For a review of Brazil, see the Brazil technology review below. In Part 5, I focus on one of Brazil's most powerful features: its ability to create new content from existing content. In the sidebar "Web Services and the JAX Pack," I lay the groundwork for using Brazil with new Web-services-oriented technologies, like the Java APIs for XML, also called the JAX Pack, from Sun. The JAX Pack is an all-in-one download of Java/XML technologies that includes the Simple API for XML (SAX), the Document Object Model (DOM), Extensible Stylesheet Language Transformations (XSLT), and the Simple Object Access Protocol (SOAP).

Read the whole series on Brazil technology:



To show how Brazil can create new content from existing content, I will demonstrate how it allows users to create their own portfolios, remembers this information, and delivers the data as a Web service. In addition, in this article I'll show you how to parse non-XML-based content. Many Websites don't provide XML representations of their data, and while that isn't always a showstopper, some Websites produce content in such a way that the data is nearly impossible to parse. Using Brazil, you can process this content to create new XML-enabled data.

I begin by discussing how to configure the Brazil technology using a config file. I then go over our sample application's two main files: index.html and GetNews.html. The file index.html is used at http://www.digiorgio.com:9001/ by default, while the file GetNews.html is called periodically to parse the news information. (The support Website www.digiorgio.com runs several Brazil servers and hosts the Web application I discuss in this article at port 9001.) These two files and the config file are all you need to implement a system that supports many user accounts featuring dynamic news and stock price data.

Readers interested in creating their own Websites can download the following software packages from Resources:

  • The Brazil distribution
  • The Jython distribution
  • config
  • index.html
  • GetNews.html


Once your application is up and running, please email me.

Configure the Brazil server

In this article, we will work with several handlers and templates to develop a Website that provides session tracking, allows users to customize the Website, integrates contents from diverse Websites, and utilizes Brazil Scripting Language (BSL) and Jython to manipulate content easily. Jython is a 100 percent pure Java implementation of Python. As an interpreted language, Python facilitates program writing and testing. Python programs are compact and readable, and the language includes a rich set of libraries. Jython, which is Python supporting a Java interface, is an excellent replacement for Perl and Tcl. Jython allows you to run Python on any Java platform. See Resources for more information.

1 | 2 | 3 | 4 |  Next >
Resources
  • "Proposed Web Protocol Sparks Tampering Fears," Carolyn Duffy Marsan (Network World, 2001)
    http://www.nwfusion.com/archive/2001/123819_08-13-2001.html?nw
  • To build your own application, download Brazil, Jython, and the following files (rename config.txt to config and change the others so that they end in .html; start the Brazil server with the config file):
  • The following two Sun press releases provide a high-level introduction to the Web services approach to building applications with the Java APIs for XML.