Developer Area/Import//Export/LEAP Import/Blog Artefact Plugin
From Mahara Wiki
< Developer Area | Import//Export | LEAP Import
http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Import http://wiki.cetis.ac.uk/2009-03/LEAP2A_types#selection http://wiki.cetis.ac.uk/2009-03/LEAP2A_categories/selection_type#Blog http://wiki.cetis.ac.uk/2009-03/LEAP2A_relationships#has_part http://wiki.cetis.ac.uk/2009-03/LEAP2A_categories/readiness http://git.mahara.org/?p=mahara.git;a=blob;f=htdocs/artefact/blog/import/leap/lib.php;hb=HEAD http://wiki.mahara.org/Developer_Area/Import%2f%2fExport/LEAP_Export/Blog_Artefact_Plugin 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)