<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;AkMGRXY9fSp7ImA9WhRUFkU.&quot;"><id>tag:blogger.com,1999:blog-11096258</id><updated>2012-01-27T19:20:24.865+01:00</updated><category term="JBOWS" /><category term="BCS" /><category term="Encoding" /><category term="Customization" /><category term="Schema" /><category term="ILM" /><category term="UserProfile" /><category term="BRE" /><category term="ASP.NET" /><category term="ASC2011" /><category term="WF" /><category term="TDD" /><category term="Taxonomy" /><category term="MySite" /><category term="RoboCopy" /><category term="Other" /><category term="EDA" /><category term="SqlServer" /><category term="Flex" /><category term="IAM" /><category term="WinForms" /><category term="ActiveDirectory" /><category term="jQuery" /><category term="Publishing" /><category term="VisualStudio" /><category term="UX" /><category term="MVP" /><category term="WS-Trust" /><category term="Design" /><category term="ServiceApplications" /><category term="ADFS" /><category term="BAM" /><category term="Kerberos" /><category term="IIS" /><category term="SCSF" /><category term="TableAdapter" /><category term="Versioning" /><category term="TermStore" /><category term="IA" /><category term="Topology" /><category term="WebPart" /><category term="XPath" /><category term="ContentType" /><category term="ManagedMetadataService" /><category term="SiteStructure" /><category term="Faults" /><category term="Office1x" /><category term="S+S" /><category term="Serializing" /><category term="InfoPath" /><category term="Innovation" /><category term="Claims" /><category term="MVC" /><category term="WIF" /><category term="Binding" /><category term="Messaging" /><category term="Exchange" /><category term="ECDM" /><category term="ESB" /><category term="CAB" /><category term="AJAX" /><category term="SOA-G" /><category term="Build" /><category term="WOA" /><category term="Integration" /><category term="ES-EWA" /><category term="SOA" /><category term="BTS" /><category term="Programming" /><category term="Configuration" /><category term="WSDL" /><category term="VSTO" /><category term="SaaS" /><category term="WSSF" /><category term="STS" /><category term="CIM" /><category term="ActivityFeed" /><category term="DDD" /><category term="Virtualization" /><category term="SecureStoreService" /><category term="EntLib" /><category term="Findability" /><category term="Governance" /><category term="ASMX" /><category term="REST" /><category term="MDM" /><category term="WS*OA" /><category term="SharePoint" /><category term="WS-Security" /><category term="Modeling" /><category term="BPM" /><category term="Web2.0" /><category term="CEP" /><category term="Contracts" /><category term="Search" /><category term="FAST" /><category term="SDO" /><category term="MSCRM" /><category term="WS-Federation" /><category term="SearchDriven" /><category term="Transactions" /><category term="ADO.NET" /><category term="ContentTypeHub" /><category term="UAG" /><category term="WCF" /><category term="InformationManagement" /><category term="Validation" /><category term="VAB" /><category term="Patterns" /><category term="Enterprise2.0" /><title>InfoWorker Solutions</title><subtitle type="html">When in doubt, hesitate!</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://kjellsj.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>252</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/InfoworkerSolutions" /><feedburner:info uri="infoworkersolutions" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;AkMGRXY8fSp7ImA9WhRUFkU.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-3117460831809973350</id><published>2012-01-19T18:34:00.000+01:00</published><updated>2012-01-27T19:20:24.875+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-27T19:20:24.875+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WIF" /><category scheme="http://www.blogger.com/atom/ns#" term="STS" /><category scheme="http://www.blogger.com/atom/ns#" term="WS-Trust" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="ADFS" /><category scheme="http://www.blogger.com/atom/ns#" term="WS-Federation" /><category scheme="http://www.blogger.com/atom/ns#" term="Binding" /><category scheme="http://www.blogger.com/atom/ns#" term="Claims" /><title>Custom ADFS Login Form for SharePoint 2010 Claims</title><content type="html">This week I've been involved in creating a custom login page for SharePoint 2010 to bypass the standard "select a login method" page for multi-mode claims-enabled web-applications. What we wanted was similar to the &lt;a href="http://blogs.msdn.com/b/jjameson/archive/2011/02/25/claims-login-web-part-for-sharepoint-server-2010.aspx"&gt;Claims Login Web Part for SharePoint Server 2010&lt;/a&gt; for Forms-Based Authentication (FBA) by Jeremy Jameson, but for a trusted ADFS 2.0 identity provider instead.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-jqTbLA9P4X4/TxqHWaxRXcI/AAAAAAAAAXs/uAaDDNxdgDA/s1600/sp2010_cba_login_selector.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="131" src="http://3.bp.blogspot.com/-jqTbLA9P4X4/TxqHWaxRXcI/AAAAAAAAAXs/uAaDDNxdgDA/s400/sp2010_cba_login_selector.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Having a custom login page allows you to stay in your site, which is more WCAG friendly, and avoid the&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/hh147177.aspx"&gt;passive STS authN redirect dance&lt;/a&gt; back and forth between SP and the ADFS STS for authentication. This requires you to use active mode (WS-Trust) rather than the passive mode used by SharePoint. Note that this active approach won't give you single sign-on, because you won't get the MSISAuth&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/hh446525.aspx"&gt;ADFS SSO cookies&lt;/a&gt;&amp;nbsp;- it will simply authenticate you first and then give you the SharePoint FedAuth cookie.&lt;br /&gt;
&lt;br /&gt;
The code you need to call ADFS to make it authenticate you, and thus issue a claims token for use with SharePoint, can be found at &lt;a href="http://www.leastprivilege.com/UsingAnActiveEndpointToSignIntoAWebApplication.aspx"&gt;Using an Active Endpoint to sign into a Web Application&lt;/a&gt;&amp;nbsp;by Dominick Baier or &lt;a href="http://koenwillemse.wordpress.com/2010/08/02/making-a-web-application-use-an-active-sts/"&gt;Making a web application use an active STS&lt;/a&gt; by Koen Willemse. The missing detail not shown in their code is the URL to the ADFS endpoint, which needs to match the &lt;a href="http://www.leastprivilege.com/WIFADFS2AndWCFndashPart1Overview.aspx"&gt;chosen client credentials and security mode&lt;/a&gt;; when using &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;UserNameWSTrustBinding&lt;/span&gt;&amp;nbsp;and sending the username and password in the WCF message secured using SSL (i.e. mixed), the URL should be like "&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;http://adfs.pzl/adfs/services/trust/13/usernamemixed/&lt;/span&gt;" including the important ending / slash to avoid "405 method not allowed" error from IIS.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;protected void btnLogin_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; // authenticate with WS-Trust endpoint&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; var factory = new WSTrustChannelFactory(&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new UserNameWSTrustBinding(SecurityMode.TransportWithMessageCredential),&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new EndpointAddress ("https://adfs.puzzlepart.com/adfs/services/trust/13/usernamemixed/"));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; factory.Credentials.UserName.UserName = txtUserName.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; factory.Credentials.UserName.Password = txtPassword.Text;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; var channel = factory.CreateChannel();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; var rst = new RequestSecurityToken&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RequestType = RequestTypes.Issue,&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AppliesTo = new EndpointAddress("urn:sharepoint:puzzlepart"),&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KeyType = KeyTypes.Bearer&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; var genericToken = channel.Issue(rst) as GenericXmlSecurityToken;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; // parse token&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; var handlers = FederatedAuthentication.ServiceConfiguration.SecurityTokenHandlers;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; var token = handlers.ReadToken(new XmlTextReader(&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new StringReader(genericToken.TokenXml.OuterXml)));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; SPSecurity.RunWithElevatedPrivileges(delegate(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SPFederationAuthenticationModule.Current. SetPrincipalAndWriteSessionToken(token);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; });&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; Response.Redirect("~/pages/default.aspx");&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
After getting authenticated against the ADFS STS when calling &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Issue&lt;/span&gt;&amp;nbsp;on the WS-Trust channel with a &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;RequestSecurityToken&lt;/span&gt;, the returned SAML security token must first be parsed and&amp;nbsp;then written to a FedAuth cookie created from the SAML token. The SharePoint FAM wrapper will both set the thread principal and write the cookie, making the user a logged in SharePoint user.&lt;br /&gt;
&lt;br /&gt;
Note how the writing of the cookie is wrapped with&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;RunWithElevatedPrivileges&lt;/span&gt; to ensure that &amp;nbsp;it runs as the app-pool identity and not as the impersonated SharePoint user. This is to avoid the dreaded "&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;CryptographicException: The system cannot find the file specified&lt;/span&gt;" error in the internal &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ProtectedDataCookieTransform&lt;/span&gt;&amp;nbsp;call.&lt;br /&gt;
&lt;br /&gt;
When calling&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ValidateToken&lt;/span&gt; you will run into the &lt;a href="http://blogs.msdn.com/b/jimmiet/archive/2010/09/19/10064794.aspx"&gt;SecurityTokenException: Issuer of the Token is not a Trusted Issuer&lt;/a&gt; error if your STS is not trusted by SharePoint. SharePoint is configured to use its own &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SPPassiveIssuerNameRegistry&lt;/span&gt;&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;and that will either validate against the built-in SharePoint STS or the set of trusted STS token issuers. See how to add your STS certificate(s)&amp;nbsp;at &lt;a href="http://blogs.msdn.com/b/ekraus/archive/2010/03/22/sharepoint-2010-claims-based-auth-with-adfs-v2.aspx"&gt;SharePoint 2010 Claims-Based Auth with ADFS v2&lt;/a&gt; by Eric Kraus. The trusted providers are apparently only used if the login page is located under the /_trust/ folder that is part of the above "redirect dance" when authenticating against a trusted identity provider.&lt;br /&gt;
&lt;br /&gt;
Over at &lt;a href="http://stackoverflow.com/questions/8215037/creating-an-custom-active-sts-for-sharepoint-2010-using-windows-identity-foundat"&gt;stack overflow&lt;/a&gt;,&amp;nbsp;Matt Whetton had run into the same exception as us and solved it by replacing the passive &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;issuerNameRegistry&amp;gt;&lt;/span&gt; with the Windows Identity Foundation (WIF) &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ConfigurationBasedIssuerNameRegistry&lt;/span&gt; instead. The&amp;nbsp;&lt;a href="http://koenwillemse.wordpress.com/2010/09/02/configuration-of-wif/"&gt;Configuration of WIF&lt;/a&gt;&amp;nbsp;post shows how to add the set of certificate names and thumbprints to the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;trustedIssuers&amp;gt;&lt;/span&gt; list. This is how your web.config list of trusted STS token issuers may look like:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;trustedIssuers&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;add thumbprint="1337133713371337" name="CN=adfs-puzzlepart" /&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;add thumbprint="0000000000000000" name="CN=SharePoint Security Token Service" /&amp;gt;
&amp;lt;/trustedIssuers&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;/issuerNameRegistry&amp;gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Remember to add the SharePoint self-issued certificates such as the&amp;nbsp;"SharePoint Security Token Service" certificate&amp;nbsp;to the list of trusted issuers, in addition to your own STS.&lt;br /&gt;
&lt;br /&gt;
I strongly recommend putting your custom ADFS login page under /_trust/ to avoid having to change the SharePoint web.config files. We chose this approach to minimize risks.&lt;br /&gt;
&lt;br /&gt;
Note that Fiddler seems to break the ADFS login process, at &lt;a href="http://blogs.msdn.com/b/fiddler/archive/2011/09/04/fiddler-http-401-authentication-workaround-to-support-channel-binding-tokens-removing-endless-prompts.aspx"&gt;least when decrypting SSL&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Disclaimer: Note that even if things seems to work as normal after this configuration change, there is no guarantee that nothing was affected in the huge platform that SharePoint 2010 is. The combination of SP2010 claims and WIF is not very well documented, and any changes beyond supported configuration involves risks. Do not apply these changes if you are not sure that it will not break any of your SharePoint solutions or services.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-3117460831809973350?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/vBwRGpnrYQk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/3117460831809973350/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=3117460831809973350" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/3117460831809973350?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/3117460831809973350?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/vBwRGpnrYQk/sharepoint-adfs-custom-login-form.html" title="Custom ADFS Login Form for SharePoint 2010 Claims" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-jqTbLA9P4X4/TxqHWaxRXcI/AAAAAAAAAXs/uAaDDNxdgDA/s72-c/sp2010_cba_login_selector.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2012/01/sharepoint-adfs-custom-login-form.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AERHo_eip7ImA9WhRVGE0.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-7132900798176755973</id><published>2012-01-17T09:22:00.000+01:00</published><updated>2012-01-17T14:08:25.442+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-17T14:08:25.442+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Publishing" /><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="WebPart" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="VisualStudio" /><title>Simple Feature Files Cleanup using Extension Methods</title><content type="html">As every seasoned SharePoint developer knows, deactivating a feature does not remove the files deployed by that feature. The deployed masterpages, web part pages, wiki pages, page layouts, web-part definitions, styling artifacts, etc files will stay in the target libraries - and they will not be overwritten on feature activation. Don't let Visual Studio 2010 trick you into believing otherwise.&lt;br /&gt;
&lt;br /&gt;
You have to delete those deployed files yourself in the FeatureDeactivating event. The classic approach is to delete the files one-by-one, but this is tedious and error-prone. The following is a set of extension methods that allows you to simply do this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;public override void &lt;span style="color: blue;"&gt;FeatureDeactivating&lt;/span&gt;(SPFeatureReceiverProperties properties)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SPSite site = (SPSite) properties.Feature.Parent;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;properties.Definition.&lt;span style="color: blue;"&gt;DeleteFeatureFiles&lt;/span&gt;("MasterPages", site.RootWeb);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;properties.Definition.&lt;span style="color: blue;"&gt;DeleteFeatureWebPartFiles&lt;/span&gt;(site.RootWeb);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
The code is an adaptation of Corey Roth's&amp;nbsp;&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/02/16/linq-to-xml-and-deleting-files-on-feature-deactivation.aspx"&gt;LINQ to XML and Deleting Files on Feature Deactivation&lt;/a&gt;, using extension methods and supporting cleanup of specific feature modules and all feature web-parts.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;namespace Puzzlepart.SharePoint.Core.SPExtentions&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; public static class &lt;span style="color: blue;"&gt;SPFeatureDefinitionExtentions&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public class &lt;span style="color: blue;"&gt;Module&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public string Name { get; set; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public string Path { get; set; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public List&amp;lt;string&amp;gt; Files { get; set; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static void&amp;nbsp;&lt;span style="color: blue;"&gt;DeleteFeatureFiles&lt;/span&gt;(this SPFeatureDefinition spFeatureDefinition, string moduleName, SPWeb web)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;Module&amp;gt; modules = GetModuleFiles(spFeatureDefinition, moduleName);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (Module module in modules)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DeleteModuleFiles(module, web);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static void&amp;nbsp;&lt;span style="color: blue;"&gt;DeleteFeatureWebPartFiles&lt;/span&gt;(this SPFeatureDefinition spFeatureDefinition, SPWeb web)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;Module&amp;gt; modules = GetAllModuleFiles(spFeatureDefinition);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (Module module in modules)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (string.Compare(module.Path, "_catalogs/wp", StringComparison.CurrentCultureIgnoreCase) == 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DeleteModuleFiles(module, web);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static List&amp;lt;Module&amp;gt; &lt;span style="color: blue;"&gt;GetModuleFiles&lt;/span&gt;(SPFeatureDefinition spFeatureDefinition, string moduleName)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string elementsPath = string.Format(@"{0}\FEATURES\{1}\{2}\Elements.xml", SPUtility.GetGenericSetupPath("Template"), spFeatureDefinition.DisplayName, moduleName);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XDocument elementsXml = XDocument.Load(elementsPath);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XNamespace sharePointNamespace = "http://schemas.microsoft.com/sharepoint/";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // get each module name and the files in it&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var moduleList =&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from module in elementsXml.Root.Elements(sharePointNamespace + "Module")&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; select new&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Name = (module.Attributes("Name").Any()) ? module.Attribute("Name").Value : null,&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ModuleUrl = (module.Attributes("Url").Any()) ? module.Attribute("Url").Value : null,&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Files = module.Elements(sharePointNamespace + "File")&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;Module&amp;gt; modules = new List&amp;lt;Module&amp;gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // iterate through each module with files&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var module in moduleList)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Module m = new Module()&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Name = module.Name,&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Path = module.ModuleUrl&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;string&amp;gt; files = new List&amp;lt;string&amp;gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var fileElement in module.Files)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string filename = (fileElement.Attributes("Name").Any()) ? fileElement.Attribute("Name").Value : fileElement.Attribute("Url").Value;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; files.Add(filename);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; m.Files = files;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; modules.Add(m);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return modules;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static void &lt;span style="color: blue;"&gt;DeleteModuleFiles&lt;/span&gt;(Module module, SPWeb web)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (string filename in module.Files)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!string.IsNullOrEmpty(module.Path))&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; web.GetFile(string.Format("{0}/{1}", module.Path, filename)).Delete();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; web.Files.Delete(filename);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static List&amp;lt;Module&amp;gt; &lt;span style="color: blue;"&gt;GetAllModuleFiles&lt;/span&gt;(SPFeatureDefinition spFeatureDefinition)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var moduleList = new List&amp;lt;Module&amp;gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string modulesPath = string.Format(@"{0}\FEATURES\{1}\", SPUtility.GetGenericSetupPath("Template"), spFeatureDefinition.DisplayName);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DirectoryInfo folder = new DirectoryInfo(modulesPath);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (DirectoryInfo moduleFolder in folder.GetDirectories())&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; moduleList.AddRange(GetModuleFiles(spFeatureDefinition, moduleFolder.Name));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return moduleList;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note that page layouts cannot simply be deleted if they are in use. Use code to revert the "GhostableInLibrary" files to the uncustomized (ghosted) feature files on disk in the SharePoint root [14].&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-7132900798176755973?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/NoYYELrai20" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/7132900798176755973/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=7132900798176755973" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7132900798176755973?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7132900798176755973?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/NoYYELrai20/sp2010-feature-files-cleanup-extension.html" title="Simple Feature Files Cleanup using Extension Methods" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2012/01/sp2010-feature-files-cleanup-extension.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYER3k4fip7ImA9WhRWFk8.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-7111505068438894512</id><published>2012-01-03T14:11:00.000+01:00</published><updated>2012-01-03T22:28:26.736+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-03T22:28:26.736+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Publishing" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><title>SharePoint 2010 Localized Publishing Web Template</title><content type="html">When you try to create a new localized publishing site based on a minimal SharePoint 2010 publishing &lt;a href="http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-templates.aspx"&gt;web template&lt;/a&gt; (or a similar &lt;a href="http://www.andrewconnell.com/blog/archive/2008/12/06/Using-a-Minimal-Publishing-Site-Definition-in-the-field.aspx"&gt;minimal site definition&lt;/a&gt;), it might fail with a "CreateWelcomePage" error such as this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-size: x-small;"&gt;System.Runtime.InteropServices.COMException (0x80070001): 0x80070001 at Microsoft.SharePoint.Library.SPRequestInternalClass.&lt;/span&gt;&lt;b&gt;GetMetadataForUrl&lt;/b&gt;&lt;span style="font-size: x-small;"&gt;(String bstrUrl, Int32 METADATAFLAGS, Guid&amp;amp; pgListId, Int32&amp;amp; plItemId, Int32&amp;amp; plType, Object&amp;amp; pvarFileOrFolder) at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid&amp;amp; pgListId, Int32&amp;amp; plItemId, Int32&amp;amp; plType, Object&amp;amp; pvarFileOrFolder) - -- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid&amp;amp; pgListId, Int32&amp;amp; plItemId, Int32&amp;amp; plType, Object&amp;amp; pvarFileOrFolder) at Microsoft.SharePoint.SPWeb.GetListItem(String strUrl, Boolean bFields, String[] fields) at Microsoft.SharePoint.Publishing.PublishingWeb.GetPublishingPage(String strUrl) at Microsoft.SharePoint.Publishing.Internal.AreaProvisioner.&lt;/span&gt;&lt;b&gt;CreateWelcomePage&lt;/b&gt;&lt;span style="font-size: x-small;"&gt;(PublishingWeb area, PageLayout pageLayout) at Microsoft.SharePoint.Publishing.Internal.AreaProvisioner.SetDefaultPageProperties(PublishingWeb area, Boolean&amp;amp; updateRequired) at Microsoft.SharePoint.Publishing.Internal.AreaProvisioner.InitializePublishingWebDefaults() - -- End of inner exception stack trace --- at Microsoft.SharePoint.Publishing.Internal.AreaProvisioner.InitializePublishingWebDefaults() at Microsoft.SharePoint.Publishing.Internal.AreaProvisioner.Provision()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; at Microsoft.SharePoint.Publishing.PublishingFeatureHandler.&amp;lt;&amp;gt;c_DisplayClass3.b_0() at Microsoft.Office.Server.Utilities.CultureUtility.RunWithCultureScope(CodeToRunWithCultureScope code) at Microsoft.SharePoint.Publishing.CmsSecurityUtilities.RunWithWebCulture(SPWeb web, CodeToRun webCultureDependentCode) at Microsoft.SharePoint.Publishing.PublishingFeatureHandler.FeatureActivated(SPFeatureReceiverProperties receiverProperties).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The typical cause is that your web template/site definition is a bit too minimal. The "Publishing" feature needs some initial configuration property data during feature activation. Don't strip these properties away completely. Also, activating the "Publishing" feature from code or a feature stapler will not work for localized sites if you don't pass in this configuration. It is not standard, but you can pass property XML data from code to feature activation as shown in&amp;nbsp;&lt;a href="http://hristopavlov.wordpress.com/2008/07/15/specifying-properties-when-activating-features-through-code/"&gt;Specifying Properties When Activating Features Through Code&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
You must pass in the publishing feature property configuration for the "WelcomePageUrl" to ensure that is reference the localized pages library during activation, which is /sider/ for LCID 1044. The fallback for when this property is not set or is empty seems to be hardcoded to /pages/. Note that using "osrvcore" as the resource file is needed for some languages if you don't have SP1 of the language pack installed.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;!-- Feature: Publishing --&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416"&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Properties xmlns="http://schemas.microsoft.com/sharepoint/"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/puzzlepart.master" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;Property Key="WelcomePageUrl" Value="$Resources:cmscore,List_Pages_UrlName;/default.aspx"/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
It is important to reference an existing page in an existing library as the welcome page (home page). Deploy a page using a module if needed. Note that not all of these properties need to be specified as they have working default settings as fallback.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-7111505068438894512?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/EMLJA8Rd_1Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/7111505068438894512/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=7111505068438894512" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7111505068438894512?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7111505068438894512?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/EMLJA8Rd_1Y/sp2010-localized-publishing-web.html" title="SharePoint 2010 Localized Publishing Web Template" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2012/01/sp2010-localized-publishing-web.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04DQX46eCp7ImA9WhRUEUk.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-5131464118684414278</id><published>2011-11-01T11:19:00.002+01:00</published><updated>2012-01-21T12:39:30.010+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-21T12:39:30.010+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Search" /><category scheme="http://www.blogger.com/atom/ns#" term="Findability" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="IA" /><category scheme="http://www.blogger.com/atom/ns#" term="Taxonomy" /><category scheme="http://www.blogger.com/atom/ns#" term="SiteStructure" /><category scheme="http://www.blogger.com/atom/ns#" term="SearchDriven" /><category scheme="http://www.blogger.com/atom/ns#" term="Innovation" /><title>SharePoint Information Architecture from the Field</title><content type="html">Over the years, I've written quite a few articles on how to technically &lt;a href="http://kjellsj.blogspot.com/2010/08/classification-and-structuring-of.html"&gt;structure your SharePoint solutions&lt;/a&gt; into web-apps, sites, subsites, lists and document libraries. All based on having a defined Information Architecture (IA) as a basis for the solution design, or at least being able to reason about your content management using my&amp;nbsp;&lt;a href="http://kjellsj.blogspot.com/2011/10/sharepoint-2010-information.html"&gt;"chest of drawers" and "news paper"&lt;/a&gt;&amp;nbsp;analogies. The latter is based on my experiences from the field as most companies don't have a well-defined IA in place.&lt;br /&gt;
&lt;br /&gt;
Common questions from customers are "what is Information Architecture?" and "what is the value of having an IA for SharePoint, can't we just create sites and doc-libs on the fly as needed?". Not to forget "how do we go about creating an Information Architecture for SharePoint?". So here are some IA advice from Puzzlepart projects:&lt;br /&gt;
&lt;br /&gt;
In short, &lt;a href="http://kjellsj.blogspot.com/2005/05/sharepoint-areas-and-topics-for.html"&gt;Information Architecture defines how to classify and structure your content&lt;/a&gt; so that it is easy for content consumers to find and explore relevant content, while making it simple for workers to contribute and manage content in an efficient manner.&lt;br /&gt;
&lt;br /&gt;
The business goal of having an Information Architecture for your SharePoint solution is enabling workers
to contribute, store and mange content in a manner that is simple and
efficient, enabling more content sharing; and at the same time making it easy
for workers to browse and find content they need, while also making it easy for
workers to discover and explore relevant content they didn't know of. The
outcome is more knowledgeable workers that are better informed about what’s
going on in the company and about the range of intellectual property possessed
by other employees, while also saving time wasted on finding information, and
time wasted on incorrect or outdated information.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;An outcome is a metric that customers use to define the successful realization 
of the objectives and goals. Outcomes happens after the project has delivered on 
its objectives and goals, and the customers must themselves work against 
securing the outcomes to achieve the desired business value.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
The business value of having a working IA is capturing company
knowledge from employees with better quality of shared content, which combined
with good findability drive &lt;a href="http://www.amazon.com/Power-Pull-Smartly-Things-Motion/dp/0465019358/"&gt;more knowledgeable workers that make better decisions and better faster processes&lt;/a&gt;. In addition, more and better content
sharing helps user not only discover and explore content, but also people such
as subject matter experts, allowing employees to build and expand their network
throughout the company, helping the company to retain talented employees
through social ties and communities. Access to discover more and better content
and people expertise is central to enabling innovation and process improvement,
as new knowledge is a trigger for new ideas and for identifying new
opportunities.&lt;br /&gt;
&lt;br /&gt;
The process of defining your IA for your SharePoint solution should focus on these objectives and goals:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Analyze and define the &lt;u&gt;content classification and structure&lt;/u&gt; for the solution&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;goal: identify what content to manage and plan how to store it in SP, leading to sites, subsites and doc-lib structure organized into SP web-apps&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Analyze and define how to &lt;u&gt;browse and navigate&lt;/u&gt; the content&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;goal: make it simple and efficient for users to find and use known content that they need in they daily work to drive better faster processes&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Analyze and define how to &lt;u&gt;discover and explore&lt;/u&gt; the content&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;goal: make it easy for users to stumble upon novel shared knowledge based on "common focus" to trigger innovation and build social ties&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Provide simple and efficient &lt;u&gt;content contributor experience&lt;/u&gt;&amp;nbsp;with liberal appliance of default metadata values, storing content close to the authors&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;goal: &lt;b&gt;make workers contributors, not knowledge management grunts&lt;/b&gt;, and help them store content correctly with better metadata and tagging, driving findability and "common focus" content discovery; drive better sharing and collaboration&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Analyze and define the &lt;u&gt;starter content types with metadata and term set taxonomy&lt;/u&gt; based on the defined site and doc-lib architecture, with a strong focus on needed search experience capabilities&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;goal: enable content management and support&amp;nbsp;both search-driven and "common focus" content;&amp;nbsp;drive findability, sharing and innovation&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Analyze and define the &lt;u&gt;policies for social tagging and rating&lt;/u&gt; in the solution, also in relation to user profile interests, skills and responsibility tagging&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;goal: drive "common focus" content discovery, drive findability, drive social communities, drive innovation&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Analyze and define the &lt;u&gt;search experience&lt;/u&gt;, focusing on both search-driven content and on search center scopes and refiners&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;goal: drive findability and provide both search-driven and "common focus" content&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Enable &lt;u&gt;disposition of redundant and irrelevant content&lt;/u&gt;&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;goal: provide users with better, correct and up-to-date information, drive findability, save storage cost, save process cost&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
Including the search experience helps you avoid an initial version of your IA with a too narrow scope, which is easy to do for a starter IA when e.g. analyzing only project collaboration needs or just the document types of an attachment-based intranet. It makes you focus on what you get out, not only what you put in.&lt;br /&gt;
&lt;br /&gt;
Note that navigation is not IA, its just one way to explore the content. Using navigation to structure your content is just reapplying the fileshare folder approach, which we all know doesn't work too good for findability and discovery. Navigation should not &lt;a href="http://kjellsj.blogspot.com/2010/08/classification-and-structuring-of.html"&gt;define the statical IA structure for the content&lt;/a&gt;, do a &lt;a href="http://kjellsj.blogspot.com/2005/05/sharepoint-areas-and-topics-for.html"&gt;LATCH&lt;/a&gt; analysis to model the possible IA structures, and choose one of them to define the statical IA structure. The site map is closer to define statical IA structure than navigation, still it is only good for logical IA structure and cannot be expected to be used directly as the physical IA structure in SharePoint.&lt;br /&gt;
&lt;br /&gt;
In an upcoming article I will give some practical advice from the field on how to define and realize the Information Architecture for your SharePoint solution in an agile fashion.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-5131464118684414278?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/W0yj8QNEDUY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/5131464118684414278/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=5131464118684414278" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/5131464118684414278?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/5131464118684414278?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/W0yj8QNEDUY/sp2010-information-architecture.html" title="SharePoint Information Architecture from the Field" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/11/sp2010-information-architecture.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UGRXY-eip7ImA9WhRTEUk.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-318456547476037539</id><published>2011-10-27T10:10:00.001+02:00</published><updated>2011-11-01T12:00:24.852+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-01T12:00:24.852+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="IA" /><category scheme="http://www.blogger.com/atom/ns#" term="Taxonomy" /><category scheme="http://www.blogger.com/atom/ns#" term="SiteStructure" /><title>SharePoint is like a Chest of Drawers</title><content type="html">I often get asked "how many document libraries and sites will we need?" in SharePoint, followed by "how will we know whether we should use more doc-libs in a site or just throw it all in there?" and "where should content be stored? we need to show it on the intranet home page, but it is really edited and owned by HR in region Gokk". Well, SharePoint is like a chest of drawers.&lt;br /&gt;
&lt;br /&gt;
To answer such questions, you need to know how to &lt;a href="http://kjellsj.blogspot.com/2010/08/classification-and-structuring-of.html"&gt;classify and structure your content&lt;/a&gt;; ideally you should have an &lt;a href="http://kjellsj.blogspot.com/2011/11/sp2010-information-architecture.html"&gt;Information Architecture&lt;/a&gt; for all your different kinds of data. If you are like most others, you don't. This is where the "chest of drawers" analogy might help you reason about your content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether you need many doc-libs or subsites or not depends on your IA policies for information management. Still don't have an IA? Think of a chest of drawers for you clothes: it makes it easier to manage different types of clothes in different ways at different schedules, by e.g. separating t-shirts from trousers. Maybe even handle different kinds of t-shirts differently, such as your precious Maiden t-shirts. It also allows for delegating a few drawers to be managed by your wife; maybe you even want to have some locked drawers with more privacy :)&lt;br /&gt;
&lt;br /&gt;
Your content are the clothes, the drawers are doc-libs or even subsites; and depending on the variety of clothes you have, you might need quite a sophisticated chest of drawers. Throw in all your other stuff, and you might need a bigger closet or a garage!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-x6MA3Fxldd8/TqlOdyFcNbI/AAAAAAAAAXE/Q7wLJNNHq80/s1600/chest_of_drawers_02.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-x6MA3Fxldd8/TqlOdyFcNbI/AAAAAAAAAXE/Q7wLJNNHq80/s320/chest_of_drawers_02.jpg" width="239" /&gt;&lt;/a&gt;&lt;/div&gt;
So now all your content is stored into nicely separated drawers, with delegated and secure handling where needed. But is is not so easy to see what is in the drawers without actually opening and browsing the content of each drawer. Until we get one of those science fiction closets that knows whats in the drawers and let us explore what trendy outfits we can wear today, its time for another analogy: the good old news paper, even in its modern online incarnation.&lt;br /&gt;
&lt;br /&gt;
Think of a news paper with a front page and then multiple sections, such as domestic, foreign, sports, economics, etc.&amp;nbsp;The front page and section front pages are used to show the (elsewhere) stored content to readers, helping them quicly browse the content at wellknow locations in the paper. The shown stories are typically rollup content stored elsewhere, typically where maintained, close to the content editors.&lt;br /&gt;
&lt;br /&gt;
So a paper is built from dispersed storage of content that can be rolled up and targeted to readers multiple places. The home page and section pages rollup content "teasers" and allows the user to browse the content stored elsewhere in the paper and decide whether to explore it further.&lt;br /&gt;
&lt;br /&gt;
The front page is the home page of your SharePoint site, the sections are subsites and the section pages are the subsite welcome pages in SharePoint parlance. As for the drawers, there might be different management policies and different people handling the different sections, and this helps you decide when subsites are needed. The rollup, or cross publishing if you like, is achieved using the&amp;nbsp;content by query web-part or search-driven content based on content types, tagging and metadata.&lt;br /&gt;
&lt;br /&gt;
Controlled and secure management of content according to different policies and schedules is much simpler when using subsites as compared to throwing it all into one site. Store the content close to the producers, show it everywhere the users expect to find it - and also where *you* want them to discover and explore knowledge new to them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-318456547476037539?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/TAvHjSKtH5Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/318456547476037539/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=318456547476037539" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/318456547476037539?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/318456547476037539?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/TAvHjSKtH5Q/sharepoint-2010-information.html" title="SharePoint is like a Chest of Drawers" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-x6MA3Fxldd8/TqlOdyFcNbI/AAAAAAAAAXE/Q7wLJNNHq80/s72-c/chest_of_drawers_02.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/10/sharepoint-2010-information.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8CSXg_eip7ImA9WhdVFk8.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-7704544294528811035</id><published>2011-09-08T12:45:00.003+02:00</published><updated>2011-09-21T19:57:48.642+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-21T19:57:48.642+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="MySite" /><category scheme="http://www.blogger.com/atom/ns#" term="UserProfile" /><title>Issue with SP2010 Personal Site UserInfo Synchronization</title><content type="html">Today we discovered an issue with the SharePoint synchronization from the user profile database to the hidden UserInfoList in all site-collections. This sync is performed by two timer jobs (see &lt;a href="http://community.bamboosolutions.com/blogs/sharepoint-2010/archive/2010/11/15/sharepoint-2010-user-management.aspx"&gt;profile sync details in this excellent article&lt;/a&gt; on the&amp;nbsp;Bamboo Team Blog), which will update changes to your user profile in all the cached profile data in the hidden user info lists, except for the UserInfoList in your personal site under the profile site (My Site Host).&lt;br /&gt;
&lt;br /&gt;
To verify the reported bug, I updated my mobile phone number in my user profile, and ran the two sync timer jobs. This is how my updated user information looks in a team-sites:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-oaEmuO4R2sc/Tmict2sbn3I/AAAAAAAAAW8/WbZ8EQOJwoo/s1600/UserInfoList_Synced.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="370" src="http://4.bp.blogspot.com/-oaEmuO4R2sc/Tmict2sbn3I/AAAAAAAAAW8/WbZ8EQOJwoo/s400/UserInfoList_Synced.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
And this is how my non-updated user information looks in my personal site:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-AsnKHdA2Tjo/TmibClcEpfI/AAAAAAAAAW4/hq-FbUgrI8U/s1600/UserInfoList_SyncIssue.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="371" src="http://2.bp.blogspot.com/-AsnKHdA2Tjo/TmibClcEpfI/AAAAAAAAAW4/hq-FbUgrI8U/s400/UserInfoList_SyncIssue.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
As you can see from the time stamps in the lower left corner, the profile data is still exactly as cached in the UserInfoList when I first created and visited my personal site. As of now I don't know any fix for this issue.&lt;br /&gt;
&lt;br /&gt;
[UPDATE] A list of things to check, not all applies to SP2010 though: &lt;a href="http://support.microsoft.com/kb/2388988"&gt;Troubleshooting User Profile Sync issues in Microsoft Office SharePoint Server 2007&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
As it turns out, all our personal sites get the "ProfileSynchronizationInternalException: ProfSynch: The site with ID &amp;lt;guid&amp;gt; cannot be synchronized due to an unprovisioned root web" error in the ULS. This seems to be a common problem in SharePoint 2010 according to this &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010setup/thread/7e74bfe0-6adc-4337-ad2c-72226dba3581"&gt;MSDN forum thread&lt;/a&gt;, which also provides an unsupported workaround that updates the Flags column of the Webs table in the My Site Host content database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-7704544294528811035?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/jZtVFXCA-LQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/7704544294528811035/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=7704544294528811035" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7704544294528811035?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7704544294528811035?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/jZtVFXCA-LQ/sp2010-personal-site-userinfo-profile.html" title="Issue with SP2010 Personal Site UserInfo Synchronization" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-oaEmuO4R2sc/Tmict2sbn3I/AAAAAAAAAW8/WbZ8EQOJwoo/s72-c/UserInfoList_Synced.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/09/sp2010-personal-site-userinfo-profile.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8CSXk_cCp7ImA9WhdXEEU.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-8361988759569362440</id><published>2011-08-10T09:58:00.004+02:00</published><updated>2011-08-23T10:07:48.748+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-23T10:07:48.748+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Customization" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="MySite" /><title>Some Gotchas when Customizing the "My Content" Personal Site</title><content type="html">Customizing an existing SharePoint 2010 site definition such as the personal site (SPSPERS) that provides the "My Content" section in the My Site Host web-application, is a bit different than customizing your own site definitions. As the supported way of customizing existing site definitions is to use feature stapling, you need to consider the provisioning order of elements in onet.xml and referenced and stapled 'SPSite' and 'SPWeb' features. Failing to do so might result in strange end results when creating a new site.&lt;br /&gt;
&lt;br /&gt;
The MCS Norway team has done a good job of documenting the SharePoint element provisioning order, as part of their &lt;a href="http://spsiteconfigurator.codeplex.com/"&gt;SiteConfigurator&lt;/a&gt; available at CodePlex:&lt;br /&gt;
&lt;blockquote&gt;"There are several steps in the creation process and SharePoint provisions in the following order:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Global onet.xml This file defines list templates for hidden lists, list base types, a default definition configuration, and modules that apply globally to the deployment.&lt;/li&gt;
&lt;li&gt;SPSite scoped features defined in site definitions onet.xml, in the order they are defined in the file. The onet.xml file defined in the site definition can define navigational areas, list templates, document templates, configurations, modules, components, and server e-mail footers used in the site definition to which it corresponds.&lt;/li&gt;
&lt;li&gt;SPSite scoped stapled features, in quasi random order&lt;/li&gt;
&lt;li&gt;SPWeb scoped features defined in onet.xml, in the order they are defined in the file.&lt;/li&gt;
&lt;li&gt;SPWeb scoped stapled features, in quasi random order&lt;/li&gt;
&lt;li&gt;List instances defined in onet.xml&lt;/li&gt;
&lt;li&gt;Modules defined in onet.xml&lt;/li&gt;
&lt;/ol&gt;This is a fairly complex process and it can often be hard to know the method for customizing a site definition. A solution can be right in one scenario and completely wrong in another, making this somewhat confusing."&lt;/blockquote&gt;Here are some gotchas related to SPSPERS customization:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The doc-libs Shared Documents and Personal Documents do not exist yet during feature stapling; list instances in onet.xml are provisioned in step 6.&lt;/li&gt;
&lt;li&gt;The my content home page default.aspx&amp;nbsp;do not exist yet during feature stapling; files and pages in onet.xml are provisioned in step 7.&lt;/li&gt;
&lt;li&gt;Do not create your own customized default.aspx file, it will get filled with the standard web-parts when the file's &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;AllUsersWebParts&lt;/span&gt; are provisioned by the onet.xml module in step 7.&lt;/li&gt;
&lt;li&gt;The quick launch heading node titles are not yet localized during site provisioning, look them up by their id rather than their title when adding links&lt;/li&gt;
&lt;li&gt;The standard BlogView web-part only works when in a site page in the site root, it won't work in pages stored in lists, doc-libs or custom folders.&lt;/li&gt;
&lt;li&gt;The Wiki Page Home Page feature is not activated by default for personal sites; do not provision your own /SitePages/ custom list, doc-lib or folder, as this will prevent enabling wiki pages later on.&lt;/li&gt;
&lt;/ul&gt;To customize the standard personal site home page, you must provision a new home page with a different name and change the site's home page setting (&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;SPFolder&amp;nbsp;rootFolder.WelcomePage&lt;/span&gt;). Remember to restore the standard setting when deactiving your customization feature.&lt;br /&gt;
&lt;br /&gt;
I strongly recommend using or learning from the SiteConfigurator, download the feature and the source code from CodePlex and join the community there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-8361988759569362440?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/K7mufjFUNEU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/8361988759569362440/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=8361988759569362440" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/8361988759569362440?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/8361988759569362440?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/K7mufjFUNEU/customizing-sharepoint-2010-my-content.html" title="Some Gotchas when Customizing the &quot;My Content&quot; Personal Site" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/08/customizing-sharepoint-2010-my-content.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYESHo_cSp7ImA9WhZaGUk.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-4132592628881493464</id><published>2011-07-06T08:26:00.005+02:00</published><updated>2011-07-06T12:28:29.449+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-06T12:28:29.449+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Topology" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="FAST" /><category scheme="http://www.blogger.com/atom/ns#" term="ServiceApplications" /><title>Problem creating a FAST Content SSA in SharePoint 2010</title><content type="html">While installing Fast Search Server for SharePoint 2010 (FS4SP) on a dev farm today, I got a problem with the provisioning of a new FAST Content SSA (Search Service Application), it would hang forever at "0:01 Configuring the Search Service..." waiting for the TopologyConfigFinish.aspx page to complete.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-5DIvxJwc818/ThQWATzrSqI/AAAAAAAAAWY/3bvDncflMPQ/s1600/SP2010_create_new_SSA.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="128" src="http://3.bp.blogspot.com/-5DIvxJwc818/ThQWATzrSqI/AAAAAAAAAWY/3bvDncflMPQ/s400/SP2010_create_new_SSA.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The problem turned out to be that the SharePoint 2010 Administration service wasn't started after the mandatory server reboot after installing FS4SP. The FAST "nctrl status" cmdlet does not check this.&amp;nbsp;Make sure that both the SP2010 Administration and Timer services are running:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-CaPKDsSvohs/ThP9iVa3ejI/AAAAAAAAAWU/8FD9s3N27fE/s1600/SharePoint_Timer_Admin_NTServices.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="106" src="http://1.bp.blogspot.com/-CaPKDsSvohs/ThP9iVa3ejI/AAAAAAAAAWU/8FD9s3N27fE/s400/SharePoint_Timer_Admin_NTServices.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
If you still can't create new or delete search service application instances, or make topology changes at all, then you might need to delete the old SSA the hard way. See &lt;a href="http://donalconlon.wordpress.com/2010/08/27/deleting-the-search-service-application/"&gt;Deleteing the search service application&lt;/a&gt; and&amp;nbsp;&lt;a href="http://blogs.technet.com/b/nishants/archive/2010/04/14/how-to-delete-orphan-configuration-objects-from-sharepoint-farm.aspx"&gt;How to delete orphan configuration objects from SharePoint farm&lt;/a&gt;. Heed this warning: "Please be VERY careful when executing the deleteconfigurationobject command, if this command is not used in the correct way (if you end up deleting the wrong object) there is NO way to revert back the changes and it has the potential to render your Configuration Database useless, hence you may require to restore / rebuild your SharePoint farm".&lt;br /&gt;
&lt;br /&gt;
Remember to &lt;a href="http://technet.microsoft.com/nb-no/library/ff381261(en-us).aspx"&gt;configure SSL enabled communication&lt;/a&gt; again when recreating the FAST Content SSA, otherwise your next crawl will be stuck on starting while retrying every 60 seconds to connect to the document engine. Also remember to restart the FAST Search for SharePoint and the SharePoint Server Search 14 services before starting a new full crawl.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-4132592628881493464?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/lwmFO9qi3ec" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/4132592628881493464/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=4132592628881493464" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/4132592628881493464?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/4132592628881493464?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/lwmFO9qi3ec/search-service-application-sharepoint.html" title="Problem creating a FAST Content SSA in SharePoint 2010" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-5DIvxJwc818/ThQWATzrSqI/AAAAAAAAAWY/3bvDncflMPQ/s72-c/SP2010_create_new_SSA.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/07/search-service-application-sharepoint.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AGQ3c4eyp7ImA9WhZaE04.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-7011517746115939419</id><published>2011-06-24T12:23:00.027+02:00</published><updated>2011-06-29T10:22:02.933+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-29T10:22:02.933+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="AJAX" /><category scheme="http://www.blogger.com/atom/ns#" term="WebPart" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><title>Delay Loading of Data in SharePoint 2010 Web Parts</title><content type="html">Sometimes your web-parts may take a long time to load their data, e.g. when connecting to external data through BCS, doing SPSiteDataQuery across a large number of sites, or when iterating over a user's site memberships to read some items from lists in different site-collections. Put a few of such web-parts on a dashboard page and wait for the combined load time of all those web-parts to complete before the page is shown. Not a nice user experience. These days users expect something as shown in this short screencast:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" data-thumbnail-src="http://i.ytimg.com/vi/xyJ3cs-CBtA/0.jpg" height="266" width="320"&gt;&lt;param name="movie" value="http://www.youtube.com/v/xyJ3cs-CBtA?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" /&gt;&lt;param name="bgcolor" value="#FFFFFF" /&gt;&lt;embed width="320" height="266"  src="http://www.youtube.com/v/xyJ3cs-CBtA?f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;
If you've used ASP.NET Ajax UpdatePanels, you might wish to utilize the asynchronous partial page update experience seen on postbacks also during page load. The simple thing seems to be &lt;a href="http://encosia.com/easily-refresh-an-updatepanel-using-javascript/"&gt;calling __doPostBack&lt;/a&gt;&amp;nbsp;for each UpdatePanel from the &lt;a href="http://encosia.com/document-ready-and-pageload-are-not-the-same/"&gt;page load&lt;/a&gt; JavaScript event to trigger the Ajax async partial postback. That won't work, as only one concurrent postback is allowed by ASP.NET Ajax, so only one of your web-parts will work as expected, the other __doPostBack calls will get canceled by the ScriptManager.&lt;br /&gt;
&lt;br /&gt;
A simple solution to this problem, is to put an &lt;a href="http://www.codeproject.com/KB/ajax/DelayedContentLoading.aspx"&gt;asp:timer control inside the UpdatePanel&lt;/a&gt; and let it trigger a postback to your web-part code. Then load the data and update the content of the UpdatePanel during this async Ajax postback.&lt;br /&gt;
&lt;br /&gt;
Here are the code to two base classes that implements this delayed load approach:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;using System;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;using System.Linq;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;using System.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;using System.Web.UI;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;namespace Puzzlepart.SharePoint.WebParts&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; public class AjaxPanelWebPart : System.Web.UI.WebControls.WebParts.WebPart&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected UpdatePanel AjaxPanel;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected override void OnLoad(EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; base.OnLoad(e);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.EnsureChildControls();&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected override void CreateChildControls()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AjaxPanel = new UpdatePanel()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ID = this.ID + "UpdatePanel1",&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UpdateMode = UpdatePanelUpdateMode.Conditional&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Controls.Add(AjaxPanel);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UpdatePanelConfigurator.AddUpdatePanelProgress(AjaxPanel);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected virtual void ApplyUserActions()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //to be overridden in derived classes&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected void RebindControlsWhenNoViewState()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Page.IsPostBack == true &amp;amp;&amp;amp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp;System.Web.UI.ScriptManager.GetCurrent(Page).IsInAsyncPostBack == false)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ApplyUserActions();&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; public class AjaxPanelDelayedLoadWebPart : AjaxPanelWebPart&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected Timer LoadTimer;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected override void OnLoad(EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; base.OnLoad(e);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.EnsureChildControls();&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected override void CreateChildControls()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; base.CreateChildControls();&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CreateLoadTimer();&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private void CreateLoadTimer()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LoadTimer = new Timer()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ID = this.ID + "LoadTimer1",&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Interval = 1 //millisecond&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LoadTimer.Tick += new EventHandler&amp;lt;EventArgs&amp;gt;(LoadTimer_Tick);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AjaxPanel.ContentTemplateContainer.Controls.Add(LoadTimer);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; protected void LoadTimer_Tick(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LoadTimer.Enabled = false;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ApplyUserActions();&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label msg = new Label()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Text = "An error occurred in delayed load: " + ex.Message,&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ToolTip = ex.ToString()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Controls.Add(msg);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ApplyUserActions&lt;/span&gt; method is where you should fetch your data and update the content of the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;AjaxPanel&lt;/span&gt; member control. All the controls of your web-part should be created as usual, remember to call &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;base.CreateChildControls&lt;/span&gt;&amp;nbsp;in your derived web-parts to ensure that the Ajax controls get created.&lt;br /&gt;
&lt;br /&gt;
Note that no slow data must be fetched and bound to your web-part controls during page load, e.g. in the&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CreateChildControls&lt;/span&gt; or &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;OnPreRender&lt;/span&gt; methods, as this defeats the purpose of delay loading the data in the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ApplyUserActions&lt;/span&gt; async postback method. A typical scenario is creating and configuring an SPGridView control in &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CreateChildControls&lt;/span&gt; and then fetch the data and set the grid's DataSource and call the grid's DataBind method in the overridden &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ApplyUserActions&lt;/span&gt; method in your derived web-part.&lt;br /&gt;
&lt;br /&gt;
Note that &lt;a href="http://encosia.com/are-you-making-these-3-common-aspnet-ajax-mistakes/"&gt;all page event code get executed on partial postbacks&lt;/a&gt; for all web-parts on the page. This can cause problems that are unrelated to the web-part that triggers the postback, manifested as ScriptResource.axd JavaScript errors. Some problems are related to viewstate handling, such as the "Error=Value cannot be null.  Parameter name: container" SPGridView exception. The simple solution is to turn off viewstate, and then call the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;RebindControlsWhenNoViewState &lt;/span&gt; method to load and bind the data when the postback is not an async Ajax postback. This must also be done for all controls that do not use viewstate, otherwise they will end up empty after e.g. modal dialogs that reload the page on close.&lt;br /&gt;
&lt;br /&gt;
This ASP.NET Timer approach allows the page to load quickly, then each web-part will in turn get the timer tick postback and update itself using &lt;a href="http://msdn.microsoft.com/en-us/library/bb399001.aspx"&gt;ASP.NET Ajax partial page updates&lt;/a&gt;. Note that this code won’t work as a sandboxed web-part. The UpdatePanel control requires the ScriptManager, which isn’t accessible from the sandboxed worker process.&lt;br /&gt;
&lt;br /&gt;
The more professional way of getting real asynchronous loading for web-part content is to use &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;PageAsyncTask&lt;/span&gt; as shown in Chapter 9 in Wictor Wilen's excellent &lt;a href="http://www.amazon.com/SharePoint-2010-Web-Parts-Action/dp/1935182773"&gt;SharePoint 2010 Web Parts in Action&lt;/a&gt; book. It does require a bit more code, but will allow parallell data fetching and thus faster page load time. It also works without using any UpdatePanels as all is done server-side.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-7011517746115939419?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/dKzRN-VWNtg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/7011517746115939419/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=7011517746115939419" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7011517746115939419?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7011517746115939419?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/dKzRN-VWNtg/delayed-load-sharepoint-2010-web-parts.html" title="Delay Loading of Data in SharePoint 2010 Web Parts" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/06/delayed-load-sharepoint-2010-web-parts.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcNRng9fSp7ImA9WhZWGUs.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-6054956174669236051</id><published>2011-05-19T20:18:00.018+02:00</published><updated>2011-05-21T09:31:37.665+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-21T09:31:37.665+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ContentType" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Taxonomy" /><category scheme="http://www.blogger.com/atom/ns#" term="Governance" /><category scheme="http://www.blogger.com/atom/ns#" term="ContentTypeHub" /><category scheme="http://www.blogger.com/atom/ns#" term="ManagedMetadataService" /><title>New Sites and the SharePoint 2010 Content Type Hub</title><content type="html">The SharePoint 2010 content type hub does quite a good job of managing and publishing a centrally controlled set of content types. There are a few quirks and limitations, some of them documented in &lt;a href="http://blogs.msdn.com/b/chaks/archive/2011/02/09/content-type-hub-limitations.aspx"&gt;Content Type Hub FAQ and Limitations&lt;/a&gt; by Chaks' SharePoint Corner; not to forget the &lt;a href="http://www.sharepointanalysthq.com/2010/06/content-type-publishing-in-sharepoint-2010/"&gt;content type publishing timer jobs&lt;/a&gt; that actually push the content types to the subscribers.&lt;br /&gt;
&lt;br /&gt;
One of the less documented areas of using a content type hub (HUB) is what happens to new site-collections that are provisioned? What if I have list definitions in my features, how can I be sure that their referenced content types have been provisioned at feature activation time? Can I deploy my enterprise content types feature at both the hub site-collection and also at new site-collections that users create?&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-P55nO5mJZbg/TddqLWLSxfI/AAAAAAAAAWQ/UuS-3cg75JU/s1600/content+type+hub.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="209" src="http://2.bp.blogspot.com/-P55nO5mJZbg/TddqLWLSxfI/AAAAAAAAAWQ/UuS-3cg75JU/s320/content+type+hub.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
First, when a new site-collection is created, it will immediately have all the published content types from the parent SharePoint web-application's connected Managed Metadata Service (MMS) application's defined HUB, automatically provisioned into its local content type gallery. Note that this applies only to the published content types as configured in the source hub. Content types that are not published, will not exist in your new site-collection. Note that hub content types are not by default published; this must be configured for every single content type in the source hub.&lt;br /&gt;
&lt;br /&gt;
So if your list definitions depend on global content types that have not been published in the HUB, your feature activation will fail. You can of course solve this by publishing the applicable global content types in the source hub and run the timer jobs first, as this will ensure that new site-collections will have the enterprise content types auto-provisioned from the MMS HUB.&lt;br /&gt;
&lt;br /&gt;
However, you can also deploy your enterprise content types feature to both the content type hub and to any other site-collection that you create. This works fine as the site content type definitions are identical, including the &lt;a href="http://msdn.microsoft.com/en-us/library/aa543822.aspx"&gt;content type ID&lt;/a&gt; structure - after all it is the same content type CAML feature. This won't affect subscribing to the content type hub, and publishing new, updated or derived content types from the hub works just as expected.&lt;br /&gt;
&lt;br /&gt;
Activate your site content type feature before activating your list definition feature, or any other feature that depends on the site content types being provisioned, to ensure that they exists locally in the new site-collection even if not yet published in the HUB.&lt;br /&gt;
&lt;br /&gt;
As your taxonomy is subject to change, so are your enterprise content types. Thus, your deployment strategy for enterprise content types needs to handle change. I strongly recommend using the &lt;a href="http://kjellsj.blogspot.com/2010/04/sharepoint-2010-open-closed-taxonomy.html"&gt;Open-Closed Principle for modifying and extending the enterprise content types&lt;/a&gt;. The Open-Closed Principle is based on using a set of immutable base content types that you derive from to make new specialized content types, inheriting fields from the base. The immutable base of the Open-Closed Principle coincides nicely with provisioning global content types through both a feature and the content type hub, as by policy any changes are made by extending the former through the latter.&lt;br /&gt;
&lt;br /&gt;
Even trivial stuff such as providing standardized company templates for Word and  other Office applications, is best done by publishing new derived  content types. Use the content type hub to inherit your base PzlDocument into PzlDocumentMemo and attach a template, go to "Manage publishing for this content type" to publish the content type. Wait for, or run, the two HUB timer jobs, and then add the Word template to the applicable document libraries.&lt;br /&gt;
&lt;br /&gt;
Now you're in for a surprise later on. The next time you try to create a new site-collection after publishing modifications in the HUB, you might get this "content type is read only" error:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-LUGSEyedK4M/TdVTGu-NYKI/AAAAAAAAAWM/dB0pg0wBDRA/s1600/SharePoint_content_type_hub_update_error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="156" src="http://4.bp.blogspot.com/-LUGSEyedK4M/TdVTGu-NYKI/AAAAAAAAAWM/dB0pg0wBDRA/s320/SharePoint_content_type_hub_update_error.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The ULS log typically contains an exception like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SPContentTypeReadOnlyException&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Error code: -2146232832&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;The content type is read only or updateChildren is true and one of the child objects of the content type is read only.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The root cause for this is that published content types are by default read-only in the subscribers. What typically leads to this error is the need to use code when provisioning content types, e.g. when renaming and reordering fields, or when adding the enterprise keywords field to your content type. Another typical scenario where code is required is managed metadata fields; see &lt;a href="http://www.wictorwilen.se/Post/How-to-provision-SharePoint-2010-Managed-Metadata-columns.aspx"&gt;How to provision SharePoint 2010 Managed Metadata columns&lt;/a&gt; by Wictor Wilén.&lt;br /&gt;
&lt;br /&gt;
Making changes to the site content type definition in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;FeatureActivated&lt;/span&gt; code and then calling &lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SPContentType Update&lt;/span&gt;&lt;/span&gt; with &lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;updateChildren=true&lt;/span&gt;&lt;/span&gt; will work fine, until someone creates a new derived content type in the source hub and publish it. Your carefully tested code will suddenly crash, as the published child content type is read-only! Alas, what better proof that the deployed and the published global content types are the same?&lt;br /&gt;
&lt;br /&gt;
Luckily, the change is isolated to the new inherited content type, thus it can safely be ignored when deploying the base content types. Use this overloaded &lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Update&lt;/span&gt;&lt;/span&gt; method when modifying the global content types:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;public void Update(&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool updateChildren := true,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool throwOnSealedOrReadOnly := false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The HUB change did not affect your global content type  due to using the Open-Closed governance policy for enterprise content types. See my &lt;a href="http://kjellsj.blogspot.com/2010/04/sharepoint-2010-open-closed-taxonomy.html"&gt;SharePoint 2010 Open-Closed Taxonomy&lt;/a&gt; post to learn more about this recommended policy.&lt;br /&gt;
&lt;br /&gt;
The content type hub and the Managed Metadata Service are perhaps the best new features in SharePoint 2010, still there are some uncharted areas that make developers reluctant at using the MMS HUB. There are a lot of articles at Technet and MSDN on the architecture, but way too little about deployment scenarios and issues such as those in this post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-6054956174669236051?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/kZMJnrXQ8DM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/6054956174669236051/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=6054956174669236051" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/6054956174669236051?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/6054956174669236051?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/kZMJnrXQ8DM/provisioning-sites-content-type-hub.html" title="New Sites and the SharePoint 2010 Content Type Hub" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-P55nO5mJZbg/TddqLWLSxfI/AAAAAAAAAWQ/UuS-3cg75JU/s72-c/content+type+hub.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/05/provisioning-sites-content-type-hub.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAMRX44fCp7ImA9WhRVF0U.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-9215547244882883193</id><published>2011-05-07T19:53:00.023+02:00</published><updated>2012-01-17T09:26:24.034+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-17T09:26:24.034+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Search" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="InformationManagement" /><category scheme="http://www.blogger.com/atom/ns#" term="Governance" /><category scheme="http://www.blogger.com/atom/ns#" term="SearchDriven" /><title>Site Lifecycle Management using Retention Policies</title><content type="html">The ootb &lt;a href="http://kjellsj.blogspot.com/2010/05/start-with-simple-governance-sharepoint.html"&gt;governance tools for site lifecycle management&lt;/a&gt; (SLM) in SharePoint 2010 have not improved from the previous version. You're still stuck with the &lt;a href="http://technet.microsoft.com/en-us/library/cc262420.aspx"&gt;Site Use Confirmation and Deletion&lt;/a&gt; policies that will just periodically e-mail site owners and ask them to confirm that their site is still in use. There is no check for the site or its content actually being used, it is just a dumb timer job. If the site is not confirmed as still being active, the site will then be deleted - even if it is still in use. As deleting a site is not covered by any SharePoint recycle bin mechanism (&lt;a href="http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=973"&gt;coming in SP1&lt;/a&gt;), Microsoft also provides the &lt;a href="http://governance.codeplex.com/"&gt;site deletion capture tool&lt;/a&gt; on CodePlex.&lt;br /&gt;
&lt;br /&gt;
Wouldn't it be nice if we could apply the &lt;a href="http://office.microsoft.com/en-us/sharepoint-server-help/create-and-apply-information-management-policies-HA101631505.aspx"&gt;information management policies&lt;/a&gt; for retention and disposition of content also for SharePoint 2010 sites? Yes we can :) By using a content type to identify and keep metadata for a site, the standard information management policies for content expiration can be configured to implement a recurring multistage retention policy for site disposition.&lt;br /&gt;
&lt;br /&gt;
Create a site information content type and bind it to a list or library in your site definition, and ensure that this list contains one SiteInfo item with the metadata of the site. Typical metadata are site created date, site contact, site type, cost center, unit and department, is restricted site flag, last review date, next review date, and last update timestamp. Restrict edit permissions for this list to just site owners or admins.&lt;br /&gt;
&lt;br /&gt;
Enable retention for the SiteInfo content type to configure your site lifecycle management policy as defined in your &lt;a href="http://kjellsj.blogspot.com/2010/05/sharepoint-governance-part-i-eating.html"&gt;governance plan&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-_-LwqA6NK7o/TcVwNOsSW9I/AAAAAAAAAWA/8KUm_YXjtDA/s1600/SP2010_information_management_retention.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="http://3.bp.blogspot.com/-_-LwqA6NK7o/TcVwNOsSW9I/AAAAAAAAAWA/8KUm_YXjtDA/s400/SP2010_information_management_retention.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Add one or more retention stages for the SiteInfo content type as needed by your SLM policy. You will typically have a first stage that will start a workflow to notify the site owner of site expiration and ask for disposition confirmation. Make sure that the site owner knows about and enacts on your defined governance policies for manual information management, such as sending valuable documents to records management. Then there will be a second stage for performing the site disposition steps triggered by the confirmation.&lt;br /&gt;
&lt;br /&gt;
You can also implement custom information management policy &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.recordsmanagement.policyfeatures.iexpirationformula.aspx"&gt;expiration formula&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.recordsmanagement.policyfeatures.iexpirationaction.aspx"&gt;expiration action&lt;/a&gt; for use when configuring your retention policy. You typically do this when your policy requires retention events that are not based on date fields only. See Sahil Malik's &lt;a href="http://blah.winsmarts.com/2008-10-Authoring_custom_expiration_policies_and_actions_in_SharePoint_2007.aspx"&gt;Authoring custom expiration policies and actions in SharePoint 2007&lt;/a&gt; which is still valid for SharePoint 2010.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-RXEC1rxxxug/TcVxJOnn6yI/AAAAAAAAAWE/aWPadSfBTxs/s1600/SP2010_information_management_site_disposition.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="323" src="http://3.bp.blogspot.com/-RXEC1rxxxug/TcVxJOnn6yI/AAAAAAAAAWE/aWPadSfBTxs/s400/SP2010_information_management_site_disposition.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Use a &lt;b&gt;custom workflow&lt;/b&gt; or &lt;b&gt;custom expiration action&lt;/b&gt; to implement the site disposition steps: user removal, automated content clean-up and archiving, and finally trigger deletion of the site. If the site is automatically deleted by a custom workflow, or marked for deletion to be processed by a custom timer job, or a custom action just sends an e-mail to the site-admin, is up to your SLM policy.&lt;br /&gt;
&lt;br /&gt;
If you need to keep the site in a passive state for e.g. 6 months before deleting it, you can use a&amp;nbsp;delegate control in your site master pages to prevent access to passive sites or you can move the site to an archive web-app that use a "deny write" / "deny all" access policy to prevent access. Note that the former is not real security, just content targeting for the site. The latter is real security, as "deny" web-app policies overrides site specific access rights granted to SharePoint groups and users. This allows for keeping the site users and groups "as-is" in case the site can be reactivated again according to your SLM policies. If site owners can do housekeeping on a site while passive, then grant them access by creating extra "steward" accounts that are not subject to being denied access.&lt;br /&gt;
&lt;br /&gt;
I recommend removing all users from the default&amp;nbsp;&lt;a href="http://sharepointmagazine.net/articles/administrator/best-practices-for-sharepoint-groups"&gt;site members group&lt;/a&gt; before deleting the site, otherwise the site will not be deleted from the &lt;a href="http://blogs.msdn.com/b/spses/archive/2011/02/05/social-computing-part-4-colleagues-membership-and-more.aspx"&gt;site memberships&lt;/a&gt; list in the user's my site.&lt;br /&gt;
&lt;br /&gt;
The astute reader may wonder how the content type retention policy knows if the site is actually in use. The answer is quite simple; each SPWeb object provides a &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LastItemModifiedDate&lt;/span&gt; property. This timestamp is also stored in the &lt;a href="http://pbs2010.codeplex.com/"&gt;SharePoint property bag&lt;/a&gt;. Use a delegate control in your site's master page to check and push the timestamp to a date-time field the SiteInfo item, so that the rentention policy can trigger on it. Remember to use &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SystemUpdate&lt;/span&gt; when updating the SiteInfo, otherwise you will change the site's&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LastItemModifiedDate&lt;/span&gt;&amp;nbsp;to now. You can also use a custom expiration formula that inspects the last modified timestamp for the site when the &lt;a href="http://technet.microsoft.com/en-us/library/cc678870.aspx"&gt;information management policy timer job&lt;/a&gt; runs.&lt;br /&gt;
&lt;br /&gt;
We also use the site information content type in our Puzzlepart projects to provide a search-driven site directory. It is quite simple to make a nicely categorized and searchable site catalog by simply using one or more&amp;nbsp;&lt;a href="http://www.zimmergren.net/archive/2008/03/15/moss-2007-customize-the-search-result-using-xslt-part-3-customize-using-sharepoint-designer-2007.aspx"&gt;customized the search results&lt;/a&gt; web-parts. This search-driven catalog can of course be sorted by the search result 'write'  managed property, which must be mapped to the crawled property field  that contains the LastItemModifiedDate of a site.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-EeYNZO4IMN4/TceWNLIlrtI/AAAAAAAAAWI/h62UA7EzrB8/s1600/Search_Driven_SharePoint_Site_Directory.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="172" src="http://2.bp.blogspot.com/-EeYNZO4IMN4/TceWNLIlrtI/AAAAAAAAAWI/h62UA7EzrB8/s320/Search_Driven_SharePoint_Site_Directory.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Using a &lt;a href="http://kjellsj.blogspot.com/2010/08/my-tasks-web-part-search-driven-cross.html"&gt;search-driven approach&lt;/a&gt; makes it unnecessary to have a classic site directory list. The site metadata is simply stored directly in a list within each site, managed by the respective site owners. This is more likely to keep the site metadata up-to-date rather than going stale in a central site directory list that no one maintains.&lt;br /&gt;
&lt;br /&gt;
I hope this post have given you some new ideas on how to store, manage and use site metadata both for site lifecycle management and for providing a relevant search-driven site directory.&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/11096258-9215547244882883193?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/paBt2rEeIiQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/9215547244882883193/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=9215547244882883193" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/9215547244882883193?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/9215547244882883193?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/paBt2rEeIiQ/sharepoint-site-lifecycle-management.html" title="Site Lifecycle Management using Retention Policies" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-_-LwqA6NK7o/TcVwNOsSW9I/AAAAAAAAAWA/8KUm_YXjtDA/s72-c/SP2010_information_management_retention.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/05/sharepoint-site-lifecycle-management.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYESXc4fip7ImA9WhZXEks.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-3723730767773055960</id><published>2011-04-29T09:05:00.011+02:00</published><updated>2011-05-01T17:01:48.936+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-01T17:01:48.936+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SqlServer" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="SecureStoreService" /><category scheme="http://www.blogger.com/atom/ns#" term="BCS" /><title>Using SP2010 BCS Resource Files for BDC Model Settings</title><content type="html">You've probably seen way too many Business Connectivity Services (BCS) demos using SharePoint Designer (SPD), showing how simple it is to connect to a SQL Server 2008 database and automagically create external content types and operations, with external lists that can be used both to display and update external data.&lt;br /&gt;
&lt;br /&gt;
Have you ever wondered how to manage those data source connection settings across multiple SharePoint 2010 farms? How do you change the SQL Server name and other login information when deploying to your test and staging farm, and then to your production farm without using SPD again? Even good BCS books such as &lt;a href="http://www.amazon.com/Professional-Business-Connectivity-SharePoint-Programmer/dp/047061790X"&gt;Professional Business Connectivity Services in SharePoint 2010&lt;/a&gt; have very little coverage of BCS external system settings in Central Admin and of how to actually use BDC resource files. There is a nice end-to-end overview in the &lt;a href="http://msdn.microsoft.com/en-us/library/gg650431.aspx"&gt;Migrating Business Connectivity Services External Content Types in SharePoint 2010&lt;/a&gt; article on MSDN, also lacking some of these details.&lt;br /&gt;
&lt;br /&gt;
Data source connection settings are stored as External System properties that can be configured from Central Admin by managing the BDC service application. This can be a bit confusing, as you might run into the "there are no configurable properties" message when trying to manage Settings for an External System. The trick is to remember that these settings are not for the external system per se, but for a specific external system instance aka connection. Chose the External Systems view in the ribbon, click the link of the applicable external system to see the instances, then select the instance and finally click Settings in the ribbon. Change the connection properties and click OK.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kXTfjkI7I9s/Tblr4xZhBxI/AAAAAAAAAVk/-cB3Otc4Tuk/s1600/BCS_external_system_instance_settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="191" src="http://3.bp.blogspot.com/-kXTfjkI7I9s/Tblr4xZhBxI/AAAAAAAAAVk/-cB3Otc4Tuk/s400/BCS_external_system_instance_settings.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In the example data connection I've used the Secure Store Service (SSS) application for the login information because the target database requires SQL Server authentication instead of passthrough integrated Windows authentication.&lt;br /&gt;
&lt;br /&gt;
Instead of manually changing these External System settings whenever deploying a new version across your development, testing, staging and production farms, you can use &lt;a href="http://msdn.microsoft.com/library/aa674515.aspx"&gt;BDC resource files&lt;/a&gt; to apply the settings. This is done by exporting and importing resource files, either using Central Admin, code or Powershell.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-vguHu0NEfzA/TblyH12vKZI/AAAAAAAAAVo/If64EuH6RYM/s1600/BCS_export_import_settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="161" src="http://3.bp.blogspot.com/-vguHu0NEfzA/TblyH12vKZI/AAAAAAAAAVo/If64EuH6RYM/s400/BCS_export_import_settings.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Prototype and test your BCS solution on your development farm first, then package your solution into a feature as explained in &lt;a href="http://msdn.microsoft.com/en-us/library/ff798309.aspx"&gt;How to: Deploy a Declarative BDC Model with a Feature&lt;/a&gt; on MSDN.  Remember to change the model name and external system name, including the  entity namespace into durable names, or at least change the entity  version, from your SPD prototype when packing your BDC model.&lt;br /&gt;
&lt;br /&gt;
The declarative BDC model is really just some XML stored in a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;BDCM &lt;/span&gt;file. In addition to the BDC model file, SharePoint 2010 also supports  using &lt;a href="http://msdn.microsoft.com/library/aa674515.aspx"&gt;BDC resource files&lt;/a&gt; for specific metadata elements that commonly  change, such as SQL Server connection configuration. A resource file is really just some XML stored in a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;BDCR &lt;/span&gt;file, that can be merged with the stored model without deleting the existing model and its configuration from the BCS metadata store.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-L7sbXhKXD78/TblzySV_pEI/AAAAAAAAAVs/8ApxL_Aysbg/s1600/BCS_resource_file.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" src="http://3.bp.blogspot.com/-L7sbXhKXD78/TblzySV_pEI/AAAAAAAAAVs/8ApxL_Aysbg/s400/BCS_resource_file.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The simplest way to get a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;BDCR &lt;/span&gt;file to start with, is to export the BDC resources using Central Admin.  Chose the BDC Models view in the ribbon, then select the applicable model and finally click Export in the ribbon. Set the file type to Resource and select which resources to include in the exported &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;BDCR &lt;/span&gt;file, typically properties, and click Export to save the selected set of resources.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ttgnwS_1Y0Y/TbpcNMn9VYI/AAAAAAAAAVw/K6bW4gruV3g/s1600/BCS_export_resources.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="222" src="http://1.bp.blogspot.com/-ttgnwS_1Y0Y/TbpcNMn9VYI/AAAAAAAAAVw/K6bW4gruV3g/s400/BCS_export_resources.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Edit the the &lt;a href="http://msdn.microsoft.com/library/aa674515.aspx"&gt;resource XML&lt;/a&gt; to change e.g. the name of the SQL Server (RdbConnection Data Source) and save your changes, using one file per BDC model and target farm. Only the XML for settings that should be updated when applying the resource file need be in the file.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-IujFb1w7bk4/TbplqL74LaI/AAAAAAAAAV4/IcfQOBrcj7s/s1600/BCS_resource_file_edited.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="181" src="http://1.bp.blogspot.com/-IujFb1w7bk4/TbplqL74LaI/AAAAAAAAAV4/IcfQOBrcj7s/s400/BCS_resource_file_edited.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The edited BDC resource file can now be applied to the applicable BDC model in one of your farms, typically when deploying a new version of a model to the staging or production farm. Chose the BDC Models view in the ribbon, then select the applicable  model and finally click Import in the ribbon. Click Browse to select the applicable resource file and set the file type to  Resource. Then select which resources to import from &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;BDCR &lt;/span&gt;file, typically properties, and click Import to load the selected set of resources.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-kh-Xkwiy2nQ/TbphWskOMmI/AAAAAAAAAV0/_gBLXNDY1es/s1600/BCS_import_resource_file.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="257" src="http://2.bp.blogspot.com/-kh-Xkwiy2nQ/TbphWskOMmI/AAAAAAAAAV0/_gBLXNDY1es/s400/BCS_import_resource_file.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Validate that the correct settings were imported by reviewing the import log warnings, and by reviewing e.g. the settings for your external system instance or the permissions for the BDC model and its external content types.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-pZNQrnz6ZHU/Tbpl9i2WmbI/AAAAAAAAAV8/5CMH4gWS_Ac/s1600/BCS_imported_resource_file.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="156" src="http://3.bp.blogspot.com/-pZNQrnz6ZHU/Tbpl9i2WmbI/AAAAAAAAAV8/5CMH4gWS_Ac/s400/BCS_imported_resource_file.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
See &lt;a href="http://msdn.microsoft.com/en-us/library/ee231564.aspx"&gt;How to: Use a Resource File to Specify Localized Names, Properties, and Permissions&lt;/a&gt; on MSDN to include an edited BDC resource file in a feature in your Visual Studio 2010 package. Note that BDC models created with SPD cannot be exported from CA as they are not complete. Such declarative BDC models must be exported from SPD.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-3723730767773055960?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/-GW0i3mPO30" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/3723730767773055960/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=3723730767773055960" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/3723730767773055960?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/3723730767773055960?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/-GW0i3mPO30/bcs-resource-files-data-source.html" title="Using SP2010 BCS Resource Files for BDC Model Settings" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-kXTfjkI7I9s/Tblr4xZhBxI/AAAAAAAAAVk/-cB3Otc4Tuk/s72-c/BCS_external_system_instance_settings.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/04/bcs-resource-files-data-source.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcARH87fyp7ImA9WhZXF0U.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-1878603767772168027</id><published>2011-04-28T09:24:00.006+02:00</published><updated>2011-05-07T17:44:05.107+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-07T17:44:05.107+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SqlServer" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="BCS" /><category scheme="http://www.blogger.com/atom/ns#" term="SearchDriven" /><title>Using Dynamic Stored Procedures in BCS Finders</title><content type="html">We use quite a lot of Business Connectivity Services (BCS) at my current SharePoint 2010 project both for traditional integration of data from external systems into web-parts and lists, and also for crawling external systems for integrating those system using search and search-driven web-parts.&lt;br /&gt;
&lt;br /&gt;
One of our integration partners prefers to provide their integration points as SQL Server 2008 stored procedures, which is very well supported by BCS. BCS supports both stored procedures and table valued functions, called "routines" in SharePoint Designer (SPD). SharePoint Designer is dependent on being able to extract metadata about the returned table data set when adding External Content Type (ECT) operations or when using the Operations Design View.&lt;br /&gt;
&lt;br /&gt;
Alas, the provided integration sprocs used dynamic SQL statements, and for technical reasons this could not be rewritten to inline SQL select statements. This is as always a problem with tooling such as SPD, as no result set metadata can be discovered. When connecting SPD to the external system, I got no fields in the Data  Source Elements panel in the Read List operation's Return Parameter  Configuration. Rather I got three errors and a warning.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-iiSyyEHJssM/TbkQyiUnSLI/AAAAAAAAAVc/4PX88KohhC4/s1600/BCS_untyped_resultset.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://2.bp.blogspot.com/-iiSyyEHJssM/TbkQyiUnSLI/AAAAAAAAAVc/4PX88KohhC4/s400/BCS_untyped_resultset.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The workaround is quite simple and requires the use of a SQL Server table variable, which defines the result set and allows SPD to discover the table metadata. Rewrite the stored procedure by declaring a table variable, insert the result of the dynamic SQL statement into the variable, and finally return the result set by reading the table variable. The changes to the sproc is shown in blue in this example:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;CREATE PROCEDURE [dbo].[GetFavorites] &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;AS&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;SET NOCOUNT ON;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;DECLARE @DbName AS NVARCHAR(max) = 'ARISModellering1'&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;DECLARE @ObjDef  AS NVARCHAR(max) = dbo.GetArisTableName(@DbName, 'ObjDef')&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;DECLARE @Model  AS NVARCHAR(max) = dbo.GetArisTableName(@DbName, 'Model')&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;DECLARE  @FavoriteSQL  AS NVARCHAR(max) = N'&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;SELECT&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;ARISBPDATA.BOOKMARKS.ID AS FavoriteId&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;, ARISBPDATA.BOOKMARKS.DESCRIPTION AS FavoriteName&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;, ModelType.ModelTypeName AS FavoriteType&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;, LOWER(ARISBPDATA.BOOKMARKS.USERNAME) AS UserName&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;, ''http://puzzlepart/index.jsp?ExportName=ARISModellering&amp;amp;modelGUID='' + ARISBPDATA.BOOKMARKS.DATAKEY AS FavoriteUrl&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;FROM&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;ARISBPDATA.BOOKMARKS&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;INNER JOIN ' + @Model + ' m ON ARISBPDATA.BOOKMARKS.OBJID = m.Id&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;INNER JOIN ModelType ON m.TypeNum = ModelType.ModelTypeId&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;'&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;DECLARE @userFavs TABLE(FavoriteId int not null, FavoriteName nvarchar(max), FavoriteType nvarchar(max), UserName nvarchar(max), FavoriteUrl nvarchar(max))&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;b&gt;&lt;span style="color: blue;"&gt;insert @userFavs &lt;/span&gt;&lt;/b&gt;EXEC  sp_executeSQL @FavoriteSQL&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;b&gt;&lt;span style="font-size: x-small;"&gt;select * from @userFavs&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;END&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Refreshing the external system data connection and then creating the ECT read list operation now works fine, and all the return type errors and warnings are gone.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-dFZwNbPkp7k/TbkWHJ0VE0I/AAAAAAAAAVg/IYzj4tMvFXE/s1600/BCS_typed_resultset.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="215" src="http://2.bp.blogspot.com/-dFZwNbPkp7k/TbkWHJ0VE0I/AAAAAAAAAVg/IYzj4tMvFXE/s400/BCS_typed_resultset.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Note that the classic #temp table workaround won't work with SPD, you have to use a table variable in your stored procedure. The sproc will now use more memory, so the BCS best practice for keeping finder result sets small applies.&lt;br /&gt;
&lt;br /&gt;
The table_variable declaration is also a good place to make sure that the identifier column is "not null" and that it is a supported BCS data type such as "int32". External lists cannot be created from an ECT whose identifier field is unsupported, such as SQL Server "bigint", and I strongly recommend using a supported identifier data type right from the start. Getting the ECT identifier wrong in the BCS model will give you problems later on when using SharePoint Designer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-1878603767772168027?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/qoEw9C6NkQI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/1878603767772168027/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=1878603767772168027" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/1878603767772168027?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/1878603767772168027?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/qoEw9C6NkQI/stored-procedures-in-bcs-sharepoint.html" title="Using Dynamic Stored Procedures in BCS Finders" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-iiSyyEHJssM/TbkQyiUnSLI/AAAAAAAAAVc/4PX88KohhC4/s72-c/BCS_untyped_resultset.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/04/stored-procedures-in-bcs-sharepoint.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4MRn0yeyp7ImA9WhZXEEU.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-7937137525653552822</id><published>2011-04-20T15:09:00.000+02:00</published><updated>2011-04-29T16:23:07.393+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-29T16:23:07.393+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="BCS" /><title>BCS External Lists causes SharePoint 0x80131600 exception for SPSiteDataQuery</title><content type="html">Issue: Your SharePoint 2010 code use the SPSiteDataQuery or CrossListQuery and get an exception with code &amp;lt;nativehr&amp;gt; 0x80131600 and absolutely no other helpful details.&lt;br /&gt;
&lt;br /&gt;
Cause: External list referencing an external content type that has been deleted from the BDC metadata store.&lt;br /&gt;
&lt;br /&gt;
Solution: Delete the applicable external lists from your sites - or recover the deleted external content type.&lt;br /&gt;
&lt;br /&gt;
A related error code is code 0x8102003 which is caused by missing list definitions in activated features.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-7937137525653552822?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/xCGFiqjMJGo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/7937137525653552822/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=7937137525653552822" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7937137525653552822?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7937137525653552822?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/xCGFiqjMJGo/sharepoint-0x80131600-spsitedataquery.html" title="BCS External Lists causes SharePoint 0x80131600 exception for SPSiteDataQuery" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/04/sharepoint-0x80131600-spsitedataquery.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8DRHk4eCp7ImA9WhZSFkk.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-7686732208977028312</id><published>2011-04-01T09:34:00.006+02:00</published><updated>2011-04-01T10:01:15.730+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-01T10:01:15.730+02:00</app:edited><title>Installing SharePoint SPSF on Visual Studio 2010 SP1</title><content type="html">In preparing for the 2011 &lt;a href="http://www.arcticsharepointchallenge.com/"&gt;Arctic SharePoint Challenge&lt;/a&gt; next week with my awesome &lt;a href="http://www.puzzlepart.com/"&gt;Puzzlepart&lt;/a&gt; team, we're installing the &lt;a href="http://spsf.codeplex.com/"&gt;SharePoint Software Factory&lt;/a&gt; (SPSF) tooling available at CodePlex. There is a nice prerequisite installer that helps you download and install the Guidance Automation Extensions and Toolkit, but it would not install the guidance packages properly on my Visual Studio 2010 SP1.&lt;br /&gt;
&lt;br /&gt;
Installing GAT2010.vsix failed with missing "Visual Studio 2010 SDK", so I downloaded that and got the "you must have Visual Studio 2010 installed" error instead. As it turns out, you will of course need "Visual Studio 2010 SP1 SDK" (&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=21307C23-F0FF-4EF2-A0A4-DCA54DDB1E21"&gt;download&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-oagAJ859Y9c/TZV_emwropI/AAAAAAAAAVU/UkubkSm-mmM/s1600/SharePoint+SPSF+in+Visual+Studio+2010+SP1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="205" src="http://3.bp.blogspot.com/-oagAJ859Y9c/TZV_emwropI/AAAAAAAAAVU/UkubkSm-mmM/s400/SharePoint+SPSF+in+Visual+Studio+2010+SP1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Now I've got the SPSF project types in the Guidance Packages section of File &amp;gt; New Project and are ready for &lt;a href="http://twitter.com/#%21/search/%23asc2011"&gt;#ASC2011&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-7686732208977028312?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/wL9bGtCG0Es" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/7686732208977028312/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=7686732208977028312" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7686732208977028312?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/7686732208977028312?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/wL9bGtCG0Es/installing-sharepoint-software-factory.html" title="Installing SharePoint SPSF on Visual Studio 2010 SP1" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-oagAJ859Y9c/TZV_emwropI/AAAAAAAAAVU/UkubkSm-mmM/s72-c/SharePoint+SPSF+in+Visual+Studio+2010+SP1.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/04/installing-sharepoint-software-factory.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkENQX48fyp7ImA9WhZTEkw.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-916229522132188136</id><published>2011-03-15T15:28:00.006+01:00</published><updated>2011-03-15T20:51:30.077+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-15T20:51:30.077+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ActivityFeed" /><category scheme="http://www.blogger.com/atom/ns#" term="WebPart" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="MySite" /><title>SharePoint News Feed Formatting of ActivityEvent</title><content type="html">It is quite easy the get the news feed for activities from your colleagues and for your interests and skills in SharePoint 2010. It is not, however, that simple to format each event to display them in your own web-part using the activity feed object model.&lt;br /&gt;
&lt;br /&gt;
Sure, the data of the different activity types are all there in the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;ActivityEvent&lt;/span&gt; object, and you can get the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;ActivityTemplate&lt;/span&gt; based on the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;ActivityType&lt;/span&gt; of the event. But then you need to process the display template tags to merge in the event values or the event XML from &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;TemplateVariable&lt;/span&gt; string property using the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SimpleTemplateFormat&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;ActivityTemplateVariable&lt;/span&gt; classes. See the &lt;a href="http://statto1974.wordpress.com/2011/03/14/fun-and-games-with-the-activityevent/"&gt;Fun and Games with the ActivityEvent&lt;/a&gt; post by Toby Statham to get you started.&lt;br /&gt;
&lt;br /&gt;
Luckily, the activity feed is based on the web syndication model, so you can simply create a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;SyndicationItem&lt;/span&gt; object based on the activity event, and it will find and process the activity template for you:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private Panel CreateFeedEventPanel(ActivityEvent activity)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Panel panel = new Panel()&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CssClass = "MyProfileActivityFeedEventPanel"&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //access the LinkList property in order to populate the ActivityEvent&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;Link&amp;gt; temp = activity.LinksList;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string picture = activity.Publisher.Picture;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; picture = string.IsNullOrEmpty(picture) ? "/_layouts/images/O14_person_placeHolder_32.png" : picture;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Image publisherImage = new Image()&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageUrl = picture,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AlternateText = activity.Publisher.Name,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CssClass = "MyProfileActivityFeedEventPublisher"&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; panel.Controls.Add(publisherImage);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SyndicationItem syndicationItem = activity.CreateSyndicationItem(_activityManager.ActivityTypes, ContentType.Html);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; panel.Controls.Add(new LiteralControl() { Text = syndicationItem.Summary.Text });&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return panel;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void PopulateNewsFeedActivityList(bool useTodayOnly)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string url = SPContext.Current.Site.Url;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (SPSite site = new SPSite(url))&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPServiceContext context = SPServiceContext.GetContext(site);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserProfileManager profileManager = new UserProfileManager(context);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPUser user = SPContext.Current.Web.CurrentUser;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserProfile userProfile = profileManager.GetUserProfile(user.LoginName);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _activityManager = new ActivityManager(userProfile, context);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (useTodayOnly)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime todayFilter = DateTime.Now.Date;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _activityList = _activityManager.GetActivitiesForMe(todayFilter);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _activityList = _activityManager.GetActivitiesForMe(MaxItems);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The formatted HTML will be the same as rendered by the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;NewsFeedWebPartBase&lt;/span&gt; class, except for the profile picture size and some missing timestamps for some event types. Use Reflector on the&amp;nbsp;news feed web-part&amp;nbsp;base&amp;nbsp;class to see the code for mitigating&amp;nbsp;such details.&lt;br /&gt;
&lt;br /&gt;
The code for &lt;a href="http://msdn.microsoft.com/en-us/library/ff426883.aspx"&gt;getting activity events for a user&lt;/a&gt; and other SharePoint 2010 social computing "how-tos" can be found&amp;nbsp;in the&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/ee557271.aspx"&gt;User Profiles and Social Data&lt;/a&gt; section at MSDN.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-916229522132188136?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/fFTrQUDZ0lk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/916229522132188136/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=916229522132188136" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/916229522132188136?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/916229522132188136?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/fFTrQUDZ0lk/sharepoint-news-feed-formatting-of.html" title="SharePoint News Feed Formatting of ActivityEvent" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/03/sharepoint-news-feed-formatting-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IDQ304fip7ImA9WhdVF0Q.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-4540995551706050805</id><published>2011-02-23T14:03:00.004+01:00</published><updated>2011-09-23T19:39:32.336+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-23T19:39:32.336+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><title>Help Content Cannot Be Displayed in SharePoint 2010</title><content type="html">Today we had a weird error on our SharePoint 2010 production farm: clicking on help got the "help content cannot be displayed" error for all normal sites, even though it worked perfectly well in Central Admin. The same applied to Site Settings&amp;gt;Help Settings for the site-collection, it worked in Central Admin, but not in any other site. In addition, the 'SharePoint Foundation Search' service was running on one WFE server.&lt;br /&gt;
&lt;br /&gt;
First I checked all settings in &lt;a href="http://support.microsoft.com/kb/939313"&gt;KB939313&lt;/a&gt; without that fixing the problem, then I checked the log files and found this access denied error for our site's app-pool account:&lt;br /&gt;
&lt;br /&gt;
&lt;span lang="EN-US" style="font-family: Calibri, sans-serif; font-size: 11pt;"&gt;SqlError: 'The EXECUTE permission was denied on the object 'proc_EnumResourcesAtScope', database 'SharePoint_AdminContent_ABBAef34-7603-4da5-823a-43ee1327ABBA', schema 'dbo'.'&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Before embarking on changing any database rights, we decided to test with an English site just in case, as all our custom site definitions are in Norwegian. Lo and behold - help worked for the new team-site; and what's more, suddenly help was working for all our existing Norwegian LCID 1044 sites also. Go figure...&lt;br /&gt;
&lt;br /&gt;
[UPDATE] See the comments for tips on granting execute rights on the sprocs listed in the ULS to fix this problem once and for all - even beyond IISRESET.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-4540995551706050805?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/1iSCtC6xLpo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/4540995551706050805/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=4540995551706050805" title="11 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/4540995551706050805?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/4540995551706050805?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/1iSCtC6xLpo/help-content-cannot-be-displayed-in.html" title="Help Content Cannot Be Displayed in SharePoint 2010" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>11</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/02/help-content-cannot-be-displayed-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUCQ346fip7ImA9WhZWGE8.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-2253815964311158370</id><published>2011-02-21T10:28:00.005+01:00</published><updated>2011-05-19T17:51:02.016+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-19T17:51:02.016+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Taxonomy" /><category scheme="http://www.blogger.com/atom/ns#" term="TermStore" /><category scheme="http://www.blogger.com/atom/ns#" term="ManagedMetadataService" /><title>Starting Term Store Management in SharePoint 2010</title><content type="html">If you can't get any edit or management popup menus such as add term store term group to show in the SharePoint 2010 Managed Metadata Service application Term Store Management Tool, check that:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Internet Explorer is started with "Run as administrator"&lt;/li&gt;
&lt;li&gt;You have added your taxonomy managers to the "Term Store Administrators" for the MMS root node&lt;/li&gt;
&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-7C0miVvJ5YY/TWIwFtkT1oI/AAAAAAAAAVE/TiUpDgs2WLI/s1600/SP2010+Term+Store+Management.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="166" src="http://3.bp.blogspot.com/-7C0miVvJ5YY/TWIwFtkT1oI/AAAAAAAAAVE/TiUpDgs2WLI/s320/SP2010+Term+Store+Management.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
This is required even if you are an administrator of the MMS application itself and you have full control MMS connection permissions.&lt;br /&gt;
&lt;br /&gt;
So then&amp;nbsp;you're ready&amp;nbsp;to realize your ingenious &lt;a href="http://www.amazon.com/Organising-Knowledge-Taxonomies-Organisational-Effectiveness/dp/1843342286/"&gt;taxonomy for classifying and organizing your knowledge&lt;/a&gt; with managed metadata and content types.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-2253815964311158370?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/yjrRbYk69wc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/2253815964311158370/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=2253815964311158370" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/2253815964311158370?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/2253815964311158370?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/yjrRbYk69wc/term-store-management-in-sharepoint.html" title="Starting Term Store Management in SharePoint 2010" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-7C0miVvJ5YY/TWIwFtkT1oI/AAAAAAAAAVE/TiUpDgs2WLI/s72-c/SP2010+Term+Store+Management.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/02/term-store-management-in-sharepoint.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEMSH0-eyp7ImA9Wx9WEEw.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-513791595475423043</id><published>2011-01-14T15:32:00.002+01:00</published><updated>2011-01-14T16:08:09.353+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-14T16:08:09.353+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASC2011" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><title>Arctic SharePoint Challenge 2011</title><content type="html">The lynx is out of the bag: Get down with Arctic SharePoint Challenge at &lt;a href="http://pzl.no/asc2011"&gt;http://pzl.no/asc2011&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://weblogs.asp.net/blogs/mnissen/ASC2011-Logo-800WEB.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="156" src="http://weblogs.asp.net/blogs/mnissen/ASC2011-Logo-800WEB.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Twitter: &lt;a href="http://twitter.com/SPChallenge"&gt;@spchallenge&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-513791595475423043?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/IVNLYa9X6rE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/513791595475423043/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=513791595475423043" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/513791595475423043?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/513791595475423043?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/IVNLYa9X6rE/arctic-sharepoint-challenge-2011.html" title="Arctic SharePoint Challenge 2011" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2011/01/arctic-sharepoint-challenge-2011.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMBSHY_eyp7ImA9Wx9SGUU.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-9011181136521020714</id><published>2010-12-10T11:03:00.007+01:00</published><updated>2010-12-10T14:40:59.843+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-10T14:40:59.843+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WebPart" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><title>Content Link Web Part for SharePoint</title><content type="html">The Puzzlepart &lt;a href="http://contentlinkwebpart.codeplex.com/"&gt;Content Link web-part&lt;/a&gt; works like the Content Editor web-part in ContentLink mode,  but does not require you to configure anonymous access on source  web-applications for cross site-collection linked content URLs. ContentLink is useful for showing common content stored in a central document  library for use across other site-collections and sites.&lt;br /&gt;
&lt;br /&gt;
Use the ContentLink property to set a server relative or absolute URL of the linked content to show. The user must of course have at least read-access to the document library where the linked content is stored. Note that the web-part is not suitable for solution gallery/sandboxed deployment  due to the use of web request.&lt;br /&gt;
&lt;br /&gt;
The web-part will work for  retrieving linked content from other web-applications and site-collections even  if anonymous access is not turned on. It also works when anonymous access is  turned on, when the anonymous web-application policy is "no policy", "deny  write" or "deny all". The code use the default credentials of the user when making the web  request.&lt;br /&gt;
&lt;br /&gt;
Download the &lt;a href="http://contentlinkwebpart.codeplex.com/releases/"&gt;WSP package&lt;/a&gt; or just the C# source for the  web-part under &lt;a href="http://contentlinkwebpart.codeplex.com/SourceControl/list/changesets"&gt;Source Code&lt;/a&gt; at  CodePlex.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-9011181136521020714?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/cF7xxPPO918" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/9011181136521020714/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=9011181136521020714" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/9011181136521020714?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/9011181136521020714?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/cF7xxPPO918/content-link-web-part-for-sharepoint.html" title="Content Link Web Part for SharePoint" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2010/12/content-link-web-part-for-sharepoint.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cGRXcyfSp7ImA9Wx9TFUQ.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-1243806403241813517</id><published>2010-11-22T09:15:00.010+01:00</published><updated>2010-11-24T11:37:04.995+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-24T11:37:04.995+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="UserProfile" /><title>Managing Memberships, Colleagues and Links for Other SharePoint User Profiles</title><content type="html">Programming the SharePoint 2010 UserProfileManager, ColleagueManager, QuickLinkManager  and MembershipManager seems simple enough, until you try to manage these profile aspects for other users. There are several quirks that when forgotten throws an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;UnauthorizedAccessException&lt;/span&gt; with the message "&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;This operation requires you to be managing your own data or have administrator privileges&lt;/span&gt;".&lt;br /&gt;
&lt;br /&gt;
Note that using the well known &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;RunWithElevatedPrivileges&lt;/span&gt; is not sufficient to read the profile data of other users. To be able to do that, your &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;UserProfileManager&lt;/span&gt; code must either run as a user profile manager, or be configured to respect the built-in privacy control using the &lt;a href="http://msdn.microsoft.com/en-us/library/ee576331.aspx"&gt;IgnoreUserPrivacy&lt;/a&gt; parameter. Note how the SDK is very vague on using true or ...hmm... true? &lt;br /&gt;
&lt;blockquote&gt;&lt;i&gt;When this parameter is true, administrators can load and access complete user records for any user profile objects. When this parameter is true, administrators work as regular users and can load only trimmed profile information based on the user profile’s privacy setting&lt;/i&gt;.&lt;/blockquote&gt;As it turns out, you must use &lt;a href="http://social.technet.microsoft.com/Forums/en/sharepoint2010programming/thread/506a7f7c-1a25-450b-a31e-d81810e5bef2"&gt;false to get the expected behavior&lt;/a&gt; to avoid getting the access denied exception as a normal user. Only accounts that are registered as User Profile service application (UPA) managers will have access to ignore user privacy. If your code use &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;IgnoreUserPrivacy = true&lt;/span&gt; and runs as an account that is not an UPA administrator, you will get this error:&lt;br /&gt;
&lt;blockquote&gt;&lt;i&gt;You must have manage user profiles administrator rights to use administrator mode.&lt;/i&gt;&lt;/blockquote&gt;&lt;br /&gt;
Set &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;IgnoreUserPrivacy&lt;/span&gt; to &lt;b&gt;false&lt;/b&gt; when creating the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;UserProfileManager&lt;/span&gt; object, as shown here:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #274e13;"&gt;//profile and membership internally use ValidateIsSelfOrAdmin, must use IgnoreUserPrivacy = false&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;string siteUrl = SPContext.Current.Site.Url;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;using (SPSite mySite = new SPSite(siteUrl))&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;SPServiceContext context = SPServiceContext.GetContext(mySite);&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;UserProfileManager profileManager = new UserProfileManager(context, false);&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;MySiteUtilities profileSiteInfo = new MySiteUtilities(Page);&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;UserProfile userProfile = profileManager.GetUserProfile(&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;profile&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;SiteInfo.CurrentProfileSiteAccountName);&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;MembershipManager memberManager = userProfile.Memberships;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;Membership[] membershipList = memberManager.GetItems(MembershipSortType.Alphabetical);&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;. . .&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #38761d;"&gt;//membership management code here&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;. . .&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
If you need to ignore the user privacy to filter memberships or access private profile properties, or manage user profiles in general, then you must be an UPA administrator or the code must &lt;a href="http://kjellsj.blogspot.com/2010/10/secure-store-service-create-site.html"&gt;implement Windows impersonation&lt;/a&gt; as the user profile manager ignores &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;RunWithElevatedPrivileges&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
Note that SharePoint site memberships are periodically processed by the "&lt;span id="ctl00_PlaceHolderMain_ctl00_LabelJobName"&gt;User Profile Service  Application Proxy - User Profile to SharePoint Full/Quick Synchronization&lt;/span&gt;" timer jobs, and that only direct account membership in a site's member SharePoint group will be registered in the user profile membership list. Having access to a site through an AD security group will not do, as SharePoint don't resolve AD group memberships.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-1243806403241813517?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/XXeBxymyGU0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/1243806403241813517/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=1243806403241813517" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/1243806403241813517?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/1243806403241813517?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/XXeBxymyGU0/managing-memberships-colleagues-and.html" title="Managing Memberships, Colleagues and Links for Other SharePoint User Profiles" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2010/11/managing-memberships-colleagues-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQAQ384eip7ImA9WhRVEkQ.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-2149435691256778210</id><published>2010-10-06T09:52:00.007+02:00</published><updated>2012-01-11T16:39:02.132+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-11T16:39:02.132+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Programming" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="SecureStoreService" /><title>Secure Store Service: Create Site-Collections avoiding UnauthorizedAccessException</title><content type="html">The MSDN forums is full of questions on how to create a new site-collection from code, especially on what permissions are required to avoid the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;UnauthorizedAccessException "Access is denied" HRESULT: 0x80070005&lt;/span&gt; error. Your code might work fine when running as you on your development server, and of course under the identity of the SharePoint farm account; but not when running under another application pool identity, or as a normal end-user or even as the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SHAREPOINT\System&lt;/span&gt; account in workflows or event receivers using &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SPSecurity.RunWithElevatedPrivileges&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
The simple answer is that &lt;a href="http://blog.falchionconsulting.com/index.php/2009/07/custom-sharepoint-2007-site-collection-creation-page/"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;CreateSite&lt;/span&gt; requires the same permissions as the SharePoint farm account&lt;/a&gt;. You certainly do not want to give all your end-users those permissions, so typically you would do a revert-to-self using &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;RunWithElevatedPrivileges&lt;/span&gt; and run the site provisioning code as your SharePoint web-application application pool identity. Alas, adding the app-pool identity to the farm administrator group, giving it "full control" and "run as system" in web-app &lt;a href="http://technet.microsoft.com/en-us/library/ff608071.aspx"&gt;User Permission Policy&lt;/a&gt;, adding it to server local groups such as &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;WSS_WPG&lt;/span&gt; or even to SQL Server &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;db_owner&lt;/span&gt; and &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;WSS_Content_Application_Pools&lt;/span&gt; database roles in the config and content databases, will not provide a configuration that works across all scenarios from web-parts to event receivers, workflows and integration tests.&lt;br /&gt;
&lt;br /&gt;
Always try to &lt;a href="http://technet.microsoft.com/en-us/library/ee513067.aspx"&gt;assign a managed service account for the SP web-app&lt;/a&gt; application pool identity using Central Admin first or run &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;GrantAccessToProcessIdentity&lt;/span&gt; in PowerShell. Still, getting access to the content database might not be enough for creating new site-collections, access to the configuration database is also needed for the process account.&lt;br /&gt;
&lt;br /&gt;
The simple solution to this problem is to run all SharePoint web-applications using the farm account. This is definitely not recommended, and the Central Admin Health Analyzer will report the "The server farm account should not be used for other services" error in the security category.&lt;br /&gt;
&lt;br /&gt;
A better alternative is to do a real &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;RevertToSelf&lt;/span&gt; using &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;WindowsImpersonationContext&lt;/span&gt; rather than the SharePoint &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;RunWithElevatedPrivileges&lt;/span&gt; abstraction. This will require that your code knows the login name and password of the farm account. It is not best practice to store these in clear text in your code or config files, so I recommend using the SharePoint 2010 &lt;a href="http://technet.microsoft.com/en-us/library/ee806866.aspx"&gt;Secure Store Service&lt;/a&gt; to provide the farm account credentials to your code. Here's the &lt;a href="http://support.microsoft.com/kb/306158"&gt;code to implement impersonation in ASP.NET&lt;/a&gt; and the &lt;a href="http://msdn.microsoft.com/en-us/library/ff394459.aspx"&gt;code to get credentials from the default secure store provider&lt;/a&gt; to get you started.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/_VhGcD5-4xdY/TKwpMgvpi2I/AAAAAAAAAU4/mWToAnaHbOo/s1600/SP2010_Secure_Store_Service.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="132" src="http://2.bp.blogspot.com/_VhGcD5-4xdY/TKwpMgvpi2I/AAAAAAAAAU4/mWToAnaHbOo/s400/SP2010_Secure_Store_Service.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Use a Secure Store target application of type "Group" to store the Windows credentials of the farm account. Add only the required app-pool identities as target application "Members" when setting the target application access permissions, and then use &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;RunWithElevatedPrivileges&lt;/span&gt; when retrieving the farm account credentials from the Secure Store Service.&lt;br /&gt;
&lt;br /&gt;
So the final solution is this: retrieve the farm account credentials in your code using the app-pool identity, impersonate the farm account using those credentials, and then &lt;a href="http://msdn.microsoft.com/en-us/library/ms411953.aspx"&gt;create a new site-collection&lt;/a&gt; from your code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that there are issues with claims and adding sites from code, at least in combination with FBA. The known workaround is to enable self-service site creation (SSSC) and use &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SelfServiceCreateSite&lt;/span&gt; from code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Need to provision lists, pages and other stuff to your new site? Check out the &lt;a href="http://spsiteconfigurator.codeplex.com/"&gt;SharePoint Site Configurator Feature&lt;/a&gt; over at CodePlex. Its a great resource for learning how to configure SharePoint sites.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-2149435691256778210?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/iv2PEfvnM3E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/2149435691256778210/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=2149435691256778210" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/2149435691256778210?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/2149435691256778210?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/iv2PEfvnM3E/secure-store-service-create-site.html" title="Secure Store Service: Create Site-Collections avoiding UnauthorizedAccessException" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_VhGcD5-4xdY/TKwpMgvpi2I/AAAAAAAAAU4/mWToAnaHbOo/s72-c/SP2010_Secure_Store_Service.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2010/10/secure-store-service-create-site.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIHRno4fip7ImA9Wx5WF00.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-1733766929594090939</id><published>2010-09-28T09:40:00.009+02:00</published><updated>2010-09-28T21:35:37.436+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-28T21:35:37.436+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Search" /><category scheme="http://www.blogger.com/atom/ns#" term="Customization" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><title>Customizing the Search Action Links in SharePoint 2010</title><content type="html">The SharePoint 2010 Search Action Links web-part is really just the Search Core Results web-part with the 'Show search results' settings set to false. Some of the action links have configurable captions such as the 'Show more results' link, while the 'Alert me' and 'RSS feed' link captions are not exposed in the web-part settings. However, it is quite easy to customize the layout, styling, links and content of the Search Action Links web-part - you can even add custom action links.&lt;br /&gt;
&lt;br /&gt;
This example shows a searchable site directory built from customized standard SharePoint 2010 search web-parts:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VhGcD5-4xdY/TKGVv4-Xt-I/AAAAAAAAAUw/siekI1w9XP4/s1600/SP2010_Search_Action_Links_WebPart.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="121" src="http://3.bp.blogspot.com/_VhGcD5-4xdY/TKGVv4-Xt-I/AAAAAAAAAUw/siekI1w9XP4/s400/SP2010_Search_Action_Links_WebPart.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Customizing the Search Action Links web-part is done exactly like for the Search Core Results web-part: you customize the embedded XSL or provide a custom XSL file using the hidden XslLink setting in the .webpart file. The following example shows how to customize the caption of the alerts and RSS links:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VhGcD5-4xdY/TKGaF6QOQ6I/AAAAAAAAAU0/l4SMmjQWqRY/s1600/SP2010_Search_RSS_Feed_Fix_XSL.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="608" src="http://3.bp.blogspot.com/_VhGcD5-4xdY/TKGaF6QOQ6I/AAAAAAAAAU0/l4SMmjQWqRY/s640/SP2010_Search_RSS_Feed_Fix_XSL.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The example XSL shows how to set an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;lt;xsl:variable&amp;gt;&lt;/span&gt; field based on different conditions using &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;lt;xsl:choose&amp;gt;&lt;/span&gt;. XSL don't have variables like in programming languages; they behave like C# const or read-only fields, they cannot be changed when first set.&lt;br /&gt;
&lt;br /&gt;
The example XSL also shows how to fix an error with the RSS feed link when using a 'Fixed query' in your search page, or when using a specific search 'Scope' and no user query keyword by default, to show all results from that scope. The RSS link do not pick up these settings from the web-part, and the query RSS feed will generate the "&lt;span style="font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;i&gt;Search RSS feed generation failed&lt;/i&gt;&lt;/span&gt;" error message. This error is caused by there being no keyword, which is fixed by adding a keyword to the URL using the k= querystring key. Just add the fixed query or the scope as the keyword:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/_layouts/srchrss.aspx?k=scope:"Puzzlepart"&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Note that the 'Alert me' link don't have the k= RSS feed issue, rather it uses JavaScript and the hidden &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;lt;input name="P_Query"&amp;gt;&lt;/span&gt; field on the page. This field is emitted by the Search Core Result web-part and contains the complete keyword query including the user query and the Scope, FixedQuery and AppendedQuery property settings.&lt;br /&gt;
&lt;br /&gt;
Add custom parameters to the XSL when you need to have extra web-part configuration options beyond the provided standard parameters. For example, to simulate the P_Query mechanism, pass the &lt;a href="http://msdn.microsoft.com/en-us/library/ee558911.aspx"&gt;query keywords&lt;/a&gt; as custom parameters. The example XSL shows how to use the custom parameter, along with the standard parameters. Use the 'Parameters Editor' in the web-part tool pane to configure your custom web-part setting:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;&amp;lt;ParameterBinding Name="AppendedFilter" Location="None" DefaultValue="scope:&amp;amp;qout;Puzzlepart&amp;amp;qout;" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Pass your configuration value using the DefaultValue attribute, using "None" as the Location. You can of course also set the 'alert me' and 'RSS feed' link captions using  parameters.&lt;br /&gt;
&lt;br /&gt;
I use code like this in a FeatureActivated event receiver to configure and add the customized web-part to our custom web part pages:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;b style="color: #20124d;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;private static void AddWebPartResultsActionLinks(SPLimitedWebPartManager lwpm, string title, string siteTemplate)&lt;/span&gt;&lt;/b&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;{&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string xslParams = "";&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!String.IsNullOrEmpty(siteTemplate))&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xslParams = String.Format("&lt;span style="color: purple;"&gt;&amp;lt;ParameterBinding Name='AppendedFilter' Location='None' DefaultValue='SiteInfoSiteTemplate:\"{0}\"' /&amp;gt;&lt;/span&gt;", siteTemplate);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CoreResultsWebPart ralwp = new CoreResultsWebPart()&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title = title,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ChromeType = PartChromeType.None,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QueryNumber = QueryId.Query1, &lt;span style="color: #38761d;"&gt;//must be UserQuery because user can search the SiteInfoScope&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ShowActionLinks = true,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ShowSearchResults = false, &lt;span style="color: #38761d;"&gt;//this makes it an "action links" web-part&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ShowWindowsSearch = false,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisplayRSSLink = true,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisplayAlertMeLink = true,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XslLink = "&lt;span style="color: purple;"&gt;/CenterPages/XSL/SearchActionLinks.xsl&lt;/span&gt;",&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ParameterBindings = xslParams,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UseLocationVisualization = false,&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ShowMessages = false&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lwpm.AddWebPart(ralwp, "MiddleRightZone", 1);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You can of course export the customized Search Action Links web-part and use &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;lt;AllUsersWebPart&amp;gt;&lt;/span&gt; in a file module to provision the web-part to a page, but the elements.xml file quickly gets huge and unmanageable. In addition, you'll have to encode any CDATA sections embedded in the exported web-part XML, as CDATA sections cannot be nested. That's why I recommend using XslLink rather than embedded XSL, and then code to provision the customized web-parts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-1733766929594090939?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/AEcCMUHdEcA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/1733766929594090939/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=1733766929594090939" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/1733766929594090939?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/1733766929594090939?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/AEcCMUHdEcA/customizing-search-action-links-in.html" title="Customizing the Search Action Links in SharePoint 2010" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_VhGcD5-4xdY/TKGVv4-Xt-I/AAAAAAAAAUw/siekI1w9XP4/s72-c/SP2010_Search_Action_Links_WebPart.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2010/09/customizing-search-action-links-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMNQ3s-eyp7ImA9WhRTFE4.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-3240298443396751953</id><published>2010-09-22T14:38:00.008+02:00</published><updated>2011-11-04T19:48:12.553+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-04T19:48:12.553+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Search" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="UserProfile" /><category scheme="http://www.blogger.com/atom/ns#" term="ManagedMetadataService" /><category scheme="http://www.blogger.com/atom/ns#" term="ServiceApplications" /><title>Missing "I Like It" in SharePoint 2010</title><content type="html">The social tagging capability in SharePoint 2010 takes several dependencies on different service applications: the Managed Metadata Service application (MMS) for storing and providing tag definitions, the User Profile Service application (UPA) for storing the actual tagging and notes, and the Search Service for several tag-based web-parts to show tagging information such as those on the tag profile page. The identity used to run your SharePoint 2010 solutions and the content crawler identity needs to have access to the service applications that manage and store your social tagging data.&lt;br /&gt;
&lt;br /&gt;
I recently added a new web-application to my development farm, and today to my surprise I noticed that the "I Like It" button in the global area was missing. In addition, the button was disabled in the item "Tags and Notes" ribbon.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/_VhGcD5-4xdY/TJntHLnmvLI/AAAAAAAAAUY/DcIKqtkeeNI/s1600/SharePoint_2010_Missing_Tagging.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="295" qx="true" src="http://2.bp.blogspot.com/_VhGcD5-4xdY/TJntHLnmvLI/AAAAAAAAAUY/DcIKqtkeeNI/s400/SharePoint_2010_Missing_Tagging.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The Tags &amp;amp; Notes buttons worked as expected in other sites in the farm, so the "Social Tags and Note Board Ribbon Controls" farm feature was activated, enabling these buttons for all sites in the farm.&lt;br /&gt;
&lt;br /&gt;
I first verified that I had the "Use Social Feaures" permissions in the User Profile Service application, and did some tagging in another SharePoint site in the farm, ruling out that this had something to do with my SharePoint user. So I knew it had to be something related to my newly added web-application identity, having had problems with the search-driven tag cloud and tag profile pages in the past.&lt;br /&gt;
&lt;br /&gt;
The solution is to grant the identity running the SharePoint web-applicaiton the correct connection permissions to the two service applications. My new web-application lacked permissions on the Managed Metadata Service application. Go to "Central Administration &amp;gt; Manage Service Applications", select the MMS application row in the list, and click "Permissions" in the ribbon to configure the connection permissions.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/_VhGcD5-4xdY/TJnxadazkkI/AAAAAAAAAUg/6GOtp3GAvDQ/s1600/SharePoint_2010_WebApp_Tagging_Permissions.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" qx="true" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/TJnxadazkkI/AAAAAAAAAUg/6GOtp3GAvDQ/s400/SharePoint_2010_WebApp_Tagging_Permissions.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Add the &lt;a href="http://technet.microsoft.com/en-us/library/ff724278.aspx"&gt;managed account&lt;/a&gt; used as the &lt;a href="http://technet.microsoft.com/en-us/library/ee662513.aspx"&gt;service account&lt;/a&gt; for the web-application, and assign it permissions to read and add new terms to the MMS term store. Write access&amp;nbsp;is required to allow users to apply tags never used before. Full access is not required. This will show and enable the "I Like It" button and the "Tags" tab in the popup dialog for&amp;nbsp;"Tags &amp;amp; Notes" as expected.&lt;br /&gt;
&lt;br /&gt;
Revoking the service application connection permissions for a web-application identity can be used to remove the social tagging and note board tools from contained sites. However, while the "I Like It" button is hidden when revoking access to MMS, the "Tags &amp;amp; Notes" button is not hidden when revoking access to UPA, rather a non-functional popup dialog is shown - not the best user experience. The following figure shows the effect of having access to MMS but not to UPA:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/_VhGcD5-4xdY/TJn6fkz6I0I/AAAAAAAAAUo/vUvIcAUscBw/s1600/SharePoint_2010_tagging_MMS_UPS_connection_permissions.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" qx="true" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/TJn6fkz6I0I/AAAAAAAAAUo/vUvIcAUscBw/s320/SharePoint_2010_tagging_MMS_UPS_connection_permissions.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
So, if there is something strange with the social tagging and related web-parts in your SharePoint 2010 solution, always make sure that web-applications identities and content crawler identity have applicable MMS and UPA service application connection permissions.&lt;br /&gt;
&lt;br /&gt;
If you use the Note Board web-part, and it suddenly stopped working by not showing any existing notes and you cannot even add new ones - and only the web-part title is shown, then make sure that your Search Service Application (SSA) indexing is crawling properly. This can happen after applying e.g. a cumulative update. Remember that you can always check if the tags and notes database is operational using the UPA.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-3240298443396751953?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/SyanHPDC8lY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/3240298443396751953/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=3240298443396751953" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/3240298443396751953?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/3240298443396751953?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/SyanHPDC8lY/missing-i-like-it-in-sharepoint-2010.html" title="Missing &quot;I Like It&quot; in SharePoint 2010" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_VhGcD5-4xdY/TJntHLnmvLI/AAAAAAAAAUY/DcIKqtkeeNI/s72-c/SharePoint_2010_Missing_Tagging.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2010/09/missing-i-like-it-in-sharepoint-2010.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8BQX8-fyp7ImA9WhZUGEs.&quot;"><id>tag:blogger.com,1999:blog-11096258.post-1902590392783902153</id><published>2010-08-27T13:08:00.019+02:00</published><updated>2011-06-12T10:20:50.157+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-12T10:20:50.157+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Search" /><category scheme="http://www.blogger.com/atom/ns#" term="Customization" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Configuration" /><category scheme="http://www.blogger.com/atom/ns#" term="SearchDriven" /><category scheme="http://www.blogger.com/atom/ns#" term="ServiceApplications" /><title>SharePoint 2010 My Tasks Web Part using Search Driven Cross-Site Query with Muenchian Grouping</title><content type="html">There always seems to be a requirement for rolling up data from all sites in one or more SharePoint solutions, such as getting a list of my tasks, a list of new documents this week, or creating a searchable news archive for publishing sites; or such as creating a site map or dynamic site directory based on metadata collected in your&amp;nbsp;site provisioning workflow, that are later maintained by site owners.&lt;br /&gt;
&lt;br /&gt;
SharePoint has several web-parts that can do cross-list and cross-subsite queries, such as the Content Query web-part, but all restricted to a single site-collection. In addition, there are the classic Data View web-part and the new XSLT List View web-parts that can be configured using SharePoint Designer. These web-parts can connect to a diverse set of data sources, from internal SharePoint lists to external REST and OData services.&lt;br /&gt;
&lt;br /&gt;
Still, the simplest solution for cross-site/cross-solution rollups is to customize the ootb search web-parts against custom search scopes in the Search Service application. In most cases, no coding will be required, pure configuration of SharePoint will go a long way. This post will show how to configure a search driven "My Tasks" web-part that will show all tasks assigned to the user across all SharePoint sites across all indexed SharePoint solutions. The unstyled cross-site task rollup web-part looks like this, included some debug info:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VhGcD5-4xdY/THdbD_rjNxI/AAAAAAAAASY/NDhuGR57GH0/s1600/TaskRollup_WebPart.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="326" ox="true" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/THdbD_rjNxI/AAAAAAAAASY/NDhuGR57GH0/s400/TaskRollup_WebPart.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
First you need to configure the results scope behind the search driven web-part in Central Admin. Start by adding a new scope in 'Search Service Application&amp;gt;Scopes' called &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;TaskRollup&lt;/span&gt; using the rules as shown here:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_VhGcD5-4xdY/THaE2DDKGWI/AAAAAAAAAR4/TrGf2hzuLGY/s1600/TaskRollup_SearchScopeAndRules.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="306" ox="true" src="http://3.bp.blogspot.com/_VhGcD5-4xdY/THaE2DDKGWI/AAAAAAAAAR4/TrGf2hzuLGY/s400/TaskRollup_SearchScopeAndRules.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
If you can't see &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ContentType&lt;/span&gt; when adding a rule, then go to 'Search Service Application&amp;gt;Metadata Properties' and edit the managed property to set &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Allow this property to be used in scopes&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
As the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;TaskStatus&lt;/span&gt; site column is not mapped to any managed property by default, you must map the crawled property &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;ows_Status&lt;/span&gt; to one before it can be used. Go to 'Search Service Application&amp;gt;Metadata Properties' and create a managed property called &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;TaskStatus&lt;/span&gt; using the mapping as shown here:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VhGcD5-4xdY/THaIgdtzU4I/AAAAAAAAASA/SrBV-NfJyqU/s1600/TaskRollup_CrawledTaskStatus.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="263" ox="true" src="http://1.bp.blogspot.com/_VhGcD5-4xdY/THaIgdtzU4I/AAAAAAAAASA/SrBV-NfJyqU/s400/TaskRollup_CrawledTaskStatus.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Do not go creative with the naming, stay away from spaces and special characters such as ÆØÅ - a SharePoint best practice for &lt;a href="http://technet.microsoft.com/en-us/library/ff919564.aspx"&gt;any artifact name used as an identifier or an URL fragment&lt;/a&gt;. For example, a name like "Contoso Web Ingress" first gets encoded as "Contoso_x0020_Web_x0020_Ingress" when stored, and then once more encoded as "Contoso_x005F_x0020_Web_x005F_x0020_Ingress" in a search result XML.&lt;br /&gt;
&lt;br /&gt;
A full crawl is required after adding or changing crawled or managed properties. Do a full crawl of the content source you used in the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;TaskRollup&lt;/span&gt; scope. Note that there must be some matching content stored in SharePoint for these properties to be added to the property database in the first place. Thus after provisioning new site content types or site columns, you must add some sample content and then do a full recrawl of the applicable content source.&lt;br /&gt;
&lt;br /&gt;
Verifying that the full crawl of the SharePoint sites content source finished without errors completes the Central Admin configuration. Now it's time to configure the ootb Search Core Results web-part to become the customized My Tasks web-part.&lt;br /&gt;
&lt;br /&gt;
Open a team-site and add the Search Core Results web-part to a page. Switch to page edit mode and select 'Edit Web Part' to open the Search Core Results settings panel. Rename the web-part 'Title' to &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Task Rollup (cross-site)&lt;/span&gt; and set the 'Cross Web-Part Query ID' to &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;User query&lt;/span&gt; and 'Fixed Keyword Query' to &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;scope: "TaskRollup"&lt;/span&gt; as shown here:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_VhGcD5-4xdY/THbQ4cdwFhI/AAAAAAAAASI/ujPDZDDh8mY/s1600/TaskRollup_CoreResult_All.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://2.bp.blogspot.com/_VhGcD5-4xdY/THbQ4cdwFhI/AAAAAAAAASI/ujPDZDDh8mY/s320/TaskRollup_CoreResult_All.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The Search Core Results web-part requires a user query, or a configured fixed or appended query, to actually perform a search. No configured or no user query will just show a message asking for query input. The cross-page query ID setting &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;User query&lt;/span&gt; is chosen here for reasons explained later.&lt;br /&gt;
&lt;br /&gt;
If you want to further limit what tasks are shown in the My Tasks web-part, just add more &lt;a href="http://msdn.microsoft.com/en-us/library/ee558911.aspx"&gt;query keywords&lt;/a&gt; to the 'Append Text to Query' setting as shown here:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_VhGcD5-4xdY/THdrgdhNkqI/AAAAAAAAASo/bYnD_zlemPE/s1600/TaskRollup_CoreResult_Filtered.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/THdrgdhNkqI/AAAAAAAAASo/bYnD_zlemPE/s320/TaskRollup_CoreResult_Filtered.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The My Tasks web-part will show the two task fields 'Status' and 'Assigned to' in the task list. Any managed crawled property can be added to the search results by configuring the 'Fetched Properties' setting. Add the following XML &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;Column Name="AssignedTo"/&amp;gt; &amp;lt;Column Name="TaskStatus"/&amp;gt;&lt;/span&gt; as shown here: &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VhGcD5-4xdY/THdkShGBRZI/AAAAAAAAASg/bxTSNcbmnYI/s1600/TaskRollup_CoreResults_ColumnsAndStyling.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://1.bp.blogspot.com/_VhGcD5-4xdY/THdkShGBRZI/AAAAAAAAASg/bxTSNcbmnYI/s320/TaskRollup_CoreResults_ColumnsAndStyling.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
You need to uncheck the 'Use Location Visualization' setting to enable the controls for customizing the result set and XSL formatting. See &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/04/05/a-quick-guide-to-coreresultswebpart-configuration-changes-in-sharepoint-2010.aspx"&gt;A quick guide to CoreResultsWebPart configuration changes in SharePoint 2010&lt;/a&gt; by Corey Roth to learn more about the new search location concept in SharePoint 2010. Read all his &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Enterprise+Search/default.aspx"&gt;Enterprise Search&lt;/a&gt; posts for an excellent introduction to the improved SharePoint 2010&amp;nbsp;search services and web-parts.&lt;br /&gt;
&lt;br /&gt;
After adding&amp;nbsp;'TaskStatus' and 'AssignedTo' to the fetched properties, you will also need to customize the XSL used to&amp;nbsp;format and&amp;nbsp;show the search results to also include your&amp;nbsp;extra&amp;nbsp;task fields.&amp;nbsp;Click the 'XSL Editor' button in the 'Display Properties' section of the web-part settings panel, and add the fields to the match="Result" xsl:template according to your design. Note that the property names must be entered in lower case in the XSL.&lt;br /&gt;
&lt;br /&gt;
The astute reader will have noticed the nice grouping of the search results. This is done using the &lt;a href="http://www.jenitennison.com/xslt/grouping/"&gt;Muenchian method&lt;/a&gt; as SharePoint 2010 still uses XLST 1.0, thus no simple XSLT 2.0 &lt;a href="http://www.xml.com/lpt/a/1314"&gt;xsl:for-each-group&lt;/a&gt;. The customized "My Tasks"&amp;nbsp;results XSL creates a key called 'tasks-by-status' that selects 'Result' elements and groups them on the 'taskstatus' field as shown here:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_VhGcD5-4xdY/THeRZQDCaSI/AAAAAAAAATw/q0HF9CDaEQg/s1600/TaskRollup_CoreResultsMuenchianGrouping_XSLT.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="244" ox="true" src="http://1.bp.blogspot.com/_VhGcD5-4xdY/THeRZQDCaSI/AAAAAAAAATw/q0HF9CDaEQg/s640/TaskRollup_CoreResultsMuenchianGrouping_XSLT.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Again, note the requirement for lower case names for the fetched properties when used in the XSL. Use the &amp;lt;xmp&amp;gt; trick to &lt;a href="http://msdn.microsoft.com/en-us/library/ms546985.aspx"&gt;see the actual result XML&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The final part of the puzzle is how to turn the cross-site task list into a personal task list. Unfortunately, the [Me] and [Today] filter tokens cannot be used in the enterprise search query syntax, so some coding is required to add such dynamic&amp;nbsp;filter tokens. Export the customized Search Core Results web-part to disk&amp;nbsp;to start packaging into a WSP solution.&lt;br /&gt;
&lt;br /&gt;
Create a new TaskRollupWebPart web-part SPI in your web-parts feature in Visual Studio 2010. Make the new web-part class inherit from &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;CoreResultsWebPart&lt;/span&gt; in the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Microsoft.Office.Server.Search&lt;/span&gt; assembly. Override the methods shown&amp;nbsp;here&amp;nbsp;to add dynamic filtering of the query through the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SharedQueryManager&lt;/span&gt; for the web-part page:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;namespace PuzzlepartTaskRollup.WebParts&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;[ToolboxItemAttribute(false)]&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: cyan; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;public class TaskRollupWebPart : Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;QueryManager _queryManager;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: cyan; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;protected override void OnInit(EventArgs e)&lt;/span&gt; &lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; base.OnInit(e);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; _queryManager = SharedQueryManager.GetInstance(this.Page).QueryManager;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: cyan; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;protected override System.Xml.XPath.XPathNavigator GetXPathNavigator(string viewPath)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; SPUser user = SPContext.Current.Web.CurrentUser;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &lt;span style="background-color: #f1c232;"&gt;_queryManager.UserQuery = string.Format("scope:\"TaskRollup\" AssignedTo:\"{0}\"", user.Name);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; return base.GetXPathNavigator(viewPath); &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: cyan; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;protected override void CreateChildControls()&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; base.CreateChildControls();&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; //debug info&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #38761d; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; //Controls.Add(new Label { Text = string.Format("FixedQuery: {0}&amp;lt;br/&amp;gt;AppendedQuery: {1}&amp;lt;br/&amp;gt;UserQuery: {2}", FixedQuery, AppendedQuery, _queryManager.UserQuery) });&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The code in &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;GetXPathNavigator&lt;/span&gt; is what adds&amp;nbsp;the current user&amp;nbsp;to the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;QueryManager.UserQuery&lt;/span&gt; to filter tasks based on the assigned user by [me]. There are five query objects available on a search web-part page, where &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;QueryId.Query1&lt;/span&gt; is the default.&amp;nbsp;This is also&amp;nbsp;what is exposed in the web-part settings as the&amp;nbsp;'User Query' option. Use the&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;GetInstance(Page, QueryId)&lt;/span&gt; overload in &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SharedQueryManager&lt;/span&gt;&amp;nbsp;to get at a specific cross-page query object.&lt;br /&gt;
&lt;br /&gt;
Replace the content of the TaskRollupWebPart.webpart file with the exported Search Core Results configuration. This will ensure that all the configuration done to customize the ootb web-part into the&amp;nbsp;My Tasks&amp;nbsp;web-part is applied to the new TaskRollupWebPart. A small change is needed in the metadata type element to load the new TaskRollupWebPart code rather than the CoreResultsWebPart code:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;webParts&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;webPart xmlns="http://schemas.microsoft.com/WebPart/v3"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;metaData&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;type name="&lt;span style="background-color: #f1c232;"&gt;PuzzlepartTaskRollup.WebParts.TaskRollupWebPart, $SharePoint.Project.AssemblyFullName$&lt;/span&gt;" /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;importErrorMessage&amp;gt;$Resources:core,ImportErrorMessage;&amp;lt;/importErrorMessage&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;lt;/metaData&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Build the feature and deploy the package to your test site from Visual Studio 2010. Add the web-part to a page and verify that you get only your tasks as expected.&lt;br /&gt;
&lt;br /&gt;
I know that this seems like a lot of work, but a search-driven web-part is easily created and tested before lunch. The inevitable&amp;nbsp;styling &amp;amp; layout using XSL and CSS is what will burn hours, as usual.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
A drawback of search driven web-parts or code is the delay before new/updated content is shown due to the periodical crawling schedule, typically five or ten minutes. On the positive side, the results will be automatically security trimmed for you based on the logged on user - no authentication hassles or stored username password required as with the XSL List View.&lt;br /&gt;
&lt;br /&gt;
Note that &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/a4473d25-d1af-4839-85d6-f744bff9c4c2"&gt;most enterprise search classes are still sealed in SharePoint 2010&lt;/a&gt;&amp;nbsp;as in&amp;nbsp;SharePoint 2007, except the CoreResultsWebPart and some new classes, so you're limited to what customizations can be achieved with configuration or the &lt;a href="http://p2p.wrox.com/content/articles/customizing-sharepoint-2010-search-user-experience"&gt;SharedQueryManager&lt;/a&gt;. Search driven web-parts works equally well in SharePoint 2007, except that there is no SharedQueryManager, but rather the infamous &lt;a href="http://blogs.msdn.com/b/arbindo/archive/2009/06/21/extending-sharepoint-coreresultswebpart.aspx"&gt;search results hidden object&lt;/a&gt; (SRHO) which is unsupported.&lt;br /&gt;
&lt;br /&gt;
Recommended: &lt;a href="http://sctxsl.codeplex.com/"&gt;SharePoint Search XSL Samples&lt;/a&gt;&amp;nbsp;and the &lt;a href="http://sct.codeplex.com/"&gt;Search Community Toolkit&lt;/a&gt; at CodePlex.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11096258-1902590392783902153?l=kjellsj.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InfoworkerSolutions/~4/ph-ib4nPQtI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://kjellsj.blogspot.com/feeds/1902590392783902153/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11096258&amp;postID=1902590392783902153" title="25 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/1902590392783902153?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11096258/posts/default/1902590392783902153?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InfoworkerSolutions/~3/ph-ib4nPQtI/my-tasks-web-part-search-driven-cross.html" title="SharePoint 2010 My Tasks Web Part using Search Driven Cross-Site Query with Muenchian Grouping" /><author><name>Kjell-Sverre Jerijærvi</name><uri>http://www.blogger.com/profile/13654217591841196465</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_VhGcD5-4xdY/SjEv-qMek4I/AAAAAAAAALQ/jid4lSvC95c/S220/kjellsj.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_VhGcD5-4xdY/THdbD_rjNxI/AAAAAAAAASY/NDhuGR57GH0/s72-c/TaskRollup_WebPart.png" height="72" width="72" /><thr:total>25</thr:total><feedburner:origLink>http://kjellsj.blogspot.com/2010/08/my-tasks-web-part-search-driven-cross.html</feedburner:origLink></entry></feed>

