Friday, May 22, 2009

SPHttpUtility, a hidden gem

Recently we converted a Rich text field to a plain text field in a content type which resulted in raw html tags messed up with the plain text. There are lot of options to clean a html text to a plain text. We can use Regex, a custom approach etc.

But there is an OOTB way to do it which is hidden in SPHttpUtility class. It has a method called SPHttpUtility.ConvertSimpleHtmlToText which accepts an input html string and max length of input string. This class is specific to WSS Specific Rich text field as per the documentation. Specifying -1 to the max length property will make no maximum length.

We can use this method across the site to update all metadatas to clean up the html strings

This SPHttpUtility is coming in Microsoft.Sharepoint.Utilities namespace more information can be found in MSDN

Friday, May 15, 2009

Free EBook- Virtualization For dummies

Virtualization For Dummies, Sun and AMD Special Edition explains how virtualization works and how it can benefit an organization. The book covers the kinds of issues virtualization can address and how it addresses them.

Virtualization allows you, virtually and cost-effectively, to have two or more computers, running two or more completely different environments, on one piece of hardware. This technology promises to usher in an entirely new wave of hardware and software innovation. It is also designed to enable a generation of more energy-efficient computing
Download Virtualization For dummies

Wanna give a try to Sun's virtualization product then try Virtual Box, an open source technology which comes under GNU public license runs on Windows, Linux, Macintosh & openSolaris.It supports a large number of guest operating systems.