Regular Expression Validated Column in SharePoint

What a great discovery – a Regular Expression Validated column on Codeplex. I’ve been talking about writing one of these for about 6 months – and Gael Duhamel has written one for me! Kudos!

I’ve not tried it yet, but I’m putting it to the top of my ‘things to try’ list. As my colleagues know I love regular expressions, and I rather feel this should be OOB.

Regular Expression Validated Column in SharePoint

My Breadcrumbs have "> Pages > default.aspx" in them

I’ve written about this before, but really it was just an addendum to another point I was trying to make. It might be worth bringing out as a post in itself.

ASP.NET navigation controls take data from a navigation provider, and render it into HTML. The breadcrumbs used in SharePoint use the one navigation control, but give it different navigation providers…

… the point relevant to whether or not the “> Pages > default.aspx” is displayed in the breadcrumbs is the SiteMapProvider. The CurrentNavSiteMapProviderNoEncode provider doesn’t seem to include the ‘Pages’ bit of the path – hence it is used by the page layouts. The Default.master’s SPContentMapProvider provides a breadcrumb that includes the ‘Pages’.

So, if your page is using a breadcrumb such as…

<asp:SiteMapPath id="ContentMap" SiteMapProvider="SPContentMapProvider" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>

… then your breadcrumb will include the “> Pages > default.aspx”. Note that this is the default content of the breadcrumb in default.master. Thus, if you’re creating a brand new page layout, you’ll probably want to override that content using an ASP.NET Content control something like this…

<asp:Content ContentPlaceHolderId="PlaceHolderTitleBreadcrumb" runat="server">

<asp:SiteMapPath ID="siteMapPath" SiteMapProvider="CurrentNavSiteMapProviderNoEncode" RenderCurrentNodeAsLink="false" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" Runat="server"/>

</asp:Content>

This code defines a content control that overrides the default content for the Title Breadcrumb. It uses the CurrentNavSiteMapProviderNoEncode (nice name!) navigation provider, and so won’t show the “> Pages > default.aspx” bit in the breadcrumb.

So, in short, when you’re creating a new Page Layout, make sure you override the Title Breadcrumb with something that uses the CurrentNavSiteMapProviderNoEncode provider.

My Breadcrumbs have "> Pages > default.aspx" in them

Outlook 2003 to SharePoint 2007 Email Integration

So what has Andy been working on lately? Well, lately I’ve been writing an integration between Outlook 2003 and SharePoint 2007. It was all a bit fraught – some of the web services I was using are a bit dodgy, uploading files and metadata as one transaction doesn’t seem to be possible, and everyone always underestimates the effort involved in coping with the metadata about an email. I’ve written an integration between GroupWise 6.5 and Open Text Livelink before now, and again, dealing with the metadata was a bigger effort than browsing the system or uploading the document.

Now, email saving into SharePoint seems to be an overlooked thing. Microsoft have their Exchange 2007 Managed Folders, which can push emails into a SharePoint Records center. Liam Cleary has written his usual high-quality description of setting it up, and the MS Records management team blogged about it in parts I, II, III and IV.

However, a lot of our customers aren’t impressed with this solution. They want to be able to save emails into particular SharePoint Libraries within their usual collaboration environment, rather than just booting them off into a Record Center.

U2U built an Outlook 2007 addin which is very nice – though a bit of a different take. Their approach requires defining the save location up front and mapping to the data, but that then saving emails is dead easy – just drag them into the folder. Nice.

Anyway, this is what I built – I’ll contrast with the U2U offering lateer…

Continue reading “Outlook 2003 to SharePoint 2007 Email Integration”

Outlook 2003 to SharePoint 2007 Email Integration

Styles in the Summary Links Web Part

So, I’d been asked to look at building a links menus something like this:

A Fake Menu with Big Buttons

I thought that this was quite nice. I wondered if I could make something similar to this using the Summary Links web part – curiously, it’s something I’ve never really used, and I though I remembered seeing that it could show images too. So, I set up some examples… Continue reading “Styles in the Summary Links Web Part”

Styles in the Summary Links Web Part

Self Referencing Lookup columns

Came across something I’d not considered – self referencing lookup columns! I was doing some testing, and this totally caught me out (and caused my Outlook plugin to crash and die).

Basically, this is a Lookup column where the List that it is looking up onto is the same as the list where the lookup column is in use. In our case we had a list called ‘Issues’, and the lookup was a multi-choice look-up called ‘Related Issues’. It would let a user select things from the Issues list. All in all, a perfectly sensible use of a multiple lookup, and one I’d not thought of!

