Life, the universe and whatever

Something to say about most things

Archive for the tag “SharePoint”

SharePoint and Silverlight 3

Having accomplished some great results with version 2 of Silverlight in some of my SharePoint projects I have been wondering about version 3 as the implementation has changed somewhat.  Karine Bosche has very kindly gone to the trouble of blogging how to get your Silverlight 3 applications running in WSS 3.0 and MOSS 2007.  Time to roll up the sleeves and dive into all that new functionality!

SharePoint Property Hash Tables

Today I read another great article by Andy Burns entitled Control the RSS Feed Settings on an SPList via the API.  What I love about Andy’s posts are the way he describes the problem first and then how he goes about tackling them, he’s obviously not just a SharePoint specialist but also clearly a true professional when it comes to software development.  If you haven’t read Andy’s blog before I seriously recommend subscribing and then making yourself a coffee and taking a good look through his back catalogue.

Andy used his experience and a nifty tool from Codeplex called SharePoint Manager to inspect the RootFolder Properties HashTable of the SPList object and sure enough he found the settings.  When you’ve come across this concept once or twice it becomes a logical place to look for properties and configuration settings and Andy’s post reminded me of a similar scenario I found myself in recently.  I have a client who are building a new intranet based on WSS 3.0 and Search Server 2008 Express and they want it branded the same as their new internet site.  I created two master pages and a site definition and I wanted to add a Search Center when a new Site Collection is provisioned from the site definition.  That part was straight forward;

SPWeb searchSite = rootWeb.Webs.Add("search", "Search Centre", string.Empty, rootWeb.Language, "SRCHCENTERLITE#0", false, false);

When Search Server is installed a file called webtempsrch.xml is added to the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML directory containing details of the template used to create the Search Center site, that is where the template name and ID are taken from to form the SPWebTemplate parameter “SRCHCENTERLITE#0”.

I then wanted to associate the search box found on most standard WSS 3.0 site pages (a.k.a. the small search box) with the Search Center results page rather than the standard /_layouts/OSSSearchResults.aspx page.  Through the user interface this is easily achieved by opening the Site Settings and selecting Search settings from the Site Collection Administration group.

image

On the Search Settings page simply select the first radio button to send searches to a Search Center and provide the relative URL.  However, I faced a similar problem to Andy and wanted to configure this programmatically when the site collection is provisioned.  A quick look at the SPWeb object model in the SDK didn’t reveal anything obvious and neither did searches on Bing and Google.  My next thought was the SPWeb Properties Hashtable so I took a look in there and found something that looked promising;

image

Using the AllProperties property of the SPWeb it is possible to set the value of the Search Center for the Site Collection as follows;

rootSite.AllProperties["SRCH_ENH_FTR_URL"] = "/search"; // Site Settings > (Site Collection Administration) Search Settings > Use custom scopes
rootSite.Update();

Social computing with SharePoint

I have a couple of clients at the moment who are very interested in exploring social computing trends and how they might apply within the organisation.  I have to admit I find it all very interesting if not a little overwhelming and being relatively new and such a fast evolving area it’s quite a challenge to get onboard.

I’m currently making hard work of reading the rather catchily entitled Social Computing with Microsoft SharePoint 2007: Implementing Applications for SharePoint to Enable Collaboration and Interaction in the Enterprise.  Hard work not because of the book, it’s content  or how it is written but simply because I just don’t make the time to read right now.  I do however make sure I keep on top of my RSS feed list and have just stumbled upon an interesting looking Microsoft blog: The Enterprise Social Computing Blog.  It looks to have been running since January 2009 but I’ve only just noticed it so I have some catching up to do but if the opening sentence of the first post is anything to go by then it will be the perfect place to get up to speed;

Welcome to the new Microsoft mini-site dedicated to enterprise social computing– what it is, what it can bring to your organization, and how the social power of Microsoft SharePoint and other Microsoft offerings can help you collaborate, communicate, and achieve your business goals more effectively than ever before.  If you are interested in enterprise social computing, SharePoint, or both, you’ve arrived at the official river of news and perspectives from Microsoft on this hot topic for enterprises.

So if you have an interest in social computing for the enterprise I suggest you get over there, check it out and look around the rest of the Microsoft Office Social Computing site which looks full of great content.

VSeWSS v1.3 and source control

I have recently looked into using the Visual Studio extensions for Windows SharePoint Services (VSeWSS) that are currently at release version 1.3.  I evaluated the initial releases a couple of years ago and was completely underwhelmed; it was very buggy, very restrictive and, as far as my clients were concerned, I had to recommend an alternative approach to structuring Visual Studio solutions for deploying SharePoint solutions.  A few months ago I was challenged on this point by another experienced SharePoint development consultant and after reviewing Kirk Evans’ series of articles and webcasts I downloaded the March 2009 CTP and set about recreating a few existing solutions using the extensions.  I am very impressed with how far the extensions have advanced since those early releases and they are now supported by the Feedback and Feature Requests forum on MSDN.

