Archive

Archive for February, 2009

Finding out if SharePoint Objects are Disposed Correctly

February 27th, 2009 RichardWillis No comments

Everyone should know by now that certain SharePoint objects, including SPSite and SPWeb need to be disposed of when you have finished with them or you will get a memory leak. If you want to refresh your memory have a look at the MSDN white papers Best Practices: Using Disposable Windows SharePoint Services Objects on MSDN and Best Practices: Common Coding Issues When using the SharePoint object model.

What you may not know is that there are a couple of tools/techniques which can help you find areas in your code where you are not disposing of objects correctly.

  1. SPDisposeCheck. This is a tool which will analyze your assemblies to search for coding patterns which lead to objects not being disposed correctly. It’s a great tool and worth running regularly on your assemblies.
  2. SPRequestStackTrace registry value. Creating the registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings
SPRequestStackTrace: DWORD = 1

Will cause the SharePoint runtime to log a stack trace everytime a SPRequest object is not disposed of correctly. This will actually pick up all the types of objects not being disposed of as internally the problem with not disposing of them is that they contain a reference to SPRequest.

At this point I have to say thank you to Jared Kahlil who pointed out a memory leak in the SLK by using the second method above and started my research into both of these methods. Unfortunately we can’t use SPDisposeCheck on SLK as it checks to see if the file name begins with Microsoft and if there are any namespaces beginning with Microsoft, and if so ignores the assembly.

Categories: Development, SLK, SharePoint Tags:

SharePoint Learning Kit 1.3.1 support for Microsoft Learning Gateway

February 26th, 2009 RichardWillis No comments

I’ve updated the components of the MLG which depend on SLK to use the latest version (1.3.1). You can download these from the MLG 1.1 release page. This had been one of the biggest bugbears of the SLK & MLG projects, the fact that they were not in sync. Not that there’s convergence again we should be able to keep them in sync.

Please let me know if there work for you.

Categories: Microsoft Learning Gateway, SLK Tags:

slkadm for SharePoint Learning Kit

February 26th, 2009 RichardWillis 2 comments

slkadm is a tool which ships with the SharePoint Learning Kit and is analogous to stsadm for SharePoint itself, in that it’s used the administratively configure SLK, in particular the SLK mappings.

What is an SLK mapping?

An SLK mapping is the link between a site collection and the SLK data. For each site collection you want to use SLK with you must create a mapping. You would normally do this through SharePoint Central Administration | Application Management | SharePoint Learning Kit.

A mapping consists of:

  • The GUID of the site collection – this uniquely identifies the site collection
  • The database connection details
  • The names of the SLK permissions
  • The SlkSettings file used to define the queries used in the Assignment List Web Part and elsewhere.

To re-iterate, if a site collection does not have an SLK mapping associated with it, you will not be able to use SLK on that site. A common problem is not setting the correct site collection on the Configure SharePoint Learning Kit page. It’s actually not that obvious which site collection the page is going to update, even though it’s the first control on the page.

What can slkadm do?

slkadm is a command line tool and can perform 4 tasks:

  • Configure a site collection / mapping. Either one which hasn’t been configured before, or update an existing mapping.
  • Show the existing mapping for a site collection.
  • Show all mappings on the server
  • Delete a mapping

Configure a site collection

The command for this is

slkadm.exe -o configuresite -url http://server/site -databaseserver myDbServer -databasename myDatabase -createdatabase -instructorPermission “SLK Instructor” -learnerPermission “SLK Learner” -observerPermission “SLK Observer” -createPermissions -uploadSlkSettings “file name of slksettings.xml” -defaultSettings

The arguments for these are fairly self explanatory Some notes are:

  • createdatabase. If this is present then the database is created
  • createPermissions – Create the permission levels
  • defaultSettings – Use the default slksettings.xml. Cannot be used with uploadSlkSettings

Show the existing mapping for a site collection

The command for this is

slkadm.exe -o getsiteconfiguration -url http://server/site

and an example output is

Notice that slkadm has “found” the SLK configuration and then listed what is configured. The output could be clearer though, here’s one for a site collection which has not been configured:

Although it does state that “no SLK configuration found”, it then goes on to list the default settings, so at first glance it could be configured.

Show all mappings on the server

The command for this is simply

slkadm.exe -o enummappings

with an example output as