However, this in itself wouldn’t cause my plug-in to suffer an error. The problem was with the data I was getting back from the Web Services I’m using. I use the List Webservice‘s GetListContentType method to get information about the Content Type, and I then read the information about the fields. Lookup fields normally come through with an attribute List ; this is the list that’s being looked up onto, and normally it is a GUID. However, for self-referencing lookup instead of a GUID, you get a string ‘Self’‘. Okay, I can’t argue that it’s wrong, but it’s a smidgen annoying that it is inconsistent. Couldn’t it just give me the GUID and let me figure out if that’s the same list? Or use another attribute to denote that it’s a self-reference?

I don’t get why this was built that way.

Self Referencing Lookup columns

Comparison of different ways of putting content into SharePoint 'Pages'

Previously I’ve looked at a couple of ways of entering your data into a Publishing Page. Well, it turns out that really there are 3 ways of putting content in:

  1. Writing content directly using the Content Editor control (the RichHTMLField control)
  2. Writing content in Word 2007 and using the Document Conversion service
  3. Writing content in Word 2007 and cutting and pasting(!)

I decided to test and compare these techniques. For options 2. and 3. I used this document:

The Source Word 2007 Document

Let’s look at the results of this and the code that is behind each resulting page… Continue reading “Comparison of different ways of putting content into SharePoint 'Pages'”

Comparison of different ways of putting content into SharePoint 'Pages'

Accessibility in MOSS…

Recently I had a meeting with HiSoftware about the Accessibility Kit for SharePoint that they’ve made (and is available on CodePlex), and it was quite interesting. Making a SharePoint system accessible requires knowing how much of the system to make accessible, and to what level of accessibility. As with branding, doing the whole system would probably be prohibitively expensive. However, making certain areas (such as a WCM site) accessible is quite feasible.

Even if a SharePoint system is developed to be accessible, there is a governance issue in make sure that new content is also accessible. HiSoftware provide the Accessibility Kit (for free) to help develop an accessible site – though custom work will always be required. They also provide several commercial products to facilitate governance of new content and ensuring that it is accessible. I think that these will be useful sometimes, so it’s not a bad sales pitch. Continue reading “Accessibility in MOSS…”

Accessibility in MOSS…

Web Part for showing subsites

This is kind of obvious, but why isn’t there a web part for showing subsites?

Sure, there is the ‘Table of Contents’ web part, but annoyingly that shows other things in the site, like lists and libraries, rather than just child sites. And there isn’t any setting I can find on it to make it behave that way – which also seems a pretty obvious feature. So annoying – 90% there, but not quite.

Well Chis Johnson has has the same though and made an example. I’m not entirely convinced about creating the output string in the property (that’s a bit bizarre Chris), but it’s a good start.

I guess it’s another bit of a gripe about out-of-box navigation in SharePoint

Web Part for showing subsites

Getting ListItems from throughout the Site Collection with SPSiteDataQuery

So, recently I was doing some work with SharePoint Web Services, getting possible values for Lookup fields. One of the functions I was using was GetListItems(), to get the values that the lookup field could take.

The method’s signature is:

Lists.GetListItems( [List], [ViewName], [Query], [ViewFields], [RowLimit], [QueryOptions], [WebID]);

I’m not going to talk about most of these parameters – you can read about them here. For my query, most of these parameters were Null (i.e. they were unused). However, the [List] parameter interested me. It’s the ‘Name’ of the list, though I prefer using a GUID (a unique ID) for the list.

The lookup column I was using was defined in a different site to the one where I was making the GetListItems call. I’d pass the GUID, and get the correct values back. My call actually was:

XmlNode resultNode = _lists.GetListItems( listGuid, null, null, viewFields, null, null, null);

So, this query was finding the correct list elsewhere in the site collection based only on the GUID. Interesting – I’m not passing a WebID, and the list is outside the site I’m currently using the web services of. This set me thinking – clearly the call was selecting by list GUID against a table of all ListItems in the site collection.

I was a little surprised – then it hit me – the Content Query Web Part also does that. But how?

Well, a bit of searching later and I found the SPSiteDataQuery object. The object is used for queries against multiple lists in multiple sites. You can specify the types of list to query, values to filter, order by, display, etc.. I’m pretty sure that this is what the Content Query Web Part uses.

Neat! Now I just need to find a reason to use it!

Getting ListItems from throughout the Site Collection with SPSiteDataQuery