SharePoint: An update on IRuntimeFilter

A few weeks ago I posted on the IRuntimeFilter interface in SharePoint. Here are a few updates…

1) I’ve validated that IRuntimeFilter’s CheckRuntimeRender() method is only called when the IsIncludedFilter property of a web part is non-null.

2) By default, Windows SharePoint Services will put administrators and web designers into a shared page view rather than in a my page view.  The net effect is that the shared page isn’t a personalized view and therefore IRuntimeFilter’s CheckRuntimeRender() method isn’t called.  To fix this create a new site definition and add the following tag into the <HEAD> tag.  <META name=”WebPartPageDefaultViewPersonal”>  Then make sure you do an IISReset so it can take effect.  (You’ll have to create a new site to see this.)

3) ValidateRuntimeFilter() is called everytime the web part is serialized — which is often.  So keep the code that you write in this method very simple.

4) If you decide to do post backs in the chooser form that you create, you’ll need to add a tag to the <HEAD> tag.  That tag is <base target=”_self”>  If you don’t do this then the form will cause a new window to open.

My next step is to fix some impersonation issues with roles (the ones that Michael Donovan mentioned to in his post.  From there, I’ll be writing a IRuntimeFilter chain to allow the Portal audiences IRuntimeFilter to run side-by-site with our own IRuntimeFilter.


How to Gather Windows SharePoint Services Requirements

Getting good requirements for a SharePoint project is in some ways more critical than for a project that’s based on more widely understood technologies. The fact that SharePoint isn’t widely understood by clients — whether internal or external — means the potential for misunderstandings is much greater. For this reason, it’s more critical to discuss each feature of SharePoint to understand of how the feature works out-of-the-box and to understand how the organization envisions those features. Whether you choose to design and architect your SharePoint technologies solution yourself or decide to work with an outside partner to perform the architecture and design steps, you’ll find that having a foundation in solid requirements makes the development process run smoother and results in a better solution for your business needs. [Article removed from the website]


Harnessing Properties in SharePoint Search

Most users of SharePoint Portal Server rapidly become enamored with the ability to add new fields (containing meta data) to documents in the document library. All of the sudden it becomes possible to associate information to a file beyond the file name that we’ve been limited to since the beginning of the computing era.

Few users, however, have the opportunity to understand how this meta data is used by SharePoint for searching. This leads to problems when users decide that it’s necessary to use SharePoint Portal Server Search to search on information contained in a field that they have added. In this article you’ll learn how SharePoint uses document library fields to create properties that are searchable and how to enable searching on those properties.

Article reposted here: Retro: Harness Properties in SharePoint Search


Debugging in the GAC

There are sometimes when your assembly almost has to be in the GAC and when you need to debug it.  This was difficult since if you registered a .NET assembly into the GAC the debugger wouldn’t break on it.  This is because the .PDB file information didn’t get loaded since it’s not in the same directory as the DLL.  Here’s how to work around that.

1) Install the Assembly in the GAC
2) Start-Run, %SYSTEMROOT%\Assembly\GAC
3) Navigate into the folder with name of the DLL that you want to debug
4) Navigate into the folder with the version number and public key that you want
5) Copy the .PDB file into this directory

Now you’ll be able to run a debugger against code running in the GAC.


Creating Artifacts — what you don’t know

[Authors Note: There’s a very interesting discussion brewing about what artifacts are good and what artifacts are bad. Check it out.]

Just as artifacts from ancient times give us information about early man, the documents and presentations you create in IT can give insight into your technology initiatives.

We know relatively little about the humans that were roaming the earth thousands of years ago. But because we have the artifacts they left behind–pots, arrowheads, and so forth–we have a glimpse give us a glimpse into their daily lives and who they were.

Artifacts (documents, Powerpoint presentations, spreadsheets, etc.) also allow a glimpse into the processes that are happening in your IT organization. Learning how to encourage the creation of artifacts is an essential part of managing an IT department.

The power of the artifact

An artifact is anything crafted by human hand that is left behind. This can be a product, a training manual, help documentation, project management documentation, or anything else which is tangible. Most of the time artifacts are documentation or diagrams of some sort but they can also be the finished product or some piece of the finished product.


Developing a data communications strategy

Any data communications proposal can look good on paper until you dissect it by evaluating its reliability, expandability, and complexity.

Whether your organization has two sites or two hundred sites, figuring out how to manage the data communications between those sites can be a real challenge. With a vast array of options, it’s often hard to determine what’s best for your organization. Here are three key evaluation criteria you can use to make the right decisions for your connectivity.


In most cases the reliability of the network is a critical component to how useful it is. Even in organizations where the ability to communicate between sites isn’t core to the business because there are no central databases to be accessed and no real-time need to share information, loss of connectivity is still very disruptive.

Reliability is measured by the frequency, the duration, and the completeness of outages.


Requirement: Collaboration

The next time I see a requirements document which says they want “collaboration” my response is going to be to ask…

“Why do you want to cooperate treasonably with a foreign power?”

Maybe that will jar people into asking what they mean by collaboration.  (Asking what they mean by collaboration doesn’t seem to work in most cases.)


Anatomy of a Software Development Role: Development Manager

