Syntax of mimeTypes.rdf and configurability of Download Actions

Thomas Baker <[email protected]> Sat, 27 Oct 2007 19:23:17 +0200
Newsgroups gmane.comp.mozilla.devel.rdf
Message-ID <20071027172317.GA3564@octavius>
Dear all,

Last year (in August 2006), a colleague of mine hand-edited the
file ../profile/mimeTypes.rdf under Firefox 2.0.0.8 (see attached
below) so that I could click on a file with extension ".mbox"
to call up the file in mutt or click on a ".txt" file to edit
the file directly with vim.  I have found this simple ability
to configure the actions associated with file extensions to
be an incredible boost to productivity.

I am currently setting up Firefox on another machine
-- same version number 2.0.0.8 -- but the default
../profile/mimeTypes.rdf currently 2.0.0.8 reads:

    <?xml version="1.0"?>  

    <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

      <Description about="urn:mimetypes"> 
        <NC:MIME-types> 
          <Seq about="urn:mimetypes:root"> 
          </Seq> 
        </NC:MIME-types> 
      </Description> 
    </RDF>

The syntax style of this new mimeTypes.rdf is obviously
different from the August 2006 mimeTypes.rdf below (e.g.,
"<Description>" instead of "<RDF:Description>").  Anyway,
for whatever reasons, my old mimeTypes.rdf does not work with
the more recently downloaded Firefox 2.0.0.8, even when I
try obvious tricks such as "s/RDF://g".

I see that in my older Firefox 2.0.0.8, the Actions hand-coded
into the mimeTypes.rdf are displayed under Options ->
Download Actions.  However, the menus appear to offer no way
to add new file extensions (such as .txt or .mbox) to the
Download Actions.

Thinking this might be an RDF question, I have been looking in
some of the obvious places for previous discussion (e.g., [1]).

I would much appreciate if anyone here could suggest a
workaround for me (maybe I should get binaries of Firefox
2.0.0.8 from last August?).

And if it is has not yet been suggested before, I would
of course also like to suggest that "Tools -> Options ->
Download Actions" be extended make it possible to add new types
of files.  It is one of my favorite features of Firefox... :-)

Many thanks,
Tom Baker

[1] http://groups.google.com/group/mozilla.dev.tech.rdf/topics


----------------------------------------------------------------------
mimeTypes.rdf since August 2006

