All,
I'm running a private Mediawiki within the company - and I want to embed objects other than the standard picture MIME formats. Obviously, clients need to have the software installed - and I know how to allow certain upload file types - but how do I enable the client to display the embedded object ?
This seems like it should be an FAQ - but I can't find any other info. Jon. PS the file type I'm particularly interested in is ISIS sketch - which is a molecular drawing program (and is different to Moelcule e.g. jMOL). ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. -----------------------------------------------------------
Jon.G.Bartlett@gsk.com wrote:
All,
I'm running a private Mediawiki within the company - and I want to embed objects other than the standard picture MIME formats. Obviously, clients need to have the software installed - and I know how to allow certain upload file types - but how do I enable the client to display the embedded object ?
This seems like it should be an FAQ - but I can't find any other info. Jon. PS the file type I'm particularly interested in is ISIS sketch - which is a molecular drawing program (and is different to Moelcule e.g. jMOL).
If no-one has written a plugin for that file type already, you'll have to do one yourself. Basically it's a media type handler, so say if the type is application/x-isis, you'd have:
$wgMediaHandlers['application/x-isis'] = 'IsisHandler';
class IsisHandler extends MediaHandler { function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) { return new IsisPluginOutput( $image->getURL() ); }
...a few other functions to define here but all pretty easy... }
class IsisPluginOutput extends MediaTransformOutput { function __construct( $url ) { $this->url = $url; }
function toHtml( $options = array() ) { return Xml::element( 'object', array( 'src' => $this->url, ... object attributes per ISIS documentation ... ) ); } }
Put that in a file, fill in the blanks, and share it as an extension on www.mediawiki.org.
Unfortunately it's necessary at the current time to do one of these for each object type you want to embed. If you have a media handler like this, then the plugin will be invoked on the file description page, and for file links in wiki pages like [[File:Foo.mol]].
-- Tim Starling
To: mediawiki-l@lists.wikimedia.org From: Jon.G.Bartlett@gsk.com Date: Fri, 3 Jul 2009 10:18:34 +0100 Subject: [Mediawiki-l] Configuring to allow Embedding different MIME types
All,
I'm running a private Mediawiki within the company - and I want to embed objects other than the standard picture MIME formats. Obviously, clients need to have the software installed - and I know how to allow certain upload file types - but how do I enable the client to display the embedded object ?
This seems like it should be an FAQ - but I can't find any other info. Jon. PS the file type I'm particularly interested in is ISIS sketch - which is a molecular drawing program (and is different to Moelcule e.g. jMOL).
This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_________________________________________________________________ Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le maintenant ! http://www.windowslive.fr/messenger/1.asp
To: mediawiki-l@lists.wikimedia.org From: Jon.G.Bartlett@gsk.com Date: Fri, 3 Jul 2009 10:18:34 +0100 Subject: [Mediawiki-l] Configuring to allow Embedding different MIME types
All,
I'm running a private Mediawiki within the company - and I want to embed objects other than the standard picture MIME formats. Obviously, clients need to have the software installed - and I know how to allow certain upload file types - but how do I enable the client to display the embedded object ?
This seems like it should be an FAQ - but I can't find any other info. Jon. PS the file type I'm particularly interested in is ISIS sketch - which is a molecular drawing program (and is different to Moelcule e.g. jMOL).
This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_________________________________________________________________ Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ? Lancez-vous ! http://www.microsoft.com/windows/windowslive/default.aspx
mediawiki-l@lists.wikimedia.org