The Engine Room
The engine room is a place for people to contribute ideas on the development of Sharepoint, Visual Studio and information technology.

TFS Guide Beta 1 released

Microsoft TFS team has been working on TFS Guide project for a long time now and the beta 1 has finally been released. This guide will specially help those who want to start using TFS. As J. D. Meier suggests, “It's a distillation of many lessons learned” it can also be used by those who are facing any problems with TFS. This version of guide touches some of the important and essential parts of the entire TFS system. Here is the TOC:

Contents at a Glance

  • Part I, Fundamentals
  • Part II, Source Control
  • Part III, Builds
  • Part IV, Large Project Considerations
  • Part V, Project Management
  • Part VI, Process Guidance
  • Part VII, Reporting
  • Part VIII, Setting Up and Maintaining the Team Environment


Chapters

  • Introduction
  • Ch 01 - Introducing the Team Environment
  • Ch 02 - Team Foundation Server Architecture
  • Ch 03 - Structuring Projects and Solutions
  • Ch 04 - Structuring Projects and Solutions in Team Foundation Server
  • Ch 05 - Defining Your Branching and Merging Strategy
  • Ch 06 - Managing Source Control Dependencies in Visual Studio Team System
  • Ch 07 - Team Build Explained
  • Ch 08 - Setting Up Continuous Integration with Team Build
  • Ch 09 - Setting Up Scheduled Builds with Team Build
  • Ch 10 - Large Project Considerations
  • Ch 11 - Project Management Explained
  • Ch 12 - Work Items Explained
  • Ch 13 – MSF Agile Projects
  • Ch 14 - Process Templates Explained
  • Ch 15 - Reporting Explained
  • Ch 16 - Team Foundation Server Deployment
  • Ch 17 - Providing Internet Access to Team Foundation Server

I’ve downloaded a copy of the PDF and it looks really useful. Go ahead and give it a go yourself.

Thanks.

SQL Server Hosting Toolkit – Part 2

SQL Server Hosting Toolkit is a tool that makes it easier to deploy your SQL databases to a hosted environment from your local instance of the database. I wrote about it when the first version was released a few months ago. And now they have release the next version of it. This version includes updates like

·         Ability to select individual objects/tables for publishing

·         Performance improvements up to 30-40%

·         Usability and other bug fixes

This is a free download from Microsoft and I recommend people to use this if you are developing solution in any versions of MS SQL 2000 or above. It makes life so much easier.

Thanks.

Creating a custom search results page for a (searchresults.aspx) Windows Sharepoint Services (WSS) Site

When creating a site using Windows Sharepoint Services, search is typically managed at the web application level.  This means that although the pages you create for your site will inherit the styles and layout designated in your site masterpage, any search results will be displayed using the default web application theme. By taking the following steps, it is possible to customise the way search results are shown, without affecting other sites operating in your WSS web application.

Create a custom searchresults aspx page

When you perform a sharepoint site search, the search results are displayed using the searchresults.aspx page.  This is located in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS.  Copy the contents of this file.  Now, navigate to your site (using sharepoint designer), and create a new aspx page named ‘CustomSearchResults.aspx’.  Paste the contents of searchresults.aspx into your newly created page. At this point, you need to make two changes to the page.
Firstly, update the Page directive to point to your site masterpage. 
For ie, <%@ Page language="C#" MasterPageFile="~masterurl/default.master"  ... %>
In order to ensure that this is set out correctly, it is best to copy this from another page in your site that inherits from your site masterpage.
Secondly, remove unnecessary controls from the page.  There will be a number of controls registered at the top of the page; it is likely that these are already registered in your masterpage.  Therefore, remove all except the following controls:

<%@ Register Tagprefix="SharePoint" Namespace=
"Microsoft.SharePoint.WebControls" ...  %> <%@ Register Tagprefix="SearchWC" Namespace=
"Microsoft.SharePoint.Search
.Internal.WebControls"  ... %>
<%@ Register Tagprefix="WebPartPages" Namespace=
"Microsoft.SharePoint.WebPartPages" ... %>
Create a custom searchresults control
Your customised search results page is now inheriting from your masterpage.  In order to display the results of a given search, it is necessary to create a customised control to place on your masterpage. Navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES and locate SearchArea.ascx.  This is the control which displays the search bar on your site, and passes the search parameters supplied to the search results page.  Again, copy the contents of this file, and create a new CustomSearchBox.ascx control (this time, in the CONTROLTEMPLATES directory) with the pasted contents of SearchArea.ascx.
Open CustomSearchBox.ascx and make the following changes:

Firstly, update the referenced url to reflect your customised search results page, near the top of the page.


string strEncodedUrl= SPHttpUtility.EcmaScriptStringLiteralEncode(SPHttpUtility.UrlPathEncode(web.Url + "/CustomSearchResults.aspx", false, false));

Secondly, update the names of the searchscope and searchstring, near the bottom of the page.


<SELECT id='idSearchScope' name='CustomSearchScope' class='ms-searchbox' ... >>
<INPUT Type=TEXT id='idSearchString' size=35 name='CustomSearchString' display='inline'  ... >>

And, thirdly, update the javascript calls to reflect a custom search function.

<INPUT Type=TEXT id='idSearchString' size=35 name='CustomSearchString'  ... onKeyDown="return
CustomSearchKeyDown(event, <%=strEncodedUrl%>);"  ... >
<a target='_self' href='javascript:' onClick="javascript:
SubmitCustomSearchRedirect(<%=strEncodedUrl%>);javascript:return false;"  ... > </a>

Edit Core.js

In order to redirect the page to your custom search results page, we need to create a couple of custom javascript functions.  Navigate to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033, and open the Core.js file.  Search for the “SubmitSearchRedirect” function.  This is the default search function.  Unfortunately, the Form actions at the end cause sharepoint to require a screen refresh each time you navigate to your custom search results page.  To solve this, we can create a new function, as follows: (the new function ensures existing site search will remain unaffected)
function SubmitCustomSearchRedirect(strUrl)
{
                var frm=document.forms["frmSiteSearch"];
                frm=document.forms[MSOWebPartPageFormName];
                var searchText=frm.elements["CustomSearchString"].value;
                var searchScope=frm.elements["CustomSearchScope"].value;
                strUrl=strUrl+"?k="+escapeProperly(searchText)
+"&u="+escapeProperly(searchScope);
                window.location = strUrl;
}
 
Likewise, search for the SearchKeyDown function, duplicate it, and edit as follows:
function CustomSearchKeyDown(event, strUrl)
{
                if (IsKeyDownSubmit(event))
                {
                                SubmitCustomSearchRedirect(strUrl);
                                return false;
                }
                return true;
}
 

Adding your custom searchresults control to the site masterpage

You have now created a customised search control, which utilises a custom search results page.  In order to utilise this in your site, it is necessary to add the control to your masterpage.
This is a simple process, consisting of the following steps:
Firstly, register your control at the top of your masterpage.
<%@ Register TagPrefix="provoke" TagName="CustomSearchBox" src="~/_controltemplates/CustomSearchBox.ascx" %>
And, secondly, place the control at the appropriate location on your masterpage.
<asp:ContentPlaceHolder ID="ProvokeCustomSearch" runat="server">
<provoke:CustomSearchBox id="CustomPlaceHolderSearchArea" runat="server"/></asp:ContentPlaceHolder>
 
At this point, you should be able to run your site search (after a hard browser refresh), and view your customised search results page.