Disclaimer: All postings are provided "AS IS" with no warranties, and confer no rights. This weblog does not represent the thoughts, intentions, plans or strategies of Microsoft. Because a weblog is intended to provide a semi-permanent point-in-time snapshot, you should not consider out of date posts to reflect current thoughts and opinions.
Recently, I was going through setting up some sample navigation approaches for SharePoint. The first step was in creating a bunch of Child Sites and some basic hierarchical structure. For that I used a great tool from IDevFactory called SWAT just to create some empty Team Sites.
The one issue with that tool is it doesn’t allow setting a few options globally.
What I wanted was to have under the Navigation options to have the “Show Subsites” enabled. In addition to a few other navigation settings. Just as shown below:
To do that you need to access the AllProperties collection on the SPWeb object and add or update any existing entries. What I came up with is the following:
37 private static void SetNavigation(SPWeb childWeb) 38 { 39 if (childWeb.IsRootWeb == false) 40 { 41 SPNavigation spNav = childWeb.Navigation; 42 childWeb.Navigation.UseShared = true; 43 childWeb.Description = childWeb.Name + " description..."; 44 45 SetAllPropr(childWeb, "__IncludeSubSitesInNavigation", "True"); 46 SetAllPropr(childWeb, "__InheritCurrentNavigation", "False"); 47 SetAllPropr(childWeb, "__IncludePagesInNavigation", "False"); 48 SetAllPropr(childWeb, "__NavigationShowSiblings", "False"); 49 SetAllPropr(childWeb, "__NavigationOrderingMethod", "2"); 50 } 51 } 52 53 static void SetAllPropr(SPWeb web, string key, object value) 54 { 55 56 if (web.AllProperties.Contains(key)) 57 web.AllProperties.Remove(key); 58 59 web.AllProperties.Add(key, value); 60 }
37 private static void SetNavigation(SPWeb childWeb)
38 {
39 if (childWeb.IsRootWeb == false)
40 {
41 SPNavigation spNav = childWeb.Navigation;
42 childWeb.Navigation.UseShared = true;
43 childWeb.Description = childWeb.Name + " description...";
44
45 SetAllPropr(childWeb, "__IncludeSubSitesInNavigation", "True");
46 SetAllPropr(childWeb, "__InheritCurrentNavigation", "False");
47 SetAllPropr(childWeb, "__IncludePagesInNavigation", "False");
48 SetAllPropr(childWeb, "__NavigationShowSiblings", "False");
49 SetAllPropr(childWeb, "__NavigationOrderingMethod", "2");
50 }
51 }
52
53 static void SetAllPropr(SPWeb web, string key, object value)
54 {
55
56 if (web.AllProperties.Contains(key))
57 web.AllProperties.Remove(key);
58
59 web.AllProperties.Add(key, value);
60 }
The full standalone console project is located here
For a good list on what your current farm patch level is at check out the following post:
http://www.mindsharpblogs.com/penny/articles/481.aspx
Just navigate to Central Administration –> Servers in Farm and look at the version reported.
OK. When the …\User Agent\Post Platform key (explained in the prior post) has too many items and the total length exceeds 260 characters, what happens is the javascript function windows.navigator.userAgent reports back as MSIE 6.0.
As follows – using the http://www.fiddlertool.com/ua.aspx test page:
getComponentVersion says you are running Internet Explorer 7,0,6001,18000.
window.navigator.userAgent: [Mozilla/4.0 (compatible; MSIE 6.0)] window.navigator.appMinorVersion: [0]
window.navigator.userAgent: [Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 1.1.4322; WWTClient2; .NET CLR 3.5.30729; .NET CLR 3.0.30618; Zune 3.0; MS-RTC LM 8; OfficeLivePatch.0.0)] window.navigator.appMinorVersion: [0]
Recently, installed a bunch of new Windows Live components such as Messenger, etc.
That update extended my HTTP_USER_AGENT string to beyond 260 characters, which unfortunately IE then, when asked via javascript, reports itself back as IE 6 – this causes the Modal dialog boxes in SharePoint for things like adding web parts to zones to report a message that “Not enough storage is available to complete this operation”.
So, since this is an x64 machine, I need to trim down the string which is taken from the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform
My key was the following:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 1.1.4322; WWTClient2; .NET CLR 3.5.30729; .NET CLR 3.0.30618; Zune 3.0; MS-RTC LM 8; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
For now, I’ll take out the OfficeLiveConnector (which I’m NOT using now) from the AG
If you’re doing WSS/MOSS development then you need to understand the implications of when to Dispose and not Dispose of your objects from the SharePoint object model. Roger Lamb has been keeping us all up to date and I’m sure there’s more forthcoming…
http://blogs.msdn.com/rogerla/archive/2009/01/14/try-finally-using-sharepoint-dispose.aspx
If you’ve been running x64 WSS/MOSS in development VSeWSS has been a challenge (wouldn’t install – albeit I believe the Bamboo solutions folks had some hack…)
Now, the CTP of VSeWSS 1.3 has been announced
SharePoint Team Blog
CTP Preview of VSeWSS
Key capabilities in 1.3
If you’re running Grisoft AVG with Web Shield and trying the new Windows Live Messenger you might be experiencing connection issues.
For me disabling the Web Shield MSN Messenger protection worked…