List template not working when used in at different farm - Lookup Columns will caus trouble

Be aware that you re-create Lookup columns when creating a new list based on a list template created on a different server/farm. They will not work because the source list used in the look up column does not exist in the destination farm. It is obvious after you have done the mistake and found the cause of "the disaster". Quick and dirty may sometimes become very dirty ... :-(

" A parser error has occurred" (1319) error when hitting a page in SharePoint 2007

I've had the error "A parser error has occurred" (with event ID 1319) a couple of times when working with SharePoint 2007 - especially when moving content between different farms (e.g. backup and restore). In my cases it has been missing solutions (dlls and libraries) in the destination farm that has been the cause. Last time Ajax runtime and what missing in the destination farm, and the parsing could not be done.

It is therefore very immportant that farms involved in a backup and restore scenario is 100 % in sync bfore restoring a site collection from one farm into another.


SharePoint 2007 Data View Web Part

So it was time to use the Data View Web Part to display content from av custom web service in a nice way.

Examples and how to use the Data View Web part:

And writing custom sharepoint 2007 web services:

Errors and solutions

And of course I (as so many other it seems) run into the error: "The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again. If the problem persists, contact the server administrator". I did not find a "proven" solution to the cause of the error, but in my case it looked like it was the number of parameters and the length of these that got me into trouble. Can it be that the soap-header somehow got corrupted?? I re-wrote my custom web service, reduced the number of parameters to it, and I got it working.

Tired of writing the same SharePoint 2007 c# code over and over again - create snippets

then start creating snippets of your best and proven code. Need a tool to administer and write snippets more efficient? Check out http://www.codeplex.com/SnippetDesigner


SharePoint 2007 - What version are you really running?

From Penny Coventry's blogg I got hold of the following information regarding how to identify which version av SharePoint / WSS (services packs, hot fixes, etc).

To find the version number you open SharePoint Central Administration Site Actions.

- MOSS 2007 or WSS 3.0 Service Pack 2:
- MOSS 2007 or WSS 3.0 Cumulative update :
- MOSS 2007 or WSS 3.0 Infrastructure Update :
- MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB948945):
- MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB941274):
- MOSS 2007 or WSS 3.0 post-SP1 hotfix (KB941422):
- MOSS 2007 or WSS 3.0 SP1:
- MOSS 2007 or WSS 3.0 October public update:
- MOSS 2007 or WSS 3.0 August 24, 2007 hotfix:
- MOSS 2007 or WSS 3.0 RTM:
- MOSS 2007 or WSS 3.0 Beta 2 TR:
- MOSS 2007 or WSS 3.0 Beta 2:


SharePoint Mock Library for SharePoint released

A new developer tool has been released:

Typemock are offering their new product for unit testing SharePoint called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to unit test SharePoint without a SharePoint server. To learn more click here.

The first 50 bloggers who blog this text in their blog and tell us about it, will get a Full Isolator license, Free. for rules and info click here.

I will be one of my tools-of-trade soon!


"Please wait while scripts are loaded", SharePoint 2007 Master Page design

If you get the error "Please wait while scripts are loaded..." on your status when a sharepoint page is loaded you most likely have an error in your masterpage desigen; missing html-elements with certain IDs that sharepoint depends on. Examples are: onetIdTopNavBarContainer, onetidPageTitleAreaFrame, etc.

Links that helped me to trouble shoot this one:

In our solution some of the forms did not work properly, and the user had to refresh the page to get them working.


Open a document from a list and control in which document library Office/Word/Excel should default to on Save/Save As, SharePoint 2007

Often our SharePoint customers have a set of document templates that is larger than it is possible/practical to define as Content Types with document templates (and then available on the New document meny/button on a document library).

I found the createNewDocumentWithProgID javascript function (SharePoint's own) when browsing the html source of a page displaying a document list including the list toobar and the New document command.

How to use it? The following pseudocode will help you to get some ideas on how to create a solution which will set the default save to location for the Office program to the 'http://myserver/asite/Documents' library in the site where the command/action is executed:

  1. Collect and categorize all your document templates (Word, Excel, Visio, Powerpoint) in a document library
  2. Create a Custom Admin Page, e.g. createdocumentfromtemplate.aspx, and place it in the /_layouts/
  3. Display all your document templates (from the library created in 1)) in a page named createdocumentfromtemplate.aspx using some custom code, controls, or something, but make sure that the URL's href parameter contains the following (the correct paths you have to create on the fly) : javascript:createNewDocumentWithProgID('http://myserver/documenttemplates/thetemplate.docx', 'http://myserver/asite/Documents' , 'SharePoint.OpenDocuments', false);
  4. Create a button, menu or an Action that calls /_layouts/createdocumentfromtemplate.aspx

