Daily Training Notes

Sept. 11

Cloned simpel2 to form a members tool. This will be the basis for driving the providers created by participants of the Integration Workshop. Edited the MembersTool to get a cover instances of the AuthzGroupService and print a list of the existing groups. This currently works and returns the following list in the default system:

Groups found: 20
    !group.template
    !group.template.course
    !pubview
    !site.helper
    !site.template
    !site.template.course
    !site.user
    !user.template
    !user.template.guest
    !user.template.maintain
    !user.template.registered
    !user.template.sample
    /announcement/channel/!site/motd
    /content/attachment/
    /content/public/
    /site/!admin
    /site/!error
    /site/!gateway
    /site/!urlError
    /site/mercury

This can be filtered to produce a list of default sites, of which only the mercury site is valid. I think some code to create a few new authz groups will be needed for the purposes of the exercise. Sites are filtered on "/site" to produce the following list:

Groups found: 5
    /site/!admin
    /site/!error
    /site/!gateway
    /site/!urlError
    /site/mercury

This can probably further filtered, but this is a good start. The next step is to create the site Id (or perhaps the name if it can be found) as links to a secondary page to show members in the group. Finally, a third step is needed to show personal information. Done correctly, these steps correspond to

  • default site (authz group)
  • users gained by the group provider
  • user information gained by the user provider

Sept. 14

Added a test URL to Members Tool. Works fine. URL is of the form:

Now I need to catch is request in doGet().

doGet() re-written to handle four request states:

  • (default) - Show member groups.
  • site - Show members of a site.
  • user - Show membership details.
  • error - Show an error message.

All of these are coded and tested against the default mercury site and the admin user.

Need to add some more test sites with users that will be provided for by the SIS.
Need to write group and user providers against SIS database.

Sept. 18

Added a populate() function to the membership tool which adds three test users. Works fine.
Added create group to populate() that addes two test authz groups. Must be logged in as admin to make this work, which is a bit of a pain if you forget. Test users are being added to groups, but are not showing up when you look at them.

If I enable creation of users, they seem to get created, along with sites. When you then try to look at the site, system tries to insert a user id, getting a unique key violation in the database. Why would it do this? I'm only trying to view the members of a site group. Also getting warnings about "student" as an invalid role.

I think that by giving the EIDs for group members and indicating that they are provided, I get an error when the system tries to cache them. It's not checking that they exist. Confirmed by commenting out user creation. This code should be removed.

Sept. 19

Thinking ahead to adding providers, I discover that I didn't include the provider module in the sakai_training distro. Adding it would be simple, BUT:

  1. Updating the environment will bring down all of the 2.3 changes to trunk.
  2. This is unlikely to compile without problems.
  3. The provider module now include new course management provider data, which means bringing CM in, too.

Updating to 2.3 is not a bad thing, since sakai_training is currently pegged to the main sakai trunk anyways. There has been talk via email of changing the SVN structure to enable smaller distributions to make tagged releases against a Sakai distro. I can avoid bringing in the CM provider by justing bringing provider/component and provider/sample. That should work.

We'll start by adding selected pieces of the provider module.
Checked out a complete new verison of sakai_training against Sakai trunk.
Updated and checked in .externals to include provider/component and provider/sample.
Updated sakai_training to pull down new code.
Created a clean version of Tomcat.
Build new sakai_training environment. – Failed.

As expected, there are new dependencies in the code. In particular:

  • sakai-message-api-dev.jar
  • sakai-mailarchive-api-dev.jar

These came up in sakai-event-util. Also the maven-deploy-plugin seems to be missing.
I'm going to try and fix the distribution, but if it turns out to be too much work, there is a fall back alternative: create a snapshot of the sakai_training against 2.2 and insert the provider module. This would need to be installed off of a CD during training, but might be necessary to allow time to complete development of the MembersTool and database access.

Added the mailarchive (but this is likely to add other dependencies).
Grrr. It dragged in the whole mail archive tool. I don't WANT the mail archive tool.

Over that one. Now the authz code brings in the test-harness. Added that module.

Well, it looks like that was all that was needed, though it remains to be seen if this conglomeration of code will actually run.
Compiled and deployed simple1 to have something to test with.

Started tomcat. Interestingly, it started with fewer error messages. Only the SU tool crapped out.

