<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Vesa &amp;quot;vesku&amp;quot; Juvonen</title><subtitle type="html">&amp;quot;Circumstances may cause interruptions and delays, but never lose sight of your goal.&amp;quot;</subtitle><id>http://blogs.msdn.com/b/vesku/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/vesku/atom.aspx" /><generator uri="http://telligent.com" version="5.6.583.17018">Telligent Community 5.6.583.17018 (Build: 5.6.583.17018)</generator><updated>2007-11-11T19:33:14Z</updated><entry><title>WebTemplate training materials – Lab 4 - Upgrading existing sites with feature versioning</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-4-upgrading-existing-sites-with-feature-versioning.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-4-upgrading-existing-sites-with-feature-versioning.aspx</id><published>2011-07-29T15:11:41Z</published><updated>2011-07-29T15:11:41Z</updated><content type="html">&lt;p&gt;This post is lab 4 from series of training materials for WebTemplate creation and maintenance. Please check the following posts for details and other exercises. Notice that you can download full package with all required lab material from link available in &lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-introduction-to-reusable-labs.aspx"&gt;introduction post&lt;/a&gt;. This package contains all supplementary materials and labs in word format.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-introduction-to-reusable-labs.aspx"&gt;WebTemplate training materials – Introduction to material&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-1-creation-of-features-and-basic-structures.aspx"&gt;WebTemplate training materials – Lab 1 - Creation of features and basic structures&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-2-creation-of-custom-navigation-control-and-master-pages.aspx"&gt;WebTemplate training materials – Lab 2 - Creation of custom navigation control and master pages&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-3-creation-of-webtemplate-for-wcm-site.aspx"&gt;WebTemplate training materials – Lab 3 - Creation of WebTemplate for WCM site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;em&gt;WebTemplate training materials – Lab 4 - Upgrading existing sites with feature versioning&lt;/em&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This particular post will concentrate on following functionalities.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Creating application page to site settings to manage feature versions &lt;/li&gt;    &lt;li&gt;Creating feature upgrade definitions for the existing features to update existing sites &lt;/li&gt; &lt;/ul&gt;  &lt;br /&gt;  &lt;hr /&gt;  &lt;br /&gt;  &lt;h1&gt;Lab 04 – Life cycle management for WebTemplate created publishing sites&lt;/h1&gt;  &lt;p&gt;The project files for this lab are in the ‘C:\Student\Labs\04_Lifecycle’&lt;em&gt; &lt;/em&gt;folder &lt;/p&gt;  &lt;h4&gt;Lab Objective&lt;/h4&gt;  &lt;p&gt;&lt;b&gt;Lab Overview&lt;/b&gt;: In this lab you will update existing sites using feature upgrade definition.&lt;/p&gt;  &lt;h4&gt;Additional Resources&lt;/h4&gt;  &lt;p&gt;This lab includes the following additional resources:    &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Starter Files&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="285"&gt;           &lt;p&gt;C:\Student\Labs\04_Lifecycle\StarterFiles&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Files that can be used to help complete the labs.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Source Code&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="285"&gt;           &lt;p&gt;C:\Student\Labs\04_Lifecycle\Solution&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Completed lab source code after this exercise&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Solution structure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="285"&gt;           &lt;p&gt;C:\Student\Labs\Contoso.Intranet\&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Solution structure started in previous exercise.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;h4&gt;Getting Started&lt;/h4&gt;  &lt;p&gt;Notice that all code and xml elements which are meant to be copied are available as text in the Word documents. This means that if you need to copy any of those elements, it’s better to use Word document formats of these labs.&lt;/p&gt;  &lt;p&gt;This Hands-On Lab contains a number of additional resources in fixed locations. By default, it is assumed that the base HOL directory is C:\Student and that the labs and additional resources are located under this directory.&lt;/p&gt;  &lt;p&gt;The default working folder for this lab is &lt;i&gt;‘&lt;b&gt;C:\Student\Labs\04_Lifecycle&lt;/b&gt;’&lt;/i&gt;.&lt;/p&gt;  &lt;p&gt;Please notice that this exercise is assuming that you have environment with url &lt;strong&gt;http://intranet.contoso.com&lt;/strong&gt; in your usage. If you use some alternative url, you’ll have to update scripts and use correct entries in exercises to make exercise to work properly.&lt;/p&gt;  &lt;h4&gt;Lab Setup Instructions&lt;/h4&gt;  &lt;p&gt;In the lab setup you will execute a PowerShell script that will create a new SharePoint site collection.&lt;/p&gt;  &lt;p&gt;1. Start the Virtual Machine in Hyper-V.&lt;/p&gt;  &lt;p&gt;2. Log on to the Virtual Machine as the local administrator with a user name of &lt;em&gt;&lt;b&gt;Contoso\Administrator&lt;/b&gt;&lt;/em&gt; and a password of &lt;em&gt;&lt;b&gt;pass@word1&lt;/b&gt;&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;3. Open Windows Explorer and browse to the location &lt;b&gt;C:\Student\Labs\Contoso.Intranet&lt;/b&gt;, in the folder double click &lt;b&gt;Contoso.Intranet.sln&lt;/b&gt; to start the previously created solution structure. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This step assumes that you have already created lab 1, 2 &amp;amp; 3 based on the lab guidance’s, so that we can continue building up the customization package. &lt;/li&gt;    &lt;li&gt;Notice also that package contains full source code status after lab 3 in folder C:\StudentWebTemplate\Labs\03_WCM\Solution\Contoso.Intranet - Lab 3 which you can copy as your starting point if you want to skip previous labs completely. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Exercise 1 – Creating upgrade application page&lt;/h2&gt;  &lt;p&gt;In this exercise we will create simple application page to list features, which could be upgraded. This exercise will familiarize you to feature framework object model and how we can use that for upgrading features granularly. Notice that depending on the actual deployment, you might actually want to upgrade your features using PowerShell, not by adding this kind of additional application page to site settings page also to avoid accidental upgrades by other end users.&lt;/p&gt;  &lt;h4&gt;Task 1 – Adding custom application page to solution&lt;/h4&gt;  &lt;p&gt;1. Expand &lt;b&gt;Layouts&lt;/b&gt; folder in the Solution Explorer&lt;/p&gt;  &lt;p&gt;2. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; folder and choose &lt;b&gt;Add – New Item…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Choose &lt;b&gt;Application Page&lt;/b&gt; template and name it as &lt;b&gt;UpgradePage.aspx&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4062.clip_5F00_image002_5F00_509C5B87.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3157.clip_5F00_image002_5F00_thumb_5F00_67E75FF8.jpg" width="443" height="308" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. Click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;5. Locate &lt;b&gt;ContentPlaceHolder&lt;/b&gt; with the Id &lt;b&gt;PlaceHolderMain&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;6. Update place holder as in the following code snipped to include two different tables&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0434.image_5F00_1EE13E32.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5125.image_5F00_thumb_5F00_12731B09.png" width="522" height="99" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. &lt;b&gt;Save&lt;/b&gt; changes&lt;/p&gt;  &lt;p&gt;8. Open &lt;b&gt;Upgradepage.aspx.cs&lt;/b&gt; file under the aspx file&lt;/p&gt;  &lt;p&gt;9. Add following using statements&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0250.image_5F00_6268C987.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6281.image_5F00_thumb_5F00_215A4A23.png" width="293" height="47" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Add override for &lt;b&gt;CreateChildIControls&lt;/b&gt; method as follows below the &lt;b&gt;Page_Load&lt;/b&gt; method · Notice that we use &lt;b&gt;QueryFeatures&lt;/b&gt; method to query features which can be upgraded&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7367.image_5F00_1FA97E4F.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2480.image_5F00_thumb_5F00_5DC29900.png" width="506" height="320" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;11. Add following &lt;b&gt;DisplayFeature&lt;/b&gt; method below the &lt;b&gt;CreateChildControls&lt;/b&gt; method&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3542.image_5F00_2CDFE195.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6607.image_5F00_thumb_5F00_2AC2E2CC.png" width="506" height="594" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;12. Add &lt;b&gt;btnUpgrade_Click&lt;/b&gt; event handler below &lt;b&gt;DisplayFeature&lt;/b&gt; method&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4532.image_5F00_672B31A9.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1411.image_5F00_thumb_5F00_2CCFBBC8.png" width="519" height="122" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;13. Right click the &lt;b&gt;SPIs&lt;/b&gt; folder in the solution explorer and choose &lt;b&gt;Add – New Folder&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;14. Name folder as &lt;b&gt;CustomActions&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;15. Right click &lt;b&gt;CustomActions&lt;/b&gt; folder and choose &lt;b&gt;Add – New&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;16. Choose &lt;b&gt;Empty&lt;/b&gt; template and name it as &lt;b&gt;FeatureUpgradeSiteSettings &lt;/b&gt;and click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;17. Update the &lt;b&gt;Elements.xml&lt;/b&gt; file for the custom action as follows&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6607.image_5F00_3FA43F72.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6685.image_5F00_thumb_5F00_2FB4FAAE.png" width="536" height="279" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;18. Update feature association for the just added custom action &lt;b&gt;FeatureUpgradeSiteSettings&lt;/b&gt; so that it’s activated in the &lt;b&gt;SiteMainResources&lt;/b&gt; feature&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6278.clip_5F00_image003_5F00_3A91DBF6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0827.clip_5F00_image003_5F00_thumb_5F00_440A9A6C.png" width="400" height="352" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;19. Open &lt;b&gt;SiteMainResources&lt;/b&gt; feature and use properties window to set the version to 1.0.0.0&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3058.clip_5F00_image005_5F00_418168AE.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7245.clip_5F00_image005_5F00_thumb_5F00_0D009666.jpg" width="405" height="452" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;20. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; and choose &lt;b&gt;Deploy&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;21. Move to address &lt;b&gt;http://intranet.contoso.com&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;22. Move the &lt;b&gt;Site Settings&lt;/b&gt; from the &lt;b&gt;Site Actions&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;23. Click &lt;b&gt;Site collection features&lt;/b&gt; under the &lt;b&gt;Site Collection Administration&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;24. Activate &lt;b&gt;Contoso.Intranet Site Main Resources&lt;/b&gt; feature&lt;/p&gt;  &lt;p&gt;25. Move back to &lt;b&gt;Site Settings&lt;/b&gt; page and ensure that the &lt;b&gt;Site Collection Feature Upgrade&lt;/b&gt; link is present under the &lt;b&gt;Contoso Configuration&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2465.clip_5F00_image007_5F00_3864B760.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image007" border="0" alt="clip_image007" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3630.clip_5F00_image007_5F00_thumb_5F00_4ED755E7.jpg" width="508" height="361" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;26. Click &lt;b&gt;Site Collection Feature Upgrade&lt;/b&gt; link is present under the &lt;b&gt;Contoso Configuration&lt;/b&gt; to ensure that code is working properly&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Page should list all activated features in site collection scope and their version &lt;/li&gt;    &lt;li&gt;Notice that look and feel depends on which master page has been enabled for the system pages. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5102.clip_5F00_image009_5F00_73886D5E.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image009" border="0" alt="clip_image009" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2475.clip_5F00_image009_5F00_thumb_5F00_35ABD5E2.jpg" width="425" height="197" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;Task 2 – Updating features and content types&lt;/h4&gt;  &lt;p&gt;1. Move back to &lt;b&gt;Visual Studio&lt;/b&gt; side&lt;/p&gt;  &lt;p&gt;2. Expand &lt;b&gt;SPIs&lt;/b&gt; folder, right click &lt;b&gt;SiteColumns&lt;/b&gt; and choose &lt;b&gt;Add – New Item&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Choose &lt;b&gt;Empty Element&lt;/b&gt; and name it as &lt;b&gt;v2Fields&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0081.clip_5F00_image011_5F00_48EC8C81.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image011" border="0" alt="clip_image011" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2553.clip_5F00_image011_5F00_thumb_5F00_4DEECA30.jpg" width="425" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. Update the Elements.xml as in the following code snipped&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3146.image_5F00_101232B4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0486.image_5F00_thumb_5F00_5C69C655.png" width="466" height="210" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. &lt;b&gt;Save&lt;/b&gt; changes&lt;/p&gt;  &lt;p&gt;6. Expand &lt;b&gt;Features&lt;/b&gt; node and open up &lt;b&gt;Contoso.Intranet Site Main Resources&lt;/b&gt; feature&lt;/p&gt;  &lt;p&gt;7. Associate the &lt;b&gt;v2Fields&lt;/b&gt; to &lt;b&gt;Contoso.Intranet Site Main Resources&lt;/b&gt; feature. You can use &lt;b&gt;packaging explorer&lt;/b&gt; to ensure the current associations. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This is done for new site collections, so that now added field is added automatically when new sites are created. Steps to modify existing sites will follow up later in this exercise. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4604.clip_5F00_image012_5F00_79FBA154.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image012" border="0" alt="clip_image012" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5277.clip_5F00_image012_5F00_thumb_5F00_5F4F053B.png" width="379" height="342" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;8. Expand &lt;b&gt;SPIs&lt;/b&gt; folder and &lt;b&gt;ContentTypes&lt;/b&gt; folder in the solution explorer&lt;/p&gt;  &lt;p&gt;9. Open &lt;b&gt;Contract&lt;/b&gt; content type &lt;b&gt;element.xml&lt;/b&gt; file and update the file to have the new site column referenced&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This update applies for new content types and to existing sites &lt;/li&gt;    &lt;li&gt;Notice that you shouldn’t just copy paste below entry, since &lt;b&gt;Contract&lt;/b&gt; content type identifier depends on environment. In this step we just add the row with &lt;b&gt;AdditionalDetails&lt;/b&gt; &lt;b&gt;FieldRef&lt;/b&gt; entry &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7331.image_5F00_15DCB080.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6747.image_5F00_thumb_5F00_2D27B4F1.png" width="502" height="201" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Open &lt;b&gt;Page&lt;/b&gt; content type &lt;b&gt;element.xml&lt;/b&gt; file and update content type to have the new site column referenced&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This update applies for new content types and to existing sites. Notice that since we update the Page content type, also the Event content type will be updated since it inherits this content type &lt;/li&gt;    &lt;li&gt;Notice that we only update the line with &lt;b&gt;AdditionalDetails&lt;/b&gt; &lt;b&gt;FieldRef&lt;/b&gt; entry, not the whole xml file &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6735.image_5F00_78A6E2A8.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3108.image_5F00_thumb_5F00_76F616D4.png" width="510" height="190" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;11. Expand the &lt;b&gt;SiteMainResources&lt;/b&gt; feature node and open up &lt;b&gt;SiteMainResources.Template.xml&lt;/b&gt; file by double clicking it&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2133.clip_5F00_image013_5F00_0D68B55C.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image013" border="0" alt="clip_image013" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7713.clip_5F00_image013_5F00_thumb_5F00_3A116F35.png" width="370" height="208" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;12. Update the template file as follows, so that there’s few upgrade actions to perform, when we upgrade from previous version to newer one&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6735.image_5F00_30D533F4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4572.image_5F00_thumb_5F00_67CF122D.png" width="484" height="320" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;13. Update &lt;b&gt;[PageID]&lt;/b&gt; and &lt;b&gt;[CONTRACTID]&lt;/b&gt; stamps in the just copied xml element with the proper identifiers. You can locate the ID’s from the following locations. These refer to unique identifiers of the content types in following files:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;[PageID] – &lt;b&gt;SPIs&lt;/b&gt; – &lt;b&gt;ContentTypes&lt;/b&gt; – &lt;b&gt;Page&lt;/b&gt; – &lt;b&gt;Elements.xml&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;[CONTRACTID] – &lt;b&gt;SPIs&lt;/b&gt; – &lt;b&gt;ContentTypes&lt;/b&gt; – &lt;b&gt;Contract&lt;/b&gt; – &lt;b&gt;Elements.xml&lt;/b&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7416.clip_5F00_image014_5F00_79CB2FED.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4760.clip_5F00_image014_5F00_thumb_5F00_319D7411.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;More on feature upgrade options and techniques&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;You can find more information on the feature upgrade options and techniques from Internet. In this case we used ApplyElementManifest first to introduce new field to site collection. After that we update the existing sites by using AddContentTypeField element. As a final element we use CustomUpgradeAction element to which we write the required code in following steps.&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;14. Since we will manipulate Publishign object model, we’ll need to add reference to &lt;b&gt;Microsoft.SharePoint.Pulbishing.dll&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;15. Right click &lt;b&gt;References&lt;/b&gt; in the &lt;b&gt;Contoso.Intranet&lt;/b&gt; project and choose &lt;b&gt;Add Reference…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1055.clip_5F00_image015_5F00_696FB834.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image015" border="0" alt="clip_image015" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3583.clip_5F00_image015_5F00_thumb_5F00_0126EF9B.png" width="376" height="174" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;16. Move to &lt;b&gt;Browse&lt;/b&gt; tab and move to folder &lt;b&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;17. Select &lt;b&gt;Microsoft.SharePoint.Publishing.dll&lt;/b&gt; and click &lt;b&gt;OK&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;18. Open &lt;b&gt;SiteMainResources.EventReceiver.cs&lt;/b&gt; to see the content of the feature receiver&lt;/p&gt;  &lt;p&gt;19. Add following using statements to file&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7220.image_5F00_73E06687.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7801.image_5F00_thumb_5F00_6BE8C425.png" width="373" height="70" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;20. Add following override for &lt;strong&gt;FeatureUpgrading&lt;/strong&gt; below &lt;b&gt;FeatureDeactivating &lt;/b&gt;method&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6646.image_5F00_74F54FA6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2117.image_5F00_thumb_5F00_4793B9D6.png" width="560" height="477" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;21. Open &lt;b&gt;Contoso.Intranet Site Main Resources&lt;/b&gt; feature in designer and use properties window to set the version to &lt;b&gt;2.0.0.0&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2133.clip_5F00_image017_5F00_5D2DF273.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image017" border="0" alt="clip_image017" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8473.clip_5F00_image017_5F00_thumb_5F00_41A8F070.jpg" width="374" height="377" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;22. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; and choose &lt;b&gt;Build&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;23. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; and choose &lt;b&gt;Package&lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Note. &lt;b&gt;DO NOT DEPLOY PACKAGE DIRECTLY FROM VISUAL STUDIO&lt;/b&gt;, since we will imitate production upgrades in following steps and if you use Visual Studio, your upgrade option is not available since Visual Studio will “try to help you” and it reinstalls features using activate/deactive commands, which doesn’t happen in actual production deployments. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;24. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; and choose &lt;b&gt;Open Folder in File Explorer&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;25. Move to &lt;b&gt;bin&lt;/b&gt; – &lt;b&gt;debug&lt;/b&gt; sub folder and verify that you have compiled successful &lt;b&gt;Contoso.Intranet.wsp&lt;/b&gt; file, which is the actual solution package to be deployed&lt;/p&gt;  &lt;p&gt;26. Copy current path to clip board, since we need to use that in PowerShell. If you are using defined guidance, path is following - &lt;b&gt;C:\StudentWebTemplate\Labs\Contoso.Intranet\Contoso.Intranet\bin\Debug&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;27. Open &lt;b&gt;SharePoint 2010 Management Shell&lt;/b&gt; from &lt;b&gt;Start | All Programs | Microsoft SharePoint 2010 Products&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;28. Run following command in the PowerShell window&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Notice that path depends on your solution structure location &lt;/li&gt; &lt;/ul&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="576"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="574"&gt;&lt;font size="2"&gt;&lt;em&gt;             &lt;br /&gt;              &lt;br /&gt;Update-SPSolution -Identity contoso.intranet.wsp -LiteralPath &amp;quot;C:\Student\Labs\Contoso.Intranet\Contoso.Intranet\bin\Debug\Contoso.Intranet.wsp&amp;quot; –GACDeployment               &lt;br /&gt;              &lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7713.clip_5F00_image0141_5F00_463EFB2A.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image014[1]" border="0" alt="clip_image014[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8880.clip_5F00_image0141_5F00_thumb_5F00_7E113F4D.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Upgrade or Re-deploy&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;In this case we used Update-SPSolution cmdlet, but you could also do retract and deploy commands in PowerShell script. Difference is that when we use update command, none of the feature installed or uninstalled methods are executed, but if you have added features to your package, those don’t get installed either.&lt;/i&gt;&lt;/p&gt;            &lt;p&gt;&lt;i&gt;If you use retract – deploy method, feature installed and unistalled commands will be executed and possible new features are automatically installed. Key point to notice though that both options don’t activate or deactivate features in the sites, like Visual Studio does. This is critical difference between development and production environment deployments.&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;29. Run command “&lt;b&gt;iisreset&lt;/b&gt;” in the PowerShell to ensure that updated xml files will be loaded to memory&lt;/p&gt;  &lt;p&gt;30. Open Internet Explorer and browse to site &lt;b&gt;http://intranet.contoso.com&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;31. Make sure that front page has not been checked out – you can publish it manually before moving forward&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This is just due the code for the feature receiver, which doesn’t have exception handling if the page has been checked out. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;32. Move to &lt;b&gt;Site Settings&lt;/b&gt; page from the &lt;b&gt;Site Actions&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;33. Click &lt;b&gt;Site Collection Feature Upgrade&lt;/b&gt; link under &lt;b&gt;Contoso Configuration&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;34. Notice that the &lt;b&gt;Contoso.Intranet Site Main Resources&lt;/b&gt; feature is listed here as possibility to upgrade&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1512.clip_5F00_image019_5F00_15C876B4.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image019" border="0" alt="clip_image019" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8865.clip_5F00_image019_5F00_thumb_5F00_4198CAA3.jpg" width="494" height="286" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;35. Click &lt;b&gt;Upgrade&lt;/b&gt; button&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This will execute the FeatureUpgrading event definitions (code and xml based configurations) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;36. Refresh page by pressing [F5] and verify that feature is not anymore listed to be upgrade&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1512.clip_5F00_image021_5F00_58779C1F.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image021" border="0" alt="clip_image021" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6215.clip_5F00_image021_5F00_thumb_5F00_2F8C8716.jpg" width="497" height="208" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;37. Move back to &lt;b&gt;Site Settings&lt;/b&gt; page&lt;/p&gt;  &lt;p&gt;38. Move to &lt;b&gt;Site Content Types&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;39. Click &lt;b&gt;Contoso.Intranet – Contract&lt;/b&gt; and ensure that &lt;b&gt;Additional details&lt;/b&gt; fields has been added to content type&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6708.clip_5F00_image023_5F00_5BC90DFA.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image023" border="0" alt="clip_image023" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4667.clip_5F00_image023_5F00_thumb_5F00_132F1F29.jpg" width="464" height="98" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;40. Move back to front page of the site and verify that web part was successfully added to the page&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2021.clip_5F00_image025_5F00_1CA7DD9F.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image025" border="0" alt="clip_image025" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3250.clip_5F00_image025_5F00_thumb_5F00_68933E4B.jpg" width="370" height="198" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1513.clip_5F00_image0142_5F00_3FA82942.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image014[2]" border="0" alt="clip_image014[2]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0842.clip_5F00_image0142_5F00_thumb_5F00_777A6D65.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Upgrading features without custom application page&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;In this exercise we created custom application page to update feature. Depending on environment, PowerShell is much more convenient so that you have full control when upgrade is executed and nobody will upgrade features accidently just from the browser user interface.&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;hr /&gt;  &lt;br /&gt;&lt;em&gt;If you find any issues on the lab, please add comments below, so that we are able to fix them as fast as possible. You can also suggest any enhancements for the lab, but due other on-going projects, I can’t promise to have time to include them. Thanks for your comments and feedback advance.&lt;/em&gt;   &lt;p&gt;&lt;em&gt;- Vesku&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10191133" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="C#" scheme="http://blogs.msdn.com/b/vesku/archive/tags/C_2300_/" /><category term="Web Content Management" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Web+Content+Management/" /><category term="onet.xml" scheme="http://blogs.msdn.com/b/vesku/archive/tags/onet-xml/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /><category term="WebTemplate" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WebTemplate/" /></entry><entry><title>WebTemplate training materials - Lab 3 - Creation of WebTemplate for WCM site</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-3-creation-of-webtemplate-for-wcm-site.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-3-creation-of-webtemplate-for-wcm-site.aspx</id><published>2011-07-29T15:08:39Z</published><updated>2011-07-29T15:08:39Z</updated><content type="html">&lt;p&gt;This post is lab 3 from series of training materials for WebTemplate creation and maintenance. Please check the following posts for details and other exercises. Notice that you can download full package with all required lab material from link available in &lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-introduction-to-reusable-labs.aspx"&gt;introduction post&lt;/a&gt;. This package contains all supplementary materials and labs in word format.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-introduction-to-reusable-labs.aspx"&gt;WebTemplate training materials – Introduction to material&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-1-creation-of-features-and-basic-structures.aspx"&gt;WebTemplate training materials – Lab 1 - Creation of features and basic structures&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-2-creation-of-custom-navigation-control-and-master-pages.aspx"&gt;WebTemplate training materials – Lab 2 - Creation of custom navigation control and master pages&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;em&gt;WebTemplate training materials – Lab 3 - Creation of WebTemplate for WCM site &lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-4-upgrading-existing-sites-with-feature-versioning.aspx"&gt;WebTemplate training materials – Lab 4 - Upgrading existing sites with feature versioning&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This particular post will concentrate on following functionalities.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Creating WebTemplate for Event site &lt;/li&gt;    &lt;li&gt;Adding custom page layout which is used in WebTemplate to our solution &lt;/li&gt;    &lt;li&gt;Creating required features and associations to onet.xml files for the WebTemplate &lt;/li&gt; &lt;/ul&gt;  &lt;br /&gt;  &lt;hr /&gt;  &lt;br /&gt;  &lt;h1&gt;Lab 03 – &lt;/a&gt;WebTemplates and Page Layouts&lt;/h1&gt;  &lt;p&gt;The project files for this lab are in the ‘C:\Student\Labs\03_WCM’&lt;em&gt; &lt;/em&gt;folder &lt;/p&gt;  &lt;h4&gt;Lab Objective&lt;/h4&gt;  &lt;p&gt;&lt;b&gt;Lab Overview&lt;/b&gt;: In this lab you will create actual WebTemplate and add custom page layout for it to be used automatically when site is created based on it.&lt;/p&gt;  &lt;h4&gt;Additional Resources&lt;/h4&gt;  &lt;p&gt;This lab includes the following additional resources:    &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Starter Files&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="285"&gt;           &lt;p&gt;C:\Student\Labs\03_WCM\StarterFiles&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Files that can be used to help complete the labs.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Source Code&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="285"&gt;           &lt;p&gt;C:\Student\Labs\03_WCM\Solution&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Completed lab source code for the status after this lab&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Solution structure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="285"&gt;           &lt;p&gt;C:\Student\Labs\Contoso.Intranet\&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Solution structure started in previous exercise.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;h4&gt;Getting Started&lt;/h4&gt;  &lt;p&gt;Notice that all code and xml elements which are meant to be copied are available as text in the Word documents. This means that if you need to copy any of those elements, it’s better to use Word document formats of these labs.&lt;/p&gt;  &lt;p&gt;This Hands-On Lab contains a number of additional resources in fixed locations. By default, it is assumed that the base HOL directory is C:\Student and that the labs and additional resources are located under this directory.&lt;/p&gt;  &lt;p&gt;The default working folder for this lab is &lt;i&gt;‘&lt;b&gt;C:\Student\Labs\03_WCM&lt;/b&gt;’&lt;/i&gt;.&lt;/p&gt;  &lt;p&gt;Please notice that this exercise is assuming that you have environment with url &lt;strong&gt;http://intranet.contoso.com&lt;/strong&gt; in your usage. If you use some alternative url, you’ll have to update scripts and use correct entries in exercises to make exercise to work properly.&lt;/p&gt;  &lt;h4&gt;Lab Setup Instructions&lt;/h4&gt;  &lt;p&gt;In the lab setup you will execute a PowerShell script that will create a new SharePoint site collection.&lt;/p&gt;  &lt;p&gt;1. Start the Virtual Machine in Hyper-V.&lt;/p&gt;  &lt;p&gt;2. Log on to the Virtual Machine as the local administrator with a user name of &lt;em&gt;&lt;b&gt;Contoso\Administrator&lt;/b&gt;&lt;/em&gt; and a password of &lt;em&gt;&lt;b&gt;pass@word1&lt;/b&gt;&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;3. Open Windows Explorer and browse to the location &lt;b&gt;C:\Student\Labs\Contoso.Intranet&lt;/b&gt;, in the folder double click &lt;b&gt;Contoso.Intranet.sln&lt;/b&gt; to start the previously created solution structure. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This step assumes that you have already created lab 1 &amp;amp; 2 based on the lab guidance’s, so that we can continue building up the customization package. &lt;/li&gt;    &lt;li&gt;Notice also that package contains full source code status after lab 2 in folder C:\StudentWebTemplate\Labs\02_UI\Solution\Contoso.Intranet - Lab 2 which you can copy as your starting point if you want to skip previous labs completely. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Exercise 1 – Creating Event Page Layout&lt;/h2&gt;  &lt;p&gt;In this exercise we’ll create page layout for the event content type, which was created earlier. This way content editors can easily create new events, which have nice editing experience for setting up metadata.&lt;/p&gt;  &lt;h4&gt;Task 1 – Adding page layout module&lt;/h4&gt;  &lt;p&gt;1. Expand the &lt;b&gt;SPIs&lt;/b&gt; folder and &lt;b&gt;Modules&lt;/b&gt; folders located in &lt;b&gt;Contoso.Intranet&lt;/b&gt; project&lt;/p&gt;  &lt;p&gt;2. Right click &lt;b&gt;Modules&lt;/b&gt; and choose &lt;b&gt;Add – New Item…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Choose Module and name it as &lt;b&gt;EventPageLayout&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4621.clip_5F00_image002_5F00_32CBC100.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4212.clip_5F00_image002_5F00_thumb_5F00_7EB721AC.jpg" width="430" height="299" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. Click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;5. Select &lt;b&gt;Sample.txt&lt;/b&gt; under the &lt;b&gt;EventPageLayout&lt;/b&gt; module and &lt;b&gt;delete&lt;/b&gt; it&lt;/p&gt;  &lt;p&gt;6. Right click &lt;b&gt;EventPageLayout&lt;/b&gt; and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;Existing Item…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;7. Browse to folder &lt;b&gt;c:\Student\Labs\03_WCM\StarterFiles&lt;/b&gt; and choose &lt;b&gt;ContosoEventPage.aspx&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;8. Click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;9. Double click &lt;b&gt;ContosoEventPage.aspx&lt;/b&gt; in the solution explorer and review its content&lt;/p&gt;  &lt;p&gt;· This file defines the layout for individual event. Event fields have been associated to the page layout already&lt;/p&gt;  &lt;p&gt;10. Double click &lt;b&gt;Elements.xml&lt;/b&gt; file and update the content as in following code snipped&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3113.image_5F00_6EC7DCE8.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0676.image_5F00_thumb_5F00_3AB33D95.png" width="517" height="147" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1663.clip_5F00_image003_5F00_3F49484F.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3716.clip_5F00_image003_5F00_thumb_5F00_771B8C72.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Properties for File element in module provisioning&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;We are defining properties for the file to be uploaded. These are not SPFile or SPPageLayout properties, rather column values for the file, which will be available in document library. In this case we define few additional properties (Page Layout and PublishingAssociatedContentType) so that page layout is properly available for pages created in the portal. &lt;/i&gt;&lt;/p&gt;            &lt;p&gt;&lt;i&gt;Notice also the Url attribute for the Module. This defines target of the file to be provisioned. Since we are provisioning page layout, we’ll need to set the target to _catalogs/masterpage.&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;11. Expand SPIs and &lt;b&gt;ContentTypes&lt;/b&gt; folder in &lt;b&gt;Content.Intranet&lt;/b&gt; project&lt;/p&gt;  &lt;p&gt;12. Open &lt;b&gt;Elements.xml&lt;/b&gt; file located under &lt;b&gt;Event&lt;/b&gt; content type&lt;/p&gt;  &lt;p&gt;13. Copy the &lt;b&gt;ID&lt;/b&gt; of the content type to clip board – we’ll need to update this to page layout module&lt;/p&gt;  &lt;p&gt;14. Move back to &lt;b&gt;Elements.xml&lt;/b&gt; file located under the &lt;b&gt;EventPageLayout&lt;/b&gt; module&lt;/p&gt;  &lt;p&gt;15. Locate &lt;b&gt;&lt;i&gt;[ContentTypeId]&lt;/i&gt;&lt;/b&gt; string in the value of the &lt;b&gt;PublishingAssociatedContentType&lt;/b&gt; property&lt;/p&gt;  &lt;p&gt;16. Replace the tag with the just copied content type id of the event content type like in the following snipped - Since we’ll need to associate page layout to content type, we’ll need to ensure that the IDs will match. Notice that we’ll need to leave the hash and other chars in place. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Note. &lt;b&gt;Don’t&lt;/b&gt; directly copy identifier as below, since value depends on your environment &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8510.image_5F00_47E9A0DB.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6837.image_5F00_thumb_5F00_7B456437.png" width="588" height="109" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;17. &lt;b&gt;Save&lt;/b&gt; changes&lt;/p&gt;  &lt;p&gt;18. Expand &lt;b&gt;Features&lt;/b&gt; node in the project structure and open up &lt;b&gt;WebPublishingBinding &lt;/b&gt;feature in designer mode&lt;/p&gt;  &lt;p&gt;19. Remove all other SPIs from this feature than the &lt;b&gt;PublishingBinding, &lt;/b&gt;if&lt;b&gt; &lt;/b&gt;there’s&lt;b&gt; &lt;/b&gt;any other SPI’s&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5861.clip_5F00_image005_5F00_720928F6.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0574.clip_5F00_image005_5F00_thumb_5F00_6FEC2A2D.jpg" width="494" height="274" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;20. Open up &lt;b&gt;SiteMainResources&lt;/b&gt; feature and ensure that all other SPIs except the &lt;b&gt;PublishingBinding&lt;/b&gt; SPI is associated to it&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5270.clip_5F00_image007_5F00_6DCF2B64.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image007" border="0" alt="clip_image007" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5355.clip_5F00_image007_5F00_thumb_5F00_24C9099E.jpg" width="498" height="278" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;21. &lt;b&gt;Save&lt;/b&gt; changes&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;Task 2 – Testing page layout in the portal&lt;/h4&gt;  &lt;p&gt;1. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; project and choose &lt;b&gt;Deploy&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Ensure that deployment was successful from the output window&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8407.clip_5F00_image009_5F00_74BEB81C.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image009" border="0" alt="clip_image009" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8507.clip_5F00_image009_5F00_thumb_5F00_59A5E90E.jpg" width="494" height="110" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. Open up Internet Explorer and move to address &lt;b&gt;http://intranet.contoso.com &lt;/b&gt;· Depending on the master page currently defined on the portal, you might run into minor issues after deployment. If you’re unable to access the front page, perform following steps&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Move to address &lt;b&gt;http://intranet.contoso.com/_layouts/settings.aspx&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;Click &lt;b&gt;Master Page&lt;/b&gt; under &lt;b&gt;Look and Feel&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;Choose &lt;b&gt;v4.master&lt;/b&gt; for both of the master page types &lt;/li&gt;    &lt;li&gt;Click &lt;b&gt;OK&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;Move back to &lt;b&gt;Visual Studio&lt;/b&gt; and &lt;b&gt;redeploy&lt;/b&gt; you’re customizations &lt;/li&gt;    &lt;li&gt;Move back to &lt;b&gt;http://intranet.contoso.com &lt;/b&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;4. Move to &lt;b&gt;Site Settings&lt;/b&gt; from &lt;b&gt;Site Actions&lt;/b&gt; menu&lt;/p&gt;  &lt;p&gt;5. Click &lt;b&gt;Master Pages&lt;/b&gt; and page layouts under the &lt;b&gt;Galleries&lt;/b&gt; selection to ensure that &lt;b&gt;Event&lt;/b&gt; page layout was successfully deployed – &lt;b&gt;ContosoEventPage.aspx&lt;/b&gt; in the gallery&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4278.clip_5F00_image011_5F00_3E8D1A00.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image011" border="0" alt="clip_image011" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4760.clip_5F00_image011_5F00_thumb_5F00_23744AF2.jpg" width="476" height="260" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;6. Move back to &lt;b&gt;Site Settings&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;7. Click &lt;b&gt;Page Layouts&lt;/b&gt; and site templates under the &lt;b&gt;Look and Feel&lt;/b&gt; section&lt;/p&gt;  &lt;p&gt;8. Under the New Page Default Settings, select &lt;b&gt;Event Page layout&lt;/b&gt; to be the default page for new pages&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8407.clip_5F00_image013_5F00_1385062E.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image013" border="0" alt="clip_image013" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2211.clip_5F00_image013_5F00_thumb_5F00_31831422.jpg" width="469" height="252" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;9. Click &lt;b&gt;OK&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;10. Select &lt;b&gt;New Page&lt;/b&gt; from the Site Actions menu&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1638.clip_5F00_image015_5F00_166A4514.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image015" border="0" alt="clip_image015" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8463.clip_5F00_image015_5F00_thumb_5F00_4DD05642.jpg" width="258" height="292" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;11. Set name as &lt;b&gt;MyExampleEvent - &lt;/b&gt;Note. If you’re currently using the custom Contoso master page, it has minor issues with the popup rendering due missing popup style definitions. Don’t mind those.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3276.clip_5F00_image017_5F00_52D293F1.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image017" border="0" alt="clip_image017" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1145.clip_5F00_image017_5F00_thumb_5F00_062E574E.jpg" width="243" height="203" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;12. Click &lt;b&gt;Create&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;13. Notice the Event related fields on the page layout, like &lt;b&gt;Event Location&lt;/b&gt; and &lt;b&gt;Event Date &lt;/b&gt;· Now we have successfully deployed also our page layout to site collection&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6332.clip_5F00_image019_5F00_3D94687C.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image019" border="0" alt="clip_image019" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1122.clip_5F00_image019_5F00_thumb_5F00_4296A62B.jpg" width="413" height="273" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Exercise 2 – Creating WebTemplate&lt;/h3&gt;  &lt;p&gt;In this exercise we’ll create new farm scoped web template, which will be used to create Event site for Contoso Intranet. We’ll use some previously created xml files to make the exercise easier. Web&lt;/p&gt;  &lt;h4&gt;Task 1 – Creating SPI for the Event WebTemplate&lt;/h4&gt;  &lt;p&gt;In this task we’ll create SPI for the web template and define the new site creation instruction, which we can use in following steps to create event sites.&lt;/p&gt;  &lt;p&gt;1. Move to &lt;b&gt;Visual Studio&lt;/b&gt; side&lt;/p&gt;  &lt;p&gt;2. Expand &lt;b&gt;SPIs&lt;/b&gt; folder and create new sub folder called &lt;b&gt;WebTemplates&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Right click &lt;b&gt;WebTemplates&lt;/b&gt; folder and choose &lt;b&gt;Add – New Item&lt;/b&gt;…&lt;/p&gt;  &lt;p&gt;4. Choose &lt;b&gt;Empty Element&lt;/b&gt; and name it was &lt;b&gt;EventWebTemplate&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7571.clip_5F00_image021_5F00_19AB9122.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image021" border="0" alt="clip_image021" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2210.clip_5F00_image021_5F00_thumb_5F00_29D7591B.jpg" width="422" height="293" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Right click &lt;b&gt;EventWebTemplate&lt;/b&gt; SPI and choose add existing Item&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7573.clip_5F00_image023_5F00_47D5670F.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image023" border="0" alt="clip_image023" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8551.clip_5F00_image023_5F00_thumb_5F00_46249B3B.jpg" width="366" height="392" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;6. Browse to &lt;b&gt;c:\Student\Labs\03_WCM\StarterFiles&lt;/b&gt; and select &lt;b&gt;onet.xml&lt;/b&gt; file&lt;/p&gt;  &lt;p&gt;7. Click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;8. Activate &lt;b&gt;onet.xml&lt;/b&gt; file in &lt;b&gt;Solution Explorer&lt;/b&gt; and review the &lt;b&gt;Property&lt;/b&gt; &lt;b&gt;window&lt;/b&gt;. Notice that currently &lt;b&gt;Deployment Type&lt;/b&gt; is &lt;b&gt;NoDeployment&lt;/b&gt; – Update the property as &lt;b&gt;ElementFile&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7573.clip_5F00_image025_5F00_2B0BCC2D.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image025" border="0" alt="clip_image025" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4331.clip_5F00_image025_5F00_thumb_5F00_4909DA21.jpg" width="345" height="297" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;9. Double click &lt;b&gt;onet.xml &lt;/b&gt;file and review its content · Notice that there’s already definition to use the Contoso master as chrome master (&lt;b&gt;ChromeMasterUrl&lt;/b&gt; property) in one of the features and there’s also default page layout definition also in place (&lt;b&gt;DefaultPageLayout&lt;/b&gt; property).&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5327.clip_5F00_image0031_5F00_46ECDB58.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image003[1]" border="0" alt="clip_image003[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1033.clip_5F00_image0031_5F00_thumb_5F00_7EBF1F7B.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Site definitions vs. WebTemplate element usage&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;If you’re familiar with Site Definitions from the 2007 version, this should seem familiar as well. Key difference is between site definitions and web template is the flexibility of the web templates in sense of customization updates and technically web templates don’t support definition of modules in the onet.xml. We can however provision modules for the site using associated features. This is done in the following task.&lt;/i&gt;&lt;/p&gt;            &lt;p&gt;&lt;em&gt;Check more concerning differences and usage models from my previous &lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/22/site-definitions-vs-web-templates.aspx"&gt;blog post&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;10. Open &lt;b&gt;Elements.xml&lt;/b&gt; file under the &lt;b&gt;EventWebTemplate&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;11. Update the content as in the following snipped&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Notice that since our WebTemplate is publishing template, we will use out of the box publishing template as the base template for future upgradability purposes (helps to movement to o15) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3264.image_5F00_647EB657.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5305.image_5F00_thumb_5F00_30D649F9.png" width="458" height="193" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;12. We’ll need to still modify the provisioning model of the &lt;b&gt;WebTemplate&lt;/b&gt;. Right the &lt;b&gt;Features&lt;/b&gt; node in the &lt;b&gt;Contoso.Intranet&lt;/b&gt; project and choose &lt;b&gt;Add&lt;/b&gt; &lt;b&gt;Feature&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;13. Rename just created feature as &lt;b&gt;FarmEventWebTemplate &lt;/b&gt;· In this case we deploy our Web Template to be available farm wide. You can also deploy WebTemplates using site collection scoped feature.&lt;/p&gt;  &lt;p&gt;14. Open up &lt;b&gt;feature designer &lt;/b&gt;(if not open, double click just created feature) and set initial properties as follows&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Title – &lt;b&gt;Contoso.Intranet Farm Event Web Template&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;Description – &lt;b&gt;Deploys new event web template to be available in farm&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;Scope - &lt;b&gt;Farm&lt;/b&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;15. Associate &lt;b&gt;EventWebTemplate&lt;/b&gt; to feature&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5808.clip_5F00_image027_5F00_3976A285.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image027" border="0" alt="clip_image027" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7484.clip_5F00_image027_5F00_thumb_5F00_50557401.jpg" width="404" height="201" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;16. Open up &lt;b&gt;WebPublishingBinding &lt;/b&gt;feature and ensure that &lt;b&gt;EventWebTemplate&lt;/b&gt; SPI is not associated to it or to &lt;b&gt;SiteMainResources&lt;/b&gt; feature&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5482.clip_5F00_image029_5F00_6329F7AB.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image029" border="0" alt="clip_image029" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6888.clip_5F00_image029_5F00_thumb_5F00_40F1EC25.jpg" width="402" height="178" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;17. &lt;b&gt;Save&lt;/b&gt; changes&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;Task 2 – Creating default feature and welcome page for the web template&lt;/h4&gt;  &lt;p&gt;In this task we’ll create default feature for the Event web template, which is responsible of deploying the default.aspx page for the site.&lt;/p&gt;  &lt;p&gt;1. Right click Features node and choose &lt;b&gt;Add Feature&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Rename feature as &lt;b&gt;WebEventWebTemplateDefault&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Set properties of the feature as following&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Title – &lt;b&gt;Contoso.Intranet Web Event Web Template Default resources&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;Description &lt;b&gt;– Default provisioner for the Event web template&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;Scope – &lt;b&gt;Web&lt;/b&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5482.clip_5F00_image031_5F00_2CF8598F.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image031" border="0" alt="clip_image031" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4722.clip_5F00_image031_5F00_thumb_5F00_15E9D853.jpg" width="436" height="189" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. Expand the &lt;b&gt;SPIs&lt;/b&gt; and &lt;b&gt;Modules&lt;/b&gt; folders&lt;/p&gt;  &lt;p&gt;5. Right click Modules and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;New Item&lt;/b&gt;…&lt;/p&gt;  &lt;p&gt;6. Select &lt;b&gt;module&lt;/b&gt; SPI type and name it as &lt;b&gt;EventWebTemplateDefaults&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;7. Delete &lt;b&gt;Sample.txt&lt;/b&gt; under the &lt;b&gt;EventWebTemplateDefaults&lt;/b&gt; module&lt;/p&gt;  &lt;p&gt;8. Right click &lt;b&gt;EventWebTemplateDefaults&lt;/b&gt; and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;Existing Item…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;9. Browse to &lt;b&gt;c:\Student\Labs\03_WCM\StarterFiles&lt;/b&gt; and choose &lt;b&gt;default.aspx&lt;/b&gt; and &lt;b&gt;event1.aspx&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;10. Click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6567.clip_5F00_image032_5F00_68F47577.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image032" border="0" alt="clip_image032" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2766.clip_5F00_image032_5F00_thumb_5F00_27E5F613.png" width="286" height="150" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;11. Open &lt;b&gt;Elements.xml&lt;/b&gt; file located under the &lt;b&gt;EventWebTemplateDefaults&lt;/b&gt; and update the xml as in the following snipped&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2251.image_5F00_25C8F74A.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8117.image_5F00_thumb_5F00_079B3996.png" width="489" height="234" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;12. Open &lt;b&gt;WebEventWebTemplateDefault&lt;/b&gt; feature, set &lt;b&gt;Is Hidden&lt;/b&gt; to &lt;b&gt;True&lt;/b&gt; and copy the &lt;b&gt;Feature Id&lt;/b&gt; from the properties window to clip board&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6567.clip_5F00_image034_5F00_39B26413.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image034" border="0" alt="clip_image034" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2337.clip_5F00_image034_5F00_thumb_5F00_0288D61A.jpg" width="333" height="328" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;13. Ensure that &lt;b&gt;EventWebTemplateDefaults&lt;/b&gt; is listed in the &lt;b&gt;Items in the Feature&lt;/b&gt; section and add also &lt;b&gt;PulishingBinding&lt;/b&gt; SPI to the feature. &lt;b&gt;IMPORTANT&lt;/b&gt; – Ensure that binding SPI is above the &lt;b&gt;EventWebTemplateDefaults&lt;/b&gt; like in below picture. You might have to do some re-associations in the designer to achieve this.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3731.clip_5F00_image036_5F00_3C2B7004.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image036" border="0" alt="clip_image036" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3817.clip_5F00_image036_5F00_thumb_5F00_1DFDB250.jpg" width="376" height="206" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;14. Open &lt;b&gt;onet.xml&lt;/b&gt; file located under the &lt;b&gt;EventWebTemplate&lt;/b&gt; SPI&lt;/p&gt;  &lt;p&gt;15. Locate following string from the onet.xml file: &lt;i&gt;&amp;lt;!-- Default page module reference --&amp;gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;16. Place Feature reference just underneath the marker as in the following snipped. Note that feature ID in your case is different, since it’s randomly created during feature creation · This will ensure that feature is automatically activated when the web template is used for site creation&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2742.image_5F00_5C16CD01.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3718.image_5F00_thumb_5F00_36ACD993.png" width="449" height="186" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;Task 3 – Add feature receiver to define initial settings for provisioned site&lt;/h4&gt;  &lt;p&gt;In this task we will stamp the site with custom property bag entry for traceability purposes using object model. You can then use this information in future to ensure that particular site has been created using specific WebTemplate.&lt;/p&gt;  &lt;p&gt;Notice also that since we updated Web scoped feature to be hidden, you can use that as your versioning feature…. Those sites which has that feature enabled, are created using specific template and therefore you can version WebTemplate using this feature with feature upgrading definitions.&lt;/p&gt;  &lt;p&gt;1. Right click &lt;b&gt;WebEventWebTemplateDefault &lt;/b&gt;feature and choose &lt;b&gt;Add feature receiver…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Remove all other methods, but replace FeatureActivated method as follows · Notice that we store the Name attribute value of the WebTemplate to property bag&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8512.image_5F00_6DA6B7CC.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4786.image_5F00_thumb_5F00_5E23A5FD.png" width="562" height="167" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. &lt;b&gt;Save&lt;/b&gt; changes&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;Task 4 – Deploy and test the structures&lt;/h4&gt;  &lt;p&gt;In this task we’ll create default feature for the Event web template, which is responsible of deploying the default.aspx page for the site.&lt;/p&gt;  &lt;p&gt;1. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; project and choose properties&lt;/p&gt;  &lt;p&gt;2. Move to &lt;b&gt;SharePoint&lt;/b&gt; tab&lt;/p&gt;  &lt;p&gt;3. Update &lt;b&gt;Active Deployment Configuration&lt;/b&gt; as &lt;b&gt;No Activation&lt;/b&gt; and uncheck also the Auto-retract after debugging to make future debugging experience little bit faster&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4370.clip_5F00_image038_5F00_34CC5DFF.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image038" border="0" alt="clip_image038" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4477.clip_5F00_image038_5F00_thumb_5F00_2F114459.jpg" width="399" height="202" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. &lt;b&gt;Save all&lt;/b&gt; changes&lt;/p&gt;  &lt;p&gt;5. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; and choose &lt;b&gt;Deploy&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;6. Ensure that deployment was successful from the &lt;b&gt;Output&lt;/b&gt; window&lt;/p&gt;  &lt;p&gt;7. Move to internet explorer and to address &lt;b&gt;http://intranet.contoso.com&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;8. Move to &lt;b&gt;Site Settings&lt;/b&gt; page from the &lt;b&gt;Site Actions&lt;/b&gt; menu&lt;/p&gt;  &lt;p&gt;9. Move to &lt;b&gt;Site Collection features&lt;/b&gt; under the &lt;b&gt;Site Collection administration&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;10. Activate &lt;b&gt;Contoso.Intranet Site Main Resources&lt;/b&gt; feature&lt;/p&gt;  &lt;p&gt;11. Move back to &lt;b&gt;Site Settings&lt;/b&gt; page&lt;/p&gt;  &lt;p&gt;12. Click &lt;b&gt;Page Layouts and site Templates&lt;/b&gt; under the &lt;b&gt;Look and Feel&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;13. Add &lt;b&gt;Events Site&lt;/b&gt; as one of the available site types &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5554.clip_5F00_image040_5F00_186EF612.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image040" border="0" alt="clip_image040" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3302.clip_5F00_image040_5F00_thumb_5F00_568810C3.jpg" width="525" height="175" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;14. Click &lt;b&gt;OK&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;15. Move back to front page of the site collection&lt;/p&gt;  &lt;p&gt;16. Choose &lt;b&gt;New Site&lt;/b&gt; from the &lt;b&gt;Site Actions&lt;/b&gt; menu&lt;/p&gt;  &lt;p&gt;17. Choose &lt;b&gt;Events Site&lt;/b&gt; and define the properties as follows&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Title - Events &lt;/li&gt;    &lt;li&gt;Url - Events &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6136.clip_5F00_image042_5F00_2D9CFBBA.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image042" border="0" alt="clip_image042" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4786.clip_5F00_image042_5F00_thumb_5F00_6BB6166B.jpg" width="526" height="172" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;18. Click &lt;b&gt;Create &lt;/b&gt;- Creation of the site will take a while&lt;/p&gt;  &lt;p&gt;19. Click &lt;b&gt;Example Event&lt;/b&gt; from the left menu&lt;/p&gt;  &lt;p&gt;20. Notice how we provisioned example template for event, with initial settings for Location and Title&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4370.clip_5F00_image044_5F00_45DFF008.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image044" border="0" alt="clip_image044" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6521.clip_5F00_image044_5F00_thumb_5F00_7D460136.jpg" width="525" height="130" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;21. Switch page to &lt;b&gt;Edit&lt;/b&gt; mode&lt;/p&gt;  &lt;p&gt;22. Notice how you can use specific controls to edit the event information&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8171.clip_5F00_image045_5F00_34AC1265.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image045" border="0" alt="clip_image045" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2388.clip_5F00_image045_5F00_thumb_5F00_2CB47003.png" width="226" height="148" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;23. &lt;b&gt;Save&lt;/b&gt; changes of the page&lt;/p&gt;  &lt;p&gt;24. Choose &lt;b&gt;New Page&lt;/b&gt; from &lt;b&gt;Site Actions&lt;/b&gt; menu and ensure that default settings for the page layout were successfully applied so that our custom page layout is used by default&lt;/p&gt;  &lt;hr /&gt;  &lt;br /&gt;&lt;em&gt;If you find any issues on the lab, please add comments below, so that we are able to fix them as fast as possible. You can also suggest any enhancements for the lab, but due other on-going projects, I can’t promise to have time to include them. Thanks for your comments and feedback advance.&lt;/em&gt;   &lt;p&gt;&lt;em&gt;- Vesku&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10191129" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="C#" scheme="http://blogs.msdn.com/b/vesku/archive/tags/C_2300_/" /><category term="Web Content Management" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Web+Content+Management/" /><category term="onet.xml" scheme="http://blogs.msdn.com/b/vesku/archive/tags/onet-xml/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /><category term="WebTemplate" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WebTemplate/" /></entry><entry><title>WebTemplate training materials - Lab 2 - Creation of custom navigation control and master pages</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-2-creation-of-custom-navigation-control-and-master-pages.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-2-creation-of-custom-navigation-control-and-master-pages.aspx</id><published>2011-07-29T15:05:24Z</published><updated>2011-07-29T15:05:24Z</updated><content type="html">&lt;p&gt;This post is lab 2 from series of training materials for WebTemplate creation and maintenance. Please check the following posts for details and other exercises. Notice that you can download full package with all required lab material from link available in &lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-introduction-to-reusable-labs.aspx"&gt;introduction post&lt;/a&gt;. This package contains all supplementary materials and labs in word format.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-introduction-to-reusable-labs.aspx"&gt;WebTemplate training materials – Introduction to material&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-1-creation-of-features-and-basic-structures.aspx"&gt;WebTemplate training materials – Lab 1 - Creation of features and basic structures&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;em&gt;WebTemplate training materials – Lab 2 - Creation of custom navigation control and master pages &lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-3-creation-of-webtemplate-for-wcm-site.aspx"&gt;WebTemplate training materials – Lab 3 - Creation of WebTemplate for WCM site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-4-upgrading-existing-sites-with-feature-versioning.aspx"&gt;WebTemplate training materials – Lab 4 - Upgrading existing sites with feature versioning&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This particular post will concentrate on following functionalities.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Creating custom navigation control &lt;/li&gt;    &lt;li&gt;Adding custom master page for WebTemplate to Visual Studio solution &lt;/li&gt;    &lt;li&gt;Adding custom navigation control to master page with required configurations &lt;/li&gt;    &lt;li&gt;Adding required css and other UI related files to Visual Studio solution &lt;/li&gt; &lt;/ul&gt;  &lt;br /&gt;  &lt;hr /&gt;  &lt;br /&gt;  &lt;h2&gt;Lab 02 – User interface customizations – Adding master page and custom navigation for WebTemplate&lt;/h2&gt;  &lt;p&gt;The project files for this lab are in the ‘C:\Student\Labs\02_UI’&lt;em&gt; &lt;/em&gt;folder &lt;/p&gt;  &lt;h4&gt;Lab Objective&lt;/h4&gt;  &lt;p&gt;&lt;b&gt;Lab Overview&lt;/b&gt;: In this exercise we create custom main navigation control to be used in master page. We also include previously created style sheets and master pages to the solution structure, so that we can deploy all our customizations from one solution package.&lt;/p&gt;  &lt;h4&gt;Additional Resources&lt;/h4&gt;  &lt;p&gt;This lab includes the following additional resources:    &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Starter Files&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="285"&gt;           &lt;p&gt;C:\Student\Labs\02_UI\StarterFiles&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Files that can be used to help complete the labs.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Source Code&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="285"&gt;           &lt;p&gt;C:\Student\Labs\02_UI\Solution&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Completed lab source code in C#&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Solution structure&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="285"&gt;           &lt;p&gt;C:\Student\Labs\Contoso.Intranet\&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Solution structure started in previous exercise&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;h4&gt;Getting Started&lt;/h4&gt;  &lt;p&gt;Notice that all code and xml elements which are meant to be copied are available as text in the Word documents. This means that if you need to copy any of those elements, it’s better to use Word document formats of these labs.&lt;/p&gt;  &lt;p&gt;This Hands-On Lab contains a number of additional resources in fixed locations. By default, it is assumed that the base HOL directory is C:\Student and that the labs and additional resources are located under this directory.&lt;/p&gt;  &lt;p&gt;The default working folder for this lab is &lt;i&gt;‘&lt;b&gt;C:\Student\Labs\02_UI&lt;/b&gt;’&lt;/i&gt;.&lt;/p&gt;  &lt;p&gt;Please notice that this exercise is assuming that you have environment with url &lt;strong&gt;http://intranet.contoso.com &lt;/strong&gt;in your usage. If you use some alternative url, you’ll have to update scripts and use correct entries in exercises to make exercise to work properly.&lt;/p&gt;  &lt;h4&gt;Lab Setup Instructions&lt;/h4&gt;  &lt;p&gt;In the lab setup you will execute a PowerShell script that will create a new SharePoint site collection.&lt;/p&gt;  &lt;p&gt;1. Start the Virtual Machine in Hyper-V.&lt;/p&gt;  &lt;p&gt;2. Log on to the Virtual Machine as the local administrator with a user name of &lt;em&gt;&lt;b&gt;Contoso\Administrator&lt;/b&gt;&lt;/em&gt; and a password of &lt;em&gt;&lt;b&gt;pass@word1&lt;/b&gt;&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;3. Open Windows Explorer and browse to the location &lt;b&gt;C:\Student\Labs\Contoso.Intranet&lt;/b&gt;, in the folder double click &lt;b&gt;Contoso.Intranet.sln&lt;/b&gt; to start the previously created solution structure.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This step assumes that you have already created lab 1 based on the lab 1 guidance, so that we can continue building up the customization package. &lt;/li&gt;    &lt;li&gt;Notice also that package contains full source code status after lab 1 in folder C:\StudentWebTemplate\Labs\01_FeaturesAndVS2010\Solution\Contoso.Intranet - Lab 1 which you can copy as your starting point if you want to skip lab 1 completely. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Exercise 1 – Developing custom navigation control&lt;/h3&gt;  &lt;p&gt;In this exercise we’ll create custom navigation control, which will be used in the custom master page added in the following exercise. &lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1616.clip_5F00_image001_5F00_3BC93CB9.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5187.clip_5F00_image001_5F00_thumb_5F00_4F76264D.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Why custom control? – why not utilize out of the box things?&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;Whenever appropriate, it’s recommended to use out of the box navigation controls. In this case the user interface designer has however created CSS styling in such a way that we’ll need to create custom control to be used.&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;h4&gt;Task 1 – Creating custom navigation control&lt;/h4&gt;  &lt;p&gt;1. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; project and choose &lt;b&gt;Add –&lt;/b&gt; &lt;b&gt;New Folder&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Rename folder as &lt;b&gt;UI&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Right click UI folder and choose &lt;b&gt;Add&lt;/b&gt; &lt;b&gt;– New Folder&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;4. Rename folder as &lt;b&gt;WebControls&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;5. Right click &lt;b&gt;WebControls&lt;/b&gt; folder and choose &lt;b&gt;Add – New Item&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;6. Under the &lt;b&gt;Web&lt;/b&gt; node, choose &lt;b&gt;ASP.NET Server Control&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5001.clip_5F00_image003_5F00_07486A71.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6177.clip_5F00_image003_5F00_thumb_5F00_05979E9D.jpg" width="396" height="275" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. Name control as &lt;b&gt;TopNavigation.cs&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;8. Click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;9. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; project and choose &lt;b&gt;References…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;10. From the &lt;b&gt;.NET&lt;/b&gt; tab, add reference to &lt;b&gt;System.Configuration&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;11. Move back to &lt;b&gt;TopNavigation.cs&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;12. Add following using statements to code class&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4024.image_5F00_43B0B94E.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6177.image_5F00_thumb_5F00_74CFF3EE.png" width="351" height="50" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;13. Remove the example code generated during class creation until the content looks like in the following code snipped:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1307.image_5F00_3A084B18.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8540.image_5F00_thumb_5F00_51BF827E.png" width="514" height="153" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;14. Add following properties to the web control (inside of the class, after the class {-sign), so that we can manage the styling of the navigation more efficiently.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3857.image_5F00_1DAAE32B.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6746.image_5F00_thumb_5F00_5510F459.png" width="526" height="204" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;15. Add following below the properties to manage the data source attached to the control&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3835.image_5F00_12BDDC16.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3438.image_5F00_thumb_5F00_31281CFF.png" width="526" height="206" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;16. Following step is to add the actual rendering logic, add following override for &lt;b&gt;RenderContents&lt;/b&gt; method after the just added private property&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This method will be responsible of rendering the navigation nodes as navigation &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3835.image_5F00_75F44133.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4405.image_5F00_thumb_5F00_340D5BE5.png" width="525" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;17. Following step is to add the actual rendering logic, add following &lt;b&gt;RenderSubNavigation &lt;/b&gt;method after the just added private property&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;This method will render the child notes of the root node &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4186.image_5F00_513303EF.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6253.image_5F00_thumb_5F00_5635419E.png" width="533" height="308" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;18. As a final step for the navigation rendering, we’ll still need to have following methods included. These will render the individual links and spacer elements between the navigation nodes.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7120.image_5F00_4163491E.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4075.image_5F00_thumb_5F00_785D2757.png" width="535" height="354" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;19. &lt;b&gt;Save&lt;/b&gt; your changes&lt;/p&gt;  &lt;p&gt;20. Right click the &lt;b&gt;Contoso.Intranet&lt;/b&gt; project and choose &lt;b&gt;Build&lt;/b&gt; to verify that code is fully available&lt;/p&gt;  &lt;h3&gt;Exercise 2 – Adding master page to solution&lt;/h3&gt;  &lt;p&gt;Master page has been previously created and we’ll add that one and supplementary files to our Visual Studio solution. We’ll also add the just created web control to master page, which will be responsible of the main navigation rendering.&lt;/p&gt;  &lt;h4&gt;Task 1 – Adding required resources to the solution&lt;/h4&gt;  &lt;p&gt;1. Right click &lt;b&gt;SPIs&lt;/b&gt; folder in the project structure and choose &lt;b&gt;New Folder&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Name folder as &lt;b&gt;Modules&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Right click &lt;b&gt;Modules&lt;/b&gt; folder and choose &lt;b&gt;New Item…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;4. Choose Module SharePoint element and name that as &lt;b&gt;ContosoMasterPage&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5460.clip_5F00_image005_5F00_0E6392EA.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2818.clip_5F00_image005_5F00_thumb_5F00_5E594168.jpg" width="385" height="268" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Right click &lt;b&gt;ContosoMasterPage&lt;/b&gt; module and choose &lt;b&gt;Add – Existing Item…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3005.clip_5F00_image007_5F00_4A5FAED2.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image007" border="0" alt="clip_image007" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6116.clip_5F00_image007_5F00_thumb_5F00_5A8B76CB.jpg" width="386" height="267" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;6. Browse to folder &lt;b&gt;c:\Student\Labs\02_UI\StarterFiles&lt;/b&gt; and select &lt;b&gt;Contoso.Intranet.Default.master&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;7. Delete the unnecessary &lt;b&gt;Sample.txt&lt;/b&gt; under the &lt;b&gt;ContosoMasterPage&lt;/b&gt; module&lt;/p&gt;  &lt;p&gt;8. Modify the &lt;b&gt;elements.xml&lt;/b&gt; file content as follows for the master page module. Notice the different settings we define to ensure that master page is deployed properly to master page gallery, so that master page is available for sites in the particular site collection.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0358.image_5F00_0D7B0733.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8360.image_5F00_thumb_5F00_4B9421E4.png" width="530" height="155" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;9. Since Visual Studio automatically added this module to our previously created features, we’ll need to refactor and ensure the associations. Double click &lt;b&gt;WebPublishingBinding &lt;/b&gt;feature under the &lt;b&gt;Features&lt;/b&gt; node&lt;/p&gt;  &lt;p&gt;10. Use Arrows to remove the &lt;b&gt;ContosoMasterPage&lt;/b&gt; module from the particular feature if it’s present&lt;/p&gt;  &lt;p&gt;11. Double click &lt;b&gt;SiteMainResources&lt;/b&gt; and use arrows to associate module to this feature&lt;/p&gt;  &lt;h4&gt;Task 2 – Adding style sheets and other relevant files for master page&lt;/h4&gt;  &lt;p&gt;In this task we add images and style sheets, which are required for the master page.&lt;/p&gt;  &lt;p&gt;1. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; project and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;SharePoint “Layouts” Mapped Folder&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Notice how Visual Studio Created automatically sub folder named as the project to avoid naming issues&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4555.clip_5F00_image008_5F00_34196DB3.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5040.clip_5F00_image008_5F00_thumb_5F00_60C2278C.png" width="263" height="290" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. Right click the &lt;b&gt;Contoso.Intranet&lt;/b&gt; folder located under the &lt;b&gt;Layouts&lt;/b&gt; and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;New Folder&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;4. Rename folder as &lt;b&gt;CSS&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;5. Right click just created &lt;b&gt;CSS&lt;/b&gt; folder and choose &lt;b&gt;Add – Existing Item…&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;6. Browse to folder &lt;b&gt;c:\Student\Labs\02_UI\StarterFiles\CSS&lt;/b&gt;, select all CSS files using ctrl and click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;a. These CSS files contains the style sheet definitions for the custom master page&lt;/p&gt;  &lt;p&gt;7. Double click &lt;b&gt;Contoso.Intranet.Default.master&lt;/b&gt; to open that on the working window&lt;/p&gt;  &lt;p&gt;8. Locate place in head tags marked with following: &lt;i&gt;&amp;lt;!-- Style sheet registration --&amp;gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;9. Add following html references to master page to link up CSS style sheets to it&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3566.image_5F00_1E6F0F49.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1004.image_5F00_thumb_5F00_0EEBFD7A.png" width="567" height="114" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. &lt;b&gt;Save&lt;/b&gt; changes &lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7380.clip_5F00_image0011_5F00_0CCEFEB1.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[1]" border="0" alt="clip_image001[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4643.clip_5F00_image0011_5F00_thumb_5F00_3977B88A.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Location for CSS files&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;Out of the box SharePoint structures deploy css files to Style Library, since files saved there can be modified using SharePoint Designer in the actual deployment. In this case objective is not to provide this customization option in production, so css files are deployed to _layouts folder. It’s always technical decision where to put these kind of files, depending on the business requirements and usage models.&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;h4&gt;Task 2 – Adding custom navigation control to master page&lt;/h4&gt;  &lt;p&gt;In this task we add the previously implemented custom navigation page to master page.&lt;/p&gt;  &lt;p&gt;1. We’ll need to add that to our custom top navigation user control. Open the master page&lt;b&gt; &lt;/b&gt;and place following registration element on top of the user control just below the &lt;b&gt;Master&lt;/b&gt; statement.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6786.image_5F00_7149FCAD.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1004.image_5F00_thumb_5F00_04F6E642.png" width="534" height="46" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. We’ll still need to replace the &lt;b&gt;fullyqualifiedname&lt;/b&gt; inside of the Assembly attribute. We can solve the fully qualified assembly name for example by using &lt;b&gt;gacutil&lt;/b&gt; command line tool. Start &lt;b&gt;Visual Studio Command Prompt&lt;/b&gt; from &lt;b&gt;Start&lt;/b&gt; | &lt;b&gt;All programs&lt;/b&gt; | &lt;b&gt;Visual Studio 2010&lt;/b&gt; | &lt;b&gt;Visual Studio Tools&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Run following command in command prompt – &lt;b&gt;gacutil –l contoso.intranet&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7183.clip_5F00_image0019_5F00_5558C7B5.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image001[9]" border="0" alt="clip_image001[9]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7380.clip_5F00_image0019_5F00_thumb_5F00_21B05B57.png" width="519" height="169" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. Copy the fully qualified assembly name to &lt;b&gt;Assembly&lt;/b&gt; attribute. In your case the public key token is little bit different, but in the case of this exercise, values is as such:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2500.image_5F00_1154E39E.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2806.image_5F00_thumb_5F00_290C1B04.png" width="539" height="69" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Now that our assembly is registered on the master page, we can add our custom navigation to proper place&lt;/p&gt;  &lt;p&gt;6. Locate place in master page marked with following: &lt;i&gt;&amp;lt;!-- Contoso Top Navigation --&amp;gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;a. You can use find functionality to do this&lt;/p&gt;  &lt;p&gt;7. Place following just below the commented marker - Notice that we link this control to &lt;b&gt;ContosoSiteMap&lt;/b&gt; portal site map data source, which is located just below the control&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6116.image_5F00_002105FB.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4135.image_5F00_thumb_5F00_2CC9BFD4.png" width="541" height="71" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;8. &lt;b&gt;Save&lt;/b&gt; changes · Since we are using custom control in our deployment, we’ll need to add required safe control entry also to web.config as part of the customizations. There are numerous different ways to achieve this automatically from solution package, but let’s now associate entry to module responsible of the master page deployment.&lt;/p&gt;  &lt;p&gt;9. Activate &lt;b&gt;ContosoMasterPage&lt;/b&gt; module and click &lt;b&gt;[…]&lt;/b&gt; from &lt;b&gt;Safe Control Entries&lt;/b&gt; row in property window&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0250.clip_5F00_image0035_5F00_4AC7CDC8.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image003[5]" border="0" alt="clip_image003[5]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1411.clip_5F00_image0035_5F00_thumb_5F00_68C5DBBC.jpg" width="330" height="319" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Add entry as following to ensure that custom top navigation control added to solution package before will work properly&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Namespace – &lt;b&gt;Contoso.Intranet.UI.WebControls&lt;/b&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4544.clip_5F00_image0055_5F00_4DAD0CAE.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image005[5]" border="0" alt="clip_image005[5]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5618.clip_5F00_image0055_5F00_thumb_5F00_32943DA0.jpg" width="424" height="198" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;11. Click &lt;b&gt;OK&lt;/b&gt; and &lt;b&gt;save&lt;/b&gt; changes&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;Task 3 – Testing master page in the site&lt;/h4&gt;  &lt;p&gt;In this task we ensure that master page is fully functional on the site and also test for the application pages.&lt;/p&gt;  &lt;p&gt;1. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; and choose &lt;b&gt;Deploy&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Ensure from the &lt;b&gt;Output&lt;/b&gt; window that deployment was successful&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0246.clip_5F00_image0075_5F00_49DF4211.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image007[5]" border="0" alt="clip_image007[5]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3058.clip_5F00_image0075_5F00_thumb_5F00_15CAA2BE.jpg" width="473" height="117" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. Move to Internet explorer and browse to address &lt;b&gt;http://intranet.contoso.com&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;4. Choose &lt;b&gt;Site Settings&lt;/b&gt; from the &lt;b&gt;Site Actions&lt;/b&gt; menu&lt;/p&gt;  &lt;p&gt;5. Click &lt;b&gt;Master Pages&lt;/b&gt; and page layouts under the &lt;b&gt;Galleries&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;6. Verify that &lt;b&gt;Contoso.Intranet.Default.master&lt;/b&gt; is listed in the gallery&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1004.clip_5F00_image009_5F00_2D15A72F.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image009" border="0" alt="clip_image009" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2061.clip_5F00_image009_5F00_thumb_5F00_71E1CB63.jpg" width="460" height="232" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. Move back to &lt;b&gt;Site Settings&lt;/b&gt; page&lt;/p&gt;  &lt;p&gt;8. Click &lt;b&gt;Master Page&lt;/b&gt; under the &lt;b&gt;Look and Feel &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;9. Choose &lt;b&gt;Contoso.Intranet.Default.master&lt;/b&gt; from the &lt;b&gt;Site Master Page&lt;/b&gt; selection &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4213.clip_5F00_image0114_5F00_7AEE56E4.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image011[4]" border="0" alt="clip_image011[4]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0312.clip_5F00_image0114_5F00_thumb_5F00_32546813.jpg" width="490" height="101" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Click &lt;b&gt;OK&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;11. Click the &lt;b&gt;Contoso&lt;/b&gt; logo located in the top left corner to move to front page of the site&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2068.clip_5F00_image0134_5F00_5E24BC02.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image013[4]" border="0" alt="clip_image013[4]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6607.clip_5F00_image0134_5F00_thumb_5F00_2A101CAF.jpg" width="485" height="232" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;12. Move back to &lt;b&gt;Site Settings&lt;/b&gt; page&lt;/p&gt;  &lt;p&gt;13. Click &lt;b&gt;Master Page&lt;/b&gt; under the &lt;b&gt;Look and Feel &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;14. Choose &lt;b&gt;Contoso.Intranet.default.master&lt;/b&gt; also to be used as system master page&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0827.clip_5F00_image0154_5F00_1A20D7EB.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image015[4]" border="0" alt="clip_image015[4]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2068.clip_5F00_image0154_5F00_thumb_5F00_26425212.jpg" width="494" height="90" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;15. Click &lt;b&gt;OK&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;16. Notice how the application pages are also using &lt;b&gt;Contoso&lt;/b&gt; branded master page&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4532.clip_5F00_image0174_5F00_2FBB1088.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image017[4]" border="0" alt="clip_image017[4]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3146.clip_5F00_image0174_5F00_thumb_5F00_62AAA0EF.jpg" width="449" height="258" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2072.clip_5F00_image018_5F00_0BD2392E.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image018" border="0" alt="clip_image018" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5773.clip_5F00_image018_5F00_thumb_5F00_1F12EFCD.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Example master page&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;This Contoso master page has minor rendering issues here and there, but it can be used for demonstrational purposes. Feel free to update or change it anyway you like, if you want to fix rendering issues.&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;hr /&gt;  &lt;br /&gt;&lt;em&gt;If you find any issues on the lab, please add comments below, so that we are able to fix them as fast as possible. You can also suggest any enhancements for the lab, but due other on-going projects, I can’t promise to have time to include them. Thanks for your comments and feedback advance.&lt;/em&gt;   &lt;p&gt;&lt;em&gt;- Vesku&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10191128" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="C#" scheme="http://blogs.msdn.com/b/vesku/archive/tags/C_2300_/" /><category term="Web Content Management" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Web+Content+Management/" /><category term="onet.xml" scheme="http://blogs.msdn.com/b/vesku/archive/tags/onet-xml/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /><category term="WebTemplate" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WebTemplate/" /></entry><entry><title>WebTemplate training materials - Lab 1 - Creation of features and basic structures</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-1-creation-of-features-and-basic-structures.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-1-creation-of-features-and-basic-structures.aspx</id><published>2011-07-29T15:02:33Z</published><updated>2011-07-29T15:02:33Z</updated><content type="html">&lt;p&gt;This post is lab 1 from series of training materials for WebTemplate creation and maintenance. Please check the following posts for details and other exercises. Notice that you can download full package with all required lab material from link available in introduction post. This package contains all supplementary materials and labs in word format.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-introduction-to-reusable-labs.aspx"&gt;WebTemplate training materials – Introduction to material&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;em&gt;WebTemplate training materials – Lab 1 - Creation of features and basic structures &lt;/em&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-2-creation-of-custom-navigation-control-and-master-pages.aspx"&gt;WebTemplate training materials – Lab 2 - Creation of custom navigation control and master pages&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-3-creation-of-webtemplate-for-wcm-site.aspx"&gt;WebTemplate training materials – Lab 3 - Creation of WebTemplate for WCM site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-4-upgrading-existing-sites-with-feature-versioning.aspx"&gt;WebTemplate training materials – Lab 4 - Upgrading existing sites with feature versioning&lt;/a&gt; &lt;!--EndFragment--&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This particular post will concentrate on following functionalities.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Creating features and feature receivers – &lt;em&gt;Introduction to VS2010 usage&lt;/em&gt;&amp;#160; &lt;/li&gt;    &lt;li&gt;Debugging feature receivers - &lt;em&gt;Introduction to VS2010 usage&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Starting creation of VS2010 project structures for more comprehensive customizations coming following labs &lt;/li&gt;    &lt;li&gt;Creating site columns and content types for the upcoming WebTemplate created in following labs &lt;/li&gt; &lt;/ul&gt;  &lt;br /&gt;  &lt;hr /&gt;  &lt;br /&gt;  &lt;h2&gt;Lab 01 – Getting started with Visual Studio 2010 and feature Framework - Creating required features for WebTemplate&lt;/h2&gt;  &lt;p&gt;The project files for this lab are in the ‘C:\Student\Labs\01_FeaturesAndVS2010 &lt;/p&gt;  &lt;h4&gt;Lab Objective&lt;/h4&gt;  &lt;p&gt;&lt;b&gt;Lab Overview&lt;/b&gt;: In this lab you will begin your work with &lt;b&gt;Visual Studio 2010&lt;/b&gt; and become familiar with the different options available and start creating the solution structure for upcoming WebTemplate deployment.&lt;/p&gt;  &lt;h4&gt;Additional Resources&lt;/h4&gt;  &lt;p&gt;This lab includes the following additional resources:    &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Starter Files&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="332"&gt;           &lt;p&gt;C:\Student\Labs\01_FeaturesAndVS2010\StarterFiles&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Files that can be used to help complete the labs.&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="129"&gt;           &lt;p&gt;Source Code&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="332"&gt;           &lt;p&gt;C:\Student\Labs\01_FeaturesAndVS2010\Solution&lt;/p&gt;         &lt;/td&gt;          &lt;td valign="top" width="203"&gt;           &lt;p&gt;Completed lab source code in C# for Lab01&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;h4&gt;Getting Started&lt;/h4&gt;  &lt;p&gt;Notice that all code and xml elements which are meant to be copied are available as text in the Word documents. This means that if you need to copy any of those elements, it’s better to use Word document formats of these labs.&lt;/p&gt;  &lt;p&gt;This Hands-On Lab contains a number of additional resources in fixed locations. By default, it is assumed that the base HOL directory is C:\Student and that the labs and additional resources are located under this directory.&lt;/p&gt;  &lt;p&gt;The default working folder for this lab is &lt;i&gt;‘&lt;b&gt;C:\Student\Labs\01_FeaturesAndVS2010&lt;/b&gt;&lt;/i&gt;.&lt;/p&gt;  &lt;p&gt;Please notice that this exercise is assuming that you have environment with url &lt;strong&gt;http://intranet.contoso.com&lt;/strong&gt; in your usage. If you use some alternative url, you’ll have to update scripts and use correct entries in exercises to make exercise to work properly.&lt;/p&gt;  &lt;h4&gt;Lab Setup Instructions&lt;/h4&gt;  &lt;p&gt;In the lab setup you will execute a PowerShell script that will create a new SharePoint site collection.&lt;/p&gt;  &lt;p&gt;1. Start the Virtual Machine in Hyper-V.&lt;/p&gt;  &lt;p&gt;2. Log on to the Virtual Machine as the local administrator with a user name of &lt;em&gt;&lt;b&gt;Contoso\Administrator&lt;/b&gt;&lt;/em&gt; and a password of &lt;em&gt;&lt;b&gt;pass@word1&lt;/b&gt;&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;3. Open Windows Explorer and browse to the location &lt;b&gt;C:\Student\Labs\01_FeaturesAndVS2010&lt;/b&gt;, in the folder double click &lt;b&gt;SetupLab01.bat&lt;/b&gt;. &lt;/p&gt;  &lt;p&gt;4. Verify the site created successfully message, and then press a key to close the prompt.&lt;b&gt; &lt;/b&gt;The setup script launches a PowerShell script that creates a sample SharePoint site at the location &lt;b&gt;http://intranet.contoso.com&lt;/b&gt; that you will use in the next exercises. If you use some alternative URL, you can update the script based on your own environment.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4571.clip_5F00_image002_5F00_2C4F68ED.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8875.clip_5F00_image002_5F00_thumb_5F00_5F3EF954.jpg" width="365" height="279" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Exercise 1 – Creating Visual Studio Solution for project&lt;/h3&gt;  &lt;p&gt;In this exercise you will create initial structure for the upcoming solution using Visual Studio 2010.&lt;/p&gt;  &lt;h4&gt;Task 1 – Creating initial structure&lt;/h4&gt;  &lt;p&gt;1. Click &lt;strong&gt;Start | All Programs | Microsoft Visual Studio 2010&lt;/strong&gt;. In the group of programs, right-click &lt;b&gt;Microsoft Visual Studio 2010&lt;/b&gt; and click &lt;b&gt;Run as Administrator&lt;/b&gt;. This enables Visual Studio debugger to work correctly when attaching to the SharePoint worker process - In default SP2010 demo environment SharePoint is running using Farm Administrator account, so this would not be actually required, but this depends on the environment which you use for the lab exercises&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8204.clip_5F00_image0021_5F00_7D3D0748.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002[1]" border="0" alt="clip_image002[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6710.clip_5F00_image0021_5F00_thumb_5F00_1F45630F.jpg" width="215" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. On the &lt;b&gt;Start&lt;/b&gt; page, in the &lt;b&gt;Project&lt;/b&gt; section, click &lt;b&gt;New Project&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;3. In the &lt;b&gt;Target Framework&lt;/b&gt; dropdown at the top of the page ensure &lt;b&gt;.NET Framework 3.5&lt;/b&gt; is selected.&lt;/p&gt;  &lt;p&gt;4. In the &lt;b&gt;Installed Templates&lt;/b&gt; section, in the &lt;b&gt;Visual C#&lt;/b&gt; group, expand the &lt;b&gt;SharePoint&lt;/b&gt; group, click &lt;b&gt;2010&lt;/b&gt;, and then click &lt;b&gt;Empty SharePoint Project&lt;/b&gt;. - We use Empty SharePoint project, so that we don’t have any additional examples created to Visual Studio project structure. You can still add any kind of SharePoint items to this project, even though we initially started that as “empty” project.&lt;/p&gt;  &lt;p&gt;5. In the &lt;b&gt;Name&lt;/b&gt; textbox, type &lt;b&gt;Contoso.Intranet&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;6. In the &lt;b&gt;Location&lt;/b&gt; textbox, type &lt;b&gt;C:\Student\Labs\ &lt;/b&gt;and then click &lt;b&gt;OK&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8272.clip_5F00_image004_5F00_39392331.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3005.clip_5F00_image004_5F00_thumb_5F00_2949DE6D.jpg" width="408" height="282" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. In the &lt;b&gt;SharePoint Customization Wizard&lt;/b&gt;, in the &lt;b&gt;What local site do you want to use for debugging?&lt;/b&gt; textbox, type &lt;b&gt;http://intranet.contoso.com/ &lt;/b&gt;· Notice that url is dependent on your environment.&lt;/p&gt;  &lt;p&gt;8. Select the &lt;b&gt;Deploy as a farm solution&lt;/b&gt; option.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0743.clip_5F00_image006_5F00_3C1E6217.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8875.clip_5F00_image006_5F00_thumb_5F00_0C141096.jpg" width="381" height="304" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;9. Click &lt;b&gt;Finish&lt;/b&gt;.&lt;/p&gt;  &lt;h5&gt;Task 2 – Reviewing the project nodes&lt;/h5&gt;  &lt;p&gt;In this task you will examine the four nodes created in a SharePoint 2010 project. The nodes Properties and References are standard on Visual Studio projects, whereas Features and Package are unique to projects created with Visual Studio 2010 SharePoint Tools.&lt;/p&gt;  &lt;p&gt;1. Right-click the &lt;b&gt;Features&lt;/b&gt; node and choose &lt;b&gt;Add Feature&lt;/b&gt;. A feature with the name &lt;b&gt;Feature1&lt;/b&gt; is added. Right-click on this node and click &lt;b&gt;Rename&lt;/b&gt;. Rename this feature to &lt;b&gt;SiteMainResources&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8863.clip_5F00_image008_5F00_57FF7142.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5040.clip_5F00_image008_5F00_thumb_5F00_2A6E2BB2.jpg" width="334" height="298" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. In Solution Explorer, right-click &lt;b&gt;SiteMainResources&lt;/b&gt; and click &lt;b&gt;View Designer&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2818.clip_5F00_image009_5F00_486C39A6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image009" border="0" alt="clip_image009" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3808.clip_5F00_image009_5F00_thumb_5F00_66D67A8F.png" width="333" height="280" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. In the &lt;b&gt;Title&lt;/b&gt; textbox, type &lt;b&gt;Contoso.Intranet Site Main Resources&lt;/b&gt;. &lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4666.clip_5F00_image010_5F00_16B11C51.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4643.clip_5F00_image010_5F00_thumb_5F00_4E836074.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Good practice – prefixes for features&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;We use Site prefix for the feature node in the solution to indicate its scope easily without opening up the feature. Name of the feature node also defines the folder name of the feature in the 14 root. We use also Site in the title, so that we can see the scope of the feature easily from the packaging explorer, which we use later in this exercise&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;4. In the &lt;b&gt;Description&lt;/b&gt; textbox, type&lt;b&gt; Main resources for Contoso.Intranet&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;5. Click the &lt;b&gt;Scope&lt;/b&gt; dropdown list and then click &lt;b&gt;Site&lt;/b&gt;. · Note: Site columns and content type deployment requires a feature which activates at site collection scope in order to properly deploy Web Part description files.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4062.clip_5F00_image012_5F00_493479C3.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image012" border="0" alt="clip_image012" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2577.clip_5F00_image012_5F00_thumb_5F00_6B3CD589.jpg" width="525" height="129" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;6. &lt;b&gt;Save&lt;/b&gt; changes.&lt;/p&gt;  &lt;h5&gt;Task 3 – Adding images to a SharePoint 2010 Project&lt;/h5&gt;  &lt;p&gt;Visual Studio tries to ensure best practice by adding images to a project specific sub-folder in the images containing folder. This avoids naming conflicts with images that Microsoft deploys in the Images location.&lt;/p&gt;  &lt;p&gt;1. In Solution Explorer, right click &lt;b&gt;Contoso.Intranet&lt;/b&gt;, click &lt;b&gt;Add&lt;/b&gt; and then click &lt;b&gt;SharePoint “Images” Mapped Folder.&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7776.clip_5F00_image014_5F00_053095AC.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5224.clip_5F00_image014_5F00_thumb_5F00_6E22146F.jpg" width="428" height="297" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. In Solution Explorer, in the &lt;b&gt;Images&lt;/b&gt; node, right-click &lt;b&gt;Contoso.Intranet &lt;/b&gt;folder and click &lt;b&gt;Add Existing Item…&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;3. Browse to the folder &lt;b&gt;C:\Student\Labs\01_FeaturesAndVS2010\StarterFiles&lt;/b&gt; and, holding the [CTRL] key, select the files named &lt;b&gt;FeatureIcon.gif&lt;/b&gt;, &lt;b&gt;SiteIcon.gif&lt;/b&gt; and &lt;b&gt;WebPartIcon.gif&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;4. Click &lt;b&gt;Add&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6523.clip_5F00_image015_5F00_00F6981A.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image015" border="0" alt="clip_image015" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2500.clip_5F00_image015_5F00_thumb_5F00_43863392.png" width="360" height="361" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. In Solution Explorer, expand &lt;b&gt;Features&lt;/b&gt;, double click &lt;b&gt;SiteMainResources &lt;/b&gt;feature - This opens up the properties sheet for the particular feature.&lt;/p&gt;  &lt;p&gt;6. In the &lt;b&gt;Properties&lt;/b&gt; sheet for the feature, in the &lt;b&gt;Image URL&lt;/b&gt; property, type &lt;b&gt;Contoso.Intranet\FeatureIcon.gif &lt;/b&gt;· This is good practice to differentiate your features from the out of the box features in UI&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1423.clip_5F00_image017_5F00_40FD01D4.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image017" border="0" alt="clip_image017" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7183.clip_5F00_image017_5F00_thumb_5F00_1ABAA87C.jpg" width="352" height="369" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. Click &lt;b&gt;Save&lt;/b&gt;.&lt;/p&gt;  &lt;h4&gt;Exercise 2 – Adding a Feature Event Receiver&lt;/h4&gt;  &lt;p&gt;In this exercise you will add a feature receiver. This will automatically execute during feature activation and feature deactivation. In this exercise you will:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Obtain the SPSite reference which points to the site collection in which the feature is being activated. &lt;/li&gt;    &lt;li&gt;Obtain a SPWeb reference which points to the top-level site. &lt;/li&gt;    &lt;li&gt;Query the top-level site's Title property and store the value as a name/value pair inside the SPWeb.Properties collection. &lt;/li&gt;    &lt;li&gt;Modify the site's Title property with a creative text value of &amp;quot;Contoso Intranet&amp;quot; &lt;/li&gt;    &lt;li&gt;Modify the site's SiteLogoUrl property to point to SiteIcon.gif inside the Images folder. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Notice that this is just preliminary exercise before we start actually creating structures for required WebTemplate structures.&lt;/p&gt;  &lt;h5&gt;Task 1 – Creating event receiver&lt;/h5&gt;  &lt;p&gt;In this task you will edit the project code to make use of an event receiver.&lt;/p&gt;  &lt;p&gt;1. In Solution Explorer, expand &lt;b&gt;Features&lt;/b&gt;, right click &lt;b&gt;Main&lt;/b&gt; and click &lt;b&gt;Add Event Receiver&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4555.clip_5F00_image0024_5F00_117E6D3B.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002[4]" border="0" alt="clip_image002[4]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6523.clip_5F00_image0024_5F00_thumb_5F00_21AA3534.jpg" width="311" height="330" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. &lt;b&gt;SiteMainResources.EventReceiver.cs&lt;/b&gt; opens in the editing window. Note the code stubs and the unique Guid for the feature. Guid is used by Visual Studio to associate proper feature receiver to correct feature.xml file.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6204.clip_5F00_image0045_5F00_1B82E899.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image004[5]" border="0" alt="clip_image004[5]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4456.clip_5F00_image0045_5F00_thumb_5F00_0B93A3D5.jpg" width="478" height="225" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. Uncomment the method named &lt;b&gt;FeatureActivated&lt;/b&gt; and &lt;b&gt;FeatureDeactivating&lt;/b&gt;. Then remove all the extraneous comments. Your code should look as follows (&lt;i&gt;Note. Don’t copy this code, uncomment the existing so that Guid attribute is correct&lt;/i&gt;):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4544.image_5F00_2991B1C9.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3566.image_5F00_thumb_5F00_6ECA08F2.png" width="490" height="296" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. Add following code between the braces {} in the &lt;b&gt;FeatureActivated&lt;/b&gt; method · Notice that we use prefix Contoso.Intranet when we store our own custom properties to property bags to avoid overlapping with any out of the box properties. This is really good practice to follow up in your real life projects as well.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4150.image_5F00_0BEFB0FD.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8357.image_5F00_thumb_5F00_4355C22B.png" width="494" height="200" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Add following code between the braces {} in the &lt;b&gt;FeatureDeactivating&lt;/b&gt; method - In this code we reset the site back to the status it was before the code was executed. This is good practice to follow up in your own customizations as well.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5621.image_5F00_79E36D6F.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1805.image_5F00_thumb_5F00_7832A19B.png" width="501" height="149" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;6. On the &lt;b&gt;File&lt;/b&gt; menu, click &lt;b&gt;Save all&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;7. In Solution Explorer, right-click on the &lt;b&gt;Contoso.Intranet&lt;/b&gt; and click &lt;b&gt;Build&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3652.clip_5F00_image0065_5F00_4EDB599D.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image006[5]" border="0" alt="clip_image006[5]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1488.clip_5F00_image0065_5F00_thumb_5F00_4CBE5AD4.jpg" width="329" height="385" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. At the bottom of the Visual Studio Window, click &lt;b&gt;Output&lt;/b&gt; to see the results of the build. Verify the code builds correctly. Leave the project open, you will deploy and test the code in the next Exercise · Note. If Output is not visible, you can get it opened by selecting &lt;b&gt;Output&lt;/b&gt; from &lt;b&gt;View&lt;/b&gt; menu&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1586.clip_5F00_image0085_5F00_2A864F4E.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image008[5]" border="0" alt="clip_image008[5]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7245.clip_5F00_image0085_5F00_thumb_5F00_6FBEA677.jpg" width="531" height="116" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;Exercise 3 – Deploying and Debugging SharePoint Projects&lt;/h4&gt;  &lt;p&gt;In this exercise you will deploy your solution and then activate it on the SharePoint site collection. Finally you will debug the solution.&lt;/p&gt;  &lt;h5&gt;Task 1 – Review deployment options and Output window results&lt;/h5&gt;  &lt;p&gt;1. In the Solution Explorer window, right-click &lt;b&gt;Contoso.Intranet&lt;/b&gt; and click &lt;b&gt;Properties&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;2. Click the &lt;b&gt;SharePoint&lt;/b&gt; tab.&lt;/p&gt;  &lt;p&gt;3. In the &lt;b&gt;Active Deployment Configuration&lt;/b&gt; dropdown list, click &lt;b&gt;No Activation&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1805.clip_5F00_image0021_5F00_1BFB2D5C.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002[1]" border="0" alt="clip_image002[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4213.clip_5F00_image0021_5F00_thumb_5F00_1A4A6188.jpg" width="324" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. In the &lt;b&gt;Edit Configurations&lt;/b&gt; list box, click &lt;b&gt;No Activation&lt;/b&gt; and then click &lt;b&gt;View -&lt;/b&gt; Notice that you can control deployment and retraction settings from here. Review the different options available.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7268.clip_5F00_image0041_5F00_51B072B6.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image004[1]" border="0" alt="clip_image004[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1563.clip_5F00_image0041_5F00_thumb_5F00_5D65B9E8.jpg" width="375" height="287" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Click &lt;b&gt;OK&lt;/b&gt; to close the dialog.&lt;/p&gt;  &lt;p&gt;6. &lt;b&gt;Save&lt;/b&gt; changes&lt;/p&gt;  &lt;p&gt;7. Ensure the output window is visible at the bottom of the screen, then in Solution Explorer window, right click&lt;b&gt; Contoso.Intranet&lt;/b&gt; and choose &lt;b&gt;Deploy &lt;/b&gt;· Review the steps that are specified in the Output window.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1805.clip_5F00_image0061_5F00_66724569.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image006[1]" border="0" alt="clip_image006[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7762.clip_5F00_image0061_5F00_thumb_5F00_72278C9B.jpg" width="384" height="177" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;8. Leave the Visual Studio project open, you will return to it in a later task.&lt;/p&gt;  &lt;h5&gt;Task 2 – Reviewing the feature in the SharePoint site collection&lt;/h5&gt;  &lt;p&gt;The solution package for the Contoso.Intranet project has been deployed on the local SharePoint. In this task you will test the work.&lt;/p&gt;  &lt;p&gt;1. Open Internet Explorer and browse to &lt;b&gt;http://intranet.contoso.com&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Click the &lt;b&gt;Site Actions&lt;/b&gt; menu, and then click &lt;b&gt;Site Settings&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;3. In the &lt;b&gt;Site Collection Administration&lt;/b&gt; section, click &lt;b&gt;Site Collection Features&lt;/b&gt;. In the list of Features, review the &lt;b&gt;Contoso.Intranet Site Main resources&lt;/b&gt; feature and its custom icon.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5125.clip_5F00_image0081_5F00_7729CA4A.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image008[1]" border="0" alt="clip_image008[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4213.clip_5F00_image0081_5F00_thumb_5F00_2E23A884.jpg" width="430" height="151" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4. To the right of the &lt;b&gt;Contoso.Intranet Site Main Resources &lt;/b&gt;feature, click &lt;b&gt;Activate&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;5. In the title bar to the top left of the features, click &lt;b&gt;Contoso Intranet &lt;/b&gt;· Review the new site Icon – since we are using publishing features, title of the site is not visible from here.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1070.clip_5F00_image0091_5F00_2C72DCB0.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image009[1]" border="0" alt="clip_image009[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1563.clip_5F00_image0091_5F00_thumb_5F00_2B2E43D1.png" width="244" height="167" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;6. Click the &lt;b&gt;Site Actions&lt;/b&gt; menu, and then click &lt;b&gt;Site Settings &lt;/b&gt;· Notice that the site title set in the feature receiver is visible here.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0081.clip_5F00_image011_5F00_629454FF.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image011" border="0" alt="clip_image011" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6170.clip_5F00_image011_5F00_thumb_5F00_00FE95E9.jpg" width="413" height="116" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. In the &lt;b&gt;Site Collection Administration&lt;/b&gt; section, click &lt;b&gt;Site Collection Features&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;8. To the right of the &lt;b&gt;Contoso.Intranet Site Main Resources &lt;/b&gt;feature, click &lt;b&gt;Deactivate&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;9. On the warning page click &lt;b&gt;Deactivate this feature&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8738.clip_5F00_image013_5F00_3864A717.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image013" border="0" alt="clip_image013" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8836.clip_5F00_image013_5F00_thumb_5F00_4BA55DB6.jpg" width="416" height="160" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Refresh page by clicking [F5] · The site icon and title have returned to the default.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3146.clip_5F00_image014_5F00_49F491E2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1586.clip_5F00_image014_5F00_thumb_5F00_0F991C01.png" width="338" height="147" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h5&gt;Task 3 – Debugging the project&lt;/h5&gt;  &lt;p&gt;In this task you will use Visual Studio 2010 to debug your project. You will create breakpoints and then step through the code.&lt;/p&gt;  &lt;p&gt;1. Return to &lt;b&gt;Visual Studio 2010&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;2. In Solution Explorer, expand the &lt;b&gt;Features&lt;/b&gt; branch.&lt;/p&gt;  &lt;p&gt;3. Right-click &lt;b&gt;SiteMainResources.EventReceiver.cs&lt;/b&gt; and click &lt;b&gt;View Code&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;4. Locate the cursor in the line &lt;b&gt;&lt;i&gt;SPWeb site = siteCol.RootWeb;&lt;/i&gt;&lt;/b&gt; on the toolbar click &lt;b&gt;Debug&lt;/b&gt;, and then click &lt;b&gt;Toggle Breakpoint &lt;/b&gt;(or &lt;b&gt;F9&lt;/b&gt; as short cut).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8814.clip_5F00_image016_5F00_26E42072.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image016" border="0" alt="clip_image016" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8233.clip_5F00_image016_5F00_thumb_5F00_6FBA9278.jpg" width="398" height="237" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. On the Visual Studio menu, click &lt;b&gt;Debug&lt;/b&gt; and then click &lt;b&gt;Start Debugging&lt;/b&gt;. The solution builds and a new instance of Internet Explorer is launched.&lt;/p&gt;  &lt;p&gt;6. In the &lt;b&gt;Debugging Not Enabled&lt;/b&gt; message box, click &lt;b&gt;OK&lt;/b&gt;.· Note. This happens only for the first time particular web application is used for debugging. · Note. Starting the debugging process could take a while, so wait patiently&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6663.clip_5F00_image017_5F00_699345DD.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image017" border="0" alt="clip_image017" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1057.clip_5F00_image017_5F00_thumb_5F00_5F7EA4B2.png" width="353" height="152" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. Click the &lt;b&gt;Site Actions&lt;/b&gt; menu, and then click &lt;b&gt;Site Settings&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;8. In the &lt;b&gt;Site Collection Administration&lt;/b&gt; section, click &lt;b&gt;Site Collection Features&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;9. To the right of the &lt;b&gt;Contoso.Intranet Site Main Resources &lt;/b&gt;feature, click &lt;b&gt;Activate&lt;/b&gt;.· Visual Studio Editor opens and the code stops at the breakpoint. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8311.clip_5F00_image019_5F00_7CA44CBC.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image019" border="0" alt="clip_image019" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2553.clip_5F00_image019_5F00_thumb_5F00_05B0D83E.jpg" width="462" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Press &lt;b&gt;[F11]&lt;/b&gt; to step through the code.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8233.clip_5F00_image021_5F00_0AB315ED.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image021" border="0" alt="clip_image021" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3124.clip_5F00_image021_5F00_thumb_5F00_0176DAAC.jpg" width="461" height="175" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;11. Return to Visual Studio on the menu click &lt;b&gt;Debug&lt;/b&gt;, and then click &lt;b&gt;Stop Debugging&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;12. Locate the cursor in the breakpoint line and click &lt;b&gt;[F9]&lt;/b&gt; to Toggle the breakpoint off.&lt;/p&gt;  &lt;h4&gt;Exercise 4: Creating and deploying content types for the solution&lt;/h4&gt;  &lt;p&gt;In the remaining exercises you will add few new SharePoint Items to the project using empty and content type templates. We are &lt;b&gt;starting to building up the data structure model&lt;/b&gt; for our upcoming Contoso.Intranet solution, which will be based on WebTemplate techniques.&lt;/p&gt;  &lt;h5&gt;Task 1 – Creating site columns&lt;/h5&gt;  &lt;p&gt;In this task you will add a Web Part to the project. You will edit the XML files to specify a different category for the part.&lt;/p&gt;  &lt;p&gt;1. In the Solution Explorer window, right click &lt;b&gt;Contoso.Intranet&lt;/b&gt;, click &lt;b&gt;Add&lt;/b&gt;, and then click &lt;b&gt;New Folder&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2047.clip_5F00_image023_5F00_0679185B.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image023" border="0" alt="clip_image023" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8814.clip_5F00_image023_5F00_thumb_5F00_045C1992.jpg" width="390" height="250" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. Rename folder as &lt;b&gt;SPIs - &lt;/b&gt;SPIs is just shortening from “SharePoint project item”. We use this folder to group our SarePoint specific structures to sub folders so that solution structure remains understandable and also others working in project can easily understand what’s included in it.&lt;/p&gt;  &lt;p&gt;3. Add also new sub folder to this folder, named as &lt;b&gt;SiteColumns&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;4. Right click &lt;b&gt;SiteColumns&lt;/b&gt;, click &lt;b&gt;Add&lt;/b&gt;, and then click &lt;b&gt;New Item&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;5. In the &lt;b&gt;Installed Templates&lt;/b&gt; section, in the &lt;b&gt;Visual C#&lt;/b&gt; group, expand the &lt;b&gt;SharePoint&lt;/b&gt; group, click &lt;b&gt;2010&lt;/b&gt; and then click &lt;b&gt;Empty Element&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7343.clip_5F00_image024_5F00_374BA9F9.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image024" border="0" alt="clip_image024" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4111.clip_5F00_image024_5F00_thumb_5F00_5A2C6BA9.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Empty template&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;Since there’s no out of the box template for site columns, we’ll be using Empty Element for defining our required fields. You can use this approach for any SharePoint projects items, which don’t have dedicated template available.&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;6. In the &lt;b&gt;Name&lt;/b&gt; textbox, type &lt;b&gt;InitialFields&lt;/b&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5287.clip_5F00_image026_5F00_6DD9553D.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image026" border="0" alt="clip_image026" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1464.clip_5F00_image026_5F00_thumb_5F00_1700ED7C.jpg" width="426" height="296" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. Click &lt;b&gt;Add&lt;/b&gt;. The &lt;b&gt;InitialFields&lt;/b&gt; node is added to Solution explorer with &lt;b&gt;elements.xml&lt;/b&gt; file.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7331.clip_5F00_image028_5F00_49F07DE3.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image028" border="0" alt="clip_image028" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5684.clip_5F00_image028_5F00_thumb_5F00_4EF2BB92.jpg" width="304" height="362" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;8. Double click the &lt;b&gt;Elements.xml&lt;/b&gt; file located under the Initial fields&lt;/p&gt;  &lt;p&gt;9. Open up &lt;b&gt;fields.txt&lt;/b&gt; located in the &lt;b&gt;c:\student\labs\01_featuresAndVS2010\StarterFiles&lt;/b&gt; and copy the content between the &lt;b&gt;Elements&lt;/b&gt; elements in the Elements.xml file as follows:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1055.image_5F00_57FF4713.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5287.image_5F00_thumb_5F00_3CE67805.png" width="468" height="170" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Review the xml content – we create the required fields for the upcoming event functionality which has specific metadata used in page layouts. In this case we add three different fields related to upcoming event functionality.&lt;/p&gt;  &lt;h5&gt;Task 2 – Creating publishing content types&lt;/h5&gt;  &lt;p&gt;1. Right click the &lt;b&gt;SPIs&lt;/b&gt; folder and create new &lt;b&gt;ContentTypes&lt;/b&gt; sub folder&lt;/p&gt;  &lt;p&gt;2. Right click the &lt;b&gt;ContentTypes&lt;/b&gt; folder and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;New Item&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. In the &lt;b&gt;Installed Templates&lt;/b&gt; section, in the &lt;b&gt;Visual C#&lt;/b&gt; group, expand the &lt;b&gt;SharePoint&lt;/b&gt; group, click &lt;b&gt;2010&lt;/b&gt; and then choose Content Type &lt;/p&gt;  &lt;p&gt;4. Name content type as &lt;b&gt;Page&lt;/b&gt;· This will be our Contoso specific root page for the publishing sites. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0804.clip_5F00_image030_5F00_1322FD12.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image030" border="0" alt="clip_image030" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7823.clip_5F00_image030_5F00_thumb_5F00_662D9A36.jpg" width="421" height="292" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;6. Choose out of the box &lt;b&gt;Welcome&lt;/b&gt; &lt;b&gt;Page&lt;/b&gt; as the base content type for this content type&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6758.clip_5F00_image032_5F00_6F3A25B7.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image032" border="0" alt="clip_image032" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8321.clip_5F00_image032_5F00_thumb_5F00_548D899E.jpg" width="426" height="338" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;7. Update the &lt;b&gt;Group&lt;/b&gt; attribute of the content type as &lt;b&gt;Contoso Content Types&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;8. We don’t need to associate any additional fields to this content type in this stage, so the definition should look as follows. Notice how the name is project specific to follow naming guidance&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5340.clip_5F00_image034_5F00_598FC74D.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image034" border="0" alt="clip_image034" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/4505.clip_5F00_image034_5F00_thumb_5F00_1089A587.jpg" width="407" height="127" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;   &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3034.clip_5F00_image0241_5F00_23CA5C26.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image024[1]" border="0" alt="clip_image024[1]" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6758.clip_5F00_image0241_5F00_thumb_5F00_46AB1DD6.png" width="24" height="16" /&gt;&lt;/a&gt;&lt;b&gt;Content type inheritance&lt;/b&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td valign="top" width="566"&gt;           &lt;p&gt;&lt;i&gt;This content type is created as the root content type for the custom publishing content types in this project. This way we can easily extend any custom content types, by manipulating this definition in future phases of the Intranet&lt;/i&gt;&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/p&gt;  &lt;p&gt;9. Right click the &lt;b&gt;ContentTypes&lt;/b&gt; folder and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;New Item&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;10. Choose Content Type and name the content type as &lt;b&gt;Event&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;11. Click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;12. Choose &lt;b&gt;Contoso.Intranet - Page&lt;/b&gt; as the base content type&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7220.clip_5F00_image036_5F00_415C3725.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image036" border="0" alt="clip_image036" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3583.clip_5F00_image036_5F00_thumb_5F00_63D0C5E0.jpg" width="367" height="290" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;13. Update the &lt;b&gt;Group&lt;/b&gt; attribute as &lt;b&gt;Contoso Content Types&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;14. Open up &lt;b&gt;fieldrefs.txt&lt;/b&gt; located in the &lt;b&gt;c:\student\labs\01_featuresAndVS2010\StarterFiles&lt;/b&gt; and copy the content between the &lt;b&gt;FieldRefs&lt;/b&gt; elements in the Elements.xml file as follows: · &lt;b&gt;Important – &lt;/b&gt;Don’t copy the snipped directly from below, since the content type GUID depends on the environment. Replace only the field references.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5340.image_5F00_621FFA0C.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8054.image_5F00_thumb_5F00_2E0B5AB9.png" width="464" height="176" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h5&gt;Task 3 – Creating document content types&lt;/h5&gt;  &lt;p&gt;1. Right click the &lt;b&gt;ContentTypes&lt;/b&gt; folder and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;New Item&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Name to be added content type as &lt;b&gt;Contract&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;3. Click &lt;b&gt;Add&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;4. Choose content type to be based on out of the box &lt;b&gt;Document&lt;/b&gt; content type&lt;/p&gt;  &lt;p&gt;5. Update the &lt;b&gt;Group&lt;/b&gt; attribute as &lt;b&gt;Contoso Content Types&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;6. Open up &lt;b&gt;statusref.txt&lt;/b&gt; located in the &lt;b&gt;c:\student\labs\01_featuresAndVS2010\StarterFiles&lt;/b&gt; and copy the content between the &lt;b&gt;FieldRefs&lt;/b&gt; elements in the Elements.xml file as follows: · Notice that we are using out of the box site column, so we only need to reference it here&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8880.image_5F00_19396239.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6648.image_5F00_thumb_5F00_308466AA.png" width="460" height="196" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This content type is only for feature upgrade demonstrations, so we don’t include any actual custom word template for it in this exercise&lt;/p&gt;  &lt;h5&gt;Task 4 – Creating content association for publishing pages&lt;/h5&gt;  &lt;p&gt;In this following task we create necessary content type binding element, which will be responsible of adding publishing content types to be available in the pages library. Unless we do this, content editors cannot create new pages with the soon to be created page layout.&lt;/p&gt;  &lt;p&gt;1. Right click &lt;b&gt;Features&lt;/b&gt; node in the &lt;b&gt;Solution Explorer&lt;/b&gt; and choose &lt;b&gt;Add Feature&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;2. Rename the newly added feature as &lt;b&gt;WebPublishingBinding &lt;/b&gt;· This is web scoped feature, which is used for binding content type to site. In this series we actually create this just for verification purposes, so we don’t actually use this web scoped feature at all when WebTemplate has been fully created.&lt;/p&gt;  &lt;p&gt;3. Update &lt;b&gt;title&lt;/b&gt; and &lt;b&gt;description&lt;/b&gt; as follows&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Title – &lt;b&gt;Contoso.Intranet Web Publishing Binding&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;Description – &lt;b&gt;Content type binding feature&lt;/b&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;4. Ensure that the &lt;b&gt;Scope&lt;/b&gt; is set as &lt;b&gt;Web&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5756.clip_5F00_image038_5F00_14FF64A7.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image038" border="0" alt="clip_image038" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5340.clip_5F00_image038_5F00_thumb_5F00_44DA0668.jpg" width="429" height="103" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Right click the &lt;b&gt;SPIs&lt;/b&gt; folder and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;New Folder&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;6. Name folder as &lt;b&gt;ContentTypeBindings&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;7. Right click the &lt;b&gt;ContenTypeBindings&lt;/b&gt; folder and choose &lt;b&gt;Add&lt;/b&gt; – &lt;b&gt;New Item&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;8. Choose &lt;b&gt;Empty Element&lt;/b&gt; and name that as &lt;b&gt;PublishingBinding&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;9. Open up &lt;b&gt;Bindings.txt&lt;/b&gt; located in the &lt;b&gt;c:\student\labs\01_featuresAndVS2010\StarterFiles&lt;/b&gt; and update the content as follows: · Notice that &lt;b&gt;you’ll need to update&lt;/b&gt; [ContentTypeId] places with the content type ids in your environment. These are the IDs of the content types, which we just created in previous SPIs, which we added to the solution.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7206.image_5F00_2A2D6A4F.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1524.image_5F00_thumb_5F00_2F9BDAF3.png" width="422" height="121" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;10. Your solution should look somewhat as in following picture&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/7701.clip_5F00_image040_5F00_188D59B7.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image040" border="0" alt="clip_image040" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/8461.clip_5F00_image040_5F00_thumb_5F00_4B7CEA1E.jpg" width="313" height="488" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h5&gt;Task 5 – Verifying outcome&lt;/h5&gt;  &lt;p&gt;In this task we verify the configure setup by reviewing the packaged content and how the structures are generated to site collection after deployment&lt;/p&gt;  &lt;p&gt;1. Choose &lt;b&gt;Package Explorer&lt;/b&gt; from the &lt;b&gt;View&lt;/b&gt; - &lt;b&gt;Other&lt;/b&gt; &lt;b&gt;Windows&lt;/b&gt; menu&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6215.clip_5F00_image042_5F00_10490E53.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image042" border="0" alt="clip_image042" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2185.clip_5F00_image042_5F00_thumb_5F00_0059C98F.jpg" width="366" height="385" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;2. Ensure that the elements are in proper features – as all site columns and content types in site collection scoped feature and binding in web scoped feature - Notice that the Feature Titles are visible here, so it’s good practice to name them properly - Notice also that you’ll need to have fields before content types listed in feature, since other of the project items in the features really matters.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/6305.clip_5F00_image043_5F00_2C2A1D7E.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image043" border="0" alt="clip_image043" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/2086.clip_5F00_image043_5F00_thumb_5F00_2AE5849F.png" width="307" height="196" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. Right click the &lt;b&gt;Contoso.Intranet &lt;/b&gt;project and choose &lt;b&gt;Properties&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;4. Move to &lt;b&gt;SharePoint&lt;/b&gt; tab and modify activation to be &lt;b&gt;Default&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/3678.clip_5F00_image044_5F00_7ADB331D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image044" border="0" alt="clip_image044" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/1425.clip_5F00_image044_5F00_thumb_5F00_59E7C076.png" width="382" height="69" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Save all changes – for example by selecting &lt;b&gt;Save All&lt;/b&gt; from &lt;b&gt;File&lt;/b&gt; menu&lt;/p&gt;  &lt;p&gt;6. Right click &lt;b&gt;Contoso.Intranet&lt;/b&gt; project and choose &lt;b&gt;Deploy&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;7. Open up Internet Explorer and move to url &lt;b&gt;http://intranet.contoso.com&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;8. Choose &lt;b&gt;Site Settings&lt;/b&gt; from the &lt;b&gt;Site Actions&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;9. Click &lt;b&gt;Site Content Types&lt;/b&gt; under the &lt;b&gt;Galleries&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;10. Ensure that you can see the just created three content types in the list · Notice also that site icon has been updated automatically by site collection scoped feature activation&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0458.clip_5F00_image046_5F00_263F5418.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image046" border="0" alt="clip_image046" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/5807.clip_5F00_image046_5F00_thumb_5F00_2F4BDF99.jpg" width="449" height="185" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;hr /&gt;  &lt;br /&gt;  &lt;p&gt;&lt;em&gt;If you find any issues on the lab, please add comments below, so that we are able to fix them as fast as possible. You can also suggest any enhancements for the lab, but due other on-going projects, I can’t promise to have time to include them. Thanks for your comments and feedback advance.&lt;/em&gt; &lt;/p&gt;  &lt;p&gt;&lt;em&gt;- Vesku&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10191125" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="C#" scheme="http://blogs.msdn.com/b/vesku/archive/tags/C_2300_/" /><category term="Web Content Management" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Web+Content+Management/" /><category term="onet.xml" scheme="http://blogs.msdn.com/b/vesku/archive/tags/onet-xml/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /><category term="WebTemplate" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WebTemplate/" /></entry><entry><title>WebTemplate training materials–Introduction to reusable labs</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-introduction-to-reusable-labs.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-introduction-to-reusable-labs.aspx</id><published>2011-07-29T14:59:08Z</published><updated>2011-07-29T14:59:08Z</updated><content type="html">&lt;p&gt;During past few years I’ve been doing quite a lot of training materials which have been then published globally in MSDN or in other places. Every now and then some of the material don’t get &lt;em&gt;officially &lt;/em&gt;released due miscellaneous reasons, so I’m quite often left with numerous demos and HOLs which were cut from some package.&lt;/p&gt;  &lt;p&gt;This post is introduction post for that kind of material, which is now released in this blog and you can also download the full package from my personal&amp;#160; sky drive (word format with supplementary files). This material has created by me for one hands on training where objective was to continue building existing solution from scratch to finish – as in step by step, rather than doing individual bits and pieces as the exercises. These kind of exercises have received excellent feedback, since they keep the context for the technologies covered in individual labs.&lt;/p&gt;  &lt;p&gt;Now released package will contain following exercises or topics, which will be released also as blog posts.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Creation VS2010 solution structure for WebTemplate and feature deployment following up naming guidance's and folder structures &lt;/li&gt;    &lt;li&gt;Creating features and feature receivers &lt;/li&gt;    &lt;li&gt;Debugging feature receivers &lt;/li&gt;    &lt;li&gt;Creating site columns and content types &lt;/li&gt;    &lt;li&gt;Developing custom navigation control for controlled html &lt;/li&gt;    &lt;li&gt;Deploying custom master page using feature with custom navigation control &lt;/li&gt;    &lt;li&gt;Adding and deploying custom page layout to solution &lt;/li&gt;    &lt;li&gt;Creation of WebTemplate with publishing features enabled (WCM site) utilizing above customizations      &lt;ul&gt;       &lt;li&gt;Business case - Creation of Events site to show information concerning upcoming events in corporation &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Creating custom Upgrade application page to site settings for feature upgrade management      &lt;ul&gt;       &lt;li&gt;Check &lt;a href="http://spfeatureupgrade.codeplex.com/"&gt;Chris O'Brien's solution&lt;/a&gt; for more comprehensive functionality for feature upgrade management from central administration application &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Upgrade existing sites created using old version of the web template with feature upgrading techniques      &lt;ul&gt;       &lt;li&gt;Check more details on the model in my &lt;a href="http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-templates.aspx"&gt;previous blog post&lt;/a&gt;&amp;#160; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Here’s the links to released blog posts&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-1-creation-of-features-and-basic-structures.aspx"&gt;WebTemplate training materials–reusable labs – Lab 1&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;Creation of features and basic structures for our solution &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-2-creation-of-custom-navigation-control-and-master-pages.aspx"&gt;WebTemplate training materials–reusable labs – Lab 2&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;Creation of custom navigation control and master pages &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-3-creation-of-webtemplate-for-wcm-site.aspx"&gt;WebTemplate training materials–reusable labs – Lab 3&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;Creation of WebTemplate for WCM site with custom page layout &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vesku/archive/2011/07/29/webtemplate-training-materials-lab-4-upgrading-existing-sites-with-feature-versioning.aspx"&gt;WebTemplate training materials–reusable labs – Lab 4&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;Upgrading existing sites with feature versioning &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;Just a teaser on the web template created publishing site with custom navigation and master page…&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0317.clip_5F00_image019_5F00_thumb1_5F00_23E7A9C6.jpg"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image019_thumb1" border="0" alt="clip_image019_thumb1" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-81-08-metablogapi/0218.clip_5F00_image019_5F00_thumb1_5F00_thumb_5F00_1AAB6E85.jpg" width="472" height="312" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can also &lt;a href="https://skydrive.live.com/redir.aspx?cid=2041e5497bda57a8&amp;amp;resid=2041E5497BDA57A8!444"&gt;download zip package&lt;/a&gt;, which includes Word document versions of the hands on labs, all required prerequisites for the labs and example implementations of the labs. Downloadable package is available from &lt;a href="https://skydrive.live.com/redir.aspx?cid=2041e5497bda57a8&amp;amp;resid=2041E5497BDA57A8!444"&gt;here&lt;/a&gt;. Exercises assumes that you have extracted this package to &lt;em&gt;c:\Student &lt;/em&gt;folder of your development server. If you want to copy-paste xml and code used in the exercises, Word format is much more suitable – it’s up to you…&lt;/p&gt;  &lt;p&gt;Labs can be performed almost in any environment and they are using same domain information as in the &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=21099"&gt;publicly available Hyper-V image with Contoso corporation&lt;/a&gt; demo structures. Simply adjust the url and domain information to match your own environment, if you have some alternative SharePoint environment for your consumption. &lt;/p&gt;  &lt;p&gt;Feel free to utilize now published material anyway you like – you can freely utilized parts of it or update it as you like. Please note that I don’t take &lt;em&gt;personally&lt;/em&gt; no responsibility what so ever with the now released package, so they are meant for learning exercises, not directly to be used in any actual SharePoint deployment.&lt;/p&gt;  &lt;hr /&gt;  &lt;br /&gt;  &lt;p&gt;&lt;em&gt;If you find any issues on the labs, please send comments, so that we are able to fix them as fast as possible. You can also suggest any enhancements for the lab, but due other on-going projects, I can’t promise to have time to include them with the exercises. Thanks for your comments and feedback advance.&lt;/em&gt; &lt;/p&gt;  &lt;p&gt;&lt;em&gt;- Vesku&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10191122" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="C#" scheme="http://blogs.msdn.com/b/vesku/archive/tags/C_2300_/" /><category term="Web Content Management" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Web+Content+Management/" /><category term="onet.xml" scheme="http://blogs.msdn.com/b/vesku/archive/tags/onet-xml/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /><category term="WebTemplate" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WebTemplate/" /></entry><entry><title>Site definitions vs. Web templates</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2011/07/22/site-definitions-vs-web-templates.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2011/07/22/site-definitions-vs-web-templates.aspx</id><published>2011-07-22T14:45:18Z</published><updated>2011-07-22T14:45:18Z</updated><content type="html">&lt;p&gt;I keep getting almost daily emails concerning WebTemplate element support and when it would be proper technical approach for the site provisioning with SharePoint 2010. There’s no doubt that many times there’s requirements to be able to provision sites as easily as possible from content editor perspective, so let’s still elaborate or evaluate different options and common misunderstandings with these options.&lt;/p&gt;  &lt;p&gt;Detailed explanation of different available options can be found from &lt;a href="http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-templates.aspx"&gt;my previous blog post&lt;/a&gt; (also has step by step guidance on custom WebTemplate usage). &lt;a href="http://sharepointchick.com"&gt;Mirjam&lt;/a&gt; also has done good work on explaining WebTemplate in &lt;a href="http://sharepointchick.com/archive/2010/06/15/site-definitions-vs.-webtemplates.aspx"&gt;her blog post&lt;/a&gt; titled as same as this one. Notice that when I’m writing about web templates, I refer to WebTemplate element usage with onet.xml, not what get’s created when you save site as a template from browser (site template wsp package), even though site templates uses WebTemplate element in them.&lt;/p&gt;  &lt;p&gt;Here’s quick list of advantages and disadvantages on both approaches. Let’s also add some cloud perspective on the topics, since it seems to get cloudier and cloudier all the time, especially now with the Office365 being released few months back.&lt;/p&gt;  &lt;p&gt;Notice that I didn’t include feature stapling or features to the game, since in this post we’ll concentrate on having new options available in the &lt;em&gt;Create Site&lt;/em&gt; functionality, rather than just changing how the existing templates will work using feature stapling or manual feature activation. Following chapters will list random pointers for both sides (advantages and disadvantages) which you should be considering when you create your technical plan for customizations.&lt;/p&gt;  &lt;h2&gt;Site definition &lt;/h2&gt;  &lt;br /&gt;  &lt;ul&gt;   &lt;li&gt;There’s no supported way to upgrade or modify already deployed site definition      &lt;ul&gt;       &lt;li&gt;It might work, but it’s &lt;strong&gt;not&lt;/strong&gt; supported &lt;/li&gt;        &lt;li&gt;There’s options to mitigate this, but there’s wider impact on architecture planning and technical solution &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Site definitions are always deployed farm wide and cannot be targeted to more granular scope &lt;/li&gt;    &lt;li&gt;There’s own template in VS2010 for site definition &lt;/li&gt;    &lt;li&gt;Feature staplers can be targeted to site definitions &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms493894.aspx"&gt;Variations&lt;/a&gt; will only work with site definitions       &lt;ul&gt;       &lt;li&gt;Note. This is not translation or multilingual solution, it’s for structural copy. Following sites as an example are not using variations – &lt;a href="http://www.kone.com"&gt;www.kone.com&lt;/a&gt; in &lt;a href="http://www.kone.com/us"&gt;English (US)&lt;/a&gt;, &lt;a href="http://www.kone.cn/"&gt;Chinese&lt;/a&gt; and in &lt;a href="http://www.kone.ru"&gt;Russia&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Not&lt;/strong&gt; supported by cloud services, like Office365 (Standard or Dedicated) &lt;/li&gt;    &lt;li&gt;Upgrades to following SharePoint major version (o15) will require additional costs      &lt;ul&gt;       &lt;li&gt;All sites created using custom site definitions are stamped with custom identifier and won’t be upgraded automatically &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Hierarchies can be easily created using separate xml formats      &lt;ul&gt;       &lt;li&gt;Requires usage of &lt;a href="http://msdn.microsoft.com/en-us/library/ms566017(office.12).aspx"&gt;portal site templates&lt;/a&gt;, which is one example of &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebprovisioningprovider.aspx"&gt;site provisioning provider&lt;/a&gt; implementation &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Only supported as farm solution deployable functionality &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Web Templates &lt;/h2&gt;  &lt;br /&gt;  &lt;ul&gt;   &lt;li&gt;Can be easily updatable just by modifying onet.xml and deploying new version of that available      &lt;ul&gt;       &lt;li&gt;Note. Update does not have any impact on existing sites, since there’s no runtime reference to them &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Can be targeted to Farm or Site collection level – provide more granularity for exposing site options &lt;/li&gt;    &lt;li&gt;Feature staplers cannot be targeted to web template      &lt;ul&gt;       &lt;li&gt;Note. Since you can modify onet.xml directly and deploy new version of that anytime, there’s no use for feature stapling with WebTemplate element &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms493894.aspx"&gt;Variations&lt;/a&gt; won’t work with WebTemplate element deployed onet.xml files       &lt;ul&gt;       &lt;li&gt;There’s already few custom solutions available, which makes variations also to work with sites created using WebTemplate elements. Logic is not that difficult, but requires customizations &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Supported by cloud services&lt;/strong&gt;, like Office365 (Standard or Dedicated) &lt;/li&gt;    &lt;li&gt;Upgrades to following SharePoint version (o15) won’t require extra work – completely same as somebody would have created site using out of the box site definition and then activated extra custom features from site settings page      &lt;ul&gt;       &lt;li&gt;Actual features have be obviously upgraded correctly &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Supports publishing features, like site definitions – so can be also used for Internet facing sites      &lt;ul&gt;       &lt;li&gt;Good example of Internet facing site created using WebTemplate elements in &lt;a href="http://www.upm.com"&gt;www.upm.com&lt;/a&gt; which also has numerous different languages (&lt;a href="http://www.upm.fr"&gt;France&lt;/a&gt;, &lt;a href="http://www.upm.com/de"&gt;German&lt;/a&gt;, &lt;a href="http://www.upm.fi"&gt;Finnish&lt;/a&gt;) &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Hierarchies can be easily created using feature receivers and code      &lt;ul&gt;       &lt;li&gt;Provides actually more flexibility than &lt;a href="http://msdn.microsoft.com/en-us/library/ms566017(office.12).aspx"&gt;portal site template&lt;/a&gt; option &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Creating custom web template is easy as creating custom site definition      &lt;ul&gt;       &lt;li&gt;Note. Don’t start by importing existing site template (wsp package) as suggested in the &lt;a href="http://msdn.microsoft.com/en-us/library/ff408263.aspx"&gt;MSDN&lt;/a&gt;. It’s much more easier to convert any existing site definition to web template simply by copying onet.xml and creating other required elements manually. Check my &lt;a href="http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-templates.aspx"&gt;previous blog post&lt;/a&gt; for details. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;There’s no designers in VS2010 for WebTemplate      &lt;ul&gt;       &lt;li&gt;This should be fixed by VS.next to promote multiple platform options – as in not to force to be only in on-prem like with site definitions – “We are all in…” &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Can be deployed from farm solution or from sandbox solution      &lt;ul&gt;       &lt;li&gt;Notice that has to be obviously in Site Collection scoped feature, if deployed as Sandbox solution &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;I upgraded from 2007 and have site definitions – now what?&lt;/h2&gt;  &lt;p&gt;In 2007 we didn’t have any other options than using site definitions with certain business requirements, so it’s understandable that there’s numerous sites which are build technically using custom site definitions. These deployments won’t be cloud compliant unless dependency to these site definitions is removed. This means that these kind of deployments cannot be migrated to Office365 (Standard or Dedicated) without complete refactoring of code and content as pre-requisite.&lt;/p&gt;  &lt;p&gt;These kind of refactoring projects are not simple and could be surprisingly expensive. If you are planning to migrate away from custom site definitions, you might want to consider to take a approach where you rebuild customizations using WebTemplate element and then migrate just the content from the existing sites to newly developed customizations. You might want to consider this as one of your options when you define required changes for the customizations anyway due the version upgrade from 2007 to 2010.&lt;/p&gt;  &lt;h2&gt;Summary&lt;/h2&gt;  &lt;p&gt;As a summary, you should be using WebTemplate element whenever possible to provide site provisioning options to your deployment. &lt;/p&gt;  &lt;p&gt;As a Microsoft consultant, I also personally would prefer people to use more cost efficient options in long term when they design their customizations to avoid any hidden cost impact or unnecessary cleaning in later stages of the deployment life cycle. By using WebTemplate element over site definition, we still provide complete flexibility for the customers to host their SharePoint wherever they want (cloud or on-prem) and don’t cause any “&lt;em&gt;stupid&lt;/em&gt;” technical limitations for their possible future cloud transition to any cloud platform (like Office365). Even though your deployment would have been &lt;strong&gt;currently&lt;/strong&gt; planned to be an on-premises deployment, you shouldn’t lock it’s future by using site definitions and cause also additional costs as part of the upgrade to following SharePoint major version (o15).&lt;/p&gt;  &lt;p&gt;Hopefully you were not forced to do any SP2003 to SP2007 upgrades where custom site definitions where used, but that’s exactly the route where using site definitions also in future will drive deployments. These migration issues should be major consideration point for any SharePoint deployment from overall costs perspective. By selecting WebTemplate approach, your deployment will be as easily updated to following SharePoint major version as it would be using simple stapled features. This has major cost impact on the overall lifecycle costs of the deployment.&lt;/p&gt;  &lt;p&gt;Notice also that since WebTemplate element usage is also based on same onet.xml structures like site definitions, you can easily learn how to use them, so that your customization architecture is following up guidance's to avoid any unintentional costs for the deployment during maintenance phase of the sites. &lt;/p&gt;  &lt;p&gt;So – forget site definitions, start using WebTemplate elements in your deployments, this will be beneficial for your customers, you and any SharePoint deployment in short and long term.&lt;/p&gt;  &lt;hr /&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;em&gt;If you disagree any of the pointers listed above, don’t hesitate to contact or write comments on this blog post. We would like to also understand what are the concerns and possible issues you might have run into. Thanks for the comments and pointers advance.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10188958" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="onet.xml" scheme="http://blogs.msdn.com/b/vesku/archive/tags/onet-xml/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /><category term="WebTemplate" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WebTemplate/" /></entry><entry><title>SharePoint 2010 and web templates</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-templates.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-templates.aspx</id><published>2010-10-14T17:34:56Z</published><updated>2010-10-14T17:34:56Z</updated><content type="html">&lt;p&gt;One of the really exciting new options on the Feature Framework level of the SharePoint 2010 is the WebTemplate element. In this blog entry we’ll cover the primary site provisioning methods and we’ll concentrate especially to web template option to share the key techniques.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="#introduction"&gt;Introduction&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="#diff"&gt;Different site provisioning methods in SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="#stapling"&gt;Feature stapling&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="#sitetemplate"&gt;Site templates&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="#webtemplate"&gt;Web Templates&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="#sitedefinition"&gt;Site definitions&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="#providers"&gt;Provisioning providers&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="#indetail"&gt;Web template option in detail&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="#design"&gt;Additional design guidelines for web templates&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="#stepbystep"&gt;Step by step creation of new publishing web template&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="#initial"&gt;Setup initial structures &lt;/a&gt;&lt;/li&gt;        &lt;li&gt;&lt;a href="#spis"&gt;Creating required SharePoint project items&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="#webtempelement"&gt;Creating WebTemplate element&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="#associateion"&gt;Associating features to web template&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="#receivers"&gt;Adding code for the feature receivers&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="#testing"&gt;Testing and ensuring that it’s working&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="#faq"&gt;Web Template FAQ&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="#summary"&gt;Summary&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="#summary"&gt;References&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;a id="introduction"&gt;&lt;!--Intro--&gt;&lt;/a&gt;  &lt;h3&gt;   &lt;br /&gt;Introduction&lt;/h3&gt;  &lt;p&gt;As you might know, there are multiple different techniques for provisioning new sites in SharePoint. SharePoint deployments always consist from at least one site, which provides functionalities for the end users. There’s multiple ways to create these sites and to customize them based on customer requirements. In this blog post we concentrate models, which support strict versioning model. Meaning that the sites are not built directly to production environment using SharePoint Designer or browser rather deployed using solution packages.&lt;/p&gt;  &lt;p&gt;Before we get started, let’s first concentrate on getting the terms right. There’s multiple different terms used when we reference definitions, which are used for creating new sites. Here’s the clarification on the most used one’s and how they should be used.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Site Template      &lt;ul&gt;       &lt;li&gt;Site template refers to WSP package, which was created by clicking the &lt;em&gt;Save Site As Template&lt;/em&gt; link in the &lt;em&gt;Site Settings&lt;/em&gt; page. In SharePoint 2007 sites were saved to specific STP format, but in SharePoint 2010 templates are using the &lt;em&gt;standard&lt;/em&gt; SharePoint solution package model. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Web Template      &lt;ul&gt;       &lt;li&gt;Web template refers to new feature element available in SharePoint 2010, which provides us flexible way to define definition (onet.xml file), which will be used only on provisioning time, when the site is created. There are no references to the definition on runtime, which provide easy maintainability for the definition. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Site Definition      &lt;ul&gt;       &lt;li&gt;Site definition refers to classic WebTemp*.xml and onet.xml combination, which are located in the file system of server. WebTemp*.xml file is used to introduce the template for SharePoint and onet.xml file contains the actual instruction or definitions concerning which features to activate when site is created. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Portal site template      &lt;ul&gt;       &lt;li&gt;Portal site templates are hierarchy files, which are available when you use SharePoint server. Portal site templates have their own xml schema, which is used to define which kind of site definitions are provisioned and in which order. Good example of portal site template is out of the box publishing portal definitions, which provisioned example www site, with single sub site. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Why is the provisioning model such an important thing? – since overall usage models in SharePoint, especially for larger companies, are not just based on individual web parts, which are used to bring additional value over the out of the box site structures. In larger project, the productivity of the individual end users and the editors plays role for designing correct model, since we want to have as good and consistent user experience provided through out the farm.&lt;/p&gt;  &lt;p&gt;Let’s have a real life example of one global intranet, which had 50 part time content editors and more than 700 sites in site hierarchy for each of the country sites. There’s 10 different site types, which should provide the same functionality where ever they are located. Since there’s quite a lot of content to be created and managed, it’s better to create specific templates compared to use feature stapling and browser customizations. You can only image the time spend modifying each site using browser and even though there would be documented instructions, most likely most of the sites would look little bit different than other. By providing 10 configured web templates, which will have all templates and web parts as defined by corporate communication, intranet will have consistent user experience and content editors can easily extend the sites as required.&lt;/p&gt;  &lt;p&gt;Key point on the site provisioning is to automate something which would be done manually by site authors. Business case can be calculated quite easily from the amount time required for each site to be configured based on the company guidance. There doesn’t have to be that many sites created, before the investment for customization is worthwhile. &lt;/p&gt;  &lt;p&gt;I’ve been still seeing demos and real production environment where the end users or content authors are forced for example to active features manually in certain order to configure the site as planned. This should not be the case, since it also increase risks of breaking up the sites by for example activating accidently wrong features. &lt;/p&gt;  &lt;p&gt;Other consideration is obviously the implications due the customizations. Certain options available can cause implications on maintenance and upgrade processes, which will impact on the overall costs included in the deployment. Luckily in SharePoint 2010, we now have the new Web Template option, which will help to address these issues.&lt;/p&gt;  &lt;p&gt;So key advantage of automating the site provisioning to save time and ensure consistent end users experience throughout the particular deployment. This is not only important for WCM sites, but also for other site types to provide consistency.&lt;/p&gt; &lt;a id="diff"&gt;&lt;!--Diff--&gt;&lt;/a&gt;  &lt;h3&gt;Different site provisioning methods in SharePoint 2010&lt;/h3&gt;  &lt;p&gt;There is four or five different main models for site provisioning in SharePoint 2010, depending what’s considered as individual models.&amp;#160; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Feature stapling &lt;/li&gt;    &lt;li&gt;Site templates &lt;/li&gt;    &lt;li&gt;Web Templates &lt;/li&gt;    &lt;li&gt;Site definitions &lt;/li&gt;    &lt;li&gt;Provisioning provides &lt;/li&gt;    &lt;li&gt;Custom code (mainly for automated processes) &lt;/li&gt; &lt;/ul&gt;  &lt;br /&gt;  &lt;p&gt;We’ll cover each of the options in high level to consider the different advantages and disadvantages in each of them, except the full custom code option, which obviously can be anything. These options will concentrate on different ways to control what’s provisioned when end users uses the out of the box &lt;em&gt;Create&lt;/em&gt; functionality.&lt;/p&gt; &lt;a id="stapling"&gt;&lt;!--stapling--&gt;&lt;/a&gt;  &lt;h4&gt;Feature stapling&lt;/h4&gt;  &lt;p&gt;Primary purpose of the feature stapling is to extend and customize existing site definitions. Usually these are used to provide some custom functionalities for the out of the box site definitions, but technique is definitely available also for the custom site definitions. &lt;/p&gt;  &lt;p&gt;Since it’s not supported to change the onet.xml file of site definitions after it has been used in environment, feature stapling is quite commonly used also to provide versioning for the already deployed custom site definitions. You can modify the stapling definitions to different site definitions also afterwards. It’s important to remember that stapled features are only activated on provisioning time, so if there’s any existing sites already provisioned, those won’t be affected automatically just by deploying new stapling definitions.&lt;/p&gt;  &lt;p&gt;Biggest downside with the feature stapling is that we can only extend the existing site definitions, we can’t provide new. This can be an issue for example when you’d like to have WCM templates created for multiple different site purposes. Also the fact that stapled features are activated before the module element or list elements in onet.xml file has been provisioned, can cause issues unless you use some workarounds. Notice also that feature stapling is only supported when site definitions are used, it doesn’t work if you are provisioning sites using site templates or web templates, even though these both options refers to root site definition.&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="3" width="500"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="middle" width="498"&gt;         &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/7065.clip_5F00_image001_5F00_3.png" width="24" height="21" /&gt;&lt;strong&gt;More information&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="498"&gt;&lt;font size="-2"&gt;&lt;font size="-2"&gt;             &lt;p&gt;&lt;i&gt;More information concerning feature stapling in SharePoint 2010 can be found from following locations:&lt;/i&gt;&lt;/p&gt;              &lt;ul&gt;               &lt;li&gt;&lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa544294.aspx"&gt;MSDN – Feature/Site Template Association&lt;/a&gt; – quite misleading title, but it works only against site definitions&lt;/em&gt; &lt;/li&gt;             &lt;/ul&gt;           &lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt; &lt;a id="sitetemplate"&gt;&lt;!--sitetemplate--&gt;&lt;/a&gt;  &lt;h4&gt;   &lt;br /&gt;Site templates&lt;/h4&gt;  &lt;p&gt;As you might know SharePoint 2010 has changed the functionality used for saving existing sites as template. In 2007 version when site was saved as a template, specific STP file was created, which could not be modified in anyway. In 2010, when we save site as template, SharePoint generates full fledge solution package (WSP file), which can then be moved between any environment containing all site level objects, like libraries and optionally also content.&lt;/p&gt;  &lt;p&gt;There are two key improvements in feature framework scheme, which have made this possible. These are WebTemplate element and CustomSchema attribute for ListInstance elements. These two options will make it possible to provision sites using alternative xml definitions, but then refer back to out of the box templates. Key point is that we use alternative definitions during provisioning, but all object references will be associated to out of the box types.&lt;/p&gt;  &lt;p&gt;One of the biggest downsides with the site templates is the fact that they are not supported when publishing features are enabled. This is also the reason why we hide the link from the site settings page to avoid anyone to use this functionality. Obviously if you know the aspx page name, you can access the page and save the site as a template also when publishing features are enabled. This is however not supported. What does that mean? – just because you can… doesn’t mean you shouldn’t. Publishing sites have complex references and dependencies, which have to be carefully defined even for site definitions. This is not supported (and link is hidden) so that inexperienced users wouldn’t break intentionally their deployments.&lt;/p&gt;  &lt;p&gt;One of the consideration with the site templates is also the fact that unless you import them to Visual Studio and modify its settings, they are only available on site collection level (site collection scoped feature), which means that to be able to have the template available from multiple locations, we’ll have to either deploy the site template as sandbox solution to multiple site collections or deploy it as full trust solution and then activate the particular feature in site collections to have the template available. &lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="3" width="500"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="middle" width="498"&gt;         &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/7065.clip_5F00_image001_5F00_3.png" width="24" height="21" /&gt;&lt;strong&gt;More information&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="498"&gt;&lt;font size="-2"&gt;           &lt;p&gt;&lt;i&gt;More information concerning Site Templates can be found from following locations:&lt;/i&gt;&lt;/p&gt;           &lt;font size="-2"&gt;&lt;font size="-2"&gt;               &lt;ul&gt;                 &lt;li&gt;&lt;a href="http://office.microsoft.com/en-us/sharepoint-designer-help/save-a-sharepoint-site-as-a-template-HA101782501.aspx"&gt;Office – Save a SharePoint site as a template&lt;/a&gt; &lt;font size="-2"&gt;&lt;/font&gt;&lt;/li&gt;                  &lt;li&gt;&lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/sharepoint/ff420387.aspx#lesson2"&gt;MSDN – Application life cycle for SharePoint 2010&lt;/a&gt; – there’s some content concerning site templates included here as well&lt;/em&gt; &lt;/li&gt;               &lt;/ul&gt;             &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt; &lt;a id="webtemplate"&gt;&lt;!--webtemplate--&gt;&lt;/a&gt;  &lt;h4&gt;   &lt;br /&gt;Web Templates&lt;/h4&gt;  &lt;p&gt;We’ll concentrate more detailed on the Web templates in later chapters, but basically with the web templates in this case, we refer to manually created WebTemplate elements in the Visual Studio. We need to create two files for each of the web templates. Other one is empty element (is VS2010 is used) for defining the actual WebTemplate element and other one is completely similar onet.xml file as for site definitions, with few exceptions, which we’ll cover little bit later.&lt;/p&gt;  &lt;p&gt;When we have our web template created, we’ll associate the element file to feature, which will be responsible of deploying the web template. WebTemplate element is supported in two scopes, which are Farm and Site. This means that we can deploy the web templates to be available either throughout the farm or based on site collection scoped feature activation. It’s important to notice that dispute the fact that we’d be using site collection scoped feature for deployment, we can still deploy the web template using farm scoped feature. This would for example give us possibility to filter the options available from the Create site functionality, based on feature activation status.&lt;/p&gt;  &lt;p&gt;One big advantage of the web templates is the fact that since they are feature based and there won’t be any files stored in file system, those are completely supported usually by the cloud services, like MS Online (BPOS). Support obviously varies based on the cloud service types, like in MS Online case, if the service is dedicated or standard. These usually mean for example differences on the support for full trusted solutions or only sandbox solutions.&lt;/p&gt;  &lt;p&gt;One really important advantage with the web templates compared to the site templates is the fact that we can utilize the publishing features in web templates. This provides us possibility to create new site provisioning options to be available from the Create site functionality, even though we would be creating new publishing feature based sites.. &lt;/p&gt;  &lt;p&gt;We’ll walk through exact details and web template creation is upcoming chapters.&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="3" width="500"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="middle" width="498"&gt;         &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/7065.clip_5F00_image001_5F00_3.png" width="24" height="21" /&gt;&lt;strong&gt;More information&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="498"&gt;&lt;font size="-2"&gt;           &lt;p&gt;&lt;i&gt;See end of the article for &lt;a href="#references"&gt;references&lt;/a&gt; and links concerning web templates and manual creation of them.&lt;/i&gt;&lt;/p&gt;         &lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt; &lt;a id="sitedefinition"&gt;&lt;!--sitedefinition--&gt;&lt;/a&gt;  &lt;h4&gt;   &lt;br /&gt;Site definitions&lt;/h4&gt;  &lt;p&gt;Site definitions are the classic xml files, which are for example used to provision out of the box sites. Many of the developers learned to create these in 2007 version, since they are very powerful and there were almost no other options available for introducing new options for the Create site functionality. As mentioned earlier site definition consists basically from two different files: WebTemp*.xml and onet.xml files.WebTemp*.xml defines how the site definition is visible for the end users and the onet.xml file contains the definitions for the actual site provisioning.&lt;/p&gt;  &lt;p&gt;We can only deploy site definitions using farm solutions, since files will be located in the file system. They are also by default available throughout the farm in every application, unless we limit the visibility either using AvailableWebTemplates attribute for publishing sites or more generally available VisibilityFeatureDepency attribute in the WebTemp*.xml file. Since we won’t be concentrating on site definitions in this blog article, I won’t be covering these options more detailed.&lt;/p&gt;  &lt;p&gt;Key change in the site definitions for the 2010 version is that if you have site collection scoped feature associated to site definitions under the SiteFeatures elements, those features are not activated, if you create sub sites. In 2007, also these site collection features where activated also for sub sites. This could be an issue when for example you want to add new Events site under corporate intranet and you’d like also for example content types to be created, when site is provisioned. There are workarounds for this, which are declared later in the web template creation chapters (same workaround applies for site definitions). &lt;/p&gt;  &lt;p&gt;Whenever we create site based on any site definitions SharePoint stores the site definition identifier information to SPWeb.WebTemplate, SPWeb.Configuration and SPWeb.WebTemplateId properties. These are critical properties in the SharePoint platform, which have to be set for each of the sites. Let’s come back to this in following chapters with detailed web template information.&lt;/p&gt;  &lt;p&gt;Biggest challenge with the site definition is that we are not allowed to change the onet.xml file after it has been used to provision any sites in the environment. This is just not supported. There are certain scenarios, which don’t impact the existing sites and it might seem that update didn’t cause any issues, but just because it didn’t hurt the first time, should you do it again? – no. This is one of the classical rules of SharePoint development, like the fact that don’t touch the databases directly. &lt;/p&gt;  &lt;p&gt;Already in 2007 version there was numerous approaches to go around the fact that onet.xml file should not be updated. Most classic one, is the so called “minimal site definition approach”, where we all possible customizations to features, which don't’ have to be activated in certain order. Let’s not spend too much time on this, but generally out of the box site definitions are actually quite awful examples for custom site definitions (quick summary). &lt;/p&gt;  &lt;p&gt;Due these upgradability issues and SLA commitments with the customers, site definitions are NOT supported usually by the cloud services, like in MS Online. It would be simply foolish to impact on the service quality by allowing site definitions to be used, especially since we have at least as good options available in SharePoint 2010, which don’t compromise the service in short or long term.&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="3" width="500"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="middle" width="498"&gt;         &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/7065.clip_5F00_image001_5F00_3.png" width="24" height="21" /&gt;&lt;strong&gt;More information&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="498"&gt;&lt;font size="-2"&gt;           &lt;p&gt;&lt;i&gt;More information concerning the site definitions can be found from following locations:&lt;/i&gt;&lt;/p&gt;           &lt;font size="-2"&gt;&lt;font size="-2"&gt;&lt;font size="-2"&gt;                 &lt;ul&gt;&lt;font size="-2"&gt;                     &lt;li&gt;&lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa978512(office.14).aspx"&gt;MSDN – Site definitions and configurations&lt;/a&gt;&lt;/em&gt; &lt;/li&gt;                      &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2008/12/06/Using-a-Minimal-Publishing-Site-Definition-in-the-field.aspx"&gt;AC - Using Minimal publishing site definition in field&lt;/a&gt; &lt;/li&gt;                   &lt;/font&gt;&lt;/ul&gt;               &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt; &lt;a id="providers"&gt;&lt;!--providers--&gt;&lt;/a&gt;  &lt;h4&gt;   &lt;br /&gt;Provisioning providers&lt;/h4&gt;  &lt;p&gt;Portal provisioning providers are technique where we completely replace the onet.xml file using code, except that we usually still use some out of the box site definition as the starting point. This means that we only use WebTemp*.xml file and assign our custom provisioning class to be used, when particular template is selected. As long as we have implemented our custom provisioning provider by inhering the out of the box SPWebProvisioningProvider class (&lt;em&gt;Microsoft.SharePoint.SPWebProvisioningProvider&lt;/em&gt;) and the associations in WebTemp*.xml are correct, we would have full control on the actions to be performed.&lt;/p&gt;  &lt;p&gt;Common implementation uses SPWeb.ApplyWebTemplate method to provision the starting point based on some out of the box site definition and then manipulates the created site using code. This is extremely flexible model, since you can easily update the code just by deploying new version of the used assembly… but wait… isn’t this almost the same model as for the web templates… &lt;/p&gt;  &lt;p&gt;One implmentation of the provisioning providers is the PortalProvisioningProvider (&lt;em&gt;Microsoft.SharePoint.Publishing.PortalProvisioningProvider&lt;/em&gt;) which is available in the SharePoint Server side, not from foundation. This provides the capability to create portal site templates, meaning hierarchy files.&lt;/p&gt;  &lt;p&gt;Since provisioning providers require that the they are introduced using the WebTemp*.xml file, which has to be placed to file system, these are not usually supported for the cloud based services, like in the MS Online. This is also due the fact that the provisioning engine would not be standard and if all projects could implement their own provisioning engine, quality assurance required would increase enormously.&lt;/p&gt;  &lt;p&gt;Notice also that this model is not recommended due future plans of SharePoint. Interface is not yet deprecated, but I' would not bet my business on this one, even though it might sound really compelling.&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="3" width="500"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="middle" width="498"&gt;         &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/7065.clip_5F00_image001_5F00_3.png" width="24" height="21" /&gt;&lt;strong&gt;More information&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="498"&gt;&lt;font size="-2"&gt;           &lt;p&gt;&lt;i&gt;More information on provisioning providers can be found from following locations:&lt;/i&gt;&lt;/p&gt;            &lt;ul&gt;             &lt;li&gt;&lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebprovisioningprovider.aspx"&gt;MSDN - SPWebProvisioningProvider&lt;/a&gt;&lt;/em&gt; &lt;/li&gt;              &lt;li&gt;&lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms494133.aspx"&gt;MSDN - Provisioning portal sites&lt;/a&gt; &lt;/em&gt;&lt;/li&gt;           &lt;/ul&gt;         &lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt; &lt;a id="indetail"&gt;&lt;!--in detail--&gt;&lt;/a&gt;  &lt;h3&gt;   &lt;br /&gt;Web template option in detail&lt;/h3&gt;  &lt;p&gt;Let’s cover the web template option little bit more detailed, so that overall model is understood properly. Following picture defines the process steps for creating new site based on the web template.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/4341.image_5F00_12.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/1538.image_5F00_thumb_5F00_4.png" width="485" height="348" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="3" width="498"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="10"&gt;#&lt;/td&gt;        &lt;td valign="top" width="487"&gt;Description&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="10"&gt;1&lt;/td&gt;        &lt;td valign="top" width="487"&gt;When ever either site collection or farm scoped feature has been activated on the particular site with web templates, these templates are available from the Create functionality in similar way as site definitions.          &lt;br /&gt;          &lt;br /&gt;Web templates are deployed as features. If they are deployed as farm solution features, they are located in the 14 root folder, but obviously with Sandbox solutions, they are located in the content database. Element file define the preview picture, filtering options and the title visible in the create site functionality.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="10"&gt;2&lt;/td&gt;        &lt;td valign="top" width="487"&gt;When web template is selected, new site is created using onet.xml file definition located in the same feature folder as the element.xml file, which was responsible of introducing it. Notice also that this onet.xml file can only have one &lt;em&gt;Configuration&lt;/em&gt; element (with id 0).&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="10"&gt;3&lt;/td&gt;        &lt;td valign="top" width="487"&gt;In similar way as for site definitions, each feature referenced in the onet.xml file are activated in the order they are listed. When we create sub sites, web scoped features are activated, but if we use web template to provision site collection root site, also site scoped features are activated.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="10"&gt;4&lt;/td&gt;        &lt;td valign="top" width="487"&gt;As part of the site provisioning process, the just created site is associated to some existing site definition, preferable to some out of the box site definition. This definition association is defined in the web template element file or in the &lt;em&gt;WebTemplate&lt;/em&gt; element.           &lt;br /&gt;          &lt;br /&gt;This means that SPWeb.WebTemplate, SPWeb.Configuration and SPWeb.WebTemplateId properties are associated to some out of the box template. Meaning that we only used the alternative onet.xml instructions during site provisioning, but from that point forward, site is as any out of the box site… also when we upgrade the SharePoint deployment in future.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;There are minor limitations in the web template onet.xml file, meaning that certain elements are not supported there. These elements are not usually used or they can be replaced using approach to use feature activations. Following elements of the onet.xml file are not available for WebTemplate onet.xml schema.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Module element – Used normally for oob site definitions to provision default.aspx and other initial files to site as part of the site provisioning engine. Shouldn’t actually be used for site definitions either. You can provision the necessary files using features, which are referenced in the onet.xml file. We’ll cover this in upcoming chapters more detailed. &lt;em&gt;Note. This actually works, but it’s not supported based on MSDN article and shouldn’t be used anyway in onet.xml file, even though out of the box site definitions do so&lt;/em&gt;. &lt;/li&gt;    &lt;li&gt;Components – Not commonly used element. The Components &lt;font color="#000000"&gt;element&lt;/font&gt; specifies components to include in sites created through the definition.       &lt;ul&gt;       &lt;li&gt;FileDialogPostProcessor – Represents an interface in Microsoft SharePoint Foundation that is used for Web views in the file dialog boxes and forms of document libraries &lt;/li&gt;        &lt;li&gt;ExternalSecurityProvider – Represents an interface that returns custom information about the security used in Microsoft SharePoint Foundation for indexing by a search crawler on a portal &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;ServerEmailFooter - &lt;font color="#000000"&gt;The &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa544338.aspx"&gt;&lt;font color="#000000"&gt;ServerEmailFooter&lt;/font&gt;&lt;/a&gt; element specifies the footer section used in email sent from the server. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So what does this mean? – in similar way as in the classic minimal site definition, we should concentrate on provision and configure everything from the features, which are associated in the onet.xml file.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/6320.image23.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/4452.image23_5F00_thumb.png" width="333" height="155" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As mentioned already earlier, we cannot staple features to web templates, but there’s actually no reasons to do this. Why? – well… since web template onet.xml file is only used provisioning time of the site and it’s completely supported to update the web template onet.xml, if any changes are required. This means that we don’t actually have valid business case for feature stapling support, since we can handle the update using alternative approach. This is not actually that big a deal, since actually feature stapling can be extremely confusing in large deployments, since there’s no easy way to solve which features have been associated to which site definitions. &lt;/p&gt;  &lt;p&gt;One of the big advantages in web templates is the fact that we are able to provide new options to &lt;em&gt;Create site&lt;/em&gt; functionality without requirement to deploy site definitions. Since web templates are also supported if they are deployed as Sandbox solutions, we can utilize them also in hosting scenarios, like in MS Online (BPOS). This is huge advantage, since it solves one of the classic limitations of providing new templates in shared environment scenarios.&lt;/p&gt;  &lt;p&gt;Other advantages and extremely important thing to realize with web templates is the fact that we can utilize them even if we would use publishing features in our sites, meaning that we are creating WCM sites in SharePoint. There’s clear difference in this compared to site templates. Publishing features are not supported in site templates, but they are supported in web templates. &lt;/p&gt;  &lt;p&gt;I’ve had quite a few arguments also concerning the missing support of creating hierarchies with web templates compared to site definitions. We'll, to be precise, you can’t define hierarchies with site definitions directly, but if you utilize the portal web templates, we can create multiple sites from one option. This requires configuration in the WebTemp*.xml file, which we don’t have for the web templates. This is indeed one limitation, but as with any area of SharePoint there’s always workarounds… &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/4846.wlEmoticon_2D00_winkingsmile_5F00_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;If you have requirement to create multiple sites at once, which is completely common scenario for example when we want to create the initial hierarchy of the some global intranet, you have few different options. If it’s one time or few times hierarchy creation, it’s actually much more efficient to define the hierarchy in PowerShell script and use that for creation. Other option would be to use similar approach as was used for Report Center creation back in 2007 version. This means that you create your hierarchies from features, which are associated to your onet.xml file. Those who are familiar of SharePoint object model, definitely knows how easily this can be done from feature receiver.&lt;/p&gt;  &lt;p&gt;Whenever we need to reference to our custom web template for example for provision new site based on it, we’ll need to know the template name, which is defined for the WebTemplate element and also the GUID for the feature responsible of introducing that to SharePoint. So the format is as follows.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;{&lt;em&gt;FeatureGuid&lt;/em&gt;}#WebTemplateName &lt;/li&gt;    &lt;li&gt;So example would be - {7642399e-798a-4eaa-9214-e80175e91463}#News &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In following picture we provision new root web based on custom web template. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/3782.image_5F00_18.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/1134.image_5F00_thumb_5F00_5.png" width="495" height="125" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So, when we need to create site collection root site and create initial hierachy for the site collection, we can use following script. Notice that obviously your feature GUIDs and web template names will vary.&lt;/p&gt;  &lt;hr /&gt;  &lt;br /&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="495"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="493"&gt;         &lt;p&gt;&lt;font size="2"&gt;#set initial parameters              &lt;br /&gt;$name = &amp;quot;Vesku Corporation&amp;quot;               &lt;br /&gt;$url = &lt;/font&gt;&lt;a href="http://www.contoso.com"&gt;&lt;font size="2"&gt;http://www.contoso.com&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;              &lt;br /&gt;$scOwner = &amp;quot;contoso\administrator&amp;quot;               &lt;br /&gt;$template = &amp;quot;{8642399e-798a-4eaa-9214-e80175e91463}#Home&amp;quot; &lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font size="2"&gt;#Create site collection and provision the root web based on web template              &lt;br /&gt;New-SPSite -URL $url -Name $name -OwnerAlias $scOwner -Template $template&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font size="2"&gt;# Services section              &lt;br /&gt;New-SPWeb ($url + &amp;quot;/Services&amp;quot;) -template &amp;quot;{7642399e-798a-4eaa-9214-e80175e91463}#Section&amp;quot;-name &amp;quot;Services&amp;quot;               &lt;br /&gt;New-SPWeb ($url + &amp;quot;/Services/Consulting&amp;quot;) -template &amp;quot;{7642399e-798a-4eaa-9214-e80175e91463}#ContentLeft&amp;quot;-name &amp;quot;Consulting&amp;quot;&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font size="2"&gt;#Products section              &lt;br /&gt;New-SPWeb ($url + &amp;quot;/Products&amp;quot;) -template &amp;quot;{7642399e-798a-4eaa-9214-e80175e91463}#Section&amp;quot;-name &amp;quot;Products&amp;quot;               &lt;br /&gt;New-SPWeb ($url + &amp;quot;/Products/Widget&amp;quot;) -template &amp;quot;{7642399e-798a-4eaa-9214-e80175e91463}#ContentLeft&amp;quot;-name &amp;quot;Widget&amp;quot;&lt;/font&gt;&lt;/p&gt;          &lt;p&gt;&lt;font size="2"&gt;#About us section              &lt;br /&gt;New-SPWeb ($url + &amp;quot;/aboutus&amp;quot;) -template &amp;quot;{7642399e-798a-4eaa-9214-e80175e91463}#Section&amp;quot;-name &amp;quot;About us&amp;quot;               &lt;br /&gt;New-SPWeb ($url + &amp;quot;/aboutus/company&amp;quot;) -template &amp;quot;{7642399e-798a-4eaa-9214-e80175e91463}#ContentLeft&amp;quot;-name &amp;quot;Company&amp;quot;               &lt;br /&gt;New-SPWeb ($url + &amp;quot;/aboutus/directors&amp;quot;) -template &amp;quot;{7642399e-798a-4eaa-9214-e80175e91463}#ContentRight&amp;quot;-name &amp;quot;Directors&amp;quot; &lt;/font&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;br /&gt;  &lt;hr /&gt;  &lt;p&gt;With web templates, there’s however one big disadvantage or case where they cannot be used. This is when your technical multilingual solution would be based on &lt;em&gt;variation&lt;/em&gt; functionality. Variations can be used for providing multilingual solution for your solution when hierarchies between the different languages are identical (or almost identical). Variations work in a way that you select one language or hierarchy to be your primary language and other site hierarchies for are created based on this primary language.&lt;/p&gt;  &lt;p&gt;In 2010, the variation functionality was changed to be timer job based, so there’s timer job, which ensures that the sites are copied properly between different variations, based on changes in root language. Since we don’t have any out of the box indication in sites that they have been created using web template, this timer job is unaware of the fact that template information in &lt;em&gt;SPWeb&lt;/em&gt; object is not valid, since that refers only to some base site definition. &lt;/p&gt;  &lt;p&gt;There’s unfortunately no workaround for this limitation concerning web templates currently, but let’s hope that variation functionality would be fixed to be aware of some indication on the used web template soon, maybe in some service pack. This does not however mean that you can’t do multilingual sites with web templates; it only means that you can’t use variations with web templates. Good examples of multilingual sites without variations is for example my &lt;em&gt;old&lt;/em&gt; baby from back in autumn 2007, which has numerous different languages, like the following: &lt;a href="http://www.kone.cn"&gt;www.kone.cn&lt;/a&gt;, &lt;a href="http://www.kone.de"&gt;www.kone.de&lt;/a&gt; and &lt;a href="http://www.kone.ru"&gt;www.kone.ru&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Additional design guidelines for web templates&lt;/h3&gt;  &lt;p&gt;Now we have covered the key concepts of the web templates. Let’s also cover few guidelines for implementing these web templates in a way that we’ll follow good practices and increase the maintainability of our sites.&lt;/p&gt;  &lt;p&gt;One of the key things to consider is the upgrade and maintenance model of the web templates. As experienced SharePoint developers know, the quality of the code and design is actually evaluated during the upgrade of these customizations. To improve maintainability and upgradability of your web templates or actually sites, created based on your web template, we should always create specific default web scoped feature for each of the web templates. Let’s clarify this more detailed in picture below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/1641.image_5F00_16.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/0160.image_5F00_thumb_5F00_7.png" width="490" height="204" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="3" width="499"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="10"&gt;#&lt;/td&gt;        &lt;td valign="top" width="487"&gt;Description&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="10"&gt;1&lt;/td&gt;        &lt;td valign="top" width="487"&gt;Obviously we can have miscellaneous amount of features referenced in our onet.xml, which are responsible of creating the required structures. You should however consider that could you associated your SharePoint project items actually to default feature, since each feature activation will have impact on the time required for site provisioning, so less is good, especially since we can associated the SPIs easily in VS2010.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="10"&gt;2&lt;/td&gt;        &lt;td valign="top" width="487"&gt;Default &lt;em&gt;hidden &lt;/em&gt;web scoped feature dedicated for the particular web template defined as the final feature under the WebFeatures section in the onet.xml file. This feature will be responsible of provisioning the welcome page of the site (default.aspx) and other structures required in the site.           &lt;br /&gt;          &lt;br /&gt;This feature should also stamp the identifier of the web template to site property bag. This identifier would be the WebTemplate name used of the particular, which is being created.           &lt;br /&gt;          &lt;br /&gt;We’ll demonstrate this in the example later in this article.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;As mentioned, the default web scoped feature should be marked as hidden, so that it’s not accidently deactivated from user interface. This is also the feature, which we’ll use as part of our versioning model, since whenever we need to change the existing sites, we would have possibility to target our new customizations by versioning this particular feature. This way you can easily write the required feature upgrade actions and apply them to proper sites.&lt;/p&gt;  &lt;p&gt;So the hidden feature is for versioning the already provisioned sites and the versioning of the actual web template can be just done simply by updating its onet.xml.&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="3" width="500"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="middle" width="498"&gt;         &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/7065.clip_5F00_image001_5F00_3.png" width="24" height="21" /&gt;&lt;b&gt;Note&lt;/b&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="498"&gt;&lt;font size="-2"&gt;           &lt;p&gt;&lt;i&gt;More information concerning feature versioning support in SharePoint 2010 can be found from following locations:&lt;/i&gt;&lt;/p&gt;            &lt;ul&gt;             &lt;li&gt;&lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/sharepoint/ff420387.aspx#lesson2"&gt;MSDN – Application life cycle for SharePoint 2010&lt;/a&gt; – video and presentation&lt;/em&gt; &lt;/li&gt;              &lt;li&gt;&lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa544511.aspx"&gt;MSDN – Upgrade features&lt;/a&gt;&lt;/em&gt; &lt;/li&gt;              &lt;li&gt;&lt;a href="http://www.sharepointnutsandbolts.com/2010/06/feature-upgrade-part-1-fundamentals.html"&gt;Chris O’Brien – Feature Upgrade series&lt;/a&gt; – excellent series of articles concerning feature upgrade practices &lt;/li&gt;           &lt;/ul&gt;         &lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;One of the challenges in SharePoint 2010 web template provisioning and actually also in site definition provisioning is the fact that if you provision sub sites to already existing site collection, none of the site scoped features mentioned in onet.xml file are activated out of the box, like it was the case in SharePoint 2007 for site definitions. Someone might say that this functionality was already a bug in 2007 and now it’s fixed, but add us small challenge.&lt;/p&gt;  &lt;p&gt;Quite often in projects you’d like to introduce some new functionalities after the initial version of the collection has been already created. Let’s image following case: We have existing corporate intranet and we’d like to add new events functionality to the intranet. Events functionality will include web parts, content types and some page layouts. It will also include some other configurations. Wouldn’t it be nice, if all of these required artifacts would be provisioned when I create the &lt;em&gt;Events&lt;/em&gt; sub site, if they are missing.&lt;/p&gt;  &lt;p&gt;Well in this case, due the required scope of the artifacts (page layouts, content types, web parts), we would be forced to first activate the features in certain order, to be able to create the sub site, which consumes them. Not necessarily big deal, but definitely also not optimal one either. Following picture defines solutions for this case.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/2046.image_5F00_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/1072.image_5F00_thumb_5F00_1.png" width="498" height="309" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Solution is to create web scope feature, which will verify that the required site collection scoped features are activated. If they are missing, feature receiver would activate those. This is relatively simple feature and only few lines of code, but it provides us a way to create completely isolated and independent web templates, which will create all required structures required for the particular functionality.&lt;/p&gt;  &lt;p&gt;The only downside of this solution is the fact when we create sub sites from user interface, SharePoint 2010 will check that all site collections scoped features mentioned in onet.xml are actually activated. This means that this workaround works when you create your sites from PowerShell or if you don’t list your site collection scoped feature at all in the &lt;em&gt;SiteFeatures &lt;/em&gt;elements. I completely understand the checking and verification, but it’s not implemented in most optimal way.&lt;/p&gt;  &lt;p&gt;We’ll cover required code for this in our step-by-step guidance later in this article.&lt;/p&gt; &lt;a id="stepbystep"&gt;&lt;!--stepbystep--&gt;&lt;/a&gt;  &lt;h3&gt;Step by step creation of new publishing web template&lt;/h3&gt;  &lt;p&gt;In this chapter, we’ll create new globally available web template, which will use publishing features to enable efficient content editing experience. We’ll do this steps by step, including the concepts defined above.&lt;/p&gt; &lt;a id="initial"&gt;&lt;!--initial--&gt;&lt;/a&gt;  &lt;h4&gt;Setup initial structures&lt;/h4&gt;  &lt;p&gt;Let’s start by creating the necessary initial structures. Since my background in from 2007, I always start by thinking the overall layout of features and then I associate the required SharePoint projects items to them.&lt;/p&gt;  &lt;p&gt;Start Visual Studio 2010 and choose Empty SharePoint project as your starting point&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Personally I always start with empty project template, since you get the same wizards as from other templates when you add particular SharePoint project items (SPI) to your project. &lt;/li&gt;    &lt;li&gt;In my case I named the solution as Contoso.Intranet.WebTemplates, so that it follows the general guidance for naming your SharePoint solutions uniquely &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Choose the solution to be farm solution, since in this case we want to deploy our template globally. As mentioned earlier, you could also deploy your template only in site collection level. &lt;/p&gt;  &lt;p&gt;Notice that we follow few naming guidance's for the features, which are creating. This is done to optimize the developer productivity by providing easy overall picture of the solution just by viewing the solution structure in &lt;em&gt;Solution Explorer&lt;/em&gt; or in the &lt;em&gt;Packaging Explorer&lt;/em&gt;. We’ll also hide all features, which should not be touched by end users to avoid any issues after initial deployment.&lt;/p&gt;  &lt;p&gt;Let’s add a new feature to your project with following attributes. This will the default web scoped feature, which will be responsible of deploying welcome page and do other web (or site) specific configurations.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Title: &lt;em&gt;Contoso.Intranet.WebTemplates - Site - Default&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Scope: &lt;em&gt;Site&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Is Hidden: &lt;em&gt;True&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Feature node name: &lt;em&gt;SitePublishingWebTemplateDefault&lt;/em&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Let’s add another feature to your project with following attributes. This feature will be responsible of deploying all site collection scoped configurations, which the site will consume. In this case, this includes content types and page layouts. This feature will be also used as the versioning model for the existing sites, whenever there’s some changes required. With this I mean that since the feature is hidden it should be active and available in every site which were based on this upcoming web template and therefore we can easily upgrade them by using the new feature versioning capabilities in SharePoint 2010.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Title: &lt;em&gt;Contoso.Intranet.WebTemplates - Web- Default&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Scope: &lt;em&gt;Web&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Is Hidden: &lt;em&gt;True&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Feature node name: &lt;em&gt;WebPublishingWebTemplateDefault &lt;/em&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;We’re still missing some required structures, so add third feature, which will be responsible of activating the default site collection scoped feature in case that we create sub sites. As mentioned above, this is due the fact that if you create sub sites, the site collection scoped features won’t be activated in SharePoint 2010 without little help. We’ll implement this as generic feature, so that &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Title: &lt;em&gt;Contoso.Intranet.WebTemplates - Web- Default&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Scope: &lt;em&gt;Web&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Is Hidden: &lt;em&gt;True&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Feature node name: &lt;em&gt;WebEnsureSiteScopedFeature&lt;/em&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So at this point we have all features, which will be associated to actual web template, but we still need to create the feature responsible deploying it or feature, which will be responsible of telling for SharePoint that the template is available. We’ll do this with farm scoped feature, so that when ever the solution package has been deployed, there’s new web template available through out the farm.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Title: &lt;em&gt;Contoso.Intranet.WebTemplates - Farm - Web Template deployment&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Scope: &lt;em&gt;Farm&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Is Hidden: &lt;em&gt;False&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Feature node name: &lt;em&gt;FarmWebTemplateDeployment&lt;/em&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;After this your Visual Studio Solution Explorer should look like in following picture.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/4214.image_5F00_5.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/1172.image_5F00_thumb.png" width="309" height="198" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;a id="spis"&gt;&lt;!--spis--&gt;&lt;/a&gt;  &lt;h4&gt;Creating required SharePoint project items&lt;/h4&gt;  &lt;p&gt;In this business case, we’re creating new complete web template, which has also publishing features enabled. Quite often you’ll need to add new site columns to out of the box &lt;em&gt;Page&lt;/em&gt; or &lt;em&gt;Welcome Page &lt;/em&gt;content types (it would be long debate which one to use in WCM cases, so let’s not go there…) and therefore you’ll need to create your own content type. As you probably already know, creating new content types is relatively straight forward in the SharePoint 2010 development, so let’s not concentrate on details of getting these elements in, rather on the web template specific features.&lt;/p&gt;  &lt;p&gt;I tend to group my SPI’s under SP folder and to specific sub folders to make the overall structure more easier to track. This is especially important in larger projects, which have multiple Visual Studio projects in them, but that’s a completely another blog entry (maybe in future :-).&lt;/p&gt;  &lt;p&gt;We’ll nevertheless have the following folder structure as the starting point for following SPIs. We have already created the required custom content type and the page layout, which our web template will use by default.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/7532.image_5F00_20.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/8422.image_5F00_thumb_5F00_8.png" width="262" height="299" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Most important SPI is the welcome page module for the WebTemplate. This SPI will be associated to default web scoped feature, which will be activated as part of the site provisioning process. So how do we do that? Let’s click the &lt;em&gt;Module&lt;/em&gt; folder and choose to add new Module element. We’ll name the module as &lt;em&gt;MOPublishingtemplateWelcomePage&lt;/em&gt;. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/7851.image_5F00_10.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/2654.image_5F00_thumb_5F00_2.png" width="448" height="145" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You might again wonder the silly prefix for the module, but that’s also for increasing the developers productivity in larger projects. It will help to identify your individual elements in the &lt;em&gt;Feature Designer&lt;/em&gt; and in the &lt;em&gt;Packaging Explorer&lt;/em&gt; when you have tens of SPIs in your Visual Studio solution. &lt;/p&gt;  &lt;p&gt;By default Visual Studio provides as example text file to be deployed, which we can completely remove, since we don’t use it in this case.&lt;/p&gt;  &lt;p&gt;Since this is WCM site, we’ll need to have the default redirection page included in this module and to associate it properly to pages library with required attributes. Attributes in this case refer to page layout and content type which we want to use. We can copy the out of the box redirection page from SharePoint structures. This can be done by copying the default.aspx file for example from the following location: &lt;em&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\SiteTemplates\PUBLISHING&lt;/em&gt;. Notice that we’ll need to copy default.aspx page, which is used out of the box for publishing sites, not for foundation sites (big difference).&lt;/p&gt;  &lt;p&gt;Following thing is to update the elements.xml file of the just created &lt;em&gt;Module &lt;/em&gt;SPI with the following values:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515"&gt;xml &lt;/span&gt;&lt;span style="color: red"&gt;version&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;1.0&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;encoding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Module &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Home&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Url&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;$Resources:osrvcore,List_Pages_UrlName;&lt;/span&gt;&amp;quot; 
          &lt;span style="color: red"&gt;Path&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;MOWelcomePagePublishingWebTemplate&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;File &lt;/span&gt;&lt;span style="color: red"&gt;Url&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;default.aspx&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Type&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;GhostableInLibrary&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Level&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Draft&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Property &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Title&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Welcome&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Property &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;PublishingPageLayout&lt;/span&gt;&amp;quot;
                      &lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;~SiteCollection/_catalogs/masterpage/
                      ContosoWelcomeLinks.aspx, Contoso Template&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Property &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ContentType&lt;/span&gt;&amp;quot; 
                &lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;ContosoIntranetWebTemplatesPage&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;File&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Module&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Notice that we refer to our custom page layout (&lt;em&gt;ContosoWelcomeLinks.aspx&lt;/em&gt;) and to custom content types (&lt;em&gt;ContosoIntranetWebTemplatespage&lt;/em&gt;) in the properties. This will set the default settings properly for the page layout when the site is provisioned.&lt;/p&gt;

&lt;p&gt;Since by default our custom content type is not available in the &lt;em&gt;pages &lt;/em&gt;library, we’ll need to create additional SPI for it. This can be done by adding new &lt;em&gt;empty element&lt;/em&gt; under the &lt;em&gt;ContentTypeBindings&lt;/em&gt; folder. Element file should be updated as follows (obviously with the full GUID of the content type):&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515"&gt;xml &lt;/span&gt;&lt;span style="color: red"&gt;version&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;1.0&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;encoding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ContentTypeBinding &lt;/span&gt;&lt;span style="color: red"&gt;ContentTypeId&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;[ContentTypeGUID]&lt;/span&gt;&amp;quot; 
                      &lt;span style="color: red"&gt;ListUrl&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;pages&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;

&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Since SharePoint provisioning is based on the order of the element files in the feature definition, we’ll need to ensure that the content type binding SPI (&lt;em&gt;CBPublishingSite&lt;/em&gt;) is listed above the welcome page SPI (&lt;em&gt;MOWelcomePagePublishingWebTemplate&lt;/em&gt;) in the &lt;em&gt;Feature Designer&lt;/em&gt;. If that’s not the case in your environment, remove the items from the feature and associate the in correct order (in larger deployments you might want to do this by updating the order inside the VS structure).&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/4237.image_5F00_22.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/2063.image_5F00_thumb_5F00_9.png" width="503" height="249" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;We are still missing one SPI, which will be responsible of adding the upcoming web template identifier to site’s property bag, so that after we have traceability on the used web templates and we can easily solve which template was used to provision particular site. As mentioned earlier, since the &lt;em&gt;SPWeb.WebTemplate&lt;/em&gt; and &lt;em&gt;SPWeb.Configuration&lt;/em&gt; properties will be “&lt;em&gt;stamped&lt;/em&gt;” using some out of the box identifiers, those cannot be used to identify the template. Not a big deal, since it only requires one more SPI to be created.&lt;/p&gt;

&lt;p&gt;Let’s create new empty SPI to new &lt;em&gt;PropertyBag&lt;/em&gt; folder and update it content as follows. Notice how the use the new &lt;em&gt;ProperbyBag&lt;/em&gt; element in feature framework to add entries to &lt;em&gt;SPWeb&lt;/em&gt; property bag. &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515"&gt;xml &lt;/span&gt;&lt;span style="color: red"&gt;version&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;1.0&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;encoding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PropertyBag &lt;/span&gt;&lt;span style="color: red"&gt;ParentType&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Web&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Property &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;contoso.intranet-webtemplateid&lt;/span&gt;&amp;quot; 
              &lt;span style="color: red"&gt;Type&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;WTPublishingSite&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;PropertyBag&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;

&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&lt;font color="#800000"&gt;This is the most important thing to remember in your web template development, so don’t skip this step, since otherwise you have no traceability on the created sites.&lt;/font&gt;&lt;/strong&gt; Why is that so important? – For easy maintenance and upgrade models, this information could be required… there’s actually other ways to do same things, but this is easy and most straight forward way to stamp the item.&lt;/p&gt;

&lt;p&gt;Remember to also ensure that the property bag entry SPI is associated to correct feature (&lt;em&gt;WebPublishingWebTemplateDefault&lt;/em&gt;). Order does not actually matter in this case.&lt;/p&gt;

&lt;p&gt;Now we have all the required SPIs for the web template in this case. Obviously you could have created other SPIs as well, for example to provision new list structures as part of the site provisioning. After this your &lt;em&gt;Visual Studio Solution Explorer&lt;/em&gt; should look like in following picture. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/2570.image_5F00_24.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/3582.image_5F00_thumb_5F00_10.png" width="274" height="406" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;a id="webtempelement"&gt;&lt;!--webtempelement--&gt;&lt;/a&gt;

&lt;h4&gt;Creating WebTemplate element&lt;/h4&gt;

&lt;p&gt;Since there’s no out of the box SPI template for web templates, we’ll need to create it using standard empty element. Let’s add new empty element under the WebTemplates folder and modify it as follows (in my case I named it as WTPublishingSite):&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515"&gt;xml &lt;/span&gt;&lt;span style="color: red"&gt;version&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;1.0&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;encoding&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;?&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;WebTemplate
           &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;WTPublishingSite&lt;/span&gt;&amp;quot;
           &lt;span style="color: red"&gt;BaseTemplateName&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;CMSPUBLISHING&lt;/span&gt;&amp;quot;
           &lt;span style="color: red"&gt;BaseTemplateID&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;39&lt;/span&gt;&amp;quot;
           &lt;span style="color: red"&gt;BaseConfigurationID&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;0&lt;/span&gt;&amp;quot;
           &lt;span style="color: red"&gt;Title&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Example Publishing Site&lt;/span&gt;&amp;quot;
           &lt;span style="color: red"&gt;Description&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Custom publishing web template&lt;/span&gt;&amp;quot;
           &lt;span style="color: red"&gt;DisplayCategory&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Contoso Publishing&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Elements&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;

&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Notice how we customized the display group entry. This is the key introduction file, which can be used to control web template visibility for example that can it be used to create new site collections or not. If the web template has been deployed as farm feature and you only allow it to be used as sub sites, it would not be listed in the central admin as one of the options. This can be controlled by using &lt;em&gt;SubWeb&lt;/em&gt; attribute (note. unfortunately there seems to be bug with this one at least with the RTM to august cumulative and the attribute doesn’t have any meaning at the moment – hopefully it will be fixed soon).&lt;/p&gt;

&lt;p&gt;Notice also the &lt;em&gt;BaseTemplateName&lt;/em&gt;, &lt;em&gt;BaseTemplateID&lt;/em&gt; and &lt;em&gt;BaseConfigurationID&lt;/em&gt; – as mentioned earlier, these have to refer to some existing site definition. We don’t use any of the content from that site definition, but this information is used to “&lt;em&gt;stamp&lt;/em&gt;” the created web with some site definition identifier. &lt;/p&gt;

&lt;p&gt;Only thing missing is the Onet.xml file, which actually defines in detail site provisioning tasks. In this case we are creating publishing feature based web template, so easiest way to get started is to copy the onet.xml file available from following folder: &lt;em&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\SiteTemplates\BlankInternet\XML&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let’s copy that to &lt;em&gt;WTPublishingSite&lt;/em&gt; SPI, right next to element.xml file in Visual Studio (drag and drop). First thing we’ll need to update is the properties of the onet.xml file to ensure that it’s deployed as part of the SPI. Just activate the file in the Visual Studio Solution Explorer and ensure that properties are as follows.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/5228.image_5F00_26.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/4743.image_5F00_thumb_5F00_11.png" width="392" height="204" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This will ensure that the file is packaged by the Visual Studio 2010 to the solution package, based on the associations in the Feature Designer. Following thing is to make the required updates on the onet.xml file. Onet.xml file structure for the web templates is completely identical as for the site definitions, except that there’s few elements, which are not supported. These elements are not actually that meaningful even for site definitions, since same functionality could be always provided using alternative approaches, like from feature receivers etc. I won’t go to details of the onet.xml structure too much, since that is a huge topic, but I’ll cover the key changes done in this case.&lt;/p&gt;

&lt;p&gt;Let’s first start by removing cleaning up all unnecessary elements. We’ll get rid of following sections in the onet.xml file:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Document templates 
    &lt;ul&gt;
      &lt;li&gt;Not meaningful for demo and could be done from feature anyway &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;Other configurations than configurations –1 and 0 – meaning getting rid of configurations 1 and 2 
    &lt;ul&gt;
      &lt;li&gt;With web templates, the 0 is the only valid configuration &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;Modules 
    &lt;ul&gt;
      &lt;li&gt;Referring to those listed in the bottom of the onet.xml file, we don’t need these either, since we’ll provision the default page from feature as well. &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If it would be out of the box team site template, we’d also get rid of all the list instances, since those can be done more easily from features. &lt;/p&gt;
&lt;a id="association"&gt;&lt;!--association--&gt;&lt;/a&gt;

&lt;h4&gt;Associating features to web template&lt;/h4&gt;

&lt;p&gt;Association of feature to onet.xml can be done easily as you might know from site definition development. We’ll first need to solve the identifier and scope of the feature to be associated and then we’ll just include that to proper location. Since we can activate site collection and web scoped features from onet.xml file, there are separate places for these. If you associate site collection feature, it has to be listed under the &lt;em&gt;SiteFeatures&lt;/em&gt; element and all web scope features are listed under the &lt;em&gt;WebFeatures&lt;/em&gt; element.&lt;/p&gt;

&lt;p&gt;In this case we have three different custom features, which we should associate to proper places in the onet.xml file. By default you’d add the site collection scoped feature to SiteFeatures section, but since we want this feature to be activated automatically as part of our provisioning technique, we can’t do that. This is due the checking SharePoint does for sub sites. If template has site collection scoped feature, which is not activated, you’d get following error when you create the site from user interface.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/7888.image_5F00_28.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/2502.image_5F00_thumb_5F00_12.png" width="448" height="222" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we’ll need to be little bit cleaver with our solution. &lt;/p&gt;

&lt;p&gt;Let’s add a feature to our onet.xml file, which will be responsible of activating the site collection feature automatically, if web template is used for sub site creation. We’ll create the necessary code for the feature receiver in following chapter, but we can already add this required xml elements. Idea is that we can define which site collection scoped feature will be activated using feature properties. Since we want to ensure that the site collection scoped feature is activated before any web scoped features, we’ll need to add this as the first feature in the WebFeatures section, like in the following snipped.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;WebFeatures&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;!-- &lt;/span&gt;&lt;span style="color: green"&gt;Custom Site collection scoped feature activation &lt;/span&gt;&lt;span style="color: blue"&gt;--&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Feature &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;6e018893-bd28-44da-8048-a9752ca9d4ae&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Properties &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Property &lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;SiteScopedGUID&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;79b93e74-ce13-49d1-825b-5007feb8d481&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Properties&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Feature&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Notice that the above feature is custom feature, so it’s up to us which kind of feature properties are implemented.&lt;/p&gt;

&lt;p&gt;Following step is to add the provisioning of welcome page, which we implemented in previous chapter. Since we want all structures be ready, before we provision our welcome page and optionally do some additional customizations from feature receiver, we associate this feature as the final feature to &lt;em&gt;WebFeatures&lt;/em&gt; section, like in the following snipped.&lt;/p&gt;

&lt;pre class="code"&gt;            &lt;span style="color: blue"&gt;&amp;lt;!-- &lt;/span&gt;&lt;span style="color: green"&gt;Welcome page provisioning for the web template &lt;/span&gt;&lt;span style="color: blue"&gt;--&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Feature &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;5bd39d1e-9e39-4e4f-932c-eb393b5454a4&lt;/span&gt;&amp;quot; &lt;span style="color: blue"&gt;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;WebFeatures&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Modules &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Configuration&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Configurations&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Notice that this is also the feature, which can do any customizations for just created site; since possible feature receiver in this feature is executed after all other configurations are applied. So for example if you’ll need to do some web part connections for the welcome page, this could be done in this feature, since welcome page is first deployed and then our feature receiver is executed.&lt;!--receivers--&gt;&lt;/p&gt;

&lt;h4&gt;Adding code for the feature receivers&lt;/h4&gt;

&lt;p&gt;Let’s move to add the necessary code for our feature receivers or actually to only one in this case. Required code was to activate the site collection scoped feature, which has been referenced in the &lt;em&gt;WebFeatures&lt;/em&gt; section. So let’s right click &lt;em&gt;WebEnsureSiteScopedFeature&lt;/em&gt; in our project structure and create the required feature receiver for the feature.&lt;/p&gt;

&lt;p&gt;You can comment out other methods, than the FeatureActivated method, which is executed when feature is activated as part of the site provisioning. Let’s update that as in the following code example. &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public override void &lt;/span&gt;FeatureActivated(
                       &lt;span style="color: #2b91af"&gt;SPFeatureReceiverProperties &lt;/span&gt;properties)
       {
           &lt;span style="color: green"&gt;//Ensure that scope is correctly set
           &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(properties.Feature.Parent &lt;span style="color: blue"&gt;is &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SPWeb&lt;/span&gt;)
           {
               &lt;span style="color: #2b91af"&gt;SPWeb &lt;/span&gt;web = (&lt;span style="color: #2b91af"&gt;SPWeb&lt;/span&gt;)properties.Feature.Parent;
               &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;SPFeatureProperty &lt;/span&gt;property 
                               &lt;span style="color: blue"&gt;in &lt;/span&gt;properties.Feature.Properties)
               {
                   &lt;span style="color: #2b91af"&gt;Guid &lt;/span&gt;featureGuid = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Guid&lt;/span&gt;(property.Value);
                   &lt;span style="color: green"&gt;//Verify feature status
                   &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SPFeature &lt;/span&gt;feature = web.Site.Features[featureGuid];
                   &lt;span style="color: blue"&gt;if &lt;/span&gt;(feature == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
                   {
                       &lt;span style="color: green"&gt;//Activate site collection scoped feature, 
                       //if requested and not currently activated
                       &lt;/span&gt;web.Site.Features.Add(featureGuid);
                   }
               }
           }
       }&lt;/pre&gt;

&lt;p&gt;So what do we do in the code? – We’ll read the GUIDs from the feature properties and activate, if they are not activated. This way we can activate site collection scoped features also from web scope feature, which provided us the way to encapsulate all features part of the web template to single provisioned package. You might want to improve the error handling and logging in real scenario, but this is fine for demonstration purposes.&lt;/p&gt;
&lt;a id="testing"&gt;&lt;!--testing--&gt;&lt;/a&gt;

&lt;h4&gt;Testing and ensuring that it’s working&lt;/h4&gt;

&lt;p&gt;So how do we test the functionality? You actually don’t want to just start debugging with default settings, since Visual Studio 2010 would activate the site collection scoped feature for you automatically based on the &lt;em&gt;ActivateOnDefault&lt;/em&gt; setting of the particular feature. This is nice for debugging point of view, but that’s not actually the way it works in real life or when you deploy your customizations from development environment to production environment. &lt;em&gt;ActivateOnDefault&lt;/em&gt; attribute for site collection scoped features is only valid for Sandbox solutions, but not when farm solutions are used, so let’s try to verify the functionality using alternative approach.&lt;/p&gt;

&lt;p&gt;Before deploying, verify that you have &lt;em&gt;No Activation&lt;/em&gt; as the &lt;em&gt;Active Deployment Configuration &lt;/em&gt;for your Visual Studio solution, so that features are installed, but not activated. This can be controlled from project properties. Deploy your customization or you can also start by debugging for verifying the functionality. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/8054.image_5F00_30.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-81-08-metablogapi/0451.image_5F00_thumb_5F00_13.png" width="431" height="266" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Not that compelling, but demonstrates the web template functionality quite nicely, so it’s cool template – Yes I’m a geek.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Example project found from &lt;a href="#references"&gt;reference list&lt;/a&gt; will also contain example web template for custom collaboration or team site. Collaboration example has been only modified slightly compare to out of the box team sites, but it still has the same upgrading or maintaining support etc. There’s also example of adding web parts to welcome pages from the default web scoped feature. Nothing actually new there for web templates, meaning that same model as for site definitions will work there as well.&lt;/p&gt;
&lt;a id="faq"&gt;&lt;!--faq--&gt;&lt;/a&gt;

&lt;h3&gt;Web Template FAQ&lt;/h3&gt;

&lt;p&gt;In this section we’ll cover few of the most common questions concerning web templates. Most of the questions have been already covered more detailed earlier, but just to summarize them.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“I associated my web template to some existing site definition, what is used from the root site definition’s onet.xml file?” &lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Absolutely nothing. Onet.xml of the web template will completely replace the referenced site definition during provisioning. Model is actually identical as if you would be using the new &lt;em&gt;CustomSchema&lt;/em&gt; attribute available for list instances. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;“When I use site definitions, object properties will get recorded correctly (SPWeb.WebTemplate etc.), so I’m unable to track which sites were created using which template. This is huge disadvantage on web template. “&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;That is true, but nevertheless you’ll need to write some logic to access those properties in your custom code. It’s as easy to access the property bag of the &lt;em&gt;SPWeb &lt;/em&gt;&lt;strong&gt;as long &lt;/strong&gt;as you remember to add the information there as suggested earlier in this article. &lt;/li&gt;

  &lt;li&gt;You actually never know what features have been activated on top of the initial site definition, so the advance of having exact identifier available is not actually even that important. In upgrade or maintenance scenarios, we’ll nevertheless need to figure out the actual features which have been activated. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;“Why wasn’t the requirement to stamp the SPWeb to site definition removed or support to use the web template identification information added for that? “&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;This is due the backward compatibility requirements. If these would have been completely removed, there would have been lot of the custom code developed by you and me, which would not worked in SharePoint 2010. These properties are also one of the core properties of the whole SharePoint platform, so changing those would cause huge quality assurance activities. &lt;/li&gt;

  &lt;li&gt;Those of you who been working in R&amp;amp;D definitely understand the historical legacy products are carrying – let’s not go too much details on this. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;“You can use the WebTemp*.xml to define the portal hierarchy to be created using the portal site template approach. If I use web template approach, there’s no way to do the same.” &lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;True, since the WebTemp*.xml file is not created or required, since all web template related files are actually stored in the database and WebTemp*.xml file changes requires deployment of the files to file system of the servers. &lt;/li&gt;

  &lt;li&gt;As covered earlier in this article, there’s two different workarounds for this. For in-frequent use, you should be using PowerShell for the hierarchy creation and if you constantly create multiple sites at once, you can easily achieve this from feature receiver. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;“What about BPOS (MS Online) and generally other hosting companies? “&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Generally, like for BPOS, web template is supported way to deploy your customizations, since that way individual sites can be more easily upgraded in future versions. If you create site definitions to some deployment, migrating that to cloud could be enormous effort. By utilizing the web template approach, you provide more flexibility for that deployment also in long run. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;“I heard that WebTemplate element is designed only for Sandbox solutions, is this true? “&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;No. WebTemplate element is part of the feature definition schema and it’s available also for full trust solutions. References to Sandbox solutions are only caused by the fact that it has been the most visible usage for the WebTemplate element in public demos. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;“When I’m creating my web template I need to decide to which out of the box site definition it will be associated. Does the definition actually matter, couldn’t I choose any of them? “&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Yes you could, but it’s better to choose as close as possible similar site definition as your custom web template. Meaning that if you create publishing web template, associate it to out of the box publishing site definition and similarly when you’re creating for example enhanced team sites. This is just due the fact that it will most likely help in your future upgrade to following SharePoint version. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;“Provisioning providers can be as easily updated as web templates, why would I use web template model? If I create my site based on some out of the box site and then activate what ever is required in my own provider? “&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Since provisioning provides will be completely based on custom code, they indeed can be easily upgraded, but this comes down on standardization of development and future considerations concerning deployment. When developers are moving between different companies and projects, it would be good that we would have standardized process for site provisioning. If you base your solution to provisioning provider, it’s custom code, which is not standard. &lt;/li&gt;

  &lt;li&gt;Other consideration is the deployments future. Web templates are also supported usually by hosting providers (like MS Online), but provisioning providers not. Even though requirement for cloud based solution is not in the objective of the first release, it doesn’t mean that it couldn’t be popping up in future. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;“Somebody was discussing this concept called feature groups – which would be excellent way to just define what features would be activated when site is created. Onet.xml is so complicated, why can’t this be more simplified“&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;em&gt;Who knows what the future brings&lt;/em&gt; (some do, but they are not telling… :-), but basically if you follow up the guidance of provisioning everything from features, not from onet.xml file, you actually have similar functionality. You only need to concentrate on what features will be activated and on which order. It’s not even close rocket science… especially since I got it… &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;“I heard that variations doesn’t work with web templates – is this true?”&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Yes, this is really unfortunate limitation, but it only affects the variations and it’s actually quite understandable, since there’s no out of the box way to indicate that site was created using custom web template. Variation functionality is dependent on the site definition information available from the &lt;em&gt;SPWeb&lt;/em&gt; level and it has no glue that the site has been created using alternative onet.xml file. &lt;/li&gt;

  &lt;li&gt;This does not however mean that you couldn’t do multilingual sites, since variation is only way to do this and quite often it’s not usable due differences between the hierarchies in language versions. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;a id="summary"&gt;&lt;!--summary--&gt;&lt;/a&gt;

&lt;h3&gt;Summary&lt;/h3&gt;

&lt;p&gt;So, when should I be using web templates? – This is commonly asked question. Answer is actually extremely simple: Whenever possible. Web template provides highest flexibility for maintenance and easy upgradability support. It provides also easy way to to provide templates only in site collection level, not always throughout the farm, like with site definitions. They can be freely updated based on new technical and business requirements. &lt;/p&gt;

&lt;p&gt;If for some reasons you still choose to use site definitions, you’ve already impacted enormously to the future of the particular deployment. What if in long run they’d like to move to use some cloud service? – if site definitions have been used, it’s impossible or you have to create separate migration project first to get the content from custom definitions to web templates. Those who’ve been involved since SP2003, can remember those &lt;em&gt;jolly&lt;/em&gt; upgrade projects we had from 2003 to 2007. &lt;/p&gt;

&lt;p&gt;Let’s try to avoid unnecessary complexity and consider the consequences of our decisions we make with custom architectures and customizations.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“The purpose of software engineering is to control complexity, not to create it.”&lt;/em&gt; – Dr. Pamela Zave&lt;/p&gt;
&lt;a id="references"&gt;&lt;!--ref--&gt;&lt;/a&gt;

&lt;h3&gt;
  &lt;br /&gt;References and links&lt;/h3&gt;

&lt;p&gt;Here’s few good links concerning web template related information. &lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;MSDN – SharePoint 2010 Advanced developer training – &lt;a href="http://www.bing.com/videos/watch/video/feature-framework-and-solution-deployment-improvements-in-sharepoint-2010/10t6r0c21"&gt;Video&lt;/a&gt; and &lt;a href="http://download.microsoft.com/download/3/D/C/3DC3FF3B-0FB6-4A43-B564-56DCF091FDB7/SP14DevTrain-sharepointfeatures.pptx"&gt;presentation&lt;/a&gt; 

    &lt;ul&gt;
      &lt;li&gt;Web template content starts from around 20:00 and don’t get fooled on the fact that we only demo sandbox solution &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;MSDN – &lt;a href="http://msdn.microsoft.com/en-us/library/aa979709.aspx"&gt;Web Templates&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;SkyDrive - &lt;a href="http://cid-2041e5497bda57a8.skydrive.live.com/redir.aspx?resid=2041E5497BDA57A8!391&amp;amp;authkey=lu0heoCIGHY%24"&gt;Example solution package&lt;/a&gt; 

    &lt;ul&gt;
      &lt;li&gt;Example package, which demonstrates the structures introduced in this blog entry. Contains example of publishing web template. Will be updated later with other examples as well. &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;Mirjam van Olst - &lt;a href="http://sharepointchick.com/archive/2010/03/11/using-the-sharepoint-2010-webtemplate-feature-element-for-creating-site.aspx"&gt;Using the SharePoint 2010 WebTemplate Feature Element for creating Site Templates&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;Chris Beckett – &lt;a href="http://www.sharepointbits.com/blog/sharepoint-2010-custom-site-templates.html"&gt;SharePoint 2010 Custom Site Templates&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note. I’ll be updating this blog entry based on all the questions and comments coming in (rather in blog post, than to email please)… and there’s few things which I didn’t have time to include to this post, which I’d love to get updated soon…&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10075999" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="C#" scheme="http://blogs.msdn.com/b/vesku/archive/tags/C_2300_/" /><category term="Web Content Management" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Web+Content+Management/" /><category term="onet.xml" scheme="http://blogs.msdn.com/b/vesku/archive/tags/onet-xml/" /><category term="Development practices" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Development+practices/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /><category term="WebTemplate" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WebTemplate/" /></entry><entry><title>New advance SharePoint 2010 training material released</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2010/05/12/new-advance-sharepoint-2010-training-material-released.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2010/05/12/new-advance-sharepoint-2010-training-material-released.aspx</id><published>2010-05-12T14:50:18Z</published><updated>2010-05-12T14:50:18Z</updated><content type="html">&lt;p&gt;We just released new SharePoint 2010 training materials to MSDN and TechNet. Material is also downloadable as videos and PowerPoint presentations.&lt;/p&gt;  &lt;p&gt;&lt;font color="#d90000"&gt;[Updated 16th of May – Direct links to IT pro trainings added. Also content concerning Channel 9 trainings included.]&lt;/font&gt;&lt;/p&gt;  &lt;h3&gt;Modules&lt;/h3&gt;  &lt;p&gt;Material contains around 40 different modules, which length varies from 30 to 100 minutes. Overall time for all of the modules is around 41 hours (22 hours in developer, 19 hours of IT Pro). There’s lot of interesting topics covered. &lt;/p&gt;  &lt;p&gt;Here’s introduction and links for both of the tracks.&lt;/p&gt;  &lt;h5&gt;Developer&lt;/h5&gt;  &lt;p&gt;“&lt;em&gt;For developers, SharePoint 2010 provides a business collaboration platform to rapidly build solutions and respond to business needs. SharePoint 2010 Advanced Developer Training offers technical training as self-paced modules and hosted labs for SharePoint 2007 professionals who want to upgrade their skills to SharePoint 2010.&lt;/em&gt;” - &lt;a href="http://msdn.microsoft.com/en-us/sharepoint/ff420377.aspx"&gt;SharePoint 2010 Advanced Developer Training&lt;/a&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420378.aspx"&gt;Developer Roadmap and Tools&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/sharepoint-2010-development-platform-overview/10t8tup5m"&gt;SharePoint 2010 Development Platform Overview&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/visual-studio-2010-sharepoint-developer-tools-overview/10twsvila"&gt;Visual Studio 2010 SharePoint Developer Tools Overview&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420379.aspx"&gt;Core Development&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/feature-framework-and-solution-deployment-improvements-in-sharepoint-2010/10t6r0c21"&gt;Feature Framework and Solution Deployment Improvements in SharePoint 2010&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/services-architecture-and-extensibility-in-sharepoint-2010/10t7tzpme"&gt;Services Architecture and Extensibility in SharePoint 2010&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/creating-sandboxed-solutions-with-sharepoint-2010/10t6l4h6q"&gt;Creating Sandboxed Solutions with SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420380.aspx"&gt;User Interfaces and Lists&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/sharepoint-2010-user-interface-improvements-and-extensibility/10twboclq"&gt;User Interface Improvements and Extensibility in SharePoint 2010&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/sharepoint-2010-list-enhancements-and-customizations/10txq33y1"&gt;List Enhancements and Customizations in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420381.aspx"&gt;Data Access in Technologies&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/accessing-sharepoint-2010-lists-using-linq-to-sharepoint/10ttkvrck"&gt;Accessing SharePoint 2010 Lists Using LINQ to SharePoint&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/using-the-client-object-model-and-rest-to-access-sharepoint-2010/10tnr5yom"&gt;Using the Client Object Model and REST to Access SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420382.aspx"&gt;Composite Solutions&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/workflow-enhancements-in-sharepoint-2010/10t0jita0"&gt;Workflow Enhancements in SharePoint 2010&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/consuming-external-data-with-business-connectivity-services-in-sharepoint-2010/10tmc8guo"&gt;Consuming External Data with Business Connectivity Services in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420383.aspx"&gt;Enterprise Content Management&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/customizing-enterprise-content-management-in-sharepoint-2010/10t0imk37"&gt;Customizing Enterprise Content Management in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420384.aspx"&gt;Enterprise Search&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/developing-custom-search-solutions-with-sharepoint-2010/10tcltlnn"&gt;Developing Custom Search Solutions with SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420385.aspx"&gt;Business Intelligence&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/exposing-business-intelligence-with-sharepoint-2010/10tj1ycow"&gt;Exposing Business Intelligence with SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420386.aspx"&gt;Communities&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/customizing-my-sites-and-social-features-in-sharepoint-2010/10t7md1g2"&gt;Customizing My Sites and Social Features in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ff420387.aspx"&gt;Development Life Cycle&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/upgrading-code-from-sharepoint-server-2007-to-sharepoint-server-2010/10tymucd3"&gt;Upgrading Code from SharePoint Server 2007 to SharePoint Server 2010&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/application-lifecycle-management-in-sharepoint-2010/10trqi2ku"&gt;Application Lifecycle Management in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;You can also download presentations directly from &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=22882429-ee80-40bb-ba8d-ff55d6e33959"&gt;Microsoft Download site&lt;/a&gt;.&lt;/p&gt;  &lt;h5&gt;IT Pro&lt;/h5&gt;  &lt;p&gt;“&lt;em&gt;For IT professionals, SharePoint Server 2010 offers enhancements to drive productivity, a scalable unified infrastructure, and flexible deployment. SharePoint Server 2010 Advanced IT Professional Training is a deep technical learning series for current SharePoint Server 2007 professionals who are looking to upgrade their skills to SharePoint Server 2010&lt;/em&gt;” – &lt;a href="http://technet.microsoft.com/en-us/sharepoint/ff420396.aspx"&gt;SharePoint Server 2010 Advance IT Professional Training&lt;/a&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-gb/sharepoint/ff677987.aspx"&gt;Core Architecture of SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/sharepoint-online-overview/10totmyyk"&gt;SharePoint Online Overview&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/understanding-sharepoint-2010-topology/10t0n10mn?from=us"&gt;Understanding SharePoint 2010 Topology&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/planning-and-leveraging-sharepoint-2010-service-applications/10tbq20g0?from=us"&gt;Planning and Leveraging SharePoint 2010 Service Applications&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/business-continuity-management-features-in-sharepoint-2010/10tm60iwl?from=us"&gt;Business Continuity Management Features in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-gb/sharepoint/ff678022.aspx"&gt;Security in SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/using-the-new-sharepoint-2010-security-model-part-1/10t6kdcnj?from=us"&gt;Using the New SharePoint 2010 Security Model – Part 1&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/using-the-new-sharepoint-2010-security-model-part-2/10ttmjqxf?from=us"&gt;Using the New SharePoint 2010 Security Model – Part 2&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-gb/sharepoint/ff678027.aspx"&gt;IT Pro Management in SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/managing-sharepoint-2010-customizations-for-the-it-pro/10tcz27yn?from=us"&gt;Managing SharePoint 2010 Customizations for the IT Pro&lt;/a&gt;&lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/it-pro-tools-for-customizing-sharepoint-2010/10tkd5dkt?from=us"&gt;IT Pro Tools for Customizing SharePoint 2010&lt;/a&gt;&lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-gb/sharepoint/ff678049.aspx"&gt;Upgrading to SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/sharepoint-2010-upgrade-overview/10thu4oyz?from=us"&gt;SharePoint 2010 Upgrade Overview&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/preparing-to-upgrade-to-sharepoint-2010/10tz8msp5?from=us"&gt;Preparing to Upgrade to SharePoint 2010&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/testing-upgraded-sharepoint-2010-solutions/10tpyrdpe?from=us"&gt;Testing Upgraded SharePoint 2010 Solutions&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/implementing-and-validating-upgrade-plans-for-sharepoint-2010/10t0tc564?from=us"&gt;Implementing and validating upgrade plans for SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-gb/sharepoint/ff678050.aspx"&gt;Enterprise Search in SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/search-capabilities-and-features-in-sharepoint-2010/10tjyo5qv?from=us"&gt;Search Capabilities and Features in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-gb/sharepoint/ff678051.aspx"&gt;Content Management in SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/document-management-capabilities-and-features-in-sharepoint-2010/10tu6lawr?from=us"&gt;Document Management Capabilities and Features in SharePoint 2010&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/records-management-in-sharepoint-2010/10t4nxu1f?from=us"&gt;Records Management in SharePoint 2010&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/governing-content-types-policies-and-taxonomy-services-in-sharepoint-2010/10tadfrt5?from=us"&gt;Governing Content Types, Policies and Taxonomy Services in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-gb/sharepoint/ff678052.aspx"&gt;Composite Solutions in SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/business-connectivity-services-in-sharepoint-2010-and-office-2010/10th8gzt9?from=us"&gt;Business Connectivity Services in SharePoint 2010 and Office 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-gb/sharepoint/ff678053.aspx"&gt;Communities in SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/using-social-capabilities-in-sharepoint-2010/10t79qayd?from=us"&gt;Using Social Capabilities in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-gb/sharepoint/ff678054.aspx"&gt;Business Intelligence in SharePoint 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.bing.com/videos/watch/video/business-intelligence-features-in-sharepoint-2010/10tjtapy4?from=us"&gt;Business Intelligence Features in SharePoint 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;You can also download presentations directly from &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=d765b362-2772-400f-b8a8-1f4e7f0e150b"&gt;Microsoft Download site&lt;/a&gt;.&lt;/p&gt;  &lt;h3&gt;Instructors&lt;/h3&gt;  &lt;p&gt;This was extremely interesting engagement and we worked with many extremely skillful instructors. Here’s the list of persons, who owned modules in this training.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://twitter.com/mkashman"&gt;Mark Kashman&lt;/a&gt;, Product Manager, Microsoft &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.technet.com/speschka/"&gt;Steve Pescha&lt;/a&gt;, Principal Consultant, Microsoft &lt;/li&gt;    &lt;li&gt;&lt;a href="http://sharepoint.microsoft.com/blogs/cgideon/default.aspx"&gt;Chris Gideon&lt;/a&gt;, Principal Premier Field Engineer, Microsoft &lt;/li&gt;    &lt;li&gt;&lt;a href="http://todd-carter.com/"&gt;Todd Carter&lt;/a&gt;, Principal Premier Field Engineer, Microsoft &lt;/li&gt;    &lt;li&gt;James Petrosky, Principal Consultant, Microsoft &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/vesku"&gt;Vesa Juvonen&lt;/a&gt;, Principal Consultant, Microsoft &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msmvps.com/blogs/shane/Default.aspx"&gt;Shane Young&lt;/a&gt;, MVP, &lt;a href="http://sharepoint911.com/"&gt;SharePoint 911&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Global tour&lt;/h3&gt;  &lt;p&gt;During past year we also had global tour to do trainings for partners and customers. We visited following cities with little bit different set of instructors: Seattle, Atlanta, Dallas, Amsterdam, Berlin, Bangalore and Singapore. Thanks for all participants and instructors from my behalf. Personally I had excellent time on the numerous locations I visited.&lt;/p&gt;  &lt;p&gt;I also want to thank the local vendors for making sure that all of the logistics were running smoothly in each of the locations. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Thanks for everyone&lt;/strong&gt; being involved for making this possible and such a success. Hopefully you find the available recordings useful and they help to make successful deployments and pleased end users.&lt;/p&gt;  &lt;h3&gt;Channel 9 SharePoint 2010 developer videos also released&lt;/h3&gt;  &lt;p&gt;Check also the newly released &lt;a href="http://channel9.msdn.com/learn/courses/SharePoint2010Developer/"&gt;Channel 9 SharePoint developer content&lt;/a&gt;. There’s new videos and content available. This content was created together with the &lt;a href="http://www.criticalpathtraining.com"&gt;Critical Path Training&lt;/a&gt; instructors (mainly &lt;a href="http://www.andrewconnell.com/blog/"&gt;Andrew Connell&lt;/a&gt; &amp;amp; &lt;a href="http://blog.tedpattison.net/default.aspx"&gt;Ted Pattison&lt;/a&gt;), who are also mainly responsible of the recorded content. &lt;a href="http://blogs.msdn.com/pstubbs/"&gt;Paul Stubbs&lt;/a&gt; has been one of the drivers for this content internally. You can read introduction from following blog entry:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;From Paul’s Blog - &lt;a href="http://blogs.msdn.com/pstubbs/archive/2010/05/12/sharepoint-2010-developer-training-course.aspx"&gt;SharePoint 2010 Developer Training Course&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;em&gt;What’s the relationship of these two developer training materials?&lt;/em&gt; – Materials are originally based on same root content, but they were differentiated from each other long time ago. Both training materials have modules, which cover similar topics, but there’s lot of different content and demos in each of them. There’s also numerous modules, which are not overlapping between these two materials. I strongly suggest to check them both. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10011708" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>How to – SharePoint 2010 – JS client object model and UI advancements</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2010/02/25/how-to-sharepoint-2010-js-client-object-model-and-ui-advancements.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2010/02/25/how-to-sharepoint-2010-js-client-object-model-and-ui-advancements.aspx</id><published>2010-02-25T17:20:09Z</published><updated>2010-02-25T17:20:09Z</updated><content type="html">&lt;p&gt;This blog entry shows how to utilize the new UI functionalities available in the SharePoint 2010 and how to use JavaScript object model to manipulate the site structure. &lt;/p&gt;  &lt;h3&gt;Create initial structure in VS2010&lt;/h3&gt;  &lt;p&gt;The first step is to create the Visual Studio solution. In this case we will create a new Empty SharePoint project with name &lt;em&gt;ClientOMUIActions&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_1.png" width="466" height="324" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Since we will be adding &lt;em&gt;Visual Web Part&lt;/em&gt; to the project, we will need to use the farm solution option.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_3.png" width="451" height="360" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The following step is to add a new Visual Web Part item to the project – let’s name it &lt;em&gt;UIDemo&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_10.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_4.png" width="447" height="311" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;h3&gt;Add dialog integration&lt;/h3&gt;  &lt;p&gt;In this case we need to add the dialog framework integration code to our visual web part, we can definitely use the same model in ribbon buttons, if required. Let’s add the following script element to the Visual Web Part canvas.&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text/javascript&amp;quot;&amp;gt;      &lt;br /&gt;      &lt;br /&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;//Dialog opening      &lt;br /&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;OpenDialog() {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var &lt;/span&gt;options = SP.UI.$create_DialogOptions();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; options.url = &lt;span style="color: maroon"&gt;&amp;quot;/_layouts/&lt;em&gt;ClientOMUIActions&lt;/em&gt;/ListCreationPage.aspx&amp;quot;&lt;/span&gt;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; options.width = 500;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; options.height = 400;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; options.dialogReturnValueCallback = Function.createDelegate(&lt;span style="color: blue"&gt;null&lt;/span&gt;, CloseCallback);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SP.UI.ModalDialog.showModalDialog(options);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var &lt;/span&gt;messageId;     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;// Dialog callback      &lt;br /&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;CloseCallback(result, target) {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;if&lt;/span&gt;(result === SP.UI.DialogResult.OK) {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; alert(&lt;span style="color: maroon"&gt;&amp;quot;OK was clicked!&amp;quot;&lt;/span&gt;);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;if&lt;/span&gt;(result === SP.UI.DialogResult.cancel) {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; alert(&lt;span style="color: maroon"&gt;&amp;quot;Cancel was clicked!&amp;quot;&lt;/span&gt;);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Here are a few things from the code worth pointing out&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Notice the url property, which is set for the &lt;em&gt;DialogOptions&lt;/em&gt;. This is the target url to be shown in the dialog. In this case we point to the custom application page, which we will create in upcoming steps &lt;/li&gt;

  &lt;li&gt;Notice also how to set the delegate for call back. In this case we define that when ever the dialog is closed, &lt;em&gt;CloseCallback&lt;/em&gt; function will be called &lt;/li&gt;

  &lt;li&gt;Notice how we check the return value usign &lt;em&gt;SP.UI.DialogResult&lt;/em&gt; and act upon the response &lt;/li&gt;

  &lt;li&gt;&lt;em&gt;messageId&lt;/em&gt; variable will be used later, so let’s add it now but use it later &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following step is to hook up JavaScript to our link, so let’s add the following to the Visual Web Part canvas as well so that when ever the the link is clicked, our dialog code is invoked.&lt;/p&gt;

&lt;p&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;br &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;a &lt;/span&gt;&lt;span style="color: red"&gt;href&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Javascript:OpenDialog();&amp;quot;&amp;gt;&lt;/span&gt;Start UI and client om demo&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;a&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Let’s test the functionality by deploying the web part to the portal and clicking the link. We should see following popup opened up.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_12.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_5.png" width="395" height="338" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This error is due the fact that we haven’t implemented our dialog page yet. Let’s close the dialog by clicking the close button from the top right corner. You should see the following alert window shown.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_14.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_6.png" width="193" height="150" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;Modify application page&lt;/h3&gt;

&lt;p&gt;The following step is to create and modify the application page to use little bit nicer UI. We also need to add some code to provide response value correctly back to the parent window. Let’s add a new application page to our project named ListCreationPage.aspx.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_16.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_7.png" width="486" height="337" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Since we want to use the SharePoint style of rending of the dialog content, let’s add the following registration line on the top of the page, just above the &lt;em&gt;Page&lt;/em&gt; statement. We will be using the controls to provide a nice SharePoint like popup “feeling”.&lt;/p&gt;

&lt;p&gt;&lt;span style="background: yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: maroon"&gt;Register &lt;/span&gt;&lt;span style="color: red"&gt;Tagprefix&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;wssawc&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Namespace&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Microsoft.SharePoint.WebControls&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Assembly&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;quot; &lt;/span&gt;&lt;span style="background: yellow"&gt;%&amp;gt;&lt;/span&gt; &lt;span style="background: yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: maroon"&gt;Register &lt;/span&gt;&lt;span style="color: red"&gt;Tagprefix&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;SharePoint&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Namespace&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Microsoft.SharePoint.WebControls&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Assembly&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&amp;quot; &lt;/span&gt;&lt;span style="background: yellow"&gt;%&amp;gt; 
    &lt;br /&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: maroon"&gt;Register &lt;/span&gt;&lt;span style="color: red"&gt;TagPrefix&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;wssuc&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TagName&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;InputFormSection&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;/_controltemplates/InputFormSection.ascx&amp;quot; &lt;/span&gt;&lt;span style="background: yellow"&gt;%&amp;gt;&lt;/span&gt; 

  &lt;br /&gt;&lt;span style="background: yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: maroon"&gt;Register &lt;/span&gt;&lt;span style="color: red"&gt;TagPrefix&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;wssuc&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TagName&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;InputFormControl&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;/_controltemplates/InputFormControl.ascx&amp;quot; &lt;/span&gt;&lt;span style="background: yellow"&gt;%&amp;gt;&lt;/span&gt; 

  &lt;br /&gt;&lt;span style="background: yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;@ &lt;/span&gt;&lt;span style="color: maroon"&gt;Register &lt;/span&gt;&lt;span style="color: red"&gt;TagPrefix&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;wssuc&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TagName&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ButtonSection&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;/_controltemplates/ButtonSection.ascx&amp;quot; &lt;/span&gt;&lt;span style="background: yellow"&gt;%&amp;gt; 
    &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Following step is to add the required JavaScript to handle the call back functionality. Let’s add following script elements to PlaceHolderAdditionalPageHead content place holder.&lt;/p&gt;

&lt;p&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;script &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text/javascript&amp;quot;&amp;gt; 
    &lt;br /&gt;

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; function &lt;/span&gt;BtnCreateListCancel_Click() { 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel,&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: maroon"&gt;'Cancelled clicked'&lt;/span&gt;); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } 

  &lt;br /&gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;function &lt;/span&gt;BtnCreateListOk_Click() { 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var &lt;/span&gt;form = document.forms.&lt;span style="background: yellow"&gt;&amp;lt;%&lt;/span&gt;SPHttpUtility.NoEncode(Form.ClientID,Response.Output);&lt;span style="background: yellow"&gt;%&amp;gt;&lt;/span&gt;; 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var &lt;/span&gt;ListNameUrl = form.&lt;span style="background: yellow"&gt;&amp;lt;%&lt;/span&gt;SPHttpUtility.NoEncode(TxtListName.ClientID,Response.Output);&lt;span style="background: yellow"&gt;%&amp;gt;&lt;/span&gt;.value; 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, ListNameUrl); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } 

  &lt;br /&gt;

  &lt;br /&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;I’ll point out a few of the elements from the code&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;We create two separate functions – one for the OK click event and one for the Cancel event. &lt;/li&gt;

  &lt;li&gt;Notice how to pass the &lt;em&gt;DialogResult&lt;/em&gt; enumerator value based on our response &lt;/li&gt;

  &lt;li&gt;In the OK function, we also take the value from existing textbox on the page, which is passed as a parameter to &lt;em&gt;commonModalDialogClose&lt;/em&gt; function &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Following step is to create the actual page layout. You’ll need to add following to the place holder called &lt;em&gt;PlaceHolderMain&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;table 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;maintable&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;border&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;cellspacing&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;cellpadding&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ms-propertysheet&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100%&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;gt; 

    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;wssuc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;InputFormSection &lt;/span&gt;&lt;span style="color: red"&gt;Title&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;List name&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;Template_Description&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;SharePoint&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;EncodedLiteral &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;EncodedLiteral1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Define list name to be created.&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;EncodeMethod&lt;/span&gt;&lt;span style="color: blue"&gt;='HtmlEncode'/&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;Template_Description&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;Template_InputFormControls&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;wssuc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;InputFormControl &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;Template_Control&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;table &lt;/span&gt;&lt;span style="color: red"&gt;border&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;cellspacing&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;td &lt;/span&gt;&lt;span style="color: red"&gt;class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ms-authoringcontrols&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;colspan&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;2&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;nowrap&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;nowrap&amp;quot;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;SharePoint&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;EncodedLiteral &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;EncodedLiteral7&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;List name will be used as url and as the title&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;EncodeMethod&lt;/span&gt;&lt;span style="color: blue"&gt;='HtmlEncode'/&amp;gt;&lt;/span&gt;: 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;font &lt;/span&gt;&lt;span style="color: red"&gt;size&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;3&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="color: red"&gt;&amp;amp;#160;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;font&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;br &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;td &lt;/span&gt;&lt;span style="color: red"&gt;dir&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ltr&amp;quot;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;td&lt;/span&gt;&lt;span style="color: red"&gt;nowrap&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;nowrap&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;colspan&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt;class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ms-authoringcontrols&amp;quot;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;wssawc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;InputFormTextBox &lt;/span&gt;&lt;span style="color: red"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Enter list name&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ms-input&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;TxtListName&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Columns&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;35&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;maxlength&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;255&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;size&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;60&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100%&amp;quot; /&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;tr&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;Template_Control&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;wssuc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;InputFormControl&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;Template_InputFormControls&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;wssuc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;InputFormSection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;wssuc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;ButtonSection &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;ShowStandardCancelButton&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;False&amp;quot;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;Template_Buttons&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;placeholder &lt;/span&gt;&lt;span style="color: red"&gt;ID&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Placeholder1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;input&lt;/span&gt;&lt;span style="color: red"&gt;class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ms-ButtonHeightWidth&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;button &amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;BtnCancel&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button1&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;OK&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;onclick&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;BtnCreateListOk_Click()&amp;quot;&amp;#160; /&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;SeparatorHtml&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;span &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;idSpace&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ms-SpaceBetButtons&amp;quot; /&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;SeparatorHtml&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;input &lt;/span&gt;&lt;span style="color: red"&gt;class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ms-ButtonHeightWidth&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;button&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;BtnCancel&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button2&amp;quot; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Cancel&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;onclick&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;BtnCreateListCancel_Click()&amp;quot; /&amp;gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;PlaceHolder&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;Template_Buttons&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;wssuc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: maroon"&gt;ButtonSection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: maroon"&gt;table&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt; 
    &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Few pointers again on the code to clarify what we just did&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;We use the &lt;em&gt;InputFormControl&lt;/em&gt; and &lt;em&gt;InputFormSection&lt;/em&gt; controls to provide a nice look and feel for our popup &lt;/li&gt;

  &lt;li&gt;In this case the buttons are html buttons, since we are not using code behind code to do anything in this case &lt;/li&gt;

  &lt;li&gt;Notice how we call the JavaScript functions we created in the previous step from the button clicks &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that the dialog page has been implemented, let’s test the functionality. You should get following dialog.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_18.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_8.png" width="375" height="326" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now if you click OK, you should see following alert shown – this confirms that our dialog callback is working properly.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_20.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_9.png" width="185" height="155" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;Add notifications&lt;/h3&gt;

&lt;p&gt;Let’s start using the notifications, to replace the “ugly” alerts, which we are currently using. SharePoint 2010 provides a really nice notification framework, which we can easily utilize. Let’s update the CloseCallback function on the visual web part as follows.&lt;/p&gt;

&lt;p&gt;&lt;span style="color: #006400"&gt;// Dialog callback 
    &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;CloseCallback(result, target) { 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;if &lt;/span&gt;(result == SP.UI.DialogResult.OK) { 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Get id 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;messageId = SP.UI.Notify.addNotification(&lt;span style="color: maroon"&gt;&amp;quot;&amp;lt;img src='_layouts/images/loading.gif'&amp;gt; Creating list &amp;lt;b&amp;gt;&amp;quot; &lt;/span&gt;+ target + &lt;span style="color: maroon"&gt;&amp;quot;&amp;lt;/b&amp;gt;...&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;true&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;Dialog response&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;null&lt;/span&gt;); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Create list using client OM 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #006400"&gt;//createList(target);&lt;/span&gt; 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;if &lt;/span&gt;(result == SP.UI.DialogResult.cancel) { 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SP.UI.Notify.addNotification(&lt;span style="color: maroon"&gt;&amp;quot;Operation was cancelled...&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;false&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;null&lt;/span&gt;); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } 

  &lt;br /&gt;} 

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Again here’s a few things to point out from the code&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;We use the &lt;em&gt;SP.UI.Notify.addNotification&lt;/em&gt; function to notify the end user based on the action in the dialog. &lt;/li&gt;

  &lt;li&gt;Notice how we also use the callback value in the message (&lt;em&gt;target&lt;/em&gt; parameter) – in this case we are showing the list name to be created &lt;/li&gt;

  &lt;li&gt;We can use html for the notifications – in this case we added a small gif animation in the OK button click &lt;/li&gt;

  &lt;li&gt;Creating list – message is shown using sticky mode (second parameter on the function call) and we store the notification identifier, so that we can show the message until the the list has been actually created &lt;/li&gt;

  &lt;li&gt;Notice the commented CreateList function call – we’ll add this in following step &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now if you try the functionality again, you should get following messages shown on the user interface, depending on the button you clicked.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_22.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_10.png" width="244" height="173" /&gt;&lt;/a&gt;&amp;#160; &lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_24.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_11.png" width="236" height="171" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;Add JavaScript client object model code&lt;/h3&gt;

&lt;p&gt;Objective was to create new list using Client object model when ever OK is clicked. Since the JavaScript OM is by default available in any SharePoint page, we can just add the following functions.&lt;/p&gt;

&lt;p&gt;&lt;span style="color: #006400"&gt;//Actual JS client side object model calls 
    &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;createList(listName) { 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Create client context. 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;clientContext = &lt;span style="color: blue"&gt;new &lt;/span&gt;SP.ClientContext(); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;var &lt;/span&gt;oWebsite = clientContext.get_web(); 

  &lt;br /&gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Let's create list creation information object 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;listCreationInfo = &lt;span style="color: blue"&gt;new &lt;/span&gt;SP.ListCreationInformation(); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; listCreationInfo.set_title(listName); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; listCreationInfo.set_templateType(SP.ListTemplateType.announcements); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; listCreationInfo.set_quickLaunchOption(SP.QuickLaunchOptions.on); 

  &lt;br /&gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;this&lt;/span&gt;.oList = oWebsite.get_lists().add(listCreationInfo); 

  &lt;br /&gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Let's create also new item to the list to be created 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;itemCreateInfo = &lt;span style="color: blue"&gt;new &lt;/span&gt;SP.ListItemCreationInformation(); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;this&lt;/span&gt;.oListItem = oList.addItem(itemCreateInfo); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; oListItem.set_item(&lt;span style="color: maroon"&gt;'Title'&lt;/span&gt;, &lt;span style="color: maroon"&gt;'Example item for ' &lt;/span&gt;+ listName); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; oListItem.set_item(&lt;span style="color: maroon"&gt;'Body'&lt;/span&gt;, &lt;span style="color: maroon"&gt;'Hello seminar audience. From list ' &lt;/span&gt;+ listName); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; oListItem.update(); 

  &lt;br /&gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; clientContext.load(oListItem); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; clientContext.load(oList); 

  &lt;br /&gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Execute the actual script 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;clientContext.executeQueryAsync(Function.createDelegate(&lt;span style="color: blue"&gt;this&lt;/span&gt;, &lt;span style="color: blue"&gt;this&lt;/span&gt;.onQuerySucceeded), Function.createDelegate(&lt;span style="color: blue"&gt;this&lt;/span&gt;, &lt;span style="color: blue"&gt;this&lt;/span&gt;.onQueryFailed)); 

  &lt;br /&gt;} 

  &lt;br /&gt;

  &lt;br /&gt;&lt;span style="color: #006400"&gt;//Called if client side OM is successful 
    &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;onQuerySucceeded() { 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Remove the 'creating' event notification 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;SP.UI.Notify.removeNotification(messageId); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Add 'created' notification as non sticky 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;SP.UI.Notify.addNotification(&lt;span style="color: maroon"&gt;&amp;quot;List &amp;lt;b&amp;gt;&amp;quot; &lt;/span&gt;+ oList.get_title() + &lt;span style="color: maroon"&gt;&amp;quot;&amp;lt;/b&amp;gt; created...&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;false&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;null&lt;/span&gt;); 

  &lt;br /&gt;} 

  &lt;br /&gt;

  &lt;br /&gt;&lt;span style="color: blue"&gt;function &lt;/span&gt;onQueryFailed(sender, args) { 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Remove the 'creating' event notification 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;SP.UI.Notify.removeNotification(messageId); 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #006400"&gt;//Shown in case of error on the JS OM call 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;SP.UI.Notify.addNotification(&lt;span style="color: maroon"&gt;&amp;quot;Operation was cancelled...&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;false&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;null&lt;/span&gt;); 

  &lt;br /&gt;} 

  &lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Remember also to uncomment the createList call from the CloseCallback function&lt;/p&gt;

&lt;p&gt;&lt;span style="color: #006400"&gt;//Create list using client OM 
    &lt;br /&gt;&lt;/span&gt;createList(target);&lt;/p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Here’s a few things again from the code&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Notice how we first get the client context, before we start doing anything &lt;/li&gt;

  &lt;li&gt;The executeQueryAsync method call actually invokes our modifications on server side from the JavaScript – we set two different function callbacks here, depending on the result. During this call, the requested actions are sent to the server side handler for manipulation &lt;/li&gt;

  &lt;li&gt;In both callback functions we remove the previously added sticky notification, before adding new one to indicate the result &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the changes have been applied properly and you now test the dialog functionality, after providing the list name and clicking OK, you should get following message after a while.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_26.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_12.png" width="244" height="156" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;If you navigate to &lt;em&gt;All Site Settings&lt;/em&gt;, you can see that the new list with single example item has been created.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_28.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010ClientobjectmodelandUIadva_E9BF/image_thumb_13.png" width="493" height="28" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;Dialog framework and code behind code in dialogs&lt;/h3&gt;

&lt;p&gt;In the example we just went through, we used only client side code, but it’s quite common that you’ll need to execute also server side OM code as part of the dialog operations. In that case after you have executed any server side code, you can execute the following code to close the dialog and return results back to caller window. &lt;/p&gt;

&lt;p&gt;&lt;span style="color: green"&gt;//Close the dialog - we are good to go 
    &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;this&lt;/span&gt;.Page.Response.Clear(); 

  &lt;br /&gt;&lt;span style="color: blue"&gt;this&lt;/span&gt;.Page.Response.Write(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #2b91af"&gt;CultureInfo&lt;/span&gt;.InvariantCulture, 

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #a31515"&gt;&amp;quot;&amp;lt;script type=\&amp;quot;text/javascript\&amp;quot;&amp;gt;window.frameElement. 
    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; commonModalDialogClose(1, '{0}');&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;, ListItems.Count)); 

  &lt;br /&gt;&lt;span style="color: blue"&gt;this&lt;/span&gt;.Page.Response.End();&lt;/p&gt;

&lt;p&gt;Notice following from the code&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Two different parameters are passed to the &lt;em&gt;commonModalDialogClose&lt;/em&gt; JavaScript function &lt;/li&gt;

  &lt;li&gt;First one defines the response code – in this case it’s 1, which means success (same as SP.UI.DialogResult.OK). You can also return 0, which would mean cancel &lt;/li&gt;

  &lt;li&gt;Second parameter can be used to pass any relevant information for your application. In this case we return the count of items in the &lt;em&gt;ListItems&lt;/em&gt; variable, which we utilized in our server side code. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Summary&lt;/h3&gt;

&lt;p&gt;As I wrote in the beginning of this blog entry, we can definitely use similar code and approach also from ribbon buttons, which makes extending of the ribbon extremely easy. SharePoint 2010 provides excellent web 2.0 platform for developers. For more information about the new capabilities, check &lt;a href="http://msdn.microsoft.com/en-gb/library/dd776256.aspx"&gt;MSDN&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hopefully this was useful – btw. Due miscellaneous reasons, the full package won’t be unfortunately available at least for a while…&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9969398" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /></entry><entry><title>SharePoint 2010 team development environment</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2010/02/01/sharepoint-2010-team-development-environment.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2010/02/01/sharepoint-2010-team-development-environment.aspx</id><published>2010-02-01T16:14:12Z</published><updated>2010-02-01T16:14:12Z</updated><content type="html">&lt;p&gt;SharePoint 2010 release date is closing (H1/2010) and there is huge interest on the product capabilities. There’s already few ongoing projects, which are scheduled to be released on H2/2010 and using currently beta 2 version for development.&lt;/p&gt;  &lt;p&gt;One of the key questions currently asked, is the setup for team based development. This blog entry defines few alternatives and some recommendations based on personal experiences. &lt;/p&gt;  &lt;p&gt;So how do you actually setup large development teams in efficient way, so that the investments done for the development environment are reasonable? As it has been &lt;a href="http://technet.microsoft.com/en-us/library/cc262485(office.14).aspx"&gt;documented&lt;/a&gt;, the hardware requirements will increase compared to 2007 at least in some level. Personally I’m mobile person, so I’m using my laptop with 8Gb and dedicate 5.5GB for the development VM. For storage of the VMs, I use secondary SSD hardware (speed is brilliant), but when we are setting up team based development, this is not the only option. &lt;/p&gt;  &lt;p&gt;What about when you actually setup development environments for example for 40 developers?. We do have few options…&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Running SharePoint from developer’s laptop or desktop – &lt;em&gt;few options here&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Running development environments from virtualized hosts &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Let’s go the options one-by-one.&lt;/p&gt;  &lt;h3&gt;&lt;b&gt;Client side setup to client OS&lt;/b&gt;&lt;/h3&gt;  &lt;p&gt;Basically each developer is having their own SP environment as client side OS install. VM is connected to corporate network to have access to centralized source control system. VM installation can be scripted to have new environment ready to be used within less than one hour. For setting up these, you can use either dedicated AD with network access to corporate net or use corporate network accounts for VM. Details on the setup obviously this depends on corporation policy.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010teamdevelopmentenvironment_FC83/single_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="single" border="0" alt="single" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010teamdevelopmentenvironment_FC83/single_thumb.jpg" width="403" height="267" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Flexible development without necessarily constant requirement to access the corporate network &lt;/li&gt;    &lt;li&gt;Easy access of development, no delays concerning VM booting up etc. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;If developer is involved in multiple projects, possibility to accidently create dependencies between them &lt;/li&gt;    &lt;li&gt;No project based software setup - for example office client version &lt;/li&gt;    &lt;li&gt;Requires heavy hardware for each developer’s computer - 8Gb memory and secondary fast hard drive (at least 7200RPM) would be good for productivity &lt;/li&gt;    &lt;li&gt;Cannot be centrally managed      &lt;ul&gt;       &lt;li&gt;Synchronization and patching of the environments can be difficult &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;High hardware requirements for each lap top or desktop – hardware is not efficiently utilized during vacations, sick leaves etc. – “hardware utilization shortage” &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;b&gt;Client side setup using virtualization&lt;/b&gt;&lt;/h3&gt;  &lt;p&gt;Similar mode as above, but using virtualization software.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Flexible development without necessarily constant requirement to access the corporate network &lt;/li&gt;    &lt;li&gt;Virtualization provides snap-shot support &lt;/li&gt;    &lt;li&gt;Each developer can dedicate one VM per project – each project can create the base setup (SPF or SPS)&amp;#160; + browser support + client versions (office 2003/2007/2010) etc. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Requires heavy hardware for each developer’s computer - 8Gb memory and secondary fast hard drive (at least 7200RPM) would be good for productivity &lt;/li&gt;    &lt;li&gt;Cannot be centrally managed &lt;/li&gt;    &lt;li&gt;High hardware requirements for each lap top – hardware is not efficiently utilized during vacations, sick leaves etc. – “hardware utilization shortage” &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;b&gt;Virtualized host setup&lt;/b&gt;&lt;/h3&gt;  &lt;p&gt;Let’s setup multiple centralized VM hosts, which can be even dedicated to single projects. This way we can have even tens of VMs on one of the environments, since if we only keep active those VMs, which are actually used, we can free flexibly resources. In our projects (MCS Finland), we’ve been successfully utilized this model already in 2007 development – and of course for 2010 development as well. VM hosts have to have more expensive hardware, but it’s still much more cost efficient, compared to investments for each developers.&lt;/p&gt;  &lt;p&gt;Whenever projects are switched to maintenance mode, we can degree the amount of hardware used for single project – which will adjust the developers work as well. In our case, we have two primary development servers, where on both we have around 25 VMs, from which approximately 5-6 are running at the same time. This model has been extremely suitable for up to 10 persons with developers roles in 5-7 different projects.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;How many developers can utilize on VM host? – depends on the hardware and virtualization engine, but 5-6 is easily doable even with relatively simple setup. Biggest bottle neck will be file IO – so disks will determine how many developer VMs you can actually have in single VM host. Obviously memory required in the host servers is also one of the key considerations.&lt;/p&gt;  &lt;p&gt;In this case, heavy hardware is required, but you can also manage and phase your investments based on the projects for SharePoint 2010. Whenever new 300-500 man day project starts, buying 4500$ hardware for it, is not a big deal… depending of course on your profit model – after the project, server can be utilized also by others. “Hi manager, so to be able to do this 300.000$ project, we need to have initial investment of 4500$ - ok?” – “Definitely, since we want the do the project .”&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010teamdevelopmentenvironment_FC83/centralized_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="centralized" border="0" alt="centralized" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010teamdevelopmentenvironment_FC83/centralized_thumb.jpg" width="400" height="225" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Centrally managed environments &lt;/li&gt;    &lt;li&gt;No high hardware requirements for developers own machines - used only for office content etc. &lt;/li&gt;    &lt;li&gt;Efficient utilization of the hardware based on project demand – easy scale up and out &lt;/li&gt;    &lt;li&gt;Easy setup for more larger farm setups for testing purposes &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Requires additional resources or roles to manage the centralized virtualization server – just to ensure that it’s online and available all the time &lt;/li&gt;    &lt;li&gt;Possible single point of failure – depends on virtualization model and software used &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;b&gt;Additional considerations&lt;/b&gt;&lt;/h3&gt;  &lt;p&gt;For overall costs, we also need to include the dev integration server and possibly also the setup used by test team. If we are using centralized model, with VM host, we can start and stops these environments as well easily. &lt;/p&gt;  &lt;p&gt;Dispute the fact that if the development would happen on individual laptops or desktops, we need to have at least few VM’s running to imitate the production deployment. So virtualization has be nevertheless done. Obviously everything depends on project size and requirements, but for enterprise projects, we need include the environment requirements and setup for the plans concerning the overall project / portal life cycle planning. This planning has not changed that much from 2007, expect the new possibilities to manage and update already deployed functionalities in production environment. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010teamdevelopmentenvironment_FC83/lifecycle_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="lifecycle" border="0" alt="lifecycle" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePoint2010teamdevelopmentenvironment_FC83/lifecycle_thumb.jpg" width="483" height="327" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h3&gt;  &lt;p&gt;Centralized virtualization model is definitely the most cost efficient options. This way the developers should be able to utilize their current lap tops for client side tasks (outlook, power points, docs), but actual work is done on the virtualized hosts. Servers can be easily used also to host other requirements, like if there’s projects where we need to integrate OCS and Exchange, we can add those as additional server to virtualization rack and they are good to go – we can relatively easily created internal networks and farm based installations for testing purposes. &lt;/p&gt;  &lt;p&gt;Key cost savings with the centralized model are also dependent on the fact that the hardware is efficiently utilized – if some of the developers are on vacation, those VM’s can be stopped and resources can be allocated to other projects. This provides lot of flexibility and cost efficient way to utilize the investments done.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9956367" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="Development practices" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Development+practices/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /></entry><entry><title>SharePoint 2010 Virtual Machine for customers &amp; partners now available</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2010/01/27/sharepoint-2010-virtual-machine-for-customers-partners-now-available.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2010/01/27/sharepoint-2010-virtual-machine-for-customers-partners-now-available.aspx</id><published>2010-01-27T01:07:37Z</published><updated>2010-01-27T01:07:37Z</updated><content type="html">&lt;p&gt;We have now released downloadable environment to get up to speed with SharePoint 2010. You can download the VM from the following address.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0c51819b-3d40-435c-a103-a5481fe0a0d2&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=0c51819b-3d40-435c-a103-a5481fe0a0d2&amp;amp;displaylang=en&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Following chapters are directly from the download page, but edited for more readable format.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;[IMPORTANT]&lt;/b&gt; – You’ll need to &lt;strong&gt;import&lt;/strong&gt; the VM to Windows Server 2008 R2 Hyper-V, so that the network adapter settings will remain the same, otherwise you’ll run into issues concerning activation of OS and Office Client. &lt;/p&gt;  &lt;p&gt;You can also download additional training material from the following links for SharePoint 2010 and for Office 2010. These include presentations and hands on lab material for developers.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;SharePoint 2010 – &lt;a href="http://channel9.msdn.com/learn/courses/SharePoint2010Developer/"&gt;http://channel9.msdn.com/learn/courses/SharePoint2010Developer/&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Office 2010 - &lt;a href="http://channel9.msdn.com/learn/courses/Office2010/"&gt;http://channel9.msdn.com/learn/courses/Office2010/&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Overview&lt;/h3&gt;  &lt;p&gt;This download contains a two Virtual Machine set for evaluating and demonstrating Office 2010 and SharePoint 2010. Virtual machine “a” contains the following pre-configured software: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Windows Server 2008 SP2 Standard Edition x64, running as an Active Directory Domain Controller for the “CONTOSO.COM” domain with DNS and WINS &lt;/li&gt;    &lt;li&gt;Microsoft SQL Server 2008 SP2 Enterprise Edition with Analysis, Notification, and Reporting Services &lt;/li&gt;    &lt;li&gt;Microsoft Office Communication Server 2007 R2 &lt;/li&gt;    &lt;li&gt;Visual Studio 2010 Beta 2 Ultimate Edition &lt;/li&gt;    &lt;li&gt;Microsoft SharePoint Server 2010 Enterprise Edition Beta 2 &lt;/li&gt;    &lt;li&gt;Microsoft Office Web Applications Beta 2 &lt;/li&gt;    &lt;li&gt;FAST Search for SharePoint 2010 Beta 2 &lt;/li&gt;    &lt;li&gt;Microsoft Project Server 2010 Beta 2 &lt;/li&gt;    &lt;li&gt;Microsoft Office 2010 Beta 2 &lt;/li&gt;    &lt;li&gt;Microsoft Office Communicator 2007 R2 &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Virtual machine “b” contains the following pre-configured software: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Windows Server 2008 R2 Standard Evaluation Edition x64, joined to the “CONTOSO.COM” domain &lt;/li&gt;    &lt;li&gt;Microsoft Exchange Server 2010 Active directory has been preconfigured over 200 “demo” users with metadata in an organizational structure. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;All of these user profiles have been imported and indexed for search within SharePoint Server 2010, with “contoso\administrator” granted administrator permissions. &lt;/p&gt;  &lt;p&gt;SharePoint Server 2010 has been configured in a “Complete” farm using Kerberos authentication and the default SQL Server 2008 instance for data, and has a site collection created using the Team Site template at http://intranet.contoso.com/ and a FAST Search Center at http://intranet.contoso.com/search/. &lt;/p&gt;  &lt;h3&gt;Performance Considerations&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;If possible, unpack and run the VM image on a separate, fast hard drive (7200 RPM or better) from the operating system of the host machine. If this is being done on a laptop, a second internal drive or external eSATA drive works best, though USB 2.0 (make sure it's 2.0, 1.1 is too slow) or Firewire is acceptable. For absolute best performance use a second internal SSD drive. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;System Requirements&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;Supported Operating Systems&lt;b&gt;: &lt;/b&gt;Windows Server 2008 R2; Windows Server 2008 R2 Enterprise; Windows Server 2008 R2 Standard &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In order to run this demo you will need the following: - Windows Server 2008 R2 with the Hyper-V role enabled. - Drive Formatting: NTFS - Processor: Intel VT or AMD-V capable - RAM: 8 GB or more recommended - Hard disk space required for install: 50 GB &lt;/p&gt;  &lt;h3&gt;Setting up your environment&lt;/h3&gt;  &lt;ol&gt;   &lt;li&gt;Start &lt;b&gt;Hyper-V Manager&lt;/b&gt; from Control Panel -&amp;gt; Administrative Tools &lt;/li&gt;    &lt;li&gt;Confirm that the local host machine appears in the Hyper-V Manager list and select it if not already done &lt;/li&gt;    &lt;li&gt;Under Actions, click &lt;b&gt;Virtual Network Manager…&lt;/b&gt; &lt;/li&gt;    &lt;li&gt;Confirm that you have created an &lt;b&gt;Internal&lt;/b&gt; virtual network named “Internal”. Internal networks limit connectivity to only VMs and the host. If a suitable not, create one now using the following steps:       &lt;ol&gt;       &lt;li&gt;Click on &lt;b&gt;Virtual Network Manager&lt;/b&gt; in the &lt;b&gt;Actions&lt;/b&gt; pane &lt;/li&gt;        &lt;li&gt;Choose &lt;b&gt;New virtual network&lt;/b&gt; in the &lt;b&gt;Virtual Networks&lt;/b&gt; pane &lt;/li&gt;        &lt;li&gt;Choose &lt;b&gt;Internal&lt;/b&gt; from the type list and click &lt;b&gt;Add&lt;/b&gt; &lt;/li&gt;        &lt;li&gt;Enter a name of &lt;b&gt;Internal&lt;/b&gt; and click &lt;b&gt;OK&lt;/b&gt; &lt;/li&gt;        &lt;li&gt;Start menu -&amp;gt; right-click Network –&amp;gt; Properties &lt;/li&gt;        &lt;li&gt;Click Change adapter settings &lt;/li&gt;        &lt;li&gt;Find the adapter with a description of &lt;b&gt;Internal&lt;/b&gt;, right-click and choose &lt;b&gt;Properties&lt;/b&gt; &lt;/li&gt;        &lt;li&gt;Double-click on Internet Protocol Version 4 and enter the following values:          &lt;ol&gt;           &lt;li&gt;&lt;b&gt;IP address&lt;/b&gt;: 192.168.150.6 2. &lt;/li&gt;            &lt;li&gt;&lt;b&gt;Subnet mask&lt;/b&gt;: 255.255.255.0 &lt;/li&gt;            &lt;li&gt;&lt;b&gt;Default gateway&lt;/b&gt;: (leave blank) &lt;/li&gt;            &lt;li&gt;&lt;b&gt;Preferred DNS server&lt;/b&gt;: 192.168.150.1 &lt;/li&gt;         &lt;/ol&gt;       &lt;/li&gt;        &lt;li&gt;Click &lt;b&gt;OK&lt;/b&gt; &lt;/li&gt;        &lt;li&gt;Close the Virtual Network Manager dialog. &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Under Actions, click &lt;b&gt;Import Virtual Machine&lt;/b&gt;… &lt;/li&gt;    &lt;li&gt;Use the &lt;b&gt;Browse&lt;/b&gt; button to select the folder where the virtual machine package was extracted. &lt;/li&gt;    &lt;li&gt;Click &lt;b&gt;Import&lt;/b&gt; and wait for the Import to complete – the import status will appear in the &lt;b&gt;Operations&lt;/b&gt; column &lt;/li&gt;    &lt;li&gt;Select the newly imported virtual machine and click &lt;b&gt;Settings&lt;/b&gt; in the right pane of the Hyper-V Manager &lt;/li&gt;    &lt;li&gt;Confirm (and correct if necessary) that the &lt;b&gt;Network Adapter&lt;/b&gt; is connected to the Internal network from step 1d. &lt;/li&gt;    &lt;li&gt;Close the virtual machine Settings dialog. &lt;/li&gt; &lt;/ol&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9953811" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /></entry><entry><title>How do we do SharePoint development, including TFS integration?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2009/10/25/how-do-we-do-sharepoint-development-including-tfs-integration.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2009/10/25/how-do-we-do-sharepoint-development-including-tfs-integration.aspx</id><published>2009-10-25T15:32:18Z</published><updated>2009-10-25T15:32:18Z</updated><content type="html">&lt;p&gt;There’s lot of information available concerning development processes, automated builds and &lt;a href="http://en.wikipedia.org/wiki/Continuous_Integration"&gt;continuous integration&lt;/a&gt; in SharePoint development using Team Foundation Server, but unfortunately most of the information is in relatively high level or just concepts, but details are missing. It’s also fairly common misconception that setting for example automated build with &lt;a href="http://msdn.microsoft.com/en-us/teamsystem/dd408382.aspx"&gt;TFS&lt;/a&gt; is difficult – it’s not. &lt;/p&gt;  &lt;p&gt;Following chapters defines the practices we use in &lt;a href="http://www.microsoft.com/microsoftservices/en/us/home.aspx"&gt;MCS Finland&lt;/a&gt; during development and for setting up the automated daily builds from TFS for enterprise projects. We will concentrate on the development process and setting up automated build process, but I’ll give some additional context from the project management point of view as well.&lt;/p&gt;  &lt;p&gt;This content applies both SharePoint 2007 and 2010 development. There are minor changes and improvements with &lt;a href="http://msdn.microsoft.com/en-gb/sharepoint/ee514561.aspx"&gt;SharePoint 2010&lt;/a&gt; development, which are pointed out.&lt;/p&gt;  &lt;p&gt;In this blog post, we cover following topics&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Development process &lt;/li&gt;    &lt;li&gt;Visual Studio solution configuration &lt;/li&gt;    &lt;li&gt;TFS side configurations &lt;/li&gt;    &lt;li&gt;Automated testing environment setup &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Development process&lt;/h3&gt;  &lt;p&gt;Following picture defines in high level the process we used for our enterprise projects. Actual details depends of course on the project size and project team. Actual process or methodology depends as well on the project, but process is always based on the &lt;a href="http://en.wikipedia.org/wiki/Agile_software_development"&gt;agile approach&lt;/a&gt; with numerous iterations. Usually methodology used can be considered as adaptation from the &lt;a href="http://en.wikipedia.org/wiki/Scrum_(development)"&gt;SCRUM&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Development process" border="0" alt="Development process" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb.png" width="539" height="393" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="540"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="24"&gt;         &lt;p align="center"&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;&lt;strong&gt;Step&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="364"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;1&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Requirements and tasks&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Project requirements and tasks are collected from project owners&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;2&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Collecting tasks to TFS&lt;/td&gt;        &lt;td valign="top" width="364"&gt;All tasks to be accomplished (also documentation) are entered as tasks to the team foundation server. Tasks are divided to iterations based on the initial plan of the project.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;3&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Virtualized development environments&lt;/td&gt;        &lt;td valign="top" width="364"&gt;All development environments are virtualized for easy management. Standardized base image has been created, which can be setup to server in matter of minutes. We commonly used centralized box to host our virtualized environment, but this depends also on project.          &lt;br /&gt;          &lt;br /&gt;Some consultants have 8GB on their laptop, making it as more appropriate and flexible hosting environment using Hyper-V.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;4&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Integration and testing servers&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Separate testing servers are part of the project setup, which are used to verify the delivery before installing that to customer environment. Automated builds are used and depending on the project, automated testing is being done, using process defined later in this blog post.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;5&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Evaluation of status&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Daily builds are being validated and based on the status and iteration schedule new deployments are being installed to the customer’s quality assurance environment. &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;6&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Quality assurance testing&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Customers can follow up the progress of the projects and give instant feedback, if there’s something to change. Release cycle to customer environment depends based on project, but is approximately two weeks to ensure that there’s constant dialog on the functionalities being developed. Quality assurance environment is also used as the acceptance testing environment, when production release is planned to be done.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;7&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Change requests and feedback&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Feedback and change requests from the quality assurance environment are tracked to team site and entered to TFS system for developers to see the possible changes and new tasks. All incoming change requests are prioritized and scheduled to iterations based on discussions with project owners.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;8&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;Production installation&lt;/td&gt;        &lt;td valign="top" width="364"&gt;When first release can be done, QA environment is used for acceptance testing and decision to move forward is done. &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="29"&gt;         &lt;p align="center"&gt;9&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="150"&gt;End user feedback&lt;/td&gt;        &lt;td valign="top" width="364"&gt;Since quite rarely projects end on the first production release, feedback and tasks are obviously collected from the end users to be processed to change requests and actual development tasks.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Iteration and production release count obviously depends on the project.&lt;/p&gt;  &lt;h3&gt;Visual Studio Solution configuration&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb_1.png" width="204" height="403" /&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;There are few things to do in the Visual Studio Solution level to enable automated builds, if you use Visual Studio 2008 in development. By default Visual Studio 2008 does not understand the solution packaging concept, so we need to enable this by modifying VS project file. Also by modifying the project settings, we can improve our development experience.&lt;/p&gt;  &lt;p&gt;In our case the &lt;em&gt;standard&lt;/em&gt; VS2008 project structure usually looks something like following.&amp;#160; There’s few things to notice from the solution structure.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Code is divided to multiple projects based on their usage models      &lt;ul&gt;       &lt;li&gt;&lt;strong&gt;ApplicationLogic&lt;/strong&gt; – contains business logic of the project, including all actual code manipulating data of the lists etc. If &lt;a href="http://msdn.microsoft.com/en-gb/library/dd203468.aspx"&gt;patterns and practices models&lt;/a&gt; are used, services, repositories etc. are placed here as well. &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Data&lt;/strong&gt; – this is project for the data objects, which are used to transfer information between different solution layers. For easy manipulation in the UI layer, all code is transferred to data objects, rather then transferring actual SharePoint objects. This also helps in unit testing. &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;FeatureReceivers&lt;/strong&gt; – this project has the custom feature receiver code. Code is separated, since feature receivers have to be placed to GAC in every deployment scenario. &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Resources&lt;/strong&gt; – this project contains the 12 hive files &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Solution.Assemblies&lt;/strong&gt; – project to create the *.Assemblies.wsp solution package &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Solution.Resources&lt;/strong&gt; – project to create the *.Resources.wsp solution package &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Web.UI &lt;/strong&gt;– Project containing all the code for web parts, web controls, http modules and code behinds for application pages &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;As you see, there’s actually two projects, which are used to generate solution packages. One for the &lt;em&gt;resources&lt;/em&gt; (stuff to goes to 12 hive) and one for the actual assemblies. This is controversy approach also in our team, but if the assemblies are separate from the resources, we can more easily and risk free, just update the actual code, without touching the xml files on disk. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;For the projects, which are outputting solution packages (wsp files), we’ve configured new .targets file, which contains separate settings for Debug and Release configurations. The Target WSSSolution has been configured as the default target to these project by &lt;a href="http://msdn.microsoft.com/en-us/library/cc441431.aspx"&gt;modifying project file&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb_2.png" width="534" height="165" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Notice that output folder of the assemblies has been configured as “..\..\..\Binaries\Release\” in the Release configuration and that wsp package is also placed to the same folder using the above xml configuration. This is same relative path to folder what’s used by the TFS automated build process to output assemblies, before the whole folder is copied to drop location. Since the wsp package is also placed to this folder by default, it’s automatically copied to the drop location without any additional configurations. So we use the same relative path already in the development environments, so that we don’t need to change anything as part of the automated build process.&lt;/p&gt;  &lt;p align="left"&gt;&lt;strong&gt;How to debug efficiently in VS2008? &lt;/strong&gt;– This is quite common question, since in VS2008, there’s no native way debug the SharePoint customization efficiently, unless you’re using the &lt;a href="http://msdn.microsoft.com/en-us/sharepoint/aa905690.aspx"&gt;VS extensions for WSS 3.0&lt;/a&gt;. Since the extensions were introduced quite late and they didn’t first support TFS integration fully, we haven’t got used to utilize them in our projects. This does not however mean that you shouldn't use them.&lt;/p&gt;  &lt;p align="left"&gt;In our case, customers usually accept deployment of our assemblies to GAC, so don’t have to create CAS files for the deployments, which makes also the debugging little bit easier, since during development time, we can deploy our assemblies to the bin folder of the IIS application and start debugging without IIS recycles etc.&lt;/p&gt;  &lt;p align="left"&gt;This means that we’ve setup the output folder of the Visual Studio projects to bin folder of the IIS application and configured the web application to fully trust the assemblies (&amp;lt;trust level=&amp;quot;Full&amp;quot; originUrl=&amp;quot;&amp;quot; /&amp;gt; in the web.config – not good practice if CAS files are used). To avoid unnecessary application pool recycles, we’ve also added additional &lt;a href="http://msdn.microsoft.com/en-us/library/system.security.allowpartiallytrustedcallersattribute.aspx"&gt;AllowPartiallyTrustedCallers&lt;/a&gt; attribute to assembly, so that assemblies are loaded to IIS process memory runtime.&lt;/p&gt;  &lt;p align="left"&gt;After these settings have been done, only thing left to do, is to attach to IIS process (w3wp.exe). To make this as efficient as possible, we use &lt;a href="http://blogs.msdn.com/jannemattila/archive/2008/10/30/attaching-debugger-to-w3wp-exe-using-nice-and-easy-keyboard-shortcut.aspx"&gt;VS macro and short cut keys&lt;/a&gt; to establish the debug process. Basically this means that only thing we need to do to get the latest versions to development portal is to compile the code and press the shortcut in the Visual Studio. After you request the page from you browser, debugger get’s automatically attached and you can start debugging.&lt;/p&gt;  &lt;p align="left"&gt;&lt;strong&gt;What kind of third party tools we use?&lt;/strong&gt; – Actually none. Managing &lt;a href="http://msdn.microsoft.com/en-us/library/ms442108.aspx"&gt;solution manifest&lt;/a&gt; and the &lt;a href="http://msdn.microsoft.com/en-us/library/bb466225.aspx"&gt;ddf&lt;/a&gt; file is something which we do manually as part of the development process. Each person involved in the project has responsibility to keep the files in sync. Generally we aim to create stub versions of each control, web part and feature file in the first iterations of the project. Meaning that each feature file and template is already included in the package, even though it doesn’t do anything. Also each web part or control only write the purpose of the particular functionality – “This web part will provide the article comment functionality in later Iteration”. This way each iteration will just increase the functionalities, which are working as designed in &lt;em&gt;technical architecture for customization &lt;/em&gt;document.&lt;/p&gt;  &lt;p align="left"&gt;There’s lot of great third party tools available for the build process in the VS2008, but we have not decided to use them, since in the end manual updates do not take that long and if the process is automated, there’s no way to control what actually get’s packaged from VS structure. Meaning that if some features are not finalized yet for the solution package, we don’t need to add them to manifest and ddf.&lt;/p&gt;  &lt;p align="center"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p align="left"&gt;&lt;strong&gt;How about SharePoint 2010 environment with VS2010?&lt;/strong&gt; – When you develop SharePoint 2010 projects using Visual Studio 2010, solution package is by default compiled to the same output directories as the assemblies, so there’s no reasons for these additional configurations. Visual studio solution structure also looks quite different, since in VS2010, you’d place the code and &lt;em&gt;14 hive&lt;/em&gt; elements to same Visual Studio projects. &lt;/p&gt;  &lt;p align="left"&gt;In SharePoint 2010 development, the common way to divide the files between the Visual Studio projects is based on the functionalities, not based on the file types. This means that for example the MySite functionalities are compiled to single solution package and portal and collaboration customizations to other packages. This model enables you a way to test and version the functionalities independently.&lt;/p&gt;  &lt;p align="left"&gt;Debugging your customizations is extremely easy, since for all of the SharePoint customizations, this happens just by starting the debugging session directly from the Visual Studio IDE. Similar ways as for the 2007 environment, debugging happens in the same computer, where you develop your customizations. Target url for debugging is defined during the VS project creation or from the project properties.&lt;/p&gt;  &lt;p align="left"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_16.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb_7.png" width="341" height="268" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How about SharePoint 2010 environment with VS2008?&lt;/strong&gt; – This is definitely valid option and quite easy to establish (it’s only references). If you want to migrate your customizations as fast as possible to SharePoint 2010, this is most likely the temporary option you’ll use. In this case, you’ll have to modify the VS2008 project types as declared above. Since VS2010 however improve the productivity of the developers, we strongly suggest to migrate your code to VS2010. &lt;/p&gt;  &lt;p&gt;VS2010 supports importing existing solution packages to your Visual Studio solution. This way you can relatively easily migrate your VS2008 package to VS2010. After importing, you’ll need to reconfigure the packaging model, which will require refactoring, since the Visual Studio 2010 solution structure is not total imitation from the &lt;em&gt;14 hive&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_14.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/SharePointandTFSHowdowedoautomatedbuilds_B036/image_thumb_6.png" width="477" height="329" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;TFS side configurations&lt;/h3&gt;  &lt;p&gt;In the TFS side, all we need to do is create the build agent and the build definition for the project. This is relatively trivial process, but basically we are enabling the automated build using standard TFS side configurations. Since we’ve configured the solution package to be dropped to the same locations as the compiled assemblies (dll files either in Debug or in Release folder), we actually don’t need to do any additional steps or configure any additional &lt;a href="http://msdn.microsoft.com/en-us/library/wea2sca5.aspx"&gt;msbuild&lt;/a&gt; settings of the build project.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/buckh/archive/2007/08/14/tfs-2008-a-basic-guide-to-team-build-2008.aspx"&gt;TFS 2008: A basic guide to Team Build 2008&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Some things to remember when you setup the build server&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Ensure that you have the proper assemblies installed and/or available on the build server. Setup is dependent on the decencies on your code. &lt;/li&gt;    &lt;li&gt;Ensure that the build service is running using domain account, which has access to the team project, so that the build service can get the latest version from the source safe &lt;/li&gt;    &lt;li&gt;Setup share to the build server or any staging server to where the compiled builds are stored, including the solution package &lt;/li&gt;    &lt;li&gt;Remember to setup proper cleaning process for the automated builds, since each build will consume space – this can be controlled using the retention policy of the build definition file &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Depending on your code and unit testing practices, you can also add unit testing as part of your code compilation. Since some of the SharePoint dependent code can be difficult to &lt;a href="http://en.wikipedia.org/wiki/Mock_object"&gt;mock&lt;/a&gt;, this might be difficult or require &lt;a href="http://msdn.microsoft.com/en-us/library/dd206942.aspx"&gt;third party tools&lt;/a&gt;.&lt;/p&gt;  &lt;h3&gt;Automated testing environment setup&lt;/h3&gt;  &lt;p&gt;TFS automated build only verifies that the code itself compiles, but there’s still additional tasks to be done to ensure that code can be deployed and that the actual use cases work as expected. Especially for the larger projects, we’ve created additional steps, which are used to imitate the customer installation of the customizations. This way after each automated build, we have similar upgraded version of the portal, that the customer would have. To automate this, we’ve added few scripts to be executed.&lt;/p&gt;  &lt;p&gt;The following model also decreases the inefficient working time of the tester to setup the actual testing environment, before the actual functionalities can be tested. We can certainly test some of the functionalities using automated testing, but for larger projects, it has been fairly common to have dedicated tester. &lt;/p&gt;  &lt;p&gt;In one of our centralized &lt;a href="http://technet.microsoft.com/en-us/library/cc753637(WS.10).aspx"&gt;hyper-v&lt;/a&gt; servers, we’ve setup a scheduled batch file, which is executed after the automated build process.&amp;#160; &lt;/p&gt;  &lt;div align="center"&gt;   &lt;table style="background-color: #eeeeee" border="0" cellspacing="0" cellpadding="2" width="502" align="center"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="500"&gt;           &lt;p align="left"&gt;set Folder=\\mcstfs\contosoautobuild              &lt;br /&gt;set FileMask=autowspbuild_*               &lt;br /&gt;set VMName=contosotest02               &lt;br /&gt;set SnapshotName=&amp;quot;18.10.2009 latest win updates&amp;quot; &lt;/p&gt;            &lt;p align="left"&gt;set LatestFile=              &lt;br /&gt;for /f &amp;quot;delims=&amp;quot; %%a in ('dir&amp;#160; /ad /b /o:d &amp;quot;%Folder%\%FileMask%&amp;quot;') do set LatestFile=%%a               &lt;br /&gt;if &amp;quot;%LatestFile%&amp;quot;==&amp;quot;&amp;quot; goto :eof               &lt;br /&gt;echo %LatestFile% &lt;/p&gt;            &lt;p align="left"&gt;powershell -command .\startsnapshot.ps1 %VMName% %SnapshotName%              &lt;br /&gt;echo Sleep for 3 minutes...               &lt;br /&gt;ping -n 240 localhost &amp;gt;nul               &lt;br /&gt;applybuild %LatestFile% %VMName% contoso\moss_admin pwd&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p&gt;As you can see from the batch file content, we first solve the latest solution file, continue with snapshot modifications and as final step installs the build to the particular virtualized environment.&lt;/p&gt;  &lt;p&gt;We use &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;powershell&lt;/a&gt; to restore the status of the testing server to same status as in the production environment. This is done by using following powershell script, which restores the snapshot given as parameter to the script. &lt;/p&gt;  &lt;div align="center"&gt;   &lt;table style="background-color: #eeeeee" border="0" cellspacing="0" cellpadding="2" width="502" align="center"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="500"&gt;           &lt;p align="left"&gt;$VMname = $args[0]              &lt;br /&gt;$SnapshotName = $args[1]&lt;/p&gt;            &lt;p align="left"&gt;$VMManagementService = Get-WmiObject -Namespace root\virtualization -Class Msvm_VirtualSystemManagementService              &lt;br /&gt;$SourceVm = Get-WmiObject -Namespace root\virtualization -Query &amp;quot;Select * From Msvm_ComputerSystem Where ElementName='$VMname'&amp;quot; &lt;/p&gt;            &lt;p align="left"&gt;$Snapshots = Get-WmiObject -Namespace root\virtualization -Query &amp;quot;Associators Of {$SourceVm} Where AssocClass=Msvm_ElementSettingData ResultClass=Msvm_VirtualSystemSettingData&amp;quot; &lt;/p&gt;            &lt;p align="left"&gt;#Write $Snapshots.Length &lt;/p&gt;            &lt;p align="left"&gt;foreach($Snapshot in $Snapshots)              &lt;br /&gt;{               &lt;br /&gt;#&amp;#160;&amp;#160;&amp;#160; $Snapshot.ElementName               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if($Snapshot.ElementName -match $SnapshotName)               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; #Write $Snapshot.ElementName               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $TheSnapshot = $Snapshot               &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }               &lt;br /&gt;}&lt;/p&gt;            &lt;p align="left"&gt;Write &amp;quot;Applying the snapshot...&amp;quot;              &lt;br /&gt;$result = $VMManagementService.ApplyVirtualSystemSnapshot($SourceVm, $TheSnapshot)               &lt;br /&gt;ProcessWMIJob($result) &lt;/p&gt;            &lt;p align="left"&gt;Write &amp;quot;Starting the VM...&amp;quot;              &lt;br /&gt;# Start the VM               &lt;br /&gt;$result = $SourceVM.RequestStateChange(2)&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p&gt;When this script has been executed, the virtualized environment is back online and the defined snapshot has been restored. Following step is to apply the actual build to the restored VM. For this the following script is used.&lt;/p&gt;  &lt;div align="center"&gt;   &lt;table style="background-color: #eeeeee" border="0" cellspacing="0" cellpadding="2" width="512" align="center"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="510"&gt;           &lt;p align="left"&gt;rem parameters: buildname, vmmachinename, username, password &lt;/p&gt;            &lt;p align="left"&gt;xcopy /y /s \\mcstfs\autobuild\%1 \\contosotest02\drop\%1\&lt;/p&gt;            &lt;p align="left"&gt;c:\pstools\psexec.exe \\%2 -u %3 -p %4 -w c:\drop\%1\release c:\windows\system32\cmd.exe /c c:\drop\%1\release\upgrade.bat http://%2 dev V12 V5&lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p&gt;As you can see the script, we are copying the solution package from the TFS autobuild server to share located in the testing server (which was just started). After that we can execute the upgrade script on the testing server, which contains the project dependent script to upgrade the existing portal with the new version of the customizations.&lt;/p&gt;  &lt;p&gt;By using these relatively simple scripts we now have clean and updated environment for testing every single day with all the latest customizations. Model obviously decreases the overall project costs, since we don’t need to spend time setting up the environments manually.&lt;/p&gt;  &lt;h4&gt;How to further improve the process?&lt;/h4&gt;  &lt;p&gt;After the testing environment has been setup, we can also improve even further the process. Common improvements would be to add &lt;a href="http://msdn.microsoft.com/en-us/library/ms182536.aspx"&gt;web testing&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms182561.aspx"&gt;load testing&lt;/a&gt; to this scenario. Due the extensive support for scripting, we can automate these to be included to the daily process. This would mean that after the testing environment has been setup, we start the automated web tests for use case validation and performance testing to ensure that new code has not dramatically decreased the performance.&lt;/p&gt;  &lt;p&gt;Web testing is again relatively trivial task to do with the Visual Studio and it provides quick way to ensure that basic functionalities are still working as expected. &lt;/p&gt;  &lt;p&gt;Performance testing uses the recorded web testing scripts and imitates larger load. Even though the development testing environment is not using same hardware as the production, we can do estimates and assumptions based on baseline tests. &lt;/p&gt;  &lt;p&gt;Baseline testing means that we have made tests in the customer environment and in testing environment using same customizations. If the new version is decreasing test environment performance for 20%, we can assume that the result would be most likely the same in the production. &lt;/p&gt;  &lt;h3&gt;Improvements in SharePoint 2010 for the process&lt;/h3&gt;  &lt;p&gt;As mentioned already earlier in this post, when you develop customizations for the SharePoint 2010 with Visual Studio 2010, there’s native support to compile solution packages to the output folder of the Visual Studio project, so there’s no need for any msbuild script changes.&lt;/p&gt;  &lt;p&gt;Other huge improvement is the native support for upgrade and versioning in the feature framework side. This will help to upgrade already existing portals and manage the versioning of the customizations. Traditionally in SharePoint 2007, this has been done with custom feature receivers, which modify the existing content. In SharePoint 2010, we have much more powerful tools to manage the portal lifecycle and to update the already existing content. Also the logging mechanism have been dramatically improved to help with customization troubleshooting, if deployments fails or something unexpected will happen.&lt;/p&gt;  &lt;p&gt;We’ll release lot of new information concerning the SharePoint 2010 development in upcoming months, so stay tuned.&lt;/p&gt;  &lt;h3&gt;Summary&lt;/h3&gt;  &lt;p&gt;Setting up the &lt;em&gt;standardized&lt;/em&gt; development process might seem like a large task, but when the environments and processes have been defined, it saves lot of resources to actual efficient project work. The processes we use for our enterprise projects (30-500-xxxx man day projects), is constantly evolving process, which is improved and changed based on the experiences from the projects. &lt;/p&gt;  &lt;p&gt;Following people have also contributed to our &lt;em&gt;standardized&lt;/em&gt; process: Jaakko Haakana, Juhani Lith, &lt;a href="http://blogs.msdn.com/jannemattila/"&gt;Janne Mattila&lt;/a&gt;, Tom Wik and &lt;a href="http://blogs.msdn.com/jukka/"&gt;Jukka Ylimutka&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Hopefully this was useful. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9912618" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="WSS 3.0" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WSS+3-0/" /><category term="MOSS" scheme="http://blogs.msdn.com/b/vesku/archive/tags/MOSS/" /><category term="Development practices" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Development+practices/" /><category term="TFS" scheme="http://blogs.msdn.com/b/vesku/archive/tags/TFS/" /><category term="SharePoint 2010" scheme="http://blogs.msdn.com/b/vesku/archive/tags/SharePoint+2010/" /></entry><entry><title>SharePoint 2010 – More public information available</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2009/10/21/sharepoint-2010-finally-public.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2009/10/21/sharepoint-2010-finally-public.aspx</id><published>2009-10-21T08:09:56Z</published><updated>2009-10-21T08:09:56Z</updated><content type="html">&lt;p&gt;Finally SharePoint 2010 information is publicly available after the release on SharePoint Conference past Monday. Since people participating to early adopters programs and for example MVPs, have had a change to work with the early builds for a while, there will be lot of new information available in the blogs during upcoming weeks.&lt;/p&gt;  &lt;p&gt;Below is small collection of the most interesting blog posts and sites currently available.&lt;/p&gt;  &lt;p&gt;Few links concerning the features available&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.microsoft.com/presspass/presskits/sharepoint/Default.aspx"&gt;Microsoft Office SharePoint Server 2010 Virtual Pressroom&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;Lot of interesting videos and other content &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/sharepoint/archive/2009/10/19/sharepoint-2010.aspx"&gt;SharePoint 2010 introduction&lt;/a&gt; from Jeff Teper &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/arpans/archive/2009/10/20/sharepoint-conference-keynotes.aspx"&gt;SharePoint Conference Keynotes&lt;/a&gt; – from &lt;a href="http://blogs.msdn.com/arpans"&gt;Arpan Shah’s blog&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://sharepoint.microsoft.com/Pages/Default.aspx"&gt;SharePoint 2010 informational site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2009/10/19/part-1-improvements-to-the-core-sharepoint-platform.aspx"&gt;Improvements to the Core SharePoint Platform &amp;amp; How the Benefit SharePoint 2010 Web Content Management&lt;/a&gt; – &lt;a href="http://www.andrewconnell.com/blog/Default.aspx"&gt;Andrew Connell&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Miscellaneous blog posts and articles&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/sharepoint/ee514561.aspx"&gt;SharePoint 2010 Developer Center&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;Introduction from &lt;a href="http://blogs.msdn.com/sharepointdeveloperdocs/archive/2009/10/19/SharePoint2010BetaDevDocsLive.aspx"&gt;SharePoint developer Documentation team blog&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/library/ee557253(office.14).aspx"&gt;Online SDK&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-us/library/cc303422(office.14).aspx"&gt;SharePoint 2010 in TechNet&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/magazine/ee309510.aspx"&gt;Visual Studio 2010 Tools for SharePoint Development&lt;/a&gt; – MSDN magazine – &lt;a href="http://blogs.msdn.com/steve_fox/archive/2009/09/29/office-and-sharepoint-2010-conferences.aspx"&gt;Steve Fox&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.harbar.net/archive/2009/10/17/sp2010dt.aspx"&gt;SharePoint 2010: Developer Tools Overview&lt;/a&gt; – &lt;a href="http://www.harbar.net/"&gt;harbar.net&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.spfoxhole.com/Blog/Lists/Posts/Post.aspx?ID=131"&gt;SharePoint 2010 Developer Dashboard&lt;/a&gt; – &lt;a href="http://www.spfoxhole.com"&gt;Bob Fox&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.harbar.net/archive/2009/10/20/single-server-complete-install-of-sharepoint-2010-using-local-accounts.aspx"&gt;Single Server Complete Install of SharePoint 2010 using local accounts&lt;/a&gt; – &lt;a href="http://sharepoint.microsoft.com/blogs/fromthefield"&gt;Neil Hodgkinson&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://bink.nu/news/sharepoint-2010-documentation.aspx"&gt;SharePoint 2010 documentation and posters&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;As defined at the &lt;a href="http://blogs.msdn.com/sharepoint/"&gt;SharePoint team blog&lt;/a&gt;, public Beta available in November and during this time, you can start developing functionalities using Visual Studio 2010 Beta 2, which will contain all the necessary project types to support natively SharePoint 2010 development.&lt;/p&gt;  &lt;p&gt;“Can I use Visual Studio 2010 project types for MOSS 2007 development?” – this has been fairly common question during the early training sessions. Theoretically it can be possible, if you update the references, but it’s not recommended. Natively VS2010 SharePoint tools supports SharePoint 2010 development&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9910426" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>WCM enabled collaboration sites</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2009/02/01/wcm-enabled-collaboration-sites.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2009/02/01/wcm-enabled-collaboration-sites.aspx</id><published>2009-02-01T23:55:28Z</published><updated>2009-02-01T23:55:28Z</updated><content type="html">&lt;p&gt;Usually collaboration sites (team sites) and WCM functionalities (publishing sites) are seen as two totally separate functionalities provided by SharePoint. However by combining these both options, we can provide even more sophisticated functionalities.&lt;/p&gt;  &lt;p&gt;One of the challenges in the team sites is the fact that there’s no easy way to store metadata in “site level”, since all of the stored information is managed in the lists. Wouldn’t it be nice, if we could dynamically list for example all of the team or project sites of one particular company division or group team sites based on the project manager assigned to the particular project site.&lt;/p&gt;  &lt;p&gt;Usually this kind of requirements are solved by implementing a custom web part, which is used to store the “&lt;em&gt;site level metadata&lt;/em&gt;” to database. This is good solution, but actually we can implement the same functionality just by utilizing out of the box functionalities.&lt;/p&gt;  &lt;h3&gt;Combining best of the both&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;WCM provides us a way to store “site level” metadata. This can achieved by storing metadata information in the &lt;em&gt;welcome page&lt;/em&gt;       &lt;ul&gt;       &lt;li&gt;This way we can utilize for example CQWP to list the content dynamically within site collections &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;From team sites we can combine the great collaboration tools, which usually are not provided in WCM sites &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Following chapters define one example usage model, which I prepared for development oriented trainings back in spring 2007. We have also used this same model successfully in multiple customer engagements. &lt;/p&gt;  &lt;h3&gt;Introduction to the solution&lt;/h3&gt;  &lt;p&gt;Following project catalog and project site functionalities are part of the more complex development methods solution, which demonstrates different possibilities of the SharePoint. Branding of the site has been done in matter of hours, so so don’t concentrate on the actual look and feel, rather to the functionalities. I didn’t want to spend too much time with CSS.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb.png" width="544" height="355" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Project site&lt;/h3&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Requirement&lt;/strong&gt;– Customer needs project sites, which should store also site level metadata. This information is used to aggregate site information in multiple places on the Intranet.&lt;/em&gt; &lt;em&gt;Project manager, as the site owner, should be able to manipulate the site metadata to indicate progress of possible issues in the project. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Requirement&lt;/strong&gt;– Customer wants to have project phases as the document libraries in the project site. These document libraries have different document templates.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Following steps defines the different features and functionalities developed to be able to provide the requested functionality.&lt;/p&gt;  &lt;p&gt;1. Create a necessary site columns, which will be used to store the site specific metadata. Let’s create a feature, which defines the necessary site columns based on the requirements. Below is example of single site column required to store the organization division information.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_20.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_9.png" width="544" height="198" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;2. Create a content type used for the welcome page of the project site. Since we are creating a publishing page content type, the content type is inherited from the out of the box Page content type and the document template is set as a specific aspx page. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_24.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_11.png" width="544" height="211" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;3. Create necessary document content types used in the project site. Notice that we use the _cts –folder in the target definitions of the template upload (module element). Underneath this folder there will be specific content type folder created, when ever a new content type is provisioned to the site collection. This is good place to store the document templates, unless the templates are frequently updated (another story, another time…).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_26.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_12.png" width="544" height="182" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;4. Create document libraries used in the project site, from where the document content types are provided. In the below image, we introduce a new document library template and create a new instance from it to be used to store documents in the &lt;em&gt;Execute&lt;/em&gt; phase of the project. “&lt;em&gt;Why new list template?”&lt;/em&gt; – If we only bind the document content types to default document library, the out of the box &lt;em&gt;document&lt;/em&gt; template would be still available. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_28.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_13.png" width="544" height="308" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;5. Bind the content types to the specific libraries. In the following image, we bind the specific document content types to the execute phase library. &lt;em&gt;“Why aren’t we binding the content types directly in list template schema&lt;/em&gt;?” – this approach allows use to use the same document library template for multiple different instances and just bind the specific document templates depending on the instance.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_30.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_14.png" width="544" height="328" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;6. Let’s not forget to bind the project welcome page content type to the pages library, so that the necessary fields will be provisioned to the list.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_32.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_15.png" width="544" height="76" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;7. Now when the project site welcome page content type is available in the pages library, we can provision initial values for the site created. This can be done by setting the default.aspx page’s metadata appropriately as in the image below. Notice that we the the ContentType value as the content type declared earlier in the feature. We also define the initial status values to be “Green”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_34.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_16.png" width="544" height="249" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;8. We need to create a page layout, which is responsible of rendering the metadata information for the end users (I wont’ declared the detail steps to save some space). Now we can create the site definition used to provision the site. When the site is provisioned, we can see the initial values defined in the module above. “&lt;em&gt;Why a custom site definition?&lt;/em&gt;” - If customer would like to utilize the oob team sites and other templates as they are, but they would also like to have this new definition available, custom definition is the only way to go. Since the WCM features are enabled, the site template option is not supported.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_38.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_18.png" width="544" height="346" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;9. Site specific metadata can now be managed directly within the welcome page as long as the fields are rendered correctly in edit mode. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_40.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_19.png" width="344" height="310" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;10. One advantage of this approach is also the possibility to utilize the field controls for content editing. This improves the content editing experience.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_42.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_20.png" width="544" height="339" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;11. When the values have been updated and information is published, we have standardized site model for all of the project sites. This way the end users of the portal can easily see the key information of the specific project from the standardized place in the layout.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_44.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_21.png" width="544" height="364" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;12. As part of the requirements we also created document libraries for each project phase and used content type binding to associate the specific document content types to the specific libraries. As an outcome we are providing different document templates from different document libraries. This way we make the document creation process more efficient and save time for the site end users.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_46.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_22.png" width="444" height="171" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_48.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_23.png" width="444" height="171" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Project catalog site&lt;/h3&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Requirement&lt;/strong&gt; – Customer wants to list dynamically all of the project sites created underneath the particular catalog site. Aggregation should list the sites based on the organization division and the phase of the project. Only those sites on which the specific user has access to should be shown.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_18.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_8.png" width="544" height="458" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Solution is to use Content By Query Web parts (CQWP) as part of the site provisioning process and set the web part configuration values appropriately. Since the organization division and the project phase are stored as the metadata of the project site welcome page (created with specific content type), we can simply utilize the standard out of the box functionalities.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_14.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_6.png" width="544" height="177" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_16.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_7.png" width="544" height="110" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now since we are using CQWP to aggregate the information, all the updates are automatically updated to the lists. Out of the box Site Directory does provide similar functionalities, but the list is not dynamically updated and the information is not stored in the specific site, so that the site owner (for example project manager) could not update the information.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Requirement&lt;/strong&gt;– Only project sites should be created underneath the project catalog site.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Define the publishing &lt;a href="http://blogs.msdn.com/vesku/archive/2007/10/14/controlling-publishing-features-from-onet-xml.aspx"&gt;features appropriately&lt;/a&gt;, so that only the project site is visible in the Create Site functionality.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_12.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_5.png" width="544" height="148" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Requirement&lt;/strong&gt;– Customer wants indicate possible issues in the project sites for the managers based on the status updated by the project manager.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Luckily we had three status indications stored to the the metadata of the sites, which we can utilize. Let’s also create a audience for the managers and show the web part only to those persons, whoe belongs to it. Below is the picture to show dynamically those sites, which have any of the status metadata values selected as “&lt;em&gt;red&lt;/em&gt;”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_10.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_4.png" width="404" height="183" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Putting it all together&lt;/h3&gt;  &lt;p&gt;Of course all of the functionalities are packaged to the solution package&amp;#160; (wsp-file), which can be used to reproduce the functionalities in any MOSS deployment. This means that we need to create the manifest file, which is used to explain the SharePoint the content of the customizations, as in what features, site definitions, assemblies, web parts etc are included in the solution.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_1.png" width="534" height="276" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As addition to the manifest file, we need to create the ddf-file which is used when the functionalities are packaged to the solution package.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_2.png" width="544" height="204" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;After this, we can deploy the same functionalities to any MOSS deployment and we can be sure that it works identically as in the development environment.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/WCMenabledcollaborationsites_1247D/image_thumb_3.png" width="544" height="272" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Independent site collections&lt;/h3&gt;  &lt;p&gt;Example design declared in this article works when the project sites are created to same site collection as the project catalog site. This has both advantages and disadvantages. One common design is the have the individual team sites created as own site collection. Also in this case, the WCM features enhance the functionality. If the site metadata information would be stored to external database, we’d have to create custom search functionality.&lt;/p&gt;  &lt;p&gt;Since the “site metadata” is stored to welcome page based on content type, we can create managed properties of the information stored. Managed properties can then be directly utilized in the search results and we can provide same user experience as in example declared in this article.&lt;/p&gt;  &lt;h3&gt;Possible enhancements&lt;/h3&gt;  &lt;p&gt;There are multiple different ways to improve the defined functionality. Here’s few simple ideas.&lt;/p&gt;  &lt;p&gt;1. &lt;strong&gt;Site approval &lt;/strong&gt;– since we are utilizing the WCM functionalities, we could easily attach site approval process before the site would be visible for other portal users. By using minor versioning in the pages library, the site would not be visible for other persons than the site owners before the site is published as a major version. For the publishing process, we can specify any kind of workflow.&lt;/p&gt;  &lt;p&gt;2. &lt;strong&gt;PKI values for the status&lt;/strong&gt; - To indicate the project status more efficiently, we could create a custom field control, which renders the status values using traffic lights in the project site. For the catalog site, this is even more easier, since we can do conditional rendering in the xslt used by the CQWP. This way we could extremely easily create a list of all projects in organization and indicate their status using traffic light model. &lt;/p&gt;  &lt;p&gt;WCM functionalities provides us numerous different functionalities, so you can easily invent more possibilities.&lt;/p&gt;  &lt;h3&gt;Considerations&lt;/h3&gt;  &lt;p&gt;“&lt;em&gt;Why would I create standard team sites, rather than WCM enabled collaboration sites?&lt;/em&gt;” – good question. If the requirements can be met with more simplified solution, like feature stapling to out of the box team sites, than there’s no reason to enable WCM in team sites. If you need to provide more enhanced functionalities, enabling the WCM functionalities might just be the solution you are looking for.&lt;/p&gt;  &lt;p&gt;“&lt;em&gt;I use database to store the metadata values of the site, is this bad solution?&lt;/em&gt;” -&amp;#160; No, but remember to consider he overall consequences of your architecture choice. The solution to choose always depends on the requirements and functionalities to be provided. The downside of the database based model is however the fact that the metadata is not stored within the site and therefore we need to do additional work to ensure that the values are in sync. Also the database based model requires additional work on the operational point of view in sense of disaster recovery and maintenance. The WCM based model keeps the metadata in the site and even though the site location in the hierarchy would be changed, the metadata would be intact, since it’s stored as part of the site.&lt;/p&gt;  &lt;p&gt;Hopefully this was useful.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9388694" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Internet facing MOSS sites without content deployment</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2009/01/29/internet-facing-moss-sites-without-content-deployment.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2009/01/29/internet-facing-moss-sites-without-content-deployment.aspx</id><published>2009-01-30T00:03:17Z</published><updated>2009-01-30T00:03:17Z</updated><content type="html">&lt;p&gt;Lately there has been quite a lot of discussions concerning Internet facing MOSS sites and &lt;a href="http://technet.microsoft.com/en-us/library/cc950778.aspx"&gt;content deployment&lt;/a&gt;. Quite often there’s misconception that MOSS cannot be used as Internet facing platform without separate authoring farm and utilizing content deployment. Assumption is understandable, but completely wrong.&lt;/p&gt;  &lt;p&gt;By utilizing possibility to have multiple zones for single &lt;em&gt;SharePoint application&lt;/em&gt;, we can setup an environment, which is can be accessed by both anonymous users from Internet and content editors from corporate network using windows authentication. &lt;/p&gt;  &lt;h3&gt;Conceptual model&lt;/h3&gt;  &lt;p&gt;Zone in the SharePoint basically means different access points to access the same content. Each of these access points can have their individual configuration for the network and for the authentication. When we create a new zone, we actually create new IIS application, which is pointing to the same &lt;em&gt;SharePoint application&lt;/em&gt;. &lt;/p&gt;  &lt;p&gt;This model is often used in extranet scenarios, where the external users are authenticated using forms based authentication (FBA) and internal users are authenticated using windows authentication (NTLM). Same model can of course be used to provide content editing functionality for Internet facing site.&lt;/p&gt;  &lt;p&gt;Following picture defines the elements more detailed.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/InternetfacingMOSSsiteswithoutcontentpub_1019F/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/InternetfacingMOSSsiteswithoutcontentpub_1019F/image_thumb_1.png" width="544" height="258" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="522"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="48"&gt;         &lt;p align="center"&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="justify"&gt;&lt;strong&gt;Element&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="51"&gt;         &lt;p align="center"&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p&gt;External users are seeing only the www.[sitename].com address. This is physically one IIS application, which accesses the MOSS application.&lt;/p&gt;          &lt;p&gt;Anonymous access is configured to the zone and the &lt;a href="http://technet.microsoft.com/en-us/library/cc263468.aspx#section6"&gt;ViewFormPagesLockDown feature&lt;/a&gt; is activated for site collection to enhance security.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="53"&gt;         &lt;p align="center"&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p&gt;Internal users will have access to http://internet , which is exposed only to the internal network. &lt;/p&gt;          &lt;p&gt;This secondary IIS application is used for creating the content in windows authentication mode to same MOSS application&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="55"&gt;         &lt;p align="center"&gt;&lt;strong&gt;3&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="justify"&gt;Actual &lt;em&gt;SharePoint&lt;/em&gt; &lt;em&gt;application&lt;/em&gt; is in the database and both zones access the same content.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Infrastructure architecture&lt;/h3&gt;  &lt;p&gt;Following picture defines the model in infrastructure level. There are multiple different variations of this kind of setup depending on the network policies and possibilities. Each of the elements and few possibilities are declared also in detail.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/InternetfacingMOSSsiteswithoutcontentpub_1019F/image6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/InternetfacingMOSSsiteswithoutcontentpub_1019F/image6_thumb.png" width="522" height="549" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="522"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="48"&gt;         &lt;p align="center"&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="justify"&gt;&lt;strong&gt;Element&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="51"&gt;         &lt;p align="center"&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="left"&gt;Internet facing network zone for external people to access the service. Anonymous zone(s) are accessed from this direction. &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="53"&gt;         &lt;p align="center"&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="left"&gt;Internet facing firewall and network load balancer, which permits only necessary ports to be used when accessing the portal.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="55"&gt;         &lt;p align="center"&gt;&lt;strong&gt;3&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="justify"&gt;Web front end servers actually serving the content for the external url, which is configured to the NLB and to the &lt;a href="http://technet.microsoft.com/en-us/library/cc261814.aspx"&gt;alternate access mapping&lt;/a&gt;.&lt;/p&gt;          &lt;p align="justify"&gt;Depending on the &lt;a href="http://technet.microsoft.com/en-us/library/cc262834.aspx"&gt;networks and the security setup&lt;/a&gt;, these can actually also be in the corporate network.&lt;/p&gt;          &lt;p align="left"&gt;Since all of the zones created to the MOSS applications are synchronized between the servers, the IIS application for NTLM zone exists in these servers, but there’s no way to external people access this IIS application.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="55"&gt;         &lt;p align="center"&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="justify"&gt;Optional firewall depending on the network, if the web front ends are in DMZ zone and the farm is divided between network segments.&lt;/p&gt;          &lt;p align="justify"&gt;This is so called &lt;a href="http://technet.microsoft.com/en-us/library/cc263513.aspx#section7"&gt;split-back-to-back farm&lt;/a&gt;.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56"&gt;         &lt;p align="center"&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="justify"&gt;Optional internal servers, which can be used to access the internal zone configured to use Windows authentication. Zone is only available for corporate network using internal DNS entries.&lt;/p&gt;          &lt;p align="justify"&gt;Depending on the requirements and network, the NTLM zone could actually also exists in the WFE servers as declared partly already in step 3.&lt;/p&gt;          &lt;p align="justify"&gt;This is not usually seen as a valid option, but actually the model is justified with security considerations and with cost saving since we would not need separate authoring farm.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56"&gt;         &lt;p align="center"&gt;&lt;strong&gt;6&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="justify"&gt;Internal access point to the portal using NTLM. From here the content editors can access the portal and make necessary changes. &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56"&gt;         &lt;p align="center"&gt;&lt;strong&gt;7&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="justify"&gt;Database cluster for the MOSS farm. &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="56"&gt;         &lt;p align="center"&gt;&lt;strong&gt;8&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="472"&gt;         &lt;p align="justify"&gt;Index server crawling the sites. Depending on the content and load, the index server can actually also be acting as the WFE server and there for it can access the content directly from itself, rather than causing load to the other WFE servers. &lt;/p&gt;          &lt;p align="justify"&gt;There are however multiple different options on this one, so it’s a different discussion.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h3&gt;Considerations&lt;/h3&gt;  &lt;h4&gt;Customization development and deployment&lt;/h4&gt;  &lt;p&gt;When separate staging or authoring farm is used, there’s more detailed processes to follow to keep the farms in sync, so that the content publishing work properly. In this option, there’s only one farm, so the deployment practices are more simplified (separate QA farm of course though recommended).&lt;/p&gt;  &lt;p&gt;Other advance on the single farm setup is more simplified possibilities for custom solutions. Let’s have an example concerning simple feedback functionality.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Objective – Collect feedback from end users by providing a simple form for information entry. Store the sent feedback to secure list in SharePoint, which can only access the web masters. &lt;/li&gt;    &lt;li&gt;Single farm with Zones – Create feedback list to the root web and setup the access control appropriately to it. Use elevated privileges in the custom form to write the feedback to the list. Web masters can access the list directly using the NTLM zone. &lt;/li&gt;    &lt;li&gt;Separate authoring farm – Since the content in the internet facing farm should not be updated for proper content publishing to work, we need to implement the write back to the authoring farm using web services. Writing entries for single list is natively supported, but especially little bit more complicated solutions increase the costs of the customizations. &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Management&lt;/h4&gt;  &lt;p&gt;Since there’s only one farm to manage and monitor, the overall costs of the MOSS deployment are considerable smaller than having two farms. Also keeping the separate farms in sync is more complex than having single farm to configure. Model also decreases the storage requirements, since there’s no duplications concerning the databases of the individual MOSS farms.&lt;/p&gt;  &lt;h4&gt;Security&lt;/h4&gt;  &lt;p&gt;All the concepts declared in this article are dependent on the network configurations and security settings. Especially when we are exposing the services to the Internet, we really need to ensure that the network and farm is properly configured. &lt;/p&gt;  &lt;p&gt;Also all the customizations developed have to follow the security recommendations so that any sensitive information is not exposed.&lt;/p&gt;  &lt;h4&gt;Content editing&lt;/h4&gt;  &lt;p&gt;Since publishing of the content is instant when the &lt;em&gt;Publish –&lt;/em&gt;button is clicked, the content can be easily modified and managed. There’s no delays of getting the information released to the internet, except the possible caching configurations.&lt;/p&gt;  &lt;p&gt;It’s of course important to notice the model in prepared training mater, like instructing the content editors to use relative addresses for resources, like images and for the links within the portal.&lt;/p&gt;  &lt;h3&gt;Real life experiences&lt;/h3&gt;  &lt;p&gt;We have used this model in multiple Internet facing sites during past few years successfully. Administrators have been pleased on the fact that there’s only one farm to manage and monitor, content editors have been pleased on the simplified model of authoring the content and generally customer directors have been pleased on the fact that the model saves investments done to hardware and to the possible customization.&lt;/p&gt;  &lt;p&gt;Hopefully this provides more insight on the flexibility of the SharePoint and for the different possibilities it provides. Each enterprise architecture is independent and they all have their own environmental characters. Therefore the guidance provided from TechNet or from numerous blogs should be always adapt to specific engagement.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9383662" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Office 14 for Web</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2008/10/31/office-14-for-web.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2008/10/31/office-14-for-web.aspx</id><published>2008-10-31T10:20:46Z</published><updated>2008-10-31T10:20:46Z</updated><content type="html">&lt;p&gt;This was so cool video, that I had to publish the link. Pretty interesting functionalities are coming up.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a title="http://channel9.msdn.com/posts/PDCNews/First-Look-Office-14-for-Web/" href="http://channel9.msdn.com/posts/PDCNews/First-Look-Office-14-for-Web/"&gt;http://channel9.msdn.com/posts/PDCNews/First-Look-Office-14-for-Web/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9026109" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="Office 14" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Office+14/" /></entry><entry><title>Caribbean English and SharePoint - localization techniques for WCM sites</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2008/10/23/caribbean-english-and-sharepoint-localization-techniques-for-wcm-sites.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2008/10/23/caribbean-english-and-sharepoint-localization-techniques-for-wcm-sites.aspx</id><published>2008-10-23T16:20:39Z</published><updated>2008-10-23T16:20:39Z</updated><content type="html">&lt;p&gt;This was so interesting, that I had to share it more widely... I'm working with one global customer concerning Internet facing MOSS site, which will eventually have more than 50 local sites within their own languages (including the corporate sites in multiple languages). Translation of the labels used in the sites are based on standard RESX handling, without any custom resource providers. &lt;/p&gt; &lt;p&gt;So basically as part of the solution deployment, the resx files are distributed to app_GlobalResources folder of IIS application in each WFE (requires some extra effort to be automated during deployment, but that's a separate story). The RESX files are not included in to the assemblies to provide more flexible way of updating just the translations without any other changes.&lt;/p&gt; &lt;p&gt;As part of the following releases, there was a requirement to generate the translations for the Caribbean English. You might wonder the business case, but there are certain phrases, which should be translated differently as for the US... similar way as there's different translations for UK. For initial testing, the RESX file with the correct culture information (en-CB) was created. When the file was introduced to the application, whole application came down with following error message.&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;strong&gt;Compilation Error &lt;br&gt;Description:&lt;/strong&gt; An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. &lt;br&gt;&lt;strong&gt;Compiler Error Message:&lt;/strong&gt; CS0101: The namespace 'Resources' already contains a definition for 'CUSTOMER'&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Well... that's interesting, since based on the &lt;a href="http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(VS.80).aspx"&gt;.NET 2.0 documentation&lt;/a&gt;, the en-CB is officially supported locale. I did little bit more digging on the case and found out that there's actually a &lt;a href="http://support.microsoft.com/kb/939949"&gt;KB article&lt;/a&gt; released concerning issues with few locale codes, if certain security fix has been installed. KB article defines that for example in this case, the locale should be actually en-029. After changing the RESX file name correctly, everything started working again and translations were successful.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;&lt;strong&gt;Improving the translation logic&lt;/strong&gt;&lt;/h3&gt; &lt;p&gt;Obviously the situation declared above was extremely scary. You can pull down the whole farm just by providing &lt;em&gt;wrongly&lt;/em&gt; named RESX files. That's not good at all. Actually there's similar implications when the RESX file contains duplicate keys etc. It's of course clear mistake in the RESX, but the fact that the farm will be dropped to it's knees, is simply extremely scary. In our case, we luckily had strict process of getting the new files published in the farm (similar as declared &lt;a href="http://blogs.msdn.com/vesku/archive/2008/09/16/project-planning-and-application-life-cycle-management.aspx"&gt;here&lt;/a&gt;), so this didn't cause any catastrophic issues to production.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;What can you do? &lt;/strong&gt;- ASP.net provider model to rescue... since we can extend or change the default asp.net functionalities, we can write our own resource provider to manage the different translations. Of course the requirement of having custom provider to be written depends on the requirements for the project - especially on the high availability sense. Depending on the requirements and implementation, you can also define your own logic concerning fall back mechanisms and duplicate keys etc. etc. etc. More information on the resource provider can be found from the following MSDN article.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa905797.aspx"&gt;MSDN - Extending the ASP.NET 2.0 Resource-Provider Model&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This approach also provides more flexible ways to provide the translations. By creating a custom resource provider, we could also fairly easily provide UI to update the translations directly for example from the site settings page of the particular country sites. This way the maintenance of the labels can be more easily delegated and managed by the web masters of the particular country sites.&lt;/p&gt; &lt;p&gt;Hopefully this was useful.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9012975" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Project planning and application lifecycle management</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2008/09/16/project-planning-and-application-life-cycle-management.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2008/09/16/project-planning-and-application-life-cycle-management.aspx</id><published>2008-09-16T21:00:01Z</published><updated>2008-09-16T21:00:01Z</updated><content type="html">&lt;p&gt;&lt;/p&gt; &lt;p&gt;One of the most important and often overlooked thing to cover in planning phase of the projects is the application lifecycle management (ALM) for upcoming portal. In this context I don't mean just the lifecycle management for the customizations, rather for the full process and environments. Every single project done with SharePoint technologies (WSS/MOSS), should define the clear rules and practices to manage the process as early as possible.&lt;/p&gt; &lt;p&gt;By setting the ground rules immediately in the planning phase of the project, you can take them into account during the technical planning of the deployment and of course also in the operational planning. Following image and table defines one example process, which follows the continuous integration model for SharePoint development (&lt;a href="http://blogs.msdn.com/vesku/archive/2008/07/29/continuous-integration-in-moss-development-using-tfs.aspx"&gt;Continuous integration in MOSS development using TFS&lt;/a&gt;). &lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/Architectureplanningandportallifecyclema_108DF/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="403" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/Architectureplanningandportallifecyclema_108DF/image_thumb.png" width="545" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Following table defines the steps and phases one-by-one.&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="522" border="1"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="48"&gt; &lt;p align="center"&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;&lt;strong&gt;Phase / Element&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="51"&gt; &lt;p align="center"&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;Developers develop individual features and functionalities based on of the technical specification using their independent virtualized environments, which have access to the TFS server for work items, source control etc.&lt;/p&gt; &lt;p align="justify"&gt;Virtualized environment have to be in-sync with the production environment concerning the licensing and patching. Customizations developed with enterprise license; don't necessarily work in standard environment. Patches and service packs should be also keep in sync.&lt;/p&gt; &lt;p align="justify"&gt;Ensure that it's somebody’s responsibility to keep the virtualized environment up to date.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="53"&gt; &lt;p align="center"&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;TFS Server used to store source code and other project related information. Developers can also sync their environment using the artifacts stored in TFS.&lt;/p&gt; &lt;p align="justify"&gt;It's obvious, that developers have to have ensured connection to the source control repository.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="55"&gt; &lt;p align="center"&gt;&lt;strong&gt;3&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;SQL Server instance of the TFS, used for actual storage of the different artifacts and document. Ensure that this database is fully managed, monitored and operational; otherwise the development cannot be conducted.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="55"&gt; &lt;p align="center"&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;Development integration server, which is used to verify the builds from the TFS, preferable using automated build process. Server should be kept in sync with the production environment.&lt;/p&gt; &lt;p align="justify"&gt;Integration server is used for integration and deployment testing. Also the initial functional testing for full package should be conducted in this environment.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;Project members (for example project manager, testers and even customers representatives in some cases) can follow the progress of the project and give feedback based on the builds deployed.&lt;/p&gt; &lt;p align="justify"&gt;Define the ground rules for accepting the deployments to quality assurance environment from the integration environment. &lt;/p&gt; &lt;p align="justify"&gt;If the development happens in ISV premises, this server is most likely located also there. It's not however good practice to have similar server in these cases also at the customer premises, so that it can be used to deploy pilot or draft versions of the solution. This way we can establish communication channels concerning the upcoming features as soon as there's something to deploy. This approach minimizes surprises at the end of the project and the customer representatives&amp;nbsp; can use the environment for training purposes as early as possible&lt;/p&gt; &lt;p align="justify"&gt;There has to be clear rules to follow for accepting the deployment for following phases.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;6&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;Quality assurance environment used for functionality testing and acceptance testing. In ideal world this environment is identical as the production environment, so that it can also be used for load testing. Quite often though, the environment is virtualized for more convenient maintenance. &lt;/p&gt; &lt;p align="justify"&gt;Load testing can be nevertheless conducted also in virtualized environment, if project performs the initial load testing (base line testing) during the first version of the portal. This way the future load testing results can be compared to these base testing values.&lt;/p&gt; &lt;p align="justify"&gt;In sense of licensing and configuration, the environment should be completely identical to production. This ensures that if the deployment is successful in this environment, it will work also in production.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;7&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;SQL Server of the quality assurance environment. Obviously the configuration should be identical as for the production. Operational setup should also follow the production, so that full portal behavior can be observed also in this environment.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;8&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;MOSS environment used for production purposes. There should be clear responsibilities and operational guidance for this environment to ensure that possible issues caused for example customizations can be solved in timely fashion.&lt;/p&gt; &lt;p align="justify"&gt;One of the key things to document and to follow is the version handling model of the customizations (how things are updated). As written earlier, there has to be crystal clear model for deployment of new versions and guidance to follow in case of any issues encountered.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="56"&gt; &lt;p align="center"&gt;&lt;strong&gt;9&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="472"&gt; &lt;p align="justify"&gt;SQL Server for the production, which is fully managed and monitored 24/7. In case of any issues, there should be clear guidance on how to proceed. Backup and restore process should be verified in quality assurance environment and if possible also in production environment, before going live with the portal.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Considerations&lt;/h3&gt; &lt;p&gt;Following chapters defines few points to consider when the full process is planned. I also want to raise few pointers, which I have personally run into in multiple partners and customers.&lt;/p&gt; &lt;h4&gt;Are the code and SharePoint artifacts in safe place?&lt;/h4&gt; &lt;p&gt;It should be clear that the all of the customizations developed for SharePoint portal are stored in some source control system, like Team Foundation Server. You don't want be in situation where the customization are gone, due failure in single laptop or desktop. Also consider and ensure that the source control system is in safe hands. If there's critical issues in the production, which requires instant code level fix to be deployed, you need to ensure that the source control is up and running. &lt;/p&gt; &lt;p&gt;Basically this means that the source control system should be high available or at least there's a backup plan to access the source code in timely fashion, so for example possible SLA's can be achieved.&lt;/p&gt; &lt;h4&gt;Is the process high available?&lt;/h4&gt; &lt;p&gt;We need to go through the steps in the process to ensure that there's no single point of failure in the process. Technical failures can be fairly easily identified, but we also need to consider the steps, which require human intervention. You don't want to be dependent from single persons, which could compromise the environment for example during summer vacation. There needs to be a back up person for each critical responsibility, with sufficient knowledge concerning the possible tasks to be done.&lt;/p&gt; &lt;h4&gt;Is there clear model to update the customizations?&lt;/h4&gt; &lt;p&gt;Setting up the initial version of the portal is quite straight forward, but the possible updated versions have to be carefully designed. It's quite common that after the initial version, there will be additional functionalities included in the portal. At some customers, there are quarterly releases, which enhance the functionalities provided for the end users by introducing new possibilities and options. If the upgrading model is not clear before the initial customizations are deployed, life can get complicated. Can we use the in-place upgrade of the solution packages? Does the end users use SharePoint designer in production? Every decision has it's effect and there for we need to ensure the model already in the planning phase.&lt;/p&gt; &lt;p&gt;Personally I've seen way too many SharePoint deployments, which have been build up nicely, but when we need to update any of the customizations, the life get's over complicated.&lt;/p&gt; &lt;h4&gt;Is the customization deployment model scalable?&lt;/h4&gt; &lt;p&gt;The usage of the solution package in deployment of the customizations can be considered as the de-facto way of deploying ANY customizations to the portal. By using solution packages we can ensure that in case of increased load for the MOSS farm, we can scale the farm out, by adding additional servers. If the deployments are done manually, there's too huge risk for human errors and the servers won't be in-sync. Manual deployment would require also huge amounts of additional actions to be conducted when the new server is introduced to the farm.&lt;/p&gt; &lt;h3&gt;Summary&lt;/h3&gt; &lt;p&gt;I listed only few pointers to give you an idea of the things to cover in you project. Of course model and required processes is fully dependent on the scale of the deployment. If you only use closely out of the box SharePoint installations and the modifications are done using SharePoint Designer, you don't necessarily have to think through these kinds of things. For large scale projects, the models and processes have to be planned carefully. It's not rocket science and you should not over think the processes, but by planning a head, you can ensure the long running service, which will be definitely worth of investment.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8954192" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="WSS 3.0" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WSS+3-0/" /><category term="MOSS" scheme="http://blogs.msdn.com/b/vesku/archive/tags/MOSS/" /><category term="Governance" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Governance/" /><category term="Development practices" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Development+practices/" /><category term="TFS" scheme="http://blogs.msdn.com/b/vesku/archive/tags/TFS/" /></entry><entry><title>MCM for SharePoint</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2008/08/01/mcm-for-sharepoint.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2008/08/01/mcm-for-sharepoint.aspx</id><published>2008-08-01T10:12:05Z</published><updated>2008-08-01T10:12:05Z</updated><content type="html">&lt;p&gt;Have you already completed the four MCTS certifications available for SharePoint and would like to have more challenges?&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.microsoft.com/learning/mcp/mcts/spservices/config/default.mspx"&gt;MCTS: Windows SharePoint Services 3.0 – Configuration&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.microsoft.com/learning/mcp/mcts/spservices/appdev/default.mspx"&gt;MCTS: Microsoft Windows SharePoint Services 3.0 – Application Development&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.microsoft.com/learning/mcp/mcts/spserver/config/default.mspx"&gt;MCTS: Microsoft Office SharePoint Server 2007 – Configuration&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.microsoft.com/learning/mcp/mcts/spserver/appdev/default.mspx"&gt;MCTS: Microsoft Office SharePoint Server 2007 ― Application Development&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Would you like to distinct yourself as the real subject matter expert for SharePoint? Check the following links for more information concerning the upcoming Microsoft Certified Master (MCM) for SharePoint.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.microsoft.com/learning/mcp/master/default.mspx" target="_blank"&gt;Microsoft Certified Master Program&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.microsoft.com/presspass/features/2008/jun08/06-10mscert.mspx"&gt;Climbing the Ladder of Success with Microsoft Certification&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.msdn.com/trika/archive/2008/06/26/more-on-the-certified-master-programs-from-me-per-the-program-owner.aspx" target="_blank"&gt;More on the Certified Master programs from me, Per, the program owner...&lt;/a&gt;  &lt;li&gt;&lt;a href="http://blogs.techrepublic.com.com/window-on-windows/?p=749"&gt;So you think you qualify for the Microsoft Certified Master Program&lt;/a&gt; &lt;li&gt;Live Meeting recording - &lt;a href="https://www.livemeeting.com/cc/lmevents/view?id=MSFT073008AMlm&amp;amp;pw=ATT12125lm"&gt;https://www.livemeeting.com/cc/lmevents/view?id=MSFT073008AMlm&amp;amp;pw=ATT12125lm&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8797918" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Office SharePoint Server 2007 TechNet content released as .chm file</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2008/08/01/office-sharepoint-server-2007-technet-content-released-as-chm-file.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2008/08/01/office-sharepoint-server-2007-technet-content-released-as-chm-file.aspx</id><published>2008-08-01T09:34:20Z</published><updated>2008-08-01T09:34:20Z</updated><content type="html">&lt;p&gt;I just noticed that the SharePoint IT pro documentation team has released &lt;a href="http://technet.microsoft.com/en-us/library/cc303422.aspx" target="_blank"&gt;Office SharePoint Server 2007 TechNet&lt;/a&gt; content as a &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ba006584-711d-4ce7-9e1f-181aedf6434a&amp;amp;DisplayLang=en" target="_blank"&gt;downloadable file&lt;/a&gt;, to be able to access the content also off-line (intercontinental flights etc.). According the announcement, the package will be updated in monthly. This is also good reference guidance, if you are in customer premises and want to verify something without access to the actual site.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Blog entry - &lt;a href="http://blogs.technet.com/tothesharepoint/archive/2008/07/24/3093422.aspx" target="_blank"&gt;You asked for it, you got it: .chm builds of library content&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Download - &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ba006584-711d-4ce7-9e1f-181aedf6434a&amp;amp;DisplayLang=en" target="_blank"&gt;Office SharePoint Server 2007 Technical Library in Compiled Help format&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8797738" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Continuous integration in MOSS development using TFS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2008/07/29/continuous-integration-in-moss-development-using-tfs.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2008/07/29/continuous-integration-in-moss-development-using-tfs.aspx</id><published>2008-07-29T19:58:09Z</published><updated>2008-07-29T19:58:09Z</updated><content type="html">&lt;p&gt;I've been delivering quite a few technical training's during past year and one of the most discussed thing is the setup of the development environments for large scale projects. Especially large ISV's are really interested on the the practicalities of utilizing the &lt;a href="http://msdn.microsoft.com/en-us/tfs2008/default.aspx" target="_blank"&gt;TFS&lt;/a&gt; as the continuous integration (CI) and/or application lifecycle management (ALM) platform. For standard .net projects this has been the way to manage large projects and it's obvious that the investment and practices are wanted to be utilized also for the SharePoint based development. &lt;/p&gt; &lt;p&gt;Since SharePoint development differs quite a lot from the standard asp.net development, this has not been that straight forward. Following scenario is example done using Visual Studio and TFS, but the principles and practices can be easily adapted also for other continuous integration solutions, like the &lt;a href="http://sourceforge.net/projects/ccnet/" target="_blank"&gt;CruiseControl.NET (CCNet)&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Setting up the Visual Studio solution for the TFS&lt;/h3&gt; &lt;p&gt;Before the continuous integration can be setup in the TFS side, we need to configure the Visual Studio project correctly, so that when ever build is initialized, newly compiled solution package (.wsp) is&amp;nbsp; created. There are numerous blog entries available from the Internet including the detailed steps for this.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc441431.aspx" target="_blank"&gt;MSDN - Automating Solution Package Creation for Windows SharePoint Services by Using MSBuild&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Basically the idea is to configure the Visual Studio solution such away that each assembly is first compiled and then the solution package is compiled using the MakeCab.exe. For the VS solution where you have multiple projects, make sure that you have defined the project dependencies such away that that the actual solution package project (the one which output is the wsp file) is dependent on the assembly projects (outputs dll's). This ensures that the assembly projects are compiled, before the wsp package is generated.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Creating the auto build project for TFS&lt;/h3&gt; &lt;p&gt;When the auto build process of the TFS has finalized by compiling the Visual Studio solution, we have received fully package solution package(s), which are ready to be deployed to any SharePoint server. Since the TFS is not aware of these kind of file types, it does not by default copy the wsp package to the drop location. This is not an issue, since we can modify little bit the build project to be able to initiate the portal recreation.&amp;nbsp; By opening the build project file (by default TFSBuild.proj located in the TeamBuildType/[build name]/ folder in TFS source control) and adding following xml elements, we make sure that the wsp package is also copied to the drop location and additional batch file (this case the rebuild.bat) is executed.&lt;/p&gt; &lt;table cellspacing="0" cellpadding="2" width="575" border="1"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="573"&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;&lt;br&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Target&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;Name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;AfterCompile&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Copy&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;SourceFiles&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;$(SolutionRoot)\[TFSProjectName]\[ProjectName]&lt;br&gt;                    &lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;\SolutionFiles\Package\[SolutionPackageName].wsp&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;br&gt;        &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;DestinationFolder&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;$(DropLocation)&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; /&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Exec&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;Command&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;C:\TFS\rebuild.bat&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;br&gt;        &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;WorkingDirectory&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;$(DropLocation)&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; /&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Target&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;em&gt;Note. Above example of using rebuild.bat is dependent on the fact that the SharePoint is located in the same server as where the build happens, which in most of the time, is not the case. Alternative solution is declared in the following chapter.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Really nice feature concerning the auto build is also the fact that operations and actions logged by the MakeCab are automatically included in the TFS auto build report, which is generated for each executed auto build. If there's anything wrong with your solution files (manifest, ddf etc.), the errors will be automatically logged here. Each executed build has it's own detailed information, from where you can access the build log as we can see from the following image.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="377" alt="Build Information" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/image_thumb.png" width="504" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Build log (BuildLog.txt) has huge amounts of details concerning the actions taken in particular build. All the MakeCab logged information is also included in the log for detailed analyses on the SharePoint solution package compilation.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="339" alt="Build Log" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/image_thumb_1.png" width="504" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Adding rebuild of the portal to scenario&lt;/h3&gt;
&lt;p&gt;When the wsp package has been created, it has to be of course deployed to the portal first, before it can be tested. This can accomplished manually, but it can also be automated, so that the portal is recreated automatically as part of the auto build process. &lt;/p&gt;
&lt;p&gt;Personally I have done this few different ways. Initially I created a console application, which was executed as a scheduled task by the Windows OS. More convenient way to do the same would be to create few new extensions to the &lt;a href="http://technet.microsoft.com/en-us/library/cc288981.aspx" target="_blank"&gt;stsadm&lt;/a&gt;, which are responsible of setting up the environment, so that project members can access the latest version without any manual intervention. If the build server and SharePoint server are different servers (most likely the case), you can schedule the execution of the stsadm commands to batch file located in the server of the drop location.&lt;/p&gt;
&lt;p&gt;Following defines one approach used. The tasks are dependent on the type of development and can be customized based on your requirements.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Objectives&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Redeploy the new solution package to the farm - remove any previous versions, if exists 
&lt;li&gt;Recreate the portal hierarchy using portal site definitions 
&lt;li&gt;Define access to the newly created hierarchy for the project managers and testers&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;For these objectives, I created following stsadm extensions, which are sequentially processed. These commands access the farm using object model. By default the stsadm provides already similar functionalities, but by creating my own commands, I can easily improve and/or add any actions to be deployed as part of the auto build process. &lt;/p&gt;
&lt;table cellspacing="0" cellpadding="2" width="513" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="165"&gt;Command&lt;/td&gt;
&lt;td valign="top" width="346"&gt;Description&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="169"&gt;deploysolutionadv&lt;/td&gt;
&lt;td valign="top" width="346"&gt;Responsible of deploying the new solution package to the farm. Retracts and removes any previous versions from the farm, if exits.&lt;br&gt;&lt;br&gt;Command is used to redeploy the solution package as part of the daily builds.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="173"&gt;recreatesitecollection&lt;/td&gt;
&lt;td valign="top" width="346"&gt;Command recreates site collection using specific template defined as parameter. If site collection already exists in the farm, it's deleted.&lt;br&gt;&lt;br&gt;Command is used to recreate the site collection for the daily builds. Portal site definitions are great way of providing immediately full hierarchies for the newly created site collection.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="177"&gt;assignuserstogroup&lt;/td&gt;
&lt;td valign="top" width="346"&gt;Grant access to defined site collection for the users defined as parameter. &lt;br&gt;&lt;br&gt;Command is used to define access to the newly created site for the persons responsible of verification tasks.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Full scenario for continuous integration&lt;/h3&gt;
&lt;p&gt;Following image defines the key steps for the continuous integration within the SharePoint development. This model can be considered as the development time process for the project. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/New%20Picture%20(3)_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="418" alt="CI for MOSS development" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/ContinuousintegrationwithMOSSdevelopment_124AB/New%20Picture%20(3)_thumb_1.png" width="520" border="0"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Following table defines the steps and phases one-by-one.&lt;/p&gt;
&lt;table cellspacing="0" cellpadding="2" width="518" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign="top" width="26"&gt;
&lt;p align="center"&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;&lt;strong&gt;Phase / Element&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="31"&gt;
&lt;p align="center"&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;Developers develop individual features and functionalities based on module plan (part of the technical specification) using their independent virtualized environments, which have access to the TFS server for work items, source control etc.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="36"&gt;
&lt;p align="center"&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;TFS Server used to store source code and other project related information. TFS is scheduled to build the integrated version of the package using build automation functionalities.&lt;/p&gt;
&lt;p align="justify"&gt;Developers can also sync their environment using the artifacts stored in TFS.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="41"&gt;
&lt;p align="center"&gt;&lt;strong&gt;3&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;Development integration server, which is used to setup the outputs from the TFS. If required, this server environment can be utilized by multiple projects as long as they have separate application on which the solution is automatically deployed (often the case in ISV environments).&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top" width="45"&gt;
&lt;p align="center"&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td valign="top" width="490"&gt;
&lt;p align="justify"&gt;Project members (for example project manager, testers and even customers representatives in some cases) can follow the progress of the project and give feedback based on the builds deployed.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div align="justify"&gt;By providing instance access to daily builds, project will get instant feedback for the developed functionalities&lt;/div&gt;
&lt;li&gt;
&lt;div align="justify"&gt;Daily builds provide flexibility to follow the progress and to discover any required changes in the design as early as possible&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Possibilities to test and verify the provided functionalities in the development integration server depend heavily on the type of the solution to build. In case declared above, complete custom site definitions with initial configuration of custom web parts are included and there for when the portal site definition is used to create the structures, new functionalities are directly visible in the portal. &lt;/p&gt;
&lt;p&gt;On the other hand, it's quite common that you are developing functionalities, which are associated to the out-of-the-box site definitions using site stapling techniques. In these kind of projects, the new functionalities would be available, as long as you create the definitions, on which the stapling has been added.&lt;/p&gt;
&lt;p&gt;Even though you would be developing only few custom web parts, by utilizing the deployment model as declared above, you could verify the deployment packages for your project and test the web parts in the environment. If you are only adding few new web parts to out-of-the-box portal, you might want to consider automated activation of your custom features, which deploys the .webpart files to the portal. This way the tester(s) could verify the functionalities by adding new web parts to the portal using standard web part picker.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;SharePoint artifact development&lt;/h3&gt;
&lt;p&gt;One of the thing to consider when setting up the project is the storage location of the SharePoint artifacts. Even though SharePoint provides version control for artifacts it stores, it cannot be considered as a actual source control system. Especially if the development is done by ISV, which is the most common case, it's good to have the source code including the artifacts in sync in the source code system (like TFS) to be able to label the actual releases of the developed features. Consider the practicalities to update your customizations from version 1.0 to 2.0 (I'll write later practices for version handling of your SharePoint project).&lt;/p&gt;
&lt;p&gt;Artifact development on the ISV side can of course utilize the standard SharePoint tools, like SharePoint Designer, which increase the productivity during the initial creation of the functionalities. There's however no easily way to sync the artifacts from SharePoint to the Visual Studio package responsible of the encapsulating the solution packages. Whenever the development for particular artifact is finalized, it can be however copied to the package manually. This way for example the master page developer, can first finalize and verify the functionalities in her/his own virtualized environment and provide versions to the official solution package when appropriate.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Real life experiences&lt;/h3&gt;
&lt;p&gt;I initially created this process and the necessary configurations for one enterprise project, which started July 2007, where I was acting as the technical lead for the infrastructure architecture and for the customized development (at the time project started developers from ISV didn't have that much experience on the customization models). Overall amount of developers in the project was up to seven persons and since the development happened at customer premises, the daily builds provided easy way for the customer representatives to follow the progress and give instant feedback whenever required. &lt;/p&gt;
&lt;p&gt;Similar setup would be however extremely useful for also any ISV, which does SharePoint development. Since the recommended deployment method for any customizations in the SharePoint landscape is to use &lt;a href="http://msdn.microsoft.com/en-us/library/aa543214.aspx" target="_blank"&gt;solution packages&lt;/a&gt;, this process would be useful to any development project, no matter the amount of the customizations (from one web part to enterprise projects with tens of developers).&lt;/p&gt;
&lt;p&gt;One additional advantages from automation came as a surprise during the project - or initially it was not foreseen. One of the guidelines we kept in the project was to utilize immediately fresh copy of the virtualized environments, if unexplained errors were encountered during development, that could not be solved in timely fashion. By utilizing the same process as for the auto build, we could recreate the full portal for the development environment from scratch (huge WCM portal) just by running the predefined batch files. This decreased the time required for setting up the development environments with latest build and there for saved project resources for actual activities to be completed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Summary &amp;amp; more information&lt;/h3&gt;
&lt;p&gt;Utilization of continuous integration practices within the SharePoint development projects provides fairly easy way to increase the quality of the delivered functionalities. The process might first seem difficult, but when the initial configurations and actions have been completed, process can be reproduced easily to any number of projects. &lt;/p&gt;
&lt;p&gt;Links to the concepts defined in this blog post&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms181710(VS.80).aspx" target="_blank"&gt;Overview of Team Foundation Build&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb417382.aspx" target="_blank"&gt;How to: Extend the STSADM Utility&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa543214.aspx" target="_blank"&gt;SharePoint Solutions Overview&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc441431.aspx" target="_blank"&gt;Automating Solution Package Creation for Windows SharePoint Services by Using MSBuild&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;I'll write more guidelines concerning the ALM (Application Lifecycle Management) and other project practices for SharePoint development in upcoming posts.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8789370" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author><category term="C#" scheme="http://blogs.msdn.com/b/vesku/archive/tags/C_2300_/" /><category term="WSS 3.0" scheme="http://blogs.msdn.com/b/vesku/archive/tags/WSS+3-0/" /><category term="MOSS" scheme="http://blogs.msdn.com/b/vesku/archive/tags/MOSS/" /><category term="Development practices" scheme="http://blogs.msdn.com/b/vesku/archive/tags/Development+practices/" /><category term="TFS" scheme="http://blogs.msdn.com/b/vesku/archive/tags/TFS/" /></entry><entry><title>Define Central Administration database to use in MOSS installation</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2008/04/24/defining-admin-database-to-use-in-moss-installation.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2008/04/24/defining-admin-database-to-use-in-moss-installation.aspx</id><published>2008-04-24T13:56:15Z</published><updated>2008-04-24T13:56:15Z</updated><content type="html">&lt;p&gt;By default when you install new MOSS/WSS farm to your environment, the content database for Central Administration application is renamed automatically using standard prefix (SharePoint_AdminContent_) and randomly generated GUID to avoid any problems if there's multiple MOSS farms installed using the same SQL Server. &lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/DefiningAdmindatabasetouseinMOSSinstalla_C342/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/DefiningAdmindatabasetouseinMOSSinstalla_C342/image_thumb.png" width="360" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;If there's only one MOSS farm installed using the same SQL Server, you can quite easily identity the content database for the Central Administration web application, but especially if you have multiple MOSS farms utilizing the same SQL Server cluster, you might have difficulties to identity for example the Internet MOSS farm admin database, if the extranet farm is installed on the same server.&lt;/p&gt; &lt;p&gt;Usually also the companies hosting the databases would like to know the exact name of all the databases created as part of the installation process before hand, so that they can establish the necessary operational activities (backups etc.).&lt;/p&gt; &lt;p&gt;Solution for the naming issue is quite simple, but it has to be done before the actual MOSS farm installation is finalized, meaning before the actual MOSS farm databases are created using configuration wizard. After running the setup.exe, close the configuration wizard and move to the folder where the psconfig tool exists. This is the same folder where stsadm tool is located and by default the path is c:\program files\common files\microsoft shared\web server extensions\12\bin.&lt;/p&gt; &lt;p&gt;Execute the following from the command line (change the values to the correct ones to use in your environment...especially the farm account details)&lt;/p&gt; &lt;table cellspacing="5" cellpadding="5" width="435" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="423"&gt; &lt;p&gt;psconfig -cmd configdb -create -server servername -database MOSS_Config -user domain\farmaccount -password accountpwd -admincontentdatabase MOSS_Content_Admin&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;em&gt;Note. Make sure that the account you are using has the sufficient access rights to the database server as declared in &lt;a href="http://technet.microsoft.com/en-us/library/cc263445.aspx" target="_blank"&gt;Technet&lt;/a&gt;.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/DefiningAdmindatabasetouseinMOSSinstalla_C342/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="271" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/DefiningAdmindatabasetouseinMOSSinstalla_C342/image_thumb_1.png" width="444" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;When the configuration is ended, the configuration database (this case the &lt;em&gt;MOSS_Config&lt;/em&gt;) has been created to SQL Server (in this case to server &lt;em&gt;servername&lt;/em&gt;) and you can restart the configuration wizard. From the wizard you can notice that the initial values have been already set and the server has already been attached to the newly created MOSS farm.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/DefiningAdmindatabasetouseinMOSSinstalla_C342/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="380" alt="image" src="http://blogs.msdn.com/blogfiles/vesku/WindowsLiveWriter/DefiningAdmindatabasetouseinMOSSinstalla_C342/image_thumb_2.png" width="443" border="0"&gt;&lt;/a&gt;&amp;nbsp; &lt;/p&gt; &lt;p&gt;At this stage you can do the traditional next-next-next installation, since all the required information already has been configured. When the configuration is completed, the admin database you defined in the psconfig command has been created to the SQL Server and the Central Administration is automatically started.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8421308" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Interesting governance and training material for SharePoint</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2008/04/11/interesting-training-material-for-administrators-end-users.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2008/04/11/interesting-training-material-for-administrators-end-users.aspx</id><published>2008-04-11T09:22:48Z</published><updated>2008-04-11T09:22:48Z</updated><content type="html">&lt;p&gt;&lt;/p&gt; &lt;p&gt;I'm currently working in two large MOSS project (Global Intranet &amp;amp; Internet facing site) where there are requirements to define the governance models and organize training for the end users. It's quote common that companies do not realize the requirements in this area in time and when the projects are already in finalization phase, this causes huge fuzz... Even though the issue was raised immediately when the projects start... well nevertheless... Here's few extremely important links to material which are useful for every single MOSS project out there.  &lt;p&gt;I'm not anymore even counting the times on when the customer have been amazed that Microsoft is providing this kind of guidance and training material... Yes... we actually do also something else rather than only install the products / servers... especially with MOSS.  &lt;p&gt;&amp;nbsp; &lt;h3&gt;Governance and general guidance&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;SharePoint Gear Up  &lt;ul&gt; &lt;li&gt;&lt;a href="http://sharepoint.microsoft.com/gearup"&gt;http://sharepoint.microsoft.com/gearup&lt;/a&gt;  &lt;li&gt;Huge amount of good materials concerning how to plan the overall project based on the SharePoint technologies.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;SharePoint Governance site at Technet  &lt;ul&gt; &lt;li&gt;&lt;a title="http://technet.microsoft.com/en-us/office/sharepointserver/bb507202.aspx" href="http://technet.microsoft.com/en-us/office/sharepointserver/bb507202.aspx"&gt;http://technet.microsoft.com/en-us/office/sharepointserver/bb507202.aspx&lt;/a&gt;  &lt;li&gt;Excellent site including numerous links to relevant documents, guidance and information&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;SharePoint Governance Checklist Guide  &lt;ul&gt; &lt;li&gt;&lt;a title="http://technet.microsoft.com/en-us/library/cc261826.aspx" href="http://technet.microsoft.com/en-us/library/cc261826.aspx"&gt;http://technet.microsoft.com/en-us/library/cc261826.aspx&lt;/a&gt;  &lt;li&gt;Excellent checklist, which points what to be plan and decide as part of the governance planning&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;SharePoint Governance and Manageability (Codeplex)  &lt;ul&gt; &lt;li&gt;&lt;a title="http://www.codeplex.com/governance" href="http://www.codeplex.com/governance"&gt;http://www.codeplex.com/governance&lt;/a&gt;  &lt;li&gt;Code examples and tools to manage sites more easily &lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Example governance plan  &lt;ul&gt; &lt;li&gt;&lt;a title="http://go.microsoft.com/fwlink/?LinkID=92333&amp;amp;clcid=0x409" href="http://go.microsoft.com/fwlink/?LinkID=92333&amp;amp;clcid=0x409"&gt;http://go.microsoft.com/fwlink/?LinkID=92333&amp;amp;clcid=0x409&lt;/a&gt;  &lt;li&gt;Sample by Mark Wagner and Joel Oleson&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Training material&lt;/h3&gt; &lt;p&gt;Following downloads were also extremely interesting, especially the Training Portal Edition, since it can be customized based on the customer case. In large global projects it's extremely important to provide consistent and well planned training materials for the administrators and end users... especially if they don't have necessarily any previous experience on the SharePoint.  &lt;p&gt;&amp;nbsp; &lt;h4&gt;Microsoft Office SharePoint Server 2007 Training Standalone Edition&lt;/h4&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=7BB3A2A3-6A9F-49F4-84E8-FF3FB71046DF&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=7BB3A2A3-6A9F-49F4-84E8-FF3FB71046DF&amp;amp;displaylang=en&lt;/a&gt;&lt;u&gt; &lt;b&gt;&lt;/b&gt;&lt;/u&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Step-by-step through beginning to advanced features, including Collaboration, Business Processes and Forms, Portals and Personalization, Search, Business Intelligence and Enterprise Content Management.  &lt;li&gt;Includes videos, interactive tutorials, and articles.  &lt;li&gt;Accessed through your browser after you install the application on your personal computer.&lt;/li&gt;&lt;/ul&gt; &lt;h5&gt;&amp;nbsp;&lt;/h5&gt; &lt;h4&gt;Microsoft Office SharePoint Server 2007 Training Portal Edition&lt;/h4&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=673DC932-626A-4E59-9DCA-16D685600A51&amp;amp;displaylang=en" target="_blank"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=673DC932-626A-4E59-9DCA-16D685600A51&amp;amp;displaylang=en&lt;/a&gt;&lt;u&gt; &lt;/u&gt; &lt;ul&gt; &lt;li&gt;Built on the Microsoft SharePoint Learning Kit,  &lt;li&gt;Designed for server administrators who want to help their end-users learn how to use the features of Microsoft Office SharePoint Server 2007.  &lt;li&gt;Step-by-step through beginning to advanced features, including Collaboration, Business Processes and Forms, Portals and Personalization, Search, Business Intelligence and Enterprise Content Management.  &lt;li&gt;Includes videos, interactive tutorials, and articles.  &lt;li&gt;The material is SCORM compliant.  &lt;li&gt;Easily add or remove training topics to fit your business needs.  &lt;li&gt;Includes a reporting function that allows an administrator/trainer to track learners’ completed training topics.  &lt;li&gt;You can customize the Training to fit the look and feel of your own Office SharePoint Server site.&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8378721" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Dev Days 2008 - Example solution package</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2008/03/11/dev-days-2008-example-solution-package.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2008/03/11/dev-days-2008-example-solution-package.aspx</id><published>2008-03-11T20:34:16Z</published><updated>2008-03-11T20:34:16Z</updated><content type="html">&lt;p&gt;I'm speaking in the MOSS development track for the whole day in Finland Dev Days on upcoming Thursday (13.3.2008). As part of the delivery I prepared Visual Studio Solution package, which is demonstrated in each of the sessions with a little bit different twist. If you are interested, the used solution package can be downloaded from my public folder&amp;nbsp; in &lt;a href="http://skydrive.live.com" target="_blank"&gt;SkyDrive&lt;/a&gt;. Below is direct link to the folder... &lt;/p&gt; &lt;p&gt;&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 26px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-2041e5497bda57a8.skydrive.live.com/embedrow.aspx/DevDays2008" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;I'll write more information concerning the functionalities demonstrated on the VS solution on upcoming blog posts including instructions and guidelines to extend / modify the solution based on requirements in projects.&lt;/p&gt; &lt;p&gt;&lt;em&gt;If you have any questions concerning the structures, feel free to add comments on this blog entry... &lt;/em&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8156055" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Create a WebCreated event of your own in onet.xml</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/vesku/archive/2007/11/11/create-webcreated-event-of-your-own-in-onet-xml.aspx" /><id>http://blogs.msdn.com/b/vesku/archive/2007/11/11/create-webcreated-event-of-your-own-in-onet-xml.aspx</id><published>2007-11-11T20:33:14Z</published><updated>2007-11-11T20:33:14Z</updated><content type="html">&lt;p&gt;I just delivered an internal MOSS IW Ramp course in Münich and we have some discussions concerning the onet.xml and how to modify the content of the sites, which have been created using custom code directly after site has been created. You are most likely aware that during site provisioning, there's no such event available as the WebCreated, which would be raised when the web creation based on onet.xml has been done. This is quite a huge limitation, but then again, there are quite good workarounds for this.&lt;/p&gt; &lt;h3&gt;Possible workarounds&lt;/h3&gt; &lt;ol&gt; &lt;li&gt;Create your own custom site definitions using browser and export that using WSS 3.0 Extensions for VS 2005. As part of the export process, the tools generate the necessary code and associations to be used. Unfortunately the extensions do not support WCM enabled sites, so it cannot be used in publishing sites.  &lt;li&gt;Use &lt;a href="http://msdn2.microsoft.com/en-us/library/ms977572.aspx"&gt;ExecuteUrl&lt;/a&gt; element to redirect the user to custom aspx page after the site has been created to be able to customize the site. Your custom aspx page might be located under the _layouts folder and there for we can easily point to that one using the xml elements within the onet.xml.  &lt;li&gt;Create the WebCreated event using the powerfull feature framework. I'll declare the steps below for more detailed information.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Steps for WebCreated event using feature receiver&lt;/h3&gt; &lt;p&gt;Step-by-Step guide for manual creating of WebCreated event are the following:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Create feature to deploy the default.aspx to root of the site using Module events  &lt;li&gt;Create feature with feature receiver class – This is used for the Site Created event  &lt;li&gt;Create site definition, which does not have directly default.aspx, rather use the feature developed above  &lt;li&gt;Set the order of the features so that the default.aspx feature is activated before the receiver feature  &lt;li&gt;In feature receiver feature, access the default aspx page, for example access the web part manager of the welcome page using following code &lt;/li&gt;&lt;/ol&gt; &lt;table cellspacing="5" cellpadding="5" width="539" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="527"&gt; &lt;p&gt;&lt;font color="#008000"&gt;//look for the default page so we can mess with the web parts&lt;/font&gt;&lt;br&gt;&lt;font color="#5591ca"&gt;&lt;font color="#2b91bd"&gt;SPFile&lt;/font&gt; &lt;/font&gt;thePage = curWeb.RootFolder.Files[&lt;font color="#ff0000"&gt;"default.aspx"&lt;/font&gt;];  &lt;p&gt;&lt;font color="#008000"&gt;//get the web part manager&lt;/font&gt; &lt;br&gt;&lt;font color="#2b91bd"&gt;SPLimitedWebPartManager&lt;/font&gt; theMan = thePage.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.&lt;font color="#2b91bd"&gt;PersonalizationScope&lt;/font&gt;.Shared); &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;Final words&lt;/h3&gt; &lt;p&gt;This was extremely quick sample, but hopefully it's useful to you. I'll try to find some time to make more comprehensive example of this. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6109906" width="1" height="1"&gt;</content><author><name>sonofthesun</name><uri>http://blogs.msdn.com/sonofthesun/ProfileUrlRedirect.ashx</uri></author></entry></feed>
