Stuff about Software Engineering

Month: September 2007 (Page 1 of 4)

Plan for building multilingual solutions by using SharePoint Products and Technologies

This white paper provides information and guidelines for using Microsoft Office SharePoint Server 2007 in scenarios where content is managed across different languages. It details most of the functionality provided by Office SharePoint Server 2007 and suggests how to use it to manage multilingual scenarios. It also provides examples for creating custom Web Parts by using Microsoft Visual Studio 2005 and how to configure and manage them by using Microsoft Office SharePoint Designer 2007, the next generation of Web designer tools specifically designed for SharePoint sites. Microsoft Windows SharePoint Services 3.0 features and functionality, and how they add value to the end-user experience, are also described.
Highly recommended!

Howto use calculated fields in WSS lists even though it’s not supported

It turns out that [Today] and [Me] can’t be used in calculated fields in WSS lists.
However, there’s a bug (or feature) which allows us to use at least the [Today] any way.
In a list create a column with the name “Today”. It doesn’t matter but use the Date field type.
Now in a calculated field it’s possible to add the Today column and use it in a calculation like the age of something in years: =DATEDIF([Born];[Today],”d”)/365
Then delete the Today column – and now we’re set. WSS then replaces [Today] with the current date and the Age calculated field is filled with the Age in years.
Weird but true.
Here’s a some more reference information on calculated fields:

How to get a List of Web Parts on a Page

Using the SharePoint object model this is pretty easy, especially if you want to retrieve that list with code running in a web part. The WebPartManager property of the WebPart base class, gives you access to a collection of all the WebPartZones available on the page. Once you’ve got the zones, you can get the web part instances by using the WebParts property. The following web part code will display a small list of all the web parts found on the page, including the name of the web part class and the web parts zone:

using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using System.Web.UI.WebControls;

namespace WebPartLister
  public class WebPartLister : System.Web.UI.WebControls.WebParts.WebPart
    BulletedList list;

    protected override void CreateChildControls()
      list = new BulletedList();
      WebPartZoneCollection zones = this.WebPartManager.Zones;
      foreach (WebPartZone zone in zones)
        WebPartCollection webparts = zone.WebParts;
        foreach (WebPart webpart in webparts)
          string.Format(“{0} ({1}), {2}”,
            webpart.Title, webpart.GetType().Name,

    protected override void Render(HtmlTextWriter writer)

Using PowerShell to control Sharepoint

Announcing three CodePlex projects for community WCM code samples

Cross posting from Andrew Connell for later reference:

Announcing three CodePlex projects for community WCM code samples

Cross posted on Spencer Harbar’s Blog.

We (Andrew Connell & Spencer Harbar) would like to announce three new CodePlex projects created to enable the community to share examples of useful Publishing site elements built using the Web Content Management features of Office SharePoint Server 2007. Initially these projects contain a number of commonly used MCMS 2002 Placeholder controls converted for use within MOSS Publishing sites which have been graciously donated by Microsoft. Over time these samples will be augmented and enhanced. Future plans include the consolidation and alignment of deployment mechanisms of all code samples in all projects.

All the CodePlex projects listed below are released under the most permissive Microsoft license (Ms-PL) which means that you can do virtually anything you want with these code samples.

Many of the code samples include a MS Word document explaining the process of developing the code sample as well as deployment instructions.

The projects (and the included code samples) are broken down as follows:

SharePoint 2007 WCM Field Controls
A collection of sample Field Controls for use within Publishing Sites built using Office SharePoint Server 2007’s Web Content Management features.

  • MultimediaFieldControl: Custom field type and control allowing content authors to specify a URL, width and height of a media file (SWF, PDF, WMV, MPEG, AVI, MPG, MOV) and renders the display of the control with the appropriate ActiveX control markup.

SharePoint 2007 WCM Web Parts
A collection of sample Web Parts for use within Publishing Sites built using Office SharePoint Server 2007’s Web Content Management features.

  • FAQWebPart: Web Part that allows business users to contribute to a frequently asked questions list which is rendered with DHTML allowing users to expand/collapse each FAQ item.
  • RandomFlashMovieWebPart: Web Part that allows a content author to select one or more Flash movies from a SharePoint library. The Web Part will then display one of the Flash movies, at random, in display mode.
  • ThumbnailWebPart: Content authors can specify a SharePoint library containing images that the Web Part will generate thumbnails for. It allows content authors to specify the size, sort order and the number of thumbnails to be displayed in one row.

SharePoint 2007 WCM Utilities
A collection of useful utilities for Publishing Sites built using Office SharePoint Server 2007’s Web Content Management features.

  • METATagsGenerator: This ASP.NET 2.0 server control renders HTML <META> tags for each field in the current page’s content type.
  • PropertyBagFeature: Allows content authors to modify values within the property bag of pages… similar to the custom properties provided in MCMS 2002.
  • SharePointSSLHttpModule: Makes it easy for developers to SSL enable certain parts of a MOSS 2007 WCM Publishing site.
« Older posts

© 2024 Peter Birkholm-Buch

Theme by Anders NorenUp ↑