Actions

Developer Area/Import//Export/LEAP Import/Blog Artefact Plugin

From Mahara Wiki

< Developer Area‎ | Import//Export‎ | LEAP Import
Revision as of 18:56, 9 May 2011 by Brettwilkins (talk | contribs) (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"> …")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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)