Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Repository API: Difference between revisions

From MoodleDocs
(Update migration status and path)
Tag: Removed redirect
 
(138 intermediate revisions by 24 users not shown)
Line 1: Line 1:
The aim is to make Moodle flexible enough to link to any repository so that Moodle users can use them to find files for use in Moodle, as well as storing their own documents there.
{{Template:Migrated|newDocId=/docs/apis/plugintypes/repository}}
 
#REDIRECT [[Repository plugins]]
To do this we will implement a layer in Moodle that takes care of the details, so that as far as Moodle modules are concerned there is just a single coherent "File system".
 
==Major Tasks==
 
===Create Repository API===
 
The API is basically a class library of functions that expose the JSR-170 functionality.  For example, there will be simple functions like get_file(), search_files(), insert_file() etc (not actual names) as well as more detailed functions for handling versions, metadata etc.
 
Plugins will extend this class, overriding certain functions with local implementations of that functionality.  Plugins will also publish information about what functionality they support.  For example, some repositories may be read-only, so everything to do with writing needs to be disabled in the interface.
 
===Create File-based Repository Plugin===
 
This simple plugin will implement as much as needed to replicate the functionality that we have now (with the exception that data is not course-based any longer).
 
===Create JSR-170 Repository Plugin===
 
This simple plugin really just "passes through" commands between Moodle and an external JSR-170 compliant repository (eg [http://jackrabbit.apache.org/ Jackrabbit] or [http://www.alfresco.com/ Alfresco]).
 
===Convert Moodle code to use the API===
 
Basically, wherever Moodle reads/writes files the code needs to be converted to use the repository API instead.  Some of the hardest work will be in the area of Roles and Permissions.
 
===Build Admin interface===
 
The admin interface allows the admin to add new repositories and set them up for use in Moodle.  The admin may also decide which people can see certain repositories based on Role.
 
===Build new user interfaces===
 
Wherever people deal with files (resources, forum attachments etc) they need a "file picker" to let them select and interact with the repository.  This file picker needs to then pass back information to the context where it was called (eg pass the path of a file back to the resource-adding page).
 
If there is only one repository configured, then the interface just shows actions possible with that repository.  If there is more than one repository then the user sees a menu in the picker to switch their "current" repository.

Latest revision as of 14:03, 24 June 2022

Important:

This content of this page has been updated and migrated to the new Moodle Developer Resources. The information contained on the page should no longer be seen up-to-date.

Why not view this page on the new site and help us to migrate more content to the new site!

  1. REDIRECT Repository plugins