<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-28016526</id><updated>2012-01-13T13:22:12.330+01:00</updated><category term='Profile'/><category term='Social'/><category term='Tagging'/><category term='Rating'/><title type='text'>Sjoert Ebben - Sharepoint blog</title><subtitle type='html'>Blogging on anything SharePoint related.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>50</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28016526.post-3792255158976620168</id><published>2011-11-13T23:09:00.001+01:00</published><updated>2011-11-13T23:57:25.365+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tagging'/><category scheme='http://www.blogger.com/atom/ns#' term='Rating'/><category scheme='http://www.blogger.com/atom/ns#' term='Profile'/><category scheme='http://www.blogger.com/atom/ns#' term='Social'/><title type='text'>SharePoint 2010 social data, part 1</title><content type='html'>&lt;strong&gt;&lt;span style="font-size: x-large;"&gt;Background&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;One of my customers wants to implement social features in their SharePoint intranet. As their current version is SharePoint 2007 and the implementation of social add-ons didn’t really succeed, a decision was made to migrate to SharePoint 2010. A presentation at Microsoft made the customer very enthusiastic, but within a week they realised that the OOTB features weren’t what they were looking for. In short: the customer wanted something like the Facebook wall.&lt;br /&gt;&lt;br /&gt;There’s limited information on how to achieve this in SharePoint. In a nice blog post from Bjørn Furuknap (&lt;a href="http://blog.furuknap.net/why-sharepoint-2010-social-features-suck" title="http://blog.furuknap.net/why-sharepoint-2010-social-features-suck"&gt;http://blog.furuknap.net/why-sharepoint-2010-social-features-suck&lt;/a&gt;), I quickly learned that it would be a “challenge” so I took a deeper dive into the social functionality of SharePoint 2010. While doing this, I wanted a more or less complete overview so why not blog about it?&lt;br /&gt;&lt;br /&gt;This article is the first in a series of articles on this topic . We’'ll start with the basics at level 100: an overview of social data in SharePoint 2010. If you’re a code cruncher, you might want to skip this post, although you might find it useful to get the overview.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: x-large;"&gt;What is social data in SharePoint 2010?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;What is social data anyway? Asking that question to Google returns a lot of pages telling us what we can do with social data, not what it actually is. On &lt;a href="http://socialdatastrategies.com/2011/what-is-social-data/" title="http://socialdatastrategies.com/2011/what-is-social-data/"&gt;http://socialdatastrategies.com/2011/what-is-social-data/&lt;/a&gt;, you can find a definition. If you redefine the search to “social media”, you’ll find more, including an interesting paper by iCrossing: &lt;a href="http://www.icrossing.co.uk/fileadmin/uploads/eBooks/What_is_Social_Media_iCrossing_ebook.pdf" title="http://www.icrossing.co.uk/fileadmin/uploads/eBooks/What_is_Social_Media_iCrossing_ebook.pdf"&gt;http://www.icrossing.co.uk/fileadmin/uploads/eBooks/What_is_Social_Media_iCrossing_ebook.pdf&lt;/a&gt;, The paper is a few years old, but I thinks it’s still a good read.&lt;br /&gt;&lt;br /&gt;Unfortunately, it doesn’t tell us much about social data in SharePoint so I’ll take the liberty of defining something myself.&lt;br /&gt;&lt;br /&gt;Social data in SharePoint is largely information added to authored information already in SharePoint: pages, list items, documents, user profiles. Social data is largely non-authoritative and it’s purpose is to add value by users who do not necessarily have authoring rights. Social data adds a layer of (corporate) crowd knowledge and intelligence on top of managed information. However, social data is also information about a user profile (like LinkedIn) and unmanaged shared knowledge.&lt;br /&gt;&lt;br /&gt;SharePoint offers the following types of social data:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;tagging &lt;/li&gt;&lt;li&gt;rating &lt;/li&gt;&lt;li&gt;commenting &lt;/li&gt;&lt;li&gt;blogging &lt;/li&gt;&lt;li&gt;profile events or updates &lt;/li&gt;&lt;li&gt;contributions to discussions and wiki’s &lt;/li&gt;&lt;/ul&gt;Social data is visible on various locations:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;On a page in a note board or tag cloud &lt;/li&gt;&lt;li&gt;On an item (document, list item, page) &lt;/li&gt;&lt;li&gt;In a newsfeed on the user’s profile page (showing activities of the user) &lt;/li&gt;&lt;li&gt;In the My Newsfeed page in the my site host (showing activities the user is subscribed to) &lt;/li&gt;&lt;li&gt;As a blog post &lt;/li&gt;&lt;li&gt;As a contribution to a wiki &lt;/li&gt;&lt;li&gt;As an entry in discussion forums (based on the discussion list template) &lt;/li&gt;&lt;/ul&gt;The most prominent place social data is visible, is the “activity stream”, also known as the newsfeed on the my site host:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-OQYeCpOVvHU/TsA_Q_uUB3I/AAAAAAAAAVI/GVbd1iIsdIE/s1600-h/image18.png"&gt;&lt;img alt="image" border="0" height="181" src="http://lh3.ggpht.com/-jKvl6qoC4Zg/TsA_RU8NlKI/AAAAAAAAAVM/kmMqTM4wRMA/image_thumb81.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;Social data with tagging is also a way of discovering how people within your organisation look at content: a formal taxonomy enforces a corporate content classification, a “folksonomy” (using tags users can use freely) exposes how people really classify content.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Important&lt;/strong&gt;: rating, tagging and notes are SharePoint 2010 Server features! A User Profile service application is required to enable them. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note&lt;/strong&gt;: For this article, I’ll focus on social data that appears in the newsfeed. This does not include discussion forums and wiki’s.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: x-large;"&gt;Creating social data&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Social data is created on various locations:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;Tagging an item&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;A user can tag an item with a keyword. The item can be a page, a document or any list item. Tags are actually keywords; these keywords are stored in the Taxonomy Term Store in a managed metadata service application.&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-0UlynPSsuJ0/TsA_R1OEW9I/AAAAAAAAAVU/M0RFlzKUhcQ/s1600-h/image2.png"&gt;&lt;img alt="image" border="0" height="193" src="http://lh6.ggpht.com/-oNqMwmZOQDc/TsA_SZ48zBI/AAAAAAAAAVc/FUru2uLk6Vc/image_thumb.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="219" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Tagging can be done at various locations in SharePoint. When you open an OOTB site, for example, you’ll notice the two large buttons:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-BQd8NOIppBY/TsA_S4JEMhI/AAAAAAAAAVk/F3oLowtKwFA/s1600-h/image81.png"&gt;&lt;img alt="image" border="0" height="71" src="http://lh3.ggpht.com/-1Wy75HKWVyU/TsA_TQLtXVI/AAAAAAAAAVs/tR396z-lnN4/image_thumb21.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="120" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The “I Like It” button is just a shortcut for adding a tag with that name. If you click on the Tags&amp;amp;Notes button, you’ll get a dialog with options to add tags and notes:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/-vUAqoS4b9Oc/TsA_UPMQWhI/AAAAAAAAAV0/XZiVWa7GRms/s1600-h/image111%25255B1%25255D.png"&gt;&lt;img alt="image" border="0" height="111" src="http://lh3.ggpht.com/-l56Sgw8gfhg/TsA_UsYg7hI/AAAAAAAAAWA/t_2CYBBD6qI/image_thumb31.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A tag can be made private by checking the “Private” checkbox:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/-tsbXrPI2vAE/TsA_VuM8nMI/AAAAAAAAAWE/Ud5Sej8oX6I/s1600-h/image321.png"&gt;&lt;img alt="image" border="0" height="31" src="http://lh3.ggpht.com/-dRNVsc_Q4dA/TsA_V6Rf79I/AAAAAAAAAWQ/-aeoIzji30Q/image32_thumb.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="333" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The result of the tagging is displayed in the newsfeed:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/-8RyIwrRQdVA/TsA_W0QNDeI/AAAAAAAAAWU/ZrJGr_aEkAM/s1600-h/image151.png"&gt;&lt;img alt="image" border="0" height="55" src="http://lh4.ggpht.com/-yLZ8sATiskI/TsA_XOeH3sI/AAAAAAAAAWc/j-yKW1ryNLA/image_thumb7.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="332" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Tags can also be shown in a tag cloud web part:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-TETu-2epeiM/TsA_X9RcM_I/AAAAAAAAAWk/XgZK_vI-3_w/s1600-h/image10.png"&gt;&lt;img alt="image" border="0" height="43" src="http://lh5.ggpht.com/-1n5MKFaGG-0/TsA_YbKf2RI/AAAAAAAAAWw/Qu8Tb5UMnOo/image_thumb41.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This web part can be configured to show tags for the current user, for all users or all users for the current URL.&lt;br /&gt;&lt;br /&gt;A nice additional feature is the tag community page. This is a generic page in the My Site host (tagprofile.aspx) that takes a tag (=term) ID as parameter and shows information about and actions related to the tag:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/-ZA7ESKjFR0U/TsA_Zb_H0qI/AAAAAAAAAW4/X2ds039GGXk/s1600-h/image%25255B11%25255D.png"&gt;&lt;img alt="image" border="0" height="155" src="http://lh4.ggpht.com/-m3dlIGzwzWA/TsA_aBcDE_I/AAAAAAAAAW8/wSRU0xVDIJU/image_thumb%25255B5%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="401" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can’t really do collaboration stuff here but leaving a note. Unlike Twitter, to leave a note for this tag, you have to go to the tag page itself instead of hash tagging your note. I bet this is going to be improved in vNext. &lt;br /&gt;&lt;br /&gt;Tagging like this does not show up in search results either. You can add a Managed Metadata field to a content type or list and use the same term set as the tagging feature to add keywords to an item that will show up in search. However, these will not show up in the newsfeed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Useful links:&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Social tagging overview (&lt;a href="http://technet.microsoft.com/en-us/library/ff608137.aspx" title="http://technet.microsoft.com/en-us/library/ff608137.aspx"&gt;http://technet.microsoft.com/en-us/library/ff608137.aspx&lt;/a&gt;) &lt;/li&gt;&lt;li&gt;Video: Use tags and notes to share information with colleagues (&lt;a href="http://office.microsoft.com/en-us/sharepoint-server-help/video-use-tags-and-notes-to-share-information-with-colleagues-VA102465712.aspx" title="http://office.microsoft.com/en-us/sharepoint-server-help/video-use-tags-and-notes-to-share-information-with-colleagues-VA102465712.aspx"&gt;http://office.microsoft.com/en-us/sharepoint-server-help/video-use-tags-and-notes-to-share-information-with-colleagues-VA102465712.aspx&lt;/a&gt;) &lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Leaving a note&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;In the Tags&amp;amp;Notes dialog, you can also add a note in the “Note Board”. Existing notes are displayed under the entry box:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/-z9VK_Lg-MdE/TsA_aqoMdXI/AAAAAAAAAXE/bumcfMpfgq0/s1600-h/image121.png"&gt;&lt;img alt="image" border="0" height="179" src="http://lh4.ggpht.com/--kfM1FT6Q_I/TsA_bbNCjtI/AAAAAAAAAXM/zqgvCKDoDRQ/image12_thumb.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="332" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The Note Board can be added as a web part to a page as well:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-zqTXnA5cEco/TsA_cND_aLI/AAAAAAAAAXY/rNeTvTe_xmo/s1600-h/image7.png"&gt;&lt;img alt="image" border="0" height="113" src="http://lh3.ggpht.com/-spxKPSxpOAg/TsA_c7YHpMI/AAAAAAAAAXg/HLz1Nv-VOPg/image_thumb3.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="335" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note&lt;/strong&gt;: The Note Board is not dynamic like your favorite Twitter client and will only show new notes from other users after a page refresh. You can’t respond to a note as you’d do in a discussion list: all notes are in a flat view.&lt;br /&gt;&lt;br /&gt;To add a tag or note on a list item, you need to check the checkbox in the list view, which enables the “I Like It” and “Tags &amp;amp; Notes” buttons. Clicking these buttons opens the Tags_Notes dialog.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/-hXGvDL8AbV0/TsA_dtKfYpI/AAAAAAAAAXk/B45F1LIX7-E/s1600-h/image31.png"&gt;&lt;img alt="image" border="0" height="119" src="http://lh6.ggpht.com/-sCJb4qERy_k/TsA_eJwt3BI/AAAAAAAAAXs/ZjaA3xvBsPQ/image_thumb11.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="324" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Notes are just plain text, so no (hash) tagging is possible. Notes are not indexed either so you can’t search for them. Building a search solution to search for notes containing a particular hash tag won’t work.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Useful links:&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Video: Use tags and notes to share information with colleagues (&lt;a href="http://office.microsoft.com/en-us/sharepoint-server-help/video-use-tags-and-notes-to-share-information-with-colleagues-VA102465712.aspx" title="http://office.microsoft.com/en-us/sharepoint-server-help/video-use-tags-and-notes-to-share-information-with-colleagues-VA102465712.aspx"&gt;http://office.microsoft.com/en-us/sharepoint-server-help/video-use-tags-and-notes-to-share-information-with-colleagues-VA102465712.aspx&lt;/a&gt;) &lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;Rating an item&lt;/span&gt;&lt;/strong&gt; &lt;br /&gt;Users can show their appreciation of content by rating it. Rating can be done on any list item (which includes pages and documents) but only when the rating feature is enabled.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Important&lt;/strong&gt;: the rating feature cannot be activated from the UI. You’ll need PowerShell to activate it.&lt;br /&gt;Rating is not enabled by default in a list or library so you’ll need to enable it via the list/library settings:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/-U9Wk318BRpE/TsA_egYoPRI/AAAAAAAAAXw/oBSUk0YDnys/s1600-h/image17.png"&gt;&lt;img alt="image" border="0" height="244" src="http://lh3.ggpht.com/-rXvpoHXTUXA/TsA_e4sX_xI/AAAAAAAAAYA/7QkgpuY9JHo/image_thumb51.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="232" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/-CyzBrdBOdKA/TsA_gM0gXrI/AAAAAAAAAYE/_g1xLvnC47M/s1600-h/image20.png"&gt;&lt;img alt="image" border="0" height="60" src="http://lh4.ggpht.com/-e7gK6TA61Y0/TsA_gofxtWI/AAAAAAAAAYM/JnPr_6MWQ5A/image_thumb6.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enabling rating adds two columns:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-up0KAJ4CEuA/TsA_hCb_xdI/AAAAAAAAAYY/yTaqbhhD16A/s1600-h/image4.png"&gt;&lt;img alt="image" border="0" height="90" src="http://lh3.ggpht.com/-aQ5J1h96_JI/TsA_iPv2j-I/AAAAAAAAAYc/8juepW9TxMA/image_thumb2.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="316" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Rating (0-5): the average rating value. This is displayed in a special field with stars. Under water, it’s a number value. &lt;/li&gt;&lt;li&gt;Number of Ratings: does exactly what it says &lt;/li&gt;&lt;/ul&gt;You can also add the rating site column to a content type to enable rating on just a selection of types.&lt;br /&gt;Once available, a user can rate the item:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/-ItRTOuMfckc/TsA_ikFwthI/AAAAAAAAAYo/vdtxQyVxzHo/s1600-h/image27.png"&gt;&lt;img alt="image" border="0" height="56" src="http://lh3.ggpht.com/-kmLjlwF43i4/TsA_jz9rieI/AAAAAAAAAYs/yRY2ZZhJzjM/image_thumb9.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="313" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Mouseover the stars and click one of them.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-rvYGUQGtxo4/TsA_kOk_JMI/AAAAAAAAAY0/PG-HEMrt0HE/s1600-h/image26.png"&gt;&lt;img alt="image" border="0" height="110" src="http://lh4.ggpht.com/-mjU8IcKaXQY/TsA_khw9PxI/AAAAAAAAAY8/76XfXnTIL50/image_thumb8.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="205" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Important&lt;/strong&gt;: when a user rates an item, this action is not picked up immediately for other users. There is a timer job, scheduled hourly by default, that will calculate the average rating. You’ll notice a difference in the color of the stars: with blue stars an average has been calculated, with yellow stars this has not yet been done. When a user refreshes a page after rating an item on the page, this rating will not be visible before the timer job has run!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/-81BhjI199xA/TsA_lPK5L_I/AAAAAAAAAZE/vpWqOS6Hywg/s1600-h/image81%25255B1%25255D.png"&gt;&lt;img alt="image" border="0" height="51" src="http://lh3.ggpht.com/-F0eozwchpKw/TsA_lS8NxFI/AAAAAAAAAZM/DVffgtsC4-Q/image_thumb4.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="329" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Useful links:&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Enable users to rate content (&lt;a href="http://office.microsoft.com/en-us/sharepoint-server-help/enable-users-to-rate-content-HA101791797.aspx?CTT=3" title="http://office.microsoft.com/en-us/sharepoint-server-help/enable-users-to-rate-content-HA101791797.aspx?CTT=3"&gt;http://office.microsoft.com/en-us/sharepoint-server-help/enable-users-to-rate-content-HA101791797.aspx?CTT=3&lt;/a&gt;) &lt;/li&gt;&lt;li&gt;Turn on Ratings Feature in SharePoint 2010 (&lt;a href="http://kroondyk.blogspot.com/2010/06/turn-on-ratings-feature-in-sharepoint.html" title="http://kroondyk.blogspot.com/2010/06/turn-on-ratings-feature-in-sharepoint.html"&gt;http://kroondyk.blogspot.com/2010/06/turn-on-ratings-feature-in-sharepoint.html&lt;/a&gt;) &lt;/li&gt;&lt;li&gt;Managing privacy (&lt;a href="http://technet.microsoft.com/en-us/library/ee620541.aspx" title="http://technet.microsoft.com/en-us/library/ee620541.aspx"&gt;http://technet.microsoft.com/en-us/library/ee620541.aspx&lt;/a&gt;) &lt;/li&gt;&lt;li&gt;Using the New SharePoint 2010 Ratings Feature in Search (&lt;a href="http://blogs.technet.com/b/speschka/archive/2009/10/28/using-the-new-sharepoint-2010-ratings-feature-in-search.aspx" title="http://blogs.technet.com/b/speschka/archive/2009/10/28/using-the-new-sharepoint-2010-ratings-feature-in-search.aspx"&gt;http://blogs.technet.com/b/speschka/archive/2009/10/28/using-the-new-sharepoint-2010-ratings-feature-in-search.aspx&lt;/a&gt;) &lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;Creating a new blog post&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Blog posts created on your My Site are also social data in the newsfeed:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/-I-VCXzlSrLI/TsA_mIrACcI/AAAAAAAAAZY/HEhXsNyJm_4/s1600-h/image11.png"&gt;&lt;img alt="image" border="0" height="56" src="http://lh4.ggpht.com/-Ak1D5aj7g4k/TsA_ncRqPzI/AAAAAAAAAZg/S7tyPNJMxOU/image_thumb5.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Why is a blog post social? Well, it how it’s used. A blog as a medium isn’t social per se: it’s just a mechanism to publish information, just like a news page is. The way we broadcast doesn’t necessarily make something social. However, most blog post show all the characteristics I like in the before mentioned paper by &lt;a href="http://www.icrossing.com/" target="_blank"&gt;iCrossing&lt;/a&gt;: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;it encourages contributions and feedback from everyone who is      &lt;br /&gt;interested. &lt;/li&gt;&lt;li&gt;it’s open to feedback and participation. Voting, comments and the sharing of information is encouraged. &lt;/li&gt;&lt;li&gt;it’s seen as a two-way conversation. &lt;/li&gt;&lt;li&gt;it’s community based (like this blog post is for the SharePoint community). &lt;/li&gt;&lt;/ul&gt;Please note that not all your blog posts will end up in the newsfeed: only the ones created under your My Site will appear.&amp;nbsp; Postings in shared blogs (like a corporate blog), remain outside newsfeed unless you’ll write some custom code to add them. Allowing My Sites might not be something you had planned for.&lt;br /&gt;&lt;br /&gt;When you’re on your My Site, there’s a shortcut to adding new blog posts:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-LVZqPrhUdvQ/TsA_nxfExrI/AAAAAAAAAZk/jzQDRvIezuo/s1600-h/image%25255B3%25255D.png"&gt;&lt;img alt="image" border="0" height="90" src="http://lh6.ggpht.com/-GWMDbu1TveQ/TsA_pvHX6bI/AAAAAAAAAZw/-BLEx21D5TE/image_thumb%25255B1%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The blog is a sub site of the My Site.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Useful links:&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Plan for My Sites (&lt;a href="http://technet.microsoft.com/en-us/library/cc262500.aspx" title="http://technet.microsoft.com/en-us/library/cc262500.aspx"&gt;http://technet.microsoft.com/en-us/library/cc262500.aspx&lt;/a&gt;) &lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;User profile events or updates&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Although user profile information is part of the social data realm, it is not really created like the categories above but is generated from updates to a profile or (automatic) events based on profile information. &lt;br /&gt;&lt;br /&gt;When a user changes a profile property, this change is picked up and published to people who &lt;em&gt;follow&lt;/em&gt; the user (see “Following colleagues” below for what that means in a SharePoint context) and have subscribed to a particular change category (like “Sharing Interests”).&lt;br /&gt;&lt;br /&gt;The update is shown in the newsfeed:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-IUKwp_eKi1I/TsA_qLjXnOI/AAAAAAAAAZ0/fRYNf1ndx3s/s1600-h/image311.png"&gt;&lt;img alt="image" border="0" height="45" src="http://lh3.ggpht.com/-84M5qDgf2vk/TsA_qVctMFI/AAAAAAAAAZ8/hmIOVFpAByQ/image_thumb111.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Not only an active profile change ends up as an activity, also changing memberships, upcoming anniversaries or manager change generate an entry in the newsfeed.&lt;br /&gt;&lt;br /&gt;A new feature in SharePoint 2010 is the status message, although under water it’s just a profile field called “Status message” (SPS-StatusNotes) that you cannot edit otherwise (not even from the user profile service application). The status message can be edited by yourself on the My Profile page:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-H2KeQyWEOh8/TsA_q_s4TbI/AAAAAAAAAaI/xhDbiMsD6NE/s1600-h/image%25255B7%25255D.png"&gt;&lt;img alt="image" border="0" height="84" src="http://lh5.ggpht.com/-4oBZ1WF8z5Q/TsA_r0kpt8I/AAAAAAAAAaQ/XUpBZGLl0KA/image_thumb%25255B3%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="364" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: x-large;"&gt;The newsfeed and subscribing to activities&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The newsfeed is somewhat similar to the Facebook wall but actually more similar to the LinkedIn “All updates”. It shows various types of activities, by you or by your colleagues. The newsfeed is available in two flavours:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Showing the activities from the colleagues you follow. The web part for this (What’s New) is on your My Newsfeed page (which is the default page of the My Site host) &lt;/li&gt;&lt;li&gt;Showing your activities. The web part for this (Recent Activities) is on the first tab of your profile page. &lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Following colleagues&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;You need to add a user as colleague to follow his or her activities. This can be done from the “My colleagues” pages in the My Site host:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-oXF7H45nRRI/TsA_sfb6RqI/AAAAAAAAAaU/ug_8OZEdFQI/s1600-h/image5.png"&gt;&lt;img alt="image" border="0" height="151" src="http://lh4.ggpht.com/-dvhWx6eMHOk/TsBAGbkepkI/AAAAAAAAAag/MAtcj6Qg0Eo/image_thumb1.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="244" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Users that report to the same manager as you, are automatically added as your colleague, but this list can be edited manually. The button “View Suggestions” brings up suggested colleagues, like people who have tagged with your interest:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh4.ggpht.com/-7CTQHk2oFJ0/TsBAG7SA5FI/AAAAAAAAAak/UmT5-YzIqh4/s1600-h/image%25255B15%25255D.png"&gt;&lt;img alt="image" border="0" height="38" src="http://lh6.ggpht.com/-yGQz7u0Rfbo/TsBAHLQVtGI/AAAAAAAAAao/m45MWxru3Ks/image_thumb%25255B7%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="373" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/-99StdN47CjY/TsBAHoODcBI/AAAAAAAAAaw/QskH5t6VwyY/s1600-h/image%25255B19%25255D.png"&gt;&lt;img alt="image" border="0" height="97" src="http://lh5.ggpht.com/-6nnTa_ErkOQ/TsBAIbAj5pI/AAAAAAAAAa4/age6o4jaVL0/image_thumb%25255B9%25255D.png?imgmax=800" style="background-image: none; border-width: 0px; display: inline; margin: 0px 0px 5px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="image" width="381" /&gt;&lt;/a&gt;&lt;br /&gt;Once you have colleagues, you can follow their activities as set in the Newsfeed section of your profile. The following activities are available:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Note Board post &lt;/li&gt;&lt;li&gt;Tagging with my interests &lt;/li&gt;&lt;li&gt;Rating &lt;/li&gt;&lt;li&gt;Status Message &lt;/li&gt;&lt;li&gt;Manager change &lt;/li&gt;&lt;li&gt;New blog post &lt;/li&gt;&lt;li&gt;New membership &lt;/li&gt;&lt;li&gt;Sharing Interests &lt;/li&gt;&lt;li&gt;Tagging by my colleague &lt;/li&gt;&lt;li&gt;Upcoming birthday &lt;/li&gt;&lt;li&gt;Birthday &lt;/li&gt;&lt;li&gt;Upcoming workplace anniversary &lt;/li&gt;&lt;li&gt;Workplace anniversary &lt;/li&gt;&lt;li&gt;New colleague &lt;/li&gt;&lt;li&gt;Job title change &lt;/li&gt;&lt;li&gt;Profile update &lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Note&lt;/strong&gt;: The “Tagging with my interests” activity is generated for all users, not just your colleagues.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;What the newsfeed is not&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;What you’ll soon discover about the newsfeed, is that it’s not Facebook or Twitter:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You cannot “Like” an activity or write a comment on it. In SharePoint 2010, you like or comment &lt;em&gt;content&lt;/em&gt;, not an &lt;em&gt;activity&lt;/em&gt; &lt;/li&gt;&lt;li&gt;You cannot hash tag your notes. Well, you can put a hash sign in, but there’s no mechanism to pick it up. So that also means you don’t have notes in your newsfeed that contain words that match your interests. &lt;/li&gt;&lt;li&gt;It’s all but real time. New activities are picked up by a timer job running every hour (default setting), the newsfeed web part does not refresh without a page reload. You can set the jobs to run every minute, but that’s still far from real time. &lt;/li&gt;&lt;li&gt;You cannot “follow” any other entity than a colleague, so if you want to follow activities on a community site, you have to visit that site. &lt;/li&gt;&lt;/ul&gt;Social data in SharePoint 2010 is very much profile oriented and you’ll have to go to your or someone else’s profile page so see what’s cooking. So SharePoint social is a corporate LinkedIn, without an OOTB way to follow community activity.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: x-large;"&gt;A square peg in a round hole?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Does SharePoint 2010 social functionality make sense? Well, that depends on your needs. You might be just happy with a corporate LinkedIn, centered around user profiles.&lt;br /&gt;If you’re searching for hash tagging, liking or leaving comments on activities and want social data centered around a community instead of a profile, SharePoint out-of-the-box will not satisfy your needs.&lt;br /&gt;&lt;br /&gt;However, please appreciate that SharePoint takes security into account: you won’t see anything you don’t have access rights too. In the corporate world, securing content is often best practice but this comes with a price: if you want to build a knowledge platform using social media, preventing people from seeing activities is also keeping knowledge away from them. Just think of the case where your colleague tags something in a team site you don’t have access to. Should you still see the activity in your newsfeed?&lt;br /&gt;&lt;br /&gt;So aren’t we asking too much of the platform? Full security and governance on one hand, full openness on the other. Structured data, retention policies and document management on on hand (a closed system), unstructured tagging, rating and comments on the other (an open system).&lt;br /&gt;I don’t claim to have an exact answer to the paradox above as it’ll depend on the customer’s case. As long as you’re aware of the possibilities and consequences, you can provide the best solution. Hopefully, this blog post helps a little with that.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Useful links:&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SharePoint Server 2010 Adoption Best Practices White Paper (&lt;a href="http://www.microsoft.com/download/en/details.aspx?id=1288" title="http://www.microsoft.com/download/en/details.aspx?id=1288"&gt;http://www.microsoft.com/download/en/details.aspx?id=1288&lt;/a&gt;) &lt;/li&gt;&lt;li&gt;SharePoint Server 2010 Usage Best Practices White Paper (&lt;a href="http://www.microsoft.com/download/en/details.aspx?id=12500" title="http://www.microsoft.com/download/en/details.aspx?id=12500"&gt;http://www.microsoft.com/download/en/details.aspx?id=12500&lt;/a&gt;) &lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;span style="font-size: x-large;"&gt;Coming up&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Now we’ve cleared level 100 and it’s time to move a little deeper into the mechanics of social data in SharePoint 2010, so check out the next posts in this series, coming soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-3792255158976620168?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/3792255158976620168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=3792255158976620168' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3792255158976620168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3792255158976620168'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2011/11/sharepoint-2010-social-data-part-1.html' title='SharePoint 2010 social data, part 1'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-jKvl6qoC4Zg/TsA_RU8NlKI/AAAAAAAAAVM/kmMqTM4wRMA/s72-c/image_thumb81.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-1089633684078798771</id><published>2011-04-11T13:52:00.001+02:00</published><updated>2011-04-11T13:52:39.483+02:00</updated><title type='text'>Generically kick starting workflows for system account actions</title><content type='html'>&lt;p&gt;Since MOSS 2007 service pack 1, workflows are not automatically starting when the list item is created or modified by the system account. For a recent project, we implemented a generic workflow starter event receiver that kick starts workflows in certain conditions.&lt;/p&gt;  &lt;p&gt;The event receiver does its trick for the ItemAdded and ItemUpdated events and calls a private method for the implementation:&lt;/p&gt;  &lt;hr /&gt;  &lt;pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ItemAdded(SPItemEventProperties properties)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  StartWorkflows(properties, EventType.ItemAdded);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Please note that the EventType enum is project specific, it’s not standard SharePoint.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The private method StartWorkflows takes two properties: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;the event properties&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;a custom enum value&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;First, a check is done if we can get the item id and the list name. This should never go wrong, but you never know…&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; itemId = properties.ListItemId;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; listName = properties.ListTitle;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (itemId == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; || listName == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We now start running the code with elevated privileges. This is required to get the appropriate access to the item and its properties.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;SPSecurity.RunWithElevatedPrivileges(&lt;span style="color: #0000ff"&gt;delegate&lt;/span&gt;()&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (SPSite ElevatedSite = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SPSite(properties.SiteId))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (SPWeb ElevatedWeb = ElevatedSite.OpenWeb(properties.RelativeWebUrl))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;      SPList list = ElevatedWeb.Lists[listName];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;      SPListItem item = list.GetItemById(itemId);&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Next, a check is done if the item is a folder. In our scenario, nothing should be done with folders so we rule them out here:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (item.Folder != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now we check the account that added or modified the item:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;  &lt;hr /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; loginName;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (eventType == EventType.ItemAdded)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  loginName = item.GetFieldValueUserLogin(SPBuiltInFieldId.Author);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  loginName = item.GetFieldValueUserLogin(SPBuiltInFieldId.Editor);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As you can see, we implemented an extension method (GetFieldValueUserLogin) to get the name:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; GetFieldValueUserLogin(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; SPListItem item, Guid fieldId)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (item != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    SPFieldUserValue userValue = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SPFieldUserValue(item.Web, item[fieldId] &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; userValue.User.LoginName;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Empty;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We now call the code that actually fires the workflows. This is done with a helper method (for reuse purposes):&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;SharepointHelper.StartWorkFlow(ElevatedSite, list, item, loginName);&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;In the helper method, all workflow associations of the list are retrieved. if the workflow is of the type “AutoStartCreate” or “AutoStartChange”, a workflow will be started on the item. Here’s the code of the method:&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; StartWorkFlow(SPSite site, SPList list, SPListItem item, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; loginName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (loginName.ToUpper() == &amp;quot;&lt;span style="color: #8b0000"&gt;SHAREPOINT\\SYSTEM&lt;/span&gt;&amp;quot;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    SPWorkflowManager workflowManager = site.WorkflowManager;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    SPWorkflowAssociationCollection workflowAssociations = list.WorkflowAssociations;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (SPWorkflowAssociation workflowAssociation &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; workflowAssociations)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (workflowAssociation.AutoStartCreate || workflowAssociation.AutoStartChange)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;      {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;        workflowManager.StartWorkflow(item, workflowAssociation, workflowAssociation.AssociationData);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;      }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In our scenario, the event receiver is added to a particular list by the event receiver that created the list. I haven’t tested this on SharePoint 2010 yet but will post an update if I do.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-1089633684078798771?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/1089633684078798771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=1089633684078798771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/1089633684078798771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/1089633684078798771'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2011/04/generically-kick-starting-workflows-for.html' title='Generically kick starting workflows for system account actions'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-3431683680973373351</id><published>2010-10-02T19:11:00.001+02:00</published><updated>2010-10-02T19:11:56.945+02:00</updated><title type='text'>Files not indexed in custom default view</title><content type='html'>&lt;p&gt;One of the things I always set as a crawl rule is something like “http://*/Forms/*.aspx”. This will exclude all the list view pages from being indexed. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/TKdnyaebjmI/AAAAAAAAARg/zUPI3DKO0GA/s1600-h/image%5B3%5D.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://lh5.ggpht.com/_VvmOdY-72ug/TKdny7OqKTI/AAAAAAAAARk/_Lhg7qVX_qg/image_thumb%5B1%5D.png?imgmax=800" width="353" height="104" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I never experienced a problem until recently, where some documents didn’t show up in the search results. The setup is a MOSS 2007 farm at a customer. It’s running a webapp with a single site collection and multiple (levels of) subsites.&lt;/p&gt;  &lt;p&gt;In on of the sites, there is a library with a custom view set as default: “DocumentsByType.aspx” (the screen shot below is from a Dutch site, but you’ll get the idea). I’ve recreated it for this article with some dummy content. There are two documents in there: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/TKdnzGLqW_I/AAAAAAAAARo/j10GZCHRats/s1600-h/image%5B7%5D.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://lh5.ggpht.com/_VvmOdY-72ug/TKdnzdMECII/AAAAAAAAARs/L7F3igp9ASU/image_thumb%5B3%5D.png?imgmax=800" width="425" height="55" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now when I search for these documents on a search page with a specific scope (after running a full crawl), I get results, but not the ones I expect:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/TKdnz4Mg1oI/AAAAAAAAARw/TZqecwu9FGg/s1600-h/image%5B10%5D.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://lh4.ggpht.com/_VvmOdY-72ug/TKdn0JC8TcI/AAAAAAAAAR0/oQT70U0AL-E/image_thumb%5B4%5D.png?imgmax=800" width="244" height="127" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;So I get the site and the default page, which contains a list view web part of the document library. Hey, I want my documents in the results!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Elementary, dear Watson&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;After staring at this for a while, I checked various possible causes:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;versioning. Nope, all docs were major versions&lt;/li&gt;    &lt;li&gt;security. Nope, I’m logged in in God mode&lt;/li&gt;    &lt;li&gt;library excluded from search results? Nope, indexing allowed.&lt;/li&gt;    &lt;li&gt;Type of document? Nope, I have a doc and a docx. How standard can it be?&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I expected to find relevant information in the crawl log, filtered on my library URL, but found none:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/TKdn0crW7TI/AAAAAAAAAR4/Z88ralJ37FQ/s1600-h/image%5B19%5D.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://lh3.ggpht.com/_VvmOdY-72ug/TKdn00IIUzI/AAAAAAAAAR8/N6of2uQnpCE/image_thumb%5B9%5D.png?imgmax=800" width="413" height="117" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There’s nothing in the document library? Pull the other one, will you!&lt;/p&gt;  &lt;p&gt;But wait, I have a crawl rule specified, remember? So I must have excluded all libraries. Well, surprisingly that isn’t the case. When searching in another scope, I do get results:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/TKdn1Og9GsI/AAAAAAAAASA/9t3qHpx9wLM/s1600-h/image%5B22%5D.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://lh3.ggpht.com/_VvmOdY-72ug/TKdn1beyibI/AAAAAAAAASE/BF41sCvKorw/image_thumb%5B12%5D.png?imgmax=800" width="409" height="177" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;So what’s the difference between the library that returns results and the one that doesn’t? The view!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Take a different view: the default one&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I happens that my libary has a default view that is not allitems.aspx (but “DocumentsByType.aspx”, remember?). After I change the “All documents” view (allitems.aspx) to be the default one and run a full crawl, I get the results I expect:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/TKdn1_LxJtI/AAAAAAAAASI/LJpFWXOBaC8/s1600-h/image%5B29%5D.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://lh5.ggpht.com/_VvmOdY-72ug/TKdn2UloeyI/AAAAAAAAASM/EjitaWX1aYQ/image_thumb%5B15%5D.png?imgmax=800" width="399" height="225" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The crawl log also contains info now:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/TKdn2q4AJfI/AAAAAAAAASQ/BfoKJtNBQ4E/s1600-h/image%5B33%5D.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://lh6.ggpht.com/_VvmOdY-72ug/TKdn3NiKWnI/AAAAAAAAASU/KdhkRii27jY/image_thumb%5B17%5D.png?imgmax=800" width="407" height="173" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;So what’s happening?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you exclude forms pages in a library from being crawled, the items can’t be indexed. Remember that the indexer crawls over http, not over the object model. However, it seems there’s something special with the allitems.aspx because even if we set the crawl rule “http://*/Forms/*.aspx” and have the allitems.aspx page as the default view, it gets indexed.&lt;/p&gt;  &lt;p&gt;It’s hard to find anything with reflector. The only thing I found that might be relevant is “Microsoft.Office.Server.Search.Administration.SearchAdminUtils.NormalizeUri(Uri)”, where the following code can be found:&lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 407px; padding-right: 5px; height: 144px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (builder.ToString().EndsWith(&amp;quot;&lt;span style="color: #8b0000"&gt;/allItems.aspx&lt;/span&gt;&amp;quot;))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;  builder.Length -= LogsConstants.CWC_URL_ALLITEMS_ASPX;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;If you fancy a deeper dive and find more info, share your knowledge. In the meantime, be careful with crawl rules and your default views.&lt;br /&gt;&lt;br /&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-3431683680973373351?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/3431683680973373351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=3431683680973373351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3431683680973373351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3431683680973373351'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2010/10/files-not-indexed-in-custom-default.html' title='Files not indexed in custom default view'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_VvmOdY-72ug/TKdny7OqKTI/AAAAAAAAARk/_Lhg7qVX_qg/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-4518297676694418456</id><published>2010-06-25T17:45:00.001+02:00</published><updated>2010-06-25T17:45:05.548+02:00</updated><title type='text'>Changing a site programmatically right after provisioning</title><content type='html'>&lt;p&gt;For a customer, I’ve designed a farm with several web applications. One of the web applications is used for ad-hoc collaboration sites, each running as a site collection in a managed path.&lt;/p&gt;  &lt;p&gt;The collaboration sites are based on a Team site definition and need some extras:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;a custom design&lt;/li&gt;    &lt;li&gt;two extra navigation buttons: one called Home, to be shown as the first button, one called Search, to be shown as the last one. The result should be something like: [Home] [Start page] [Search]&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;A good practice is to use feature stapling (see &lt;a title="http://msdn.microsoft.com/en-us/library/bb861862(office.12).aspx" href="http://msdn.microsoft.com/en-us/library/bb861862(office.12).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb861862(office.12).aspx&lt;/a&gt; if you don’t know what this is) to achieve this. So I created two features:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;a feature with receiver to set some properties programmatically&lt;/li&gt;    &lt;li&gt;a stapling feature&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The stapling feature consists of an elements file with a FeatureSiteTemplateAssociation element:&lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;FeatureSiteTemplateAssociation&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Id&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;[feature id]&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;TemplateName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;MYTEMPLATE#0&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The feature receiver sets some properties:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; WerkplaatsReceiver : SPFeatureReceiver&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:         &lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4:         &lt;span style="color: #808080"&gt;/// Occurs after the Feature is activated. Navigation nodes are added and a custom CSS is applied.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5:         &lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6:         &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;properties&amp;quot;&amp;gt;An &amp;lt;see cref=&amp;quot;T:Microsoft.SharePoint.SPFeatureReceiverProperties&amp;quot;&amp;gt;&amp;lt;/see&amp;gt; object that represents the properties of the event.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:         [SharePointPermission(SecurityAction.LinkDemand, ObjectModel = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)]&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; FeatureActivated(SPFeatureReceiverProperties properties)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:         {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10:             &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:             {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12:                 &lt;span style="color: #008000"&gt;//Declare variables&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:                 &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; newCSS = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 14:                 &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; searchCenterUrl = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15:                 &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; searchCenterTitle = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 16:                 &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; homeUrl = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 17:                 &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; homeTitle = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 18:                 &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; portalName = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 19:                 &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; portalUrl = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 20:                 &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; featureId = properties.Feature.DefinitionId.ToString();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 21: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 22:                 &lt;span style="color: #008000"&gt;//Get the values for the properties. Check if they exist in the feature xml to avoid object reference errors.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 23:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;CssLocation&lt;/span&gt;&amp;quot;] != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 24:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 25:                     newCSS = properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;CssLocation&lt;/span&gt;&amp;quot;].Value;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 26:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 27:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;SearchCenterUrl&lt;/span&gt;&amp;quot;] != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 28:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 29:                     searchCenterUrl = properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;SearchCenterUrl&lt;/span&gt;&amp;quot;].Value;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 30:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 31:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;SearchCenterTitle&lt;/span&gt;&amp;quot;] != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 32:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 33:                     searchCenterTitle = properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;SearchCenterTitle&lt;/span&gt;&amp;quot;].Value;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 34:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 35:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;HomeUrl&lt;/span&gt;&amp;quot;] != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 36:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 37:                     homeUrl = properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;HomeUrl&lt;/span&gt;&amp;quot;].Value;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 38:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 39:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;HomeTitle&lt;/span&gt;&amp;quot;] != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 40:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 41:                     homeTitle = properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;HomeTitle&lt;/span&gt;&amp;quot;].Value;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 42:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 43:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;PortalName&lt;/span&gt;&amp;quot;] != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 44:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 45:                     portalName = properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;PortalName&lt;/span&gt;&amp;quot;].Value;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 46:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 47:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;PortalUrl&lt;/span&gt;&amp;quot;] != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 48:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 49:                     portalUrl = properties.Feature.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;PortalUrl&lt;/span&gt;&amp;quot;].Value;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 50:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 51: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 52:                 &lt;span style="color: #008000"&gt;//get the site collection where the feature is activated&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 53:                 &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (var curSite = (SPSite)properties.Feature.Parent)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 54:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 55:                     &lt;span style="color: #008000"&gt;//Set the portal connection&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 56:                     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (portalName != &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot; &amp;amp;&amp;amp; portalUrl != &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 57:                     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 58:                         curSite.PortalName = portalName;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 59:                         curSite.PortalUrl = portalUrl;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 60:                     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 61: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 62:                     &lt;span style="color: #008000"&gt;//Get a reference to the root web&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 63:                     var curWeb = curSite.RootWeb;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 64: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 65:                     &lt;span style="color: #008000"&gt;//Set the path to the CSS&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 66:                     curWeb.AlternateCssUrl = newCSS;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 67: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 68:                     &lt;span style="color: #008000"&gt;//Disable any theme&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 69:                     curWeb.ApplyTheme(&amp;quot;&lt;span style="color: #8b0000"&gt;none&lt;/span&gt;&amp;quot;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 70: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 71:                     &lt;span style="color: #008000"&gt;//Set search center url&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 72:                     curWeb.AllProperties[&amp;quot;&lt;span style="color: #8b0000"&gt;SRCH_ENH_FTR_URL&lt;/span&gt;&amp;quot;] = searchCenterUrl;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 73: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 74:                     &lt;span style="color: #008000"&gt;//Add navigation nodes as external nodes to make sure we don't get file not found exceptions&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 75:                     SPNavigationNodeCollection topNavNodes = curWeb.Navigation.TopNavigationBar;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 76:                     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (topNavNodes != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 77:                     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 78:                         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (homeTitle != &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot; &amp;amp;&amp;amp; homeUrl != &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 79:                         {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 80:                             SPNavigationNode homeNode = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SPNavigationNode(homeTitle, homeUrl, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 81: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 82:                             &lt;span style="color: #008000"&gt;//Add to nodes collection&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 83:                             topNavNodes.AddAsFirst(homeNode);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 84: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 85:                             &lt;span style="color: #008000"&gt;//Add feature id so we can always remove these nodes on feature deactivate&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 86:                             homeNode.Properties.Add(&amp;quot;&lt;span style="color: #8b0000"&gt;FeatureId&lt;/span&gt;&amp;quot;, featureId);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 87:                             homeNode.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 88:                         }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 89:                         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (searchCenterTitle != &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot; &amp;amp;&amp;amp; searchCenterUrl != &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 90:                         {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 91:                             SPNavigationNode searchCenterNode = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SPNavigationNode(searchCenterTitle, searchCenterUrl, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 92: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 93:                             &lt;span style="color: #008000"&gt;//Add to nodes collection&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 94:                             topNavNodes.AddAsLast(searchCenterNode);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 95: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 96:                             &lt;span style="color: #008000"&gt;//Add feature id so we can always remove these nodes on feature deactivate&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 97:                             searchCenterNode.Properties.Add(&amp;quot;&lt;span style="color: #8b0000"&gt;FeatureId&lt;/span&gt;&amp;quot;, featureId);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 98:                             searchCenterNode.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 99:                         }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;100:                     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;101:                     &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;102:                     &lt;span style="color: #008000"&gt;//Update the web&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;103:                     curWeb.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;104:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;105:             }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;106:             &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (SPException)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;107:             {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;108:             }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;109:         }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The feature.xml contains the properties:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Properties&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Key&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;HomeUrl&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;/pages/welcome.aspx&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Key&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;HomeTitle&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Home&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Key&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;SearchCenterUrl&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;http://myfarm/searchcenter/&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Key&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;SearchCenterTitle&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Search&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Key&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;CssLocation&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;/Style Library/collaboration.css&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Key&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;PortalName&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Collaboration&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Property&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Key&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;PortalUrl&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Properties&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You might have noticed I’m adding navigation nodes with some extra properties (the feature Id). This is to make sure I can remove the nodes (even if they have changed!) when the feature is deactivated:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; FeatureDeactivating(SPFeatureReceiverProperties properties)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2:         {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:             &lt;span style="color: #008000"&gt;//Declare variables&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4:             &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; featureId = properties.Feature.DefinitionId.ToString();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6:             &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:             {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8:                 &lt;span style="color: #008000"&gt;//get the site collection where the feature is deactivated&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:                 &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (var curSite = (SPSite)properties.Feature.Parent)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:                     &lt;span style="color: #008000"&gt;//Reset the portal connection&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12:                     curSite.PortalName = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:                     curSite.PortalUrl = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 14: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15:                     &lt;span style="color: #008000"&gt;//Get the root web&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 16:                     var curWeb = curSite.RootWeb;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 17: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 18:                     &lt;span style="color: #008000"&gt;//Reset the alternate CSS&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 19:                     curWeb.AlternateCssUrl = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 20: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 21:                     &lt;span style="color: #008000"&gt;//Reset the URL to the common search center&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 22:                     curWeb.AllProperties[&amp;quot;&lt;span style="color: #8b0000"&gt;SRCH_ENH_FTR_URL&lt;/span&gt;&amp;quot;] = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 23: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 24:                     &lt;span style="color: #008000"&gt;//Delete the navigation nodes that were added via this feature&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 25:                     SPNavigationNodeCollection topNavNodes = curWeb.Navigation.TopNavigationBar;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 26:                     &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (SPNavigationNode node &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; topNavNodes)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 27:                     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 28:                         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (node.Properties.ContainsKey(&amp;quot;&lt;span style="color: #8b0000"&gt;FeatureId&lt;/span&gt;&amp;quot;))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 29:                         {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 30:                             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;)node.Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;FeatureId&lt;/span&gt;&amp;quot;] == featureId)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 31:                             {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 32:                                 topNavNodes.Delete(node);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 33:                             }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 34:                         }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 35:                     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 36: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 37:                     &lt;span style="color: #008000"&gt;//Update the web&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 38:                     curWeb.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 39:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 40:             }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 41:             &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (SPException)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 42:             {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 43:             }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 44:         }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So far so good…&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;A problem with the order of events&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Implementing this did not result in expected behaviour when it came to the navigation nodes: every time the order of the nodes was [Start page] [Home] [Search].&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;After a while, I realised that the order of events was working against me. When the site is created, the following takes place:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;site features from the onet.xml&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;stapled site features&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;web features from the onet.xml&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;stapled web features&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;modules&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The Start page is created from the modules section and therefore created &lt;em&gt;after&lt;/em&gt; my feature is activated. I need a way to fire an event after the site is created, but there’s no site created event. Luckily, there is way: provisioning. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Provisioning to the rescue&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Microsoft uses provisioning for its portal templates, to add extra sites. For my solution, I do not have to create a site hierarchy, just set some properties.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;It’s actually fairly easy: create a provisioning class (see &lt;a title="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebprovisioningprovider.provision.aspx" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebprovisioningprovider.provision.aspx"&gt;http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebprovisioningprovider.provision.aspx&lt;/a&gt;), override the Provision method and add a reference to it in the site configuration in the webtemp*.xml.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; &lt;span style="color: #0000ff"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Templates&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;ows&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;Microsoft SharePoint&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Template&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;MYTEMPLATE&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;12004&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Configuration&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Title&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;collaboration site&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;Hidden&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;FALSE&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;ImageUrl&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;/_layouts/Images/collaborationsite.gif&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;Description&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;A collaboration site.&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;RootWebOnly&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;TRUE&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;DisplayCategory&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;My company&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;ProvisionAssembly&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;[my assembly name], Version=1.0.0.0, Culture=neutral, PublicKeyToken=[my token]&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;ProvisionClass&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;CollaborationProvisioner&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Configuration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Configuration&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ID&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Title&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;collaboration site&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;Hidden&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;TRUE&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;ImageUrl&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;/_layouts/Images/collaborationsite.gif&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;Description&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;A collaboration site.&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;RootWebOnly&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;TRUE&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;        &lt;span style="color: #ff0000"&gt;DisplayCategory&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;My company&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Configuration&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Template&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Templates&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As you might have noticed, I have tow configurations. The first one is the one that fires the provisioning code, the second one is the actual configuration in the onet.xml. In code, I call the configuration with ID=1 to create the actual site. After that, I add the feature:&amp;#160; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; CollaborationProvisioner : Microsoft.SharePoint.SPWebProvisioningProvider&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Provision(SPWebProvisioningProperties props)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4:         {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5:             &lt;span style="color: #008000"&gt;//Apply template in a 'using' statement to make sure the SPWeb is available again for the feature receivers and for &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6:             &lt;span style="color: #008000"&gt;//persisting the applied template in the web object&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:             &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (var curWeb = (SPWeb)props.Web)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8:             {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:                 &lt;span style="color: #008000"&gt;//Apply the hidden template. The #0 is the one the end users see.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10:                 curWeb.ApplyWebTemplate(&amp;quot;&lt;span style="color: #8b0000"&gt;MYTEMPLATE#1&lt;/span&gt;&amp;quot;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:             }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:             &lt;span style="color: #008000"&gt;//Get a reference to the site collection. Perhaps no need to dispose but not sure if we own the object &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 14:             &lt;span style="color: #008000"&gt;//(also see http://solutionizing.net/2008/12/06/the-new-definitive-spsitespweb-disposal-article/)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15:             &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (var curSite = (SPSite)props.Web.Site)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 16:             {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 17:                 &lt;span style="color: #008000"&gt;//Add the feature&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 18:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (curSite.Features[&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Guid(&amp;quot;&lt;span style="color: #8b0000"&gt;[my guid]&lt;/span&gt;&amp;quot;)] == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 19:                 {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 20:                     curSite.Features.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Guid(&amp;quot;&lt;span style="color: #8b0000"&gt;[my guid]&lt;/span&gt;&amp;quot;));&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 21:                 }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 22:             }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 23:         }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 24:     }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;A few important notes on this:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;if you don’t call ApplyWebTemplate, you’ll need to choose one in the browser (which is strange for the user as he has already chosen one)&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;If you don’t use “using” or properly dispose the SPWeb after calling ApplyWebTemplate, the feature that is added on line 20 will generate an error as it cannot update the SPWeb because it’s still in use by the provision process&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;If with ApplyWebTemplate you call the same template as the one that has the provisioning class referenced, you’ll end up with an eternal loop&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Anyway, this worked for me and triggered numerous ideas on what else you could do with this. Cool stuff anyway.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-4518297676694418456?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/4518297676694418456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=4518297676694418456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4518297676694418456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4518297676694418456'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2010/06/changing-site-programmatically-right.html' title='Changing a site programmatically right after provisioning'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-8659165719361468754</id><published>2010-04-23T09:14:00.001+02:00</published><updated>2010-04-23T09:14:26.716+02:00</updated><title type='text'>The power of the site directory</title><content type='html'>&lt;p&gt;Sites in SharePoint are often in a sort of &lt;em&gt;logical&lt;/em&gt; parent/child relationship. For example, projects can be part of a program or related to a customer, units can be part of a division etc:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/S9FIr-asRjI/AAAAAAAAAPo/ZWtenayqUUg/s1600-h/image3.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://lh4.ggpht.com/_VvmOdY-72ug/S9FIsUUpUEI/AAAAAAAAAPs/f353BswOLL4/image_thumb1.png?imgmax=800" width="260" height="113" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This logical relationship is often translated into a &lt;em&gt;physical&lt;/em&gt; parent/child relationship in SharePoint using sites with sub sites:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/S9FIsmmfc7I/AAAAAAAAAPw/39JGeF-UCU0/s1600-h/image11.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://lh6.ggpht.com/_VvmOdY-72ug/S9FItF70y8I/AAAAAAAAAP0/7X8MtURECmc/image_thumb7.png?imgmax=800" width="211" height="245" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the example above, I think of the customer site being the root site of a site collection. In real life, there might be more levels above this, but the above assumption should give you an idea.&lt;/p&gt;  &lt;p&gt;There are, however, some disadvantages with using sub sites:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;each sub site might require very specific access rights. As all SharePoint groups are managed at the site collection level, the chance increase that security is not set properly &lt;/li&gt;    &lt;li&gt;if you get a lot of sub sites, each with unique groups, the amount of groups to manage at the site collection level just explodes &lt;/li&gt;    &lt;li&gt;in the example above, the root and sub sites have a complete different level of &lt;em&gt;life cycle management&lt;/em&gt;. Whereas a project has a start and an end within a reasonable amount of time, a customer relation lasts a lot longer. To archive a finished project, you need to archive it with the customer as the sub site has dependencies on the site collection (for content types and site columns for example). Restoring an archived project also means restoring the site collection stuff, which might have changed dependencies. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Life cycle management is a worth writing a few more posts but for this one I’ll leave it to that.&lt;/p&gt;  &lt;h4&gt;using site collections&lt;/h4&gt;  &lt;p&gt;To overcome the disadvantages mentioned above, you can architecture your solution with site collections for your projects.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/S9FItYQHDBI/AAAAAAAAAP4/T5DtwAjDP7o/s1600-h/image15.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://lh3.ggpht.com/_VvmOdY-72ug/S9FIt_j2vlI/AAAAAAAAAP8/ViwjedEi850/image_thumb9.png?imgmax=800" width="260" height="53" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;These site collections are created within a managed path and exist on the same physical level. Using site collections has some advantages:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;a site collection has its own groups and because there are no sub sites (the assumption is that there are no sub projects), the amount of groups is manageable &lt;/li&gt;    &lt;li&gt;a site collection has a natural security boundary so it’s easier to secure your data &lt;/li&gt;    &lt;li&gt;a site collection can have its own database. When the site is no longer active and should be archived, this database can be detached from SQL, zipped and stored on tape &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There are also some disadvantages:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;you can have fewer sites than when using a combination of site collections with sub sites. However, looking at the absolute numbers, this seems a bit theoretical (please refer to &lt;a title="http://technet.microsoft.com/en-us/library/cc262787.aspx" href="http://technet.microsoft.com/en-us/library/cc262787.aspx"&gt;http://technet.microsoft.com/en-us/library/cc262787.aspx&lt;/a&gt; for details). &lt;/li&gt;    &lt;li&gt;you cannot aggregate data between site collections using the OOTB components like the Content Query web part &lt;/li&gt;    &lt;li&gt;there is no physical connection between the sites, so there is no breadcrumb or URL to indicate the logical relationship &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;using the Site Directory as a logical relation store&lt;/h4&gt;  &lt;p&gt;Creating site collections can be done from the Central Admin or from the Sites Directory. This directory is based on, like almost everything in SharePoint, a list (called Sites) with items and metadata. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/S9FIublgT9I/AAAAAAAAAQA/rLK0ZuK5Xck/s1600-h/image50.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://lh4.ggpht.com/_VvmOdY-72ug/S9FIurVUjHI/AAAAAAAAAQE/-LuwwBLUNHI/image_thumb28.png?imgmax=800" width="169" height="162" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The pages in the Site Directory site just provide you a view on that list, using special web parts. When a new site is created, &lt;em&gt;anywhere&lt;/em&gt; in a portal that has a Site Directory,&amp;#160; the user can choose if a reference to that site should be stored as an item in that list. The user can also provide some extra metadata to make the site easier to find.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/S9FIvNa8pFI/AAAAAAAAAQI/AiQ1qJZIkGw/s1600-h/image54.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://lh3.ggpht.com/_VvmOdY-72ug/S9FIvrnDfAI/AAAAAAAAAQM/wxsYqFujMio/image_thumb30.png?imgmax=800" width="225" height="260" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If self-service site creation is enabled, users with appropriate rights can create their own site collections. Make sure to enable the setting is the Site Directory settings page:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/S9FIvzwaRKI/AAAAAAAAAQQ/thXDa8iEsl8/s1600-h/image21.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://lh6.ggpht.com/_VvmOdY-72ug/S9FIwQ43UnI/AAAAAAAAAQU/Jt26A5AWcIk/image_thumb11.png?imgmax=800" width="244" height="47" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/S9FIwmi5ruI/AAAAAAAAAQY/2ZYSkWYJmow/s1600-h/image18.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://lh5.ggpht.com/_VvmOdY-72ug/S9FIxNmXvTI/AAAAAAAAAQc/YTOd8aSNs1I/image_thumb10.png?imgmax=800" width="244" height="36" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;From the Site Directory home page, click the Create Site button&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/S9FIxVs3JkI/AAAAAAAAAQg/5hWZKqJKGlw/s1600-h/image24.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://lh4.ggpht.com/_VvmOdY-72ug/S9FIxzlvcJI/AAAAAAAAAQk/8VRMR6BiOb0/image_thumb12.png?imgmax=800" width="80" height="28" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You’ll notice that you’ll be redirected to “_layouts/scsignup.aspx” instead of “_layouts/newsbweb.aspx”.&lt;/p&gt;  &lt;p&gt;OK, so far the basic SharePoint stuff, let’s go back to the architecture. The key to using the Site Directory as a logical relation store is the metadata. If we take our customer/project relation, for example, we could store the reference to the customer as metadata with the entry of the project site.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/S9FIyKET3DI/AAAAAAAAAQo/HX28hHANcnc/s1600-h/image36.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://lh5.ggpht.com/_VvmOdY-72ug/S9FIyWYeqnI/AAAAAAAAAQs/tCQ5g9xplcs/image_thumb20.png?imgmax=800" width="260" height="178" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;One of the properties can be Customer. This field can be text, a choice list, a lookup to a list of customers or a custom field that queries the Sites list for entries of the type “customer site”.&lt;/p&gt;  &lt;p&gt;The relationship is now stored and can also easily be changed without having to move the site around: just change the metadata!&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Now that we know how to store the logical relationship, we still need to have a means of using that information. In the Site Directory itself, you can create a view on the list, grouped by customer:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/S9FIy9lz_6I/AAAAAAAAAQw/RFD0S97kcss/s1600-h/image41.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://lh6.ggpht.com/_VvmOdY-72ug/S9FIzh22E2I/AAAAAAAAAQ0/uI9euSuE-zc/image_thumb23.png?imgmax=800" width="346" height="167" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;On the home page, the categories web parts shows as follows:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/S9FIz1Ty1QI/AAAAAAAAAQ4/stxtjBkwujM/s1600-h/image46.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://lh6.ggpht.com/_VvmOdY-72ug/S9FI0XvX6uI/AAAAAAAAAQ8/OLZJQsE-a1I/image_thumb26.png?imgmax=800" width="354" height="168" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h4&gt;advanced customizations&lt;/h4&gt;  &lt;p&gt;Specifying the customer might work for project sites, but might be completely irrelevant to other types (like a customer site). There might also be a other requirements:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;a need to store some of our metadata in the site itself. You need to control the provisioning process to make this happen. &lt;/li&gt;    &lt;li&gt;grant site creation rights for some site templates to specific users only. You need to replace the site creation page for this. Never touch the OOTB pages. &lt;/li&gt;    &lt;li&gt;use the site directory for global navigation. We used this in a customer project, linking the site directory with a special custom list that was used to merge site data and other information into a navigation provider &lt;/li&gt;    &lt;li&gt;implement security on who can see site references. You can achieve this by using item level security on the items in the Sites list &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In any case, in the sites themselves we want to visualize the logical relationship to a parent:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;in the breadcrumb &lt;/li&gt;    &lt;li&gt;in the top navigation &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;All of this can only be achieved with custom development, for example with a custom navigation provider. Examples can be found, amongst others, on &lt;a title="http://msdn.microsoft.com/en-us/library/bb897739.aspx" href="http://msdn.microsoft.com/en-us/library/bb897739.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb897739.aspx&lt;/a&gt; and &lt;a title="http://www.sharepointdev.net/sharepoint--development-programming/how-to-create-custom-sitemapprovider-inder-to-create-custom-navigation-60525.shtml" href="http://www.sharepointdev.net/sharepoint--development-programming/how-to-create-custom-sitemapprovider-inder-to-create-custom-navigation-60525.shtml"&gt;http://www.sharepointdev.net/sharepoint--development-programming/how-to-create-custom-sitemapprovider-inder-to-create-custom-navigation-60525.shtml&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;There are many more possibilities but I’ll leave that up to your creativity. Hopefully, this post has triggered some ideas. If you have any, please share with the community!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-8659165719361468754?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/8659165719361468754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=8659165719361468754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8659165719361468754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8659165719361468754'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2010/04/power-of-site-directory.html' title='The power of the site directory'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_VvmOdY-72ug/S9FIsUUpUEI/AAAAAAAAAPs/f353BswOLL4/s72-c/image_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-4294420734194316914</id><published>2010-03-29T22:11:00.001+02:00</published><updated>2010-03-29T22:11:52.397+02:00</updated><title type='text'>CSS trick to indent text except for the first line</title><content type='html'>&lt;p&gt;This is a trick I used for a customer and for which I thought I needed a table element.&lt;/p&gt;  &lt;p&gt;What I wanted to achieve is the following (in SharePoint that is):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;retrieve a number of calendar items using de Content By Query (CBQ) web part&lt;/li&gt;    &lt;li&gt;show the date and the title of the event&lt;/li&gt;    &lt;li&gt;if the title is too long, display it on the next line but not under the the date&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You could use something like the following (per row):&lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt; &lt;span style="color: #ff0000"&gt;valign&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;top&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;[insert date here]&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt; &lt;span style="color: #ff0000"&gt;valign&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;top&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;[insert title here]&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;It’s ugly, but it works. However, by default the CBQ does not provide a table wrapper around each row of data and I wanted to avoid creating a custom contentquerymain.xslt. I do, however, have a custom itemstyle.xslt with the following xsl (shows only a part of the template):&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;BG_agendaitem&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt; &lt;span style="color: #ff0000"&gt;href&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;{$SafeLinkUrl}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;BG_newsoverviewwptitle&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;xsl&lt;/span&gt;:&lt;span style="color: #800000"&gt;value&lt;/span&gt;-&lt;span style="color: #ff0000"&gt;of&lt;/span&gt; &lt;span style="color: #ff0000"&gt;select&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;$day&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;-&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;xsl&lt;/span&gt;:&lt;span style="color: #800000"&gt;value&lt;/span&gt;-&lt;span style="color: #ff0000"&gt;of&lt;/span&gt; &lt;span style="color: #ff0000"&gt;select&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;$month&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;-&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;xsl&lt;/span&gt;:&lt;span style="color: #800000"&gt;value&lt;/span&gt;-&lt;span style="color: #ff0000"&gt;of&lt;/span&gt; &lt;span style="color: #ff0000"&gt;select&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;$year&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;BG_agendaitemspacer&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;xsl&lt;/span&gt;:&lt;span style="color: #800000"&gt;text&lt;/span&gt; &lt;span style="color: #ff0000"&gt;disable&lt;/span&gt;-&lt;span style="color: #ff0000"&gt;output&lt;/span&gt;-&lt;span style="color: #ff0000"&gt;escaping&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;yes&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&amp;amp;amp;nbsp;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;xsl&lt;/span&gt;:&lt;span style="color: #800000"&gt;text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;xsl&lt;/span&gt;:&lt;span style="color: #800000"&gt;value&lt;/span&gt;-&lt;span style="color: #ff0000"&gt;of&lt;/span&gt; &lt;span style="color: #ff0000"&gt;select&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;&amp;quot;@Title&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;div&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I use the following CSS:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;.&lt;span style="color: #800000"&gt;BG&lt;/span&gt;_&lt;span style="color: #800000"&gt;agendaitem&lt;/span&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #800000"&gt;margin-left&lt;/span&gt;:&lt;span style="color: #800000"&gt;62px&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #800000"&gt;text-indent&lt;/span&gt;:&lt;span style="color: #800000"&gt;-62px&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;.&lt;span style="color: #800000"&gt;BG&lt;/span&gt;_&lt;span style="color: #800000"&gt;agendaitemspacer&lt;/span&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;&lt;span style="color: #800000"&gt;width&lt;/span&gt;:&lt;span style="color: #800000"&gt;6px&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;}&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The div has a margin-left of 62px. This will display all text at that margin. The div also has a text-indent of –62px, which will compensate for the 62px margin-left, but only for the first line.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The result on the page is as follows:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/S7EJhNqEkfI/AAAAAAAAAPg/H5IP9t2JSuU/s1600-h/image%5B2%5D.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://lh5.ggpht.com/_VvmOdY-72ug/S7EJhqExQfI/AAAAAAAAAPk/8zrqj6XKZV4/image_thumb.png?imgmax=800" width="243" height="135" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As you can see, the text flow is right where it should be, without tables.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-4294420734194316914?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/4294420734194316914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=4294420734194316914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4294420734194316914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4294420734194316914'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2010/03/css-trick-to-indent-text-except-for.html' title='CSS trick to indent text except for the first line'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_VvmOdY-72ug/S7EJhqExQfI/AAAAAAAAAPk/8zrqj6XKZV4/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-4151075084877745659</id><published>2010-02-01T10:29:00.001+01:00</published><updated>2010-02-01T10:29:51.596+01:00</updated><title type='text'>App pool timeouts while debugging</title><content type='html'>&lt;p&gt;This is one I encountered this weekend. &lt;/p&gt;  &lt;p&gt;On my new dev VM, I was debugging some web part code. For some code blocks, debugging took some time, and more than once, I got the message that the IIS application was reset and debugging cancelled.&lt;/p&gt;  &lt;p&gt;For those of you who debug for a living, you might now how to overcome this already, but for all others, here’s the cause and the solution.&lt;/p&gt;  &lt;p&gt;The application pool has a setting called “Ping enabled”, which can be set to true or false. When set to true, the app pool periodically checks if the application is still alive. It uses the interval specified in “Ping maximum response time”, which defaults to 90 seconds.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/S2afDJGIyHI/AAAAAAAAAPQ/vQuFfowtGp0/s1600-h/apppool%5B5%5D.gif"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="apppool" border="0" alt="apppool" src="http://lh5.ggpht.com/_VvmOdY-72ug/S2afDiPQmSI/AAAAAAAAAPU/TOXK7x2Bmws/apppool_thumb%5B3%5D.gif?imgmax=800" width="412" height="497" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When debugging takes more than 90 seconds, the app pool thinks that the application is not responsive anymore and recycles.&lt;/p&gt;  &lt;p&gt;If you set Ping Enabled to false, your debug can take as long as you need. If that’s a bit too scary for you, specify a higher interval.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-4151075084877745659?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/4151075084877745659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=4151075084877745659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4151075084877745659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4151075084877745659'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2010/02/app-pool-timeouts-while-debugging.html' title='App pool timeouts while debugging'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_VvmOdY-72ug/S2afDiPQmSI/AAAAAAAAAPU/TOXK7x2Bmws/s72-c/apppool_thumb%5B3%5D.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-4433954718272847800</id><published>2010-01-17T17:37:00.001+01:00</published><updated>2010-01-17T17:37:04.424+01:00</updated><title type='text'>Playing around with custom fields, part 3</title><content type='html'>&lt;p&gt;This is part 3 of a blog series on custom fields. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://sjoere.blogspot.com/2009/09/playing-around-with-custom-fields.html" target="_blank"&gt;Part 1&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://sjoere.blogspot.com/2009/11/playing-around-with-custom-fields-part.html" target="_blank"&gt;Part 2&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This article will contain the final bits of the solution: a custom field to display rating info. Please note that this is not a complete product I’m presenting, but my findings on a journey to learn more about custom fields. I do hope it’ll trigger ideas you can apply in your own solution.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How the field works&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There are a few steps involved:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;creating an instance of the field. This field is a number field and stores a rating value&lt;/li&gt;    &lt;li&gt;calling the OnAdded method to set some properties and fire some other methods&lt;/li&gt;    &lt;li&gt;create a related field&lt;/li&gt;    &lt;li&gt;modify the view&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;When a user creates a new field of this type, under water a related field is added to do the actual rendering. This new field will take the title of the field created (so the user won’t notice it), while the original field’s title will be changed. The related field will get a display pattern set via code and is added to the default view. The original field is removed from the default view.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Creating an instance of the field&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The field is instantiated with two constructors:&lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; RatingField(SPFieldCollection fields, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fieldName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2:       : &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;(fields, fieldName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = fields;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DisplayFormat = SPNumberFormatTypes.NoDecimal;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; RatingField(SPFieldCollection fields, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fieldName, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; displayName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10:       : &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;(fields, fieldName, displayName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = fields;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 14:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DisplayFormat = SPNumberFormatTypes.NoDecimal;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15:     }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Why do you need two? Please refer to the previous post for a reference to some good articles.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The class also has some private variables to be used later:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; SPFieldCollection _fields;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; String _renderFieldSuffix = &amp;quot;&lt;span style="color: #8b0000"&gt;_EOGRatingRenderField&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; String _renderFieldDisplayName = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; String _fieldNewDisplayNamePrefix = &amp;quot;&lt;span style="color: #8b0000"&gt;Rating value for &lt;/span&gt;&amp;quot;;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here’s what they do:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;The SPFieldCollection _fields is used in a method to delete the related field when the field itself is deleted.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;The string _renderfieldSuffix is used to make sure the related field created later has a standard naming convention&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;The string _renderfieldDisplayName is used to set the title of the rendered field&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;The string _fieldNewDisplayNamePrefix is used to set a display value for the field in the view&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;OK, nothing really exiting here, so let’s move on.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Calling the OnAdded method&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If you have read the articles I mentioned above, you’ll know that setting properties in the constructors is of no use. The OnAdded method is the place to be for setting anything custom and will fire once the control has been added. This method takes one parameter of the enum type &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spaddfieldoptions.aspx" target="_blank"&gt;SPAddFieldOptions&lt;/a&gt; but for this solution I’m not going to use it.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnAdded(SPAddFieldOptions op)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:  SPList list = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ParentList;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5:  &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (list != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6:  {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:   &lt;span style="color: #008000"&gt;//change display name of field&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8:   _renderFieldDisplayName = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Title;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:   &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Title = _fieldNewDisplayNamePrefix + _renderFieldDisplayName;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10:   &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Update(&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12:   &lt;span style="color: #008000"&gt;//create related field&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:   CreateRelatedField();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 14: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15:   &lt;span style="color: #008000"&gt;//hide field from default view&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 16:   HideFieldFromDefaultView(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 17:  }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 18: }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The following actions are performed here:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;setting the value of the _renderfieldDisplayName variable. The rendered field should gets the title the user specified when creating the field so we copy it from this.Title.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;change the title of the field to add the prefix set in the variable _fieldNewDisplayNamePrefix.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Update the field to make the changes persistent&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Create the related field by calling the custom method CreateReleatedField&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Hide the original field from the default view by calling the custom method HideFieldFromDefaultView.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If the field is created as a site column, there is no use for a related field and there is no view to modify. Only when the field is instantiated to a list, further actions are required. Remember, when a site column is applied to a list, a copy is made so the OnAdded will be called again. Check if the field (“this”) has a ParentList. If not, no further actions required.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Creating the related field&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The method CreateRelatedField() creates the related field and adds it to the default view.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; CreateRelatedField()&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:   SPList list = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ParentList;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5:   String relatedFieldName = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + _renderFieldSuffix;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:   &lt;span style="color: #008000"&gt;//Now create a new field of the type Computed. This allows us to separate rendering from the actual fields that store the values.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8:   &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fieldSchema = &amp;quot;&lt;span style="color: #8b0000"&gt;&amp;lt;Field Type=\&amp;quot;Computed\&amp;quot; ReadOnly=\&amp;quot;TRUE\&amp;quot; Name=\&amp;quot;&lt;/span&gt;&amp;quot; + relatedFieldName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot; DisplayName=\&amp;quot;&lt;/span&gt;&amp;quot; + relatedFieldName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot; Sortable=\&amp;quot;TRUE\&amp;quot; Filterable=\&amp;quot;TRUE\&amp;quot; EnableLookup=\&amp;quot;FALSE\&amp;quot; SourceID=\&amp;quot;http://schemas.microsoft.com/sharepoint/v3\&amp;quot;&amp;gt;&amp;lt;FieldRefs&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;&lt;/span&gt;&amp;quot; + &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot; /&amp;gt;&amp;lt;/FieldRefs&amp;gt;&amp;lt;DisplayPattern&amp;gt;&amp;lt;Switch&amp;gt;&amp;lt;Expr&amp;gt;&amp;lt;Column Name=\&amp;quot;&lt;/span&gt;&amp;quot; + &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot;/&amp;gt;&amp;lt;/Expr&amp;gt;&amp;lt;Case Value=\&amp;quot;\&amp;quot;&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;lt;img src=\&amp;quot;_layouts/images/eog_rating/rating0.gif\&amp;quot; onclick=\&amp;quot;commonShowModalDialog(']]&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;HttpVDir/&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[/_layouts/Eog_RatingField/Eog_rating.aspx' ,'dialogHeight:150px;dialogWidth:180px;scroll:no;toolbar:no;status:no;resizable:no;',null, this.parentNode);\&amp;quot; /&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;/Case&amp;gt;&amp;lt;Default&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;lt;img src=\&amp;quot;_layouts/images/eog_rating/rating]]&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;Column Name=\&amp;quot;&lt;/span&gt;&amp;quot; + &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot;/&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[.gif\&amp;quot; /&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;/Default&amp;gt;&amp;lt;/Switch&amp;gt;&amp;lt;/DisplayPattern&amp;gt;&amp;lt;/Field&amp;gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:   list.Fields.AddFieldAsXml(fieldSchema);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:   &lt;span style="color: #008000"&gt;//Due to a bug in SharePoint, the field had to be created with a DisplayName the same as Name. After creation, we can update the field DisplayName&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12:   SPField field = list.Fields[relatedFieldName];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:   field.Title = _renderFieldDisplayName;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 14:   field.Update(&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 16:   &lt;span style="color: #008000"&gt;//add field to default view&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 17:   SPView view = list.DefaultView;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 18:   &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!view.ViewFields.Exists(relatedFieldName))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 19:   {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 20:     view.ViewFields.Add(relatedFieldName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 21:     view.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 22:   }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 23: }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The following actions are performed here:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;create a Name for the related field that is related to the field the user created. Remember our CAML constraint mentioned in the &lt;a href="http://sjoere.blogspot.com/2009/11/playing-around-with-custom-fields-part.html" target="_blank"&gt;previous post&lt;/a&gt;? If we know the Name set by the user, we can reference it. By using a standard naming conventions, we can always reference it, even from CAML.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;create a new field of the type Computed. This allows us to separate rendering from the actual fields that store the values. Please note that my solution does not contain all the required fields for a full rating solution, but this code demonstrates how to do it.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;create this field by calling list.Fields.AddFieldAsXml using a string of XML. The reason for creating a field this way is that we have control over the field properties and can set the DisplayPattern dynamically. See &lt;a href="http://murugangs.blogspot.com/2007/12/checkbox-in-listviewwebpart.html"&gt;http://murugangs.blogspot.com/2007/12/checkbox-in-listviewwebpart.html&lt;/a&gt; for an example of setting the DisplayPattern.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;set the display name (=Title) to the correct value. Due to a bug in SharePoint, the field had to be created with a DisplayName the same as Name. See &lt;a href="http://weblogs.asp.net/bsimser/archive/2005/07/21/420147.aspx"&gt;http://weblogs.asp.net/bsimser/archive/2005/07/21/420147.aspx&lt;/a&gt; for details&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Add the field to the default view. You need to create a View object first; setting the property directly via list.DefaultView.ViewFields.Add() does not work! While writing this post and thinking about how to explain why this works the way it does, I found an excellent article by Keith Dahlby on &lt;a title="http://solutionizing.net/2009/02/21/why-you-need-reflector-splist-defaultview/" href="http://solutionizing.net/2009/02/21/why-you-need-reflector-splist-defaultview/"&gt;http://solutionizing.net/2009/02/21/why-you-need-reflector-splist-defaultview/&lt;/a&gt;. For a briefer explanation, see &lt;a title="http://stackoverflow.com/questions/776367/customizing-pages-view-in-sharepoint%20for%20details" href="http://stackoverflow.com/questions/776367/customizing-pages-view-in-sharepoint%20for%20details"&gt;http://stackoverflow.com/questions/776367/customizing-pages-view-in-sharepoint%20for%20details&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As you can see, I’m now using CAML set via code. This overcomes the issues of not being able to manipulate it as mentioned in the &lt;a href="http://sjoere.blogspot.com/2009/11/playing-around-with-custom-fields-part.html" target="_blank"&gt;previous post&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Hiding the original field&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As the original field is only used as a store for the rating value, we don’t need to show it in the view. The method HideFieldFromDefaultView() will take care of it.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; HideFieldFromDefaultView(String internalName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:   SPList list = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ParentList;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5:   &lt;span style="color: #008000"&gt;//We need to create a view object due to an issue of fields collection getting out of scope&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6:   SPView view = list.DefaultView;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:   &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (view.ViewFields.Exists(internalName))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8:   {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:     view.ViewFields.Delete(internalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10:     view.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:   }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12: }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The method takes the InternalName of the original field as input parameter, checks if it exists in the view (might not be added due to user’s choice), deletes it from the view and then updates the view.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Cleaning up when the field is deleted&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If a user deletes the field, we need to make sure the related field is deleted as well. We can use the OnDeleting() method to intercept a delete event:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnDeleting()&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:   String relatedFieldInternalName = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + _renderFieldSuffix;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4:   DeleteRelatedField(relatedFieldInternalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5: }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We need to know the internal name for the related field and luckily we have used a naming convention for this: this.InternalName + _renderFieldSuffix;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We now call the custom method DeleteRelatedField() which takes the internal name as input parameter:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DeleteRelatedField(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; internalName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3:   &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields.ContainsField(internalName))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4:   {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5:     SPField field = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields.GetFieldByInternalName(internalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6:     field.ReadOnlyField = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7:     field.Hidden = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8:     field.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9:     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields.Delete(internalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10:   }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11: }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here we use the _fields variable, which contains the fields collection related to the original field. We could have used the field collection of the list, but the collection is available from the field itself. If the field exists (it should, but you never know), a reference to the field is made, ReadOnly and Hidden are set to false, the field is updated and then deleted.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;That’s all folks&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Well, there you have it: a sample solution you could use as a reference for your own solutions. I hope it’ll be of use to you. For your convenience, the full code is listed below. Have fun!&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 400px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2: &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3: &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4: &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Text;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5: &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.SharePoint;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6: &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Xml;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8: &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Eog.SharePoint2007.Fields&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10:   &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; RatingField : SPFieldNumber&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11:   {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12:     #region &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; variables&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; SPFieldCollection _fields;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 14:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; String _renderFieldSuffix = &amp;quot;&lt;span style="color: #8b0000"&gt;_EOGRatingRenderField&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; String _renderFieldDisplayName = &amp;quot;&lt;span style="color: #8b0000"&gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 16:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; String _fieldNewDisplayNamePrefix = &amp;quot;&lt;span style="color: #8b0000"&gt;Rating value for &lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 17:     #endregion&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 18: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 19:     #region constructors&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 20:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; RatingField(SPFieldCollection fields, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fieldName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 21:       : &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;(fields, fieldName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 22:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 23:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 24:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = fields;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 25:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DisplayFormat = SPNumberFormatTypes.NoDecimal;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 26:     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 27: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 28:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; RatingField(SPFieldCollection fields, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fieldName, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; displayName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 29:       : &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;(fields, fieldName, displayName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 30:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 31:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 32:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = fields;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 33:       &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DisplayFormat = SPNumberFormatTypes.NoDecimal;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 34:     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 35:     #endregion&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 36: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 37:     #region events&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 38:     &lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 39:     &lt;span style="color: #808080"&gt;/// OnAdded event&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 40:     &lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 41:     &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;op&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 42:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnAdded(SPAddFieldOptions op)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 43:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 44:       SPList list = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ParentList;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 45: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 46:       &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (list != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 47:       {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 48:         &lt;span style="color: #008000"&gt;//change display name of field&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 49:         _renderFieldDisplayName = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Title;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 50:         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Title = _fieldNewDisplayNamePrefix + _renderFieldDisplayName;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 51:         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Update(&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 52: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 53:         &lt;span style="color: #008000"&gt;//create related field&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 54:         CreateRelatedField();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 55: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 56:         &lt;span style="color: #008000"&gt;//hide field from default view&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 57:         HideFieldFromDefaultView(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 58:       }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 59:     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 60: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 61:     &lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 62:     &lt;span style="color: #808080"&gt;/// OnDeleting event&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 63:     &lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 64:     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnDeleting()&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 65:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 66:       String relatedFieldInternalName = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + _renderFieldSuffix;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 67:       DeleteRelatedField(relatedFieldInternalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 68:     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 69:     #endregion&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 70: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 71:     #region methods &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; hidden related data field&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 72:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; CreateRelatedField()&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 73:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 74:       SPList list = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ParentList;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 75: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 76:       String relatedFieldName = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + _renderFieldSuffix;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 77: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 78:       &lt;span style="color: #008000"&gt;//Now create a new field of the type Computed. This allows us to separate rendering from the actual fields that store the values.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 79:       &lt;span style="color: #008000"&gt;//See http://murugangs.blogspot.com/2007/12/checkbox-in-listviewwebpart.html for an example of setting the DisplayPattern&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 80:       &lt;span style="color: #008000"&gt;//Create the field by calling AddFieldAsXml using a string of XML. The reason for creating a field this way is that &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 81:       &lt;span style="color: #008000"&gt;//we have control over the field properties and can set the DisplayPattern dynamically.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 82:       &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fieldSchema = &amp;quot;&lt;span style="color: #8b0000"&gt;&amp;lt;Field Type=\&amp;quot;Computed\&amp;quot; ReadOnly=\&amp;quot;TRUE\&amp;quot; Name=\&amp;quot;&lt;/span&gt;&amp;quot; + relatedFieldName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot; DisplayName=\&amp;quot;&lt;/span&gt;&amp;quot; + relatedFieldName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot; Sortable=\&amp;quot;TRUE\&amp;quot; Filterable=\&amp;quot;TRUE\&amp;quot; EnableLookup=\&amp;quot;FALSE\&amp;quot; SourceID=\&amp;quot;http://schemas.microsoft.com/sharepoint/v3\&amp;quot;&amp;gt;&amp;lt;FieldRefs&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;&lt;/span&gt;&amp;quot; + &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot; /&amp;gt;&amp;lt;/FieldRefs&amp;gt;&amp;lt;DisplayPattern&amp;gt;&amp;lt;Switch&amp;gt;&amp;lt;Expr&amp;gt;&amp;lt;Column Name=\&amp;quot;&lt;/span&gt;&amp;quot; + &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot;/&amp;gt;&amp;lt;/Expr&amp;gt;&amp;lt;Case Value=\&amp;quot;\&amp;quot;&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;lt;img src=\&amp;quot;_layouts/images/eog_rating/rating0.gif\&amp;quot; onclick=\&amp;quot;commonShowModalDialog(']]&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;HttpVDir/&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[/_layouts/Eog_RatingField/Eog_rating.aspx' ,'dialogHeight:150px;dialogWidth:180px;scroll:no;toolbar:no;status:no;resizable:no;',null, this.parentNode);\&amp;quot; /&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;/Case&amp;gt;&amp;lt;Default&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[&amp;lt;img src=\&amp;quot;_layouts/images/eog_rating/rating]]&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;Column Name=\&amp;quot;&lt;/span&gt;&amp;quot; + &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.InternalName + &amp;quot;&lt;span style="color: #8b0000"&gt;\&amp;quot;/&amp;gt;&amp;lt;HTML&amp;gt;&amp;lt;![CDATA[.gif\&amp;quot; /&amp;gt;]]&amp;gt;&amp;lt;/HTML&amp;gt;&amp;lt;/Default&amp;gt;&amp;lt;/Switch&amp;gt;&amp;lt;/DisplayPattern&amp;gt;&amp;lt;/Field&amp;gt;&lt;/span&gt;&amp;quot;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 83:       list.Fields.AddFieldAsXml(fieldSchema);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 84: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 85:       &lt;span style="color: #008000"&gt;//Due to a bug in SharePoint, the field had to be created with a DisplayName the same as Name. After creation, we can update the field DisplayName&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 86:       &lt;span style="color: #008000"&gt;//See http://weblogs.asp.net/bsimser/archive/2005/07/21/420147.aspx for details&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 87:       SPField field = list.Fields[relatedFieldName];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 88:       field.Title = _renderFieldDisplayName;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 89:       field.Update(&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 90: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 91:       &lt;span style="color: #008000"&gt;//add field to default view&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 92:       SPView view = list.DefaultView;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 93:       &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!view.ViewFields.Exists(relatedFieldName))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 94:       {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 95:         view.ViewFields.Add(relatedFieldName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 96:         view.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 97:       }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 98:     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 99:     #endregion&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;100: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;101:     #region &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; methods&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;102:     &lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;103:     &lt;span style="color: #808080"&gt;/// Hide a field from the default view of a list&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;104:     &lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;105:     &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;internalName&amp;quot;&amp;gt;Internal name of the field&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;106:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; HideFieldFromDefaultView(String internalName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;107:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;108:       SPList list = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ParentList;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;109: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;110:       &lt;span style="color: #008000"&gt;//We need to create a view object due to an issue of fields collection getting out of scope&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;111:       &lt;span style="color: #008000"&gt;//See http://stackoverflow.com/questions/776367/customizing-pages-view-in-sharepoint for details&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;112:       SPView view = list.DefaultView;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;113:       &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (view.ViewFields.Exists(internalName))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;114:       {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;115:         view.ViewFields.Delete(internalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;116:         view.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;117:       }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;118:     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;119: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;120:     &lt;span style="color: #808080"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;121:     &lt;span style="color: #808080"&gt;/// Delete a related field&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;122:     &lt;span style="color: #808080"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;123:     &lt;span style="color: #808080"&gt;/// &amp;lt;param name=&amp;quot;internalName&amp;quot;&amp;gt;Internal name of the field&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;124:     &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DeleteRelatedField(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; internalName)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;125:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;126:       &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields.ContainsField(internalName))&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;127:       {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;128:         SPField field = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields.GetFieldByInternalName(internalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;129:         field.ReadOnlyField = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;130:         field.Hidden = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;131:         field.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;132:         &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields.Delete(internalName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;133:       }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;134:     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;135:     #endregion&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;136:   }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;137: }&lt;/pre&gt;&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-4433954718272847800?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/4433954718272847800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=4433954718272847800' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4433954718272847800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4433954718272847800'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2010/01/playing-around-with-custom-fields-part.html' title='Playing around with custom fields, part 3'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-3252967015491244186</id><published>2010-01-09T17:35:00.002+01:00</published><updated>2010-01-09T17:37:39.492+01:00</updated><title type='text'>Custom PeoplePicker with security</title><content type='html'>&lt;strong&gt;background&lt;/strong&gt;&lt;br /&gt;I’ve been working as architect on a very interesting and challenging SharePoint project for a few months now. The technical project lead asked me for advise on an issue concerning the PeoplePicker. Due to some issues in the past, where users accidentally added large AD groups to SharePoint groups and send notifications to hundreds of people, the PeoplePicker was set (using STSADM) to show only individual users and not AD groups. However, for some admin operations (like adding AD groups to SharePoint groups on some site) and for using the &lt;a href="http://www.axceler.com/SharePointProducts/AxcelerControlPoint.aspx" target="_blank"&gt;Axceler ControlPoint&lt;/a&gt; tools, adding AD groups was required. That’s a challenge, because there’s no way to configure the PeoplePicker for admin pages, only when using it as a People and Groups field in a list. As I want to keep my dev skills up-to-date, I put on my dev hat and created a solution.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;modifying the people picker&lt;/strong&gt;&lt;br /&gt;Modifying the People Picker itself actually proved to be one of the easiest. It’s a matter of writing an override web control that inherits from Microsoft.SharePoint.WebControls.PeopleEditor and then setting the SelectionSet property in the OnLoad. SelectionSet is a comma separated string with four possible values. See &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.peopleeditor.accounttype.aspx" title="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.peopleeditor.accounttype.aspx"&gt;http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.peopleeditor.accounttype.aspx&lt;/a&gt; for details.&lt;br /&gt;&lt;pre style="background-color: #fbfbfb; border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; border-right: #cecece 1px solid; border-top: #cecece 1px solid; min-height: 40px; overflow: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 400px;"&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;1: namespace ShareSP.PeoplePicker.WebControls&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;2: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;3:   public class PeopleEditor : Microsoft.SharePoint.WebControls.PeopleEditor&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;4:   {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;5:     protected override void OnLoad(System.EventArgs e)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;6:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;7:       base.OnLoad(e);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;8: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;9:       if(SPContext.Current.Web.UserIsSiteAdmin)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;10:       {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;11:         this.SelectionSet = "DL, SecGroup, SPGroup, User";&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;12:       }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;13:       else&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;14:       {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;15:         this.SelectionSet = "SPGroup, User";&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;16:       }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;17:     }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;18:   }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;19: }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above example is pretty simple. For my final solution, I added a lot more so keep on reading…&lt;br /&gt;&lt;br /&gt;I’ve implemented this as a feature with web application scope. I’m not going to explain how to build this and add it to the GAC, use your favorite search engine to find the excellent articles that have been written about this if you don’t know how to do it. All source code is available on CodePlex.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;replacing the existing PeoplePicker&lt;/strong&gt;&lt;br /&gt;Now that I have a custom PeoplePicker, how do I replace the existing one? Remember, the requirement is that it’ll be used on existing admin pages and we all know you should &lt;strong&gt;never&lt;/strong&gt; edit default SharePoint files! Luckily, there is a very non-intrusive way. Years ago, my team at e-office developed a first version of a &lt;a href="http://products.e-office.com/Products/SharePoint-2007-webonderdelen/webonderdeel-List" target="_blank"&gt;List web part&lt;/a&gt;. After a while, we did some serious rework on it and published a 2.0. The issue with web parts on pages is that the full reference is stored, so if you upgrade, the web page will still reference the old one. To avoid having to create an upgrade script for a few (but critical) instances, the web.config is our savior: you can use so called “tag mapping” to redirect an assembly reference to another. See &lt;a href="http://msdn.microsoft.com/en-us/library/ms164641.aspx" title="http://msdn.microsoft.com/en-us/library/ms164641.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms164641.aspx&lt;/a&gt; for reference or &lt;a href="http://www.usingnat.net/sharepoint/2009/6/2/sharepoint-people-picker-override-validation-logic.html" title="http://www.usingnat.net/sharepoint/2009/6/2/sharepoint-people-picker-override-validation-logic.html"&gt;http://www.usingnat.net/sharepoint/2009/6/2/sharepoint-people-picker-override-validation-logic.html&lt;/a&gt; for an article on another custom PeoplePicker (make sure to read the comments as well as some extra stuff is required to get tag mapping to work).&lt;br /&gt;I build all of this in a feature receiver that modifies the web.config when the feature is activated on a web application:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #fbfbfb; border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; border-right: #cecece 1px solid; border-top: #cecece 1px solid; min-height: 40px; overflow: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 400px;"&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;1: private void deployPeoplePicker(SPWebApplication webApp, string ownerID)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;2:     {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;3:       //Add Assembly&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;4:       string modificationName = string.Format(@"add[@assembly='{0}']", Assembly.GetExecutingAssembly().FullName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;5:       SPWebConfigModification modification = new SPWebConfigModification(modificationName, Globals.WebConfigModificationAssemblyPath);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;6:       modification.Path = Globals.WebConfigModificationAssemblyPath;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;7:       modification.Value = string.Format(@"&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;add&lt;/span&gt; &lt;span style="color: red;"&gt;assembly&lt;/span&gt;=&lt;span style="color: blue;"&gt;""&lt;/span&gt;{&lt;span style="color: red;"&gt;0&lt;/span&gt;}"" &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;", Assembly.GetExecutingAssembly().FullName); ;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;8:       modification.Owner = ownerID;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;9:       modification.Sequence = 0;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;10:       modification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;11:       webApp.WebConfigModifications.Add(modification);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;12: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;13:       //Add tagMapping&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;14:       modificationName = string.Format(@"add[@tagType='Microsoft.SharePoint.WebControls.PeopleEditor'][@mappedTagType='ShareSP.PeoplePicker.WebControls.PeopleEditor,{0}']", Assembly.GetExecutingAssembly().FullName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;15:       modification = new SPWebConfigModification(modificationName, Globals.WebConfigModificationTagMappingPath);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;16:       modification.Path = Globals.WebConfigModificationTagMappingPath;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;17:       modification.Value = string.Format(@"&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;add&lt;/span&gt; &lt;span style="color: red;"&gt;tagType&lt;/span&gt;=&lt;span style="color: blue;"&gt;""&lt;/span&gt;&lt;span style="color: red;"&gt;Microsoft&lt;/span&gt;.&lt;span style="color: red;"&gt;SharePoint&lt;/span&gt;.&lt;span style="color: red;"&gt;WebControls&lt;/span&gt;.&lt;span style="color: red;"&gt;PeopleEditor&lt;/span&gt;"" &lt;span style="color: red;"&gt;mappedTagType&lt;/span&gt;=&lt;span style="color: blue;"&gt;""&lt;/span&gt;&lt;span style="color: red;"&gt;ShareSP&lt;/span&gt;.&lt;span style="color: red;"&gt;PeoplePicker&lt;/span&gt;.&lt;span style="color: red;"&gt;WebControls&lt;/span&gt;.&lt;span style="color: red;"&gt;PeopleEditor&lt;/span&gt;,{&lt;span style="color: red;"&gt;0&lt;/span&gt;}"" &lt;span style="color: blue;"&gt;/&amp;gt;&lt;/span&gt;", Assembly.GetExecutingAssembly().FullName);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;18:       modification.Owner = ownerID;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;19:       modification.Sequence = 1;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;20:       modification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;21:       webApp.WebConfigModifications.Add(modification);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;22: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;23:       //Save changes&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;24:       webApp.Farm.Services.GetValue&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon;"&gt;SPWebService&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;/span&gt;().ApplyWebConfigModifications();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;25: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;26:       //Serialize and propagate changes across farm&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;27:       webApp.Update();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;28: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;29:       //Create the persistent objects&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: white; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;30:       Common.CreatePersistentObjects(webApp);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #cfcfcf; font-family: consolas, &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 12px; margin: 0em; width: 100%;"&gt;31:     }&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This stuff can be very tricky: the modification Path, for example, is an Xpath expression, but so is the Name attribute! I found some good guidance on Mark Wagner’s blog (&lt;a href="http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32" title="http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32"&gt;http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32&lt;/a&gt;) but still had to experiment a wee bit to get it working properly.&lt;br /&gt;&lt;br /&gt;In the code above, the value for Modification.Owner is the Guid of the feature ID. This will make sure it’s unique and that the modifications can be retrieved for retract later.&lt;br /&gt;&lt;br /&gt;When the feature is activated, the PeoplePicker is now showing different results for different users.&lt;br /&gt;Admin users:&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/S0iwMBIx69I/AAAAAAAAAOw/zBTMKL0M8Mo/s1600-h/image%5B2%5D.png"&gt;&lt;img alt="image" border="0" height="220" src="http://lh5.ggpht.com/_VvmOdY-72ug/S0iwMteCuRI/AAAAAAAAAO0/U7Re-srTfjM/image_thumb.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Common users:&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/S0iwNCG6OCI/AAAAAAAAAO4/fhNwRYp4WYk/s1600-h/image%5B5%5D.png"&gt;&lt;img alt="image" border="0" height="221" src="http://lh4.ggpht.com/_VvmOdY-72ug/S0iwNob1rvI/AAAAAAAAAO8/P6WYYi0uHDo/image_thumb%5B1%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="image" width="244" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;adding more options&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Basically, my solution worked. As I was in the “zone”, I decided to add some more features to make it more stable and easier to deploy and maintain. This is what I did:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;added an admin page that allows admin users to set options for a web application. The admin page is accessible via Application Management in the Central Admin. &lt;/li&gt;&lt;li&gt;added retract methods in the feature receiver &lt;/li&gt;&lt;li&gt;split my code into several classes (and files) &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Here’s what the admin page looks like:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/S0iwN9mtLHI/AAAAAAAAAPA/Xso23qxx5Po/s1600-h/image%5B8%5D.png"&gt;&lt;img alt="image" border="0" height="244" src="http://lh5.ggpht.com/_VvmOdY-72ug/S0iwOdqLZJI/AAAAAAAAAPE/gufmw9W56mc/image_thumb%5B2%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="232" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;All source files and the complete wsp are available on CodePlex: &lt;a href="http://sharesp.codeplex.com/" title="http://sharesp.codeplex.com/"&gt;http://sharesp.codeplex.com/&lt;/a&gt;. Feel free to use or improve!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-3252967015491244186?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/3252967015491244186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=3252967015491244186' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3252967015491244186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3252967015491244186'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2010/01/custom-peoplepicker-with-security.html' title='Custom PeoplePicker with security'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_VvmOdY-72ug/S0iwMteCuRI/AAAAAAAAAO0/U7Re-srTfjM/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-8979782310754251852</id><published>2010-01-09T14:58:00.001+01:00</published><updated>2010-01-09T14:58:00.273+01:00</updated><title type='text'>passed 70-542</title><content type='html'>&lt;p&gt;I’d studied for this last year but never had the time to do the exam. So when my team at &lt;a href="http://www.e-office.com" target="_blank"&gt;e-office&lt;/a&gt; needed one more certificate for an area in our gold partnership, I immediately booked the exam. Two days later, I managed to pass with a score of 100%! That’s all 4 SharePoint exams in the pocket, now let’s get moving on the 2010 ones!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-8979782310754251852?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/8979782310754251852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=8979782310754251852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8979782310754251852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8979782310754251852'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2010/01/passed-70-542.html' title='passed 70-542'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-9018673493200156395</id><published>2009-12-03T11:28:00.001+01:00</published><updated>2009-12-03T11:28:47.576+01:00</updated><title type='text'>Publishing Image does not get indexed</title><content type='html'>&lt;p&gt;This is a nasty one if you want to use search to get publishing content displayed somewhere.&lt;/p&gt;  &lt;h2&gt;The short version&lt;/h2&gt;  &lt;p&gt;Here’s the short version if you’re not interested in the full monty:&lt;/p&gt;  &lt;p&gt;On an article page, you can set an image in a field of the type “Publishing Image”. If you want to display this image in the search results, you’d expect you can use the “ows_PublishingPageImage” property to map in a managed property. Well, this won’t work. Microsoft Support doesn’t call it a bug (“&lt;em&gt;SharePoint cannot crawl the content of a compound control&lt;/em&gt;”)and suggests, as a workaround, to store the ImageUrl value in another field using an event handler and then to map this field in a managed property.&lt;/p&gt;  &lt;h2&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/h2&gt;  &lt;p&gt;The problem first showed at a customer where article pages created in one site collection should be show in another. The configuration of the farm is like the following:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SxeSzl_i1XI/AAAAAAAAAN4/eZ2PDRw_dcU/s1600-h/clip_image002%5B3%5D.gif"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://lh4.ggpht.com/_VvmOdY-72ug/SxeS0LJIhAI/AAAAAAAAAN8/Pf5RRRcVQw8/clip_image002_thumb.gif?imgmax=800" width="240" height="155" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note: this only conceptually reflects the infrastructure.&lt;/p&gt;  &lt;p&gt;In Site collection 1, there is a site with a pages library. In this page library, pages with the content type Article Page (standard MOSS content type and page layout) are created for news.&lt;/p&gt;  &lt;p&gt;Article created in the page library on Site collection 1 should be shown in Site collection 2 (without content deployment). As there is a boundary between site collections, the search index is used to make content from site collection available in the other. All users have at least read rights on all site collections.&lt;/p&gt;  &lt;p&gt;Using either the default Search Core Results web part or a third party web part, it proved impossible to show the page image and roll up image in Site collection 2. The title and page content were shown without problems.&lt;/p&gt;  &lt;p&gt;The next section shows repro steps taken.&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;Repro steps&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;For reproducing the problem, only one site collection is required as it will show the problem as well.&lt;/p&gt;  &lt;p&gt;In the site collection, use a page library to store the Welcome or Article pages (both can be used for this scenario). &lt;/p&gt;  &lt;p&gt;Each page has at least the following fields filled:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;page content --&amp;gt; stored in the field “Page Content” (internal name: PublishingPageContent)&lt;/li&gt;    &lt;li&gt;image --&amp;gt; stored in the field “Page Image” (internal name: PublishingPageImage)&lt;/li&gt;    &lt;li&gt;roll up image --&amp;gt; stored in the field “Rollup Image” (internal name: PublishingRollupImage)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The images are displayed on the page by the standard Publishing Image control in the page layout (out of the box). The images are stored in an image library in Site collection 1. For testing purposes, images of both the default created image library “/PublishingImages/” and a newly created image library called “Pictures” (/Pictures) were used. &lt;/p&gt;  &lt;p&gt;Below is a screenshot of the page properties of the page used for testing:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SxeS0RFvDYI/AAAAAAAAAOA/sBhKARpGemI/s1600-h/clip_image004%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://lh5.ggpht.com/_VvmOdY-72ug/SxeS0oYDcsI/AAAAAAAAAOE/_9r14uSexE8/clip_image004_thumb.jpg?imgmax=800" width="244" height="236" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The page used for testing was published as a major version.&lt;/p&gt;  &lt;p&gt;After that, the index was run with an incremental crawl. When searching for the word “welcome”, the Search Center displays the results correctly:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SxeS0zM2M2I/AAAAAAAAAOI/D08kfbjfuzk/s1600-h/clip_image006%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://lh5.ggpht.com/_VvmOdY-72ug/SxeS1C4d3eI/AAAAAAAAAOM/6I-mD2726f0/clip_image006_thumb.jpg?imgmax=800" width="244" height="72" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;What I want to achieve now, is to show the Page Image (field: PublishingPageImage) instead of the icon. At my customer, I’m using a third party web part to display the articles, but the concept can be shown by using only standard functionality.&lt;/p&gt;  &lt;p&gt;To make this possible, a few steps need to be followed:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;create a managed property mapping to the page field&lt;/li&gt;    &lt;li&gt;run a full crawl on the index&lt;/li&gt;    &lt;li&gt;change the Core Results web part settings to include the new managed property as a column&lt;/li&gt;    &lt;li&gt;change the XSLT for the search result to render an image using the new column&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;b&gt;Step 1&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In the SSP, I created a managed property called PublishingPageImage. This property maps to the indexed field ows_PublishingPageImage:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SxeS1hnCdqI/AAAAAAAAAOQ/B-U8paYBJ0k/s1600-h/clip_image008%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://lh6.ggpht.com/_VvmOdY-72ug/SxeS1_rfAdI/AAAAAAAAAOU/D00wJZtpHkQ/clip_image008_thumb.jpg?imgmax=800" width="244" height="164" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Note: the name of the managed property should match the mapped property as closely as possible to avoid problems.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 2&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;To make this managed property usable, a full crawl should be done. After the full crawl, you can already see the problem:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SxeS2AKPI7I/AAAAAAAAAOY/Ofix_JF-KMg/s1600-h/clip_image010%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://lh6.ggpht.com/_VvmOdY-72ug/SxeS2ghIR1I/AAAAAAAAAOc/JiY0pBTjdOQ/clip_image010_thumb.jpg?imgmax=800" width="244" height="35" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;There are no items found using this property&lt;/b&gt;. However, as you can see in the page properties (first screen shot under Repro steps), the field &lt;i&gt;does&lt;/i&gt; have a value!&lt;/p&gt;  &lt;p&gt;Conclusion: the field ows_PublishingPageImage is not indexed properly!&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 3&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Steps 3 and 4 are actually obsolete as step 2 already shows us no content will be returned. However, to get the picture, I’ll show them anyway.&lt;/p&gt;  &lt;p&gt;In the site collection Search Center, go to edit mode and go to the properties of the web part Search Core Results. Under Results Query Options, Selected Columns, open the columns editor and add &lt;/p&gt;  &lt;p&gt;&amp;lt;Column Name=&amp;quot;PublishingPageImage&amp;quot;/&amp;gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SxeS21DZ6JI/AAAAAAAAAOg/cfl79c2ro_E/s1600-h/clip_image012%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image012" border="0" alt="clip_image012" src="http://lh4.ggpht.com/_VvmOdY-72ug/SxeS3OaoP7I/AAAAAAAAAOk/rXPlFm-xh9Y/clip_image012_thumb.jpg?imgmax=800" width="244" height="193" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This will ensure our new managed property can actually be used in the search results. Click OK to close the editor dialog.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Step 4&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In the web part property pane, click the XSL Editor button. In the editor, search for&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;srch-Icon&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt; &lt;span style="color: #ff0000"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{$url}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{concat('CSR_IMG_',$id)}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{$url}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;align&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;absmiddle&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{imageurl}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;border&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;alt&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{imageurl/@imageurldescription}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This text displays the default icon &lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SxeS3fbUHTI/AAAAAAAAAOo/rVTtJBUfK94/s1600-h/clip_image014%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://lh6.ggpht.com/_VvmOdY-72ug/SxeS3rl0PYI/AAAAAAAAAOs/nbRzMFk0mME/clip_image014_thumb.jpg?imgmax=800" width="53" height="25" /&gt;&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;What I want to achieve is that the publishing page image is shown, when available. To do so, replace the xsl text above with something like the following:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;&lt;br /&gt;  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:if&lt;/span&gt; &lt;span style="color: #ff0000"&gt;test&lt;/span&gt;=” &lt;span style="color: #ff0000"&gt;publishingpageimage&lt;/span&gt; != ‘’”&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:attribute&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;=”&lt;span style="color: #ff0000"&gt;src&lt;/span&gt;”&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:value-of&lt;/span&gt; &lt;span style="color: #ff0000"&gt;select&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;publishingpageimage&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:attribute&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:if&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:if&lt;/span&gt; &lt;span style="color: #ff0000"&gt;test&lt;/span&gt;=” &lt;span style="color: #ff0000"&gt;publishingpageimage&lt;/span&gt; = ‘’”&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;srch-Icon&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt; &lt;span style="color: #ff0000"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{$url}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{concat('CSR_IMG_',$id)}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{$url}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;align&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;absmiddle&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{imageurl}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;border&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;alt&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{imageurl/@imageurldescription}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:if&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Note: as step 2 already makes sure we don’t get any results, it’s not sure if the creating an &amp;lt;img&amp;gt; is necessary. If the field stores complete html , the following would be OK:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;&lt;br /&gt;  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:if&lt;/span&gt; &lt;span style="color: #ff0000"&gt;test&lt;/span&gt;=” &lt;span style="color: #ff0000"&gt;publishingpageimage&lt;/span&gt; != ‘’”&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:value-of&lt;/span&gt; &lt;span style="color: #ff0000"&gt;select&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;publishingpageimage&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:if&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:if&lt;/span&gt; &lt;span style="color: #ff0000"&gt;test&lt;/span&gt;=” &lt;span style="color: #ff0000"&gt;publishingpageimage&lt;/span&gt; = ‘’”&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt; &lt;span style="color: #ff0000"&gt;class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;srch-Icon&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt; &lt;span style="color: #ff0000"&gt;href&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{$url}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;id&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{concat('CSR_IMG_',$id)}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;title&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{$url}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;align&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;absmiddle&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{imageurl}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;border&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;alt&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{imageurl/@imageurldescription}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;a&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;span&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;xsl:if&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Click OK, and Apply. Click OK on the web part tool pane to close it.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The expected result would be that the image of the page is shown in the results&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Other information&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Please note that the images themselves (as library items) can be found with the search. The problem is the &lt;i&gt;page field&lt;/i&gt;, creating the link between the page and the image. It looks like this field is not indexed properly, making it impossible to show images related to an article via Search.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Please note that if we use an out of the box picture field (not the publishing image), the contents are stored and indexed. However, this is not the behavior we want as we want to use the publishing features, not the WSS types.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Solution from Microsoft&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;For this problem, I opened a support case that ran for ages. After almost a year (!) mailing back and forth, I got the following solution:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;Dear Sjoert,&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;As agreed your existing support case SRQ[…] will now be archived. Customer Satisfaction is very important to us and we would like to be sure that you are very satisfied with the service you have received.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;If I can be of any further assistance on this case or if you have any suggestions for improving our service please do not hesitate to contact myself or my manager […] so we can ensure you receive our immediate attention.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;Here is a summary of your case:&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;[ARCR]&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;&lt;font face="Courier New"&gt;ACTION:&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;You want to customize Search results Page, so that found pages are listed with an Image which is stored in the Web Part &amp;quot;Page Image&amp;quot;.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;You mapped the ows_PublishingPageImage with the internal name &amp;quot;PublishingPageImage&amp;quot; of the web part &amp;quot;Page image&amp;quot;.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;You also customized the web part &amp;quot;Search Core Results&amp;quot;, so that the query returns also the mapped property &amp;quot;ows_PublishingPageImage&amp;quot; and modified the XSLT of this web part, so that it should additionally display the &amp;quot;PublishingpageImage&amp;quot;&amp;#160; as a picture left of the url of the page.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;&lt;font face="Courier New"&gt;RESULT:&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;The Image in the &amp;quot;Page Image&amp;quot;&amp;#160; of the found page is not displayed in the Search Core results web part.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;&lt;font face="Courier New"&gt;CAUSE:&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;The mapped property &amp;quot;ows_PublishingPageImage&amp;quot; is not crawled in that way, that we can use it as an image blob. SharePoint cannot crawl the content of a compound control. &lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;&lt;font face="Courier New"&gt;RESOLUTION:&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;Workaround: You need to add the url to the image to the Pages Library List. We used the column &amp;quot;comment&amp;quot; for that purpose. We provided an EventHandler which receives and handles the events &amp;quot;ItemUpdating&amp;quot; and &amp;quot;ItemAdding&amp;quot; events(executed if you change or add a picture to the picture library). &lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;public override void ItemUpdated(SPItemEventProperties properties)&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SPListItem item = properties.ListItem;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string imageUrl = ((Microsoft.SharePoint.Publishing.Fields.ImageFieldValue)(item[&amp;quot;PublishingPageImage&amp;quot;])).ImageUrl;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; item[&amp;quot;Comments&amp;quot;] = imageUrl;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; item.Update();&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;Use this picture library for adding picture to the web parts &amp;quot;Page Image&amp;quot; or &amp;quot;Rollup Image&amp;quot;.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font face="Courier New"&gt;Run a full crawl. Map the meta property ows_Comment to the column &amp;quot;Comment&amp;quot;. Run a crawl again. Used this property name in the Search results Core Web Part in the query options and modify the XSLT.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I still think this is a bug: SharePoint cannot crawl the content of a compound control. However, there’s a workaround. I suggest not to use the Comments field as suggested by Microsoft but a dedicated field instead.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-9018673493200156395?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/9018673493200156395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=9018673493200156395' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/9018673493200156395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/9018673493200156395'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/12/publishing-image-does-not-get-indexed.html' title='Publishing Image does not get indexed'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_VvmOdY-72ug/SxeS0LJIhAI/AAAAAAAAAN8/Pf5RRRcVQw8/s72-c/clip_image002_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-5980228656091432439</id><published>2009-11-19T15:14:00.001+01:00</published><updated>2009-11-19T15:14:09.738+01:00</updated><title type='text'>Installing SharePoint Foundation 2010</title><content type='html'>&lt;p&gt;I’ve been insatlling SharePoint Foundation 2010 beta today and although some blogs are already out there with good support on installation, I thought it might be handy to provide some visuals. Might be helpfull if you’re about to install or just want to know what it looks like without installing it yourself.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Development machine&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I’m running VMWare Workstation on a Lenovo T61p with 4GB of Ram. Windows Server 2008 R2 is my OS on the VM and I had all prerequisites installed, including SQL Server, before making a linked clone on which I’m now installing SharePoint Foundation. Using a linked clone is a good thing: if the installation fails, you have a base VM to start over again.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Starting the installation&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When you run the executable, the SharePoint Foundation installation window opens, offering a few options:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SwVSb5BieOI/AAAAAAAAALA/opo8lPE1-es/s1600-h/image2.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://lh3.ggpht.com/_VvmOdY-72ug/SwVScWbQHOI/AAAAAAAAALE/JcpyvFqz38k/image_thumb.png?imgmax=800" width="244" height="185" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If your machine does not have all prerequisites installed, be sure to start with the option “Install software prerequisites”. Might also be a good idea to check &lt;a href="http://blogs.msdn.com/opal/archive/2009/11/16/installation-notice-for-sharepoint-2010-public-beta.aspx" target="_blank"&gt;Ji Lie’s blog post&lt;/a&gt; for some inportant hotfixes. Please note that the WCF fix he mentions for R2 is not available yet. However, things seem to install fine on my R2 machine!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Install software prerequisites&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I was pretty sure I installed the lot, but you never know. So I started the installation of the prerequisites, which takes you into a wizard that tells you what is going to be done. Nice!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SwVSclqYD4I/AAAAAAAAALI/rmdN_fnJEJQ/s1600-h/image5.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://lh3.ggpht.com/_VvmOdY-72ug/SwVScxYiBiI/AAAAAAAAALM/VPntCDRPP2g/image_thumb1.png?imgmax=800" width="244" height="185" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Next step is to accept the license agreement. Did I actually read it? &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/SwVSdIU0-ZI/AAAAAAAAALQ/KGwDdZw6Svw/s1600-h/image8.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://lh5.ggpht.com/_VvmOdY-72ug/SwVSdkbNJoI/AAAAAAAAALU/DljWUyImYok/image_thumb2.png?imgmax=800" width="244" height="185" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Select and click Next, which starts the various checks and installations. This will take a few minutes, depending on how well you prepared your machine. When it’s done, you get to the “Installation Complete” screen. Why do Americans start every word with a capital? Are they German?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SwVSeKna3LI/AAAAAAAAALY/kv9uPw6BmAY/s1600-h/image11.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://lh4.ggpht.com/_VvmOdY-72ug/SwVSeSc9slI/AAAAAAAAALc/g5r0S3OelqE/image_thumb3.png?imgmax=800" width="244" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click Finish to return to the main setup screen. Now click “Install SharePoint Foundation”.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Installing Foundation&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The installation wizard will first take you to the license terms:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SwVSetC1nfI/AAAAAAAAALg/Dk1q7eOoauY/s1600-h/image14.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://lh3.ggpht.com/_VvmOdY-72ug/SwVSfFfFdXI/AAAAAAAAALk/HCZoE81orss/image_thumb4.png?imgmax=800" width="244" height="200" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Select and click Continue. You get to a screen with an important choice to make:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SwVSfb4ciFI/AAAAAAAAALo/TIwL6UCr0Gk/s1600-h/image17.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://lh3.ggpht.com/_VvmOdY-72ug/SwVSf0F-H-I/AAAAAAAAALs/5UKOo-ygMX8/image_thumb5.png?imgmax=800" width="244" height="200" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I strongly recommend you choose Server Farm. Standalone will use SQL Express, which has limited functionality. After clicking “Server Farm”, you’re faced with basically the same choice:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SwVSgNVpopI/AAAAAAAAALw/iNzq9BlESFs/s1600-h/image20.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://lh4.ggpht.com/_VvmOdY-72ug/SwVSgeC5ooI/AAAAAAAAAL0/NDNNK0FNo6s/image_thumb6.png?imgmax=800" width="244" height="200" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Select “Complete” and click the tab “Data location”. Here you can set the location of the index files. I recommend you choose a location not on the C drive:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SwVSg8yAC4I/AAAAAAAAAL4/WXPM1v4d9_Q/s1600-h/image23.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://lh3.ggpht.com/_VvmOdY-72ug/SwVShG2tWUI/AAAAAAAAAL8/ZKC-rS6ZB9M/image_thumb7.png?imgmax=800" width="244" height="200" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click “Install Now” to start the actual installation:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SwVSho9ExLI/AAAAAAAAAMA/ztXTTCc1d0w/s1600-h/image26.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://lh6.ggpht.com/_VvmOdY-72ug/SwVSh1Td79I/AAAAAAAAAME/oG982KydzAw/image_thumb8.png?imgmax=800" width="244" height="200" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When all is fine, you get to the last screen of the installation wizard. Check the checkbox and click “Close” to start the configuration wizard:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SwVSiEn-q-I/AAAAAAAAAMI/Z8mc6zY1G7o/s1600-h/image%5B3%5D.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://lh3.ggpht.com/_VvmOdY-72ug/SwVSih47PII/AAAAAAAAAMM/ANaBgsS8BGs/image_thumb%5B1%5D.png?imgmax=800" width="244" height="200" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Running the configuration wizard&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The wizard starts with a welcom. Click “Next” to continue:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SwVSi6sULOI/AAAAAAAAAMQ/ynBrSNZ5UmI/s1600-h/image%5B6%5D.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://lh5.ggpht.com/_VvmOdY-72ug/SwVSjMvHMcI/AAAAAAAAAMU/RLnLOSMpVtc/image_thumb%5B2%5D.png?imgmax=800" width="244" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The wizard asks you if some services might have to be started or reset. Click “Yes”:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SwVSjoIp_5I/AAAAAAAAAMY/yRCjLLnMEWk/s1600-h/image%5B9%5D.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://lh5.ggpht.com/_VvmOdY-72ug/SwVSj-v02SI/AAAAAAAAAMc/nESCQTNj0mc/image_thumb%5B3%5D.png?imgmax=800" width="244" height="209" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You are now asked if you want to connect to an existing farm or create a new one. I presume this is the first time you create one with SharePoint Foundation, so select “Create a new server farm”:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SwVSkSNy2yI/AAAAAAAAAMg/eIBYXbttlFg/s1600-h/image%5B12%5D.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://lh5.ggpht.com/_VvmOdY-72ug/SwVSkt2hrEI/AAAAAAAAAMk/IVqVWm6r0Hk/image_thumb%5B4%5D.png?imgmax=800" width="244" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You are now asked to fill in some details for the database settings:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SwVSlMHJD8I/AAAAAAAAAMo/VPtCEeXMWmA/s1600-h/image%5B15%5D.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://lh4.ggpht.com/_VvmOdY-72ug/SwVSlZSJ4lI/AAAAAAAAAMs/fc53eOhX9SY/image_thumb%5B5%5D.png?imgmax=800" width="244" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The next thing to fill in, is a passphrase for new servers to join the farm:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/SwVSltFWQQI/AAAAAAAAAMw/_CjilDkzPps/s1600-h/image%5B18%5D.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://lh6.ggpht.com/_VvmOdY-72ug/SwVSmP5gGaI/AAAAAAAAAM0/tSVRYiL55Qk/image_thumb%5B6%5D.png?imgmax=800" width="244" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Make sure the passphrase is secure enough (using capitals, numbers and special characters). If your passphrase is not secure, you’ll get an error message:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SwVSmQlqk0I/AAAAAAAAAM4/-KQT_HRYmmQ/s1600-h/image%5B21%5D.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://lh4.ggpht.com/_VvmOdY-72ug/SwVSm9Wnn7I/AAAAAAAAAM8/xsGdvw6TtFc/image_thumb%5B7%5D.png?imgmax=800" width="244" height="209" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The next screen asks you some settings for the Central Admin, like port number and authentication provider (NTLM or Kerberos):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SwVSnFEKPII/AAAAAAAAANA/DiY2Ww9XZhE/s1600-h/image%5B24%5D.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://lh5.ggpht.com/_VvmOdY-72ug/SwVSnkxFOfI/AAAAAAAAANE/Lv0mdFl2njE/image_thumb%5B8%5D.png?imgmax=800" width="244" height="209" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click “Next” to get to the summary page:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SwVSob7EreI/AAAAAAAAANI/FBGAiu8luJA/s1600-h/image%5B27%5D.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://lh4.ggpht.com/_VvmOdY-72ug/SwVSohMUkwI/AAAAAAAAANM/295_glG0BQY/image_thumb%5B9%5D.png?imgmax=800" width="244" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you click the “Advanced Settings” button, you are taken to a screen to enable AD account creation mode:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SwVSpGNWfTI/AAAAAAAAANQ/m52AZdPfQQk/s1600-h/image%5B30%5D.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://lh6.ggpht.com/_VvmOdY-72ug/SwVSpZzPW3I/AAAAAAAAANU/4KOkqnVN97k/image_thumb%5B10%5D.png?imgmax=800" width="244" height="209" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Back in the summary screen, click “Next” to start the actual configuration. This might take some time:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/SwVSpnfWsJI/AAAAAAAAANY/QumHPa2WY_I/s1600-h/image%5B33%5D.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://lh5.ggpht.com/_VvmOdY-72ug/SwVSqI1jRFI/AAAAAAAAANc/QJPzv5Qc7BU/image_thumb%5B11%5D.png?imgmax=800" width="244" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When all goes well, you’re taken to the last screen in the wizard:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/SwVSqQm7nGI/AAAAAAAAANg/DSmdVsBvYDs/s1600-h/image%5B36%5D.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://lh4.ggpht.com/_VvmOdY-72ug/SwVSqpDEpVI/AAAAAAAAANk/cZVVaHq0Fp4/image_thumb%5B12%5D.png?imgmax=800" width="244" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Click “Finish” to close the wizard and to be taken to the Central Admin page. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Central administration&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When going to the Central Admin for the first time, the first question you’re asked is if you want to participate in the customer experience improvement program:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/SwVSrHDQ4VI/AAAAAAAAANo/hNQemJe2So0/s1600-h/image%5B39%5D.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://lh3.ggpht.com/_VvmOdY-72ug/SwVSrQqYegI/AAAAAAAAANs/rknbLIL3sBI/image_thumb%5B13%5D.png?imgmax=800" width="244" height="134" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Of course you want to, to make a great product even better!. Click “OK” to move on. You’re now asked if you want to configure everything yourself or via a wizard:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SwVSr8S0hBI/AAAAAAAAANw/8NGHz9YlZq0/s1600-h/image%5B42%5D.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://lh5.ggpht.com/_VvmOdY-72ug/SwVSsH2DaQI/AAAAAAAAAN0/Qdy8oDpsi0c/image_thumb%5B14%5D.png?imgmax=800" width="244" height="92" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you have loads and loads of free RAM, choose the wizard. If you’re running this in a VM on a laptop with 4GB with Vista as host, don’t! I’m getting the error message “There is insufficient system memory in resource pool 'internal'” after a few minutes. Luckily, there’s a link to go back to Central Admin and nothing seems to be broken. Giving my VM more memory to try this again (the link to the wizard is available in the left menu) only means my Vista is getting slower, beyond the point of dying alltogether…&lt;/p&gt;  &lt;p&gt;So, the final step is to configure the lot yourself, but that’s out of scope for this blog. Happy installing, happy buying more RAM!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-5980228656091432439?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/5980228656091432439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=5980228656091432439' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/5980228656091432439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/5980228656091432439'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/11/installing-sharepoint-foundation-2010.html' title='Installing SharePoint Foundation 2010'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_VvmOdY-72ug/SwVScWbQHOI/AAAAAAAAALE/JcpyvFqz38k/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-8542647977909115545</id><published>2009-11-15T15:25:00.001+01:00</published><updated>2009-11-15T15:25:38.657+01:00</updated><title type='text'>Playing around with custom fields, part 2</title><content type='html'>&lt;p&gt;In my &lt;a href="http://sjoere.blogspot.com/2009/09/playing-around-with-custom-fields.html" target="_blank"&gt;previous post&lt;/a&gt; on this topic, I described some of the architectural choices on creating my custom field. That post was, more or less, non technical. This posting will be more code oriented.&lt;/p&gt;  &lt;p&gt;In this second post, I’m taking you with me on my journey and the challenges underway. The third and final post will be about how I fixed it in the end.&lt;/p&gt;  &lt;p&gt;As said before, I’ve &lt;em&gt;not&lt;/em&gt; created a full working solution; that was not my intention and I just don’t have enough hours in a day to create one (and my wife will kill me if I try…). However, the bits below helped me gaining more insight, which was the purpose of this exercise in the first place.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The goal&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Just as a reminder of what I’m trying to achieve, here’s a brief mission statement:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;create a custom field that stores rating settings and displays the average rating with stars(1 to 5) in both display mode as well as list views. Store rating history and possibly user comments as well.      &lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SwAPYLluE1I/AAAAAAAAAK4/9fFtrGLoeic/s1600-h/image%5B2%5D.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://lh3.ggpht.com/_VvmOdY-72ug/SwAPYTd9PkI/AAAAAAAAAK8/73XwgnVFWvo/image_thumb.png?imgmax=800" width="87" height="26" /&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;The result&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This article is about the process of getting somewhere, namely a custom field with some specific rendering. Along the way, I’ve tried many things that didn’t do the trick so keep on reading for the lot. If you just want to hear about the result, here it is:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;create a custom field that inherits from SPFieldNumber &lt;/li&gt;    &lt;li&gt;when creating the field, in the OnAdded event create a related computed field automatically and use a specific naming convention to keep a link with the custom field &lt;/li&gt;    &lt;li&gt;the related computed field will not store any data but is only there for rendering purposes &lt;/li&gt;    &lt;li&gt;hide the custom field from the view and show the computed one &lt;/li&gt;    &lt;li&gt;write some code to update the custom field data (not implemented) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Read on if you’re interested in the background information.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Creating the field type&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You need to create a fldtypes*.xml file to store information on your custom field. In my case, the field is of the type “Number”. The file fldtypes_rating.xml goes into 12\TEMPLATE\XML:&lt;/p&gt;  &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #800000"&gt;xml&lt;/span&gt; &lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;encoding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;utf-8&amp;quot;&lt;/span&gt; ?&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;FieldTypes&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;FieldType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;TypeName&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;RatingField&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ParentType&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Number&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;TypeDisplayName&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Rating&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;TypeShortDescription&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Rating field&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;UserCreatable&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;TRUE&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Sortable&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;TRUE&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AllowBaseTypeRendering&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;TRUE&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Filterable&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;TRUE&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;FieldTypeClass&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Eog.SharePoint2007.Fields.RatingField, Eog.SharePoint2007.Fields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=[mytoken]&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Field&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;FieldType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;FieldTypes&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So far so good, this is quite easy.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Field class&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;It’s not only XML, it’s code as well. If your field is just an override of a standard one (but why would you do that), the code is fairly easy:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;&lt;br /&gt;  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.SharePoint;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Xml;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Eog.SharePoint2007.Fields&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; RatingField : SPFieldNumber&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  {&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; SPFieldCollection _fields;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; RatingField(SPFieldCollection fields, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fieldName)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      : &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;(fields, fieldName)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = fields;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DisplayFormat = SPNumberFormatTypes.NoDecimal;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; RatingField(SPFieldCollection fields, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fieldName, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; displayName)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      : &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;(fields, fieldName, displayName)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;._fields = fields;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;      &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.DisplayFormat = SPNumberFormatTypes.NoDecimal;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Make sure to add a reference to Microsoft.SharePoint as otherwise Visual Studio won’t know what SPFieldNumber is. I’ve left out a lot of stuff in the above example but we’ll get to that later. If you want to know why there are two constructors, I strongly advise you to read the &lt;a href="https://www.e-junkie.com/ecom/gb.php?ii=238802&amp;amp;c=ib&amp;amp;aff=85990&amp;amp;cl=41816" target="_blank"&gt;USP Journal on SPTags&lt;/a&gt; by Bjørn Furuknap! There’s a ton of complex stuff related to custom fields and that’s very well explained in the journal. Another good source is the great article by Wouter van Vugt on MSDN: &lt;a title="http://msdn.microsoft.com/en-us/library/cc889345.aspx" href="http://msdn.microsoft.com/en-us/library/cc889345.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc889345.aspx&lt;/a&gt;. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Strongly name your assembly, add it to the GAC and do an IISReset. That’s all there is to it for creating a simple but useless custom field. The usefull stuff is still to come.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Field control&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To display a field in a custom manner, a field control would seem like a logical option. Basically, create a field that inherits from one of the base types. In the constructor, specify the field type it is related to:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;&lt;br /&gt;  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; RatingFieldControl(RatingField parentField)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.field = parentField;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the field class, override the FieldRenderingControl method to hook up the field to the control:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;&lt;br /&gt;  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; BaseFieldControl FieldRenderingControl&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; get&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; {&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  BaseFieldControl fieldControl = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RatingFieldControl(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  fieldControl.FieldName = InternalName;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; fieldControl;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To render UI, either do this in code (CreateChildControls) or with a control template. If you think “hold your horses, you’re skipping all the details”, you’re absolutely right. Why? A: there’s plenty of documentation on the web via your favourite search engine. B: this approach doesn’t work for what I want! &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The rendering control works fine in display and edit mode, but not in list views! &lt;strong&gt;List views do not load your rendering controls&lt;/strong&gt; and only display the contents of field as it is stored. And you know what: &lt;strong&gt;even your Field class is not called in the list view&lt;/strong&gt;! I’ve set a dozen break points, but none of them fires when loading the list view.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;But it looks like there’s another way…&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Renderpattern&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The RenderPattern is a piece of CAML in your field definition (fldtypes*.xml) that provides an alternative way of rendering your field’s data. Please refer to &lt;a title="http://msdn.microsoft.com/en-us/library/aa544291.aspx" href="http://msdn.microsoft.com/en-us/library/aa544291.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa544291.aspx&lt;/a&gt; for a full reference. You use the Name attribute to set &lt;em&gt;DisplayPattern&lt;/em&gt;, which is the pattern used in the list view. Here’s an example:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;&lt;br /&gt;  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;RenderPattern&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;DisplayPattern&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Switch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Expr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Column&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Expr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Default&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Column&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Default&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Switch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;RenderPattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In this example, an expression is used to check if the column contains data. If not, it doesn’t do anything. If it does, it displays whatever specified between the &amp;lt;default&amp;gt; tags. In this case, it only renders the column value. Quite useless because not specifying this pattern will do the same, but this example is to show you the potential.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;For my solution, this could work with an expression:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;&lt;br /&gt;  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;RenderPattern&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;DisplayPattern&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Switch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Expr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Column&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Expr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;_layouts/images/rating/rating0.gif&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;]]&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;_layouts/images/rating/rating1.gif&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;]]&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;_layouts/images/rating/rating2.gif&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;]]&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Default&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;_layouts/images/rating/rating0.gif&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;]]&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Default&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Switch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;RenderPattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;But here’s the catch: I planned to store much more than I want to show in the list view and there’s no way to filter that out with CAML. The idea was to store the rating history as well, so having the Column element in my markup would show the history as well whereas I only want to show the average. I also can’t use the column value in an expression like the one above. There’s just no way to perform advanced data manipulation before it reaches the RenderPattern.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is becoming a challenge:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;the field type does not do rendering everywher (and is not even called in the list view) &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;the field control is of no use in the list view as it’s not used there &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;the RenderPattern is not suitable for transforming my data &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Trying to work around the CAML constraints&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;My eye felt on an attribute of the Column element: ShowField. This attribute allows you to show the contents of another field. Aha: so what if have not one but two fields; one for storing the history and one for showing the current rating?&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Looks like an interesting solution, but there’s a caveat: how do I know what the related field is? If the user creates a column based on my field, it is given a name that I don’t know in advance so I can’t guess the related field name to specify in the CAML.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Related field&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So what about that Column attribute hidden in the SDK: UseRelatedField? This field gets the value of a related field (quite obvious!). RelatedField is a property of SPField, giving me the opportunity to create another field via code (and thus giving me control over its name) and then connecting it to my rating field:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;somehow create another field when my custom field is instantiated&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;relate the two by &amp;lt;MyCustomField&amp;gt;.RelatedField = &amp;lt;MyCustomRelatedField&amp;gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Render the value using CAML&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the RenderPattern, the related value would be retrieved like the following:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;&lt;br /&gt;  &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;RenderPattern&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;DisplayPattern&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Switch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Expr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Column&lt;/span&gt; &lt;span style="color: #ff0000"&gt;UseRelatedField&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;TRUE&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Expr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;_layouts/images/rating/rating0.gif&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;]]&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;_layouts/images/rating/rating1.gif&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;]]&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;_layouts/images/rating/rating2.gif&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;]]&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Case&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Default&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;img&lt;/span&gt; &lt;span style="color: #ff0000"&gt;src&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;_layouts/images/rating/rating0.gif&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;]]&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HTML&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Default&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Switch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;RenderPattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now we’re getting somehere. There are still many questions to answer:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;how do I make sure the user cannot edit the related field’s value directly?&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;what is the best way to render my field?&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;how do I show the correct field in the list view?&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Where are we now?&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In this post, I’ve gone into some of the basics of creating a custom field as well as some of the challenges I faced with the solution I have in mind. The third and final posting will contain the final bits so stay tuned!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-8542647977909115545?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/8542647977909115545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=8542647977909115545' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8542647977909115545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8542647977909115545'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/11/playing-around-with-custom-fields-part.html' title='Playing around with custom fields, part 2'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_VvmOdY-72ug/SwAPYTd9PkI/AAAAAAAAAK8/73XwgnVFWvo/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-8375654799431979117</id><published>2009-11-05T18:06:00.001+01:00</published><updated>2009-11-05T18:06:39.892+01:00</updated><title type='text'>SharePoint 2010 BLOB storage</title><content type='html'>&lt;p&gt;One of the disadvantages of using a database to store large files is performance; databases commonly just aren’t designed for large files.&lt;/p&gt;  &lt;p&gt;If you use SQL Server 2008, however, you have the option to store blobs using FILESTREAM (see &lt;a title="http://www.microsoft.com/sqlserver/2008/en/us/wp-sql-2008-manage-unstructured.aspx" href="http://www.microsoft.com/sqlserver/2008/en/us/wp-sql-2008-manage-unstructured.aspx"&gt;http://www.microsoft.com/sqlserver/2008/en/us/wp-sql-2008-manage-unstructured.aspx&lt;/a&gt; or &lt;a title="http://blogs.msdn.com/sqlrbs/" href="http://blogs.msdn.com/sqlrbs/"&gt;http://blogs.msdn.com/sqlrbs/&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;With SharePoint 2007, you have to write your own APIs and libraries to achieve &lt;em&gt;External BLOB Storage&lt;/em&gt; (EBS). We’ve done some implementations for customers, but it always turned out to be a hassle. &lt;/p&gt;  &lt;p&gt;One of the key features that is promoted for SharePoint 2010, is the ability to have data storage outside the SharePoint DB build in using &lt;em&gt;Remote BLOB Storage&lt;/em&gt; (RBS). So no need to create custom APIs and libraries anymore! Found some more details on &lt;a title="http://sharepointsolutions.com/sharepoint-help/blog/index.php/2009/10/externalizing-blob-storage-in-sharepoint-2010/" href="http://sharepointsolutions.com/sharepoint-help/blog/index.php/2009/10/externalizing-blob-storage-in-sharepoint-2010/"&gt;http://sharepointsolutions.com/sharepoint-help/blog/index.php/2009/10/externalizing-blob-storage-in-sharepoint-2010/&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;You can write your own providers to hook into RBS although I can’t think of any now. Perhaps write BLOBs to a Distributed File System?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-8375654799431979117?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/8375654799431979117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=8375654799431979117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8375654799431979117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8375654799431979117'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/11/sharepoint-2010-blob-storage.html' title='SharePoint 2010 BLOB storage'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-4518016780962044554</id><published>2009-10-23T23:56:00.001+02:00</published><updated>2009-10-23T23:56:17.721+02:00</updated><title type='text'>SharePoint 2010 reference on MSDN</title><content type='html'>&lt;p&gt;Wish I’d been in Vegas at the SPC, but luckiliy, a lot of information on SharePoint 2010 is now becoming available. One good starting point is MSDN: &lt;a title="http://msdn.microsoft.com/en-us/library/dd776256.aspx" href="http://msdn.microsoft.com/en-us/library/dd776256.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd776256.aspx&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Happy reading!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-4518016780962044554?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/4518016780962044554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=4518016780962044554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4518016780962044554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4518016780962044554'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/10/sharepoint-2010-reference-on-msdn.html' title='SharePoint 2010 reference on MSDN'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-3295106786137272890</id><published>2009-10-22T16:23:00.001+02:00</published><updated>2009-10-22T16:23:01.122+02:00</updated><title type='text'>Error when creating a SharePoint database with PSCONFIG</title><content type='html'>&lt;p&gt;At a customer, we’re building a dev environment where each developer has his own VM, running Windows Server 2008 (64 bit) with a domain controller (each dev machine is its own domain) , SQL Server 2005 Development edition and MOSS 2007 SP2.&lt;/p&gt;  &lt;p&gt;We’re using scripts to automate as much of the setup as possible but run into a problem with PSConfig when creating a MOSS database. This is the command we’re running:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;psconfig -cmd configdb -create -server %SQLSRV% -database %DBNameConfig% -user %ServerFarmAdminAccount% -password %ServerFarmAdminAccount_Password% -admincontentdatabase %DBNameAdminContent%&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;When running the script, we receive the following error:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;In the Event Log, an event is created with ID 5586.&lt;/p&gt;  &lt;p&gt;First, we’ve checked and double checked all variables:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;user and password are OK&lt;/li&gt;    &lt;li&gt;users are members of the appropriate domain groups&lt;/li&gt;    &lt;li&gt;users are known in SQL and have been assigned appriopriated rights&lt;/li&gt;    &lt;li&gt;script is run with admin priveleges&lt;/li&gt;    &lt;li&gt;db server exsists (the database itself is created, psconfig fails on configuring it. See below for more info.)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Looking in more details at the event log, an SQL server error preceeds the SharePoint one:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;EVENTID 17810: Could not connect because the maximum number of '1' dedicated administrator connections already exists. Before a new connection can be made, the existing dedicated administrator connection must be dropped, either by logging off or ending the process. [CLIENT: ::1]&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;As said above, the database is created but psconfig hangs on configuring it. The same script works fine in our test environment! The difference is that we’re using multiple machines and SQL Enterprise in the test farm.&lt;/p&gt;  &lt;p&gt;We do not have any other connection to the database open when running the script so it looks like something inside psconfig.&lt;/p&gt;  &lt;p&gt;Google doesn’t provide much help on this and none of my collegues has seen this before so if anyone knwos the key, please don’t hesitate to post a reply!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-3295106786137272890?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/3295106786137272890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=3295106786137272890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3295106786137272890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3295106786137272890'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/10/error-when-creating-sharepoint-database.html' title='Error when creating a SharePoint database with PSCONFIG'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-8469600511027290470</id><published>2009-09-22T13:08:00.001+02:00</published><updated>2009-09-22T13:08:22.304+02:00</updated><title type='text'>Playing around with custom fields</title><content type='html'>&lt;p&gt;It had been some time since I used Visual Studio so I thought it was time to play around a bit.&amp;#160; I wanted to do something that might be of use in a customer-based scenario but not something necessarily production ready, more stuff to gain more in-depth knowledge.&lt;/p&gt;  &lt;p&gt;This is the first of a two articles I’m going to write about this topic. In this first one, I’m focussing on the solution I have in mind and the architecture. Please mind that due to time constraints, I didn’t write a complete solution. However, that was never my goal but I found some things on my path to share with you.&lt;/p&gt;  &lt;p&gt;The second article will be about some more technical details.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;the scenario&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I was triggered by a customer request for a feature to allow feedback or rating on articles written by their experts. The requirement is that on an article page, a reader can give a rating or post a comment.&lt;/p&gt;  &lt;p&gt;I know, I know: there are solutions readily available and for a customer I would definately look at these first, but remember I’m doing this for fun…&lt;/p&gt;  &lt;p&gt;Some existing solutions:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="http://tonybierman.blogspot.com/2008/07/add-user-ratings-and-rich-html-comments.html" href="http://tonybierman.blogspot.com/2008/07/add-user-ratings-and-rich-html-comments.html"&gt;http://tonybierman.blogspot.com/2008/07/add-user-ratings-and-rich-html-comments.html&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://www.kwizcom.com/ProductPage.asp?ProductID=682&amp;amp;ProductSubNodeID=683" href="http://www.kwizcom.com/ProductPage.asp?ProductID=682&amp;amp;ProductSubNodeID=683"&gt;http://www.kwizcom.com/ProductPage.asp?ProductID=682&amp;amp;ProductSubNodeID=683&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://sptoolbasket.codeplex.com/" href="http://sptoolbasket.codeplex.com/"&gt;http://sptoolbasket.codeplex.com/&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;To keep it simple, I decided to go for a rating solution only. The basics for that solution would definately provide enough input for later enhancements.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;architectural decissions&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The first solution I thought of was a pretty easy one:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;create a hidden list to serve as a container for the rating. This list will have the appropriate columns to store my values (user, datetime, rating etc) &lt;/li&gt;    &lt;li&gt;create a control/web part that interacts with this list: add new ratings and retrieve existing ones. The control would use metadata values of the containing page (ID and so). &lt;/li&gt;    &lt;li&gt;add the control/web part to the publishing page &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Using a control would give me more flexibility to add it to a page layout and show it on article pages already created and as I didn’t need configuration, a control would be the right choice.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SriwIVy6HyI/AAAAAAAAAKo/NCScyADe_to/s1600-h/concept128.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="concept1" border="0" alt="concept1" src="http://lh4.ggpht.com/_VvmOdY-72ug/SriwItfZhrI/AAAAAAAAAKs/ys7tob6oNYs/concept1_thumb24.jpg?imgmax=800" width="274" height="197" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This solution would work for all cases where the content is an article page, but &lt;em&gt;not&lt;/em&gt; for regular list items as list items do not allow a web part to be added. List items only display their fields.&lt;/p&gt;  &lt;p&gt;Although having rating enabled on anything other than articles was not a requirement per se, I felt my solution had too many limitations. Back to the drawing board!&lt;/p&gt;  &lt;p&gt;When the requirement is to allow rating on &lt;em&gt;any&lt;/em&gt; type of list item, a custom field is your best choice. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/SriwJOVpHcI/AAAAAAAAAKw/tk6Fb4MukXA/s1600-h/image%5B6%5D.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://lh6.ggpht.com/_VvmOdY-72ug/SriwJawIH0I/AAAAAAAAAK0/4_6meafL4PA/image_thumb%5B4%5D.png?imgmax=800" width="257" height="151" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The advantages of the custom field are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;it is available on the New, Display and Edit forms &lt;/li&gt;    &lt;li&gt;its value can be displayed on the List form &lt;/li&gt;    &lt;li&gt;it can be added to any item &lt;/li&gt;    &lt;li&gt;it can also be added to a page &lt;/li&gt;    &lt;li&gt;its value can be picked up by a web part on a publishing page &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So what type of field do I need? Obviously, this depends on what I needed to store. I thought of two options:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;store a whole lot of information with the feedback and rating, in a structured way to make sure I can apply filtering or perform calculations. &lt;/li&gt;    &lt;li&gt;keep it simple and only store only the total rating. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Due to time constraints, I ended up with option 2, although option 1 was what I started with. Custom fields can be notoriously difficult to develop, but some excellent guidance is available. More on that in the second article, following soon.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-8469600511027290470?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/8469600511027290470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=8469600511027290470' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8469600511027290470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8469600511027290470'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/09/playing-around-with-custom-fields.html' title='Playing around with custom fields'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_VvmOdY-72ug/SriwItfZhrI/AAAAAAAAAKs/ys7tob6oNYs/s72-c/concept1_thumb24.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-3934784417676388636</id><published>2009-09-01T15:16:00.002+02:00</published><updated>2009-09-01T15:19:21.891+02:00</updated><title type='text'>Passed Prince 2 Foundation</title><content type='html'>This morning, I passed my Prince 2 Foundation exam with a score of 79%. I've noticed many of my customers use Prince 2 so in my role between business and development, I've gained more expertise on implementing SharePoint succesfully.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-3934784417676388636?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/3934784417676388636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=3934784417676388636' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3934784417676388636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3934784417676388636'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/09/passed-prince-2-foundation.html' title='Passed Prince 2 Foundation'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-8248898931735730301</id><published>2009-08-21T22:25:00.002+02:00</published><updated>2009-08-21T22:47:50.319+02:00</updated><title type='text'>background-image not set when changing a class on a DIV</title><content type='html'>&lt;p&gt;For I customer I was implementing a design on a SharePoint site using a custom master page and style sheet. One of my goals was to have no styles coded in the master page but to only use class references. This works very well and isn’t particularly rocket science (hey, I’ve given presentations on “dynamic HTML” when working for Microsoft in the ninties, so this should still be in my dna :-) ).&lt;/p&gt;&lt;p&gt;However, I ran into a nice rendering issue on a mouseover event on a div that uses a background-image set via a class (using IE8). The div is located in the QuickLaunch menu; this menu has to be collapsed by default and opened only when clicking on an arrow image:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom:gray 1px solid;border-left:gray 1px solid;padding-bottom:4px;line-height:12pt;background-color:#f4f4f4;margin:20px 0px 10px;padding-left:4px;width:97.5%;padding-right:4px;font-family:consolas, 'Courier New', courier, monospace;font-size:8pt;overflow:auto;border-top:gray 1px solid;cursor:text;border-right:gray 1px solid;padding-top:4px"&gt; &lt;div style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000"&gt;div&lt;/span&gt; &lt;span style="color:#ff0000"&gt;id&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;siteContentArrow&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;onclick&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;showHideLeftNavMenuArea();&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000"&gt;class&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;swSiteContentPinArrow&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000"&gt;div&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br/&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Clicking the div will trigger a javascript function to change the className (snippet is only part of the function):&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style="border-bottom:gray 1px solid;border-left:gray 1px solid;padding-bottom:4px;line-height:12pt;background-color:#f4f4f4;margin:20px 0px 10px;padding-left:4px;width:97.5%;padding-right:4px;font-family:consolas, 'Courier New', courier, monospace;font-size:8pt;overflow:auto;border-top:gray 1px solid;cursor:text;border-right:gray 1px solid;padding-top:4px"&gt;&lt;br /&gt;&lt;div style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;document.getElementById(&lt;span style="color:#006080"&gt;&amp;quot;siteContentArrow&amp;quot;&lt;/span&gt;).classname = “swSiteContentPinArrowDown”;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The css classes are located in a referenced stylesheet:&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom:gray 1px solid;border-left:gray 1px solid;padding-bottom:4px;line-height:12pt;background-color:#f4f4f4;margin:20px 0px 10px;padding-left:4px;width:97.5%;padding-right:4px;font-family:consolas, 'Courier New', courier, monospace;font-size:8pt;overflow:auto;border-top:gray 1px solid;cursor:text;border-right:gray 1px solid;padding-top:4px"&gt;&lt;br /&gt;&lt;div style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;span style="color:#cc6633"&gt;.swSiteContentPinArrow&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;{&lt;/pre&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;span style="color:#0000ff"&gt;background-image&lt;/span&gt;:url('/Style%20Library/Images/QuickLaunchPinArrow&lt;span style="color:#cc6633"&gt;.gif&lt;/span&gt;');&lt;/pre&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;}&lt;/pre&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt; &lt;/pre&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;span style="color:#cc6633"&gt;.swSiteContentPinArrowDown&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;{&lt;/pre&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;&lt;span style="color:#0000ff"&gt;background-image&lt;/span&gt;:url('/Style%20Library/Images/QuickLaunchPinArrowDown&lt;span style="color:#cc6633"&gt;.gif&lt;/span&gt;');&lt;/pre&gt;&lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, 'Courier New', courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px"&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The method above should work, but doesn’t. The className is set properly and will change basically everything but the background-image. Using a script to the set the backgroundImage property does work but means I have to put the url of the picture in my master page, something I want to avoid. &lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;On Stackoverflow.com, I found a thread on a similar issue in IE6: &lt;a title="http://stackoverflow.com/questions/213173/change-of-class-does-not-result-in-the-new-classs-rules-being-applied-in-ie6" href="http://stackoverflow.com/questions/213173/change-of-class-does-not-result-in-the-new-classs-rules-being-applied-in-ie6"&gt;http://stackoverflow.com/questions/213173/change-of-class-does-not-result-in-the-new-classs-rules-being-applied-in-ie6&lt;/a&gt;. Unfortunately, none of this helped me out. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;The solution&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Of course, if we can send rockets to Mars, fixing an anoying rendering issue should also be possible. I added a piece of javascript that loops through all rules in all stylesheets in the document and looks for my arrow classes. From these classes, I get the background-Image properties and store them in variables that are set when the script loads. The function will change the backgroundImage property using the variable values, depending on the current state of the menu:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="BORDER-BOTTOM: gray 1px solid; BORDER-LEFT: gray 1px solid; PADDING-BOTTOM: 4px; LINE-HEIGHT: 12pt; BACKGROUND-COLOR: #f4f4f4; MARGIN: 20px 0px 10px; PADDING-LEFT: 4px; WIDTH: 97.5%; PADDING-RIGHT: 4px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; FONT-SIZE: 8pt; OVERFLOW: auto; BORDER-TOP: gray 1px solid; CURSOR: text; BORDER-RIGHT: gray 1px solid; PADDING-TOP: 4px"&gt;&lt;br /&gt;&lt;div style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;&amp;lt;script&amp;gt;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; leftNavMenuAreaDisplay = &lt;span style="color:#006080;"&gt;"none"&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; siteContentArrowBackgroundImage = &lt;span style="color:#006080;"&gt;""&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; siteContentArrowDownBackgroundImage = &lt;span style="color:#006080;"&gt;""&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; siteContentArrowCurrentBackgroundImage = &lt;span style="color:#006080;"&gt;""&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt; &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; stylesheets = document.styleSheets;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;        &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;&lt;span style="color:#0000ff;"&gt;for&lt;/span&gt;(&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; i=0;i&amp;lt;stylesheets.length;i++)&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0pxfont-family:consolas, 'Courier New', courier, monospace;font-size:8pt;color:black;"   &gt;{&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;  &lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; rules = document.styleSheets[i].rules  document.styleSheets[i].cssRules    &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;  &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt;(&lt;span style="color:#0000ff;"&gt;var&lt;/span&gt; x=0;x&amp;lt;rules.length;x++) &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;  {        &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;(rules[x].selectorText==&lt;span style="color:#006080;"&gt;".swSiteContentPinArrow"&lt;/span&gt;) &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;    {                &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;      siteContentArrowBackgroundImage = rules[x].style.backgroundImage;       &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;    }&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;    &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;(rules[x].selectorText==&lt;span style="color:#006080;"&gt;".swSiteContentPinArrowDown"&lt;/span&gt;) &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;    {                &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;      siteContentArrowDownBackgroundImage = rules[x].style.backgroundImage;       &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;    } &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  }&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;}&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;        &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px" color="black" size="8pt" face="consolas, 'Courier New', courier, monospace"&gt;siteContentArrowCurrentBackgroundImage = siteContentArrowBackgroundImage;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt; &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;span style="color:#0000ff;"&gt;function&lt;/span&gt; showHideLeftNavMenuArea()&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;{&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt;(leftNavMenuAreaDisplay == &lt;span style="color:#006080;"&gt;"none"&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  {&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    leftNavMenuAreaDisplay = &lt;span style="color:#006080;"&gt;"inline"&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    siteContentArrowClass = &lt;span style="color:#006080;"&gt;"swSiteContentPinArrowDown"&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    siteContentArrowCurrentBackgroundImage = siteContentArrowDownBackgroundImage;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  }&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  {&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    leftNavMenuAreaDisplay = &lt;span style="color:#006080;"&gt;"none"&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    siteContentArrowClass = &lt;span style="color:#006080;"&gt;"swSiteContentPinArrow"&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;    siteContentArrowCurrentBackgroundImage = siteContentArrowBackgroundImage;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  }&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  &lt;span style="color:#008000;"&gt;//set style.display property to either none or inline&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  document.getElementById(&lt;span style="color:#006080;"&gt;"leftNavMenuArea"&lt;/span&gt;).style.display = leftNavMenuAreaDisplay;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt; &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  &lt;span style="color:#008000;"&gt;//set className&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  document.getElementById(&lt;span style="color:#006080;"&gt;"siteContentArrow"&lt;/span&gt;).classname = siteContentArrowClass ;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt; &lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  &lt;span style="color:#008000;"&gt;//force render of background image&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;  document.getElementById(&lt;span style="color:#006080;"&gt;"siteContentArrow"&lt;/span&gt;).style.backgroundImage = siteContentArrowCurrentBackgroundImage;&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;}&lt;/pre&gt;&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: white; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There you have it. I’ve noticed that rendering might take a wee bit of time (miliseconds…) but after the page is properly cached, no noticable delays occured. Perhaps you can use JQuery to do similar things, but this works fine for now. &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-8248898931735730301?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/8248898931735730301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=8248898931735730301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8248898931735730301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8248898931735730301'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/08/background-image-not-set-when-changing.html' title='background-image not set when changing a class on a DIV'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-8991263919885442459</id><published>2009-07-09T16:14:00.002+02:00</published><updated>2009-07-09T16:18:34.024+02:00</updated><title type='text'>e-office summer school</title><content type='html'>This summer, e-office organises a summer school with a pretty exiting agenda. Topics are ranging from technology to the new way of work. Some topics are technology specific (MS, IBM, Google, Blackberry), some are multi-level ones. Please check out the &lt;a href="http://summerschool.e-office.com/" target="_blank"&gt;web site &lt;/a&gt;for details. (sorry folks, Dutch only).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-8991263919885442459?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/8991263919885442459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=8991263919885442459' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8991263919885442459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/8991263919885442459'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/07/e-office-summer-school.html' title='e-office summer school'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-4767103506787953412</id><published>2009-05-18T21:47:00.002+02:00</published><updated>2009-05-18T21:50:45.395+02:00</updated><title type='text'>Content types are not document templates!</title><content type='html'>&lt;p&gt;Microsoft introduced content types in MOSS 2007. Content types are defined by Microsoft as follows: “A content type is a reusable collection of settings you want to apply to a certain category of content”. In practice, they consist of a collection of site columns and some other settings (like workflow).&lt;/p&gt;&lt;p&gt;For content types deriving from document parent types, a document template file can be attached (for example a Word document template).&lt;br /&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/ShG7Ugti-3I/AAAAAAAAAJo/SYgsRxyfzxg/s1600-h/image%5B2%5D.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://lh5.ggpht.com/_VvmOdY-72ug/ShG7VPyPoUI/AAAAAAAAAJs/1CtCouD1bEM/image_thumb.png?imgmax=800" width="244" height="78" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;This becomes visible to end users when a content type is used in a document library: under the New button, the content type appears and when clicking it, the appropriate application will open based on the defined template.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/ShG7VX-HnMI/AAAAAAAAAJw/KcQCGcQav6s/s1600-h/image%5B8%5D.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://lh4.ggpht.com/_VvmOdY-72ug/ShG7VwFjXjI/AAAAAAAAAJ0/AR0RchNO8DA/image_thumb%5B2%5D.png?imgmax=800" width="244" height="187" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;h4&gt;&lt;strong&gt;User perception&lt;/strong&gt;&lt;/h4&gt;&lt;p&gt;This is how most people associate the content type: something related to the application (Word, Excel etc). Seems logical because an application opens when they create a new item based on that content type. Example: we have a document content type “Project Initiation Document” that we use in a document library. A blank Word document is set as the associated template file so when a user clicks “New, Project Initiation Document”, Word opens.&lt;/p&gt;&lt;p&gt;In the field, I’ve noticed content types like “Word document”,&lt;br /&gt;“Excel document” etc. being used solely to open the appropriate application, without any specific site column for meta information. This strengthens the user perception of “content type = template”.&lt;/p&gt;&lt;h4&gt;Here’s the catch&lt;/h4&gt;&lt;p&gt;Content types are great, but what if I have one called “Calculations” and sometimes use Word and sometimes Excel for its contents? The content type only allows me to associate one template file. If I have set it to use Word, I always get Word when clicking the content type from the New button. Reality is that people often use various document types to achieve similar objectives; I even made my CV in PowerPoint once.&lt;/p&gt;&lt;p&gt;A workaround would be to create the Excel document locally, upload it to the library and then choose the content type. However, how do you explain your average user to create some documents via the New button and some documents locally? Also, how do you make sure the locally created document is based on a template you control centrally?&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/ShG7WKGM96I/AAAAAAAAAJ4/kgA8KFdvsHw/s1600-h/image%5B24%5D.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://lh6.ggpht.com/_VvmOdY-72ug/ShG7WoNi4HI/AAAAAAAAAJ8/KOzMkBlXu44/image_thumb%5B12%5D.png?imgmax=800" width="408" height="211" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;This is where I think Microsoft took a wrong shortcut, connecting the content type and the document template so intimately.&lt;/p&gt;&lt;h4&gt;How it should work&lt;/h4&gt;&lt;p&gt;Here’s how I think it should work and should be looked at by users. A content type should be regarded as an &lt;em&gt;information type&lt;/em&gt;, not as a document template. You should use content types to indicate that an item is of a special &lt;em&gt;type&lt;/em&gt;, having its own set of metadata. It’s like the example I gave in the article “&lt;a href="http://sjoere.blogspot.com/2009/02/using-metadata-instead-of-folders.html"&gt;Using metadata instead of folders&lt;/a&gt;”: a car is not the same thing as a house. The document you use is only the container for the content (or the way this content is presented), the content type is the extra information you provide about that content, not about the container of that content.&lt;/p&gt;&lt;p&gt;IMHO, Microsoft should extend the content type mechanism so you can attach more than one template file to it. The example below is a representation of how this could work:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/ShG7XPKJ3aI/AAAAAAAAAKA/mZupt2vHnFs/s1600-h/image%5B28%5D.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://lh6.ggpht.com/_VvmOdY-72ug/ShG7XliKUDI/AAAAAAAAAKE/MFu3HKFBRIE/image_thumb%5B14%5D.png?imgmax=800" width="417" height="167" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Before Microsoft changes any of that, please make sure you fully understand the concept of content types and that your end users do not confuse the with document templates.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-4767103506787953412?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/4767103506787953412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=4767103506787953412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4767103506787953412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/4767103506787953412'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/05/content-types-are-not-document.html' title='Content types are not document templates!'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_VvmOdY-72ug/ShG7VPyPoUI/AAAAAAAAAJs/1CtCouD1bEM/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-2408768677429068695</id><published>2009-03-30T19:34:00.001+02:00</published><updated>2009-03-30T19:34:04.442+02:00</updated><title type='text'>Privacy gap when choosing your own manager</title><content type='html'>&lt;p&gt;As you’ll know, in a Mysite, a user can edit his profile data. Usually, the Manager field is synchronised with the Active Directory and cannot be filled in by the user:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SdECecZJXRI/AAAAAAAAAJI/KA1hWndrC7E/s1600-h/image%5B5%5D.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://lh3.ggpht.com/_VvmOdY-72ug/SdECfJOJQZI/AAAAAAAAAJM/Fu5jmM6JijE/image_thumb%5B3%5D.png?imgmax=800" width="378" height="18" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Setting a manager results in an automatic display of team hierarchy in a treeview consisting of users who share the same manager:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_VvmOdY-72ug/SdECfuGsZjI/AAAAAAAAAJQ/Q0e6N3IHfIw/s1600-h/image%5B8%5D.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://lh4.ggpht.com/_VvmOdY-72ug/SdECgdTxtFI/AAAAAAAAAJU/d4u-HnnqA8Q/image_thumb%5B4%5D.png?imgmax=800" width="146" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The audience who can see details, can be set on some fields the user can fill in:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SdECg0GuL3I/AAAAAAAAAJY/glAoi7gXGow/s1600-h/image%5B11%5D.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://lh3.ggpht.com/_VvmOdY-72ug/SdECh-eiLPI/AAAAAAAAAJc/tEQs7s56PlY/image_thumb%5B5%5D.png?imgmax=800" width="108" height="100" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;My Manager is set by the manager field, My Collegues and My Workgroup are somewhat special. You can add people to your My Collegues group and mark them as member of My Workgroup:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/SdECiN1wRVI/AAAAAAAAAJg/j6REkObuK3E/s1600-h/image%5B14%5D.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://lh5.ggpht.com/_VvmOdY-72ug/SdECiqhtEQI/AAAAAAAAAJk/GinnhBvOk9w/image_thumb%5B6%5D.png?imgmax=800" width="204" height="101" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If someone shares the same manager as you, that person will be automatically added to your My Collegues group and markes as My Workgroup as well.&lt;/p&gt;  &lt;p&gt;So here’s a catch: if you allow people to set their own manager, they will be automatically added to your My Collegues and My Workgroup!&lt;/p&gt;  &lt;p&gt;I’ve tried this on my VM:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;in the SSP, Profile settings, change the manager field to be updatable by users &lt;/li&gt;    &lt;li&gt;create 3 user accounts, give them access to SharePoint and allow them to create a Mysite. &lt;/li&gt;    &lt;li&gt;log in to Windows with user 1 and create a MySite. This user will be the manager. &lt;/li&gt;    &lt;li&gt;now log in to Windows with user 2 and create a MySite. Set user 1 to be the manager. Note: signing in in SharePoint with the user account is not enough as you’ll be redirected to the Mysite of the windows account. Verify the Collegues page. &lt;/li&gt;    &lt;li&gt;now log in to Windows with user 3 and create a MySite. Set user 1 to be the manager. &lt;/li&gt;    &lt;li&gt;Now log in to Windows with user 2 again and go to the Mysite. Check the collegues page to verify that user 3 has now been added to My Collegues and My Workgroup without ever asking for permission. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The impact on security is open to discussion as only some personal details can now be seen by people you didn’t have in mind. Security on list items is not breached as that is set on groups or individual users, not on social distance. However, it’s worth reconsidering whether to allow end users to fill in their own manager.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-2408768677429068695?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/2408768677429068695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=2408768677429068695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/2408768677429068695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/2408768677429068695'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/03/privacy-gap-when-choosing-your-own.html' title='Privacy gap when choosing your own manager'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_VvmOdY-72ug/SdECfJOJQZI/AAAAAAAAAJM/Fu5jmM6JijE/s72-c/image_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-6819922548997727616</id><published>2009-02-23T14:34:00.001+01:00</published><updated>2009-02-23T14:34:21.984+01:00</updated><title type='text'>Using metadata instead of folders</title><content type='html'>&lt;p&gt;Although a great deal of information is (and opinions are) available on the web, most of them favouring the use of metadata instead of folders, I'd like to add some samples that I use in my daily work. I often use these samples at companies that are &amp;quot;migrating&amp;quot; their file shares to SharePoint (2007 version). Please notice the quotes, intentionally put there to stress that using SharePoint instead of file shares is much more than just a migration: it's a whole new way of work! However, that's a bit out of scope for this article so let's stick to metadata versus folders.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;We love to structure our data...&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;... and that's actually not a bad habit. A common scenario at customers is a file share for project teams that structure their data based on some properties of their projects, like the following example:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Division a      &lt;ul&gt;       &lt;li&gt;Department b          &lt;ul&gt;           &lt;li&gt;Project c              &lt;ul&gt;               &lt;li&gt;Stage d                  &lt;ul&gt;                   &lt;li&gt;Document 1 &lt;/li&gt;                    &lt;li&gt;Document 2 &lt;/li&gt;                 &lt;/ul&gt;               &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;People have worked like this for ages and seem generally satisfied with this solution.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Not so structured after all?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The sample above can work as long as:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;there is good governance on the structure &lt;/li&gt;    &lt;li&gt;there are not too many levels &lt;/li&gt;    &lt;li&gt;you do not have to share document across projects &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There might be more properties available than can be used without creating a ridiculously complex folder structure:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;author of the document &lt;/li&gt;    &lt;li&gt;create date of the document &lt;/li&gt;    &lt;li&gt;customer &lt;/li&gt;    &lt;li&gt;version of the document &lt;/li&gt;    &lt;li&gt;project year &lt;/li&gt;    &lt;li&gt;etc. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Often, extra data is stored in the title of the document, like &amp;quot;pid draft version 0.5 - modified by John - to review.doc&amp;quot;. From the title, you can get extra information: it's a Project Initiation Document (pid), it's not final, it's been modified by John and should be reviewed. What if it had not been called pid but &amp;quot;prj. in. doc.doc&amp;quot;? It's still a pid, but would you immediately recognise it as such?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Creating duplicates&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Using folders for structuring files might work when these files stay within that one folder. However, some files belong to more than one folder. In the folder structure above, 'Document 1' might also belong to 'Project f'. The general solution is creating a copy of the document, causing the following major problems:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;not clear which version is the latest and greatest &lt;/li&gt;    &lt;li&gt;not clear who is the document owner &lt;/li&gt;    &lt;li&gt;need for extra storage &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;The route to finding information: vertical/horizontal navigation&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A folder view is a vertical way of finding information: you'll find the document via a vertical path that someone else has defined. That path might not be the one you want to follow. A great example is a second hand car site. On that site, there are thousands of cars available and you are looking for that one car. Suppose the site had been structured with a folder view, like:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;brand (e.g Mercedes)      &lt;ul&gt;       &lt;li&gt;model (e.g 320)          &lt;ul&gt;           &lt;li&gt;fuel type (e.g. Petrol)              &lt;ul&gt;               &lt;li&gt;colour (e.g. Silver Metallic)                  &lt;ul&gt;                   &lt;li&gt;milage (e.g. 70k-80k) &lt;/li&gt;                 &lt;/ul&gt;               &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;That would work if you'd been looking for a Merc. But what if you're looking for a car with the following criteria:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;not more than 5 years old &lt;/li&gt;    &lt;li&gt;petrol &lt;/li&gt;    &lt;li&gt;mileage between 50k-80k &lt;/li&gt;    &lt;li&gt;hatchback &lt;/li&gt;    &lt;li&gt;price between &amp;#8364;20k-&amp;#8364;35k &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The folder view above won't work for you as you'll have to browse each (sub) folder to find cars that match some (but not all ) of your criteria. You don't want a vertical view, you want a horizontal one!&lt;/p&gt;  &lt;p&gt;To map this to information within your organisation: you might be able to find the information you're working with because you know the folder structure, but what about all the other employees that might be looking for that information? What about the manager looking for the latest project status reports for all projects?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Did I mention metadata?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;We use metadata more often than we think. As Wikipedia describes it: Metadata (meta data, or sometimes metainformation) is &amp;quot;data about other data&amp;quot;. In the car example above, the properties of the car are its metadata: information &lt;em&gt;about&lt;/em&gt; the car. So if you're looking for a car (age, mileage, etc), a partner (gender, hobbies, etc) or house (type, price, etc), you use metadata to filter. As you can see, each type of object I'm looking for (car, partner, house, etc) will have its own metadata; it wouldn't make much sense to filter on fuel type for a house...&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_VvmOdY-72ug/SaKlzCqWR1I/AAAAAAAAAIY/Q5m0QAk_fZA/s1600-h/comparison2%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="102" alt="comparison2" src="http://lh6.ggpht.com/_VvmOdY-72ug/SaKlzqIxgxI/AAAAAAAAAIc/HYcOY4nDyFw/comparison2_thumb%5B1%5D.jpg?imgmax=800" width="240" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The folder view allows you to add metainformation &lt;em&gt;implicitly&lt;/em&gt;, i.e. the location where the item is stored defines its metadata. Once the item is moved to another location, it looses that meta information. Using metadata on the item itself, means that metadata becomes explicit. No matter where you store the item, it keeps its metadata. There are some technical requirements to achieve this, but that will be explained next.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Metadata with SharePoint&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Although it's possible to create folders in SharePoint document libraries, I generally do not recommend it: see the sections above. SharePoint implements metadata as columns. End users sometimes find it hard to grasp this concept, but the I use the example of Excel. Almost everyone in an organisation has used Excel so a spreadsheet like the following should look familiar:&lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/SaKlz5iUmdI/AAAAAAAAAIg/KqA6I_Pes-A/s1600-h/excel13.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="101" alt="excel1" src="http://lh3.ggpht.com/_VvmOdY-72ug/SaKl0aLnmdI/AAAAAAAAAIs/sqoGnsc4hpo/excel1_thumb1.jpg?imgmax=800" width="349" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Most people also know you can apply filtering in Excel:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_VvmOdY-72ug/SaKl1VKWcxI/AAAAAAAAAIw/4F06LTbTeHQ/s1600-h/excel211.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="125" alt="excel2" src="http://lh6.ggpht.com/_VvmOdY-72ug/SaKl11w8DDI/AAAAAAAAAI0/b_w2UBCo2ro/excel2_thumb9.jpg?imgmax=800" width="349" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And that's also how SharePoint works! (plus more)&lt;/p&gt;  &lt;p&gt;SharePoint stores items in lists/libraries and uses columns to provide extra information about the items. SharePoint even allows you to store different types of items (remember the car, partner and house) in one list using so-called content types. &lt;/p&gt;  &lt;p&gt;Using metadata, users can now apply filtering, sorting and grouping on the data, either directly or with views. &lt;/p&gt;  &lt;p&gt;flat view:&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SaKl2OmwjFI/AAAAAAAAAI4/JOaTJdhUcX4/s1600-h/library13.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="60" alt="library1" src="http://lh6.ggpht.com/_VvmOdY-72ug/SaKl2jEBP2I/AAAAAAAAAI8/PsAyKToZRFw/library1_thumb1.jpg?imgmax=800" width="353" border="0" /&gt;&lt;/a&gt;&amp;#160; &lt;br /&gt;grouped view:&lt;a href="http://lh3.ggpht.com/_VvmOdY-72ug/SaKl3C2ABcI/AAAAAAAAAJA/rNuIzFatZUo/s1600-h/library24.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="97" alt="library2" src="http://lh5.ggpht.com/_VvmOdY-72ug/SaKl3QQt_0I/AAAAAAAAAJE/9Ue7x0SjrVY/library2_thumb2.jpg?imgmax=800" width="349" border="0" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Retaining metadata when moving items around&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I've already mentioned that SharePoint has ways to keep the metadata with the item. Using Content Types is a great way of applying the same metadata structure to lists and libraries. When the item moves to another list that has the same columns, it will keep its metadata. Office files have an even better mechanism build in as metadata is contained &lt;em&gt;within&lt;/em&gt; the document itself! Try it out yourself by adding metadata to, for example, a Word document in a library. Now copy the file to another library that does not have the same metadata columns yet. Once you have added the same metadata columns (use the same &lt;em&gt;internal&lt;/em&gt; name for the columns!), they will automatically show the metadata. Beyond cool!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Metadata in SharePoint allows you for a much more flexible way of structuring your data than using folders on a file share. When you want to implement SharePoint, leave the folder way of thinking behind and start thinking in more dimensions!   &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-6819922548997727616?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/6819922548997727616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=6819922548997727616' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/6819922548997727616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/6819922548997727616'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2009/02/using-metadata-instead-of-folders.html' title='Using metadata instead of folders'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_VvmOdY-72ug/SaKlzqIxgxI/AAAAAAAAAIc/HYcOY4nDyFw/s72-c/comparison2_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-23205504830793282</id><published>2008-11-18T20:49:00.001+01:00</published><updated>2008-11-18T20:49:32.636+01:00</updated><title type='text'>Publishing versus collaboration</title><content type='html'>&lt;p&gt;It has been a while since my last post, so it's time to post once again. This time, it's not something technical. It's related to something me and my collegues at e-office often notice @ customers who are implementing SharePoint.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Solution to what?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;What are customers trying to solve by implementing SharePoint? The answers are as divers as hard to get. In many cases, SharePoint is put forward by an IT department as &lt;strong&gt;the&lt;/strong&gt; product to use. If it delivers what the business needs is not clear, but there is confidence that SharePoint can meet &lt;em&gt;any&lt;/em&gt; need.&lt;/p&gt;  &lt;p&gt;OK, I'm a SharePoint addict and I'm confident you can do a lot with it, OOTB or custom made, but listening to the business is a &lt;strong&gt;must do&lt;/strong&gt; as SharePoint is meant to solve &lt;em&gt;business&lt;/em&gt; challenges, not &lt;em&gt;IT&lt;/em&gt; challenges (in fact, SharePoint can add a few to those IT challenges...).&lt;/p&gt;  &lt;p&gt;Commonly, when you get the answers, SharePoint will be used in an organisation for two types of solutions:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;As a publishing intranet (MOSS), and/or &lt;/li&gt;    &lt;li&gt;As a collaboration environment (WSS) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;I know there are many more uses, but for the sake of this post, I'll leave it at these two.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The intranet&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;MOSS is great for it's OOTB publishing templates: in no time, a complete company intranet can be set up. An intranet has some characteristics:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;it serves as an information channel: its contents are relevant to a broad audience &lt;/li&gt;    &lt;li&gt;it is accessed by many who read, by few who contribute &lt;/li&gt;    &lt;li&gt;its consists mainly of published content (drafts are not visible to the general public) &lt;/li&gt;    &lt;li&gt;the type of content is mainly &lt;em&gt;pages&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;its contents is often part of an approval cycle &lt;/li&gt;    &lt;li&gt;its content is often the &lt;em&gt;output&lt;/em&gt; of some sort of process, not part of the process itself (like supporting documents) &lt;/li&gt;    &lt;li&gt;its content is highly structured &lt;/li&gt;    &lt;li&gt;style and layout are usually more corporate branded &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In short: it's one way traffic on the information highway. There are more characteristics, but the list above is sufficient for the purpose of this post.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The collaboration environment&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;WSS is great for having team members working together in a virtual environment. This environment has some characteristics:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;it contains content that is only relevant to members of the team &lt;/li&gt;    &lt;li&gt;its content is mainly part of a process, not primarily the final output of this process (example: a team site might be set up for creating a HR reference document which is then published on an intranet) &lt;/li&gt;    &lt;li&gt;the type of content is mainly &lt;em&gt;documents&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;there are many contributors, only a few readers &lt;/li&gt;    &lt;li&gt;work in progress (draft) is visible to all members &lt;/li&gt;    &lt;li&gt;its content is free form &lt;/li&gt;    &lt;li&gt;style and layout are functional &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There are more characteristics, but the list above is sufficient for the purpose of this post.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Can we do it in the mix?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There's not a problem that we can't fix... (pun intended) but mixing WSS and MOSS can lead to problems that are hard to fix indeed. These are not of the technical kind, but functional. Above, you've seen that MOSS and WSS can be used to achieve great intranets (MOSS) and great collaboration environments (WSS). But when you install MOSS, you have WSS as well and can be tempted to use publishing sites with collaboration elements. Quite often, I meet customers who have implemented MOSS and created an intranet with sites/pages that combine the publishing and collaboration features on a functional level. This results in, for example, department sites that show:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;information about the department (&amp;quot;who are we? What do we do?&amp;quot;) &lt;/li&gt;    &lt;li&gt;information for the people within the department (like announcements) &lt;/li&gt;    &lt;li&gt;documents that are part of processes within the department (like draft status handbooks) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The result is a site or page that is only partially interesting for whoever looks at it:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;if you're in that department, you know &amp;quot;who you are&amp;quot; and &amp;quot;what you do&amp;quot; &lt;/li&gt;    &lt;li&gt;if you're not in the department, you are not interested at all in the drafts &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Furthermore, because now collaboration and publishing data are mixed, it's virtually impossible to achieve some sort of uniformity or to control what is shown. Also, this can only work when the site map of the intranet reflects the organisational structure. When you have inter-departemental collaboration, you can't reflect that in an intranet where the structure is department oriented. It's quite difficult to publish information on several places (for example: content can be related to a department but also to a theme. Both department and theme have sites/pages in the intranet). Furthermore, what happens if the team moves from one department to another?&lt;/p&gt;  &lt;p&gt;Technically, you can work with permissions and audiences to limit what is shown. With metadata and the content by query webpart, you can show information from one area on another. However, this doesn't take away the fact that mixing publishing and collaboration is fundamentally wrong: they are different concepts!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Guidelines and solutions&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Here are some guidelines and solutions I usually advise:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;use publishing sites for publishing only &lt;/li&gt;    &lt;li&gt;use team sites for collaboration &lt;/li&gt;    &lt;li&gt;place your collaboration sites either under the sitesdirectory as subsites (easier for central metadata management) or create new site collections (under the managed path &amp;quot;sites&amp;quot;). This makes it much easier to control access. If you expect many sites of a kind, consider using a different web applicayion for collaboration and publishing.&lt;/li&gt;    &lt;li&gt;use metadata and/or workflows/SendTo to show final output created at collaboration site level on the publishing site(s)&lt;/li&gt;    &lt;li&gt;make a visual difference between the collaboration and publishing environment. This makes it easier for the users to see where they are. For a collaboration environment, keep it functional.&lt;/li&gt;    &lt;li&gt;before you start developing, make sure the customer understands the concepts and has defined the business requirements&lt;/li&gt;    &lt;li&gt;provide training for the people who work with it&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Never say never&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So should you never use publishing features in a collaboration environment? Well, that's not my message. You can use whatever template meets your requirements. If you need to have, for example, news pages within a collaboration environment, why not use a template that enables them. My message is that on the &lt;em&gt;functional level (or better: the content level)&lt;/em&gt;, you should separate collaboration and publishing. Put some time in the business and functional requirements and then decide how to structure your SharePoint environment and what templates should be used where.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-23205504830793282?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/23205504830793282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=23205504830793282' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/23205504830793282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/23205504830793282'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2008/11/publishing-versus-collaboration.html' title='Publishing versus collaboration'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-3810152455883030782</id><published>2008-10-22T22:35:00.002+02:00</published><updated>2008-10-22T22:38:48.922+02:00</updated><title type='text'>passed 70-631</title><content type='html'>I'm ashamed that this is the first posting since May, but I've been too busy working on challenging MOSS projects. Anyway, I passed the 70-631 exam with a score of 945. Must have gotten my name wrong...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28016526-3810152455883030782?l=sjoere.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sjoere.blogspot.com/feeds/3810152455883030782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28016526&amp;postID=3810152455883030782' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3810152455883030782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28016526/posts/default/3810152455883030782'/><link rel='alternate' type='text/html' href='http://sjoere.blogspot.com/2008/10/passed-70-631.html' title='passed 70-631'/><author><name>Sjoert Ebben</name><uri>http://www.blogger.com/profile/17174465288997544720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28016526.post-2934593613887040125</id><published>2008-05-16T18:44:00.001+02:00</published><updated>2008-05-16T18:44:38.900+02:00</updated><title type='text'>Reghosting feature files</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;As promised in my blog &lt;a href='http://sjoere.blogspot.com/2008/04/error-after-re-ghosting-page-layout.html'&gt;Error after re-ghosting a page layout&lt;/a&gt;, hereby some code to revert files from a specific feature back to their definitions. The code to actually re-ghost the files is taken from Gary Lapointe (&lt;a href='http://stsadm.blogspot.com/2007/09/re-ghosting-pages.html'&gt;http://stsadm.blogspot.com/2007/09/re-ghosting-pages.html&lt;/a&gt;). He ran into the same issues I did with files still not being reset and found some workarounds. My addition is a console application that takes a site collection address and a feature ID (GUID) as input parameters to only re-ghost files from that feature. I ran into a scenario where only the files from my feature needed to be re-ghosted, not the other ones.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To do so, I'm looping through the features of the site collection and get the definition of my feature&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;SPFeatureCollection featureCollection = siteCollection.Features;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      foreach (SPFeature feature in featureCollection)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        if (feature.DefinitionId == featureID)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          //Get the feature definition&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          SPFeatureDefinition featureDefinition = feature.Definition;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;It's then easy to get the element definitions of this feature:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;//Get all element definitions in the feature&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          SPElementDefinitionCollection elementDefinitionCollection = featureDefinition.GetElementDefinitions(System.Globalization.CultureInfo.InvariantCulture);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          foreach (SPElementDefinition elementDefinition in elementDefinitionCollection)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            //get the XML node of the elements file&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            XmlNode elementsNode = elementDefinition.XmlDefinition;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            XmlNodeList fileNodes = elementsNode.ChildNodes;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;This returns an XmlNodeList that you can loop through to find the correct elements. I tried to apply an XPath query to filter on elements GhostableInLibrary, but that failed. Looping through was the only way I could get it to work. DOH!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;//perform operation on all files that are ghostable&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            foreach (XmlNode fileNode in fileNodes)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;Now I had to check on some attributes:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;if (fileNode.NodeType == XmlNodeType.Element &amp;amp;&amp;amp; fileNode.Attributes != null)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;              {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                if (fileNode.Attributes["Type"] != null)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                  if (fileNode.Attributes["Type"].Value == "GhostableInLibrary")&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                  {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    fileschecked++;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    string url = String.Format("{0}/{1}", elementsNode.Attributes["Url"].Value, fileNode.Attributes["Url"].Value);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    SPFile file = web.GetFile(url);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    if (file.Exists) //Prevents fatal errors when the file has been removed&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                      if (file.CustomizedPageStatus == SPCustomizedPageStatus.Customized)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;This is where the actual re-ghosting method is called.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here's the complete code. Sorry for the messy layout of code on blogger. I still have to find a way to improve that. Anyway, have fun using and changing it to your needs. Make sure to credit Gary Lapointe as well.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;using System;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;using System.Collections.Generic;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;using System.Text;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;using Microsoft.SharePoint;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;using Microsoft.SharePoint.Administration;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;using System.Xml;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;using System.Reflection;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;namespace RevertToDefinition&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;  class Program&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;  {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    const string ERR_ARGS = "Please specify a valid url for the site collection and a GUID for the feature.";&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    const string ERR_GUID = "Invalid feature Guid";&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    const string ERR_SITECOLLECTION = "Unable to connect to site collection";&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    static void Main(string[] args)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      string output = string.Empty;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      int fileschecked = 0;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      int filesfixed = 0;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      int filesnotfixed = 0;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      Guid featureID;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      SPSite siteCollection;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      //check if a parameter has been provided&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      if (args.Length &amp;lt; 2)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        Console.WriteLine(ERR_ARGS);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        return;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      //create instance of Program&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      Program p = new Program();&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      //Create ref to site collection&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      try&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        siteCollection = new SPSite(args[0]);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      catch&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        Console.WriteLine(ERR_SITECOLLECTION);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        return;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      SPWeb web = siteCollection.RootWeb;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      //Get Guid&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      try&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        featureID = new Guid(args[1]);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      catch&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        Console.WriteLine(ERR_GUID);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        return;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      //get all features activated on this site&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      SPFeatureCollection featureCollection = siteCollection.Features;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      foreach (SPFeature feature in featureCollection)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        if (feature.DefinitionId == featureID)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          //Get the feature definition&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          SPFeatureDefinition featureDefinition = feature.Definition;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          //Get all element definitions in the feature&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          SPElementDefinitionCollection elementDefinitionCollection = featureDefinition.GetElementDefinitions(System.Globalization.CultureInfo.InvariantCulture);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          foreach (SPElementDefinition elementDefinition in elementDefinitionCollection)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            //get the XML node of the elements file&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            XmlNode elementsNode = elementDefinition.XmlDefinition;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            XmlNodeList fileNodes = elementsNode.ChildNodes;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            //perform operation on all files that are ghostable&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            foreach (XmlNode fileNode in fileNodes)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;              if (fileNode.NodeType == XmlNodeType.Element &amp;amp;&amp;amp; fileNode.Attributes != null)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;              {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                if (fileNode.Attributes["Type"] != null)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                  if (fileNode.Attributes["Type"].Value == "GhostableInLibrary")&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                  {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    fileschecked++;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    string url = String.Format("{0}/{1}", elementsNode.Attributes["Url"].Value, fileNode.Attributes["Url"].Value);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    SPFile file = web.GetFile(url);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    if (file.Exists) //Prevents fatal errors when the file has been removed&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                      if (file.CustomizedPageStatus == SPCustomizedPageStatus.Customized)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                        if (p.doRevert(web, file, url))&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                        {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                          filesfixed++;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                        }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                        else&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                        {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                          filesnotfixed++;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                        }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                      }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                    }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                  }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;                }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;              }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;            }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;          }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      //Dispose&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      web.Dispose();&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      siteCollection.Dispose();&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      string notfixed = String.Empty;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      if (filesnotfixed &amp;gt; 0)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        notfixed = String.Format("Unable to fix {0} files.",filesnotfixed.ToString());&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      output = String.Format("{0} files checked, {1} files required fix. {2}", fileschecked.ToString(),filesfixed.ToString(), notfixed);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      Console.WriteLine(output);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    }&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    /// &amp;lt;summary&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    /// Code below is taken from Gary Lapointe (http://stsadm.blogspot.com/2007/09/re-ghosting-pages.html)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    /// His code elaborates on the RevertContentStream as that method might not always do the trick&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    /// &amp;lt;param name="file"&amp;gt;&amp;lt;/param&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    private bool doRevert(SPWeb web, SPFile file, string url)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;    {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      bool isFixed = true;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      file.RevertContentStream();&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      file = web.GetFile(url);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      if (file.CustomizedPageStatus == SPCustomizedPageStatus.Customized)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;      {&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        // Still unsuccessful so take measures further                    &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        PropertyInfo requestProp = web.GetType().GetProperty("Request", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.GetProperty);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        object request = requestProp.GetValue(web, null);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-size:8pt'&gt;        MethodInfo revertContentStreams = request.GetType().GetMethod("RevertContentStreams", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod)
