Plugins/Artefact/FreeMindFlash
From Mahara Wiki
< Plugins | Artefact
Mahara FreeMind mind map plugin
This is an artefact file blocktype plugin to allow Flash rendering of interactive FreeMind mind maps (.mm XML files) in Mahara Pages (Views).
http://freemind.sourceforge.net
It also works with .mm files generated by Freeplane (a fork of FreeMind). Other mind mapping software may also have the option to export in .mm format.
http://freeplane.sourceforge.net
It draws inspiration from the FreeMind filter for Moodle.
http://docs.moodle.org/en/FreeMind_filter
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/Freeplane Flash browser including SWFobject to render the FreeMind files (i.e. using a combination of JavaScript and Flash)
http://freemind.sourceforge.net/wiki/index.php/Flash_browser http://code.google.com/p/swfobject/
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 page/view permissions.
Installation
The latest code, which should work with Mahara 1.2, 1.3, 1.4 and 1.5 may be downloaded from Github
https://github.com/geoffrowland/mahara-artefact_file_blocktype_freemindflash
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 (Note: after unpacking the bundle, you may find that you have a folder labeled geoffrowland-mahara-artefact_file_blocktype_freemindflash-cc1115d. You will need to open that folder and click down through a few folders to find the freemindflash folder. It is that folder that you will need to upload to your server.)
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 <!-- General types -->)
<!-- FreeMind mind maps --> <filetype> <description>mm</description> <mimetypes> <mimetype>application/x-freemind</mimetype> </mimetypes> </filetype>
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 (Note: to "increment the $config->version number increase your current $config->version number by one. That is, if your current number is: 202020202, make the number 202020203)
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 require_once('file.php'); $data->filetype = file_mime_type($um->file['tmp_name']); } else { $data->filetype = $um->file['type']; }
Add
// The browser may have been wrong, so use file extension to force some mime-types.//// require_once('file.php'); switch ($um->original_filename_extension()) { case 'mm': $data->filetype = 'application/x-freemind'; break; }
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.
Use
When editing the contents of a Page (View), drag the FreeMindFlash icon (thumb.png, below) from the Files, images and video tab into the Page. Then select/upload the .mm file of your choice. You can also set the width and height (default 450px x 300px).
thumb.png - from Gregor Anželj
Alternative thumb.png - from Geoff Rowland
Issues
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.
On first adding a mind map to a View, you may get a No Flash warning. A page refresh should show the embedded interactive mind map.
ToDo
- Thorough review against Developer Area/Coding guidelines
- The bundled SWFobject Flash/JavaScript library is duplicated in the video display libraries in Mahara. Perhaps rationalise this.
- Research/develop HTML5/SVG alternative to Flash or Java applet for interactive display of .mm files. This would allow broader cross-platform support. Note that static mindmap images can be exported from FreeMind in a variety of formats (PNG, JPEG, SVG, PDF etc) and then uploaded/embedded in Mahara pages