Skip to content

The SharePoint Shepherd On Office Online

I just was catching up and realized that earlier this week Laura announced that the first three tasks from The SharePoint Shepherd’s Guide for End Users appeared on Office Online. Earlier this year I agreed to let Microsoft publish a few tasks from the book on Office Online. The first three tasks are:

Go check them out!

Adding a Second Global Navigation to Pages in SharePoint

Recently I had a client that was interested in having two different global navigations. The first global navigation across the top — using the default global navigation that SharePoint implements. However, they wanted a second global navigation in the left column on top of the normal Quick Launch menu. As it turns out this isn’t that hard, if you’re willing to create a site to host the second global navigation. Sahil Malik posted a blog entry titled “Implementing Consistent Navigation across Site Collections” that showed some promise, however, he was using an XmlSiteMap provider and a custom .sitemap file — I needed to allow my customer to perform the modifications to the global navigation themselves.

The answer I came up with was to create a site off of the root, which I called global navigation (/globalnav). I hid this from the real global navigation (so it didn’t show up in the top bar) and managed the navigation in the site so it had the navigation items I needed at the top of my Quick Launch bar. However, the question was how to plug it in.

The left navigation, or Quick Launch, is emitted out of a placeholder in the master page. The default.master file contains the PlaceHolderLeftNavBar which already contains some default content. In that default content is a delegate control called QuickLaunchDataSource. (You can learn more about Delegate controls in my article “SharePoint’s Delegate Control Power“). The default contents of the delegate control is a SiteMapDataSource control:

This is referring to the SPNavigationProvider in the web.config file. There’s a node in /configuration/system.web/siteMap/providers/ which is the site map provider — As shown below:

<add name=”SPNavigationProvider” type=”Microsoft.SharePoint.Navigation.SPNavigationProvider, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” />

You may notice that the SiteMapDataSource is referencing a StartingNodeUrl of “sid:1025”. This is important for two reasons, first, StartingNodeUrl is useful for navigating to the node in the SiteMapProvider that you want to start at and second because 1025 is the ID for local navigation (quicklaunch) in SharePoint. (By the way, global navigation has an ID of 1002).

This data source is consumed by the SharePoint AspMenu which appears immediately below the delegate control:

The SharePoint AspMenu is a thin shell over the Menu control in ASP.NET. It has the same format for attributes — including the DataSourceId which matches the id of the SiteMapDataSource above. So following the chain… The SharePoint navigation provider returns a set of nodes, the SiteMapDataSource starts at the 1025 (quick launch/local navigation) node and returns the child objects. The SharePoint AspMenu displays the items that are returned (based on the attributes provided.)

With this knowledge we can create a secondary SiteMapDataSource for our global navigation and use the StartingNodeUrl to override where we start at. However, we need one more piece of information. One of the other entries in the web.config file is:

<add name=”GlobalNavSiteMapProvider” description=”CMS provider for Global navigation” type=”Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” NavigationType=”Global” EncodeOutput=”true” />

This site map provider is useful because because it expects to receive a URL in its StartNodeUrl attribute from the SiteMapDataSource. Thus we can create a SiteMapDataSource like this:

Wait a moment you say, what happened to Asp:SiteMapDataSource, well, I wanted to get a few more attributes (described in a moment) so I changed to the actual type of the SiteMapDataSource (PublishingNavigation:PortalSiteMapDataSource). This is a subclass of Asp:SiteMapDataSource so it can be used wherever SiteMapDataSource is expected. Of course, I need to register the PublishingNavigation prefix at the top of the file if it’s not already registered, like this:

<%@ Register TagPrefix=”PublishingNavigation” Namespace=”Microsoft.SharePoint.Publishing.Navigation” Assembly=”Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>

So other than the additional attributes, I changed to the CurrentNavSiteMapProvider from SPNavigation Provider, StartingNodeUrl to “/GlobalNav” from “sid:1025”, and changed the ID to “GlobalLeftNav” from “QuickLaunchSiteMap”. This effectively gives me a navigation provider that would be local to /GlobalNav (my global navigation site).

Then all I have to do is copy the <SharePoint:AspMenu> that currently is used for QuickLaunch and replace the DataSourceId with my new GlobalLeftNav Id from my PublishingNavigation:PortalSiteMapDataSource. In the end I have a working second global navigation.

I promised to explain the additional attributes in the PortalSiteMapDataSource. Well, by default the navigation will include sub-sites and pages in the site in question. Rather than relying on the users to remember to hide them if they created any, I can tell the navigation provider that I don’t want any subsites or pages returned. The effect of which is that I get only the headings and links that they added manually to the navigation of the site.

In the end I chose to implement the changes I describe here in a page layout so that the users could easily choose to include the navigation — or not, based on the page they were creating.