The extensions are obviously a work-in-progress but my concerns lay with the upgrade path to Visual Studio 2010 and the indicated/anticipated increase in the level of integration for SharePoint as a development platform.  However, I quickly discovered there is an issue with the extensions when it comes to source control because the feature.xml files are dynamically generated.  This is all well and good except that there is no chance that the standard, minimal settings generated will be sufficient for a production release; the project assembly name is used for the feature title (I think), there is no description, the version number is always 1.0.0.0, the list goes on.  Using the WSP View it is possible to open feature.xml files and make any necessary updates but the problem is the extensions store the physical files in a sub-directory of the project named pkg.  When another developer opens the project from source control the pkg sub folder is not included and it is therefore auto-generated when they first package or deploy the solution. 

Richard Slater is one of many people who have already raised the issue of source control for VSeWSS 1.3 solutions.  As per the MSDN article How to: Create an Automated Build and Deployment Solution with Team Foundation Server Team Build (taken from the SharePoint Guidance on Codeplex) the recommended approach is to add the pkg folder to source control;

To permit team development, you must add this folder to the source control repository. This makes any WSP structure customizations that one developer performs available to the other developers on the team.

The guidance also says;

…the Setup.bat file must be placed under source control so that a build process can use these files to generate a .wsp file and deploy it.

Whether I am automating the build process or not, when the .wsp file is the output to a client I also want this under source control.

Okay, so it seems that we have everything we need in source control for team development and although it doesn’t exactly feel quite right we can live with it because we know this is a work-in-progress and an interim solution before we can get our hands on Visual Studio 2010.  Is it robust enough?  I’m not 100% convinced but I’ve now committed some current projects to the setup so time will tell and if I find more issues then I will report them to the Feedback and Feature Requests forum and blog them here.

Update: I should also have mentioned that when version 1.3 of the extensions is installed a help file is deployed to “[drive_letter]:\Program Files\Microsoft SharePoint Developer Tools 9.0\VSeWSS13.CHM”.  The “Application Lifecycle Management with VSeWSS” chapter should be considered essential reading when using the extensions and there is a section entitled “Source Control using TFS” which details a good demonstration of adding the necessary files and folders to source control.

Technorati Tags: ,,
 

SharePoint unit testing

My last post about ASP.NET unit testing was prompted by the offer that the guys at TypeMock were making for free licences to their new ASP.NET bundle.  I noticed that fellow SharePoint developer and all round top man Chris White was far quicker off the mark than I was!  Rather notably Andrew Woodward has joined the league of SharePoint bloggers willing to spread the word even though (like myself) I know Andrew is a fully licensed user already.  The reason for this?  In accordance with the spirit of my earlier SharePoint as a development platform post there has been a groundswell of activity by Microsoft and leading 3rd party development tools suppliers to support the platform.

If I get a free TypeMock license I will happily donate it as a prize for the 2nd Annual SUGUK Golf Day on 23 July at Ullesthorpe Court.  With any luck, Agile development and unit testing will be on the agenda for the evening user group meeting.

SharePoint as a development platform

Any developer who has interacted with SharePoint in any way, shape or form will surely have asked themselves the question, asked someone else the question or read or partook in at least one of the many debates that have raged over the years.  For me the question “is SharePoint a good development platform?” is pointlessly provocative so I would rather ask “can SharePoint be a good development platform?”.  Instead of giving my own answer to that question I will quote Kirk Evans reflecting on a 6 part series of articles and screen casts he authored entitled SharePoint for Developers:

This series has been building up to an application that provides the ability for an end user to pause a video (rendered through a Silverlight media player) and capture annotations about the video at a particular time segment.  You can imagine that, in a media company, there very well could be additional actions taken when someone creates an annotation such as automatically sending a formatted email to an advertiser (“The text formatting at time 00:00:28.4500000 does not comply with our standards for broadcast”).  This is the real power and benefit of leveraging SharePoint as an application platform: we can incrementally add value to our solution without requiring us to build that functionality into the service.  In a traditional ASP.NET application, you would likely add new functionality in a business logic layer, requiring a change in database storage, changes to the UI to display the new functionality, and changes to the service layer to expose the data to remote consumers.  With SharePoint, you could simply attach workflows to the content type, and any updates to the list via our web service will enjoy this new functionality without making any changes to the web service.  Or you might create a new content type and attach that to an existing list. 

This is a hugely powerful concept, and strongly demonstrates why you should consider using SharePoint as a development platform.  The separation of fields and content types and the ability to apply workflows to content types is huge.  This separation provides the framework for reusable components that can be easily assembled by end users through the web UI instead of requiring developers to code more functionality.  This lets you focus on creating the really cool building blocks and focusing on how to add value rather than writing monotonous forms code that performs CRUD operations against yet another custom database.  It provides a single, consistent platform that provides the web UI, services, and storage within a single platform.

The possibilities here are staggering, because it truly changes the way we think about building applications.

