Readme for TFSWebParts
This project is based upon ideas from http://www.codeproject.com/KB/dotnet/TFS-WorkItemTracking-Web.aspx. These have been pulled apart and re-worked into a pair of webparts for used on any ASP.NET 2.0 hosting service such as IIS or SharePoint
The Visual Studio 2008 solution contains two projects:
• A DLL with the two WebParts
o One to do the connection to the TFS server and list work items
o One to display details drawn from the first
• A test harness using ASP.NET WebPartZones
The DLL project, as well as building the assembly, will also produce a .WSP file to allow the webparts to be installed as a feature into a SharePoint 2007 server farm. An example batch file with the required STAADM commands to install the feature is also provided.
Usage:
1. Load the solution in VS2008 (if you need to use VS2005 you will need to recreate the solution file, and point at the right TFS API DLLs, but everything else should work)
2. Run the test harness project (note as we are using webparts it will have to create a local ASPNETDB.MDF files the first time it runs. The DB contains the config for the webparts so you will see nothing on the first loading until you setup the parameters)
3. In the test page select the edit mode at the top of the page, then edit the list webpart in WebPartZone1, enter the following:
• TFSServerURL – the TFS server e.g. http://tfs.mydomain.com:8080
• TFSDomain – the domain used to authenticate against e.g. mydomain
• TFSUsername – the user name to connect to the TFS server as, we create a dedicated user for this webpart to login as.
• TFSPassword – the password used to authenticate with (shown in clear text)
• TFSAllowedWorkItemTypes – a comma separated list of work item types to be listed in the control, must match types in the [System.WorkItemType] field in the TFS DB. Depending on the process template in use the types will vary but as a start in most templates there is a ‘bug’ type.
• TFSDefaultProject – the name of the default TFS project to select on loading, can be left blank
• TFSPagingSize – the number of rows to show in the list of work items
• TFSShowOnlyDefaultProject – if this is set only the default project is listed in the available projects – this means a single TFS user, which can see many projects, can be used for different webpages and the project shown locked down with this parameter
• TFSUsePaging – set if the list of workitems should be paged
4. Once this is all done and saved you should be able to a list of projects and workitems in the first webpart.
5. To wire the two webparts together select the connection mode radio button at the top of the page
• On the web part in WebPartZone2 select the connect option
• In the connections zone that appears create a new connection to link the two webparts
6. Once this is done you should see the detail of any given workitem when it is selected from the list. The problem is you see all the fields in the work item (useful for debugging)
7. Put web page back into edit mode and edit the settings on the details web part
• TFSFieldsToShow – a comma separate list of field names to be shown.
• TFSShowAllField – if checked the TFSFIeldsToShow is ignored