Finding the right Plugin type

Finding the right Plugin type

by Paul Stanyer -
Number of replies: 3
I'm writing a plugin at the moment which will export some Moodle data into CVS files every night and FTP this to a remote location.

I'd quite like to take advantage of the plugin architecture so that I can auto-install the plugin, as I need to create a database table (to save FTP attempts/status), and would also like to be able to have a config page for this so that I can edit FTP settings.

This is all fine, my only problem is that I can't decide the most appropriate plugin type. It's not really an activity, and it shouldn't be added to a course, it's just a site-wide tool.

It's also not, I believe, any of these:

Admin report
Assignment type
Authentication plugin
Course format
Course report
Database field
Database preset
Enrolment plugin
Filter
Portfolio Plugin
Question type
Question import/export format
Quiz report
Repository plugin
Resource type
Search engine adapter

Gradebook export could be useful I guess, but there isn't any documentation for this.

That leaves me thinking about createing a block for Admin on the home page, but it just seems like I'm forcing it in to the closest fit, rather than a good solution? My other option I'm contemplating is to shove it all in a sub directoy under Moodle root, and then just add a new admin page.

Can anyone suggest a better approach?

Thanks!
Average of ratings: -
In reply to Paul Stanyer

Re: Finding the right Plugin type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Well, there is a better option than 'shove it all in a sub directoy under Moodle root'. Instead, shove it in a directory called local.

Also, an admin report might be appropriate. That, at least, is an easy way to make it accessible to admins only. Also, it is reporting something, just to an FTP server, rather than a HTML page. You could have an HTML page with the settings and confirmation of when the report last run as what you see when you go to the report in your web browser.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Finding the right Plugin type

by Paul Stanyer -
Tim, I hadn't seen the local directory before; it's certainly useful to know about, although I fear I might be tempted to use it in the future, rather than think of a better solution ;)

In this case though, I like the idea of having a report module to display a report on each of the FTP attempts, and then hooking into the cron to actually run the service.

Thanks for your input.
In reply to Paul Stanyer

Re: Finding the right Plugin type

by Michael Penney -
A module that only shows up at the site level would let you hook into the main cron for exporting reports, backup and restore, etc. which IMO would be closer to good than a new directory in the root (easier to share/install/maintain).