<?xml version="1.0"?>
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Description RDF:about="urn:mimetype:application/pdf"
                   NC:fileExtensions="pdf"
                   NC:description="Adobe Acrobat 7.0 Document"
                   NC:value="application/pdf"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/pdf"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:text/plain"
                   NC:alwaysAsk="false"
                   NC:useSystemDefault="false"
                   NC:saveToDisk="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:text/plain"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:chemical/x-pdb"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/download"
                   NC:path="C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
                   NC:prettyName="AcroRd32.exe" />
  <RDF:Description RDF:about="urn:mimetype:handler:application/x-msdos-program"
                   NC:alwaysAsk="true"
                   NC:saveToDisk="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-msdos-program"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-zip-compressed"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/msexcell"
                   NC:path="C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE"
                   NC:prettyName="EXCEL.EXE" />
  <RDF:Description RDF:about="urn:mimetype:handler:application/zip"
                   NC:alwaysAsk="true"
                   NC:saveToDisk="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/zip"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/msexcell"
                   NC:fileExtensions="xls"
                   NC:description="Microsoft Excel Worksheet"
                   NC:value="application/msexcell"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/msexcell"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/x-gzip"
                   NC:value="application/x-gzip"
                   NC:editable="true"
                   NC:fileExtensions="gz"
                   NC:description="WinZip-Datei">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-gzip"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/x-external-editor"
                   NC:alwaysAsk="true"
                   NC:useSystemDefault="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-external-editor"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:audio/mpeg"
                   NC:useSystemDefault="false"
                   NC:handleInternal="false"
                   NC:alwaysAsk="true"
                   NC:saveToDisk="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:audio/mpeg"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-gzip"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:video/x-ms-wmv"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:handler:application/download"
                   NC:alwaysAsk="false"
                   NC:saveToDisk="false"
                   NC:useSystemDefault="false"
                   NC:handleInternal="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/download"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-msdos-program"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:handler:chemical/x-pdb"
                   NC:alwaysAsk="true"
                   NC:useSystemDefault="true"
                   NC:saveToDisk="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:chemical/x-pdb"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/vnd.ms-powerpoint"
                   NC:path="C:\Program Files\Microsoft Office\OFFICE11\POWERPNT.EXE"
                   NC:prettyName="POWERPNT.EXE" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:image/jpeg"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:application/rdf+xml"
                   NC:fileExtensions="rdf"
                   NC:description="Resource Description Framework"
                   NC:value="application/rdf+xml"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/rdf+xml"/>
  </RDF:Description>
  <RDF:Seq RDF:about="urn:mimetypes:root">
    <RDF:li RDF:resource="urn:mimetype:application/x-msdos-program"/>
    <RDF:li RDF:resource="urn:mimetype:application/x-zip-compressed"/>
    <RDF:li RDF:resource="urn:mimetype:application/mbox"/>
    <RDF:li RDF:resource="urn:mimetype:application/text"/>
    <RDF:li RDF:resource="urn:mimetype:audio/x-pn-realaudio"/>
    <RDF:li RDF:resource="urn:mimetype:chemical/x-pdb"/>
    <RDF:li RDF:resource="urn:mimetype:application/pdf"/>
    <RDF:li RDF:resource="urn:mimetype:application/rdf+xml"/>
    <RDF:li RDF:resource="urn:mimetype:application/x-gzip"/>
    <RDF:li RDF:resource="urn:mimetype:audio/mpeg"/>
    <RDF:li RDF:resource="urn:mimetype:video/x-ms-wmv"/>
    <RDF:li RDF:resource="urn:mimetype:application/aa-dhelper"/>
    <RDF:li RDF:resource="urn:mimetype:application/vnd.ms-powerpoint"/>
    <RDF:li RDF:resource="urn:mimetype:application/msword"/>
    <RDF:li RDF:resource="urn:mimetype:application/msexcell"/>
    <RDF:li RDF:resource="urn:mimetype:application/download"/>
    <RDF:li RDF:resource="urn:mimetype:application/x-external-editor"/>
    <RDF:li RDF:resource="urn:mimetype:image/jpeg"/>
    <RDF:li RDF:resource="urn:mimetype:application/x-download"/>
    <RDF:li RDF:resource="urn:mimetype:application/zip"/>
    <RDF:li RDF:resource="urn:mimetype:text/rtf"/>
    <RDF:li RDF:resource="urn:mimetype:text/plain"/>
  </RDF:Seq>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/text"
                   NC:path="e:\u\config\text.bat"
                   NC:prettyName="Vim" />
  <RDF:Description RDF:about="urn:mimetype:handler:application/aa-dhelper"
                   NC:alwaysAsk="false"
                   NC:saveToDisk="false"
                   NC:useSystemDefault="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/aa-dhelper"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetypes">
    <NC:MIME-types RDF:resource="urn:mimetypes:root"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/rdf+xml"
                   NC:handleInternal="false"
                   NC:alwaysAsk="true"
                   NC:useSystemDefault="true"
                   NC:saveToDisk="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/rdf+xml"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:text/rtf"
                   NC:alwaysAsk="true"
                   NC:useSystemDefault="true"
                   NC:saveToDisk="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:text/rtf"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/zip"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-external-editor"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/aa-dhelper"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:video/x-ms-wmv"
                   NC:value="video/x-ms-wmv"
                   NC:editable="true"
                   NC:fileExtensions="wmv"
                   NC:description="Windows Media Audio/Video file">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:video/x-ms-wmv"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/x-download"
                   NC:alwaysAsk="true"
                   NC:saveToDisk="true"
                   NC:useSystemDefault="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-download"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/msexcell"
                   NC:saveToDisk="false"
                   NC:handleInternal="false"
                   NC:alwaysAsk="false"
                   NC:useSystemDefault="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/msexcell"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:audio/mpeg"
                   NC:fileExtensions="mp3"
                   NC:description="MP3 Format Sound"
                   NC:value="audio/mpeg"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:audio/mpeg"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:image/jpeg"
                   NC:alwaysAsk="true"
                   NC:saveToDisk="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:image/jpeg"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/aa-dhelper"
                   NC:fileExtensions="adh"
                   NC:description="Audible Download Helper"
                   NC:value="application/aa-dhelper"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/aa-dhelper"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/msword"
                   NC:saveToDisk="false"
                   NC:alwaysAsk="false"
                   NC:useSystemDefault="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/msword"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:text/plain"
                   NC:prettyName=""
                   NC:path="E:\u\config\text.bat" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:audio/mpeg"
                   NC:path="C:\Program Files\Windows Media Player\wmplayer.exe"
                   NC:prettyName="wmplayer.exe" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:text/rtf"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:application/msword"
                   NC:fileExtensions="doc"
                   NC:description="Microsoft Word Document"
                   NC:value="application/msword"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/msword"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/text"
                   NC:alwaysAsk="false"
                   NC:saveToDisk="false"
                   NC:useSystemDefault="false"
                   NC:handleInternal="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/text"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/x-download"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:chemical/x-pdb"
                   NC:fileExtensions="pdb"
                   NC:description="Palm Database File"
                   NC:value="chemical/x-pdb"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:chemical/x-pdb"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:audio/x-pn-realaudio"
                   NC:alwaysAsk="true"
                   NC:useSystemDefault="true"
                   NC:saveToDisk="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:audio/x-pn-realaudio"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/vnd.ms-powerpoint"
                   NC:alwaysAsk="false"
                   NC:saveToDisk="false"
                   NC:useSystemDefault="false"
                   NC:handleInternal="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/vnd.ms-powerpoint"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/x-gzip"
                   NC:alwaysAsk="true"
                   NC:saveToDisk="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-gzip"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/x-zip-compressed"
                   NC:alwaysAsk="true"
                   NC:saveToDisk="true"
                   NC:useSystemDefault="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/x-zip-compressed"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/x-msdos-program"
                   NC:value="application/x-msdos-program"
                   NC:editable="true"
                   NC:fileExtensions="exe"
                   NC:description="Application">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-msdos-program"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/x-external-editor"
                   NC:value="application/x-external-editor"
                   NC:editable="true"
                   NC:fileExtensions="php"
                   NC:description="">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-external-editor"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/pdf"
                   NC:alwaysAsk="false"
                   NC:saveToDisk="true"
                   NC:useSystemDefault="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/pdf"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/zip"
                   NC:value="application/zip"
                   NC:editable="true"
                   NC:fileExtensions="zip"
                   NC:description="WinZip-Datei">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/zip"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:image/jpeg"
                   NC:value="image/jpeg"
                   NC:editable="true"
                   NC:fileExtensions="jpg"
                   NC:description="IrfanView JPG File">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:image/jpeg"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/vnd.ms-powerpoint"
                   NC:fileExtensions="ppt"
                   NC:description="Microsoft PowerPoint-Präsentation"
                   NC:value="application/vnd.ms-powerpoint"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/vnd.ms-powerpoint"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/mbox"
                   NC:path="e:\u\config\mbox.bat"
                   NC:prettyName="Mutt" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/rdf+xml"
                   NC:path="C:\Program Files\Mozilla Thunderbird\thunderbird.exe"
                   NC:prettyName="thunderbird.exe" />
  <RDF:Description RDF:about="urn:mimetype:text/plain"
                   NC:value="text/plain"
                   NC:editable="true"
                   NC:description="Plain Text File">
    <NC:fileExtensions>txt</NC:fileExtensions>
    <NC:fileExtensions>tex</NC:fileExtensions>
    <NC:handlerProp RDF:resource="urn:mimetype:handler:text/plain"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/x-zip-compressed"
                   NC:fileExtensions="zip"
                   NC:description="WinZip-Datei"
                   NC:value="application/x-zip-compressed"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-zip-compressed"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:text/rtf"
                   NC:fileExtensions="rtf"
                   NC:description="Rich Text Format"
                   NC:value="text/rtf"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:text/rtf"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:video/x-ms-wmv"
                   NC:alwaysAsk="true"
                   NC:saveToDisk="true">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:video/x-ms-wmv"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/x-download"
                   NC:description=""
                   NC:value="application/x-download"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/x-download"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:audio/x-pn-realaudio"
                   NC:fileExtensions="ram"
                   NC:description="RealPlayer Presentation"
                   NC:value="audio/x-pn-realaudio"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:audio/x-pn-realaudio"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/pdf"
                   NC:path="C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe"
                   NC:prettyName="AcroRd32.exe" />
  <RDF:Description RDF:about="urn:mimetype:application/mbox"
                   NC:value="application/mbox"
                   NC:editable="true"
                   NC:fileExtensions="mbox"
                   NC:description="Mailbox File">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/mbox"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:externalApplication:audio/x-pn-realaudio"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/msword"
                   NC:prettyName=""
                   NC:path="" />
  <RDF:Description RDF:about="urn:mimetype:application/text"
                   NC:value="application/text"
                   NC:editable="true">
    <NC:fileExtensions>txt</NC:fileExtensions>
    <NC:fileExtensions>tex</NC:fileExtensions>
    <NC:description>Plain Text File</NC:description>
    <NC:description>Plain Tex File Treated as Text</NC:description>
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/text"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:handler:application/mbox"
                   NC:alwaysAsk="false"
                   NC:saveToDisk="false"
                   NC:useSystemDefault="false"
                   NC:handleInternal="false">
    <NC:externalApplication RDF:resource="urn:mimetype:externalApplication:application/mbox"/>
  </RDF:Description>
  <RDF:Description RDF:about="urn:mimetype:application/download"
                   NC:fileExtensions="pdf"
                   NC:description="Adobe Acrobat 7.0 Document"
                   NC:value="application/download"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/download"/>
  </RDF:Description>
</RDF:RDF>


-- 
Tom Baker - [email protected] - [email protected]