Creating your own GroupProvider in Sakai

In Sakai, the GroupProvider provides user / role membership in a group, from an external system. We are currently involved in a project that implements GroupProvider to allow the members of a federated administration workspace to manage the worksites created inside that federated administration worksite. More on that in future posts. Here I'd like to briefly give a few pointers about implementing your own GroupProvider.

I'm doing this against Sakai 2.5.3.

First of all, read Chuck Severance's blog post about creating an allhands group: http://www.dr-chuck.com/csev-blog/000205.html.

The source code that Chuck is referring to is in your Sakai source tree under [SAKAI_SRC]\providers\allhands You'll find a number of very useful examples in [SAKAI_SRC]\providers, that I wish I would have found earlier.

Some of the information in Chuck's post is outdated. First of all, Sakai now ships with a GroupProvider out of the box and since there can only be a single GroupProvider, the out of the box version has to be disabled. Secondly, you can't manually change the Provider ID in your worksites realm anymore, because the provider ID will be checked by the CourseManagementService configured. The latter is an undocumented feature that I found out by debugging.

Fortunately, both the GroupProvider and the CourseManagementService can be configured in Sakai properties. This is contrary to popular belief that both have to be beans with ids that match the fully qualified name of the interface. The fact that you can do your configuration in sakai.properties is good news, because if the configuration did involve creating beans with the proper ids, that would mean disabling the GroupProvider and CourseManagementService beans that ship out of the box. That would be Bad News because it requires you to patch the Sakai source code (Spring configuration is source too, you know), which I try to avoid as much as possible.

So to set up your own GroupProvider, do the following:

  • Implement the GroupProvider interface.
  • Configure a bean in the components.xml file of your pack that sets up your GroupProvider as a singleton. Give it any id you like (but NOT org.sakaiproject.authz.api.GroupProvider).
  • In sakai.properties add this line:
    org.sakaiproject.authz.api.GroupProvider=[your id]

This sets up your GroupProvider, but introduces a problem. When you try to change the realm using the realms tool, doing so will fail because the realms tool will consult the CourseManagementService to ask whether it knows the Provider ID that you supply. This is a bit strange, really, because the tool apparently assumes a particular implementation of the GroupProvider. Moreover, if there is no CourseManagementService configured (which is the case in the 2.5.x-cafe branch), editing the realm will fail entirely.

Luckily, the course management service can be configured in the same way that the GroupProvider is configured: using sakai.properties. So to set up your own CourseManagementService:

  • Implement a dummy CourseManagementService. It doesn't have to do anything.
  • Configure a bean in the components.xml file of your pack that sets up your CourseManagementService as a singleton. Give it any id you like (but NOT org.sakaiproject.coursemanagement.api.CourseManagementService).
  • In sakai.properties add this line:
    org.sakaiproject.coursemanagement.api.CourseManagementService=[your id]

That should do it. What exactly my GroupProvider does is the topic of my next post.

Overige Blog Posts

Mixing Spring MVC Controllers with Spring Annotations

Blogger: Roland Groen

Date: 20-08-2011 - 14:00

Read the article at our confluence page Mixing Spring MVC Controllers with Spring Annotations

Sakai en SURFconext: federated team sites en Sakai openSocial gadgets

Blogger: Jaeques Koeman

Date: 18-03-2011 - 16:29

Edia heeft de afgelopen maanden gewerkt aan Sakai als service provider binnen de samenwerkinginfrastructuur die door SURFnet wordt ontwikkeld. SURFconext zorgt dat diensten van verschillende aanbieders met en naast elkaar gebruikt kunnen worden waardoor nieuwe samenwerkingsmogelijkheden ontstaan. Instellingen passen SURFconext toe om interne en externe diensten te integreren en om gebruikers een samenwerkingsomgeving te bieden die meebeweegt met hun online samenwerkingsbehoefte (Bron: surfnet.nl).

Sakai Scorm Player at the Dutch NOiv Plugfest

Blogger: Melvin Wevers

Date: 12-10-2010 - 15:12

Edia has been awarded the 100% score with the Sakai SCORM player at the Dutch NOiV Plugfest. During this event, organized by NOiV and Kennisnet, experts on education show how open-source eLearning can be employed within different eLearning platforms and Authoring environments. Edia’s version became first in the ranking of the eLearning category which also featured It’s Learning and N@tschool. The Sakai SCORM player works within the Sakai architecture, and it a continuation of the work of UC Davis.

Creating your own GroupProvider in Sakai

Blogger: Maarten van Hoof

Date: 12-05-2009 - 11:04

In Sakai, the GroupProvider provides user / role membership in a group, from an external system. We are currently involved in a project that implements GroupProvider to allow the members of a federated administration workspace to manage the worksites created inside that federated administration worksite. More on that in future posts. Here I'd like to briefly give a few pointers about implementing your own GroupProvider.

Part Of Speech Tagging en GWT

Blogger: Roland Groen

Date: 20-03-2009 - 12:20

In de Alane Suite berekenen we de moeilijkheid van tekst op basis van hoe vaak de woorden in de tekst voorkomen. Een tekst met alleen veelvoorkomende woorden is gemakkelijker dan een tekst met weinig voorkomende woorden. Hierop baseren wij de berekening van de moeilijkheid van teksten voor de Alane Nieuwslezer. Het woord "de" is makkelijker dan het woord "allengs".  Het eerste woord komt vaker voor, dus kom je het vaker tegen, dus is de kans dat je weet wat het betekent groter. Dat is dus de theorie, en in de praktijk blijkt dat prima te werken.

Launch of the 'Smart Newsreader'

Blogger: Rintse van der Werf

Date: 15-10-2008 - 14:53

In a project sponsored by a digital pioneers grant of Netherlands Knowledgeland software from Edia's ALANE suite is used to help immigrants with learning Dutch vocabulary used in today's newspaper articles.