Tuesday 25 November 2008

Isolator for SharePoint !

If you are a big fan of TDD and you develop on SharePoint then you need to check out Typemock Isolator for SharePoint - develop and test SharePoint code without a SharePoint server - how cool is that!!!

Head over to Andrew Woodward's blog - http://www.21apps.com for some more TDD goodness - specifically these two posts that link to whitepapers and code for download.
http://www.21apps.com/agile/beginners-guide-to-test-driven-web-part-development/
http://www.21apps.com/agile/unit-testing-sharepoint-getting-into-the-object-model/

Typemock are offering their new product for unit testing SharePoint called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to unit test SharePoint without a SharePoint server. To learn more click here.
The first 50 bloggers who blog this text in their blog and tell us about it, will get a Full Isolator license, Free. for rules and info click here.

Thursday 13 November 2008

Anouncing SPDisposeCheck for SharePoint Developers

http://blogs.msdn.com/sharepoint/archive/2008/11/12/announcing-spdisposecheck-tool-for-sharepoint-developers.aspx

So what is SPDisposeCheck

"SPDisposeCheck, will open your custom compiled assemblies recursively and validate them against the Microsoft published guidance. The output from the tool will contain messages that may indicate the SPSite and SPWeb Dispose() methods guidance is are not being followed in the customers source code. While these messages need expert evaluation in order to determine if the software is not performing properly, in some cases just running the tool on your custom code can lead you to simple fixes that improve the quality and performance of custom code on SharePoint. "

"This tool is planned for release during the coming North American Winter. Customers who are currently experiencing difficulties with memory management in their custom applications should review the guidance listed above. Customers who are currently experiencing difficulties with Microsoft Office SharePoint Server 2007 should contact their regular Microsoft Customer Support Services contact, or refer to http://support.microsoft.com/."



Disposing of SharePoint objects correctly is a big problem in custom developed code, if your SharePoint implementation is constantly "Dieing" ie, after regular use the memory and cpu max out and you need to reboot your server to get things going again then its highly likely you are running custom SharePoint Object Model code that is not correctly disposing of objects causing memory leaks. The rate of memory leakage can be significant.

I have since this ugly problem rear its head in a number of projects I have been involved in. So yeah when you finally do fixup the problem and dispose of objects correctly you will notice the improvement of system performance and your server should run as if it has a simple vanilla install of SharePoint.

Another major problem with this is that.... These Dispose() rules are COMPLEX. The biggest problem faced is the difference in coding patterns depending on where your custom code is running.

ie. If your SharePoint OM code is running in a Web Part or Custom Control then you have access to the SPContext.Current object which is your starting point to get to your SPSite, SPWeb, SPList, SPListItem, SPFile etc. etc. its important to note that objects accessed from the current context should not be disposed of. The SPContext.Current.Site and its SPWebs that hang of it are singletons and should not be disposed as SharePoint makes use of these and will need to possibly use these objects after your custom code executes. That means the using(SPWeb =...) pattern will dispose of objects you are not meant to, you will get an error.

BUT - if you are running the code in a console app or 'out-of-context' then you should always dispose the objects as you are the one creating them.

Confused? Complicated? Yeh it is but it is important to understand the issues if you are writing custom SharePoint Object Model code.

Friday 7 November 2008

SharePoint MVP Blogs OPML

If you're big on RSS and use it to keep track of the latest SharePoint news out there, then here's a link to the SharePoint MVP Blogs OPML.

http://services.newsgator.com/sharepoint/opml


My friend Jeremy Thake also has a nice collection of SharePoint links on his Diigo that he seems to update quite often. Here's the RSS feed for Jeremy's SharePoint Diigo links - http://www.diigo.com/rss/user/Jthake/sharepoint

Thursday 6 November 2008

Patterns & Practises SharePoint Guidance and Ramp-Up Program SharePoint for Developers


Microsoft Patterns and Practices - SharePoint Guidance

http://msdn.microsoft.com/en-us/library/dd203468.aspx

Guidance at a Glance
This guidance helps architects and developers build SharePoint intranet applications. The guidance contains a reference implementation (RI) that demonstrates solutions to common architectural, development, and lifecycle management challenges.



Ramp-Up !

