Re: Creating a Media handler extension for molecular files ?
Nicolas Vervelle <nvervelle <at> gmail.com>
2010-12-01 22:11:53 GMT
Hi Brion and others,
On Tue, Nov 23, 2010 at 12:46 AM, Nicolas Vervelle <nvervelle <at> gmail.com>wrote:
> On Mon, Nov 22, 2010 at 11:57 PM, Brion Vibber <brion <at> pobox.com> wrote:
>> On Mon, Nov 22, 2010 at 1:03 PM, Nicolas Vervelle <nvervelle <at> gmail.com
>> > Molecular files exist in several formats : pdb, cif, mol, xyz, cml, ...
>> > Usually they are detected as simple MIME types (either text/plain or
>> > application/xml) by MediaWiki and not as more precise types (even if
>> > types exist : chemical/x-pdb, chemical/x-xyz, ...).
>> > It seems that to register a Media handler, I have to add an entry to
>> > $wgMediaHandlers : $wgMediaHandler['text/plain'] = 'MolecularHandler';
>> > Will it be a problem to use such a general MIME type to register the
>> > handler
>> > ? Especially for files of the same MIME type but that are not molecular
>> > files ?
>> You'd want to make sure the type detection correctly identifies your files
>> so you can associate the handler types, or it's going to make things
>> For XML files, you should usually be able to add to the $wgXMLMimeTypes
>> array, which by default recognizes the root elements for HTML, SVG, and
>> vector drawings -- see the entries in DefaultSettings.php as examples. It