Home > Store > Operating Systems, Server
Rapid Application Development with Mozilla
- By Nigel McFarlane
- Published Nov 25, 2003 by Prentice Hall. Part of the Bruce Perens'Open Source Series series.
- Copyright 2004
- Dimensions: 7 x 9 1/4
- Pages: 800
- Edition: 1st
- Book
- ISBN-10: 0-13-142343-6
- ISBN-13: 978-0-13-142343-5
Register your product to gain access to bonus material or receive a coupon.
Product Author Bios
NIGEL MCFARLANE is a science and technology writer, analyst, and programmer. He is the author of many articles on Web, XML, JavaScript, and other technologies, and his work has appeared in periodicals such as DevX, The Sydney Morning Herald, and Builder.com. Nigel is also the author of Instant JavaScript and Professional JavaScript. He lives in Melbourne, Australia.
Rapid Application Development with Mozilla, part of the Bruce Perens Open Source Series, is a concise guide for any programmer who wants to learn the versatility and compatibility of Mozilla, an open source toolset with over a thousand objects and components. An additional feature of Rapid Application Development with Mozilla is the NoteTaker Web browser add-on-a sample Mozilla application that is developed throughout the book. Written by Web and XML expert Nigel McFarlane, this book is the perfect addition to the library of any user-interface software engineer, cross-platform developer, or any programmer looking to discover the benefits of rapid application development.
Downloads
Download the Chapters from Rapid Application Development with Mozilla.
As an aid to readers of Rapid Application Development with Mozilla, we are providing for download in compressed archives XPIDL interface defintions, class-interface reports, and code for the NoteTaker example project.
Download the files for the platform of your choice:
- MacOS9 (4.1 MB, SIT)
- UNIX/Linux (1.7 MB, TGZ)
- Windows (4.2 MB, ZIP)
- All platforms (10 MB, ZIP)
Source Code
Download the Source
Files related to this title.
Related Articles
An Introductory Tour of Mozilla's XUL
Mozilla Overlays: A New Way to Combine XML Documents
Searching for Substance: Hot Air Costs More Than Hardware
Searching for Substance: Web Browser Olympic Scorecard
Smoke, Mirrors and Silence: The Browser Wars Reignite
Author's Site
Links
To facilitate your work with Rapid Application Development with Mozilla , below please find links to Web-based resources on technologies and standards mentioned in the book.
ActiveState ActiveState produces integrated development environment (IDE) tools for software developers. Their Komodo product is based on the Mozilla platform.
ebXML ebXML (Electronic Business using eXtensible Markup Language), is a modular suite of specifications that enables enterprises of any size and in any geographical location to conduct business over the Internet.
Ecma International Ecma International facilitates the timely creation of a wide range of global Information and Communications Technology (ICT) and Consumer Electronics (CE) standards. From ECMA, you can download the ECMA-262 ECMAScript standard (this is the JavaScript standard).
Fontconfig Fontconfig is a library for configuring and customizing font access. You will find here an explanation of the basics of the Xft font-serving system. Fontconfig is part of freedesktop.org , a free software project to work on interoperability and shared technology for desktop environments for the X Window System.
mozdev.org Mozdev.org is a software development community dedicated to making quality applications and extensions freely available to all computer users. Areas on the site referenced in the text include:
- Bugzilla Thesaurus & Reverse Dictionary
- Mozilla Javascript Library
- MySQL XPCOM Project .
- Protozilla . Protozilla is a browser add-on that makes it very easy to implement protocols in Mozilla (or Netscape 6.x).
- Customizing Mozilla . Offer some hints about some of the less well documented features in Mozilla which can be customized to suit the user's preference.
- ftp://ftp.mozilla.org/ . If you wish to compile Mozilla yourself, an --enable-xtf version for GTK1.x in RPM format can be had from this ftp site.
- IRC in Mozilla, aka ChatZilla . ChatZilla is an IRC client that is written entirely in JavaScript and XUL.
- JavaScript Language Resources .
- Mozilla Jargon File . A list of some of the jargon used by mozilla hackers.
- Mozilla Keyboard Planning FAQ and Cross Reference and the Mozilla Keyboard Assignment Map .
- SQL Support in Mozilla .
- XBL - Extensible Binding Language 1.0 . XBL is a markup language for describing bindings that can be attached to elements in other documents.
- XML Extras . The XML Extras module contains several features that allow developers to treat XML as data i.e. not as just another document format.
Netscape DevEdge Extensive forum for developers that focusses on the use of web standards for accessibility, maintainability, and user interaction.
Nigel McFarlane - Technology in Your Terms Author Nigel McFarlane's Web site. On the site you will find his support page for Rapid Application Development with Mozilla , including the latest updates and errata.
OEone OEone produces products intended to make personal computers easily useable by novices. Their OEone HomeBase product is a custom combination of Linux and an enhanced version of the Mozilla platform called Penzilla. It provides a complete system for interacting with a computer.
PURL A PURL (Persistent Uniform Resource Locator) is functionally a URL. PURLs persist indefinitely, and as long as they do, all instances of such PURLs (for example, links in a Web document or a bibliographic record) remain valid. PURL is a project of OCLC Research , one of the world's leading centers devoted exclusively to the challenges facing libraries in a rapidly changing information technology environment.
World Wide Web Consortium (W3C) The World Wide Web Consortium (W3C) develops interoperable technologies (specifications, guidelines, software, and tools) to lead the Web to its full potential. From W3C, download all of these standards: CSS2 , CSS2.1 , XML 1.0 , XHTML 1.0 , DOM 1 all parts, DOM 2 all parts, DOM 3 all parts, and RDF . These standards are nearly all available in high-quality PDF files and can be viewed electronically with the free Adobe Acrobat Reader .
X.Org X.Org is the worldwide consortium empowered with the stewardship and collaborative development of the X Window System technology and standards.
|
15 of 15 people found the following review helpful
By
This review is from: Rapid Application Development with Mozilla (Paperback)
Most good programming books have clear examples and good Appendices.This book, unfortunately, decided to take the examples and the Appendix and shuffle them together. Code examples for the 'Note Taker' application are hard to follow on first read through. Too much detail is given for tag options (that should have been in appendices), and the example app is never displayed in full. It may just be me, but I learn quicker if I can see something practical and then have it explained. I can identify pieces of a puzzle much better if I know the context of each piece beforehand. It may be "Rapid Application" Development, but I'm afraid it isn't Rapid "Application Development" in my opinion. It's obviously written by someone with a deep understanding of Mozilla application development - I just wished that they had tested it on some Mozilla newbies and taken on board feedback before publishing!
26 of 31 people found the following review helpful
A Kid's Review
This review is from: Rapid Application Development with Mozilla (Paperback)
I have amassed a large collection of guidebooks, learn-by-example books, and technical reference manuals over the years. I have a fairly short temper when it comes to poorly written books, so I tend to feel them out either at the book store, or if possible, online.RAD w/Mozilla is no exception. I downloaded the free PDF version from the publisher's website, and have for the last 4 hours, been beating myself senseless trying to make heads/tails of the example code. In a word: Useless. While the book itself is written in easy-to-read manner gramatically, it absolutely fails as a step-by-step guide for building an app with Mozilla. Quite simply, the author has spent zero time, or so it seems, consolidating his examples. The slipshod manner in which he presents the examples, by scattering a piece here, a piece there, leaves the reader completely lost as to the continuity of the code. I find myself backtracking from chapter three to chapter two in order to... Read more
12 of 14 people found the following review helpful
By
This review is from: Rapid Application Development with Mozilla (Paperback)
Nigel McFarlane has produced one of the most extensive books on application development using Mozilla that I have seen. His writing style is easy to follow and he wisely walks the reader through the creation of a useful example program. Longtime programmers will recognize the traditional "Hello, World" program as a starting point for learning how to program Mozilla. From this small beginning he moves the reader forward to writing a complete program. The coverage of Mozilla is thorough and provides the reader with all the basics they need to have a solid foundation in Mozilla. The XML User interface Language (XUL) is clearly described, the available tools extensively described and explained, and all the other important areas are covered including Listboxes, Chrome, Overlays, Trees, Events, Forms, Menus, Layout, Scripting, RDF, Bindings, XPCOM, and anything else you may need to know. This will not make you a Mozilla expert but it will give you all the basic information...
Read more
|
› See all 14 customer reviews...
Table of Contents
1. Fundamental Concepts.
2. XUL Layout.
3. Static Content.
4. First Widgets and Themes.
5. Scripting.
6. Events.
7. Forms and Menus.
8. Navigation.
9. Commands.
10. Windows and Panes.
11. RDF.
12. Overlays and Chrome.
13. Listboxes and Trees.
14. Templates.
15. XBL Bindings.
16. XPCOM Objects.
17. Deployment.
Index.
About the Author.
Preface
Welcome to Software Development the Mozilla Way
The Mozilla Platform is a large software development tool that is a modern blend of XML document processing, scripting languages, and software objects. It is used to create interactive, user-focused applications. This book is a conceptual overview, reference, and tutorial on the use of the platform for building such applications.
The Mozilla Platform encourages a particular style of software development: rapid application development (RAD). RAD occurs when programmers base their applications-to-be on a powerful development tool that contains much pre-existing functionality. With such a tool, a great deal can be done very quickly. The Mozilla Platform is such a tool.
One strategy for doing RAD is to make sophisticated HTML pages and display them in a Web browser. This book does not explain HTML, nor does it show how to create such pages. It has very little to do with HTML. Instead, it shows how to create applications that require no browser, and that might appear to be nothing like a Web browser. Such applications might be Web-enabled, benefiting from the advantages that Web browsers have, or they might have nothing to do with the Web at all.
Because Mozilla is closely linked to the Web in people's minds, this last point cannot be emphasized enough. The Mozilla Platform is far more than a browser. Here are some statistics:
- Mozilla contains well over 1,000 object types and well over 1,000 interfaces.
- It is highly standards compliant, supporting many standards from bodies such as the W3C, IETF, and ECMA. These bodies are, respectively, the World Wide Web Consortium, the Internet Engineering Task Force, and the European Computer Manufacturers' Association.
- Mozilla is built on a very big source code base and is far larger than most Open Source projects. It is 30 times larger than the Apache Web Server, 20 times larger than the Java 1.0 JDK/JRE sources, 5 times bigger than the standard Perl distribution, twice as big as the Linux kernel source, and nearly as large as the whole GNOME 2.0 desktop source--even when 150 standard GNOME applications are included.
- As a result of the browser wars in the late 1990s, the platform has been heavily tested and is highly optimized and very portable. Not only have hundreds of Netscape employees and thousands of volunteers worked on it, but millions of end users who have adopted Mozilla-based products have scrutinized it as well.
This extensive and tested set of features is a huge creative opportunity for any developer interested in building applications. These features also offer an opportunity for traditional Web developers to broaden their existing skills in a natural way.
This book covers the Mozilla Platform up to version 1.4. Changes between minor versions (e.g., 1.3 and 1.4) are small enough that most of this book will be correct for some time.
Useful Knowledge
Some experience is required when reading this book. Some familiarity with Web standards is assumed. This list of skills is more than enough preparation:
- A little HTML or XHTML
- A little XML
- A little JavaScript, or another scripting language, or one of the C languages (C, C++, C#, Java, IDL)
- A little CSS2
- A little Web page development
- A little SQL
- A little experience working with objects
- The pleasure of having read the W3C's DOM 2 Core standard at least once
All the standards for these technologies, except SQL and JavaScript, are available at <www.w3.org>.
To read this book with very little effort, add these skills: a little Dynamic HTML; a little Prolog; more experience with an object-brokering system like COM or CORBA; additional experience with another RAD tool like a 4GL or a GUI Designer; and more SQL experience.
It is common for advanced Mozilla programmers to have a full copy of the Mozilla Platform source code (40 MB, approximately). This book sticks strictly to the application services provided by the platform. There is no need to get involved in the source code, unless that is your particular interest.
The Structure of This Book
Chapter 1, Fundamental Concepts, is an overview of Mozilla. The remaining chapters mimic the structure of the Mozilla Platform. The early chapters are about the front part of Mozilla, comprising XML markup, which displays the elements of a graphical user interface. As the chapters proceed, the subject matter works its way to the back of Mozilla. The back consists of objects that silently connect to other computing infrastructure, like file systems, networks, and servers. To summarize:
- Chapter 1 is a concept overview.
- Chapters 2-4 describe basic XUL markup. XUL is a dialect of XML.
- Chapter 5 explains the JavaScript language.
- Chapters 6-10 describe interactions between the DOM, JavaScript, and XUL.
- Chapter 11 explains the RDF data format.
- Chapters 12-14 describe interactions between XUL and RDF.
- Chapter 15 explains how to enhance XUL using XBL.
- Chapter 16 describes many useful XPCOM objects. XPCOM is Mozilla's component technology.
- Chapter 17 describes how to deploy a finished application.
Within this flow from front to back, each chapter follows a set structure:
- Facing the start of each chapter is a special diagram called the NPA diagram.
- The first few paragraphs of a chapter introduce the chapter concepts, expanding on brief remarks in Chapter 1, Fundamental Concepts. Read these remarks to identify whether the chapter is relevant to your need.
- For more difficult material, these concepts are expanded into a concept tutorial. Read this tutorial material when looking through the book for the first time, or if a concept seems very foreign.
- Next, all the technical detail is laid out in a structured manner. Many examples are provided to support a first-time read, but this detail is designed to be flipped through and revisited later when you've forgotten something.
- In later chapters, this reference material is followed by a scripting section that explains what JavaScript interactions are possible. Read this when XUL and RDF alone are not enough for your purposes.
- "Style Options" describes the impact of the CSS standards on the chapter. Read this when a window doesn't look right.
- "Hands On" contains the NoteTaker tutorial that runs throughout the book. Read this when you need to get into the coding groove.
- "Debug Corner" contains problem-solving advice and collected wisdom on the chapter's technology. Read this before coding and when you're really stuck.
- Finally, the summary closes with a reflective overview and exits gracefully in the direction of the next chapter.
Some of these structural elements are discussed in the following topics.
The NPA Diagram
The core of the Mozilla Platform is implemented in the C and C++ programming languages, using many object classes. To understand how it all works, one could draw a huge diagram that shows all the object-oriented relationships explicit in those classes. Such a diagram would be quite detailed, and any high-level features of the platform might not be obvious. Although the diagram might be accurate, it would be a challenge to understand.
The NPA diagram is a simplified view of Mozilla's insides. NPA stands for not perfectly accurate. It is a learning aid. No one is arguing that Mozilla is built exactly as the diagram shows; the diagram is just a handy thinking tool. There is no attempt to illustrate everything that Mozilla does.
The NPA diagram appears prior to each chapter of this book. The subject matter of a given chapter is usually tied to a specific part or parts of the diagram.
Style Options
Mozilla makes extensive use of cascading stylesheet styles. In addition to features described in the CSS2 standard, Mozilla has many specialist style extensions. An example of a Mozilla-specific style is
vbox { -moz-box-orient: vertical; }Most chapters contain a short section that describes Mozilla-style extensions relevant to that chapter.
The NoteTaker Tool
NoteTaker is a small programming project that is a running example throughout this book. There isn't room for developing a full application, so the compromise is a small tool that is an add-on. NoteTaker is a Web browser enhancement that provides a way to attach reminder notes (Web notes) to displayed Web pages. The browser user can attach notes to the pages of a Web site, and when that Web site is visited at a later date, the note reappears. This is done without modifying the remote Web site at all. Notes can be created, edited, updated, and deleted.
The browser window shown has a new toolbar, which is the NoteTaker toolbar. That toolbar includes a drop-down menu, among other things. The displayed HTML page includes a small pale rectangle--that is the Web note for the page's URL. That rectangle does not appear anywhere in the displayed test.html file. Also shown is the Edit dialog window, which is used to specify the content and arrangement of the current note.
As an idea, it doesn't matter whether NoteTaker is pure genius or horribly clumsy. Its purpose is to be a working technology demonstrator. Each chapter enhances NoteTaker in a small way so that, by the end of this book, all Mozilla's technologies can be seen at work together.
There is no generally agreed upon technical term for describing NoteTaker. The relationship between the tool and a browser is a little like the relationship between a Java applet and a Java application. It is an add-on that is more than a mere configuration option but less than a plugin.
This example project is attached to a Web browser. Generally speaking, Mozilla applications should run in their own windows with no Web browser in sight. There is no implication that all Mozilla applications should be designed like NoteTaker--it is just that NoteTaker is too small as described here to stand by itself.
Hands On: Tools Needed for Development
Even this short introduction attempts to follow the chapter structure described earlier. To begin development with Mozilla, you need a computer, software, and documentation.
Microsoft Windows, Macintosh, and UNIX/Linux are all acceptable development systems, although MacOS 9 support is slowly being dropped and perhaps should be avoided. The computer does not need to be Internet-enabled or even LAN-enabled after the platform is installed. The Mozilla Web site, www.mozilla.org, is the place to find software. Chapter 1, Fundamental Concepts, discusses software installation in "Hands On."
The sole warning in this introduction relates to documentation. This book alone is simply not enough information for all development needs. It would need to be a 10-volume encyclopedia to achieve that end. Just as UNIX has man(1) pages and applications have help systems, Mozilla has its own electronic reference information. That information complements the material in this book.
Unfortunately, that help information is widely scattered about and must be collected together by hand. Here are the documents you should collect while you are downloading a copy of the platform:
- From the W3C, www.w3.org, download all of these standards: CSS2, CSS2.1, XML 1.0, XHTML 1.0, DOM 1 all parts, DOM 2 all parts, DOM 3 all parts, and RDF. These standards are nearly all available in high-quality PDF files and can be viewed electronically with the free Adobe Acrobat Reader (at www.adobe.com). The CSS2, DOM 2 Core, and DOM 2 Events standards are the most important ones; the others are rarely needed.
- From ECMA, www.ecma.ch, download the ECMA-262 ECMAScript standard. This is the JavaScript standard. You can do without it, but it is occasionally handy.
- From Prentice Hall's Web site, <http://authors.phptr.com/mcfarlane/>, or from the author's Web site, <www.nigelmcfarlane.com>, download sets of XPIDL interface files. These definition files describe all the object interfaces in Mozilla. These files are extracted from the source code and bundled up for your convenience.
- Also from <http://authors.phptr.com/mcfarlane> or from <www.nigelmcfarlane.com>, download class-interface reports. These specially prepared files are a nearly accurate list of the class-interface pairs supported by the platform. These lists help answer the question: What object might I use? They can be manipulated with a text editor or a spreadsheet.
- Finally, it would be helpful to possess a Web development book with a JavaScript focus.
If you are very detail oriented and have copious free time, then you might consider adding a full copy of the Mozilla Platform source code (40 MB approximately). That is not strictly required.
It is common for advanced application programmers to retain a full copy of the Mozilla Platform source code (40 MB, approximately). This book sticks strictly to the application services provided by the platform, so there is no need to get involved in the source code, unless that is your particular interest.
Debug Corner: Unreadable Documentation
Make sure that any documentation you download has the right format for your platform. The UNIX tools unix2dos and dos2unix can help; also UNIX files can be read on Microsoft Windows with any decent text editor (e.g., gvim at <www.vim.org>).
The font system on Linux is sometimes less than adequate and can make PDF text hard to read. To fix this, follow the suggestions in the Mozilla release notes. For other font problems, see the discussion on fonts in Chapter 3, Static Content.
Some standards are written in HTML. If you save these files to local disk and disconnect from the Internet, sometimes they display in a browser very slowly. This is because the browser is trying to retrieve stylesheets from a Web server. To fix this, choose "Work Offline" from the File menu, and reload the document.
Summary
Mozilla is a massively featured development environment with origins in XML, objects, and the Web, and application developers can easily exploit it. I hope you enjoy reading this book as much as I enjoyed writing it. I wish you many constructive and creative hours exploring the technology, should you choose to take it up. With that said, here we go…
Downloadable Sample Chapter
Download the Sample
Chapter related to this title.
Index
Download the Index
file related to this title.
Updates & Corrections
- Chapter 1
Page 35, Section 1.6.5, NoteTaker Preparation:
In dot point 3, for "chrome" put instead: "content".
- Chapter 3
Page 93, Table 3.1, Row 2:
The properties -moz-border-radius-topright and -moz-border-radius-bottomleft (in columns 2 and 3) should be inserted in the first column underneath the property -moz-border-radius-topleft.
Similarly, in row 4, -moz-border-top-colors and -moz-border-left-colors should be inserted in column 1 underneath -moz-border-bottom-colors.
- Chapter 7
Page 249-250, Listings 7.2 and 7.3:
The third argument to open(), which controls the synchronous or asyncronous behaviour of the method is stated in reverse. The default is true, meaning asynchronous behaviour.
In Listing 7.2 req.open() should have an explicit false argument; in Listing 7.3, req.open() should have no third argument (or it should explicitly be set to true). The comment in Listing 7.3 is also incorrectly reversed.
As an aid to readers of Rapid Application Development with Mozilla, we are providing for download in compressed archives XPIDL interface defintions, class-interface reports, and code for the NoteTaker example project.
Download the files for the platform of your choice:
- MacOS9 (4.1 MB, SIT)
- UNIX/Linux (1.7 MB, TGZ)
- Windows (4.2 MB, ZIP)
- All platforms (10 MB, ZIP)
This book includes free shipping!
- Request an Instructor or Media review copy.
- Corporate, Academic, and Employee Purchases
- International Buying Options
Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.

