|
|
|
|
|
|
|
|
|
|
|
|
| Making Sense of the SharePoint World |
2/2/2010 As most of you know, I was a speaker at the Indianapolis SharePoint Saturday event. We had close to a capacity crowd, with over 250 attendees. Not bad for a little town in the Midwest. OK, Indianapolis isn't all that small. There are a few events that draw more people - like the Indianapolis 500. And I hear there's also a football team... (just kidding - Go Colts!).  My Session Nevertheless, there were 20 sessions, in four tracks. My session was the first of the day in the "No-code solutions" track. I gave an Introduction to SharePoint Designer 2010 (click the link to download a PDF of the presentation). I touched on many of the key features, but gave special emphasis to how you could easily configure SharePoint to disable the "dangerous" functions (modifying master pages, and editing or un-ghosting pages). This, along with SPD's new emphasis on business process integration, makes it a great tool to give to your business analysts and information workers, without needing to worry about them "messing up" your corporate branding or making their sites unusable. Collaboration and Camaraderie Of course, the big benefit of coming to a smaller conference is getting actual face-to-face time with the presenters, without the pressure of competing with thousands of others who want the same thing.  And let's not forget drawing for door prizes! In the end, knowledge was shared, connections were formed, and a good time was had by all. I'm really looking forward to the next one! P.S. In case you missed it earlier, here is a link to a PDF of my presentation. 1/21/2010
The Answer may be SharePoint, but Don't Forget the Questions!
One of the biggest reasons some SharePoint deployments fail is because they are "SharePoint Deployments".
People hear the buzz, and want to jump on the SharePoint bandwagon. They buy servers, attend training, install the software. Big bux are spent customizing and branding a SharePoint home page. Maybe there's a big roll-out promotion. Everybody says "Look! We've rolled out SharePoint!". And then...
Crickets.
All Dressed Up, and Nowhere to Go
But, you ask, what about all of those stories you hear about "uncontrolled growth"? People clamoring to get their own SharePoint sites? That's all true as well, but you need to consider why that is happening. In those cases, the people have a goal, and find that SharePoint is a great tool for making that goal a reality. The goal isn't to have a SharePoint site, per se. Rather the goal might be "easier document and calendar sharing", and SharePoint is used to attain it.
Simple Pleasures
Often those implementing SharePoint forget the KISS principle (Keep it Super Simple). SharePoint has a lot of great features and functions right out of the box. It is very tempting to try implementing all of them at once on the same site, sometimes even the same page. It is almost like when "desktop publishing" was made possible by Postscript laser printers. People discovered how easy it was to have a dozen fonts on a single page, and so that's what they did.
Similarly, in the early days of the web, as new features were added to web browsers, they started showing up everywhere on sites. (Does anyone remember the <Blink> tag?) And don't even get me stated on some of the early Flash-based sites. It got to the point where IBM was even poking fun at the designs in their commercials. "It's a Flaming Logo!" Why? Because we can!
The fact is, like the flaming logo, the fanciest features SharePoint has are worthless unless they are used in the service of some actual user need. For example: Assuming it is reasonably well implemented and up to date, the most used feature on any intranet is almost guaranteed to be the company phonebook or employee directory. Probably by an order of magnitude above any other function. It isn't fancy, but it is something people actually need on a regular basis.
As it turns out, SharePoint, with its personal profiles and My Sites, makes a great employee directory. :)
Form Follows Function
Of course, if all you needed was an employee directory, SharePoint would be overkill in the extreme. But put that directory in the context of a company intranet, with news and knowledge bases, collaboration and search. And here's a radical idea - Ask your users what they need first, and implement that! Maybe throw in a few things that are just for fun, like classified ads, or pictures from the company picnic. Suddenly you have a "destination" that will draw in your users and enhance the sense of community in your organization.
These are all things that could be (and often have been) done individually without SharePoint. But SharePoint gives you the tools you need to build and maintain these "applications" easily, quickly, and consistently - usually without custom code.
Now you can add your branding, and promote "Our-Net 2.0". Sure, it is a site based on SharePoint, but now you have put the horse before the cart, and given your users the tools they really need. It doesn't matter to them what the name of the technology behind the scenes is. All they care about is that you have created something that can help them do their jobs better.
Let SharePoint play Clark Kent, so you can look like the super hero. 1/9/2010
On the Road Again...
Well, 2010 has just barely gotten started, and SharePoint Saturday's are already in full swing. I'm pleased to announce that I've been selected to present at the SharePoint Saturday in Indianapolis, Indiana. This takes place on January 30th, 2010, at the Gene B. Glick Junior Achievement Center. Click on the link or logo above for all the details, including registration, a list of the other presenters, as well as the Twitter feed of #SPSIndy commentary.
A SharePoint Saturday is a free to attend event that serves as a mini SharePoint conference. You get some of the same world-class speakers and content found at the big events like Tech-Ed. If you're in the Indianapolis area, and want to know more about SharePoint, this is not something you'll want to miss. 12/28/2009
The Obligatory Year-end Report
It is now the last week of December, and you know what that means. Lying in wait among the crumpled wrapping paper, danced-out sugarplums, and pine needles (not to mention the feathers and other "presents" from all those birds your true love gave to you) you'll find year-end wrap-ups from every corner imaginable.
This is mine. :) I'll get to the more general stuff in a moment, but there was one personal SharePoint-related thing that stood out for me in 2009, and that happened the very first day.
I Became a Published Author
While I (along with Asif and Bryan) did all of the work in 2008, my book Professional Microsoft Office SharePoint Designer 2007 was officially released by Wrox Press on January 1st of 2009 (December 31st, 2008 in some markets). I'm honored by the very positive reviews, and want to thank everyone who has purchased it.
Ironically, its importance is going to continue on into 2010, and possibly beyond. While SharePoint 2010 is top-of-mind for many people right now, the fact is that SharePoint 2007 is going to be around for a long time to come. But, SharePoint Designer 2010 cannot work with SharePoint 2007 sites, so SPD 2007 will still be needed if you want to customize older SharePoint sites. Since SPD is now a free download, there isn't much in the way of printed documentation, other than (you guessed it) third party books - like mine.
The Year of the "Community Conference"
One amazing thing that stood out about 2009 was the popularity of independent SharePoint-related conferences and seminars. I personally presented at two - the "Best Practices SharePoint Conference" in San Diego, and the "SharePoint Technology Conference" in Boston.
But the big trend was the emergence of the "SharePoint Saturday" mini-conferences. These are one-day, free to attend conferences, that are held all over the world. Here you will find breakout sessions by the very same experts that present at the larger venues, like Tech-Ed and the official Microsoft SharePoint Conference. Check out the SPS site, and plan to attend one of these events near you!
And, of course, no mention of the "Community Conference" would be complete without mentioning the "Conference Community" on Twitter. This is a bit less formal, but essentially you will find a play-by-play for almost every conference being happily tweeted by the attendees with hash tags like #SPC09, or #SPSINDY.
SharePoint 2010
Of course, the big news was the announcement of Office and SharePoint 2010, and the availability of the public beta. The official release is currently set for the "first half" of calendar 2010. As many articles have pointed out already, much has changed. There will probably still be some significant changes between now and the final release, though what they might be, nobody can say.
Other Significant Events
Some of the other SharePoint things that happened to me in 2009
- I became Michael Gannotti's very first "Backseat Driver"
- I was once again awarded as a Microsoft MVP for SharePoint Server
- I autographed and gave away almost 500 copies of my book while working the Microsoft Technical Learning Center booth at Tech-Ed in Los Angeles
SharePoint, the Target
No post about SharePoint in 2009 would be complete without some mention of another buzzphrase that started appearing in 2009 - "SharePoint Killer". Almost every new application that had the slightest thing to do with collaboration or content management seemed to earn headlines of "Is X the Next SharePoint?" or "Y will make SharePoint Obsolete". From Google Sites to Google Wave. From Drupal, to Alfresco, to the classic DotNetNuke. Yet while each may have one area where it shines, none of them really has the versatility or power to match SharePoint, assuming they are even truly comparable.
Blog Highlights
For those of you new to my blog, here are some of the articles I wrote this year that you might find particularly interesting:
Looking Ahead
With the planned official release of SharePoint 2010, 2010 the year looks like it will be just as exciting as 2009. One thing that is very clear is that Microsoft is putting a lot more effort into the supporting infrastructure for SharePoint. From native support in Visual Studio, to online documentation, to partner training.
While people may have been shocked by SharePoint's meteoric rise, nobody is going to be surprised by its continuing momentum. 12/13/2009
"You Must Un-learn what You Have Learned!"
The public beta of SharePoint 2010 has been out for a few weeks now. Many people are discovering and blogging about some of the great new features you're going to find. Yet there have also been some significant changes to existing features. These are things you may have been using every day in SharePoint 2007 and WSS 3.0, but which in SharePoint 2010 have moved or changed in ways could cause confusion to experienced users.
In this article I'm going to focus on changes the typical end-user would see. In future articles I'll talk about changes for site owners and administrators.
If it Ain't Broke…
SharePoint 2007 took a lot of heat for having certain "quirks" in its user interface design. For 2010, much as they did for the Office clients in 2007, Microsoft put a lot of R&D into what it would take to make SharePoint easier for typical users. This resulted in a lot of changes.
Human beings are creatures of habit. With certain notable exceptions, we don't much like change. Despite having worked through a non-intuitive learning curve, or sometimes because of it, we would rather keep doing things the way we are used to than learn new ways - even if those ways are better.
...Fix it Anyway
Only time will tell if the changes Microsoft made truly are for the better, but they've definitely been made. Let's start by looking at the basic team site page in SharePoint 2010 side by side with its SharePoint 2007 equivalent:

