下面有一系列的其它技术介绍,作为利用Mozilla的XUL来开发跨平台的web应用程序的补充。
XBL
可扩展绑定语言(XBL)是一种用来定义特殊的新元素(如XUL物件的“绑定”)的标记语言。使用XBL,开发人员可以定义一些XUL物件的新内容,为XUL增加一些附加的事件处理器,或者增加一些新的属性和方法。本质上来说,XBL通过定制已经存在的标签和创建新的标签来授权给开发人员尽可能的扩展XUL。
使用XBL时,开发人员可以简单的构建自定义的用户接口物件,像进度条,各式弹出菜单,事件工具栏和搜索表单等。这些自定义组件可以通过特殊的自定义标签和关联属性在XUL应用程序中被使用。
Overlays
Overlays被用来申明一些UI的额外内容的XUL文件。使用覆盖小片的XUL文件,而不必重新提供整个UI,并且尽量重用UI中某些特定的部分的这种通用的机制,用于向UI增加额外的组件。
Overlays对于定制和扩展已经存在的应用程序来说是狠有用的机制,因为他们工作在两种关联但是高度不同的方式上。某些方面来说,Overlays和其它语言中的的“include”文件是同义的,因为一个应用程序可以在他的定义处使用Overlay方式来包含。但是Overlays也可以使用外部指定,允许设计者无需修改原始代码来添加程序之外的特性。
在实际应用中,该特性允许开发人员为已发布的程序维护一个代码流,以后可以为客户定制商标或者专门的依赖于源码的特性。该方向是一个那些长期运行程序的更加容易和低花费的完整解决方案。
对于打算为Mozilla增加新特性的软件开发人员来说,使用Overlays方式是有很大好处的。Netscape公众协议(NPL)和Mozilla公众协议(MPL)要求企图修改原始特性(随Mozilla一起提供的源码文件)的开发人员发布修改代码给消费者。Overlays可以被用来给Mozilla增加私有特性,而无需修改原始的开发代码。
XPCOM/ XPConnect
XPCOM and XPConnect是XUL应用程序集成和使用外部库的补充技术。
XPCOM是跨平台组件对象模型的标准,也是一个写跨平台软件的框架。XPCOM组件可以使用C,C++,和JavaScript来写,可以使用C,C++,JavaScript,Python和处于发展下的Perl扩展。
XPConnect是一种允许在XPCOM和JavaScript之间简单协作的技术。XPConnect允许JavaScript对象直接访问和操作XPCOM对象。它也允许JavaScript对象通过XPCOM接口来调用XPCOM对象。
总之,XPCOM和XPConnect允许开发人员创建需要使用编译型语言(C/C++)特殊处理的或者与操作系统相关的XUL应用程序。
XPInstall
XPInstall,Mozilla的跨平台安装特性,提供了一个使用安装脚本来打包XUL应用程序组件标准方法,可以被Mozilla下载和执行。
XPInstall允许用户轻松的通过Internet或者从公司内部服务器上安装一个新的XUL程序。安装一个新的应用程序,用户只需要点击web页面上或者邮件中的超链接,并通过一个Mozilla安装对话框接受新包安装。
--------------------原文------------------------
Supporting Technologies
There are number of other technologies introduced by Mozilla that complement XUL for building cross platform web applications.
|
XBL |
The eXtensible Bindings Language (XBL) is a markup language that defines special new elements, or "bindings" for XUL widgets. With XBL, developers can define new content for XUL widgets, add additional event handlers to a XUL widget, and add new interface properties and methods. Essentially, XBL empowers developers with the ability to extend XUL by customizing existing tags and creating new tags of their own.
By using XBL, developers can easily build custom user interface widgets such as progress meters, fancy pop-up menus, and even toolbars and search forms. These custom components can then be used in XUL applications by specifying the custom tag and associated attributes. |
|
Overlays |
Overlays are XUL files used to describe extra content for the UI. They are a general mechanism for adding UI for additional components, overriding small pieces of a XUL file without having to resupply the whole UI, and reusing particular pieces of the UI.
Overlays are a powerful mechanism for customizing and extending existing applications because they work in two related but highly different ways. In one respect, Overlays are synonymous with "include" files in other languages because an application may specify that an Overlay be included in its definition. But Overlays can also be specified externally, enabling the designer to superimpose them upon an application without changing the original source.
In practical terms, this enables developers to maintain one code stream for a given application then apply custom branding or include special features for customers with a completely independent code base. This leads to an overall solution that is easier and less costly to maintain in the long run.
There is an additional benefit to Overlays for software developers who intend to add features to Mozilla that they wish to keep proprietary. The Netscape Public License (NPL) and Mozilla Public License (MPL) require developers who alter original work (source code files that are provided with Mozilla) to release the source code for these changes to their customers. Overlays can be used to add features to Mozilla without contaminating the original open source code with proprietary alterations. |
|
XPCOM/ XPConnect |
XPCOM and XPConnect are complementary technologies that enable the integration of external libraries with XUL applications.
XPCOM, which stands for Cross Platform Component Object Model, is a framework for writing cross-platform, modular software. XPCOM components can be written in C, C++, and JavaScript, and they can be used from C, C++, JavaScript, , and with Perl extensions under development.
XPConnect is a technology which enables simple interoperation between XPCOM and JavaScript. XPConnect allows JavaScript objects to transparently access and manipulate XPCOM objects. It also enables JavaScript objects to present XPCOM compliant interfaces to be called by XPCOM objects.
Together, XPCOM and XPConnect enable developers to create XUL applications that require the raw processing power of compiled languages (C/C++) or access to the underlying operating system. |
|
XPInstall |
XPInstall, Mozilla's Cross Platform Install facility, provides a standard way of packaging XUL application components with an install script that Mozilla can download and execute.
XPInstall enables users to effortlessly install new XUL applications over the Internet or from corporate intranet servers. To install a new application the user need only click a hypertext link on a web page or in an email message and accept the new package through a Mozilla install dialog. |