Friday was the second day of the SharePoint Advanced Development seminar with Shannon Bray.
We went deep-diving into feature development, the Business Data Catalog, Enterprise Search and WCF Web Services. Just as in my previous post this is me cleaning up my notes and also a way to know where I have them. I hope you’ll find use for it, even if there are no code samples it may give you some good pointers on where to start.
Starting with the feature development we got more demonstration code on how to set up our environment, especially for WSPBuilder. Setting up folders in Visual Studio that corresponds to the SharePoint hive 12 structure will let WSPBuilder install everything in the correct folder, even in the 80-folder.
In order to deploy a SharePoint web part we also need to sign our assembly. It’s best to create a Strong Name Key before and use it for all your web parts. That way they will all have the same Public Key.
With a Feature we can work with all parts of our SharePoint application. For example: on the feature Activated-method we can get to our site with properties.Feature.Parent as SPWeb. We may then change properties in the site. Don’t forget to use .Update() for all changes to go through.
Tip: On all SharePoint pages you can add ?contents=1 to view all web parts added to the page. Sometime a web part may be closed but not removed from the page. This can be done through this page.
The Business Data Catalog is a very nice feature included in the Enterprise version. With the BDC we can map an external database and then use it in our application in lists and such.
The BDC can be found in Central Administration under Shared Services.
In order to use a BCD an Application Definition File has to be created. This is an xml-file mapping the database tables into entities. Similar to any other O/R Mapper such as Entity Framework or NHibernate.
The ADF is very complicated and you don’t really want to do it manually. Instead we can use the tools available. BDC Metaman is popular and it has a free SQL-version. There is also the Application Definition Designer which is included in the MOSS SDK.
When it comes to Enterprise Search in SharePoint it is a huge subject. In order to go through it all you need a seminar or course only for the search. However, it was nice to get a run-through with the most important parts to know where to start.
In the search administration you can set upp crawl schedules to index all documents and sites that should be available for searching. The search has word breakers that will divide sentences into words and stemmers which makes it possible to find different inflections of a word. For example Joe ran will also return Joe is running.
In order to search in files SharePoint uses IFilters. Specific IFilters can be downloaded from http://www.ifilter.org.
We can also use the SearchAPI to set up our own searches. In WSS we don’t have cross-site searches but with a web part we can loop through all our SPSites, do a search in each site and then merge the result.
Our last module of the seminar was the WCF Web Services. This is something I haven’t had time to look at before so it was nice to see the demo.
When using WCF in SharePoint the first thing we have to do is to add a Virtual Path Provider. This is because WCF does not handle ~ in paths. Instead of coding our own we can use Winsmarts SharePoint WCF Support that is available at http://spwcfsupport.codeplex.com/
One thing to think about is that the samples show us to host our WCJ services in the /_wcf folder. Instead you should put them in the 12 hive, for example in the _layouts folder. This way it will work for extended web applications without problems.
That was it for this 2-day seminar and I really enjoyed it. I learned a lot and hopefully I’ll have use for most of it very soon.
Shannon Bray made the presentation very interesting and he is excellent in sharing his knowledge.
Thank you Shannon and thank you AddSkills for arranging this expert seminar.