Actions

Difference between revisions of "Developer Area/Import//Export/LEAP Export"

From Mahara Wiki

< Developer Area‎ | Import//Export
Line 1: Line 1:
Mahara's Leap export is implemented as a plugin for Mahara's [[Developer Area/Import//Export/Export API|"Export" plugin type]]. It allows Mahara to export [http://wiki.cetis.ac.uk/LEAP2A_specification Leap2A] files, which Mahara can also [[Developer Area/Import//Export/LEAP Import|import]].
+
http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/Export_API
 +
http://wiki.cetis.ac.uk/LEAP2A_specification
 +
http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Import
 +
http://wiki.cetis.ac.uk/LEAP2A_specification
 +
http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Export/Blog_Artefact_Plugin
 +
http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Export/File_Artefact_Plugin
 +
http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Export/Internal_Artefact_Plugin
 +
http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Export/Resume_Artefact_Plugin
 +
../../../../Developer_Area/Import%2f%2fExport/Interoperability
 +
Mahara's Leap export is implemented as a plugin for Mahara's [[Developer Area/Import%2f%2fExport/Export API|"Export" plugin type]]. It allows Mahara to export [http://wiki.cetis.ac.uk/LEAP2A_specification Leap2A] files, which Mahara can also [[Developer Area/Import%2f%2fExport/LEAP Import|import]].
  
 
'''''Note:''''''' A working understanding of the [http://wiki.cetis.ac.uk/LEAP2A_specification 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.''
 
'''''Note:''''''' A working understanding of the [http://wiki.cetis.ac.uk/LEAP2A_specification 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.''
Line 29: Line 38:
 
If using the latter method, the artefact plugin needs to provide a <code>LeapExport</code> class that extends <code>LeapExportArtefactPlugin</code>. This class has one contract method - <code>get_export_xml</code>. It is then up to that method to generate all the XML for all artefacts in the plugin. The internal artefact plugin does this to generate the persondata element for the user who is exporting the portfolio.
 
If using the latter method, the artefact plugin needs to provide a <code>LeapExport</code> class that extends <code>LeapExportArtefactPlugin</code>. This class has one contract method - <code>get_export_xml</code>. It is then up to that method to generate all the XML for all artefacts in the plugin. The internal artefact plugin does this to generate the persondata element for the user who is exporting the portfolio.
  
* [[Developer Area/Import//Export/LEAP Export/Blog Artefact Plugin|Blog artefact plugin export]]
+
* [[Developer Area/Import%2f%2fExport/LEAP Export/Blog Artefact Plugin|Blog artefact plugin export]]
* [[Developer Area/Import//Export/LEAP Export/File Artefact Plugin|File artefact plugin export]]
+
* [[Developer Area/Import%2f%2fExport/LEAP Export/File Artefact Plugin|File artefact plugin export]]
* [[Developer Area/Import//Export/LEAP Export/Internal Artefact Plugin|Internal artefact plugin export]]
+
* [[Developer Area/Import%2f%2fExport/LEAP Export/Internal Artefact Plugin|Internal artefact plugin export]]
* [[Developer Area/Import//Export/LEAP Export/Resume Artefact Plugin|Resume artefact plugin export]] 
+
* [[Developer Area/Import%2f%2fExport/LEAP Export/Resume Artefact Plugin|Resume artefact plugin export]] 
  
 
</div><div id="section_4">
 
</div><div id="section_4">
Line 44: Line 53:
 
===Exporting from Other Systems===
 
===Exporting from Other Systems===
  
We have documented the results of exporting to other systems, as well as importing, in the [[../../../../Developer Area/Import//Export/Interoperability|Interoperability]] section.
+
We have documented the results of exporting to other systems, as well as importing, in the [[../../../../Developer Area/Import%2f%2fExport/Interoperability|Interoperability]] section.
  
 
</div>
 
</div>

Revision as of 18:05, 12 May 2011

http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/Export_API http://wiki.cetis.ac.uk/LEAP2A_specification http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Import http://wiki.cetis.ac.uk/LEAP2A_specification http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Export/Blog_Artefact_Plugin http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Export/File_Artefact_Plugin http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Export/Internal_Artefact_Plugin http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Export/Resume_Artefact_Plugin ../../../../Developer_Area/Import%2f%2fExport/Interoperability Mahara's Leap export is implemented as a plugin for Mahara's "Export" plugin type. It allows Mahara to export Leap2A files, which Mahara can also import.

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.

Architecture

The Leap export plugin lives in htdocs/export/leap/. The core export algorithm is implemented here, as well as other parts necessary to implement the Mahara export API. Most of the work is done by the PluginExportLeap class, which represents the process of producing an export for an individual user.

In addition to this, each artefact plugin can provide the export/leap/lib.php file, which the plugin searches for in order to do most of the heavy lifting. The core Mahara artefact plugins all provide the ability to export their respective artefact types. If you are writing an artefact plugin and your plugin does not supply any artefact type that can be meaningly exported in a Leap file, you don't have to provide the export/leap/ directory at all.

Implementation

The export is generated by building a string containing the Leap2A XML, as well as copying files from their location in dataroot into a temporary directory. The XML is written to a leap2a.xml file, and the entire package is zipped up. The plugin provides the location of the zip file to caller.

Mostly, the XML is built by use of smarty templates.

Artefacts

Artefact plugins have two choices for implementing Leap2A export - either to generate XML for each artefact in turn, or generate XML all in one go for all of their artefacts.

If using the former method, there is a base class - LeapExportElement - provided to give rudimentary export of any artefact. The artefact plugin may have to extend this class to add extra information to the exported XML for artefacts of a given type. If this is the case, the artefact plugin can provide a LeapExportElement class (e.g. LeapExportElementBlog), which the plugin will automatically use when found.

If using the latter method, the artefact plugin needs to provide a LeapExport class that extends LeapExportArtefactPlugin. This class has one contract method - get_export_xml. It is then up to that method to generate all the XML for all artefacts in the plugin. The internal artefact plugin does this to generate the persondata element for the user who is exporting the portfolio.

Views

The plugin exports views itself as selections of the type 'Webpage'.

Exporting from Other Systems

We have documented the results of exporting to other systems, as well as importing, in the Interoperability section.

Subpages