I should remove the SU tool from the distribution. We don't need it and it doesn't startup right in tomcat.

Simple1 runs fine.
Compiled and deployed the MemberTool. Worked fine. I'm back where I was a couple of hours ago, with support for providers in place now.

Sept. 21, 2006

Clock is ticking! Starting work on the providers. This will be done in two phases and instances: stubbed data, then implemented against a relational database.

Created module in providers called training. This will hold the train provider examples. The process of creating a provider is documented here, since it needs to be folded into a presentation (Hmm, why not take notes in PowerPoint? Hey, good idea, Mark!).

Four providers will be built:

  • StubbedUserProvider
  • TrainingUserProvider
  • StubbedGroupProvider
  • TrainingGroupProvider

The Sample providers seemed to be better written these days. In most ways, these could suffice for stub purposes. So I have cloned the sample providers into StubbedUserProvider and StubbedGroupProvider. These compile without error and I can use them later as the basis for creating the database version.

Meanwhile, I'm going to turn on the sample providers included with the distribution to see how they work in the MembersTool. This is done by removing comments in the components.xml file associated with the providers module.

Changed the users in the MembersTool intiailization to be in line with examples provided in the SampleUserDirectoryProvider (user1, user2, user3).

Changed components.xml to use StubbedUserProvider. Added printfs to code. User provider is not being accessed.
Added some trace code to BaseDirectoryProvider (impl).
Provider is not getting installed correctly.

Well, as usual, nothing is simple in Sakai. There's no documentation on how to install the provider, except for a single comment in the components.xml file associated with the providers. It should be just a matter of uncommenting it and building it. But NOOOOO.

Ok, I can try re-building all of the training environment. That might matter.
This didn't work.

Sept. 22

After adding trace code to the UserDirectoryService, I determined that the provider wasn't being registered properly.
Ressurrected my old Component Manager Dashboard and updated it to show interface bindings.
Problem was in the provider/component/project.xml file, which had dependencies commented out. Removed them, added dependency for
the StubbedUserProvider. Now being registered correctly. However, provider is not being called, still.

Captured some of these techniques for debugging in 13.0: Developing Providers.

Added more tracing code to BaseUserDirectoryService. The provider is properly installed. However, it is getting called by something other than getUser() on a strange user id (marjknorton) and is not being called when I click on one of the test users.
This seems to have something to do with a mapping of Id to Eid.

Membership in the authz groups was stored using eid's in the assumption that these would be resolved by the provider for final personal information. What's happening is that they are being treated like an id. The user directory service then requests the eid for this id and none is found – because these are not defined users in Sakai.

Re-enable the creation of users in MembersTool creating three users with pre-made ids:

  • user1 - markjnorton
  • user2 - duffygillman
  • user3 - stevergithens

Found the reference to marjknorton. It was a typo in the check to see if users had already been created in the MembersTool.
At least I know where it was coming from.

Added eids into the stubbed provider instead of being referenced by the userId. Added more trace code to stubbed provider.

Running out of time to be trashing around. I note that the called getUserByEid() always causes the provider to be invoked. So lets change the Members tool a bit. Maybe we can make it fancier later. Changed doHome() to show hard wired link to

  • Mark Norton

Changed doPerson() to use getUserByEid(). Success, information was returned from the provider. Expanded this to include the other three names currently stubbed. Test – all three work correctly.

With a way to drive the Stubbed User Provider, at least one way is established to teach how to develop a user provider. It's pretty narrow at this point, however. It also isn't clear why I had to create users for this to work. Perhaps I didn't. This is worth an experiment. I'll add a forth person, but not create them as a user. We'll use brigidcassidy.

To compile the providers, run maven in provider/training. Then run maven in provider/component. This causes the providers to
be properly packed and deployed. Sometimes you see a message like sakai-deploy-plugin not available. I think this signifies
that you're in a module that's not set up to be deployed. Rather, it need to be packaged up and then deployed.

This isn't working as well as I thought. Although I'm passing different user id's in, the are all resolving to user1. This turned out to be a copy and paste error. User id was hardwired to "marknorton". Replacing it with id variable caused it to work correctly, even for brigidcassidy. Therefore, users do NOT have to be created in advance. I'm going to back up MemberTool and strip out all the unused code.

