From Mahara Wiki

< Plugins‎ | Artefact
Revision as of 21:09, 19 May 2011 by Geoffr (talk | contribs) (Use)

Mahara FreeMind mind map plugin

This is an artefact file blocktype plugin to allow Flash rendering of interactive FreeMind mind maps in Mahara Views.

It draws inspiration from the FreeMind filter for Moodle.

Development of this Mahara version was begun by a student, James Kerrigan, on the Foundation degree in Computing and Internet Technology at the University Centre Yeovil.

It uses the FreeMind Flash browser including SWFobject to render the FreeMind files (i.e. using a combination of JavaScript and Flash)

We also have (largely) working code rendering the mind maps using the FreeMind Java applet. If there is any interest, we can make available. However, in our hands this performed more sluggishly than Flash and also had some issues with applet security and Mahara view permissions.


The code may be downloaded from Github

After unpacking the download bundle, installation essentially involves copying the /freemindflash folder (and contents) into the /artefacts/file/blocktype folder of your Mahara installation to give /artefacts/file/blocktype/freemidflash

However, a few additional edits of Mahara core files are required for appropriate handling of FreeMind .mm files.

To /artefacts/file/filetypes.xml

add (e.g. just before )


Then increment the $config->version number in /artefacts/file/version.php and visit the Site Administration page to 'force' the update the artefact_file_mime_types table

Finally, in /artefacts/file/lib.php

Immediately after

       if ($um->file['type'] == 'application/octet-stream') {
           // the browser wasn't sure, so use file_mime_type to guess
           $data->filetype = file_mime_type($um->file['tmp_name']);
       else {
           $data->filetype = $um->file['type'];


       // The browser may have been wrong, so use file extension to force some mime-types.////
       switch ($um->original_filename_extension()) {
           case 'mm': $data->filetype = 'application/x-freemind';

Note that the switch statement can be easily extended to force other mime-types (for other plugins) that are not reliably identified on upload by browsers.


When editing the contents of a View, drag the FreeMindFlash icon from the Files,images and video tab into your View. Then select/upload the .mm file of your choice. You can also set the width and height, though these default to 450 px x 300 px if you don't.



alternative thumb.png

Freemind thumb.png


If you can't upload/see FreeMind .mm files from the file-picker, then there may be problems with the file mime-type handling. Some browser/operating systems don't correctly identify .mm files as application/x-freemind during file upload. So, this has to be 'forced' in Mahara.

To do this, ensure you have applied the 'tweaks' to /artefact/file/filetypes.xml, /artefact/file/version.php and /artefact/file/lib.php detailed above.