Friday, August 27, 2010

SharePoint 2007 Crawled Property Creation

Just an interesting observation.

In the SharePoint 2007 farm, if there are more than one list columns with the same name, for example, "Report Name", not in the same list, of course, SharePoint creates only one crawled property for all those columns with the exact same name, and the crawled property is named as "ows_Report_x0020_Name".

Here is how I did the test.
  1. Create a list named abc with a column "Report Name", fill in some dummy value
  2. Do an incremental index
  3. In SSP, there is a new crawled property named "ows_Report_x0020_Name" created
  4. Create another list named xyz with a column "Report Name", fill in some dummy value
  5. Do an incremental index
  6. In SSP, there is still only one crawled property named "ows_Report_x0020_Name", there is nothing else similiar to "ows_Report_x0020_Name" 

Tuesday, August 24, 2010

SharePoint 2010 Application Development Resources

Developing Applications for SharePoint 2010

SharePoint 2010 Walkthrough Guide

SharePoint 2010 Developer Training Kit

 

URL path length restrictions (SharePoint Server 2010)

URL path length restrictions (SharePoint Server 2010)

Guide on resolving url length problem from the article:


  • Upgrade all the end-user browsers to Internet Explorer 8, which has a longer URL length limit.

  • Use shorter names for sites, folders, and documents and control the depth of the site and folder structures to reduce the lengths of URLs.

  • If possible or allowed, use ASCII names for sites, folders, and documents. This will avoid situations where the URL will be lengthened by being encoded.

  • To reduce the risk that the SharePoint Server 2010 end-users will encounter problems because of URL length limitations, we recommend that you apply the following effective limits in the deployment:

    • 256 Unicode (UTF-16) Code units - the effective file path length limitation, including a domain/server name

    • 128 Unicode (UTF-16) Code units - the path component length limitation

Monday, August 9, 2010

What's New of SmartTools for SharePoint Time Display Bug and Fix

If you have not heard of SmartTools for SharePoint, then you need to check it out. It has several very useful SharePoint 2007 extensions to "make your life as a SharePoint user, developer or administrator a little bit easier!", to quote from the site.

However, the WhatsNew web part displays the modified date and time coloumns incorrectly, specifically, it converts the time from SharePoint to local time one time more than necessary. For example, it shows "6:56 AM" for a document last modified at "11:56 AM". The SharePoint regioinal setting is US Central Time. You can see the difference is 5 housrs, which is the difference between US Central Daylight Time and GMT.

The fix is very easy. In the source code which you can download from the site, comment line 406 and 411, and uncomment line 407 and 410. See correct code below.

                    if (modifiedDateTime.Date == DateTime.Today)
                        row["ModifiedDate"] = "Today";
                    else
                    {
                        //row["ModifiedDate"] = SPUtility.FormatDate(SPContext.Current.Web, modifiedDateTime.Date, SPDateFormat.DateOnly);
                        row["ModifiedDate"] = modifiedDateTime.Date.ToShortDateString();
                    }

                    row["ModifiedTime"] = modifiedDateTime.ToShortTimeString();
                    //row["ModifiedTime"] = SPUtility.FormatDate(SPContext.Current.Web, modifiedDateTime, SPDateFormat.TimeOnly) ;


SPUtility.FormatDate assumes the given time is UTC time and converts to local time based on regional settings (See what is good to know about SPUtility.FormatDate). When the code gets the modifiedDateTime, it is local time already. Another conversion to local time therefore is not necessary.

In SharePoint, Datetime value is stored as UTC time. When setting datetime, SharePoint converts the input to UTC and stores the UTC value; when displaying datetime, SharePoint converts the UTC time to local time.

According to this blog sharepoint web services and utc time fun and games from Andy Burns, there is some kind of problem with web services.