July 2004 - Posts

Blogging is really catching up in Belgium: today I would like to welcome Alain Leroy, yet another Microsoft Belux employee! I guess Microsoft Belux wants to beat the U2U blogging team (see Patrick’s post). :-) At this moment I think it’s a draw (MS Belux 4 - U2U 4), let’s start to count the posts… Just kidding, as I always say: it’s a quality thing.

Happy blogging guys!

A common requested feature for SharePoint sites is to produce RSS feeds based on the contents of a SharePoint list or document library. Even Scoble asked for it, and it’s still not available! :-) Luckily there is a great SharePoint community that has created some nice solutions.

But it seems that Microsoft itself is looking for a solution too, a few weeks ago I got an email from Tim, an intern at Microsoft, asking for some input concerning RSS in SharePoint. During our conversations Tim explained that they are looking to make feeds as customizable as possible, so users can have multiple “views” on a specific list (even sorting and filtering should be possible). A feed that syndicates multiple lists on a site also has been discussed. Of course Tim could not make any promises but at least it sounds great.

So what’s your idea about syndication in SharePoint? Microsoft is eagerly looking for input, so drop your requests as a comment and I’ll make sure Tim gets them.

From the Download Center...

Quick Info

File Name:

ipvsproj.exe

Download Size:

17699 KB

Date Published:

7/27/2004

Version:

1.0

Intresting: “For a limited time, the InfoPath Toolkit for Visual Studio .NET 2003 is available as a free web download. Please note that this free download will only be available through February 28, 2005.

The InfoPath 2003 SP1 Preview expires July 31st 2004, that's in 4 days. I hope they will release the final version of the SP really soon...

Update: It seems that the InfoPath SP1 is part of Office 2003 SP1, great!

Another Belgian has started a weblog! This time it's Peter Himschoot, a BizTalk expert. Welcome Peter!

For those of you who don’t know the SmartPart for SharePoint; a little introduction:A SharePoint web part that can host any ASP.NET user control. Create your web parts by using the VS.NET designer instead of coding everything by hand!

In the last weeks Fons and I have worked on some cool new functionality, you can download the new release (version 0.2.0.1) from the GotDotNet Workspace. To install the SmartPart, execute the MSI Package that’s included. Due to some internal changes, the SmartPart assembly must be deployed to the Global Assembly Cache (GAC), hence if you’re prompted by the installer, choose ‘Yes’. For this release you need to manually alter the web.config file and set the trust level in the system.web section to WSS_Medium (see the readme file for more info). I’m working on this to avoid the manual intervention (already many thanks to Maxim for his help). So, what’s the cool new stuff in this release?

  • Exposing user control properties in the properties toolpane. In the previous versions you needed to implement the IPropertyProvider interface so the SmartPart properties toolpane would display some properties of the user control it contained. These days are over, you can now add the Browsable attribute to every property you want to be exposed. That’s it! By using the Description attribute you can control the caption of the property in the toolpane. Both attributes are in the System.Componentmodel namespace.

  • Dropdown list for easy selection of user controls. In the previous versions the location of the user control needed to entered manually (e.g. “~\UserControls\HelloWorld.ascx”). In the new version you can choose between two web parts: one similar to version 0.1.x (with a textbox as input) and another one with a dropdown list that contains all available user controls. By default the SmartPart List web part will look in the \UserControls directory which user controls are available. If you prefer another location, you can easily change it in the DWP file.

To illustrate how to use the new stuff and to show how easy it is, let’s create a small demo web part. Let’s create a web part that displays the name of the currently logged on user. In Visual Studio, create a new ASP.NET Web Application. Add a new Web User Control to the project, for example UserInfo.ascx. Add a reference to the SmartPart.dll, which is included in the download, and to the Microsoft.SharePoint dll, which you can find on your SharePoint server. Suppose we want to be able to let the user choose a prefix that should appear in front of the user name (e.g. “Current user John Doe”). So we’ll need to create a property Prefix and decorate it with the Browsable attribute. For a good user experience we also add the Description attribute to specify how the property is presented to the user. Add a Label control that will contain the actual text. Because we want to display the user that is currently logged on, we’ll need access to the SharePoint object model. That’s quite easy, just implement the SmartPart.IUserControl interface. Finally we need to add the code to display the prefix and username to the Page_Load function. To finish of, you can add a Description attribute to the class too, so it gets a nice name in the SmartPart dropdown list. The complete code of the user control could look like this:

[System.ComponentModel.Description("Hello World Demo")]
public class UserInfo : System.Web.UI.UserControl, SmartPart.IUserControl
{
            private string _prefix = null;
            protected System.Web.UI.WebControls.Label Label1;
            private Microsoft.SharePoint.SPWeb _web;
            
            [System.ComponentModel.Browsable(true),
             System.ComponentModel.Description("Prefix to display")]
            public string Prefix 
            {          get { return _prefix; }
                        set { _prefix = value; } }
            public Microsoft.SharePoint.SPWeb SPWeb 
            {          get       { return _web; }
                        set       { _web = value;          } }
            private void Page_Load(object sender, System.EventArgs e)
            {
                        Label1.Text = this.Prefix + this.SPWeb.CurrentUser.Name;
            }
            #region Web Form Designer generated code
            // Left out..
            #endregion
}

After you’ve build the project, the deployment can start. You need to copy two files: copy the UserInfo.ascx to the \UserControl folder in the folder that maps to your SharePoint site (e.g. C:\Inetpub\wwwroot\UserControls) and copy the UserInfo.dll to the \Bin folder (e.g. C:\Inetpub\wwwroot\Bin). If the UserControls folder does not exist, you can create it (it’s not a default SharePoint folder). Now drag-and-drop an instance of the SmartPart List web part to a site, and choose the “Hello World Demo” control from the drop down list.

To obtain the complete call stack instead of the default error page, you can alter the web.config file: set the ClassStack value to true in the SharePoint section:
<SafeMode MaxControls="50" CallStack="true"/>

Additionally make sure the CustomeErrors mode value (in the system.web section) is set to “off”:
<customErrors mode=”Off”>

More info, tips and tricks in following article: Debugging Web Parts.

Last week I received the new issue (#5) of “.NET Magazine”, I was happy to see that an article I wrote some time ago is finally published! It’s about how you can fine-tune Visual Studio to be even more productive. In the article I describe a macro to convert the declarations of private fields to public properties. Unfortunately the code of that macro isn’t published. Luckily David Cumps noticed it, he provides a link where a slightly different version (by Fons Sonnemans) can be downloaded.

If you live in Belgium, Luxembourg or The Netherlands and you want to have a free subscription to this magazine, register here. Recommended!

Note to self: take a look at this: a webpart (!) that generates a RSS feed for a SharePoint site. Thanks Maurice Prather!

http://www.bluedoglimited.com/Downloads/pages/SyndicationGenerator.aspx

The Syndication Generator for Windows® SharePoint® Services is a web part based RSS generator.  The web part is highly configurable and requires no access to the server once it has been installed.  This is the main advantage of the tool when compared to existing RSS feed generators.

Creating an RSS feed for your SharePoint server has never been easier.  Drag/drop the web part onto your page, pick the list you wish to syndicate, and ... tada! Your feed is up and runing in no time flat.

I didn't expect it so soon, but it seems V1 of the Information Bridge Framework can be downloaded!

Microsoft Office Information Bridge Framework 1.0
The Microsoft® Office Information Bridge Framework 1.0 enables developers to quickly create and deploy flexible, custom solutions that adapt to an organization’s existing IT infrastructure and require little or no adjustment of back-end systems.

Quick Info

Download Size:

389 KB - 4360 KB

Date Published:

7/1/2004

Version:

1.0

More Posts