Dumping the RAW CQWP Query Results (or How To Change the ContentQueryMain.xsl)

Sometimes working with SharePoint feels like picking a lock. You know that if you get the right combination the lock will open and you’ll be able to get what you want — however, figuring out that critical combination is difficult. I’ve spent too many hours trying to do something simple — I wanted to look at the results of the query generated by the CQWP in its raw form. There are several posts that talk about how to dump out the attributes/fields that are coming back from the query, including Heather Solomon’s. This uses a simple technique in the ItemStyle.xsl which creates a template that iterates through each of the attributes by using a select of @* (meaning Attributes, All). However, I just wanted to see the raw XML. The XSLT to do that is pretty trivial…

However, there aren’t a ton of examples on how to even customize the main XSL for the Content Query Web part. The property you need to change in the web part file is MainXslLink. However, this property isn’t covered in either How to: Customize the Content Query Web Part by using Custom Properties or How to: Customize XSL for the Content Query Web Part. I located the property and tried to customize it with my little dumpall.xsl that I keep around (it is little more than the XSL snippet above). However, every time I’d use it I’d get an error message:

Well, it turns out that there are some dependencies in the CQWP to what’s in the main XSLT file. (No I didn’t isolate them.) So instead of starting with a blank file to dump out everything I made a copy of the ContentQueryMain.xsl where I replaced the following snippet:

with the snippet above to dump everything out. This worked beautifully. It dumped out what the CQWP was providing to the XSLT for transformation.

Microsoft Certified Master: SharePoint

There has been a bit of discussion in the public blogs about the new Microsoft Certified Master program for SharePoint. Folks I respect, like Joel Oleson have said, in effect, I can’t do this because it requires that I think both from the perspective of a developer and an IT Pro. I’ve spent my whole career as an IT Pro. (Joel – Please forgive me for paraphrasing so bluntly.) He graciously complements me as someone who could possibly achieve this certification because I can do both sides. As a point of fact, I tend to drift towards the development but I can absolutely talk about load balancers, link aggregation control protocol, VLANs, core switch bandwidth, etc. Frankly I know I’m in the minority about the ability to do this — my clients remind me of it all the time.

So I’ve seen a ton of email traffic beyond what’s public in blogs and here’s what I can confidently say about the Master program — it will set you apart.

I’ve got a ton of paper certifications behind my name from CompTIA, Microsoft, and even some expired Novell certifications. I rarely write them down any longer. In fact, the seven CompTIA certifications I have are all listed as “etc” in my signature. I’ve been involved in just about every aspect of the exam development and certification process. (I suppose I’ve never proctored exams so not everything.) I’ve written exam questions. I’ve written books about exams. I’ve written articles about exams. And one thing I’ve come to realize is that I’m really good at “gaming” the questions. What I mean by that is that I use the question itself to lead me to the answer. While smart people on the exam development teams try to prevent this from happening, I can tell you that I do it on every test I take — certification or not. (What’s really fun is gaming a personality test.) So I know that you can have people who don’t know the technology who can get these certifications. (I’m not saying I don’t know them — just that I can clearly see how one could pass without knowing the requisite knowledge.)

Here’s the thing. A certification is SIMPLE thing. It’s a STANDARD, a bar which the candidate has to get over. Some could argue that the computer based exams set the bar too low. (I’ve got a book on psychometrics you can read if you believe this is the true problem — I don’t need it any longer. It cured my insomnia.) The trick with computer based exams is they are designed for VOLUME. They’re designed to provide a MINIMUM standard that people should meet. They’ve never been designed with the idea of having only a few people pass them. I was once told that each computer based certification exam could cost more than $200,000 to develop. Ouch. I hope they get a lot of people to take it.

Several years ago when Cisco released the CCIE program there were a bunch of folks who didn’t believe the costs for those exams were worth it. However, the market has proven out that this was a good thing — for Cisco and for the participants in the program. Having a CCIE really does distinguish you in that field. It’s not as prestigious as it once was, but it still carries a ton of respect.

What does all of this have to do with the MCM program? Well, first, having a high bar — having a bar that provides a real hurdle for most folks has value. Sure there won’t be tons of them in the market — but there aren’t tons of Microsoft SharePoint Rangers either — you know when you get one that you’ve managed to get the right person to help you solve your issues. Having a high bar with a practical test is worth it in and of itself. That being said, that isn’t all the program is about. The much discussed fee has been a big sticking point for people but let’s look at what it really is. It’s three weeks of training.