(http://www.myrampup.com/) has just launched a brand-new learning track: SharePoint for Developers, Part I today.

http://msdn.microsoft.com/en-us/rampup/default.aspx
http://msdn.microsoft.com/en-us/rampup/dd221355.aspx

Monday 3 November 2008

Free Open Source CMS / WCM on WSS 3.0 - CompleteSharePoint.NET

My old buddy Tommy Segoro recently released CompleteSharePoint.NET a free, open source CMS / WCM system that sits on top of WSS 3.0
http://www.codeplex.com/completesharepoint
http://www.completesharepoint.net/Home/Pages/Default.aspx

Tommy is a great buddy of mine and we've worked on some cool projects together in the past - Nice work Tommy! I miss working with Tommy because he's probably one of the fastest developers I have ever worked with.

Enabling the Word 2007 Developer Tab in the Ribbon to Always Show the Document Information Panel (DIP) When Opening a Document



Last Friday I went to a special Perth SharePoint User Group presentation hosted by William Cornwill of Microsoft. The presentation was excellent and provided a nice overview on Custom Content Types, Templates and Document Information Panel interaction between SharePoint and Word 2007. Awesome presentation!


One question that came up in the user group presentation that a number of people wanted answered was –



"How do I always force the Document Information Panel to show on opening a document"




I had some trouble with this a few weeks ago until I figured out that you can add the Developer Toolbar to Word 2007 which provides the facility to configure quite a lot in the document.




I came across this excellent blog post by Andrew Coates also another Australian Microsofty like William Cornwill – and just like William, Andrew presented at the Perth SharePoint UG a few months ago.




So to enabled the Developer Toolbar in Word following the steps in Andrew's post :




Enabling the Word 2007 Developer Tab




http://blogs.msdn.com/acoat/archive/2007/02/28/enabling-the-word-2007-developer-tab.aspx



You basically go into Word 2007 options to enable the Developer tab in the Ribbon – fairly simple but it took me AGES to figure this out until I came across Andrew's blog.




After enabling the Developer Tab follow these steps to always force the Document Information Panel to show, click on the Developer Tab and then click on the last icon – Document Panel.








And then tick the Always show Document Information Panel on document on open and initial save checkbox to always show the DIP.








Its as simple as that! If you tick that checkbox and save the word document – and then use this word document as a Content Type template in a SharePoint Document Library – then every time a user creates a new document or opens a document they will be presented with the DIP showing.


UPDATE: You need to set this in the Content Type's settings page, there's a link to Document Information Panel Settings.



See - http://stephenmuller.com/2008/07/17/using-the-dip-and-quick-parts-with-office-pt-1/




The developer tab has a bunch of other useful goodies you can play with one of which is adding various content controls such as Picture content controls.



Another important function of the developer tab is Formatting quick parts. Have you ever wanted to change the date format of a Date Quick Part? Add a Quick Part to the page that is based on a Date and you get it formatted as dd/MM/yyyy.



With the quick part selected switch to the Developer tab and click the Properties button in the Controls section of the ribbon







You then have the following options available for configuring this Quick Part (Content Control).






Click Okay – and you now have applied a format to your Date Quick Part ! Other options available such as the Content cannot be edited forces users to always updated the DIP instead of the word document. Ie. By default users can type into quick parts/content controls in a word doc and changes are reflected in the DIP – with this option set users must edited this content in the DIP.







Another fine blog post on Andrew's blog that helped me recently is –



Linking Word 2007 Content Controls to Custom XML



http://blogs.msdn.com/acoat/archive/2007/03/01/linking-word-2007-content-controls-to-custom-xml.aspx



Andrew gives a nice overview of how to make use of the Word 2007 Content Control Toolkit to manipulate custom XML stored in a word document, the tool allows you to add ANY custom XML to a document and then bind it to a Content Control.



Finally in summary I came across the following EXCELLENT resource if you are implementing this sort of advanced document management in SharePoint –



Using Office Open XML Formats to Support Electronic Health Records Portability and Health Industry Standards




http://msdn.microsoft.com/en-us/library/bb879915.aspx



By the Ted Pattison Group – if those guys are involved then you know this is going to be top class.



And the Visual Studio Solution for the article is downloadable here - http://www.microsoft.com/downloads/details.aspx?FamilyId=B36AEBDC-8217-4D64-BFD0-187E58B708BD&displaylang=en