Difference between revisions of "Developer Area/Import//Export/LEAP Import/Blog Artefact Plugin"
From Mahara Wiki
< Developer Area | Import//Export | LEAP Import
|Line 35:||Line 35:|
Latest revision as of 16:40, 16 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
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.
- Import raw ATOM feed entries as blog posts (needs testing)