However, it’s three weeks of training by the folks who know that topic best. You’re not going to an Microsoft Training Center that trains on Word one day and SharePoint the next — or even the SharePoint training companies that I respect that teach on Development, Administration, Branding, etc. You’re talking about the guy (or gal) that knows the topic the best. If you take the $18,500 and break it down into three weeks of training it’s $6K/week — I’m not saying that’s cheap but I’m also not saying it’s really too bad either. You’ll spend ~$3K/week for a decent training class. For me, it’s a solid deal. It’s the best you can get…

Why should someone get it? That’s one of the most frequent questions that I’ve seen in private threads. The obvious answer is so that you can make more money — make more than your investment back. Of course, for some this won’t work and others it will. My perspective is a bit different. The reason to get it as an individual is to distinguish yourself. I wrote an article “Standing Out from the Crowd” for Developer.com. This would definitely qualify, but it’s more than just finding a better job, or the next job. It’s also about doing something that you can be proud of.

One of the things that I’m the proudest of, with the exception of my family, is my pilot’s license. I earned it about seven years ago. I don’t fly much right now because I’m busy working, raising a son, and loving my wife, however, it’s still something that I can say I did. It’s not practical at all — for me. However, I know it’s something that I learned to do that relatively few people on the earth have done. Similarly I’ve met people who have learned to Scuba dive who have a similar feeling. I’m saying that there’s a certain sense of pride in knowing that you can do something. I think the MCM may be that for some people.

Another common question is why should an employer send their employee? There are a few hidden questions here but let’s start with the fact that having an MCM will distinguish your entire organization. If you’re a Microsoft Gold partner you’ve probably got competitors in your space who are also Microsoft Gold partners. How do you distinguish against them? The other hidden item is a fear that if you invest in an employee they’ll leave to go get more money, etc. Well, the fear is valid, however, there are ways of mitigating it. How? How about writing the training as a loan to the employee that’s 0% that you pay back for them in the form of a bonus for a certain amount for every month that they work for you after they come back from receiving the certification? Of course the loan becomes payable immediately if they leave.

Beyond that, you’ll select the people you send very carefully. If you send someone it’s unlikely they’ll leave unless you do something truly boneheaded. Why? Because in the end analysis we don’t work for money. We work because we like and respect the people we work with. Sure we have to cover the money thing first but most people (particularly looking at this as an option) make enough for a basic needs. At this point we want to work for people we like and respect. An employer that makes this sort of investment in someone has to endear some level of gratitude. I’ve not seen recent statistics about people leaving after they have achieved a certification but it used to be that it didn’t happen as much as employers feared.

So with my position firmly in the camp of “MCM is good” one might reasonably expect that I’ll be the first to sign up and go for it. Ultimately the money doesn’t bother me and I’m quite ready to have something else that I can say I’m very proud of. I know that I’d learn a ton from people who are at the top of their game. However, in all honestly, I’m not ready at this point to spend three weeks away from my family. (I didn’t say friends because I honestly have quite a few friends in Redmond — so I wouldn’t miss time with friends.)

So it’s probably not right for me — but it may be right for you.

TechEd Online: SharePoint Patterns and Practices Guidance

Last week while at Tech Ed EMEA in Barcelona I got the opportunity to do a recording for Tech Ed Online. Ajoy Krishnamoorthy and I talked about the recent release of the SharePoint Guidance from the Patterns and Practices team. If you want to see the interview you can (WMV High, WMV Low, MP4, MP3)

I will say I find it more than slightly amusing that they were able to spell Ajoy’s last name correctly (and fit it on the screen) but they fat fingered my last name. (You’ll have to watch the video to see it.)  [Update: Wow they fixed that fast.  You’ve missed how they mistyped my last name at this point.]

TechEd EMEA 2008: Connecting Office Client, SharePoint, Search, and Workflow

Earlier today I presented on Connecting Office Client, SharePoint, Search, and Workflow. It’s one of my favorite talks because it shows an end-to-end solution from getting data from the end users through promoting the properties in SharePoint, making them searchable, and taking action via workflows. In the presentation I referred to a few tools and resources. They are:

Good luck on your next project to make life easier to get data in — and used in your organization.

SharePoint Governance and Pandora’s Box

Maybe it’s the fact that I’m over in Europe on the continent for the first time in my life. Maybe it’s the fact that I’m listening to German and thinking of all of the languages that I don’t know. However, somehow my thoughts drifted across the old Greek Mythological figure of Pandora. The short of the story is that Pandora opens a box containing all of the evils of the world — and hope. The story ends with Pandora having opened the box and realizing that once let loose there’s simply no way to get all of the evil back in the box.

I was recently emailed to ask how to convince an organization that they need some SharePoint Governance. The answer I gave was to look at the Governance articles I written (Many of them are linked from the Microsoft TechNet SharePoint Governance Resource Center) and know enough about them to ask the client how they’re going to deal with a particular topic. I walk clients through governance conversations all of the time. I walk them through first with those questions — and then I move on to providing best practices, cautions, and advice about how to develop the best possible system with the least possible cost. I tell most folks that governance isn’t rocket science, it’s just a matter of knowing what things you want to manage. In fact, one of the definitions of governance — and the one I like best — talks about managing risk. That’s pretty simple — we do work on governance to mitigate the risks that empowering the end users brings.