The populate() function in MemberTool now only creates two sites. All user initialization has been removed.

Tempting as it is to move on to the database portion (because then I'd have at least on full path through the workshop), I'm going to try and get at least one call to the group provider working. With that in place, I can concentrate on getting the database to work, which is a whole different kettle of fish.

There is an error warning that comes up in catalina.out when refreshing the authzgroups that were created. The eid's for the user ids are not being found.

Changed provider/component/../component.xml to use the StubbedGroupProvider instead the distributed sample.
Several group providers are being called as a side effect of the group initialization process. I'm gonna stub out populate and see if they go away completely.

All but one are eliminated: "getGroupRolesForUsers()". This may be called on the default mercury site. A bit more tracing will illustrate. As I suspect, it was for the default case: getGroupRolesForUsers(admin).

Tested access to authz group "test1". Failed, since it wasn't dyanmically created. I'll add back the populate code.

To some degree, there is a "chicken-and-egg" problem with the user and group providers. You can't add members to a group unless you can access them as users. You can't access a list of users unless you've defined a group. I suspect that if we have the user provider in place, that there might be a way to create groups (even temporary ones) with information that's externally provided. That may mean that I have to delay populating the groups until the user provider is in place and working or perhaps explain that the participant's can't use that part of the test harness until the user provider is done.

Some of the group providers are being called with a null id. Stripped out tracking from BasedUserDirectoryService.

Looks like I'm not creating my groups with a provider id. That would help, I suspect.
Added setProviderGroupId("ext-test1"), for example. Group provider is being called in at least one place with the external group provider id. Still getting some calls with a null id, though. The "mercury" group is still the primary suspect, since it's unlikely that it has an external provider id.

There is no "refreshAuthzGroup()" method in either AuthzGroup or AuthzGroupService. It's not in the SecurityService interface, either. It's not in SiteService or Site. Not in MercuryPortal. Hellooooo! Where are yoooooo?

Ok, let's simplify things a bit by commenting out the creation of the second authz group. Some trace code added to MemberTool.
Here are the results:

%%%% Group Provider:  getGroupRolesForUser(admin).

@@@@ Member Tool:  populate() - start.

@@@@ Member Tool:  populate() - before init site test.

@@@@ Member Tool:  populate() - before site init.

%%%% Group Provider:  getRolesForGroup(null).

%%%% Group Provider:  unpackId(ext-test1).

%%%% Group Provider:  getRolesForGroup(ext-test1).

%%%% Group Provider:  unpackId(ext-test1).
WARN: refreshAuthzGroup: cannot find eid for user: markjnorton (2006-09-22 19:21
:31,890 http-8080-Processor25_org.sakaiproject.authz.impl.DbAuthzGroupService)
WARN: refreshAuthzGroup: cannot find eid for user: user2 (2006-09-22 19:21:31,90
6 http-8080-Processor25_org.sakaiproject.authz.impl.DbAuthzGroupService)

@@@@ Member Tool:  populate() - after site init.

getGroupRolesForUser(admin) is called by Mercury before the MemberTool is even launched.
getRolesForGroup(null) is likely part of the call to azm.addAuthzGroup("/site/test1").
refreshAuthzGroup may be part of the call to azm.save (g1);

refreshAuthzGroup(BaseAuthzGroup azGroup) is part of the Storage interface definition for the AuthzGroups implementation. The interface is declared in BaseAuthzGroupService (I hate inner classes like this). refreshAuthzGroup() is implemented in DbAuthzGroupService. I found the log warning in the implementation. A call is made to the provider early on:

  • m_provider.getUserRolesForGroup(realm.getProviderGroupId())

However, I don't see evidence that this provider function is actually being called. Ah, my trace functions didn't name the
provider function correctly. Let's update and see what the evidence looks like:

%%%% Group Provider:  getUserRolesForGroup(null).

%%%% Group Provider:  unpackId(ext-test1).

%%%% Group Provider:  getUserRolesForGroup(ext-test1).

%%%% Group Provider:  unpackId(ext-test1).
WARN: refreshAuthzGroup: cannot find eid for user: markjnorton (2006-09-22 19:36
:52,312 http-8080-Processor25_org.sakaiproject.authz.impl.DbAuthzGroupService)
WARN: refreshAuthzGroup: cannot find eid for user: user2 (2006-09-22 19:36:52,31
2 http-8080-Processor25_org.sakaiproject.authz.impl.DbAuthzGroupService)

Now we see getUserRolesForGroup(ext-test1) being called for our test authz group. Likely, this is not return the list of users expected. We can add code to determine this.

Added the following hardwired check in getUserRolesForGroup():

//  Check for the test1 group.
if (id.compareTo ("ext-test1") == 0) {
	rv.put ("markjnorton", "student");
	rv.put ("user2", "student");
	return rv;
}

Now we see:

%%%% Group Provider:  getGroupRolesForUser(admin).

@@@@ Member Tool:  populate() - start.

@@@@ Member Tool:  populate() - before init site test.

@@@@ Member Tool:  populate() - before site init.

%%%% Group Provider:  getUserRolesForGroup(null).

%%%% Group Provider:  unpackId(ext-test1).

%%%% Group Provider:  getUserRolesForGroup(ext-test1).
WARN: refreshAuthzGroup: cannot find eid for user: markjnorton (2006-09-22 19:48
:53,953 http-8080-Processor25_org.sakaiproject.authz.impl.DbAuthzGroupService)
WARN: refreshAuthzGroup: cannot find eid for user: user2 (2006-09-22 19:48:53,95
3 http-8080-Processor25_org.sakaiproject.authz.impl.DbAuthzGroupService)

#### User Provider:  getUser(): markjnorton

#### User Provider:  getUser(): user provided.

#### User Provider:  getUser(): user2
WARN: refreshAuthzGroup: cannot find id for user eid: user2 (2006-09-22 19:48:53
,968 http-8080-Processor25_org.sakaiproject.authz.impl.DbAuthzGroupService)

@@@@ Member Tool:  populate() - after site init.

So we are starting to see checks into users via the user provider. Note that user2 was used in the test1 auths group, but is really an id not an eid, whereas markjnorton is an eid. This may mean that I should use eids exclusively. Let's try that!
Results:

%%%% Group Provider:  getGroupRolesForUser(admin).

@@@@ Member Tool:  populate() - start.

@@@@ Member Tool:  populate() - before init site test.

@@@@ Member Tool:  populate() - before site init.

%%%% Group Provider:  getUserRolesForGroup(null).

%%%% Group Provider:  unpackId(ext-test1).

%%%% Group Provider:  getUserRolesForGroup(ext-test1).
WARN: refreshAuthzGroup: cannot find eid for user: markjnorton (2006-09-22 19:54
:34,109 http-8080-Processor25_org.sakaiproject.authz.impl.DbAuthzGroupService)
WARN: refreshAuthzGroup: cannot find eid for user: duffygillman (2006-09-22 19:5
4:34,109 http-8080-Processor25_org.sakaiproject.authz.impl.DbAuthzGroupService)

#### User Provider:  getUser(): duffygillman

#### User Provider:  getUser(): user provided.

#### User Provider:  getUser(): markjnorton

#### User Provider:  getUser(): user provided.

@@@@ Member Tool:  populate() - after site init.

So, while this is looking better, it still seems that Sakai can't equate user ids and eids.

Now I clicked on the test1 site in the MemberTool and the following was displayed:

Members of /site/test1 include:
    c06a92b8-07ae-4eb2-8013-32402a3270b7
    duffygillman
    b11be452-da37-4cdf-00e0-5306a652e6d0
    markjnorton

Sakai is assigning user id's and including them in the authz group. It's also retaining the two names I assigned initially. Again, this is a sign of not establishing the relationship between ids and eids.

Well, that's enough for one (long) day. This needs more poking at, but a LOT was accomplished.

Sept. 23

Not to suggest that the life of a Sakai developer is one full of luxury, but I had an idea while sitting in my hot tub admiring the sunset and sipping on a wine cooler. It may be that the populated groups don't need to have members at all. Now that the group and user providers are in place, it's worth experimenting to remove the membership initialization for the test authz groups and see if it still works.

Here is the code after commenting:

g1 = azm.addAuthzGroup("/site/test1");
g1.setProviderGroupId("ext-test1");
g1.addRole("student");
//g1.addMember("markjnorton", "student", true, true);
//g1.addMember("duffygillman", "student", true, true);
azm.save (g1);
sb.append("New site created:  /site/test1<br>");

A group is added, we set the provider id for it, add a role, and save it. Clicking on the test1 authz group, we get:

Members of /site/test1 include:
    9aece65e-137a-4fe1-0034-99aee2508ab5
    3f5d003a-716c-41aa-00f9-7d08e57a65d5

These are both links to people. Unfortunately, the ids are not mapped to the eids. This is strange, since these ids are being created on the basis of calls to the group provider, which includes eids in the map. Wouldn't the caching include both? You'd think so. It occurred to me that perhaps the eid is being saved and I wasn't using the right thing to set up my links. In fact, this turned out to be the case. by replacing memb.getUserId() with memb.getUserEid(), Eids are now displayed for a particular group and clicking on them gives user data. Furthermore, refreshAuthzGroup() is not longer giving warnings.

At this point we have a simple application (MemberTool) that will work with stubbed providers to get information from an external source about users and groups. Let's pause to clean up the code some before moving on to the database implementation.

Three test groups now include:

  • physics-101
  • music-200
  • calc-355

Two roles are now included: instructor and student.

Users have been explanded to include:

  • markjnorton
  • duffygillman
  • stevegithens
  • brigidcassidy
  • charlesseverance
  • kristolhancock
  • glenngolden

Tested code. All is working. One nice addition would be to include the roles of a user when listing the site roster.

Updated the documentation of Member Tool and the databases in Provider Data Model.

It's time to start in on the database creation and then the database code.

Look at the files in oki/ent_workshop. This is an OKI workshop I created for MIT that showed how to implement OKI OSIDs against an SIS database in 2005. This uses the same sort of approach being used for the Integration Workshop.

Things to do:

  1. Consider upgrading MySQL to the latest version
  2. Create the data tables.
  3. Track down the connector JAR. – It's on laptop at c:/mysql/mysql-connector-java-3.0.16-ga.
  4. Document the SIS database with data dumps and sample queries.
  5. Write the TrainingUserProvider and TrainingGroupProvider.
  6. Test over LAN.

The version of MySQL that's on my laptop is pretty old (3.0.16). I have the zipped version of 4.1.9. The latest version is 5.0.24a. I think I'll download this to my laptop and see if I can get it up and running. Downloaded successfully. Installed. Setup using the configuration wizard. Database was NOT set up as a windows service.

Sept. 25

After installing MySQl 5.0.24, I discovered that I had previously installed MySQL Server 4.1 as a system service. This means it is automatically launched on startup. I'm going to try an de-install this version, then install 5.0 as a service. It was recommended, and I shoulda listened.

I removed 4.1 as a service and installed 5.0 as a service. I got an error at the end, but was able to connect to the database service using the mysql command with a user of root. The password, if needed is "sakai".

Created a new database using the following command in mysql client:

  • create database SAKAI_SIS;

Created the USER_REGISTRY table using the following command:

CREATE TABLE USER_REGISTRY (
Eid VARCHAR(256) NOT NULL,
First VARCHAR(256) NOT NULL,
Last VARCHAR(256) NOT NULL,
Email VARCHAR(256),
PRIMARY KEY(Eid)
);

Had trouble creating an auto incrementing key. So punted and let the Eid be the primary key.

Populated this table with the following data:

mysql> select * from USER_REGISTRY;
+------------------+---------+-----------+---------------------------------+
| Eid              | First   | Last      | Email                           |
+------------------+---------+-----------+---------------------------------+
| brigidcassidy    | Brigid  | Cassidy   | abrigidcassidy@sakaiproject.org |
| charlesseverance | Charles | Severance | csev@sakaiproject.org           |
| duffygillman     | Duffy   | Gillman   | duffygillman@sakaiproject.org   |
| glenngolden      | Glenn   | Golden    | ggolden@sakaiproject.org        |
| kristolhancock   | Kristol | Hancock   | kristol@sakaiproject.org        |
| lancespeelmon    | Lance   | Speelmon  | lance@sakaiproject.org          |
| markjnorton      | Mark    | Norton    | markjnorton@sakaiproject.org    |
| mikeosterman     | Mike    | Osterman  | osterman@sakaiproject.org       |
| stevegithens     | Steve   | Githens   | stevegithens@sakaiproject.org   |
| zachthomas       | Zachary | Thomans   | zach@sakaiproject.org           |
+------------------+---------+-----------+---------------------------------+
10 rows in set (0.00 sec)

he GROUP_REGISTRY schema:

CREATE TABLE GROUP_REGISTRY (
GroupId VARCHAR(256) NOT NULL,
GroupName VARCHAR(256) NOT NULL,
GroupType VARCHAR(256) NOT NULL,
PRIMARY KEY(GroupId)
);

The following data is present in this table:

mysql> select * from GROUP_REGISTRY;
+-------------------+----------------------+-----------+
| GroupId           | GroupName            | GroupType |
+-------------------+----------------------+-----------+
| ext-calc-355      | Calculus 355         | course    |
| ext-french-150-s1 | French 150 Section 1 | section   |
| ext-french-s2     | French 150 Section 2 | section   |
| ext-music-200     | Music 200            | course    |
| ext-physics-101   | Physics 101          | course    |
+-------------------+----------------------+-----------+
5 rows in set (0.00 sec)

The GROUP_MEMBERSHIP schema:

CREATE TABLE GROUP_MEMBERSHIP (
GroupId VARCHAR(256) NOT NULL,
Eid VARCHAR(256) NOT NULL,
Role VARCHAR(256) NOT NULL,
PRIMARY KEY(GroupId)
);

Unfortunately, this is going to need a numerical key to create unique records, either that or I have to drop GroupId as the primary key. I didn't succeed in getting an auto_increment field, but I did change the table to have a GroupKey, which I incremented by hand. Pretty lame, but this is not going to be a dynamic database (I hope), so it will suffice.

Here is the data in this table:

mysql> select * from GROUP_MEMBERSHIP;
+-------------------+------------------+------------+----------+
| GroupId           | Eid              | Role       | GroupKey |
+-------------------+------------------+------------+----------+
| ext-physics-101   | markjnorton      | instructor |        0 |
| ext-physics-101   | duffygillman     | student    |        1 |
| ext-physics-101   | brigidcassidy    | student    |        2 |
| ext-physics-101   | charlesseverance | student    |        3 |
| ext-music-200     | duffygillman     | instructor |        4 |
| ext-music-200     | stevegithens     | student    |        5 |
| ext-music-200     | kistolhancock    | student    |        6 |
| ext-music-200     | markjnorton      | student    |        7 |
| ext-calc-355      | glenngolden      | instructor |        8 |
| ext-calc-355      | markjnorton      | student    |        9 |
| ext-calc-355      | duffygillman     | student    |       10 |
| ext-calc-355      | stevegithens     | student    |       11 |
| ext-calc-355      | brigidcassidy    | student    |       12 |
| ext-calc-355      | kristolhancock   | student    |       13 |
| ext-calc-355      | charlesseverance | student    |       14 |
| ext-french-150-s1 | kistolhancock    | instructor |       15 |
| ext-french-150-s1 | glenngolden      | student    |       16 |
| ext-french-150-s1 | charlesseverance | student    |       17 |
| french-150-s2     | brigidcassidy    | instructor |       18 |
| ext-french-150-s2 | markjnorton      | student    |       19 |
| ext-french-150-s2 | duffygillman     | student    |       20 |
| ext-french-150-s2 | stevegithens     | student    |       21 |
+-------------------+------------------+------------+----------+
22 rows in set (0.00 sec)

A good piece of work for one day. The whole database with three tables are defined and populated. Now I can move on to writing code against this database. BTW, recieved word from client today that only one person has signed up for the course. Sigh.

Sept. 26

Downloaded Connector/J (ODBC for MySQL) from here

The JAR for this connect is also present on the Sakai Maven repository in mysql/mysql-connector-java-5.0.3.
This was determined by browsing http://source.sakaiproject.org/maven/

There are two goals to achieve in order to access the Sakai SIS database locally over a net:

  1. Build an application that brings down and links with proper connector JAR.
  2. Use this JAR to establish a connection with the Sakai SIS database over a LAN.

I'm going to create a small tool in which I can play with ODBC connections. Call it TestDb cloned from Simple1.
Created, built, deployed, tested as working with hello world message.

Got maven to download the JAR using the following dependency:

<dependency>
	<groupId>mysql</groupId>
	<artifactId>mysql-connector-java</artifactId>
	<version>5.0.3</version>
</dependency>

Added a snippet of code from the README that comes with the connector JAR to establish a connect. Got the following exception:

SQLException: No suitable driver
SQLState: 08001
VendorError: 0

So it says I don't have a driver. Re-reading the material, I have to register the driver first.
Ok, using what they provided didn't work. Looks like the reason is: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver. Maybe it's not included in the connector?

Confirmed that the driver is included in the connect JAR, at least in the collection I downloaded. The connector doesn't seem to be in the target folder of testdb. Confirmed that it is in the repository.

Added a deploy.target of shared. Let's see if it fixes the problem. We can always move it in by hand if necessary. No, that didn't work. I'm going to copy the jar from the repository (since maven dependencies will still need to be satisfied).

Well, some progress. Drive seems to be accepted now. However, I'm getting a "Connection refused" error. I might need to add the port to the connection expression. Database name was wrong (sakaisis instead of sakai_sis), but that didn't get me a connection.

When I changed the server name to "MarkLaptop", I get the following error:

SQLException: null, message from server: "Host '192.168.0.103' is not allowed to connect to this MySQL server"
SQLState: HY000
VendorError: 1130

This is interesting. Either the database is not set up to allow external access, or it might be a work group problem. Either way, I'm VERY close. Confirmed that 192.168.0.103 is the IP number of my base computer. Tried with a hostname of "%", but that didnt' work – host not recognized.

Getting a bit warmer, the page http://dev.mysql.com/doc/refman/5.0/en/connection-access.html indicates that I have to make a grant in order to make the database available.

The grant syntax is at http://dev.mysql.com/doc/refman/5.0/en/grant.html.

This needs to be done on the user table and I can't find it.
Ok, the user table is in the mysql database. It has lots of columns.

Created a new user called admin with the following command:

create user 'admin' identified by 'sakai'; (password is sakai)

Then granted them full access rights using this command:

grant all on sakai_sis.* to admin;

Success. Whew. This is the breakthrough moment on this project. This was a major stumbling block the last time I tried to run a workshop of this kind (the MIT Enterprise workshop in 2005).

Added a query against the USER_REGISTRY table. Was able to print Eids.

Sept. 27

Created a SakaiSis class in provider/training. This class provides a static method to establish and return a database connection to the sakai_sis database running on my laptop.

Created and implemented DbUserProvider using SakaiSis. All methods implemented, but not tested at this time.

Sept. 30

Compiled and re-deployed providers including new DbUserProvider. Works with MembersTool. Connection is established and able to get user data. Note that only getUser() is really being tested here since the MembersTool is limited in how it drives the providers.

Wrote the DbGroupProvider. Bit of a problem with the queries, but figured them out (missing the where clause). Compiled, tested, works. Coding of the providers is now done (yeah!). Need to move into describing them for the presentations and also collecting material for documenting the SIS including queries, etc. I think I'm just gonna make the SakaiSis class available to the participants. That will simplify connection issues.

Worked on the 13.0 Developing Providers presentation. Right now, it contains a lot of information about the two provider exercises. This is not quite a flexible approach, since it would have to be modified if a course management provider were to be included in this exercise. Still, it's an OK first start. 13.1 could be a review showing how I did it, along with 13.2 for the GroupProvider. The interface should have been covered earlier in the service overview, though there may be a need to review them quickly again. Review once the bulk of the slides are done.

Oct. 1

Put the final touches on 13.2 Group Provider Exercise. These slides can be used as is, but I'm not really happy with them. They aren't that modular and the flow doesn't feel right, either. However, the bulk of the material is there. I may re-arrange things later. Also, consider breaking up the provider exercise into shorter presentations:

  • 13.0 Introduction and Set-up
  • 13.1 Provider Examples - examine the stubbed providers here.
  • 13.2 The MembersTool driver
  • 13.3 The Assignment
  • 13.4 The User Provider Exercise
  • 13.5 The Group Provider Exercise

These pieces can be combined into a one-off merged presentation (13) for a given workshop. That allows me to mix in other examples and exercises, like the course management provider, later.

The MembersTool could also use more work. It would be nice if it could query some function to get a list of groups that include external groups, as well as the internally defined ones. Perhaps we can create a mix-in interface for the training examples that add a getGroups() method or something.

Wrote the bulk of the Course Management Service overview in three presentations:

  • 20.1 Legacy Course Management
  • 20.2 The Course Management Service
  • 20.3 Course Management Integration

Needs a bit of thought, a few slides to finish, and slick it up some with graphics and color.

The following work remains for the Integration Workshop:

Item

Status

Review the provider slides

 

Review the CM slides

 

Write and review the Web Services slides

 

Collect the software together

 

Create CD image

 

Test the whole environment setup process

 

Print and coallate slides (5-6 sets)

 

Duplicate and assemble workshop CDs (5-6 discs)

 

Nov. 8

NYU Integration Workshop.

Modifications were needed to the connector class. Needed to use IP number instead of MarkLaptop in connector specification.
Another method was added to the group provider. Check all interfaces used.

Dec. 5

Sixth Sakai Conference. Laptop stolen and not recovered. Some software was lost. Sakai SIS database was lost and needs to be re-created.

Dec. 26

New Dell laptop arrived just before christmas. I have installed Java 1.5, Eclipse, Maven 2.x, and Subversion on it. Checked out Sakai 2.3. Almost to the point of having a working development environment on it.

Preparing for Hyderabad Workshop (Oracle). The following presentations will be made:

  • 0.1 Course Overview, Instructor Introduction
  • 1: Introduction to Sakai
  • 2: The Training Environment
  • 3: Installing the Training Environment
  • 4: Developing Sakai Tools
  • 5: Cloning a SimpleTool - Exercise
  • 6: Sakai Kernel Services
  • 7: Add a Service - Exercise
  • 14: Sakai Entity Model
  • 15: Sakai User Model
  • 17: Sakai Security Model
  • 19: Sakai Site Model
  • 18: Sakai Content Model
  • 20.2: Overview of Course Management
  • 20.3: Course Management Integration
  • 19: Sakai Site Model
  • 20: Sakai Portals
  • 24: Web Services
  • General Exploration of Sakai Code
  • Reflection, Q&A
  • Evaluation

In addition the training environment needs to be brought up to date. It may be simpler to use sakai_mini or cafe.

Checkout the lastest version of the training distro.
Attempted to build into a clean tomcat. Failed immediately with XML errors. I was expecting something of the kind due to change over to Maven 2.0. Ian Boston mentioned that the old maven projects would still work, but I'm not sure that's been tested.

Blew away the maven repository.
Still fails. Turned on exception reporting.

Nested exception:
java.io.FileNotFoundException: Parent POM not found: C:\dev\sakai_training_2.3\user\master\project.xml

Interesting that maven is looking for a ../user/master directory. This is new, I think.
Couldn't find any references to this in Ian's emails. Copied master module into user. Maven is getting further.
Failed to compile the Site module. Looking for SiteAdvisor.

Actually, the problem was that Maven was trying to target java 1.4, and encountered some 1.5 code in the site api. Problem was traced to 1.5 not being installed correctly. Build moves past the site module, but later fails on sakai-event-util, which has dependencies:

Attempting to download sakai-message-api-dev.jar.
WARNING: Failed to download sakai-message-api-dev.jar.
Attempting to download sakai-mailarchive-api-dev.jar.
WARNING: Failed to download sakai-mailarchive-api-dev.jar.

So, once again I'm faced with tracking down cross dependencies between modules.
event/event-util/util has dependencies on the message api and mailarchive api.

Looks like svn didn't catch them in the checkout. Makes me suspect that the externals file isn't checked in correctly.
Built successfully.

Sadly, tomcat won't start. I don't get any errors, or even the CATALINA output window, which is very odd. No log files, either.

Jan. 2

Installed training on new laptop. Built without problem. Built simple1 and simple2. Works fine. Built notes1 - also works fine, which is interesting, since JSF bug seems to have disappeared. This indicates an environment problem which is something I suspected for some time.

Jan. 5

Virtually presentations are up to date with respect to Sakai 2.3. More work will be needed for 2.4, due to the change over to Maven 2.0. Tools Workshop to be given in Hyderabad, India next week for Oracle.