It is possible to believe that there is nothing left to be done. That all of the roles outlined thus far is all that is needed to make the process work. However, the role of the development manager is critical to the long-term success of the software development team. The role that the development manager plays – particularly when interacting with the project manager – is essential to a continuously improving process. (If you’ve not been following the series, you might want to read Cracking the Code: Breaking Down the Software Development Roles.)

What’s the Development Manager role?

The development manager’s role can be described as “everything else”. Although accurate this description is not very illuminating.

The development management role is the role whose purpose it is to keep the vision on track. This is much like a CEO, who sets the vision for an organization. This of course differs from the COO, who-like a project manager-ensures the day-to-day operations. While it’s the project manager’s goal to get the project to the finish line, it is the Development Manager ‘s responsibility to look ahead to make sure that the finish line is the right finish line to be reaching. While the project management position is a management position, the development manager role is a leadership position. Click here to see how the the Deployment role fits within the full organizational chart.

Read more of the article at

[Author’s Note: I really enjoyed the mental exercise that writing this series brought.  It was a good way for me to clarify my thinking around the various roles in the software development process.  I hope that it can provide a framework for understanding how people fit into the process in your organization. The next series is on Coding standards and starts in just a few weeks.  I’m always happy to get input on what you think should or shouldn’t be in coding standards.]


SharePoint: Cannot complete this action. Please try again.

Another one of those lovely SharePoint error messages … This one leaves me wondering what I do when it doesn’t work the second time I try it.  (Or the hundredth since I’m getting it back from code running against the API.)

… I’ve got to get my library of least favorite SharePoint error messages up.

If anyone’s interested this one came up when trying to get SPWeb from SPSite.OpenWeb with a GUID … that is valid.



The SharePoint IRunTimeFilter is a good idea but the implementation…

Mike Donovan’s post got me interested in how IRuntimeFilter could be used to replicate SharePoint Portal Server audience/targeting feature in Windows SharePoint Services.  There are several situations I’ve run into where the SPS targeting is a compelling feature for Portal Server but the limitation of 10,000 areas was a problem.  (By way of reference, I also found Serge van den Oever’s reverse engineering of the interface which was very good.)
In thinking about the interface it also seemed promising as a potential way to secure web parts.  In other words, with an IRuntimeFilter running you could potentially turn off web parts for certain groups of users.  This might be effective at preventing them from seeing our using web parts from the gallery that some users needed but weren’t suitable for everyone.
However, the actual implementation of the interface appears to have a few challenges.  (I have a case open with MS PSS right now to verify some of these observations.  I’ll update this blog entry or more likely add a new one when I get more information.)
  1. The filter is only called when the IsIncludedFilter property in the web part has a non-empty (non-null value.)  In other words, you don’t get the opportunity to inspect every web part as it’s loaded, you only get to inspect those web parts with the property set.  This makes it useful for user configuration but not very useful as a “traffic cop.”
  2. The interface doesn’t specify any information about the web part itself.  It only returns to you a filter string that you presumably created with the user interface.  The challenge with this is that there is no way (I’ve found) to determine just which web part is trying to be displayed.  Again, maybe this isn’t an issue for users configuring things for themselves, but it seems awfully limiting.  One reason is because when a web part is exported and re-imported, the IsIncludedFilter property stays with it.  That means that if you have site-specific data in the IsIncludedFilter property it becomes invalidated when it moves to the next site.  This is a real problem when trying to move web parts between sites or punch out a template site.  (The Microsoft provided ListViewWebPart andListFormWebPart both exhibit problems when you try to move them from one site to another due to this same fundamental issue of using site/area specific property values.  This is why you are not allowed to export and import ListViewWebParts via the user interface.)
  3. The ValidateIsIncludedFilter() method, which is called when the property is saved is called all the time.  There’s no event which fires when the user adds the web part or changes the configuration.  This event fires every time the web part is saved.  This appears to be happening on every page load – which is a bad thing in and of itself that I don’t really understand.  Why would we be saving a web part back to the database every time it’s rendered?  It seems to me that this would be a huge performance problem.
  4. The IRuntimeFilter is only called in “personalization mode” The precise meaning of this eludes me – I can’t find the definition in the documentation.  However, based on observation it appears that it is only called in the personal view of the site.  (This would be the view that few people actually see first, only those who have the permission to personalize the site and have done so default to a personal view of the site – almost everyone gets a shared view.)  The net effect of this is that it’s going to require some more work to force people into a personal view by default when they view a WSS page.
  5. The IRuntimeFilter interface is only called for “global” web parts on a page.  That means if the user adds a web part to their page while in personal mode the IRuntimeFilter will never control whether it is displayed or not.As a sidebar, it appears that SPS enters personalization mode or the “my page” view by default since their IRuntimeFilter is turned on.  I tried playing with this and observed that when I put a SharePoint Area into edit mode and then switched to personal view all of my menus disappeared.  All I could do was return to Shared mode which would allow me to edit what web parts were on the page, etc.  Based on these observations it looks like SPS is actually putting the area into a personal view every time the page is loaded but they also don’t allow you to personalize the page.

So, I can probably replicate the SPS audiences using IRuntimeFilter if I can figure out how to force the WSS sites to default in personal view even for those without any personalization to the site.

However, without some way of inserting the web part storage key or some other value into the IsIncludedFilter property of a web part while it’s being imported, I’m not sure how to make this interface any more useful than the SPS application of it.  I’ve not found a way to inject properties to every web part as it’s added yet…

Is anyone else playing with this interface?