For the most part I encourage folks to work with as little governance as possible so that they don’t stifle the enthusiasm of the users for using the platform. That works well for most things and most people. Whether you have a guideline on what files can be uploaded or not probably doesn’t matter for most situations. However, there are a handful of things that if you fail to govern up front you’ll create nearly irreversible problems. Here’s an incomplete list of things that you want to have a handle on right away — and why:

  • Server Configuration Management — I’m an old server guy, I’ve managed servers for organizations. I know what happens when you begin to suspect a server. You replace it. The amount of troubleshooting and problem solving necessary to figure out what the problem is generally isn’t worth it. With simple services you can quickly recreate the services that the server offers up and move on — however, SharePoint isn’t that simple. You can’t just tell all the users that you’re going to demolish SharePoint and start over. Because of this I advise every client to maintain good (not tight or perfect) control of the servers so that they don’t have to worry about rebuilding their farm. By the way, most of the time this means that developers don’t have access and all code is deployed via a SharePoint Solution (WSP) file (See Using SharePoint Solutions to Deliver Server-Side Solutions)
  • Unsupported Things — There are a fairly small set of things that Microsoft doesn’t “support.” Direct access to the databases, changing data in the databases, modifying out of the box files (with a few very small exceptions). Once you’ve done these things it’s possible that you’ll never be able to recover. For instance, modifying the database. Once it’s modified you can’t really unmodify it. Overwriting out of the box files can be undone — with care. However, most of the time if you modified a system file you did it to solve a problem (in a specific way) that couldn’t be done without modifying the file. In this situation, getting back to a supported state may be difficult, or impossible to do while still solving the same problem for the business. This is a very difficult spot to be in.
  • Site Definitions — As the Microsoft Patterns and Practices SharePoint Guidance and a flurry of recent blog posts (Joel, Eric), and my article have indicated you may need to create site definitions — but they make it equally clear that you should only do them if you need them — and they should be done in a specific way. Here’s the problem with site definitions. You can’t change them. I mean this from the perspective of changing from one site definition to another and also changing the functionality of the site definition once it’s deployed. Changing from one site definition to another isn’t supported because the core of the site is created during the site creation process and there is no way to go back and re-do that process. Also, once you’ve deployed a site definition and sites have been created, you’re not supposed to ever change that site definition. If you need to change the way that the site definition behaves, you’re supposed to feature staple to that site definition.

I’m sure that I’ll get several comments from folks who will tell me other areas of governance that really need to be in place up front to avoid long term problems. So what long term problem do you think you should have avoided by having better governance up front?

Installing SharePoint is a good thing — but if you’re not planning appropriately for the user interest — you can be opening Pandora’s box.

TechEd EMEA 2008: Quick Integration From SharePoint to Your Application

On Thursday (Nov 13, 2008), I’ll be presenting a session titled “Quick Integration from SharePoint to Your Application” at TechEd EMEA. I wanted to provide a post that would provide access to all of the resources I mention in that talk. So here are those resources:

  • Design Your Web Site to be Search Friendly — An older article on the keys to making sure that your web site can be searched by any search engine — including SharePoint.
  • Using SharePoint Search to Find Information in Your Enterprise– A web cast on how to use SharePoint Search to find information in your enterprise — including applications. This web cast was developed for SharePoint Portal Sever 2003 — but all of the concepts still apply today.
  • http://mssharepointdeveloper.com — A wealth of free resources for learning how to develop in SharePoint
  • SharePoint Guidance on MSDN — A set of guidelines for good development on SharePoint.
  • MOSS SSO Setup Step-by-Step — A step-by-step guide to how to setup SharePoint SSO

SharePoint and Locking up W3WP or STSADM

Recently I discovered a new an interesting way to lock up the W3WP process. I was trying to deploy a content type including a document template all in one feature. Because I was declaring fields (and a workflow too) I had to set the scope of the feature to Site. The problem is that files are supposed to be provisioned via <Module> tags — in a Web scoped feature. I didn’t think much about it until I realized that whenever I activated or deactivated the feature I’d lock up whatever process that was doing the work. So if I did it through the web W3WP would end up in an endless (or seemingly endless) loop. Similarly doing it from the command line caused STSADM to lock up.

So if you’re locking up the worker process (as evidenced by 50% or 100% sustained processor utilization) you may want to make sure you don’t have a <Module> tag in your Site scoped feature…

Recent Posts

Public Speaking