Actions

Difference between revisions of "Developer Area/Import//Export/LEAP Import/Internal Artefact Plugin"

From Mahara Wiki

< Developer Area‎ | Import//Export‎ | LEAP Import
(Created page with "The internal artefact plugin hooks into the LEAP import system to import basic profile data for the user being imported - excluding …")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The internal artefact plugin hooks into the [[Developer Area/Import//Export/LEAP Import|LEAP import system]] to import basic profile data for the user being imported - excluding profile icons, which are handled by the [[Developer Area/Import//Export/LEAP Import/File Artefact Plugin|file artefact plugin]].
+
The internal artefact plugin hooks into the [[Developer Area/Import%2f%2fExport/LEAP Import|LEAP import system]] to import basic profile data for the user being imported - excluding profile icons, which are handled by the [[Developer Area/Import%2f%2fExport/LEAP Import/File Artefact Plugin|file artefact plugin]].
  
 
<div id="section_1">
 
<div id="section_1">
  
=== Import Strategies Provided ===
+
===Import Strategies Provided===
  
 
This plugin provides one strategy to import raw entries that correspond to some profile fields that don't map nicely to the LEAP standard [http://wiki.cetis.ac.uk/2009-03/LEAP2A_personal_data persondata]. The bulk of the importing is handled by the <code>import_author_data</code> hook.
 
This plugin provides one strategy to import raw entries that correspond to some profile fields that don't map nicely to the LEAP standard [http://wiki.cetis.ac.uk/2009-03/LEAP2A_personal_data persondata]. The bulk of the importing is handled by the <code>import_author_data</code> hook.
Line 9: Line 9:
 
</div><div id="section_2">
 
</div><div id="section_2">
  
=== How Entries are Imported ===
+
===How Entries are Imported===
  
 
As this plugin has to potentially deal with details about the feed itself, rather than just the entries inside it, there is a special hook called <code>import_author_data</code> called to deal with importing data about the feed owner. This hook uses the person entry corresponding to the user if present, otherwise it does the best it can with the <code></code> element for the feed (also if present).
 
As this plugin has to potentially deal with details about the feed itself, rather than just the entries inside it, there is a special hook called <code>import_author_data</code> called to deal with importing data about the feed owner. This hook uses the person entry corresponding to the user if present, otherwise it does the best it can with the <code></code> element for the feed (also if present).
Line 19: Line 19:
 
</div><div id="section_3">
 
</div><div id="section_3">
  
=== TODOs ===
+
===TODOs===
  
 
* How do we want to handle potentially overwriting data?
 
* How do we want to handle potentially overwriting data?
Line 28: Line 28:
 
<div id="section_4">
 
<div id="section_4">
  
== Further Information ==
+
==Further Information==
  
 
* [http://git.mahara.org/?p=mahara.git;a=blob;f=htdocs/artefact/internal/import/leap/lib.php;hb=HEAD artefact/internal/import/leap/lib.php in source control] 
 
* [http://git.mahara.org/?p=mahara.git;a=blob;f=htdocs/artefact/internal/import/leap/lib.php;hb=HEAD artefact/internal/import/leap/lib.php in source control] 
* [[Developer Area/Import//Export/LEAP Export/Internal Artefact Plugin|LEAP Internal Export]]
+
* [[Developer Area/Import%2f%2fExport/LEAP Export/Internal Artefact Plugin|LEAP Internal Export]]
  
 
</div></div>
 
</div></div>
 +
[[Category:Developer Area]][[Category:Plugins]][[Category:Artefact Plugins]][[Category:LEAP]]

Latest revision as of 15:49, 16 May 2011

The internal artefact plugin hooks into the LEAP import system to import basic profile data for the user being imported - excluding profile icons, which are handled by the file artefact plugin.

Import Strategies Provided

This plugin provides one strategy to import raw entries that correspond to some profile fields that don't map nicely to the LEAP standard persondata. The bulk of the importing is handled by the import_author_data hook.

How Entries are Imported

As this plugin has to potentially deal with details about the feed itself, rather than just the entries inside it, there is a special hook called import_author_data called to deal with importing data about the feed owner. This hook uses the person entry corresponding to the user if present, otherwise it does the best it can with the element for the feed (also if present).

This hook attempts to map the LEAP persondata fields to Mahara's profile fields, although there isn't a perfect mapping. Sometimes, the non-standard mahara: attributes have to be examined to determine what to do with an imported field.

Three fields are imported from raw entries, by examining the mahara:plugin attribute to see if it is "internal" - Occupation, Industry and Student ID. Neither occupation nor industry map well to a LEAP persondata field. While Student IDs are covered by the LEAP spec, the Student ID field in Mahara does not correspond to a particular service, so cannot be exported as persondata.

TODOs

  • How do we want to handle potentially overwriting data?
  • Address for person (leap:spatial) - our export might have to be modified to output them in a more "correct" order for other systems
  • Validate the values of profile fields coming in? Especially email
  • Refactor the bunches of duplicate code