Archive

Archive for the ‘SLK’ Category

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:

I am now Co-ordinator of the SLK & LG projects on CodePlex

January 28th, 2009 RichardWillis 2 comments

Jay Beavers recently asked for volunteers to be the co-ordinator for the SLK project on CodePlex as he no longer had the time to commit to it. I have volunteered and am now the co-ordinator for the SLK and Learning Gateway projects on CodePlex. Many thanks for all the hard work that Jay has put in, but I’m sure he’d be the first to admit that it slowed down a lot recently.

Hopefully, now that I am co-ordinator we can get the projects moving again. My priorities are:

  • Get a new release out, with upgrade support for the previous version
  • Support Firefox and other browsers in SLK. I might roll this into the next release depending on how much work it is. I’ve done most of it, but I’m just working on Safari support at the moment
  • Answer questions in the forums
  • A new release of the LG web parts supporting the latest version of SLK
  • A drop box

After that it will depend on what is being requested in the forums and issue tracker. I might look at Course Builder, or get the rest of LG up to date.

Now, although I am co-ordinator I do have a day job as Managing Directory of SalamanderSoft. My role as co-ordinator complements this, which is why I was prepared to take it on, however realistically I am going to have a couple of hours a week I can spend on the projects. My paying customers will always take priority! I’m not going to be able to do all the work that I’d like to see done on the projects, so either the community needs to submit patches, which I will look at, or it’s going to take some time. The alternative is if I can get funding to spend more time on it – any volunteers ;)

Finally, although it is easy to find my contact details, please direct all queries and support requests to the forums. I won’t be the only one who answers questions, and any answer needs to be a shared resource.

Categories: SLK Tags:

Utility to upgrade SLK Assignments Web Part to version 1.3.1

January 27th, 2009 RichardWillis 1 comment

SharePoint Learning Kit 1.3.1 breaks backward compatibility with previous versions. Once it is installed then any pages with the Assignments web part will not be able to display them, it will show an error instead.

I’ve created a utility to swap the Assignments web part for the one in 1.3.1. You can download it from http://www.salamandersoft.co.uk/slk/upgradeSlkWebPart.zip.

It’s a simple command line application which includes the executable and source code.

From the help within the tool (UpgradeSlkWebParts.exe /?)

This utility replaces web parts which render as errors with the SLK 1.3.1 assignment list web part.
The aim is to upgrade SLK to 1.3.1 which causes the errors on the previous assignment list web part,
and this then swaps them for the web part which comes with 1.3.1.

usage: upgradeSlkWebParts baseUrl page [optional arguments]

   baseUrl: The url of the web which is the parent of the class sites e.g. http://wss/sites/school/classes
   page:    The actual page on which the web part appears
                e.g. it would be Pages/default.aspx for the url http://wss/sites/school/classes/Ma10A/Pages/default.aspx

   Optional Parameters:

   Parameters without values

       siteOnlyOff : If present sets Show site only to false, if not present it’s set to true
       queryControlOff : If present sets Show Query Control to false, if not present it’s set to true
       allSites :        Update all sites under the base Url. Otherwise use the maxNumber argument

   Parameters with values : use like maxNumber=7

       maxNumber :          The maximum number of subsites to update. Defaults to 2.
                                  Use to test on a limited number of sites first.
       querySetOverride :  The Query Set Override value to use. Defaults to blank.
       index :                  The position on the page. Defaults to 0.
       controlWidth :        The width of the control. Defaults to not setting it.

Categories: SLK Tags:

SLK and large groups

November 26th, 2008 RichardWillis No comments

A couple of the threads on the SLK forum at the moment are about using large domain groups with SLK.

In my personal opinion you should not be assigning thousands of learners to a site. SLK is designed to show all learners assigned to a site, so with that many learners, even with optimization, it’s going to be slow. Even if displaying all the users was lightning fast, from a user’s point of view it’s unusable. Hunting through 6000 learners for the ones you want to assign to is a pain, and would actually be worse and more time consuming if it was paged.

I think that you need more targeted sites for assigning work. Without a better idea of a specific organisation or SharePoint set up it’s had to suggest best practises, but here are a few ideas.

  • In a school, have a site per class/teaching group with the appropriate pupils as learners.
  • In a company, have a site per department with the departmental members as learners.
  • If you regularly give set courses, have a site per course with the SLK Learner role assigned as appropriate
  • Have a site per instructor, which they have control over. They can then give permissions to the appropriate learners.

You will probably find if you create extra sites, they will expand to become collaboration sites as well as just sites for assigning work.

Don’t forget, you don’t have to create specific sites just to assign work. You can re-use your existing hierarchy by assigning SLK Learner and Instructor permissions on the existing sites.

Of course sometimes there are situations when you might need to assign work to a large number of users. In that case it might be useful to have an option to assign to a group without displaying the members. It would still be slow on assigning as it gets assigned to each user. This would need a change to the SLK code though and work on it seems to be stalled at the moment.

Categories: SLK Tags:

Firefox support in SLK

November 12th, 2008 RichardWillis No comments

I’ve recently added support for Firefox and other browsers to SharePoint Learning Kit. It turned out to be quite a bit more work than I was hoping, but I’ve now now got a version with works. I even had to update the sample SCORM content Solitaire and that in itself was IE specific.

The code for the SCORM player is quite complex with frames in frames in frames, so it wasn’t just a case of changing document.all to document.getElementById everywhere, I had to understand how all the frames fitted together. I’m not sure why the orginal authors went down this root. I can see that the actual content needs to be in a frame as quite often it’s a complete HTML page of its own, but the rest of the navigation should have been able to be done in a single page.

The patches are available on CodePlex at http://www.codeplex.com/SLK/SourceControl/PatchList.aspx and are numbers 2068, 2069 and 2070.

I’ve provided compiled versions of SLK (based on 1.3.1) and Solitaire at http://www.salamandersoft.co.uk/slkfirefox.html.

Categories: SLK Tags: