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

Alane Nieuwslezer in Levende Talen Magazine

Blogger: Remy Lamers

Date: 25-06-2010 - 11:04

In het Levende Talen Magazine van mei 2010 staat een artikel over de Alane Slimme Nieuwslezer. In het artikel schrijft John Daniëls over zijn ervaring met de Alane Nieuwslezer als leerling en docent.

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.