Developer Area/Import//Export/LEAP Import
From Mahara Wiki
< Developer Area | Import//ExportRevision as of 16:15, 11 May 2011 by WikiSysop
Note: A working understanding of the Leap2A spec will help you understand the documentation written here. We suggest you at least partially familiarise yourself with the spec before diving into the code or this documentation.
The Leap import plugin lives in
htdocs/import/leap/. The core import algorithm is implemented here, as well as other parts necessary to implement the Mahara import API. Most of the work is done by the PluginImportLeap class, which represents a Leap export and the process of importing it.
In addition to this, each artefact plugin can provide the
import/leap/lib.php file which the core searches for in order to do most of the heavy lifting. The core Mahara artefact plugins provide this so that, for example, files and blogs in Leap files are imported as files and blogs in Mahara. If you are writing an artefact plugin and your plugin does not supply any artefact type that can be meaningly imported from a Leap file, you don't have to provide the
import/leap/ directory at all.
The code uses the PHP extension simplexml to parse the Leap files. This extension is bundled with PHP5 by default, so you're very likely to have it available.
This algorithm is still under development. Please see the implementation plan for an exhaustive description of the algorithm as it was planned. The algorithm has not changed much from how that document describes it.
Artefact Plugins and Leap Import
From a Leap export:
- The blog artefact plugin imports blogs, blog posts and their attachments.
- The file artefact plugin imports files and folders, and detects and imports profile icons.
- The resume artefact plugin imports employment history and other personal/professional records.
- The internal artefact plugin imports basic profile information.
- The Leap import plugin itself handles the importing of Views
Importing from Other Systems
We have documented the results of importing from other systems, as well as exporting, in the Interoperability section.
You should probably validate incoming Leap2A exports before filing a bug against the Mahara Leap importer.