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

From Mahara Wiki
Jump to navigation Jump to search
(Created page with "The blog artefact plugin hooks into the LEAP import system to import blogs, blog posts and their attachments. <div id="section_1"> …")
 
Line 3: Line 3:
 
<div id="section_1">
 
<div id="section_1">
  
=== Import Strategies Provided ===
+
===Import Strategies Provided===
  
 
In LEAP terms, the blog artefact plugin looks for entries that are of [http://wiki.cetis.ac.uk/2009-03/LEAP2A_types#selection leap type "selection"] and that have the [http://wiki.cetis.ac.uk/2009-03/LEAP2A_categories/selection_type#Blog 'Blog' selection type]. For each entry that is found, it looks for all entries that are a part of it ([http://wiki.cetis.ac.uk/2009-03/LEAP2A_relationships#has_part has_part] in LEAP terms), and assumes they are blog posts to be imported. The blog plugin suggests to the LEAP importer that importing such entries as blogs is a very good match.
 
In LEAP terms, the blog artefact plugin looks for entries that are of [http://wiki.cetis.ac.uk/2009-03/LEAP2A_types#selection leap type "selection"] and that have the [http://wiki.cetis.ac.uk/2009-03/LEAP2A_categories/selection_type#Blog 'Blog' selection type]. For each entry that is found, it looks for all entries that are a part of it ([http://wiki.cetis.ac.uk/2009-03/LEAP2A_relationships#has_part has_part] in LEAP terms), and assumes they are blog posts to be imported. The blog plugin suggests to the LEAP importer that importing such entries as blogs is a very good match.
Line 11: Line 11:
 
</div><div id="section_2">
 
</div><div id="section_2">
  
=== How Entries are Imported ===
+
===How Entries are Imported===
  
 
The plugin imports any entries it is given to import by using the artefact API to create blog and blogpost objects.
 
The plugin imports any entries it is given to import by using the artefact API to create blog and blogpost objects.
Line 23: Line 23:
 
</div><div id="section_3">
 
</div><div id="section_3">
  
=== TODOs ===
+
===TODOs===
  
 
* Import raw ATOM feed entries as blog posts (needs testing)
 
* Import raw ATOM feed entries as blog posts (needs testing)
Line 29: Line 29:
 
<div id="section_4">
 
<div id="section_4">
  
== Further Information ==
+
==Further Information==
  
 
* [http://git.mahara.org/?p=mahara.git;a=blob;f=htdocs/artefact/blog/import/leap/lib.php;hb=HEAD artefact/blog/import/leap/lib.php in source control] 
 
* [http://git.mahara.org/?p=mahara.git;a=blob;f=htdocs/artefact/blog/import/leap/lib.php;hb=HEAD artefact/blog/import/leap/lib.php in source control] 

Revision as of 15:15, 11 May 2011

The blog artefact plugin hooks into the LEAP import system to import blogs, blog posts and their attachments.

Import Strategies Provided

In LEAP terms, the blog artefact plugin looks for entries that are of leap type "selection" and that have the 'Blog' selection type. For each entry that is found, it looks for all entries that are a part of it (has_part in LEAP terms), and assumes they are blog posts to be imported. The blog plugin suggests to the LEAP importer that importing such entries as blogs is a very good match.

The blog plugin also suggests that any other entry can be imported, with a low score. This is in alignment with the idea that LEAP2A exports should be able to be imported by an Atom reader, with all entries degenerating to blog posts if no other match is found.

How Entries are Imported

The plugin imports any entries it is given to import by using the artefact API to create blog and blogpost objects.

  • The title and description are imported as is.
  • The ctime and mtime are set to the and entry values respectively.
  • Tags are imported for both blogs and blog posts from the appropriate .
  • Attachments are linked to the blog using the setup_relationships() hook, as at this point we can guarantee the file plugin has loaded the file artefacts required.
  • The published flag for each post is imported based on its readiness category - the default is "published" unless this declares that the post is a draft.

TODOs

  • Import raw ATOM feed entries as blog posts (needs testing)