<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<rfc ipr="full3978" docName="draft-tclarke-aeb-00">
   <front>
      <title abbrev="AEB">Application Extension Bundle (AEB)</title>
      <author initials="T." surname="Clarke" fullname="Trevor R H Clarke">
         <organization abbrev="BATC">Ball Aerospace &amp; Technologies Corp.</organization>
         <address>
            <postal>
               <street>2875 Presidential Dr.</street>
               <city>Fairborn</city>
               <region>OH</region>
               <code>45324</code>
               <country>US</country>
            </postal>
            <phone>+1 937 320 7087</phone>
            <email>tclarke@ball.com</email>
            <uri>http://www.ballforge.net/</uri>
         </address>
      </author>
      <date month="July" day="31" year="2008" />
      <area>Applications</area>
      <keyword>RFC</keyword>
      <keyword>Request for Comments</keyword>
      <keyword>I-D</keyword>
      <keyword>Internet-Draft</keyword>
      <keyword>RDF</keyword>
      <abstract>
         <t>
            This memo presents a file format for describing an application extension bundle.
            An application extension bundle, otherwise know as an add-on, extension, plug-in,
            suite, or package, is an encapsalation of all the data needed to add functionality
            to a plug-in based application.
         </t>
      </abstract>
   </front>
   <middle>
      <section title="Introduction">
         <t>
            An application extension bundle (AEB) encapsulates all the data required to extend
            an application. Often refered to as a plug-in or add-on, an AEB is a specific format
            designed to be application and platform agnostic.
            
            AEB defines common file formats and directory layouts. Extension and specification points
            are defined by a target application.
         </t>
         <section title="Relationship to XPI">
            <t>
               The AEB format is based on the XPI format used by the <xref target="refs.XPInstall">Mozilla XPInstall</xref>
               addon system. XPI is a compelling format containing much of the metadata and encapsulation information needed
               for an AEB. However, the XPI format is tightly coupled to the Mozilla project and the description documents
               often refer to specific XPI engine implementation details. AEB standardizes XPI and removes the Mozilla specific
               details. The original version of AEB is nearly an exact copy of the XPI format with minor changes and clarifications.
               AEB should, however, be considered a fork of XPI and further changes to XPI may not be reflected in AEB.
            </t>
         </section>
      </section>
      <section title="File Format">
         <t>An AEB is a <xref target="refs.zip">ZIP archive</xref> containing AEB specific files and target
         application files. The AEB specific files within the ZIP must use commonly compatible ZIP options.
         Since ZIP is a defacto standard, the features which are commonly compatible are not explicitly stated
         here but can be determined by a survey of available ZIP libraries. The version of the published ZIP
         specification at the time this document was written is 6.3.2. Optional compression algorithms and ZIP
         file extensions may be supported by a target application for target application specific files.
         
         An AEB may also exist as a directory hierarchy on a file system or file system-like service. (such as an FTP site)
         This is intended for use while devoloping an AEB. An AEB should be deployed as a ZIP archive.
         
         The file extension of an AEB ZIP archive must be .aeb unless a particular system does not support file extensions.
         When an AEB is associated with a MIME type (such as when served by an HTTP server) the MIME type should be
         application/x-aeb. The MIME type may be application/zip or application/octet-stream. A target application
         may impose additional file extension and MIME type restrictions. (for example, .myapp.app and application/x-aeb+x-myapp)
         A target application imposing additional restrictions may only require those restrictions on AEBs targetting
         only the target application. An AEB with multiple target applications must use only the restrictions in this document.
         A target application should always accept files meeting only the restrictions in this document.</t>
      </section>
      <section title="Required Files and Directories">
         <t>Every AEB must contain an install manifest in /install.rdf. This file contains a AEB metadata written
         in the <xref target="refs.aebl">application extension bundle description language (AEBL)</xref>. This file shall
         be serialized in RDF+XML format. The root directory may also contain the following directories.
         </t>
         <section title="/content">
            <t>This contains most of the AEBs extension files. The contents of this directory are specific to a
            target application but generally contain files which will be installed in the target application.</t>
         </section>
         <section title="/platform">
            <t>The /platform directory may contain sub-directories for each platform declared in the install.rdf file. The contents
            of the sub-directory corresponding to the current platform are unioned with the /content directory. If both directories
            contain a specific file, the /platform directory takes precedence. Not all platforms declared in the install.rdf file
            require a /platform directory.</t>
         </section>
         <section title="/icon">
            <t>This directory generally contains icon files referenced in the install.rdf file. These should not be installed
            by the target application.</t>
         </section>
         <section title="/license">
            <t>This directory generally contains license files referenced in the install.rdf file. There should not be installed
            by the target application.</t>
         </section>
      </section>
      <section anchor="multiitem" title="Multiple item AEB">
         <t>An AEB may contain multiple AEB archives if the multiple item AEB type is specified in the install.rdf file.
         The /content and /platform directories should contain only files with the .aeb extension. These must be AEB ZIP archives.
         AEB archives in the /content directory shall be installed on all platforms and AEB archives in a sub-directory
         of /platform shall be installed on that platform. The installation order may be arbitrary but a target application
         may define a specific order. Failure to install any AEB archive in a multiple item AEB shall result in failure to
         install the entire multiple item AEB.</t>
      </section>
      <section title="Failure to Install">
         <t>Installation of an AEB shall be an atomic operation. Failure to install an AEB shall remove a partially installed AEB.</t>
      </section>
      <section title="Shared Files">
         <t>If an AEB request installation of a resource which is already present in the target application, the resource should
         be reference counted. When an AEB with a shared resource (a resource with a reference count greater than one) should
         only remove the resource if decrementing the reference count yields a new reference count of zero.</t>
      </section>
   </middle>
   <back>
      <references>
         <reference anchor="refs.aebl">
            <front>
               <title>Application Extension Bundle description Language (AEBL)</title>
               <author initials="T." surname="Clarke" fullname="Trevor R H Clarke">
                  <organization abbrev="BATC">Ball Aerospace &amp; Technologies Corp.</organization>
               </author>
               <date month="July" day="31" year="2008"/>
            </front>
            <seriesInfo name="I-D" value="draft-tclarke-aebl-00"/>
         </reference>
         <reference anchor="refs.XPInstall" target="http://www.mozilla.org/projects/xpinstall/">
            <front>
               <title>Mozilla XPInstall</title>
            </front>
         </reference>
         <reference anchor="refs.zip" target="http://www.pkware.com/documents/casestudies/APPNOTE.TXT">
            <front><title>.ZIP File Format Specification</title></front>
         </reference>
      </references>
   </back>
</rfc>
