My little Sharepoint

I recently bought a new laptop. I choose a P8600 processor to make sure to have virtualization support and a little TDP (Thermal Dissipation Power) because I don’t really like the fan noise. And it has 4GB or RAM for these little virtual hosts. So today, I decided to have a little Sharepoint 2007 of my own. I installed Windows Server 2008 on a VMWare host, activated Remote Desktop, added Sharepoint 2007 and then MOSS 2007. I choose the x86 version of WS2008 because I wanted to limit RAM usage. With only 1GB of RAM, it worked like a charm and it is really fast. ...

July 3, 2009 · Florent Clairambault

SPGridView : Filtering

I wanted to use a little SPGridView in a software and had a little problem. First of all, in order to use filtering on a SPGridView, you have to give an ObjectDataSource by it’s control’s ID. For anything else, you can use the DataSource property directly. The best sample code I could fin on the net was this one : Creating the SPGridView with sorting and adding filtering. This example is great because it only shows the basic requirements to setup a SPGridView and it gives you a clean way to build the ObjectDataSource and it explains step by step why you have to do things this way (in Sharepoint, it’s very important). ...

June 21, 2009 · Florent Clairambault

MOSS 2007 : Managing search properties

In Microsoft Office Sharepoint Server, you have a powerful search service. It can’t say I like everything in sharepoint but the MOSS Search Engine is really amazing. It enables to search fulltext on everything and also to filter precisely your results by searching on columns at the same time. But the MOSS search engine isn’t as easy as searching directly in CAML. You have to prepare managed properties (from your lists columns) to be able to search on them. ...

June 13, 2009 · Florent Clairambault

Sharepoint : The 0x80020009 (DISP_E_EXCEPTION) error

If you’re faced with that error, you should know that it doesn’t mean anything except you have a problem. Lots of people have written posts about it, but most of their explanations are wrong. It just means that sharepoint didn’t like what you did somewhere in your masterpage, your page, your webpart, your user control or anything else. For me, it was because I used the SPWeb.GetListFromUrl method to test if the user actually had access to a list. If it didn’t, I was just catching the exception thrown. ...

June 3, 2009 · Florent Clairambault

Sharepoint – Clean a huge Document Library

I recently had to clean a huge (113 000 rows) document library. The first question that must come in mind is : Why was it so big ? Well, someone thought it was beter to store data in lots of XML files instead of in a classic list. The second question is: How ? First, you have to understand that you can’t use a DeleteAll() method, it doesn’t exist. You must fetch data by little packet of rows. If you try to get everything, you will have a OutOfMemoryException. ...

February 20, 2009 · Florent Clairambault

SharePoint: What Should I Dispose?

When starting with SharePoint development, a common question is “Which objects should I dispose?”. This is crucial because SharePoint leaks approximately 1 MB of memory per undisposed IDisposable object. For components like menus, this can quickly add up to 10 MB per page load. While the MSDN documentation provides comprehensive guidance, here’s the quick answer: In your WebPart, dispose of all SPWeb and SPSite objects except: SPContext.Current.Site SPContext.Current.Web SPContext.Current.Site.RootWeb For Features, dispose of all SPWeb and SPSite objects except those provided in your “properties” variable. ...

February 17, 2009 · Florent Clairambault