[widgets] Media type declarations

Given numerous emails regarding requiring that we allow authors to
identify and/or override the MIME types of files in a widget, I would
like to propose the following requirement for the Widgets
Configuration Document section of the Requirements document; as well
as the following technical solution for the P&C spec.

RXX. MIME type declaration
A conforming specification MUST either specify or recommend a means of
allowing authors to declare the MIME type of resources for the
purposes of rendering or processing at runtime.

Motivation:
    Web and offline distribution, and device independence.
Rationale:
    To give authors control over how resources are treated by a widget
user agent. For example, to allow authors to declare that a file with
the extension .php should actually be treated as having the
'text/html' MIME type.

For  the configuration document, I propose the following strawman:

==The media Element==

The media element allows authors to associate custom MIME type with a
particular file extension.

Context in which this element may be used:
    In the widget element.
Content model:
    Empty.
Occurrences:
    Zero or more.

==Attributes==
ext
   The file extension to which the MIME type identified by the type
attribute will be assigned to.
type
   The MIME type assigned to any file whose extension matches the
value of the ext attribute.

Example
<widget xmlns="..." >
   <media ext='php' type='application/html+xml' />
</widget>

=== ISSUES/Questions ===
Do we allow authors to override default types? For example, is this allowed?

   <media ext='html' type='application/html+xml' />

Do we allow mapping of multiple extensions to a single type? e.g.
   <media ext='php cfm asp' type='text/html' />

Another idea that people have floated around is to have an independent
manifest document (manifest.xml). I guess it would look something
like:

<manifest xmlns='...'>
   <file path="/some/path.file" type="some/type" [charset=""] />
   <file path="/some/other/path.file" type="some/other+type" />
</manifest>

Kind regards,
Marcos

-- 
Marcos Caceres
http://datadriven.com.au

Received on Wednesday, 18 February 2009 15:36:32 UTC