Of course a lot of details are missing, but in it should give you some ideas.

In one case I used the Content by Query web part to list a set of document (templates) from a document library, and by using the following line in my Item Style.xsl I set the default save catalog for Office application to me [current site]/documents:

<a href="javascript:createNewDocumentWithProgID('{$SafeLinkUrl}', document.URL.split('/').slice(0, document.URL.split('/').length-2).join('') + '/documents', 'SharePoint.OpenDocuments', false);" target="{$LinkTarget}"
title="{@LinkToolTip}"> <xsl:value-of select="$DisplayTitle"/> </a>

Happy coding!


SharePoint 2007 - setting up Kerberos correctly one and for all

No this s not "breeze" :-) But thanx to the following article I think I'll make it work - finally.

Kerberos and Excel Services

SharePoint 2007 - Item level security performance issues

I just got the following log entry:

List item query elapsed time: 39030 milliseconds, Additional data (if available): Query HRESULT: 80131530 List internal name, flags, and URL:
{6FB8EDE9-689F-45C1-B016-A4975B652F54}, flags=0x0000000024c01080, URL="xxxxx"...

And the SQL Server CPU was up to almost 100 % all the time.

The list has less than 600 elements, but each item has unique security settings. There are som severe performance issues here.

I turns out that our problem was not directly related to the list in question and item level security after all - it was a symptom on anothere severe problem; a custom SQL query against another database. BUT in the process of discovering the true cause of our performeance issue Microsoft Support could confirm that item level security WILL - sooner or later - cause troubles.

Eli Robbelard has written an article "SharePoint Security: Hard limits and recommended practices" that discusses the topic, and how to make workarounds.


SharePoint 2007 - correct disposal of SPSite og SPWeb objects - SPRequest objecst allocation

There has been writtem several articles on how to correct create and dispose SPWeb and SPSite objects, but what to do if you still get errors like:

"An SPRequest object was not disposed before the end of this thread. To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it. This object will now be disposed. ... To determine where this object was allocated, create a registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings. Then create a new DWORD named SPRequestStackTrace with the value 1 under this key"

Do what the error tell you: "Create the registry key and add the DWORD". Then you will get at stack trace which help you determine which part of your (or som others) code that are not coded correctly, but it will not neccesarily get you the answer - just a clue on where to start checking.



SharePoint 2007 Federated Search - Search Dashboards

I've just installed and played around with the Infrastructure Update for WSS 3.0 og SharePoint 2007. Finally SharePoint has federated search capabilities and an improved Search admin dashboard - both where "user friendly" when it comes to setup and configuration. Federated search connectors are available for several search engines, and/or you can write your own for searching your internal business application sources.

The obvious next thing for me now is to create "the ultimate?" search dashboard combining: faceted search, ontollica wildcard search, federated search and custom search (against our business systems). I think it will be quit good ... at least I hope so :-)


SharePoint 2007 Facted Search 2.5 combined with Ontollica Wildcard Search possible?

Combining Ontollica Wildcard Search (free component) with Microsoft Faceted Search 2.5 would have made decent couple, and in some scenarioes they seem to be. In a simple a simple test that I run today (with the out-of-the box) configuration of both components some of the facets worked well, but the following gave me trouble:
  • Filtering on Content Source: "Searching the property ContentSource is not supported in the Wildcard edition of Ontolica". Free components seldom give you everything you need ... they are usually "teasing" you - give me money ... and you will get it all :-)
  • Filtering on Language (theword DETECTEDLANGUAGE:"9"): No result with Ontollica, a lot of results in Search Center.
  • ...
I'm not given up on them yet, but will see if it is possible to live with the limitations...


Silverlight picture slide Show in Sharepoint 2007 (and EPiServer CMS)