At first glance, they're pretty similar. The WSS logo has been replaced with a "real" picture, but there's still a banner, title area, quick launch, and content space. But look a little closer. The Site Actions menu has moved. No big deal there - lots of custom master pages move that around. But, the new placement is comparable to the Backstage/File menu in the new Office 2010 client applications, thus making it a "natural" place for users to look for "application"(site)-wide functions. This analogy becomes even more obvious when some of the other tabbed interface options start showing up. (You'll see that later in the article.)
Where's MySite?
Another subtle change is the "personal" section of the banner. In SharePoint 2007, you had separate entries for User ID, links, and a direct link to your "My" site.

All of these options are now accessed through the menu under your name. There is also no reference to My "Site", rather it simply calls it your "Profile".
I think the hope here, is that by de-emphasizing the "independent site" aspect of the profile and personal storage, while actually expanding its function (the new profile features could fill up several articles on their own), resistance to deployment in certain enterprises would be reduced.
Bread-Crumbling Navigation
Getting around from site to site, and from place to place within a site, has received a LOT of attention in SharePoint 2010. In many cases, this has meant "reimagining" the concept of a breadcrumb.
In the case of 2007 site navigation, a breadcrumb stretched across the top of the page content area:
For large site hierarchies, this could become unwieldy as it stretched across the page. For 2010, Microsoft replaced it with a folder icon in the tab banner, which produces an indented hierarchical view of your current location:
Going the other direction, in SharePoint 2007 lists and libraries selecting a view was accomplished by selecting it from a drop-down list on the toolbar.
In SharePoint 2010, there is no list toolbar. While you can drill into the ribbon and find the view settings, then select your view, that's a lot of clicking. Fortunately, Microsoft has turned the title panel into an in-site breadcrumb. When looking at a list or library, the last item in that breadcrumb is the name of the current view. If you look carefully, you'll notice that there is a "down triangle" arrow. That's your hint that this element is actually a dropdown menu, where you'll find all of your view selecting goodness.

Tied up with a Ribbon
Of course, the rest of the stuff that used to live on a list or library's toolbar:
has been moved into the Library tab of the new ribbon interface:
By the same token, individual items that lived in an individual item's dropdown:
have been moved into the Documents (or other appropriate item's) tab:

Note: In this case, the individual item dropdown is still there as well.
Summary
Some folks say, "The more things change, the more they stay the same". There have been a lot of changes in SharePoint 2010. While there are some things that have stayed the same, they are actually in the minority. In this article, I have gone over some of the many changes to "carry over" functionality you will find when moving from SharePoint 2007 to SharePoint 2010. There are many more than I could hope to address in a single posting. I hope, however, that this article has given you some ideas of where to look if you can't find your favorite function where it used to be. 11/27/2009
The Fix is In, Thanks to Tom Resing
I have great news, thanks to fellow SharePointer Tom Resing. In my previous post I mentioned the problems the Community Kit for SharePoint:Enhanced Blog Edition has with the new link tracking parameters FeedBurner just started adding to their links.
In that post, I talked about the trials and tribulations of trying to get CKS:EBE working by installing an updated version. It turns out there was another approach to the problem. Although Google made the change to FeedBurner effective by default, Tom pointed out that they do offer an option to turn it off.
The Quick Fix
So, for those of you using both FeedBurner and CKS:EBE, here's the scoop. On the left menu in your FeedBurner Feed Stats Dashboard, in the Services section, is an option called "Configure Stats":
When you select Configure Stats, you have a section called "Reach", which has several options. You need to uncheck the box for "Track Clicks as a traffic source in Google Analytics":
That's all there is to it! Save the settings, and everything should be back to "normal".
Of course, it would have been nice if Google had posted a more conspicuous notice that they were making this change, and where it could be configured. It would have been even nicer if they had made the change "opt in" instead of "opt out".
Nevertheless, what's done is done. You should now be able to click through from my RSS feed directly to the articles you are interested in.
I apologize for any inconvenience. 11/25/2009
At Least They Didn't Burn the Turkey
Just a quick note before I run off for the Thanksgiving holiday (USA). If you have been a subscriber to my RSS feed, you may have noticed a problem clicking through to my blog posts lately. This is because of a change that FeedBurner made a few weeks ago. They added extra parameter information to the connection string of links back to the blog.
This is theoretically a good thing, as it allows site logging to better determine where visitors are coming from. However, this blog uses the Community Kit for SharePoint: Enhanced Blogging Edition (CKS:EBE). The way CKS:EBE handles URLs doesn't allow it to correctly interpret these additional parameters. This resulted in broken page displays. You can still eventually navigate back to the right page, but it isn't as convenient as it should be.
I have just tested a patched version of CKS:EBE to resolve that problem. While the patch for the FeedBurner problem seems to work correctly, there are significant issues with other changes to the patched build of CKS:EBE. I noticed that my tag cloud was no longer resizing the keyword links to their proportions, for example, and there were major authentication problems. These glitches are bad enough that I decided to retract the update.
I apologize for the inconvenience. Rest assured, I'll continue working on getting links from FeedBurner working (without breaking everything else).
In the mean time, Have a Happy Turkey Day! 11/12/2009
All of Your Eggs in One Basket?
Every time a new version of a virtualization tool comes out, people get all excited about the possibility of reducing the costs of running their data centers. Most of them are thinking in terms of hardware consolidation, but virtualized environments also allow for new ways of handling resilience and recovery as well.
This is all well and good, but then you run into what I call "the new hammer syndrome". The idea is, after you buy a new hammer, everything starts to look like a nail. You keep thinking of ways to apply this new tool. Some of them are great. Others, not so much.
Virtualization and SharePoint
SharePoint, in particular, frequently seems like a ripe target for virtualization. It has a multitude of roles, which can be (and often are) distributed among many servers. Data center managers see all of this hardware and envision collapsing it onto a single box. And, SharePoint is officially supported in virtualized environments. It seems like a match made in heaven, doesn't it?
But, not so fast! Take a step back and think about what I just said. You are taking all of these SharePoint roles, and spreading them out among multiple servers. Now you want to take all of these servers and virtualize them back onto a single piece of hardware? Where is the sense in that?
Why did you build out that many servers in the first place?
Pausing while people try to gather back the pieces of their exploded heads from that bit of circular logic...
Profound, isn't it? Almost like a Zen koan.
On Over-Engineering a Solution
SharePoint will very happily run all of its roles on a single server (physical or virtual), if you want it to. So, why would you want to split the roles at all? There are really only two reasons (good ones, anyway) - performance, and resilience. (No, I don't consider being able to point at a monitoring station covering a half-dozen or more servers and saying "Look at all of the systems I manage in my SharePoint farm" a good reason.)
From a performance standpoint, some SharePoint roles are real resource hogs. The two big ones would be SQL Server and Search Indexing/Crawling. SQL Server, though not technically part of SharePoint, is hit pretty much constantly by nearly every SharePoint component, and so is almost always set aside on separate hardware. The search crawl process, though intense, is "peaky." In other words, it goes through cycles of short bursts of intense activity, followed by periods of near idleness. In comparison, the web front-end functionality is a cake-walk. A single WFE server can handle potentially many thousands of users without breaking a sweat.
In fact, a big, modern server can probably handle hundreds, if not thousands, of users even with everything except SQL Server running on it. (Naturally, this depends upon just what those users are doing.) So performance is rarely the real reason for splitting off most of SharePoint's functions, except in very large environments.
That leaves resilience. Resilience is the ability of a system to keep on going, even if a piece of it fails. By splitting the SharePoint roles onto several servers, and having multiple instances of the roles that face your users, you can create a system which can tolerate a failure of any one component with minimal short-term impact. It is possible to take this too far, however. It isn't a case of "if two are good, three must be better, and five are better still."
What good is having three or more web front end servers, when they all sit practically idle at singe-digit percent utilization - even during peak periods? Not very good at all. At a minimum, it is not a very efficient use of resources. This is the kind of thing that makes virtualization look really attractive.
Balance
So, is virtualization really the answer? Maybe. Or maybe not. Let's get back to that biggest of little questions - "Why?"
Why did you build out your farm onto multiple servers?
Did you build out this big farm because your usage is so heavy, you were stressing out anything less? Then you are almost certainly not a good candidate for virtualization. In this case, you've got your hardware optimized to its load. Virtualization is just going to add another layer, and if you're already fully loading your systems, you won't get any benefit from host sharing with other virtual servers. The only reason you might justify going virtual is to be able to quickly replicate a failed system from an image, or shift a running image onto another host. But can you handle the extra overhead?
Did you build out your farm for resilience? The minimum "fully" resilient SharePoint farm is a configuration I call "2.1+". That's two servers running as WFE and Query servers (along with Excel Services in Enterprise Edition), one application server running the Index role (of which there can be only one per SSP) and optionally running other duplicated roles as well, "plus" a properly specified SQL cluster. This configuration can handle thousands of users, even with modest (by today's standards) hardware. In fact, from a performance standpoint it is probably still overkill for most organizations. Here, you might find some room to virtualize. But be careful - you split these roles out in the first place to avoid having a single point of failure. Virtualizing them and simply placing all of the VM's on a single host eliminates that benefit.
And What About SQL Server?
I decided to write about virtualization because I've been approached several times in the last week or so with folks asking about virtualizing the SQL Server side of SharePoint. Up until now, even when virtualization has been appropriate for some SharePoint components, I've always advised against making SQL virtual. But VMWare has just introduced a new version for which their marketing message is claiming that SQL virtualization is now a good thing.
Frankly, I'm not convinced. My main concern is that SharePoint is a very heavy user of SQL Server. Again it boils down to your utilization. Are your SQL Servers already CPU or disk I/O bound? If so, virtualization isn't going to help matters. If not, then you might be OK. Even if you decide to virtualize computation, I would still avoid virtualizing the data storage without first doing extensive load testing.
Going Forward
Ultimately, all computer configuration involves trade-offs. Cost, performance, and resilience are three corners of one of those "pick any two" engineering triangle conundrums. Virtualization doesn't eliminate the trade-off, but it can shift the balance toward the lower-cost corner. Whether or not it is appropriate in your case will depend upon your server load and tolerance for risk. In the case of SharePoint, you can achieve many of the same results as virtualization by simply re-consolidating the roles that were originally split off.
Mark Twain once said: "Keep all of your eggs in one basket - then watch that basket!" If you do decide to virtualize, make sure you take appropriate precautions. The Microsoft Consulting Services UK SharePoint Team has written an excellent series of articles on SharePoint virtualization. I suggest checking that out for more technical details. 11/11/2009
Enhancing a CodePlex Project
In this article, I'm going to get a bit more technical than is my normal wont. In fact, I'm going to go into Visual Studio, and show you some C# code as well.
(Waiting a few minutes for folks who know me to pick their jaws up off the floor, or even find some smelling salts... Yes, Virginia, I really can program when I have to. :) I just very rarely have to.)
That doesn't mean I'm going to be building this project from scratch. Far from it. So, if you're looking for info on how to build a .wsp solution package, this isn't the article for you. I am going to talk a bit about user choice, web part properties, a programming technique called "recursion", and the SharePoint API (in particular, accessing the User Profile store).
What I'm going to do is show you how to fulfill a very common business requirement by starting with a fairly simple CodePlex project, and tweaking it until it is something that does just what you need.
A Common Request
Virtually every client I've implemented SharePoint for has asked for an organizational chart. The problem is, there aren't very many org chart web parts out there for SharePoint, and those that are, tend to have issues (usually performance) - especially if you have a fairly large organization.
SharePoint Server 2010 finally makes a really cool organization chart part of the package. It is Silverlight based, and works pretty fast. Unfortunately, that's 2010, and it is going to be a while before many companies are ready to deploy it. We need something that will work for "today".
Finding the CodePlex Project
So what do you do? Well, a quick online search reveals that there is indeed an org chart part on CodePlex, called (quite originally) "OrgChartPart". This was written by Rodney Viana. Looking at the specs, it sounds promising:
- It reads profile information from SharePoint
- It uses a free JavaScript Org Chart rendering engine
- And of course, it is free, too!
What's not to like?
There is a bit, as it turns out, but let's start with the good. Installing the OrgChartPart is a breeze. Download the .wsp file from CodePlex, install it with the "stsadm -o addsolution" command, and deploy it to your web application(s). You will then need to add the part to your web part gallery (there is a feature that does this, or you can do it manually), then add it to a page. (I suggest you add it to a web part page that has nothing else on it, for reasons you will see in a moment.) This takes 5 minutes, tops.
The web part reads your MOSS profile store, and emits the chart. Just like that, you're done!
On the surface, that doesn't sound too bad. But dig a little deeper, and you find a big red flag - the author warns that you shouldn't use the part if you have more than 500 profiles in your organization. Of course, if you have more than 500, you've got a problem.
But even if you have fewer than 500 profiles, you might not like the results. Consider the following clip of the chart initially rendered by this part:
This is a pretty complicated organization - it doesn't fit on the screen, and it is completely expanded by default. But, there's another issue. The chart looks a little "top heavy". That's because the Active Directory includes a number of accounts that aren't actually users, and therefore don't have associations in the hierarchy. Looking closer, you can see that Patricia Doyle, the CEO, has conference rooms as peers! There's also some clipping of titles and departments.
Note: This is technically a problem with the Active Directory and/or its import. In theory, you could set up the AD/Profile import to exclude non-person entities. But, that's another story... :)
Looking Under the Hood
Still, even with those issues, you can see the potential in this part.
Note: Most of the remainder of this article discusses how the OrgChartPart was originally implemented, and how I updated it. If you just want the end results, you can download the original source from CodePlex, plus my replacement OrgChartPart.cs file and rebuild the solution. (I have also given the code updates to Rodney, who may update the actual CodePlex project.)
Fortunately, as with most CodePlex projects, we have access to the source code. I downloaded the source and opened the project in Visual Studio. What we see is, the part is actually quite simple. There is one .cs file (the two in the image below include my edited version, plus the original) and the ECOTree JavaScript library. ECOTree is what actually does the heavy lifting of drawing the chart. By default, OrtChartPart uses just a fraction of the power of this library (follow the link above for more details).
There is also a "departmentconfig.xml" file hiding in the Layouts folder of the 12 hive. Hmmm...
Looking at the code itself, we find there are four main functional areas beyond the basics needed to render a web part:
- Handling that department file
- Crawling the profile store
- Building a profile render block
- Building the chart
Now, We Tweak
In the rest of this article, I'm going to look at each of the sections I described above, tell you how the original code worked, and show you what I did to update them. While I won't embed the entire source in the article, you can easily download it if you want to examine everything in context.
On the Department File
For now, I'm just going to say that while the idea of mapping the department information in the profile to department home pages is admirable, the way it was implemented was causing some serious performance issues, and would be a long-term maintenance headache. Therefore, I commented out the two lines that actually make use of it (249 and 267 in my updated file), and replaced the link rendering with a simple text rendering. Here are the original and replaced lines from the updated code ( 267, 268).
//this.department = config.Find(EmptyIfNull(Profile[PropertyConstants.Department])); this.department = EmptyIfNull(Profile[PropertyConstants.Department]);
"config.Find" is part of a config object that is defined elsewhere in the code. For purposes of this article, though, we're just going to ignore it.
Crawling the Profile Store
The profile crawl itself takes place in a function called PopulateOrg(). Examining this routine, a few things stand out.
First, there are two different ways for nodes to be added to the chart. One uses information read from a user's profile, the other feeds static information into a node. (This is used primarily to display an error message, if needed.)
Second, the population routine reads the entire profile store in one fell swoop. Combined with the inefficiency of the department link mapping mentioned above, this is a big part of the performance limiting the part to organizations with 500 or fewer profiles.
Finally, hidden in this routine (but commented out) is a nice little set of sample data.
At its core, an organization is a hierarchy. A hierarchy is made of parents and children. Technically, as long as you know the parent of each node, you can manually construct the organization. This is the approach originally taken by this web part.
foreach (UserProfile pf in pmManager) { Details dt = new Details(); dt.AddProfile(pf, this.Page.Request);
if (dt.TrimFullName != String.Empty) employeeList.Add(dt);
}
However, a UserProfile object itself has methods for listing its children and ancestors directly. This means that we can easily start at any point in the tree, and generate the organization descendent from it, as well as the chain of command above it.
The ancestors are represented in a single collection, called through the GetManagers() method. The first level of children are just as easily retrieved with the GetDirectReports() method. However, if we want more than one level of child, we would then need to call the GetDirectReports() method for each child returned in the previous call.
If you try doing this with loops, things can get complicated pretty quickly. However, there is a simple way to to handle an arbitrary number of child nodes, to an arbitrary depth. This is a technique called "recursion". Essentially, you create a function that calls itself. In order to keep it from running forever, one of the parameters that should be passed to a recursive function should be a "depth" limiter. Within the function, the child calls decrement this limiter, and stop calling when it reaches a threshold level. In my update, I create the recursive function addChildren(). This takes the starting profile, and the depth limiter as parameters.
protected void addChildren(UserProfile Parent, int levels) { try { foreach (UserProfile pf in Parent.GetDirectReports()) { Details dt = new Details(); dt.AddProfile(pf, this.Page.Request, false);
if (dt.TrimFullName != String.Empty) { employeeList.Add(dt); if (levels > 0) addChildren(pf, levels - 1); } } } catch (Exception ex) { AddInList("1", "", "Error", "", ex.Message); } }
Notice also that I have added a parameter to the AddProfile method of the details (dt) object. This third parameter allows me to force the profile being added to act as a root, or top-level, node. (This is used for the management chain of command.)
Giving Your Users Choices
Looking at the stuff I've described in the preceding section, there is something very different from the original implementation - instead of crawling the whole profile store, I crawl a specified subsection. That requires two pieces of input - the node I plan to start with, and how deep I want to crawl.
Fortunately, when you create SharePoint Web parts, you can easily allow the user to enter configuration information. In this case, I am actually going to give the user three options. The third will allow the user to show the sample data instead of the active directory. (Naturally, I uncommented the sample population section, and wrapped the two population methods in an if...else block.)
To add a property to a web part, you add some descriptive information to say how the property is to be displayed. You also set up a public property variable to appear in the configuration pane, and a private variable to use in your code. The private variable can include a default value. The public property includes a get and a set block. While these three properties simply take the value as given, you will see later that this isn't the only option.
[Personalizable(PersonalizationScope.Shared)] [WebBrowsable(true)] [System.ComponentModel.Category("Org Chart Settings")] [WebDisplayName("StartProfile")] [WebDescription("Enter the top user to display:")] public string StartProfile { get { return startProfile; } set { startProfile = value; } } private string startProfile;
[Personalizable(PersonalizationScope.Shared)] [WebBrowsable(true)] [System.ComponentModel.Category("Org Chart Settings")] [WebDisplayName("ChartDepth")] [WebDescription("Subordinate levels to display:")] public int ChartDepth { get { return chartDepth; } set { chartDepth = value; } } private int chartDepth = 1;
[Personalizable(PersonalizationScope.Shared)] [WebBrowsable(true)] [System.ComponentModel.Category("Org Chart Settings")] [WebDisplayName("Show Sample Data")] [WebDescription("Show sample data instead of profile info:")] public bool ShowSample { get { return showSample; } set { showSample = value; } } private bool showSample = true;
This is how the properties look in the Web part configuration pane. The "CacheTime" parameter was included in the original part (though it is unused in the code). I'll discuss the "Left To Right" parameter later.

You might also notice that I set the default value of showSample to true. This allows the user to place the web part on the page and see a reasonable representation of its function, without needing to first set the start point and depth.
Note: The chart initially renders with only the first layer of children open. I expanded it for this screen shot.
Rendering a Profile
Each node on the chart is constructed of HTML. The HTML is assembled in the ReturnItem() function.
I wanted to enable two functions not already present - showing the user's profile picture, and allowing the user to "re-home" the chart on another node in order to enable navigation of the entire organization in convenient sections. This meant I needed to add two properties to the details object, and then add the code to display these properties appropriately in the chart.
In order to make the re-home function work, I added an override to the StartProfile. Essentially, if there is a rootuser query string parameter, the profile specified there will be used instead of the one set in the web part property. The SetRoot link calls the current page with rootuser set to the selected profile.
In addition to the actual HTML, however, the look of the node contents are controlled by styles defined in the ECOTree.css file. In order to allow the picture to render, as well as permitting the text to fit, I needed to modify the .econode class in this file as follows.
.econode { text-overflow: clip; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: xx-small; color: White; padding: 2px; }
Rendering the Chart
Just as we built up a node by assembling the HTML, the chart itself is built by assembling JavaScript. One of the things I did was to examine the functions provided by the ECOTree library. I found that it offered a lot of flexibility that wasn't currently in use. I felt the most important was the ability to set the orientation. Here's where that "Left to Right" checkbox comes into play. The library uses a parameter .RO_TOP or RO_LEFT to decide whether the chart is top to bottom, or left to right.
This is the code that reads and sets that web part parameter:
[Personalizable(PersonalizationScope.Shared)] [WebBrowsable(true)] [System.ComponentModel.Category("Org Chart Settings")] [WebDisplayName("Left To Right")] [WebDescription("Root at left, otherwise at top:")] public bool RootLeft { get { if (chartOrient == "LEFT") { return true; } else { return false; } } set { if (value) { chartOrient = "LEFT"; } else { chartOrient = "TOP"; } } } private string chartOrient = "TOP";
This demonstrates the kind of things you can do with the get and set blocks of a parameter. The user gets to the see the checkbox that represents a binary choice, but the internal variable is a string, meaning that we can render the part simply appending the string value without inserting an "if" block.
myTree.config.iRootOrientation = ECOTree.RO_"); sb.Append(chartOrient); sb.Append(@";
The Results
The image below shows you how the revised chart looks with the same profile store shown in the first image.

This is a much more manageable presentation. It allows the user to drill into the organization as needed, and since we set the starting node on our CEO, those conference rooms who don't report to anybody are nowhere to be found.
I hope this article has shown you how easy it is to stand upon the shoulders of giants when looking for features to add to SharePoint. I built upon the CodePlex OrgChartPart, which itself leveraged the ECOTree charting library.
There are many more things you could do with this web part. You could add options to select the color of the nodes, for example. Or give users a check-box to render the entire organization at once, as the original part did.
The options are limited only by your imagination! 11/6/2009
Buried in Bureaucracy and Rebuffed
Note: This is a follow-up piece to my "In a Fix with Ford" article. See that if you need some additional background.
Where does one begin a tale of woe? For that, my friends, is what we have here. Six weeks ago, I wrote my original article with high hopes that I could prevail upon Ford to do the right thing, and fix the known design problems with my early production 2006 Ford Fusion. Little did I know that I had about as much chance of success as Don Quixote in tilting at windmills.
An Apology to the Messenger
First, I want to express my appreciation to Marq Boggs, Service Manager at Don Hinds Ford, in Fishers, IN. He had the great misfortune of being bearer of the bad news that Ford had no intention of fixing my car's problems. In my initial article, it may have seemed that I was "killing the messenger" by placing a big part of the blame on his dealership. That was not my intent, and if it was taken that way, I humbly apologize.
In fact, Marq has been of great assistance: first, in confirming that my car does indeed suffer from every one of the issues described in my first article; second, in taking it upon himself to address one of the problems by flashing my car's computer with up-to-date firmware; and finally, in chasing through some of the bureaucracy at Ford in an effort to find someone willing to address my problems.
Unfortunately, he was not successful.
Pointing Fingers, Hot Potatoes, and Monkeys in the Middle
The implication here is, that Ford has refused to repair my car. Interestingly, Ford customer service's own reply to me (I'll call it the "kiss-off" letter - others might choose a more colorful term) seems to imply that the dealership was the one with the final say in the matter:
Dear Woodrow Windischman, We have looked into this matter and our records indicate that a decision has been made by your servicing dealership. In addition, they suggested that you take your vehicle to the selling dealership and see if they would provide additional assistance. Please be advised that the CRC can not overturn this decision. However, to ensure our records are complete we have documented your feedback. We would like you to know that we understand your concern and that we appreciate the time that you have taken to write us about this issue.
(Emphasis added)
I talked to Marq again to see what was going on. It seems that each dealer is allocated a certain amount of "customer loyalty" money by Ford. This is supposed to be used to provide exceptional services to the dealer's customers. The official bottom-line position of Ford was that they weren't going to pay to fix my car, but if the dealer wanted to, they could provide the repairs out of these loyalty funds. Here's the rub - I didn't buy my car from Don Hinds, and I'm not really local (for now, I'm just in Indy on a contract), meaning future purchase prospects are limited as well. So, there really isn't a good reason for them to use a big chunk of these (rather scarce) resources on my car. I can understand this, and there are no ill-feelings from me on this account.
What about my "selling dealership" (Rice Ford, in Warsaw, IN - where I actually bought my car)? Well, I spoke to Bud Shanks, the service manager, and there was good news and bad news. The good news is, he and Mr. Rice agree that Ford should be responsible for fixing my car. The bad news is, they agree that Ford should be responsible for fixing my car. Therefore they don't feel it is appropriate to tap their loyalty funds for my repairs either. There is another complication - as I mentioned, I'm on a contract that has me over 100 miles away from the dealership during normal shop hours. In order for me to take my car there for service, I would need to take at least a day away from work, thus negating a big part of any benefit from having the repair covered.
How to Make a Billion Dollars
A company is more than its most recent marketing campaigns. I was proud of the fact that Ford didn't accept bail-out money from the government last year. I remember their "Quality is Job 1" campaign. I remember when they used to offer lifetime warranties on repair service. Notwithstanding the (truly minor) problems at issue here, I've been very happy with the service my Fusion has given me.
It is ironic that just a few days after I got their final kiss-off, Ford announced that they had made about $1,000,000,000 (that's one billion dollars) in profit during the quarter of my discontent. This during one of the worst economic downturns in recent memory. (No, how ever much the media likes to portray it that way, it isn't even close to the "real" depression of the 30's, or even the "stagflation" times of the late 70's. Doesn't anyone remember the double-digit mortgage interest rates?)
According to my experiences, and based on conversations with the dealers, a big part of this profit has been made by cutting back on the service and support provided to its customers and dealer base. Yet this "reputation" for quality and service is one of the reasons Ford was able to make sales while others were foundering.
The Big Picture
Everyone involved here agrees that it should be Ford's responsibility to fix my car. Everyone, that is, except Ford themselves.
Of course, whether paid for by Ford or not, I need to get my car fixed. This whole adventure started when I had to pay an ESP extended warranty deductible for a repair on my shifter, who's design was changed due to the very problem I suffered from. That case was made even more frustrating by the fact that the deductible was almost the entire cost of the repair. That ESP is still in place, and some of the issues I'm having are covered under that plan. Of course, I'll have to pay another deductible. In the end, given the cost of the ESP to begin with, I'll end up having paid the entire cost of the repairs, and then some.
If you've followed my blog for the last few months, you know that my life has been filled with highs and lows lately. In the grand scheme of things, is getting a few non-life threatening car repairs paid for all that important? Not really.
But that still doesn't make the way Ford has been treating its dealers and customers "right".
|
|
|
|
|
|
|
|
 |
 |
 |
 |
|