You will get one line per site collection configured, with some minimal information – the site url, GUID and database details. In the example here I’ve got 2 site collections configured for slk.

Delete a mapping

The command for this is

slkadm.exe -o deletemapping -guid 1234abcd-1234-abcd-1234-abcd1234abcd

where the GUID is replaced by the GUID of the site collection. The easiest way to get the GUID is by running the enummappings or getsiteconfiguration commands.

This will delete the mapping, and disable SLK on the site collection, but it will not remove the database or the Assignment List Web Parts from any pages in the site collection.

List the commands

As is standard with any command line tool you can view the commands by running

slkadm.exe /?

Categories: SLK Tags:

Automatically linking Moodle to Sims.Net and Facility CMIS

February 3rd, 2009 RichardWillis No comments

I’m regularly asked about whether it’s possible to link Moodle to school MIS systems. There’s a number of ways to link Moodle to Sims.Net or Facility CMIS, both open source and commercial and here’s a summary of the ones I know about. If you know of any others, or feel I’ve missed some information out, please let me know and I’ll add them.

Open Source

CLEO MIS Upload Tool

The CLEO tool was originally developed by Dan Poltawski for the CLEO Regional Broadband Consortium. It’s not a fully automatic tool as you need to create a csv file from your MIS system first. It then simplifies the process of creating users and courses from the data. Once the tool has been run, changes in Sims/Facility CMIS are not automatically reflected in Moodle. I think that if you re-export the data and re-run the tool it will update the courses, but I’m not sure about that. This tool will run with any MIS system you can export csv files from. Suport is via the Moodle forums notably this thread.


The Definitive Guide to SIMS.net, Moodle and LDAP Integration by Penfold_99

Penfold_99 is a highly active EduGeek member who has posted documentation and scripts on how to link Moodle to Sims. The documentation can be found on the Moodle Docs site. It consists of VB scripts to populate Active Directory from Sims, and then a number of scripts to create views in the Sims database so that the enable external database setting for creating courses can be used. It also includes a module to show the timetable from Sims within Moodle. Penfold_99 has given a lot of support on the Edugeek forums around setting it up, for example this thread. This is an automatic solution as Moodle is looking directly at the Sims database. The AD provisioning is run as a scheduled task. You don’t need to use the AD provisioning, but you do need a pupil identifier (their UPN) in a certain field in AD as the integration depends on using Active Directory authorisation in Moodle.

There’s now a sticky thread on this on Edugeek http://www.edugeek.net/forums/virtual-learning-platforms/28487-definitive-guide-sims-net-moodle-ldap-integration.html.

Guy Thomas’s Facility to Moodle Integration Block

Guy Thomas from the Ossett School has developed a Moodle block to integrate Moodle with Facility CMIS. It allows the bulk creation of pupil and parent accounts, and also a teacher to add Facility CMIS teaching groups a Moodle course. The initial creation of accounts is done manually through the Moodle front-end as it is a Moodle block, but there are then scheduled tasks to keep the pupil, parents and teaching group membership synchronised. The documentation it comes with looks good and Guy provides support via the Moodle forums. It does require initial preparation of Active Directory and your existing Moodle accounts to ensure that they all have the Facility CMIS Student ID in to make sure Moodle knows which user is which in Facility.

Commercial

Salamander Moodle from SalamanderSoft

I’m obviously biased about this one. It will automatically create student, staff and parent accounts from the data in your MIS system  (Sims, Facility CMIS, Phoenix, Integris, any csv file or database I can figure out the schema for). It will also create courses based on your criteria, if you can describe it I should be able to do it e.g. course per teaching group or course per subject year combination with teaching groups as Moodle groups. The provisioning is run as scheduled tasks so not quite live. I update the database directly, so if there’s other items you’d like doing I should be able to figure it out.

Which should I go for?

That’s entirely up to you and what you want out of the integration. The advantages of the Open Source solutions are that the cash price is £0 and you are contributing to the community by using them. The downside is that it can take a long time to get them working in your network and you are reliant on the goodwill, inclination and availability of the writers for support (so far the support from all the above open source tools looks pretty good). For commercial solutions, it’s pretty much the opposite, it’s going to cost you money, but will take less of your time sorting it out and the commercial company will be responsible for making sure it works and keeps working.

Categories: Facility CMIS, Moodle, Sims Tags: