Feb 25
I know this is a moot point now that SharePoint 2010 will support 50? million and without the recommended 2000 limit per container. See this article for SharePoint 2007 large list performance.
If you’re programmatically adding items into your document library or list you can use this piece of code to retrieve a folder structure based on the current Date Time. It will created a nested folder structure so that you will never have more than 2000 items in any folder. For example a new list item would be stored in the following structure:
Year – 2010
Month – 4
Day – 20
Hour – 14
private SPFolder getCurrentDateFolder(string listName)
{
SPFolder currentDateFolder = null;
DateTime now = DateTime.Now;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb web = site.OpenWeb(SPContext.Current.Web.ID))
{
SPList list = web.Lists[listName];
SPFolder yearFolder = null;
SPFolder monthFolder = null;
SPFolder dayFolder = null;
SPFolder hourFolder = null;
string year = "Year - " + now.Year.ToString();
if (doesFolderExistInSubFolders(list.RootFolder, year))
{
yearFolder = list.RootFolder.SubFolders[year];
}
else
{
web.AllowUnsafeUpdates = true;
SPListItem newFolder = list.Items.Add("", SPFileSystemObjectType.Folder, year);
newFolder.Update();
list.Update();
yearFolder = newFolder.Folder;
}
string month = "Month - " + now.Month.ToString();
if (doesFolderExistInSubFolders(yearFolder, month))
{
monthFolder = yearFolder.SubFolders[month];
}
else
{
web.AllowUnsafeUpdates = true;
SPListItem newFolder = list.Items.Add(yearFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder, month);
newFolder.Update();
list.Update();
monthFolder = newFolder.Folder;
}
string day = "Day - " + now.Day.ToString();
if (doesFolderExistInSubFolders(monthFolder, day))
{
dayFolder = monthFolder.SubFolders[day];
}
else
{
web.AllowUnsafeUpdates = true;
SPListItem newFolder = list.Items.Add(monthFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder, day);
newFolder.Update();
list.Update();
dayFolder = newFolder.Folder;
}
string hour = "Hour - " + now.Hour.ToString();
if (doesFolderExistInSubFolders(dayFolder, hour))
{
hourFolder = dayFolder.SubFolders[hour];
}
else
{
web.AllowUnsafeUpdates = true;
SPListItem newFolder = list.Items.Add(dayFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder, hour);
newFolder.Update();
list.Update();
hourFolder = newFolder.Folder;
}
currentDateFolder = hourFolder;
}
}
});
return currentDateFolder;
}
Feb 09
Just like the title says, if you’ve set AllowUnsafeUpdates = true, after a BreakRoleInheritance (on any SP object ie. SPWeb, SPList, SPListItem) AllowUnsafeUpdates will reset back to false. If you need it to remain true make sure to set it back to true right after you call BreakRoleInheritance:
SPListItem li = list.Items[0];
SPContext.Current.Web.AllowUnsafeUpdates = true;
li.BreakRoleInheritance(false);
SPContext.Current.Web.AllowUnsafeUpdates = true;
li.Update();
Dec 08
I originally found the solution from this post here. http://www.sonycreativesoftware.com/forums/ShowMessage.asp?ForumID=4&MessageID=648182
I’m using Vegas 9.0c 32 bit on Windows 7 64-bit and have noticed this issue when using Magic Bullet Looks 1.2. If you monitor the memory in task manager you’ll see it grows and will never come back down. I have a machine with 8GB of RAM so the solution presented in the post is to change the switch in the exe to allow it to utilize more than 2GB of RAM. This has worked perfectly for me. Still, it’s discouraging that there is a memory leak somewhere and I seriously hope the Vegas folks fix this. The only way to release the memory is closing the application. I’ve even tried in scripts doing a System.GC.Collect() to force garbage collection just before a render but that does not release the memory.
Here’s a run down of what you need to do:
- Get CFF Module from http://www.ntcore.com
- Open the exe file for vegas. This should be like “vegas90.exe” or “vegas80.exe”.
- Click on FILE HEADER under NT HEADER on the left side.
- On the right there is a table and on the very last cell to the right on the bottom click on “CLICK HERE”
- Check the option that says “app can handle > than 2gig address space”
- Save the file as a different file ie vegas90_new.exe.
- Run the new exe.
Now if what you’re rendering is so massive its going to grow beyond your RAM then you’re still out of luck and will have to render in pieces but at least you can get longer clips to render.
Nov 10
This one was a mystery for a while. If you’re running into a 403 from IE when going to a SharePoint forms auth site but you’re not getting any problems from another browser, check to see if you have Microsoft Office Live Update installed. I believe the latest June cumulative update will have fix shipped with it. Here’s the KB article detaling the issue…
http://support.microsoft.com/kb/972535
Oct 13
Banged my head a few times on this. If you’re copying this line and pasting it, make sure the single quotes are really single quotes or you’ll get that divide by zero error.
<?php include (ABSPATH . '/wp-content/plugins/wp-featured-content-slider/content-slider.php'); ?>
http://wordpress.org/extend/plugins/wp-featured-content-slider/installation/
Oct 12
Just spent about 2 weeks with Microsoft support on a problem related to one way trust and using the peoplepicker-searchadforests for Sharepoint. You can find out more about the property here: http://technet.microsoft.com/en-us/library/cc263460.aspx
The problem in our situation was that we previously had set the property to be able to search the forest which in our case was called contoso.local. SharePoint was not returning users from the trusted domain in people picker but what was more confusing was that people picker would return users from the trusted domain who had been previously added. So initially, we couldn’t diagnose that it wasn’t returning all users but thought it was only having a problem with a few users. In the end, we found the problem to be that contoso.local was no longer being recognized as a forest but rather just as a domain.
Why was it being now recognized as a domain and not a forest anymore? No clue. If you have any ideas please chime in because that is still a mystery to me. I’ve tripple checked and our forest is still the same name. I did notice this issue happened after the April cumulative update although I’m not sure it is related.
So our property value for peoplepicker-searchadforest had to change from:
stsadm -o setproperty -url http://contoso.com -pn peoplepicker-searchadforests -pv “forest:contoso.local“,contoso\account,*****;”domain:contoso.local”,contoso\account,****
to the correct value:
stsadm -o setproperty -url http://contoso.com -pn peoplepicker-searchadforests -pv “domain:contoso.local“,contoso\account,*****;”domain:contoso.local”,contoso\account,***
It took us 2 support technicians and an escalation then finally after 2 weeks the issue was fixed with Microsoft support. We spent a lot of time making test sites with multiple configurations but had completely missed this one detail of trying domain instead of forest. Hope this saves someone else some time!
Sep 06
Active Directory works great with SharePoint but it’s not always the ideal solution. ASP.NET membership works much better under certain circumstances. Here’s a great article by Scott Guthrie about ASP.NET membership and SharePoint (http://weblogs.asp.net/scottgu/archive/2006/04/30/SharePoint-2007-_2D002D00_-Built-on-ASP.NET-2.0-.aspx).
Here’s some points I’ve come accross that may help decide when to use either solution:
When to use Active Directory
- Users are already part of AD
- Accounts must be centrally managed by IT
- Accounts need to follow certain policies maintained by IT (password expiration, password strength)
- Users absolutely need SharePoint features only available from NTLM ie. windows explorer view for lists
- No need for forms auth and need true Windows auth integration
- Ideal for company intranets where the users of SharePoint are all from AD
When to use ASP.NET membership
- For using ASP.NET login controls (http://msdn.microsoft.com/en-us/library/ms178329.aspx) right out of the box. Saves incredible amount of work!
- There is a need for an account creation process, i.e. registration where the user will be granted with certain rights upon completing the registration.
- Need for more self service features for accounts such as “Forget Password” with a challenge and response, and a “Change Password” feature. These come out of the box.
- If the site is primary accesssed by users outside of the organization, AD will be convoluted with users that otherwise do not use internal resources. Using ASP.NET membership segregates these users which also provide better protection for assets that could be accessed by internal AD users.
- SharePoint developer/admin can support user accounts all from with the SharePoint server rather than an IT resource with rights to AD. This is helpful where there are large bureaucracies for IT that need to be bypassed.
- Ideal solution for partners, extranets, and public facing sites where the users do not need to be in AD.
May 13
If you have items (pages or subsites) missing in your current navigation or quick launch links, then it maybe related to the sitemap providers DynamicChildLimit which is set by default to 50. To change this, you’ll need to update your web.cofig as below. Setting it to 0 will allow for no limit.
The original post I found related to this was http://www.slightlyrational.com/it/sharepoint/extending50sitelimit.
<siteMap…>
<providers>
<add name=”GlobalNavSiteMapProvider” description=”CMS provider for Global navigation” type=”Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” NavigationType=”Global” EncodeOutput=”true” DynamicChildLimit=”0″ />
<add name=”CombinedNavSiteMapProvider” description=”CMS provider for Combined navigation” type=”Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” NavigationType=”Combined” EncodeOutput=”true” DynamicChildLimit=”0″ />
<add name=”CurrentNavSiteMapProvider” description=”CMS provider for Current navigation” type=”Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” NavigationType=”Current” EncodeOutput=”true” DynamicChildLimit=”0″ />
<add name=”CurrentNavSiteMapProviderNoEncode” description=”CMS provider for Current navigation, no encoding of output” type=”Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” NavigationType=”Current” EncodeOutput=”false” DynamicChildLimit=”0″ />
</providers>
</siteMap>
May 06
I had an issue with some code that was deployed into a prod environment and threw an ‘object reference not set to an instance of an object’ error where it called the SPWeb’s AssociatedVisitorGroup. It turned out that our production environment didn’t have its visitor group setup yet. To do this go to the groups page (../_layouts/groups.aspx), and on the top of of the People and Groups view click on Settings and go to Set Up Groups. There you can create a new group or associate an already existing one.
May 06
I had some fun times debugging this issue today. There was an IIS virtual directory setup in the SharePoint web applications site with the same name as one of the variations in the site. In our example, we have a variations site for japan at http://www.patrickzaw.com/jp. There was a need to redirect a url (http://www.patrickzaw.com/jp/products) that didn’t exist within the Sharepoint site structure to another subsite that does exist (http://www.patrickzaw.com/jp/sites/productline). The solution put in place was virtual directory created in the same web application for /jp and then under that another one for /products which was setup as a redirection to the existing subsite.
Upon setting this up everything will work as expected until an app pool recylce, or IIS reset. When the app pool recycles the entire site will throw an unspecified exception.
It appears only to affect virtual directories with the same name as the variations site, but does not effect subsites with the same name.
Our resolution was to delete the virtual directories, restart IIS, and use SharePoint redirect pages instead. This did force us to create a subsite for /products that only had one redirect page. Please chime in if you have some better ideas of how to implement this.