Plugins/Auth/WebServices: Difference between revisions
From Mahara Wiki
< Plugins | Auth
PiersHarding (talk | contribs) |
PiersHarding (talk | contribs) |
||
Line 35: | Line 35: | ||
The configuration interface can be found under [http://mahara.local.net/admin/extensions/plugins.php Site administration] for plugins - http://mahara.local.net/artefact/webservice/pluginconfig.php | The configuration interface can be found under [http://mahara.local.net/admin/extensions/plugins.php Site administration] for plugins - http://mahara.local.net/artefact/webservice/pluginconfig.php | ||
Read on for more WebServicesConfiguration configuration details. | Read on for more [[WebServicesConfiguration| configuration details]]. | ||
==Testing== | ==Testing== |
Revision as of 09:04, 23 Haziran 2011
Web Services support for Mahara
Artefact Webservices
Web Services plugin based support for Mahara.
The Web Services support is modelled on the webservices subsystem for Moodle and provides REST, XML-RPC, and SOAP alternatives for any registered function. The REST interface also supports JSON.
Installation Instructions
This requires the simple authentication module auth/webservice See https://gitorious.org/mahara-contrib/auth-webservice
To install you need to download both modules:
get https://gitorious.org/mahara-contrib/artefact-webservice/archive-tarball/master
and https://gitorious.org/mahara-contrib/auth-webservice/archive-tarball/master
Then do the following:
cd /path/to/mahara/htdocs/auth tar -xzf /path/to/mahara-contrib-auth-webservice-master.tar.gz mv mahara-contrib-auth-webservice webservice cd /path/to/mahara/htdocs/artefact tar -xzf /path/to/mahara-contrib-artefact-webservice-master.tar.gz mv mahara-contrib-artefact-webservice webservice
You should now have the two necessary modules in place.
Now login as admin to Mahara, and go through the upgrade process to complete the install. In order to make the auth/webservice module available, you should add this as an authentication plugin for each Institution that requires access. Do this via the admin/users/institutions.php page.
Configuration
The configuration interface can be found under Site administration for plugins - http://mahara.local.net/artefact/webservice/pluginconfig.php
Read on for more configuration details.
Testing
The testing framework and examples are based on simpletest unit tests. These are all located in the artefact/webservice/simpletest directory. To run these, you must switch user permissions to the web server user account eg:
# for a debian based install cd /path/to/artefact/webservice/simpletest sudo -u www-data php testwebservice.php
This will run the tests in testwebservice.php which covers all the webservice API functions in artefact/webservice/serviceplugins/(user|group) that make up the core function interfaces.
If you do not switch user permissions then the testing will likely fail as the process will not have write permissions to the Mahara data directory.
Developing Functions for Services
Example Clients
Core Function Interfaces
The base set of APIs are implmented in artefact/webservice/serviceplugins/.
These cover User, Favourite, and Group administration functions.