Hello,
I am interested in developing an extension for handling molecular files (files containing informations about chemical molecules : atoms, bonds, ...). If I understand correctly it will enable me to display specific informations in the File:... page, like what MediaWiki does for simple images. Something like existing extensions (FlvHandler, OggHandler, PagedTiffHandler, PNGHandler, TimedMediaHandler in SVN trunk for example).
I have read several pages on MediaWiki about writing extensions, but they are not very detailed for media handler extensions. I have also written an extension to display and interact with moleculeshttp://wiki.jmol.org/index.php/Jmol_MediaWiki_Extension, but I still have several questions on how I can create a handler for molecular files in MediaWiki. Any help or links to some explanations will be appreciated.
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 this 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 ? Are there some precautions to take into account ? (like letting an other handler deal with the file if it's not a molecular file, ...)
I want to use the Jmol http://www.jmol.org/ applet for displaying the molecule in 3d, and allowing the user to manipulate it. But the applet is about 1M in size, so it takes time to load the first time, then to start and load the molecular file. I would like to start showing a still image (generated on the server) and a button to let the user decide when loading the applet if interested in. Several questions for doing this with MediaWiki :
- What hook / event should I use to be able to add this content in the File:... page ? - Is there a way to start displaying the File:... page, compute the still image in the background,and add it in the File:... page after ? - Are there any good practices for doing this kind of things ?
Is it also possible to create thumbnails in articles if they include links to a molecular file (like [[File:example.pdb]]) ? What hook should I use ? Is it possible to compute the thumbnail in the background ?
Any other advice for writing a media handler extension ? Or other possibilities that could enhance the extension ? Among the few handler extensions in SVN, which is the better example ?
Thanks for any help Nico