Contents tagged with SharePoint

  • SharePoint: UI for ordering list items

    SharePoint list items have in the the base Item template a field named Order. This field is not shown by default.

    SharePoint 2007, 2010 and 2013 have a possibility to specify the order in a UI, using the _layouts page:


    In SharePoint 2010 and 2013 it is possible to add a custom action to a list. It is possible to add a custom action to order list items as follows (SharePoint 2010 description):

    1. Open SharePoint Designer 2010
    2. Navigate to a list
    3. Select Custom Actions > List Item Menu
    4. Fill in the dialog box:
    5. Open List Settings > Advanced Settings > Content Types, and set Allow management of content types to No 
    6. On List Settings select Column Orderingimage

    This results in the following UI in the browser:


    Selecting the custom Order Items action (under List Tools > Items) results in:


    You can change your custom action in SharePoint designer. On the list screen in the bottom right corner you can find the custom action:


    We now need to modify the view to include the order by adding the Order field to the view, and sorting on the Order field. Problem is that the Order field is hidden. It is possible to modify the schema of the Order field to set the Hidden attribute to FALSE. If we don’t want to write code to do it and still get the required result it is also possible to modify the view through SharePoint Designer:


    Modify the code of the view:


    This results in:


    Note that if you change the view through the web UI these changes are partly lost. If this is a problem modify the Order field schema for the list.

  • Getting SharePoint 2013 dev machine up and running in 5 minutes

    I’m a happy customer of, and only days after the release of SharePoint 2013 preview I was able to spin up an instance of SharePoint Server 2013 with the following configuration:

    SharePoint Server 2013 Preview

    Description: OS: Windows Server 2012 RC x64
    Spec: 80 GB HD / 8 GB RAM
    • SharePoint Server 2013 Preview
    • SQL Server 2012 Standard
    • Visual Studio 2012 RC Ultimate Edition
    • SharePoint Designer 2013 Preview
    • Adobe Reader

    The machine works like a breeze, although I already had some SharePoint crashes. But hey, it’s a preview!

    Kudo’s to CloudShare for getting a template machine up and running so fast.

    PS: I’m in no way affiliated to CloudShare, just a happy customer.

  • SharePoint.DesignFactory.ContentFiles–building WCM sites

    One of the use cases where we use the SharePoint.DesignFactory.ContentFiles tooling is in building SharePoint Publishing (WCM) solutions for SharePoint 2007, SharePoint 2010 and Office365.

    Publishing solutions are often solutions that have one instance, the publishing site (possibly with subsites), that in most cases need to go through DTAP.

    If you dissect a publishing site, in most case you have the following findings:

    1. The publishing site spans a site collection
    2. The branding of the site is specified in the root site, because:
      • Master pages live in the root site (/_catalogs/masterpage)
      • Page layouts live in the root site (/_catalogs/masterpage)
      • The style library lives in the root site ( /Style Library) and contains images, css, javascript, xslt transformations for your CQWP’s, …
      • Preconfigured web parts live in the root site (/_catalogs/wp)
    3. The root site and subsites contains a document library called Pages (or your language-specific version of it) containing publishing pages using the page layouts and master pages
    4. The site collection contains content types, fields and lists

    When using the SharePoint.DesignFactory.ContentFiles tooling it is very easy to create, test, package and deploy the artifacts that can be uploaded to the SharePoint content database. This can be done in a fast and simple way without the need to create and deploy WSP packages. If we look at the above list of artifacts we can use SharePoint.DesignFactory.ContentFiles for master pages, page layouts, the style library, web part configurations, and initial publishing pages (these are normally made through the SharePoint web UI).

    Some artifacts like content types, fields and lists in the above list can NOT be handled by SharePoint.DesignFactory.ContentFiles, because they can’t be uploaded to the SharePoint content database. The good thing is that these artifacts are the artifacts that don’t change that much in the development of a SharePoint Publishing solution. There are however multiple ways to create these artifacts:

    1. Use paper script: create them manually in each of the environments based on documentation
    2. Automate the creation of the artifacts using (PowerShell) script
    3. Develop a WSP package to create these artifacts

    I’m not a big fan of the third option (see my blog post Thoughts on building deployable and updatable SharePoint solutions). It is a lot of work to create content types, fields and list definitions using all kind of XML files, and it is not allowed to modify these artifacts when in use. I know… SharePoint 2010 has some content type upgrade possibilities, but I think it is just too cumbersome.

    The first option has the problem that content types and fields get ID’s, and that these ID’s must be used by the metadata on for example page layouts. No problem for SharePoint.DesignFactory.ContentFiles, because it supports deploy-time resolving of these ID’s using PowerShell. For example consider the following metadata definition for the page layout

    Metadata page layout
    1. # This script must return a hashtable @{ name=value; ... } of field name-value pairs
    2. # for the content file that this script applies to.
    3. # On deployment to SharePoint, these values are written as fields in the corresponding list item (if any)
    4. # Note that fields must exist; they can be updated but not created or deleted.
    5. # This script is called right after the file is deployed to SharePoint.
    7. # You can use the script parameters and arbitrary PowerShell code to interact with SharePoint.
    8. # e.g. to calculate properties and values at deployment time.
    10. param([string]$SourcePath, [string]$RelativeUrl, $Context)
    11. @{
    12.     "ContentTypeId" = $Context.GetContentTypeID('GeneralPage');
    13.     "MasterPageDescription" = "Cloud Aviator Contact pagelayout (wcm - don't use)";
    14.     "PublishingHidden" = "1";
    15.     "PublishingAssociatedContentType" = $Context.GetAssociatedContentTypeInfo('GeneralPage')
    16. }

    The PowerShell functions GetContentTypeID and GetAssociatedContentTypeInfo can at deploy-time resolve the required information from the server we are deploying to.

    I personally prefer the second option: automate creation through PowerShell, because there are PowerShell scripts available to export content types and fields.

    An example project structure for a typical SharePoint WCM site looks like:


    Note that this project uses DualLayout.

    So if you build Publishing sites using SharePoint, checkout out the completely free SharePoint.DesignFactory.ContentFiles tooling and start flying!

  • SharePoint.DesignFactory.ContentFiles - Installation

    The SharePoint.DesignFactory.ContentFiles tooling can be used to develop, test, package and deploy SharePoint files and metadata that can be uploaded to the SharePoint content database. Use this tooling for developing and packaging your master pages, page layouts, style library files, web part configurations and any file you can think of that can be uploaded to the SharePoint content database. Works on SharePoint 2007 (on SharePoint server), SharePoint 2010 (on SharePoint server or remote) and Office365 (remote).

    Installation is simple. In this post I will show the steps required to install the SharePoint.DesignFactory.ContentFiles on a Visual studio project.

    1. Fire-up Visual Studio 2010 and create a new project (File > New > Project…)
    2. Under Installed Templates select Visual C# > Web
    3. Select the .Net Framework 3.5, then select the ASP.NET Web Application project
    4. Note that the resulting project contains all kind of artifacts that are not relevant in the context of a SharePoint.DesignFactory.ContentFiles project:
    5. If NuGet is not installed yet on your Visual Studio (Tools > Library Package Manager is missing), start the Visual Studio Extension Manager (Tools > Extension Manager…). In the Extension Manager window select the Online Gallery at the left and search for NuGet. Select the NuGet Package Manager and press the Download button to install NuGet. Preferably use NuGet 1.7 or up to use all features available in the SharePoint.DesignFactory.ContentFiles NuGet package.
    6. Right-click on the just created Web Application project and in the context menu select Manage NuGet Packages….
    7. In the Manage NuGet Packages window select Online at the left and search for SharePoint.DesignFactory.ContentFiles. Select the SharePoint.DesignFactory.ContentFiles package and press the Install button.
    8. After installation where a lot of project manipulation magic happens the following message appears. An assembly is installed in the solution folder containing Visual studio Solution Explorer context menu actions that makes working with SharePoint.DesignFactory.ContentFiles even easier. This assembly is magically loaded by a Visual Studio extension called Managed Menu Extension (MME). Although this extension is not required and it is perfectly possible to work without the additional context menu actions, it is advised to install the Managed Menu Extensions (explained in the next step).
    9. Install the Managed Menu Extensions (MME) through the Extension Manager (Tools > Extension Manager…). Select Online Gallery and search for MME.
    10. Visual studio requires a restart for the Managed Menu Extensions to work and the context menu extension for SharePoint.DesignFactory.ContentFiles to work. Close Visual Studio, and reopen Visual Studio with our new solution in one of two ways (First starting Visual Studio and then loading the solution does not load the menu extensions):
      1. By starting the solution through the start menu
      2. By double-clicking the solution file in the explorer
    11. We are done with installation! The project is cleaned up, all unwanted files are removed. You are presented with a readme file explaining some things about the SharePoint.DesignFactory.ContentFiles tooling.

    In a next blog post I will give a tour through a SharePoint.DesignFactory.ContentFiles enabled Visual Studio project.

  • SharePoint.DesignFactory.ContentFiles NuGet package released

    Wouldn’t it be great to edit your SharePoint 2007/2010/Office365 content files like master pages, page layouts, web part files, style library files etc. etc. in Visual Studio, use intellisense, source control and the XSLT debugger, but without the overhead of creating complex xml files, manifest files and WSP packages? Wouldn’t it be great if you could package those file and deploy them through Dev, Test, Acceptation and Production without WSP packages? Now you can!

    Create an ASP.NET Web Application Project, add the SharePoint.DesignFactory.ContentFiles NuGet package and start building!


    See the included documentation for more information. More information will follow on this blog!

  • SharePoint.DesignFactory.ContentFiles

    Welcome to the landing page of the SharePoint.DesignFactory.ContentFiles NuGet package.

    Please see the following blog posts:

    Documentation SharePoint.DesignFactory.ContentFiles


    The DesignFactory.SharePoint.ContentFiles mechanism is designed for deploying SharePoint files with optional meta data to a SharePoint environment. This SharePoint environment can be:

    • a local environment, running on the same machine as where you are developing or deploying your content files
    • a remote environment, running on either the same machine or a machine that is accessible remotely over http.

    In both scenario's the files will end up in the SharePoint content database, as if they were uploaded by hand. This means that files are deployed in another way than if they were deployed using a WSP package using features and modules. Files are deployed as customized files. See Understanding and Creating Customized and Uncustomized Files in Windows SharePoint Services 3.0 for a good article on customized and uncustomized files.

    Project structure

    A SharePoint.DesignFactory.ContentFiles project has the following strucure:

    • ProjectFolder
      • _MachineConfiguration - configuration files describing connections to SharePoint web (SPWeb)
        • Default.ps1 - configuration file used if there is no specific configuration file for the currenty machine (MACHINE.ps1)
        • Machine1.ps1 - machine specific configuration file
        • Machine2.ps1 - machine specific configuration file
        • SPDesign.ps1 - configuration file for SharePoint web to be used for importing artifacts in project folder if no specific configuration file to use for import is specified [not used yet]
      • _Tools
        • Deploy.cmd - command for deploying all changed files in project
        • Redeploy.cmd - command for deploying all files in project
        • Package.cmd - command for packaging the files in the project
        • Clean.cmd - command to mark all files in the project for redeployment
        • SharePoint.DesignFactory.ContentFiles.ps1 - the script implementing all functionality. Can be called directly as well for more advanced features
        • ContextExtensions... - folder containing extension functions that can be used in ObjectModel and ClientObjectModel
        • Documentation... - folder containing documentation
        • Lib... - folder containing a library of reuseable functions
        • MSBuild... - folder containing a SharePoint.DesignFactory.ContentFiles specific MSBuild targets file
      • MasterPages - A folder mapped in Mappings.xml for deployment to SharePoint
        • MyMaster.master - file to be deployed to SharePoint
        • - metadata for the file to be deployed to SharePoint
        • ...
      • PageLayouts
        • ...
      • ...

    Some remarks on the above project structure:

    • The project structure can be used from any tool that is your favorite HTML editor, like:
      • Visual Studio 2010 (lower versions are supported, but not through nuget package installation)
      • WebMatrix 2.0 (still in beta, does support nuget package installation)
      • ... enter your vaforite web editor here ...
    • Visual Studio 2010 has many enhancements for working with SharePoint.DesignFactory.ContentFiles


    The Mappings.xml file describes a relationship between the project folder and where artifacts in the project folder should be deployed in to SharePoint. The Mappings.xml file looks like:

    <ContentFilesMappings xmlns="">
            <Mapping projectFolder="RootFolder" destinationFolder="/" />
            <Mapping projectFolder="Documents" destinationFolder="/documents" />
            <Mapping projectFolder="Masterpages" destinationFolder="/_catalogs/masterpage" />
            <Mapping projectFolder="PageLayouts" destinationFolder="/_catalogs/masterpage" />
            <Mapping projectFolder="Style Library" destinationFolder="/Style Library" />

    A Mapping node describes the mapping from a project folder to a SharePoint folder.

    The Mapping node attribute projectFolder':

    • refers to a folder within the project
    • must be specified
    • may not be empty
    • may not point to the root folder of the project, only files from subfolders can be uploaded

    ProjectFolders for multiple Mapping elements must be disjunct; e.g. valid is:

    <Mapping projectFolder="sub1" ... >
    <Mapping projectFolder="sub2" ... >

    invalid is:

    <Mapping projectFolder="sub1" ... >
    <Mapping projectFolder="sub1\sub3" ... >

    The Mapping node attribute destinationFolder:

    • specifies a folder within SharePoint relative to the SharePointWebUrl as specified in the machine configuration file
    • must be specified
    • may not be empty
    • to specify the root folder in 'SharePointWebUrl' specify '/'

    If the destination folder does not exist yet it will be created as an SPFolder. Any child folders below the projectFolder will result in corresponding child urls (SPFolders) in the destination folder.

    Working with the command-line tools

    The following command-line tools are available for performing the simple tasks involved in working with SharePoint.DesignFactory.ContentFiles:

    • _Tools\deploy [machineconfigurationname] - deploy changed files in the project using configuration MACHINE.ps1, Default.ps1 or specified configuration
    • _Tools\redeploy [machineconfigurationname] - deploy all files in the project using configuration MACHINE.ps1, Default.ps1 or specified configuration
    • _Tools\package - package all files in the project
    • _Tools\clean - mark all files in the project for redeployment

    For more advanced actions like deploying or marking for deployment a single file or folder the underlying PowerShell script _Tools\SharePoint.DesignFactory.ContentFiles.ps1 can be used. To see the available parameters open a PowerShell command prompt in the project foder and execute the following command:

    get-help _Tools\SharePoint.DesignFactory.ContentFiles.ps1

    Open this script file for more details on the available arguments.

    Visual Studio 2010 integration

    There is extensive integration with the Visual Studio 2010 IDE if SharePoint.DesignFactory.ContentFiles is installed as a NuGet package:

    • Create a new ASP.NET 3.5 Web Application project - File -> New -> Project..; Select .NET Framework 3.5; Select template Visual C# -> Web -> ASP.NET Web Application
    • Ensure that the Macaw NuGet repository is accessible:
      • Open Tools -> Library Package Manager -> Package Manager Settings
      • Go to Package Manager -> Package Source
      • Add source: Name = Macaw NuGet, Source =
    • Add the SharePoint.DesignFactory.ContentFiles NuGet package to the project and solution:
      • Open Tools -> Library Package Manager -> Manage NuGet Packages for Solution...
      • Select Online and the source Macaw NuGet
      • Now select the SharePoint.DesignFactory.ContentFiles package and hit Install. Add the package at both the project and solution level.

    Right click menus

    The SharePoint.DesignFactory.ContentFiles NuGet package adds right click menu entries if the Managed Menu Extension (MME) is installed. These extension can be installed through the Visual Studio 2010 UI:

    1. Open Tools -> Extension Manager..
    2. Select Online
    3. Search for managed Menu Extension (MME)
    4. Select managed Menu Extension (MME) and hit Install

    Close and reopen the Visual Studio 2010 instance containing your project to get the right click menu's loaded.

    The following right click actions are now added:

    On SharePoint.DesignFactory.ContentFiles project:

    • DesignFactory -> Deploy changed files
    • DesignFactory -> Deploy all files
    • DesignFactory -> Mark all files for deploy
    • DesignFactory -> Package
    • DesignFactory -> Documentation ContentFiles

    On mapped folder (folder in project mapped to SharePoint folder with Mappings.xml):

    • DesignFactory -> Deploy changed files in folder
    • DesignFactory -> Deploy all files in folder
    • DesignFactory -> Mark folder for deploy
    • DesignFactory -> Documentation ContentFiles

    On mapped file (file in folder in project that is mapped to SharePoint folder with Mappings.xml): - DesignFactory -> Deploy file - DesignFactory -> Deploy all files in folder - DesignFactory -> Mark file for deploy - DesignFactory -> Documentation ContentFiles


    The SharePoint.DesignFactory.ContentFiles NuGet package adds the following configurations to the project and to the solution, besides the Debug and Release configurations:

    • Deploy: build project in Debug mode, and deploy changed content files
    • Redeploy: build project in Debug mode, and deploy all content files
    • Package: build project in Release mode, and build package

    The following action is also supported when you right-click on a project:

    • Clean: marks all files in the project for redeployment, default project clean action is executed

    Select a configuration and build the project/solution. The configurations correspond with the command-line commands.

    It is also possible to add additional configurations using the Visual Studio Configuration dropdown, with at the end Configuration Manager.... In this way the following additional deployment commands can be added:

    • Deploy machineconfigurationname, i.e. Deploy Office365
    • Redeploy machineconfigurationname, i.e. Redeploy Office365

    Note that a solution configuration builds projects with a specific configuration. This works fine after installation of the NuGet package. If the SharePoint.DesignFactory.ContentFiles package is uninstalled and installed again, the solution configurations are not aligned anymore to the project configurations. To align again open the Configuration dropdown, and select at the end Configuration Manager.... Now align solution configurations with project configurations.

    Machine configuration files

    A machine configuration file is used to describe how to deploy the current project to SharePoint. The machine configuration file describes a deployment to a local machine (SP2007/SP2010) or a remote machine (SP2010). Deployment to the local machine can be done using the ObjectModel or the ClientObjectModel. Deployment to a remote machine is done with the ClientObjectModel. A machine configuration file is:

    • Located in the folder MachineConfiguration in the project folder
    • Named after the machine name, i.e. MYMACHINE.ps1 for the default deployment (Deploy.cmd, Redeploy.cmd) OR
    • Named as wanted. Requires explicit deployment, i.e. Deploy NAME, Redeploy NAME.
    • The machine configuration file Default.ps1 will be used for deployment if no machine specific configuration file exists
    • TODO: The machine configuration file SPDesign.ps1 will be used for importing SharePoint artifacts if no explicit configuration file is specified

    This machine configuration file is executed as a PowerShell script and returns a Hashtable with the following keys:

    • SharePointDeployment - MANDATORY
      • ObjectModel (on server itself, SP2007/SP2010)
      • ClientObjectModel (remote, SP2010)

    If ObjectModel is used for deployment, sharepoint is accessed with the credentials of the current user (integrated security).

    • SharePointWebUrl - MANDATORY
      • Example: 'http://myserver/sites/mysitecollection'

    Url to the SharePoint web site where the content files must be deployed to. In most cases this is the root site of a site collection, but it can be any SharePoint site. The content files in the package can only be deployed to locations within the specified site.

    • UserName - OPTIONAL
      • 'DOMAIN\UserName'

    User name to authenticate with. Must be in the format DOMAIN\UserName. If not specified check if the credentials to authenticate for the SharePointWebUrl are specified in the Windows Credential Manager.

    • Password - OPTIONAL
      • 'MyPassword'

    Password to authenticate with.

    • UseClaims - OPTIONAL
      • $true or $false

    Boolean that specifies if authentication should be done using claims authentication. This is for example the case for Office365. Note that claims-based authentication for now only works with SharePointDeployment set to ClientObjectModel.

    Authentication is done as follows:

    1. If SharePointDeployment is set to ObjectModel
      • Always use integrated security (credentials of currently logged in user)
    2. If SharePointDeployment is set to ClientObjectModel
      • If UserName,Password is specified and not empty, use these
      • Otherwise use the credentials specified in the Windows Credential Manager for Url SharePointWebUrl
    3. If no credentials found --> error.

    Using these key,value pairs multiple authentication approaches can be taken:

    Integrated security:

        SharePointDeployment = 'ObjectModel';
        SharePointWebUrl = 'http://myserver/sites/mysitecollection';
        UserName = '';
        Password = '';
        UseClaims = $false;

    Integrated security (as short as possible):

        SharePointDeployment = 'ObjectModel';
        SharePointWebUrl = 'http://myserver/sites/mysitecollection';

    Explicit authentication (ClientObjectModel deployment only):

        SharePointDeployment = 'ClientObjectModel';
        SharePointWebUrl = 'http://myserver/sites/mysitecollection';
        UserName = 'DOMAIN\UserName';
        Password = 'Password';
        UseClaims = $false;

    Explicit authentication (ClientObjectModel deployment only), but user name and password configured in Windows Credential Manager:

        SharePointDeployment = 'ClientObjectModel';
        SharePointWebUrl = 'http://myserver/sites/mysitecollection';
        UseClaims = $false;

    Explicit claims-based authentication (ClientObjectModel deployment only):

        SharePointDeployment = 'ClientObjectModel';
        SharePointWebUrl = 'http://myserver/sites/mysitecollection';
        UserName = 'DOMAIN\UserName';
        Password = 'Password';
        UseClaims = $true;

    Explicit claims-based authentication (ClientObjectModel deployment only), but user name and password configured in Windows Credential Manager:

        SharePointDeployment = 'ObjectModel';
        SharePointWebUrl = 'http://myserver/sites/mysitecollection';
        UseClaims = $true;

    How files are marked for deployment

    The Archive atribute is used to mark files for deployment. if the Archive attribute is set, the file must be deployed. After a file is successfully deployed the Archive attribute is cleared. The Archive attribute can also be set on read-only files.

    There is a case where the Archive attribute is fooled. If a file that is under TFS source control is reverted to an older version, the file should be deployed again. On Revert the Archive attribute is not set, so the file will not be deployed, although it has been updated (to an older version).

    In case of reverting from TFS source control, mark the specific file or folder for deployment.

    NuGet package installation

    When the NuGet package is installed in Visual studio the following actions are performed:

    • Add the configurations Deploy, Redeploy and Package to the project and to the solution
    • Add import of targets file SharePoint.DesignFactory.ContentFiles.targets in the project file to provide handling of building the configurations Deploy, Redeploy and Package, and a target Package for automating packaging
    • Remove the folders App_Data, Scripts and Default.aspx from the project if it is a web project
    • Copy assembly VSMenuManager.SharePoint.DesignFactory.ContentFiles.dll to the solution folder for right click menu extensions (requires restart of Visual Studio to be picked up)

    This tool is copyright 2012, Macaw.

  • SharePoint 15: What is coming?

    Something everyone busy with SharePoint would like to know: what will be the new features of SharePoint? What has been changed in the existing functionality? A lot of information that will point us in the right direction is available now from the source…

    See the Office 15 Technical Preview - Open Specification Update @

    The material is sometimes hard to read, but there is a lot of information hidden in the documents.

  • DualLayout for SharePoint 2010 WCM Quick Start

    DualLayout for SharePoint 2010 WCM is a solution to provide you with complete HTML freedom in your SharePoint Server 2010 publishing pages. In this post I provide a quick start guide to get you up and running quickly so you can try it out for yourself. This quick start creates a simple HTML5 site with a page to show-case the basics and the power of DualLayout. We will create the site in its own web application. Normally there are many things you have to do to create a clean start point for your SharePoint 2010 WCM site. All those steps will be provided in later posts. For now we want to give you the minimal set of steps to take to get DualLayout working on your machine.

    1. Create an authenticated web application with hostheader cms.html5demo.local on port 80 for the cms side of the site.
    2. Click the Create Site Collection link on the Application Created dialog box and create a Site Collection based on the Publishing Portal site template.
    3. Before we can click the site link in the Top-Level Site Successfully Created dialog we need to add the new host header cms.html5demo.local to the hosts file.
      Add the following line to the hosts file:        cms.html5demo.local

    4. Navigate to the site at http://cms.html5demo.local to see the out-of-the-box example Adventure Works publishing site.
    5. Download and add the DualLayout solution package designfactory.duallayout.sps2010.trial. to the farm’s solution store:
      1. On the Start menu, click All Programs.
      2. Click Microsoft SharePoint 2010 Products.
      3. Click SharePoint 2010 Management Shell.
      4. At the Windows PowerShell command prompt, type the following command:Add-SPSolution -LiteralPath designfactory.duallayout.sps2010.trial.
    6. In SharePoint 2010 Central Administration deploy the solution to the web application http://cms.html5demo.local.
    7. Navigate to the site at http://cms.html5demo.local, and in the Site Settings screen select Site Collection Administration > Site collection features and activate the following feature:
    8. image_thumb3

    9. Open the site http://cms.html5demo.local in SharePoint Designer 2010.
    10. Create a view-mode masterpage html5simple.master with the following code:

      1. <%@ Master language="C#" %>
      2. <%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
      3. <%@ Register TagPrefix="sdl" Namespace="DesignFactory.DualLayout" Assembly="DesignFactory.DualLayout, Version=, Culture=neutral, PublicKeyToken=077f92bbf864a536" %>
      5. <!DOCTYPE html>
      6. <html class="no-js">
      8.     <head>
      9.         <meta charset="utf-8" />
      10.         <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
      11.         <title><SharePointWebControls:FieldValue FieldName="Title" runat="server"/></title>
      13.         <script type="text/javascript">
      14.             document.createElement('header');
      15.             document.createElement('nav');
      16.             document.createElement('article');
      17.             document.createElement('hgroup');
      18.             document.createElement('aside');
      19.             document.createElement('section');
      20.             document.createElement('footer');
      21.             document.createElement('figure');
      22.             document.createElement('time');
      23.         </script>
      25.         <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
      26.     </head>
      28.     <body>
      30.         <header>
      31.             <div class="logo">Logo</div>
      32.             <h1>SiteTitle</h1>
      33.             <nav>
      34.                 <a href="#">SiteMenu 1</a>
      35.                 <a href="#">SiteMenu 2</a>
      36.                 <a href="#">SiteMenu 3</a>
      37.                 <a href="#">SiteMenu 4</a>
      38.                 <a href="#">SiteMenu 5</a>
      39.                 <sdl:SwitchToWcmModeLinkButton runat="server" Text="…"/>
      40.             </nav>
      41.             <div class="tagline">Tagline</div>
      42.             <form>
      43.                 <label>Zoek</label>
      44.                 <input type="text" placeholder="Voer een zoekterm in...">
      45.                 <button>Zoek</button>                
      46.             </form>
      48.         </header>
      50.         <div class="content">
      51.             <div class="pageContent">
      52.                 <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />
      53.             </div>
      54.         </div>
      56.         <footer>
      57.             <nav>
      58.                 <ul>
      59.                     <li><a href="#">FooterMenu 1</a></li>
      60.                     <li><a href="#">FooterMenu 2</a></li>
      61.                     <li><a href="#">FooterMenu 3</a></li>
      62.                     <li><a href="#">FooterMenu 4</a></li>
      63.                     <li><a href="#">FooterMenu 5</a></li>
      64.                 </ul>
      65.             </nav>
      66.             <small>Copyright &copy; 2011 Macaw</small>
      67.         </footer>
      68.     </body>
      69. </html>

      Note that if no specific WCM-mode master page is specified (html5simple-wcm.master), the default v4.master master page will be used in WCM-mode.
    11. Create a WCM-mode page layout html5simplePage-wcm.aspx with the following code:
      1. <%@ Page language="C#" Inherits="DesignFactory.DualLayout.WcmModeLayoutPage, DesignFactory.DualLayout, Version=, Culture=neutral, PublicKeyToken=077f92bbf864a536" %>
      2. <%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
      3. <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
      4. <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
      5. <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
      7. <asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
      8.     <SharePointWebControls:FieldValue FieldName="Title" runat="server"/>
      9. </asp:Content>
      10. <asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
      11. Title: <SharePointWebControls:TextField FieldName="Title" runat="server"/>
      12. </asp:Content>

      Notice the Inherits at line one. Instead of inheriting from Microsoft.SharePoint.Publishing.PublishingLayoutPage we need to inherit from DesignFactory.DualLayout.WcmModeLayoutPage
    12. Create a view-mode page layout html5simplePage.aspx with the following code:

      1. <%@ Page language="C#" Inherits="DesignFactory.DualLayout.ViewModeLayoutPage, DesignFactory.DualLayout, Version=, Culture=neutral, PublicKeyToken=077f92bbf864a536" %>
      2. <%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
      4. <asp:Content ContentPlaceholderID="PlaceHolderAdditionalPageHead" runat="server" />
      5. <asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
      6.     The title of the page is: <SharePointWebControls:FieldValue FieldName="Title" runat="server"/>
      7. </asp:Content>

      Notice the Inherits at line one. Instead of inheriting from Microsoft.SharePoint.Publishing.PublishingLayoutPage we need to inherit from DesignFactory.DualLayout.ViewModeLayoutPage
    13. Set the html5simple.master master page as the Site Master Page:
    14. Set the allowed page layouts to the Html5 Simple Page page layout and set the New Page Default Settings also to Html5 Simple Page so new created pages are also of this page layout.
      Note that the Html5 Simple Page page layout is initially not selectable for New Page Default Settings. Save this configuration page first after selecting the allowed page layouts, then open again and select the default new page.
    15. Under Site Actions select the New Page action. Create a page Home.aspx of the default page layout type Html5 Simple Page.
    16. Set the new created Home.aspx page as Welcome Page.
    17. Navigate to the site http://cms.html5demo.local and see the home page in the WCM display and edit mode.
    18. Select Switch to View Mode under Site Actions to see the resulting page in view-mode. Select the three dots (…) at the right side of the menu to switch back to WCM-mode.
    19. Have a look at the source view of the resulting web page and admire the clean HTML. No SharePoint specific markup or CSS files!
      Clean HTML in page
      1. <!DOCTYPE html>
      2. <html class="no-js">
      3.     <head>
      4.         <meta charset="utf-8" />
      5.         <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
      6.         <title>Home</title>
      7.         <script type="text/javascript">
      8.             document.createElement('header');
      9.             document.createElement('nav');
      10.             document.createElement('article');
      11.             document.createElement('hgroup');
      12.             document.createElement('aside');
      13.             document.createElement('section');
      14.             document.createElement('footer');
      15.             document.createElement('figure');
      16.             document.createElement('time');
      17.         </script>
      19.     </head>
      21.     <body>
      23.         <header>
      24.             <div class="logo">Logo</div>
      25.             <h1>SiteTitle</h1>
      26.             <nav>
      27.                 <a href="#">SiteMenu 1</a>
      28.                 <a href="#">SiteMenu 2</a>
      29.                 <a href="#">SiteMenu 3</a>
      30.                 <a href="#">SiteMenu 4</a>
      31.                 <a href="#">SiteMenu 5</a>
      32.                 <a href="/Pages/Home.aspx?DualLayout_ShowInWcmMode=true">…</a>
      33.             </nav>
      34.             <div class="tagline">Tagline</div>
      35.             <form>
      36.                 <label>Zoek</label>
      37.                 <input type="text" placeholder="Voer een zoekterm in...">
      38.                 <button>Zoek</button>                
      39.             </form>
      40.         </header>
      42.         <div class="content">
      43.             <div class="pageContent">
      45.     The title of the page is: Home
      46.             </div>
      47.         </div>
      49.         <footer>
      50.             <nav>
      51.                 <ul>
      52.                     <li><a href="#">FooterMenu 1</a></li>
      53.                     <li><a href="#">FooterMenu 2</a></li>
      54.                     <li><a href="#">FooterMenu 3</a></li>
      55.                     <li><a href="#">FooterMenu 4</a></li>
      56.                     <li><a href="#">FooterMenu 5</a></li>
      57.                 </ul>
      58.             </nav>
      59.             <small>Copyright &copy; 2011 Macaw</small>
      60.         </footer>
      61.     </body>
      62. </html>
      63. <!-- Macaw DesignFactory DualLayout for SharePoint 2010 Trial version -->

      Note the link at line 37, this link will only be rendered for authenticated users and is our way to switch back to WCM-mode.

    This concludes our quick start to get DualLayout up an running in a matter of minutes. And what is the result:

    • You can have the full SharePoint 2010 WCM publishing page editing experience to manage the content in your pages.
    • You don’t have to delve into large SharePoint specific master pages and page layouts with a lot of knowledge of the does and don'ts with respect to SharePoint controls, scripts and stylesheets.
    • The end-user gets a clean and light HTML page.

    Get your fully functional, non-timebombed trial copy of DualLayout and start creating!

  • DualLayout OpenSourceFood demo site installation instructions

    We released DualLayout which enables advanced web design with the power of SharePoint. DualLayout and a demo site which shows off the feature of DualLayout can be downloaded from the DualLayout product page.

    This blogpost contains detailed instructions on installing this demo site.

    The DualLayout demo site is based on the site The demo site requires internet access because for some menu items it still links to pages and resources of the real site.

    Execute the following steps to install the OpenSourceFoodDemo demo site on your SharePoint Server 2010:

    • Downloaded the file from the DualLayout product page
    • Copy the file to your development computer running SharePoint Server 2010
    • Make sure that the zip file in “unblocked”, otherwise files are marked as “unsecure” because they are downloaded from another computer, and the installation script will not run (right-click on zip file, press “Unblock” button if available, if not available the file is already unblocked)
    • Unzip the file to a folder of your choice (c:\OpenSourceFoodDemo)
    • Open the SharePoint 2010 Management Shell (Start->Microsoft SharePoint 2010 Products->SharePoint 2010 Management Shell)
    • Change directory to the unzip folder (cd c:\OpenSourceFoodDemo)
    • Start the PowerShell installation script: .\InstallDemoSite.ps1
    • Answer the questions, default values are in most cases ok. A little guidance:
      • Question: Give credentials for the account that will be used for the application pool
        Answer: use for example same account as used for the application pool of your SharePoint site (lookup in IIS Manager)
      • Question: Give credentials for the account that will be used for the application pool
        Answer: Use same account you are currently logged in with

    The DualLayout demo site is made available through a SharePoint backup and restore created using stsadm. The SharePoint Server 2010 installation must be patched to a level equal or higher to the update level on the SharePoint Server that we used to create the backup.

    If you get version errors with respect to the restore check for downloading the latest cumulative update. Don’t forget to make a snapshot before installing the cumulative update if you are using a virtual development environment. I updated one of my development machines to the december cummulative update and never got it working again:-(

  • Macaw DualLayout for SharePoint 2010 WCM released!

    A few months ago I wrote a blog post about the DualLayout component we developed for SharePoint Server 2010 WCM. DualLayout enables advanced web design on SharePoint WCM sites. See the blog post DualLayout - Complete HTML freedom in SharePoint Publishing sites! for background information.

    DualLayout if now available for download. Check out DualLayout for SharePoint 2010 WCM and download your fully functional trial copy!

    Enjoy the freedom!

  • DualLayout - Complete HTML freedom in SharePoint Publishing sites!

    Main complaint about SharePoint Publishing is HTML output size and quality. DualLayout to the rescue: complete HTML freedom in all your publishing pages!

    In this post I will introduce our approach, in later posts I will go into details on my personal vision on how you could build Internet facing sites on the SharePoint platform, and how DualLayout can help you with that.

    How SharePoint Publishing works

    But first a little introduction into SharePoint Publishing. SharePoint Publishing has the concept of templates that are used for authoring and displaying information. There are two types of templates:

    • master pages
    • page layouts

    The master page template contains the information that is displayed across multiple page layouts like headers, footers, logo’s and navigation. The master page is used to provide a consistent look and feel to your site.

    The page layout template is associated with a content type that determines the set of fields that contain the (meta)data that can be stored, authored and displayed on a page based on the page layout. Within the page layout you can use field controls that are bound to the fields to provide editing and display capabilities for a field.

    A page is an instance of a page layout. The master page used by the page is configured by the CustomMasterUrl property of the site a page is part of.

    Some images to help describe the concepts:

    Relationship between page instance, master page and pagelayout  
    Image 1: Relationship between page instance, master page and page layout (source)


    Usage of fields in a page layout  
    Image 2: Usage of fields in a page layout (source)

    The problem

    A SharePoint Publishing page can be in edit or display mode. The same SharePoint master page and page layout are used in both the edit mode and display mode. This gives you WYSIWYG editing.

    A SharePoint Publishing page in edit mode

    Image 3: A SharePoint Publishing page in WCM edit mode

    A SharePoint Publishing page in display mode

    Image 4: A SharePoint Publishing page in WCM display mode

    To be able to use a Publishing page in both editing and display mode there are a few requirements:

    • The Publishing master page and page layouts need a minimal set of controls to make it possible to use a page in both edit and display mode. See for example for a minimal Publishing master page which has a size of 25 kb to get you started
    • Create a master page that works in both the edit and display mode
    • The style sheets (CSS) and JavaScript used in publishing pages must not interfere with the standard styles and master pages used by SharePoint to provide the editing experience. This means that designers of the publishing site need to know how to let their style sheets work together with the SharePoint style sheets like core.css
    • The page must use the ASP.NET Single Web Form Postback architecture, otherwise editing stops working

    All these requirements are not easy to fulfill if you have to migrate an existing internet site to the SharePoint 2010 Publishing platform, or when you get a new design for your Internet site from a design agency. The people who created the design and site interaction in most cases didn’t design with SharePoint in mind, or they don’t have knowledge of the SharePoint platform.

    When you want to make your design work together with the SharePoint styles heet you need a lot of knowledge of SharePoint. Especially with MOSS 2007 people like Heather Salomon became famous for dissecting and documenting the SharePoint CSS files to prevent designers from branding nightmare.

    One of the design agencies we work with describe SharePoint as the “hostile environment” where their CSS and JavaScript must live in. If you don’t play exactly by the rules of SharePoint you will see things like:

    SharePoint 2007 usability trouble when the padding and margins of tables are changed 
    Image 5: SharePoint 2007 usability trouble when the padding and margins of tables are changed

    Things got a lot better in SharePoint 2010 with the introduction of the context sensitive Ribbon at the top of the page, instead of editor bars injected into the design. But still many of the same issues remain.

    Image 6: The SharePoint 2010 Ribbon

    So in my opinion SharePoint Publishing has a few “problems”:

    • A lot of SharePoint knowledge is required by visual designers and interaction designers
    • Time consuming and complex construction of master pages and page layouts
    • Master pages and page layouts get complex in order to keep them working in both edit and display mode
    • Issues with upgrades of master pages / page layouts when going to new version of SharePoint
    • Large set of required server control that are only used in edit mode, but still “execute” in display mode
    • SharePoint pages are large
    • SharePoint pages are difficult to get passing W3C validation
    • You are stuck with the ASP.NET Single Web Form Postback architecture

    Enough about the problems, lets get to the solution!

    The Solution

    About a year ago we got completely stuck on a huge project. A design agency delivered a great design completely worked out with perfect html, CSS and JavaScript, using progressive enhancement principles. They created everything without knowledge of SharePoint, and without taking SharePoint into account. We did everything we could to get it working on SharePoint: we wrote compensating CSS, custom controls, did tricks to fix id’s as created by ASP.NET, rewrote multiple form tags back to the single ASP.NET form post, but we could not get it working the way they wanted.

    We saw two approaches to solve our issues:

    1. Use SharePoint for web content management and build an ASP.NET MVC site against the SharePoint services to read the data for the site
    2. Make the SharePoint Publishing beast dance to our tunes

    It became a kind of competition within our company which approach would be best, and we managed to do both.

    Using ASP.NET MVC works great, but then it isn’t SharePoint. Its just like a custom application that uses data from an external database. Something that is difficult to sell to a company who just decided for very good reasons to go for a unified platform for intranet, extranet and internet. (See also my post Why use SharePoint Publishing for public internet sites?)

    But we also managed to do the second which we named DualLayout. We created an approach where we can introduced an additional mode to SharePoint Publishing pages. Besides the SharePoint Publishing WCM mode with it’s edit and display modes, we introduced a view mode. The view mode is a mode that gives you a view-only version of the page where you don’t have to bother about the page going into edit mode, and also don’t need the plumbing to enable your page to go into edit mode.

    So now a SharePoint Publishing page can have the following modes:

    • SharePoint Publishing WCM Display Mode
      The standard SharePoint display mode using the master page and page layout with all the required controls and the field controls rendered in display mode.
    • SharePoint Publishing WCM Edit Mode
      The standard SharePoint edit mode using the master page and page layout with all the required controls and the field controls rendered in edit mode.
    • SharePoint Publishing View Mode
      The additional view, with complete freedom in HTML, no requirements for controls or ASP.NET single web form.

    And how is this accomplished? We made it possible to have a master page and page layout for WCM mode (edit, display) and a master page and page layout for view mode (display only). Depending on the mode we display the page with the correct master page and page layout. This gives us complete freedom in designing an end user view separate from a content author / approver view.

    The WCM master page and page layout are the domain of the SharePoint specialist. She can go for completely WYSIWYG editing, or use the out of the box v4.master master page to stay as close as possible with the SharePoint look and feel so the content authors recognize the UI from the SharePoint text books.

    The View Mode master page and page layout are completely the domain of the web site designer. Any HTML can be used, there is no dependency on core.css of SharePoint JavaScripts. If required the ASP.NET single web form model can be used, for example around a web part zone, but it does not have to be around the complete page, or it can be left out completely.

    Below some screenshots of an example I made with DualLayout based on the web site In a next post I will go into detail on how I created the example using DualLayout. In this example I use the out of the box v4.master master page for the WCM mode (edit/display) where I give a schematic preview of the content in WCM display mode, and provide guidance for the content author in WCM edit mode. In the view mode I generate the exact HTML as is used in the actual site, without any compromise.

    OpenSourceFood sample, SharePoint Publishing WCM Edit Mode 
    Image 7: OpenSourceFood sample, SharePoint Publishing WCM Edit Mode

    OpenSourceFood sample, SharePoint Publishing WCM Display Mode 
    Image 8: OpenSourceFood sample, SharePoint Publishing WCM Display Mode


    OpenSourceFood sample, SharePoint Publishing View Mode 
    Image 9: OpenSourceFood sample, SharePoint Publishing View Mode

    If you are in the SharePoint Publishing View Mode, and you have the rights to author the page, there is a link that the designer can put in any location on the page to switch to WCM mode. In the zoom below you can see that we created it as a simple link at the top of the page. This link is not visible for the end user of your site.

    Image 10: Link in View mode back to WCM Display mode

    If you are in WCM Edit mode and want to see a preview of your page in View mode, you can go to the Page tab on the ribbon and select the Preview action:

    See a preview of page you are currently editing in View mode
    Image 11: See a preview of page you are currently editing in View mode

    If you are in WCM Display mode, you can switch to the View mode using an action in the Site Actions menu:

    Image 12: Switch to View mode


    DualLayout gives you all the freedom you need to build Internet facing web sites on the SharePoint Publishing platform,the way you want, without any restrictions. In the next post I will explain how I created the OpenSourceFood sample. DualLayout works on both MOSS 2007 and SharePoint 2010. I will make a full-featured download available soon so you can try it out yourself. Let me know if you are interested.

  • Why use SharePoint Publishing for public internet sites?

    Is SharePoint the best Web Content Management System you can get? Is it the best platform for your internet sites? Maybe not. There are specialized WCM platforms like Tridion, SiteCore and EPIServer that might be better. But there are many reasons why you would use SharePoint over the many alternatives.

    Strategic platform for many organizations – SharePoint is a platform that works great for intranets and extranets. It is often selected as the strategic web platform within an organization. There is a SharePoint unless policy. So why not do the public facing web sites on SharePoint as well?

    Unified web platform – In these organizations SharePoint is used as the unified web platform that is used for team, divisional, intranet, extranet, and internet sites. This unified platform promises to reduce cost and increase agility.


    With respect to the Internet this vision is also promoted by Microsoft as Microsoft’s Internet Business Vision with focus on IT Control (existing infrastructure, low TCO) and web agility; one platform to rule them all:


    See also: Microsoft's Internet Business Platform Vision Part 1, Microsoft's Internet Business Platform Vision Part 2


    Reuse of knowledge and people - Unified Development, Unified Infrastructure; the same skills can be reused for development and maintenance.

    Existing relationships – the Communication department (focusing on Intranet/Extranet) and the Marketing department (focusing on Internet) are either the same group of people, or working close together.

    Support from the community – SharePoint is one of the Microsoft server products with the best community support in blogs, support sites and open source projects. For example on you can find 1300 open source projects related to SharePoint, versus for example 27 projects for EPIServer.

    SharePoint is a development platform – SharePoint isn’t just an out of the box product, it is a development platform that you can extend at will, like an infinite number of companies already did to provide you with tools for all the (many) gaps that exist in the out of the box SharePoint offering.


    But if you look at the Internet sites that are built with SharePoint Publishing, some people are a bit disappointed. Microsoft’s classic showcases like and deliver pages with 1000+ lines, and 100+ validation errors when you run the W3C validator. But there are also a lot of great sites that use the SharePoint Publishing platform. Have a look at for a nice overview of those sites. In a future post I will describe our approach to delivering quality HTML on the SharePoint Publishing platform. We call this approach DualLayout.

  • Is your code running in a SharePoint Sandbox?

    You could execute a function call that is not allowed in the sandbox (for example call a static method on SPSecurity) and catch the exception. A better approach is to test the friendly name of you app domain:

    AppDomain.CurrentDomain.FriendlyName returns "Sandboxed Code Execution Partially Trusted AppDomain"

    Because you can never be sure that this string changes in the future, a safer approach will be:


    See for a discussion on this topic.

  • Logging to SharePoint 2010 ULS log from sandbox

    You can’t log directly from sandbox code to the SharePoint ULS log. Developing code without any form of logging is out of this time, so you need approaches for the two situations you can end up with when developing sandbox code:

    You don’t have control over the server (BPOS scenario):

    • You can log to comments in your HTML code, I know it’s terrible, don’t log sensitive information
    • Write entries to a SharePoint “log” list (also take care of some form of clean up, for example if list longer that 1000 items, remove oldest item when writing new log message)

    You have control over the server:

  • SharePoint 2010 Replaceable Parameter, some observations…

    SharePoint Tools for Visual Studio 2010 provides a rudimentary mechanism for replaceable parameters that you can use in files that are not compiled, like ascx files and your project property settings. The basics on this can be found in the documentation at

    There are some quirks however. For example:

    My Package name is MacawMastSP2010Templates, as defined in my Package properties:


    I want to use the $SharePoint.Package.Name$ replaceable parameter in my feature properties. But this parameter does not work in the “Deployment Path” property, while other parameters work there, while it works in the “Image Url” property. It just does not get expanded. So I had to resort to explicitly naming the first path of the deployment path:

    image :

    You also see a special property for the “Receiver Class” in the format $SharePoint.Type.<GUID>.FullName$. The documentation gives the following description:The full name of the type matching the GUID in the token. The format of the GUID is lowercase and corresponds to the Guid.ToString(“D”) format (that is, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

    Not very clear. After some searching it happened to be the guid as declared in my feature receiver code:


    In other properties you see a different set of replaceable parameters:


    We use a similar mechanism for replaceable parameter for years in our Macaw Solutions Factory for SharePoint 2007 development, where each replaceable parameter is a PowerShell function. This provides so much more power.

    For example in a feature declaration we can say:

    Code Snippet
    1. <?xml version="1.0" encoding="utf-8" ?>
    2. <!-- Template expansion
    3.      [[ProductDependency]] -> Wss3 or Moss2007
    4.      [[FeatureReceiverAssemblySignature]] -> for example: Macaw.Mast.Wss3.Templates.SharePoint.Features, Version=, Culture=neutral, PublicKeyToken=6e9d15db2e2a0be5
    5.      [[FeatureReceiverClass]] -> for example: Macaw.Mast.Wss3.Templates.SharePoint.Features.SampleFeature.FeatureReceiver.SampleFeatureFeatureReceiver
    6. -->
    7. <Feature Id="[[$Feature.SampleFeature.ID]]"
    8.   Title="MAST [[$MastSolutionName]] Sample Feature"
    9.   Description="The MAST [[$MastSolutionName]] Sample Feature, where all possible elements in a feature are showcased"
    10.   Version=""
    11.   Scope="Site"
    12.   Hidden="FALSE"
    13.   ImageUrl="[[FeatureImage]]"
    14.   ReceiverAssembly="[[FeatureReceiverAssemblySignature]]"
    15.   ReceiverClass="[[FeatureReceiverClass]]"
    16.   xmlns="">
    17.     <ElementManifests>
    18.         <ElementManifest Location="ExampleCustomActions.xml" />
    19.         <ElementManifest Location="ExampleSiteColumns.xml" />
    20.         <ElementManifest Location="ExampleContentTypes.xml" />
    21.         <ElementManifest Location="ExampleDocLib.xml" />
    22.         <ElementManifest Location="ExampleMasterPages.xml" />
    24.         <!-- Element files -->
    25.         [[GenerateXmlNodesForFiles -path 'ExampleDocLib\*.*' -node 'ElementFile' -attributes @{Location = { RelativePathToExpansionSourceFile -path $_ }}]]
    26.         [[GenerateXmlNodesForFiles -path 'ExampleMasterPages\*.*' -node 'ElementFile' -attributes @{Location = { RelativePathToExpansionSourceFile -path $_ }}]]
    27.         [[GenerateXmlNodesForFiles -path 'Resources\*.resx' -node 'ElementFile' -attributes @{Location = { RelativePathToExpansionSourceFile -path $_ }}]]
    28.     </ElementManifests>
    29. </Feature>

    We have a solution level PowerShell script file named TemplateExpansionConfiguration.ps1 where we declare our variables (starting with a $) and include helper functions:

    Code Snippet
    1. # ==============================================================================================
    2. # NAME: product:\src\Wss3\Templates\TemplateExpansionConfiguration.ps1
    3. #
    4. # AUTHOR: Serge van den Oever, Macaw
    5. # DATE  : May 24, 2007
    6. #
    7. # COMMENT:
    8. # Nota bene: define variable and function definitions global to be visible during template expansion.
    9. #
    10. # ==============================================================================================
    11. Set-PSDebug -strict -trace 0 #variables must have value before usage
    12. $global:ErrorActionPreference = 'Stop' # Stop on errors
    13. $global:VerbosePreference = 'Continue' # set to SilentlyContinue to get no verbose output
    15. # Load template expansion utility functions
    16. . product:\tools\Wss3\MastDeploy\TemplateExpansionUtil.ps1
    18. # If exists add solution expansion utility functions
    19. $solutionTemplateExpansionUtilFile = $MastSolutionDir + "\TemplateExpansionUtil.ps1"
    20. if ((Test-Path -Path $solutionTemplateExpansionUtilFile))
    21. {
    22.     . $solutionTemplateExpansionUtilFile
    23. }
    24. # ==============================================================================================
    26. # Expected: $Solution.ID; Unique GUID value identifying the solution (DON'T INCLUDE BRACKETS).
    27. # function: guid:UpperCaseWithoutCurlies -guid '{...}' ensures correct syntax
    28. $global:Solution = @{
    29.     ID = GuidUpperCaseWithoutCurlies -guid '{d366ced4-0b98-4fa8-b256-c5a35bcbc98b}';
    30. }
    32. #  DON'T INCLUDE BRACKETS for feature id's!!!
    33. # function: GuidUpperCaseWithoutCurlies -guid '{...}' ensures correct syntax
    34. $global:Feature = @{
    35.     SampleFeature = @{
    36.         ID = GuidUpperCaseWithoutCurlies -guid '{35de59f4-0c8e-405e-b760-15234fe6885c}';
    37.     }
    38. }
    40. $global:SiteDefinition = @{
    41.     TemplateBlankSite = @{
    42.         ID = '12346';
    43.     }
    44. }
    46. # To inherit from this content type add the delimiter (00) and then your own guid
    47. # ID: <base>00<newguid>
    48. $global:ContentType = @{
    49.     ExampleContentType = @{
    50.         ID = '0x01008e5e167ba2db4bfeb3810c4a7ff72913';
    51.     }
    52. }
    54. #  INCLUDE BRACKETS for column id's and make them LOWER CASE!!!
    55. # function: GuidLowerCaseWithCurlies -guid '{...}' ensures correct syntax
    56. $global:SiteColumn = @{
    57.     ExampleChoiceField = @{
    58.         ID = GuidLowerCaseWithCurlies -guid '{69d38ce4-2771-43b4-a861-f14247885fe9}';
    59.     };
    60.     ExampleBooleanField = @{
    61.         ID = GuidLowerCaseWithCurlies -guid '{76f794e6-f7bd-490e-a53e-07efdf967169}';
    62.     };
    63.     ExampleDateTimeField = @{
    64.         ID = GuidLowerCaseWithCurlies -guid '{6f176e6e-22d2-453a-8dad-8ab17ac12387}';
    65.     };
    66.     ExampleNumberField = @{
    67.         ID = GuidLowerCaseWithCurlies -guid '{6026947f-f102-436b-abfd-fece49495788}';
    68.     };
    69.     ExampleTextField = @{
    70.         ID = GuidLowerCaseWithCurlies -guid '{23ca1c29-5ef0-4b3d-93cd-0d1d2b6ddbde}';
    71.     };
    72.     ExampleUserField = @{
    73.         ID = GuidLowerCaseWithCurlies -guid '{ee55b9f1-7b7c-4a7e-9892-3e35729bb1a5}';
    74.     };
    75.     ExampleNoteField = @{
    76.         ID = GuidLowerCaseWithCurlies -guid '{f9aa8da3-1f30-48a6-a0af-aa0a643d9ed4}';
    77.     };
    78. }

    This gives so much more possibilities, like for example the elements file expansion where a PowerShell function iterates through a folder and generates the required XML nodes.

    I think I will bring back this mechanism, so it can work together with the built-in replaceable parameters, there are hooks to define you custom replacements as described by Waldek in this blog post.

  • A great overview of the features of the different SharePoint 2010 editions

    The following document gives a good overview of the features available in the different SharePoint editions: Foundation (free), Standard and Enterprise.

    It is good to see the power that is available in the free SharePoint Foundation edition, so there is no reason to not use SharePoint as a foundation for you collaboration applications.

  • no longer usable as a blogging platform?

    I get swamped by spam on my weblog. Both comments spam and spam through the contact form. It is getting so bad that I think the platform is becoming useless for me. Why o why are we bloggers from the first hour still in stone age without any protection against spam. Implementing Captcha shouldn’t be that hard… As far as I know this is the same blogging platform used by Aren’t all Microsoft bloggers getting sick from spam? In the past I tried to contact the maintainers of, but never got a response. Who maintains the platform? Why are we still running on a Community Server Edition of 2007? Please help me out, or I’m out of here.

  • Fun: Quoted on SharePoint 2010 Development with Visual Studio in InfoWorld Article

    When I was at the SharePoint Conference 2009 in Vegas I was sitting in the hallway working on my little white Mac Book writing a blog post on SharePoint 2010 when a guy passed by. “Can I ask you some questions?” “Sure”, I said. “If I did anything with SharePoint?” he asked me… Ok, sitting with a Mac on a Microsoft conference can be strange, but hey: VMware Fusion did let me run the Technical Preview of SharePoint 2010 on my little Mac Book with 4GB, which couldn’t be said of my Dell running Windows XP at the time, not supporting 64 bits virtualization with Microsoft tools. We talked for a few minutes, he made some audio recordings, and off he was.

    It resulted in a nice article in InfoWorld with some quotes by “van den Oever”. Never knew I said such smart things;-)

    Read it at

    And…. when you want the just release public beta of SharePoint 2010, download it:


    This link is provided by Microsoft The Netherlands to a group of people called the “Wave 14” ambassadors. We have a small competition between the ambassadors: the one who gets the most clicks gets an XBox!! So help me out, click it… often! And I will make sure that I blog a lot about SharePoint 2010!

  • The bear goes loose: Office 2010 public beta link (includes SharePoint 2010!)

    An old Dutch phrase… translated into bad English! But it is going to happen: the first public beta of the Office tools… including: SharePoint 2010!

    And where can you download it… I know it… download it


    This link is provided by Microsoft The Netherlands to a group of people called the “Wave 14” ambassadors. We have a small competition between the ambassadors: the one who gets the most clicks gets an XBox!! So help me out, click it… often! And I will make sure that I blog a lot about SharePoint 2010!

  • SharePoint 2010: #SPC09 - SSP is dead, long live Service Applications!

    Notes from the SharePoint Conference 2009 session "Introduction to Service Applications and Topology". This is my personal interpretation of what has been said during the presentation. Don't shoot me if I interpreted something wrong:-)

    In SharePoint 2010 Shared Service Providers (SSP's) are replaced by Service Applications. Services are no longer combined into a SSP. Services are running independent as a service application.

    So in MOSS 2007:
    SSP: combines services like Search, Excel Services, User Profiles, ... into a shared service provider.

    In SharePoint 2010:
    Service Applications: services like Search, Managed Meta Data, .., your service (20 services in SharePoint Server) are running "unboxed" and independent.

    So SharePoint 2010 provides a la carte unboxed services. You can configure which services are running on an application server. Per web application you can configure which services are consumed.

    When migrating MOSS 2007 to SharePoint 2010 SSPs will upgrade into Service Applications.

    SharePoint Foundation 2010 (WSS 4.0) provides the SharePoint Service Application Framework.
    New products like Office Web Apps, Project Server, Gemini (PowerPivot) use this application framework, and this platform can also be used by third parties or you to create custom services.
    You can plug your management UI for your service into the Service Management page.

    A web application does not communicate directly to a service application, but does this through a proxy:
    Web Application <-> Service Application Proxy <-> Service Application

    So a general workflow can be:
    Browser -> Web Front End ->(Request) Application Server ->(Result) Web Front End -> Browser

    SharePoint 2010 does contain a fault tolerant round-robin software load balancer with support for hardware load balancing, so it is possible to have multiple application servers.

    The Service Application infrastructure provides application isolation: each service application can use separate databases if needed and optionally run in separate app pool. There is support for multiple service apps for a service with different accounts and databases ==> Great for multi-tenancy (hosting for multiple customers on same platform)

    Services are flexible, secure and provide cross-farm federation:
    • Trust based security between farms, claims based authorization within the farm
    • Share to anyone, consume from anywhere
    • WCF based web services for communication
    • No direct DB Access
    For example: Taxonomy, has cross farm federation. Probably same for content types?


    You can manage which services are running on a server.
    In Central Administration UI: list of services, indented under a service you see the proxy.

    Through the wizards you get database names with guids at the end. Better to create manually form Central Administration, or create services through PowerShell.

    Per web application you can configure which services apps you want to be available. By default all web applications use all service applications available. You can change this into a custom configuration. Use the Manage Service Associations page for this.

    Service applications can be published to make them available outside the current farm. It allows you to select the connection type, for example https or net.tcp. Note that there must be a trust relationship with the farm that wants to consume your service. The service is published on a url. Through this url an other farm can find the published services. Url is in the following format: https://myfarm/Topology/topology.svc

    The other farm can connect to your farm through a remote service connection.

    Although manual adminstration and configuration of SharePoint 2010 can be done through Central Admin, the future of SharePoint administration is PowerShell.

    With respect to Services:

    returns the set of service applications.
    Do Get-SPServiceApplication-name yourservice to get the service object. Do Get-SPServiceApplication -name yourservice | fl to see all properties of the service object.

    There are almost a hundred Cmdlets to manage your services.

    Side note: It now really becomes time that all administrators learn PowerShell. In my company (Macaw) we use PowerShell extensively for our Macaw Solutions Factory. Everything from configuration, build and deploy through DTAP is done with PowerShell.

    It is possible to delegate management of a particular service to someone, that person then has only access to that the management UI in Central Administration for that particular service.

    Access security: specified claims principals have access to a service application. By default the "farm claim" has access, but this can be removed ad more detailed claims can be configured for more granular access rights, or example read versus read-write.

    Service applications can spawn their own timer jobs.

    Generally ISV's will build service applications on the SharePoint Service Application Framework, but for large organizations it could be interesting for SI's to create services to specialized functionality and farm-to-farm fedaration .

    For repeatable configuration over your DTAP configuration, use PowerShell to create and manage the services.

    You can create complex farm configurations where farms can share service applications. For example: two farms can share the user profile service.

  • SharePoint 2010: Client side JavaScript Object Model Library written in Script#?

    Note: this blog post is based on experiences with the SharePoint 2010 Technical Preview version.

    SharePoint 2010 now extends the object model to the client. A remote object model proxy is available for C# development (including Silverlight) and a Javascript client library which can be found at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SP.js, accessible at /_layouts/SP.js.

    I tried to understand what happens in the Javascript code, did some document formatting on it to get it readable. But not really a Javascript wizard myself I didn't really got the hang on it. But when I scrolled to the end of the SP.js file I found the following lines:

    // ---- Do not remove this footer ----
    // Generated using Script# v0.5.0.0 (
    // -----------------------------------

    Now I understand why some of the code is not that readable: it is generated code. Script# is used for creating the client side object model API!

    Have a look at for more info on Script#.

    I never dared to use Script# i a real project going into production, especially because the last version came out in August 2008. But Microsoft does not seem to have a problem with it. The Microsoft team is even running an older version that available for download (version

    As far as I know the Office Web Applications (online Word, Access and PowerPoint) are written with Script# as well. See So maybe it is time now to really dive into Script#! Anyone dare to it for production code in their projects already? 

    Disclaimer: All information in this blog post is based on my personal interpretation of information collected at the SharePoint Conference 2009 and experiences with SharePoint 2010 Technical Preview version provided to my company in the PEP program.

  • SharePoint 2010: Site exporting as WSP solution (Part 1)

    Note: this blog post is based onexperiences with the SharePoint 2010 Technical Preview version.

    In the good old days of SharePoint 2003 and 2007 it was possible to save a site as a template. These sites were saved as .stp files, I assume this acronym stands for SiteTemPlate, a non-documented closed format that did not allow for modification in the saved template files. so new sites could be created based on the template. SharePoint 2010 promises the possibility to save a site as a WSP package, the Windows SharePoint Services Package format that we all love in the development of our SharePoint solutions, because it promises seamless deployments through the farm.

    In this series of blog posts I will investigate the power of this new functionality, and take you, the reader, along the way in trying to answer the following questions that directly pop up into my mind:

    • Is the site really exported as a WSP? And how does it look like at the inside?
    • If we create a new site based on the template, do changes to content types at the site collection level propagate to the content types in the new instance of the site template?
    • In Moss2007 it was not possible to export a publishing site as a site template. Well, actually you could, but it was not supported. Probably because pages and content a site publishing site depends on, like master pages, pages layouts, the style library and site collection images are managed at the site collection level (in the root site of the site collection). Did this change in 2010, and how is it handled?
    • What is exported. The complete configuration of the site, or only changes to the site with respect to the initial site definition?
    • Can we learn some new stuff on authoring WSP’s from the generated WSP’s?
    • Visual Studio SharePoint Support has a project type “Import SharePoint Solution Package”, what does that do? Can we use the WSP generated by a saved site template?

    Ok, let get started. The first steps to execute are:

    • Create a site based on the blank site definition
    • Export the site

    To showcase some of the new tools in the mean time I will use SharePoint Designer to create our new site:

    1. Connect to the portal, and select the Subsites tab
    2. Create a new site named wspexport based on the Blank Site template
    3. This brings us a blank site:
      To inspect some of the export functionality we create a custom list MyList with a Title and Description field, and a document library MyDocuments. We put some entries in the custom list and add a document to the document library. I assume that everyone knowing something about SharePoint knows how to do this.

      Adding a simple Dummy.txt document to the document library:

      The home page after adding list view web parts for the MyDocuments and MyList:
    4. We go back to SharePoint Designer, set the site Title and Description of the site and save as template
    5. Selecting Save as template brings you to the web site where you can specify the template site settings

      When save as template is done we get to the following screen:
    6. Following the user solution gallery will bring us to the Solution Gallery. This is a location where solutions can be uploaded and downloaded. These solutions can probably be solutions that can include code that will be run in a sandbox. More on this in an upcomming blog post.
    7. Right-click on the WspExportSite and select Save Target As… to save the WSP file to your location of choice.
    8. Note that the saved solution can be activated by selecting the arrow next to its name

    This concludes the first post in this series. What do we have:

    • A WSP file on disk based on Blank Site containing a list and a document library
    • A solution in our solution gallery ready to be activated

    Disclaimer: All information in this blog post is based on my personal interpretation of information collected at the SharePoint Conference 2009 and experiences with SharePoint 2010 Technical Preview version provided to my company in the PEP program.

  • SharePoint 2010: Getting Publishing template working

    Note: this post is only relevant for people running the SharePoint 2010 Technology Preview.

    When I create a new site based on the Publishing Portal template you get a .../Pages/Default.aspx page with an error on it. The error seems to be generated by a ContentByQuery web part (the only web part) on the page. Add ?contents=1 to the url (…/Pages/Default.aspx?contents=1):


    Check Out the page, remove the web part (Delete, not Close), and your page starts working again.

    Happy Publishing!


    Disclaimer: All information in this blog post is based on my personal interpretation of information collected at the SharePoint Conference 2009 and experiences with SharePoint 2010 Technical Preview version provided to my company in the PEP program.