Rapid Application Development with Mozilla (Bruce Perens' Open Source Series)

Paperback (Print)
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 96%)
Other sellers (Paperback)
  • All (19) from $1.99   
  • New (6) from $7.70   
  • Used (13) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$7.70
Seller since 2014

Feedback rating:

(5)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
NEW BOOK UNREAD USUALLY SHIPS IN 24 HRS

Ships from: MIAMI, FL

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$7.70
Seller since 2009

Feedback rating:

(109)

Condition: New
New NEW BOOK UNREAD USUALLY SHIPS IN 24 HRS.

Ships from: Miami, FL

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$25.00
Seller since 2005

Feedback rating:

(35)

Condition: New
Black & White Diagrams Upper Saddle River, NJ., USA 2004 Decorative Soft Cover First Edition Brand New Book. No Jacket (As issued) 769 Pages, Brand New Book. Our books ship the ... day they're sold. Read more Show Less

Ships from: Bellingham, WA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$31.95
Seller since 2007

Feedback rating:

(23167)

Condition: New
BRAND NEW

Ships from: Avenel, NJ

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
$49.98
Seller since 2008

Feedback rating:

(17214)

Condition: New
Brand New, Perfect Condition, Please allow 4-14 business days for delivery. 100% Money Back Guarantee, Over 1,000,000 customers served.

Ships from: Westminster, MD

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
$57.06
Seller since 2013

Feedback rating:

(2)

Condition: New
New

Ships from: San Diego, CA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Page 1 of 1
Showing All
Close
Sort by

Overview

A must-have read for anybody interested in learning to build sophisticated applications with the Mozilla application framework.—Mitchell Baker, President, The Mozilla Foundation

Mozilla has grown to become a powerful framework for building cutting-edge web applications. Rapid Application Development with Mozilla is an indispensable guide for developers of such applications.—Brendan Eich, Chief Architect, The Mozilla Foundation, and Creator of JavaScript

Far more than just a web browser, Mozilla is the platform of choice for today's application and web developer. An innovative blend of XML vocabularies, easy-to-use scripting languages, and pre-existing software objects, Mozilla is a powerful, standards-compliant platform whose functionality guarantees rapid application development (RAD).

In Rapid Application Development with Mozilla, web, XML, and Open Standards expert Nigel McFarlane explores Mozilla's revolutionary XML User interface Language (XUL) and its library of well over 1,000 pre-built objects. Using clear and concise instruction, McFarlane explains what companies such as AOL, IBM, Hewlett-Packard, and others already know—that Mozilla and XUL are the keys to quickly and easily creating cross-platform, web-enabled applications. Coverage includes:

  • A detailed introduction to the fundamentals and capabilities of Mozilla
  • Full descriptions of Mozilla tools, including XUL, XBL, and XPCOM
  • The RDF data format and its interactions with XUL, including Listboxes, Chrome, Overlays, Trees, and Templates
  • Events, Forms, Menus, Navigation, and Commands using DOM, JavaScript™, and XUL
  • Tips for integration into Windows® and Mac® systems
  • A guide to deployment of finished applications
  • Hundreds of examples, screenshots, and code listings

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. When installed in a browser it allows you to add notes to web pages—even pages on other people's web sites! It is a memory and commentary tool that enhances repeat visits to a given site. This simple application provides a real-world example of all technologies used in the book.

If you're an application programmer or a web developer and you're looking for a productive, state-of-the-art, cross-platform programming tool, then Rapid Application Development with Mozilla is essential reading.

Read More Show Less

Product Details

Meet the Author

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.

Read More Show Less

Read an Excerpt

Introduction

Welcome to Software Development the Mozilla Way

The Mozilla Platform is a large software development tool that is a modern blend of

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
  • 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

  • Chapter 1 is a concept overview.
  • Chapters 2-4 describe basic XUL markup. XUL is a dialect of
  • 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,
  • 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

Read More Show Less

Table of Contents

Acknowledgments
Welcome to Software Development the Mozilla Way
1 Fundamental Concepts 1
2 XUL Layout 41
3 Static Content 81
4 First Widgets and Themes 103
5 Scripting 137
6 Events 197
7 Forms and Menus 239
8 Navigation 265
9 Commands 295
10 Windows and Panes 325
11 RDF 361
12 Overlays and Chrome 411
13 Listboxes and Trees 435
14 Templates 497
15 XBL Bindings 563
16 XPCOM Objects 617
17 Deployment 705
Index 753
About the Author 771
Read More Show Less

Preface

Introduction

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…

Read More Show Less

Introduction

Introduction

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 InternetEngineering 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.

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 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 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. The CSS2, DOM 2 Core, and DOM 2 Events standards are the most important ones; the others are rarely needed.
  • From ECMA 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, or from the author's Web site, 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 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.

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…

Read More Show Less

Customer Reviews

Average Rating 4
( 2 )
Rating Distribution

5 Star

(0)

4 Star

(2)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 2 Customer Reviews
  • Anonymous

    Posted January 25, 2004

    Amazing Reference for Mozilla Developers

    Mozilla is earning new prominence in today's fast-paced Internet society. So for anyone who wants to know how to leverage Mozilla's power for their own Web applications, they need a decent practicum. Enter Rapid Application Development with Mozilla. This is a highly detailed book that starts at the beginning and ends at the end, such as it is. The technology is so open ended, it's hard to find a place to stop, so it is left up to the user's imagination and desire to take the technology explained in the book wherever they want to go. Two of the biggest things Mozilla brings to the table are DOM (the Document Object Model) and XUL (the XML User-interface Language). For anyone who already understands the basic data structure of XML, they can realize huge benefits from Mozilla's XUL interface. The book details how to use these technologies to build exceptional Web applications which can be integrated with other technologies like JavaScript?. From the most basic examples to the beginnings of large application examples, a reader can find most anything within the pages of this book. It can be used as a learning tutorial if read cover to cover. Or, with its extensive index consisting of topics, tags and assorted conventions, one could simply use this book as a reference guide. The only drawback I could find with the text is its limited scope. However, if you're not the sort of person who is going to be designing Web applications using Mozilla's tools, you would hardly be interested in this book anyway.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted December 14, 2003

    Much more than a Browser

    Surely the browser wars are over? Microsoft's Internet Exploreer won, right? Certainly, on desktops, IE is said to be on over 90%, with the rest divvied up between Netscape, Mozilla, Konqueror, Opera and sundry others. Plus, by now most browsers have the same core functionality. So on your desktop, regardless of what browser you are currently using, why switch to another type anyway? As opposed to following the upgrade path for your browser. Given all this, you might askk why we need a book on Mozilla? Game over, right? Well, Mozilla has become far more than just a browser. It is now a chassis or platform upon which to quickly develop applications. It has a library of over 1000 objects, GUI and nonGUI, that have been extensively tested. The idea is that you can then easily write your application in JavaScript, using this library. By the way, JavaScript is the only choice. You might compare Mozilla to java and its now large library, or to C++ and its Standard Template Library. The book points out repeatedly that this is open source and free. Here, free is the operative word. Because, as McFarlane is careful to note, for the typical developer, open source Mozilla is moot. If you want rapid development, you have neither the time or inclination to acquaint yourself with the source at a level that you can usefully change it. The book does not seem to say the following, but I offer it as extra guidance. If you want to compare Mozilla with a Microsoft product of similar functionality, then that is not IE. Rather, it might be Visual Studio .NET. Also, in the open source arena, another alternative to Mozilla is Eclipse, donated by IBM. Eclipse is also extensible, but where you program in Java.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 2 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)