Actions

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

From Mahara Wiki

< Developer Area‎ | Import//Export‎ | LEAP Import
No edit summary
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The blog artefact plugin hooks into the [[Developer Area/Import//Export/LEAP Import|LEAP import system]] to import blogs, blog posts and their attachments.
The blog artefact plugin hooks into the [[Developer Area/Import%2f%2fExport/LEAP Import|LEAP import system]] to import blogs, blog posts and their attachments.


<div id="section_1">
<div id="section_1">
Line 32: Line 32:


* [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] 
* [[Developer Area/Import//Export/LEAP Export/Blog Artefact Plugin|LEAP Blog Export]]
* [[Developer Area/Import%2f%2fExport/LEAP Export/Blog Artefact Plugin|LEAP Blog Export]]


</div></div>
</div></div>
[[Category:Developer Area]][[Category:LEAP]][[Category:Plugins]]

Latest revision as of 16:40, 16 Mayıs 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)