I certainly do not want to reignite any of those previous flame wars about SharePoint as a development platform, I simply saw Kirk’s excellent work which clearly articulates how the development story around SharePoint is continuing to gather pace, credibility and substance.

Please; anyone wishing to express their views on this subject (for or against), I am happy to moderate comments from the well reasoned voices of experience but I have no inclination to host yet another flame war on the subject.  I myself have struggled over the years with trying to build professional, robust systems on SharePoint but I would urge you to take the time to watch Kirk’s screen casts and read the wealth of information and resources he has taken considerable time to pull together.  Nobody can deny the additional overheads (time, experience, software, hardware) involved and it boils down to whether those overheads outweigh the benefits that Kirk succinctly sums up and that can only be done on a person-by-person, situation-by-situation basis.

SharePoint, Silverlight and WCF

These are interesting times in the SharePoint space, Microsoft SharePoint 2010 is on the horizon but as yet very few details have emerged.  As a freelance SharePoint developer and consultant I have for some time been carefully considering which “horses to back” in terms of the technologies to skill up on and introduce into my everyday work.  I believe that both Silverlight and Windows Communication Foundation (WCF) will play a significant and evolving role in the future of Microsoft Office and SharePoint so I have been tracking their evolution and have been slowly and selectively introducing them into my clients’ solutions.

Today I came across the article I have been waiting for: SharePoint 2007 with WCF and Silverlight.  For sometime I have been struggling to put all the pieces of the puzzle together in a deployable and supportable way and, even though this excellent article by Sahil Malik takes a bit of working through, I now have an end-to-end solution template for displaying rich UI with Silverlight interacting with the SharePoint object model through WCF services.  The benefits that make this worth while for me are;

  • a level of UI functionality, look and feel that users are coming to expect
  • the potential to develop far more efficient SharePoint pages that don’t round trip just to update a small area on a page (jQuery and AJAX are also very definitely on my radar)
  • free upgrades – Silverlight 3 is already in beta and promising even more new features, imagine the mouth watering possibilities of SharePoint with out-of-browser support!

Incidentally, I would strongly recommend that anyone interested in Silverlight for SharePoint should read Professional Microsoft SharePoint Development Using Microsoft Silverlight 2.

More excellent community content

I saw Eric Shupps present at the European SharePoint Best Practices Conference this week and he has that rarest of combinations – a deep knowledge of and experience in the product together with a confident and competent delivery.  Eric has posted an article titled Debunking SharePoint Performance Myths and anyone working in any capacity within the SharePoint space will find this type of information invaluable.  I believe that it is shared insights like this that make the product stronger as we can all only do and experience so much ourselves.

Other highlights of the conference for me this week were Andrew Connell with a talk entitled ‘Building High Performance Solutions on MOSS’, Daniel McPherson discussing ‘SharePoint, the Social Computing Platform’ and the whirlwind that is Todd Bleeker giving us more information than could possibly fit into just one head on ‘Best Practices for Creating Custom Field Types’.

Whoever had the idea of a casino night after day 1 should be given a big pat on the back – excellent idea that had exactly the desired effect (I suspect).  I met several new people that evening and we ended up discussing SharePoint, Tamil Tigers, kilts and the north south divide (amongst other things) in a Westminster pub until late.

Overall, I wish the content had been slightly more in favour of excellent insights from the frontline such as Eric’s blog post but I know the organisers have a tough job getting the balance of content just right and I’m looking forward to reviewing the delegate DVD containing recordings and the slide decks from all the sessions.

European SharePoint Best Practices Conference

By virtue of the fact that I have worked for a succession of the world’s tightest employers and am now in the employ of probably the tightest of them all (i.e. myself), I have never been to single fee based conference.  However, after much persuasion my aforementioned current employer agreed that the first European based SharePoint Best Practices Conference was too good an opportunity to miss.  I am therefore happy to report that for the next 3 days my only concern is exactly how I arrange my time to hit all the sessions I really want to see delivered live (although I have already established that is actually impossible as several sessions I really want to see clash).  That said, one of the many benefits is a post conference DVD of all the sessions which for me will be almost worth the registration fee alone.  Of course, the opportunity to catch up with and talk to many of the SharePoint world’s leading lights and so many MVPs in one place will be invaluable.

It looks as though the guys have arranged after hours social gatherings every day culminating in a SharePoint by Day, SharePint by Night evening after the conference closes down on Wednesday.

Access to HOSTS file denied error

I recently experienced a problem on 2 of my SharePoint virtual machines where the event log was filling up with an error along the lines of;

Event ID: 6482 – Reason: Access to the path ‘C:\WINDOWS\system32\drivers\etc\HOSTS’ is denied.

I searched for help with little success and ended up restoring one the VMs to a baseline position however, within a day it was reporting the same errors again.  This time when I searched for help I came across this post by Christian Vesterkvist and this seems to have solved the problems.  I haven’t had a chance to do any meaningful diagnostics but my initial hunch is that it is related to installing SP1.

Technorati Tags: ,,

Post Navigation

Follow

Get every new post delivered to your Inbox.