<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="RSSFeed.xsl"?>
<rss version="2.0">
     <channel>
          <title>Rob Nowiks SharePoint Blog</title>
          <description>Rob Nowiks SharePoint Blog</description>
          <link>http://rnowik.com</link>
          <lastBuildDate>06/10/2008 16:17:16</lastBuildDate>
          <generator>Rob Nowiks Blog</generator>
          <item>
               <title>MOSS Quicknote: Updating Profile Property Choices Programmatically</title>
               <description>&lt;p&gt;Just a quicknote - there is a glitch in the SharePoint OM, that if you update the choicelist for a profile property programmatically, without altering any other attributes of the profile property, the change is not accepted. To force acceptance of the change, you need to programmatically update another attribute of the profile property at the same time, such as the displayname (ensuring that its changed to a different value). What seems to be going on in behind the scenes is that an IsDirty flag is set when you try to update a profile property, however this is not set when you update the choice list. Note that it is also not set if you update the displayname to the same value as previous. &lt;/p&gt;  &lt;p&gt;I would post example code, but i'm too tired! If anyone wants me to post example code, please post a comment below requesting this.&lt;/p&gt;</description>
               <link>http://rnowik.com/MOSS-Quicknote-Updating-Profile-Property-Choices-Programmatically.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>07/09/2008 18:55:04</pubDate>
          </item>
          <item>
               <title>Update: New Job</title>
               <description>&lt;p&gt;I have just joined Microsoft UK as a Developer Consultant, primarily specialising in SharePoint (joined 11th August). I am extremely excited about working with some top people and getting involved with leading edge technologies and projects.&amp;#160; &lt;/p&gt;</description>
               <link>http://rnowik.com/Update-New-Job.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>31/08/2008 11:24:28</pubDate>
          </item>
          <item>
               <title>MOSS Style Library</title>
               <description>&lt;p&gt;Just a quick note regarding style libraries...&lt;/p&gt;  &lt;p&gt;It looks like the &amp;#8220;style library&amp;#8221; is only created at the root of site collections for collaboration portals and publishing portals, both of which are normally created through central admin. If you create a &amp;#8220;team site&amp;#8221; or anything else apart from the above, the style library is not created. To access the style library, you go to &amp;#8220;Site libraries and lists&amp;#8221; or &amp;quot;View All Site Content&amp;quot;, as with any list or document library. You can also access it through SharePoint designer. Note that if you create a stylesheet under the _layouts directory, you won&amp;#8217;t be able to edit it off the server through SharePoint designer. If the style library is not present, you can add the stylesheet to a standard document library and reference it from there. &lt;/p&gt;</description>
               <link>http://rnowik.com/MOSS-Style-Library.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>29/08/2008 19:50:26</pubDate>
          </item>
          <item>
               <title>Silverlight Deep Zoom Test</title>
               <description>&lt;p&gt;I have just had a play with Deep Zoom Composer (&lt;a title="Deep Zoom Composer" href="http://www.microsoft.com/downloads/details.aspx?familyid=457b17b7-52bf-4bda-87a3-fa8a4673f8bf&amp;amp;displaylang=en"&gt;download here&lt;/a&gt;). Below is a quick test composition (use your mouse scroll wheel to zoom in / out). &lt;/p&gt;  &lt;p&gt;Note: to use silverlight on your website, you need to add a mime type of "application/x-silverlight-2-b2" for the .zap extension&lt;/p&gt; &lt;script type="text/javascript"&gt;
        function onSilverlightError(sender, args) {
        
            var appSource = "";
            if (sender != null &amp;&amp; sender != 0) {
                appSource = sender.getHost().Source;
            } 
            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;
            
            var errMsg = "Unhandled Error in Silverlight 2 Application " +  appSource + "\n" ;

            errMsg += "Code: "+ iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";

            if (errorType == "ParserError")
            {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError")
            {           
                if (args.lineNumber != 0)
                {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " +  args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }

            throw new Error(errMsg);
        }
    &lt;/script&gt;      &lt;div id="silverlightControlHost"&gt; 		&lt;object data="data:application/x-silverlight," type="application/x-silverlight-2-b2" width="100%" style="border: 1px solid #AAA;" height="300px"&gt; 			&lt;param name="source" value="images/DeepZoomTest/DeepZoomProject.xap" /&gt; 			&lt;param name="onerror" value="onSilverlightError" /&gt; 			&lt;param name="background" value="white" /&gt; 			 			&lt;a href="http://go.microsoft.com/fwlink/?LinkID=115261" style="text-decoration: none;"&gt;      			&lt;img src="http://rnowik.com/http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none" /&gt; 			&lt;/a&gt; 		&lt;/object&gt; 		&lt;iframe style='visibility:hidden;height:0;width:0;border:0px'&gt;&lt;/iframe&gt;     &lt;/div&gt;</description>
               <link>http://rnowik.com/Silverlight-Deep-Zoom-Test.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>04/08/2008 17:18:25</pubDate>
          </item>
          <item>
               <title>SQL Server 2005 Express: Database is read-only</title>
               <description>&lt;p&gt;I have experience the error &amp;quot;Failed to update database XXX.MDF because the database is read-only&amp;quot; a couple of times now when working with SQL Express 2005. I got into a situation where the database file in my app data folder was in sourcesafe on my dev machine - when it was originally added it was marked as read only to all users, and when checked out, the readonly flag was unset for the current user only, not the aspnet user. The workaround to this is outlined below: &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;(optional) uncheck &amp;quot;use simple file sharing&amp;quot; from control panel-&amp;gt;folder options-&amp;gt;view tab, then you see security tab for a folder&lt;/li&gt;    &lt;li&gt;Add COMPUTERNAME\ASPNET user to the app_data folder of your website&lt;/li&gt;    &lt;li&gt;Grant the COMPUTERNAME\ASPNET user write access to the folder&lt;/li&gt;    &lt;li&gt;Perform an iisreset&lt;/li&gt; &lt;/ol&gt;</description>
               <link>http://rnowik.com/SQL-Server-2005-Express-Database-is-read-only.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>04/08/2008 16:26:59</pubDate>
          </item>
          <item>
               <title>MOSS: Search by &amp;quot;Created By&amp;quot; and &amp;quot;Modified By&amp;quot;</title>
               <description>&lt;p&gt;I have spent the whole day battling with what seems to be a SharePoint bug &amp;#8211; the &amp;#8220;created by&amp;#8221; and &amp;#8220;modified by&amp;#8221; search mappings in advanced search never actually index the relevant metadata, meaning that you cannot usefully search on either of these. Looking at the meta data properties returned on items from a fulltextsqlquery, createdby and lastmodifiedby information is always blank - meaning that these properties are not indexed. This is pretty surprising as these criteria are available on the advanced search on by default. Note that apparently these property mappings do work for legacy (SPS2003) content, see &lt;a href="http://www.networkworld.com/community/node/19021"&gt;http://www.networkworld.com/community/node/19021&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;From what I've read on other blogs, the current workaround is to manually map meta data properties, see &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1937319&amp;amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1937319&amp;amp;SiteID=1&lt;/a&gt;. You can also use the author property as an alternative to the createdby property. &lt;/p&gt;</description>
               <link>http://rnowik.com/MOSS-Search-by-quot-Created-By-quot-and-quot-Modified-By-quot.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>30/07/2008 21:25:32</pubDate>
          </item>
          <item>
               <title>SharePoint: Calling Web Services Using WCF</title>
               <description>&lt;p&gt;This article describes how to call a SharePoint web service using WCF. In the example that follows, the Lists.asmx GetListItem webmethod is called from a console application that resides off a SharePoint server.&lt;/p&gt;  &lt;p&gt;The first step is to add a service reference to your console application (simply right click on your console application project and select &amp;quot;Add Service Reference&amp;quot;. Set the address to the lists webservice at the root of your SharePoint webapp (this can be dynamically altered later). In my example, I call the service namespace &amp;quot;ListsWS&amp;quot;. &lt;/p&gt;  &lt;p&gt;&lt;img height="240" alt="add_serv_ref1" src="http://rnowik.com/images/add_serv_ref1_thumb.png" width="289" /&gt; &lt;/p&gt;  &lt;p&gt;Note that for the code example below to work, you should ensure that the &amp;quot;Generate Asynchronous Operations&amp;quot; checkbox is unchecked in the advanced dialog. &lt;/p&gt;  &lt;p&gt;&lt;img height="277" alt="image" src="http://rnowik.com/images/image_thumb_1.png" width="291" /&gt; &lt;/p&gt;  &lt;p&gt;On adding a service reference, some entries are automatically add to the app.config / web.config file for your project. By default the security mode for the webservice binding is set to &amp;quot;None&amp;quot; (meaning that your SharePoint webservice fails because it is called anonymously). To work around this, you must change the security block from:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Original&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;&amp;lt;security mode=&amp;quot;None&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;transport clientCredentialType=&amp;quot;None&amp;quot; proxyCredentialType=&amp;quot;None&amp;quot; realm=&amp;quot;&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;message clientCredentialType=&amp;quot;UserName&amp;quot; algorithmSuite=&amp;quot;Default&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;lt;/security&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;to...&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;New&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;&amp;lt;security mode=&amp;quot;TransportCredentialOnly&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160; &amp;lt;transport clientCredentialType=&amp;quot;Ntlm&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;lt;/security&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Now you can call the webservice as follows using the following code (ensure that you class references the System.ServiceModel, System.Net and System.Xml namespaces...&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;// Set up the webservice      &lt;br /&gt;ListsWS.ListsSoapClient lists = new ListsWS.ListsSoapClient();       &lt;br /&gt;// The line below forces the credentials passed to the webservice. If this is not set,       &lt;br /&gt;// the credentials that this console app is running as will be passed through       &lt;br /&gt;lists.ClientCredentials.Windows.ClientCredential = new NetworkCredential(&amp;quot;user&amp;quot;, &amp;quot;password&amp;quot;, &amp;quot;domain&amp;quot;);       &lt;br /&gt;lists.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;// Dynamically set the endpoint to the appropriate spweb&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;lists.Endpoint.Address = new EndpointAddress(&amp;quot;&lt;/font&gt;&lt;a href="http://[serverName]/marketing/_vti_bin/lists.asmx" );?=");?"&gt;&lt;font face="Courier New" size="1"&gt;http://[serverName]/marketing/_vti_bin/lists.asmx&amp;quot;);&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;// Create xml nodes containing params to be passed to the webservice      &lt;br /&gt;// In this example, we are going to filter results to only show the item where ID = 1       &lt;br /&gt;XmlDocument xmlDoc = new XmlDocument();       &lt;br /&gt;XmlElement viewFields = xmlDoc.CreateElement(&amp;quot;ViewFields&amp;quot;);       &lt;br /&gt;viewFields.InnerXml = &amp;quot;&amp;quot;;       &lt;br /&gt;XmlElement queryOptions = xmlDoc.CreateElement(&amp;quot;QueryOptions&amp;quot;);       &lt;br /&gt;queryOptions.InnerXml = &amp;quot;&amp;quot;;       &lt;br /&gt;XmlElement query = xmlDoc.CreateElement(&amp;quot;Query&amp;quot;);       &lt;br /&gt;query.InnerXml = &amp;quot;&amp;lt;Where&amp;gt;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name=\&amp;quot;ID\&amp;quot; /&amp;gt;&amp;lt;Value Type=\&amp;quot;String\&amp;quot;&amp;gt;1&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;lt;/Where&amp;gt;&amp;quot;; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;// Call the webmethod      &lt;br /&gt;XmlElement nodeListItems = lists.GetListItems(&amp;quot;Shared Documents&amp;quot;, null, query, viewFields, &amp;quot;1&amp;quot;, queryOptions, null); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;// Parse out the items      &lt;br /&gt;XmlDocument resultsDoc = new XmlDocument();       &lt;br /&gt;resultsDoc.LoadXml(nodeListItems.InnerXml); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;// An XmlNameSpaceManager is required to pass out rs and z elements      &lt;br /&gt;XmlNamespaceManager listsNsManager = new XmlNamespaceManager(resultsDoc.NameTable);       &lt;br /&gt;listsNsManager.AddNamespace(&amp;quot;rs&amp;quot;, &amp;quot;urn:schemas-microsoft-com:rowset&amp;quot;);       &lt;br /&gt;listsNsManager.AddNamespace(&amp;quot;z&amp;quot;, &amp;quot;#RowsetSchema&amp;quot;); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;// Display the fileref of the first returned item      &lt;br /&gt;XmlNodeList items = nodeListItems.SelectNodes(&amp;quot;/rs:data/z:row&amp;quot;, listsNsManager);       &lt;br /&gt;Console.WriteLine(items[0].Attributes[&amp;quot;ows_FileRef&amp;quot;].Value);&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Key points to note on the above code are that:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;lists.ClientCredentials.Windows.ClientCredential can be omitted - in which case, the credentials that your app is running under will be passed through to the SharePoint webservice. &lt;/li&gt;    &lt;li&gt;The URL to the webservice can be overridden using lists.Endpoint.Address. &lt;/li&gt;    &lt;li&gt;In the example above, an xmlnamespacemanager is required to perform xpath on the results. &lt;/li&gt; &lt;/ol&gt;</description>
               <link>http://rnowik.com/SharePoint-Calling-Web-Services-Using-WCF.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>27/07/2008 18:36:55</pubDate>
          </item>
          <item>
               <title>SharePoint: LINQ query to get child content types</title>
               <description>&lt;p&gt;I had been putting off using / learning linq for a little while, but am now finally writing some .net 3.5 code for sharepoint where there are some clear uses for it. I am finding it really intuitive.&lt;/p&gt;  &lt;p&gt;Anyway, below is one of my first real-world linq queries - it is a simple query to get all of the descendant content types from a given content type (note that the parent content type is also included):&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;SPContentTypeId parentId = new SPContentTypeId(&amp;quot;parentContentTypeId&amp;quot;); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;using (SPSite mySiteCollect= new SPSite(&amp;quot;&lt;/font&gt;&lt;a href="http://url/to/my/spweb" ))?="))?"&gt;&lt;font face="Courier New" size="1"&gt;http://url/to/my/spweb&amp;quot;))&lt;/font&gt;&lt;/a&gt;&lt;font face="Courier New" size="1"&gt;      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New" size="1"&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; using (SPWeb website = siteCol.OpenWeb())       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IEnumerable&amp;lt;SPContentType&amp;gt; descendantContentTypes =       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; from SPContentType childCt in myspweb.AvailableContentTypes       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; where childCt.Id.IsChildOf(parentId)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select childCt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="1"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Do something here with descendant content types      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;</description>
               <link>http://rnowik.com/SharePoint-LINQ-query-to-get-child-content-types.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>17/07/2008 18:57:50</pubDate>
          </item>
          <item>
               <title>SharePoint: 403 Error Using Embedded Resources</title>
               <description>&lt;p&gt;I encountered an issue yesterday using embedded resources in a .NET 2.0 WebPart consumed by SharePoint. The dll used by the webpart contained an embedded js and css file that was accessed by this.Page.ClientScript.GetWebResourceUrl (note dll was deployed to 80\bin). &lt;/p&gt;  &lt;p&gt;Whenever a page containing the webpart was accessed first by a non-admin user after an app pool recycle, a 403 error was encountered. This error went away to all users once an admin user had viewed the webpart. This error implied to me that the appropriate safecontrol assembly setting in the web.config was not correct, however this was not the case. &lt;/p&gt;  &lt;p&gt;I have not yet found a proper solution to this problem, however the workaround I am currently using&amp;#160; is to call GetWebResourceUrl via SPSecurity.RunWithElevatedPrivileges. I will update this post if and when I find the actual cause / solution to this problem. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Related Link: &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.katriendg.com/aboutdotnet/2007-6-webresources-webpart-403-forbidden.aspx"&gt;http://www.katriendg.com/aboutdotnet/2007-6-webresources-webpart-403-forbidden.aspx&lt;/a&gt;&lt;/p&gt;</description>
               <link>http://rnowik.com/SharePoint-403-Error-Using-Embedded-Resources.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>16/07/2008 21:48:56</pubDate>
          </item>
          <item>
               <title>Passed MCPD Exam 70-547</title>
               <description>&lt;p&gt;I have just passed the &amp;quot;Designing and Developing Web-Based Applications by Using the Microsoft .NET Framework&amp;quot; exam. This means that I am now a Microsoft Certified Professional Developer.&lt;/p&gt;  &lt;p&gt;&lt;img height="80" alt="MCPD(rgb)_504" src="http://rnowik.com/images/MCPD(rgb)_504_thumb.jpg" width="229" /&gt;&lt;/p&gt;</description>
               <link>http://rnowik.com/Passed-MCPD-Exam-70-547.aspx</link>
               <author>Rob Nowik</author>
               <pubDate>16/07/2008 21:33:39</pubDate>
          </item>
     </channel>
</rss>