For a customer I needed to find a slide show component in order to show groups of pictures in a nice graphical way. Tried out some web parts using javascript/Ajax, but couldn't really get them to look "right". Then I found a great Silverlight component. It is a Silverlight 1 component, but it works.

PS! It should be equally simple to make the component available in EPiServer CMS


SharePoint 2007, EPiServer and Silverlight 2

Yes, I've started to experiment with combining the technologies in different ways to create rich interface applications that bring together the best from each product - I hope :-). The Silverlight 2 application(s) wil communicate with both SharePoint and EPiServer CMS through web services. Using web services and WCF services is straightforward, but remember:

1) Common
- Make sure you are using a valid clientaccessolicy.xml file. Download correct file from How to Use Cross Domain Policy Files With Silverlight
- You may have to change your buffer sizes in your service bindings. This is done in the file ServiceReferences.ClientConfig in your Silverlight application project if you are binding to a simple web service.

2) EPiServer CMS
- The account that you are accessing the EPiServer web service with must be added to "Allow the user to act as a web service user". This is set under: Admin Config tab Security Permissions for Functions

3) SharePoint 2007 / WSS3.0
- Make sure that you copy the clientaccesspolicy.xml fil to the root of your sharepoint site using SharePoint Designer - it must be stored in the content database. Putting the file together with the web.config file under ../virtualdirectories/80/ will NOT work.


New functionality in EpiServer CMS 5 R2

EPiServer has made available a CTP of CMS 5 R2. It contains components that have been missed by many EPiServer users and developers:
  • Convert pages from one page type to another.
  • Reuse dynamic content in many places (without X3 :-) or the web parts framework)
  • Page providers - hosting episerver content in other systems, but seen in EpiServer as regular pages (e.g. storing content in SharePoint 2007 / WSS 3.0)

More to come ...


Conditionally hidding/showing html/controls; SPSecurityTrimmedControl, Custom Wrappers, EditModePanel, SuppressWebPartChrome (SharePoint 2007)

In a recent case I've investigated a bit on different ways of hiding or showing GUI elements (html, controls, etc) bases on different conditions. There are several ways, and here are an overview of some of these:
  • SPSecurityTrimmedControl. Trimming the UI base on the current user's permissions. Possible values for the different parameters; read a blog entry from Zac Smith, or this one.
    - Showing different content for authenticated and anonymous users: read her.
    - Hiding the sita actions menu: read her.
  • Enhanced SPSecurityTrimmedControl. Open all the possibilities you can think of... (winsmarts.com)
  • Creating your own custom wrappers. Do it all yourself! (Waldek Mastykarz)
  • EditModePanel. Display different controls and elements if the page is in Edit or Display mode (WCM). Can be used to hide navigation, adding inline CSS to override classes to use different formating... (Chris O'Brien)

Related to html filtering and cleansing:

  • SuppressWebPartChrome to remove all extra html-code and display ONLY the content. Web part property. Check out Waldek Mastykartz article.
  • Remove or clean non-compliant html - override the Render method; read here.

Hiding elements when printing:

  • Using javascript to hide parts of the dom-tree in Javascript and a printer friendly button is mots often used.
  • CSS 2 styling and different style sheets for different medias are another. Read here.


How to avoid 'Read-Only Mode' when opening documents in SharePoint 2007 (Word 2003, Word 2007, etc)

This has to be done on the client side. SharePoint has not the control of the client.

Read Mart Muller's blogg entry on the issue, or the KB article, and how to fix the issue.


Liverpool made it to the semifinale in Champions League!

beating Arsenal 4-2 in a great game. Yesss!!!

Sign in as different user command in SharePoint 2007 may get you into trouble

Please be aware of the following issues when implementing a SharePoint 2007 portal and having the "Sign in as a different user" available (that is the standard).

In the examples below user A is physically logged in on the computer while B is not.:
  1. Accessing My Site. If you have a setup where you have all the My Sites on a separat web application (e.g. on a different port) and your main portal standard port 80 the "Sign in as addiferent user will" NOT work accross those two web applications. Sign in as user B (from the SharePoint Sign in ... command) and then click on My Site. Who's My Site did you get to? A or B? I guess you where hoping for B, but that is wrong.
  2. Editing documents will give you the same issues. Sign in as user B, find a document library where user B should not have Contribute rights to. Open a document, change it, and then do a Save As back to the same library. No errors! What!??!

Anybody else having issues with the "Sign in as different user" command?


Adobe iFilter for SharePoint 2007 on a Windows 2003 x64 server

The regular iFilter package may be used even on a x64 computer, but it may also fail. I've seen it both. Adobe has relased a fix for x64 to make the 32-bit iFilter work even on x64 machines.

Click here for an article that will guide you right home and make your PDF documents searchable/crawlable. But make sure that you also have ALL the system requirements in place before installing it.


Exchange Public Folders vs SharePoint

I've been in som discussions with the infrastructure guys on what to do with the Public Folders and if they should all be moved to SharePoint or not. I think ther has been som confusion here, and Microsoft has released some guidelins on what to do: Public Folders are NOT DEAD!

They will be around for a long time, and sometimes they should be used. NOT everything belongs in SharePoint. SharePoint will NOT be the silver bullet to all our troubles... but some :-)

