[Road to SharePoint 2010] New API Tree Friends (Part I)

OK, I admit that the title is a lame pun to the Happy Tree Friends cartoon series.

In this installment of the Road to SharePoint 2010 I want to introduce some new faces in the SharePoint 2010 API, as published by Microsoft in a CHM file. Even if it’s bare in documentation, we can see that many things have changed under the roof.

External Data in Lists

The SPList object now has a HasExternalDataSource boolean property that indicates that the list is a mirror of an external data source such as a database table. In this case, the SPList’s new property called DataSource points to an instance of a SPListDataSource class. This class implements the GetProperty and SetProperty methods that will be called when a field in a list item is get or set. SPListDataSource bridges the gap between SPList and external data in a much more natural way than the Business Data Catalog in MOSS 2007.

Of course, the external data capability is now built in the WSS 4.0 foundation, unlike BDC which was a MOSS-only feature.

[Road to SharePoint 2010] Repackage Your Developments for a Better Tomorrow

Today I want to comment on what should you take care of when preparing your SharePoint 2007 customizations for the 2010 world.

The Good Guys

“The Good Guys” are those customizations that should behave well when upgraded.

Features

The existing SharePoint 2007 features will (hopefully) upgrade with no fuss. By looking on the disclosed SP2010 SDK, one can see that the features will be able to “upgrade” themselves, invoking SPFeature.Upgrade method. This call will run the code you specify in the upgrade feature UpgradeReceiverAssembly property. This will probably be a special feature that will upgrade the rest of the features in a given scope.

This code from the SDK illustrates the issue:

Furthermore, it seems that the features will be properly versioned (at least). Again, I quote the SDK:

The value of this property can be different from the value of the Version property of the underlying feature definition. For example, you might deploy a feature that uses a feature definition with a version number of 1. At that point, both the feature instance and the feature definition have the same version number. Suppose that subsequently you modify the feature definition and re-deploy it with a version number of 2. Now the feature definition is version 2, but the feature instance remains version 1. That indicates that the feature instance needs to be upgraded. You need to run feature upgrade code to move the version of the feature instance from 1 to 2.

Solutions (WSP packages)

This recommended way of packaging the features and enhancements will hopefully upgrade straight-forward. Even more, it seems that it will be possible to “sandbox” a solution to limit its visibility to just a single site collection, without affecting the rest of the farm. The SDK mentions a SPUserSolution class (“This class allows solutions to be uploaded at the site collection scope and run in a sandbox.”).

Site Definitions

According to the STSADM preupgrade check operation, custom site definitions will have to be upgraded in-place with a Upgrade Definition File (an XML file, for sure). Hopefully, it won’t be a nightmare. Watch for a not-yet-released KB article 954761 that should explain it.

image

The Bad Guys

“The Bad Guys” are those customizations that you will have to rewrite or repackage in order to make them upgradeable.

Custom CAML and Ad-hoc Views

There’s new guy in town for list views in SP2010: XSLT. This standard format will replace the mutant CAML when it comes to defining the view rendering the list items. However, it comes with a price. The preupgradecheck tool will warn you which of your custom views will not be upgraded. You could leave it in CAML and SharePoint 2010 will render it well, but you will lose the new features of the XSLT-based views such as conditional formatting or SharePoint Designer 2010 customization support.

The tools mentions that “A list view using custom Collaborative Application Markup Language (CAML), a list view not associated with a Feature, or a list view associated with a custom Feature, will not be upgraded to the new XSLT-based list view”.

Custom CAML-Rendered Fields

Another CAML to XSLT victim. The custom fields that use CAML in its RenderPattern will not be upgraded to XSLT fields.

Custom Workflow Action Types

A minor issue, this one. You will have to keep a copy of your web.config and manually restore your custom workflow activity types defined in <authorizedType> tags, as they will be replaced with the new type versions.

Site and List Templates (STP files)

If you are the happy end-user that saves lists and sites for reuse as STP template files, bad news. STP files won’t be supported in SP2010, as they were present in SharePoint 2007 only to provide you with backward-compatibility with SharePoint 2003. You will have to rewrite them as site or list definitions. You can use a tool like SharePoint Solution Generator (part of the WSS 3.0 SDK) to reverse-engineer an existing site or list into a definition and then fine-tune them by hand.

