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 had to find 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). I will refer to this id from now on as [your provider id].
  • In sakai.properties add this line:
    org.sakaiproject.authz.api.GroupProvider=[your provider 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 aparently 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). I will refer to this id from now on as [your cms id].
  • In sakai.properties add this line:
    org.sakaiproject.coursemanagement.api.CourseManagementService=[your cms id]

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

 

Note: to get this working on the cafe version, the providers project should be deployed also.

Overige Blog Posts

Sakai Commercial Affiliate Program

Blogger: Melvin Wevers

Datum: 04-02-2010 - 09:52

Edia is onlangs lid geworden van het Sakai Foundation Commercial Affiliate program. Hiermee ondersteunt Edia het werk van de Foundation, de ontwikkeling van Sakai, en kan zo directer bijdragen aan Open Source innovaties binnen het hoger onderwijs. Hier kunt een overzicht vinden van de bedrijven die lid zijn van het programma.

Nieuwslezer op deelnemersdag Stichting ABC

Blogger: Maarten van Hoof

Datum: 17-12-2009 - 17:46

Op de deelnemersdag van de Stichting Belangenbehartiging Alfabetisering (Stichting ABC) was Edia uitgenodigd om de Slimme Nieuwslezer te presenteren in een tweetal workshops aan laaggeletterden. We waren bovendien genomineerd voor de ABC-trofee, die de Stichting ABC jaarlijks toekent aan een persoon, bedrijf of instelling met een bijzondere belangstelling voor de problemen van (functioneel) analfabeten en laaggeletterden.

Creating your own GroupProvider in Sakai

Blogger: Maarten van Hoof

Datum: 12-05-2009 - 11:07

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.

Wethouder leert met de Slimme Nieuwslezer

Blogger: Maarten van Hoof

Datum: 21-04-2009 - 16:59

Op vrijdag 17 april bracht Lodewijk Asscher, wethouder van onderwijs en inburgering in Amsterdam, een werkbezoek aan de Openbare Bibliotheek Amsterdam (OBA). Bij die gelegenheid heeft Rintse van der Werf een presentatie gehouden over de Slimme Nieuwslezer, een variant van de Alane Nieuwslezer die op alle vestigingen van de OBA gratis beschikbaar is om inburgeraars te helpen bij het leren van Nederlands.

Part Of Speech Tagging en GWT

Blogger: Roland Groen

Datum: 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.

Sakai en A-Select

Blogger: Roland Groen

Datum: 19-12-2008 - 10:43

In veel onderwijs en onderzoek installaties wil men gebruik maken van authenticatie die centraal geregeld wordt en tussen de verschillende systemen transparant is. Een oplossing hiervoor is A-select.

Sakai Hosting and Services

Blogger: Jaeques Koeman

Datum: 15-11-2008 - 15:02

Edia loopt voorop in Nederland op het gebied van ontwikkeling, implementatie en hosting van Sakai. Sakai is de open source Virtual Learning Environment (VLE) van de toekomst.

Launch of the 'Smart Newsreader'

Blogger: Rintse van der Werf

Datum: 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.