Read the blog/article: Public Folder vs Sharepoint Guidance

Branding the Web Part Editor box and the Web Part Header in SharePoint 2007

Then it was time to do some branding again - which is an very important task in any SharePoint project. It doesn't matter how great all the features in SharePoint 2007 are if the look-and-feel of the site doesn't make the users "happy" :-)

I found three very exciting article written by Kyle Schaeffer on his blog:
1) Floating (Movable) Web Part Task Pane
2) Web part headers with rounded corners
3) Different look and feel for the web parts when they are in different web par zones

All three articles are "must read"

Customizing the application.master file in SharePoint 2007 may result in some errors

Be carefull when customizing or branding the application.master file. You may get som strange errors, for example:

"Application error when access /_layouts/mngfield.aspx, Error=Unable to validate data. at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier ..."

I got this one when I tried to make changes to a field on a list (mngfield.aspx).

The reason in my case whas that the master page included a statement. When I removed this one I was up and running again.

Others have discovered the same error: Read here

Setting up an import filter in a Custom User Profile import soruce in SharePoint 2007

When you want to configure your user import you will most likely want to filter out certain type of account; those that are disabled, system accounts, etc.

The following two filter will let you do this:

1) Import all user accounts except those that are disabled


2) Import all users except thos belonging to a certain group:

Combining these to (after first included all system account into the SystemUsers group) should give you only those users that should have user profiles.


Power up your EPiServer CMS with DropIT Extensions X3 and EPiCode Web Parts Framework

Togheter EPiServer CMS 5, DropIT Extension X3, the EPiCode EPiServer Web Parts and your custom integration code makes a great team; The Fab 4!

By combining those three (and not "tree" as one reader correctly pointed out :-)) you get everything the editor AND the web site user will need to create great sites including the ability to make per user customization.

To be able to combine the web parts framework and X3 on the same page you have to recompile the EPiCode Web Parts framework after you have made the following minor adjustment: Let the TemplatePageWebPartbase inherit from the ExtensionbaseTemplate (in the Extensions core library). The a web part page will be able to host both web parts and Extension function.

When and why you ant to combine them? I'll soon create a table with the possible combinations and reasons you would do it (some pros and cons) ... if time permits it ... :-)


SharePoint 2007, Kerberos, Web Parts and WCF Services

Now it's time for security, kerberos, mulitple hops, wcf service, etc. Working in a secure environment where SharePoint services and web parts are consuming wcf service requuires some steps of work:

  1. Background information on Authentication, Impersonation and Delagtion on MSDN;
  2. Establishing Kerberos authentication for the SharePoint installation. How? Liam Cleary has a more or less complete article on what and how to do it. Read it here.
  3. Consuming WCF services from a SharePoint Web part
  4. ...
  5. SSO and BDC. Whitepaper
  6. ..



SharePoint Sertification Exams

Yes, I've started the certifiaction run, and now I've only one exam left to complete the SharePoint 2007 certifiaction track.
  • 70-630: MCTS - SharePoint 2007 Configuration. PASSED!
  • 70-631: MCTS - Windows SharePoint Services 3.0 Configuration. PASSED!
  • 70-541: Windows SharePoint Services 3.0 Application Development. PASSED!
  • 70-542: SharePoint 2007 Application Development. Approx March 1.