[Road to SharePoint 2010] Getting Ready for 64-bit World

Welcome to the second installment of the Road to SharePoint 2010 series. I will tackle the oldest news for this SharePoint version: it will be released only as a 64-bit installation. So, how do we prepare for this requirement? Well, by getting ready with our shiny new 64-bit servers and virtual machines.

image 
(check the original scan from a 1983 magazine here)

The hardware and software requirements were outlined on the official SharePoint team blog.

Which hardware it will need?

64-bit hardware has been recommended for SharePoint 2007 for some time. Testing data shows that SharePoint hugely benefit from improved memory management in 64-bit environment. SQL Server is also memory-intensive application, so it will be grateful for the extended memory space. Roughly, the database will benefit the most, following by the front-end web servers, and the application servers will benefit the least.

Which Windows it will need?

SharePoint 2010 will run on Windows Server 2008 / 2008 R2 x64.

Which SQL Server it will need?

SharePoint will need SQL Server 2005 or 2008 / 2008 R2 x64.

What for the developer Virtual Machines?

You are strongly recommended to have a 64-bit host OS for 64-bit virtual machines, although you still can run a 64-bit VM in a 32-bit host OS. If you are using 32-bit OS for the host, you must have a 64-bit capable processor (check here) and activate the 64-bit virtual extensions in the BIOS (called Intel VT or AMD-V, depending on the CPU maker).

You can use the Sun Virtual Box software or VMWare to create the virtual machine. Unfortunately, Virtual Microsoft PC cannot accept 64-bit client OS in the VM.

Do I have to worry about my custom .NET code in SharePoint? How can I port it to 64-bits?

You will have to recompile your source code in 64 bits configuration (or in AnyCPU build configuration). The 64-bit NET cannot load a 32-bit-only assembly.

If you don’t have the source code, as with IFilters or third-party extensions, you will have to obtain the 64-bit version, if available. If not, you will have to remove that component from the farm.

As for the NET Framework in 64 bits, there are useful references at MSDN to help us migrate our existing code. In short, if you stick to the managed code, you shouldn’t have problems. The problems arise when you use platform-dependent (alias P-Invoke) operations that cross the managed code boundaries and access the Windows directly. There’s a known issue with int data type pointers coming from COM or P-Invoke layer, you should use IntPtr data type instead.

If you want the gory details of the 32-to-64-bits issues, Scott Hanselman has a nice blog entry about it.

How to migrate my SharePoint farm from 32 to 64 bits?

The best way is to do it gradually.First you move the database tier, then the application servers and finally the web servers, as illustrated on this figure. Do not mix 32 and 64 bit servers on the same tier.

image

The recommended steps are outlined in this TechNet article:  http://technet.microsoft.com/en-us/library/dd622865.aspx

[Road to SharePoint 2010] The Journey Begins Here

I’ve decided to start a new series of articles, called Road to SharePoint 2010. What I’m trying to achieve is to summarize what a SharePoint professional / developer must learn to smoothly transition to SharePoint 2010 when it becomes RTM. I hope that you will find it useful.

Enjoy the journey…

image

image

The Backpack: What Do I Assume?

  • You are a SharePoint 2007 Administrator / Developer / Consultant with 1 or more years of experience
  • You have a working knowledge of .NET Framework 3.5, Windows Server 2008 and SQL Server 2008

The Road Ahead: What Will I Post?

I will cover these topics about SharePoint 2010, with one or more posts for each main topic:

  • Harware and Software Requirements
  • Preparing Your Developments for the Upgrade
  • What’s New for Developers: Lap Around the SharePoint API Improvements
  • What’s New for Administrators: Managing SharePoint with New Tools

Warning Sign: Disclaimer

I have not signed any Microsoft Non-Disclosure Agreement for anything nor I’ve seen any non-public information about SharePoint 2010. I will base my posts on publicly available information, from Microsoft or other sources.