Identifying Groove Forms Tools
The various workspace tools each have a Type, which identifies the tool: Files, Discussion, Calendar, Forms, and so on.
The standard list of tool types in Groove V3 are:
urn:groove.net:platform.tools.Forms
urn:groove.net:platform.tools.Files
urn:groove.net:platform.tools.Discussion
urn:groove.net:platform.tools.Calendar
Within a Forms tool, the designer may also have specified a DesignName and DesignVersion; these are optional, but I'd strongly recommend you use them to label your tools. The design name is a URN. The design version is just a string, but I recommend choosing a "dotted numbers" format: at a minimum <majorversion>.<minorversion>. That way, it's easy to identify releases of the same tool with compatible schemas (same major-version) or incompatible schemas (different major-version), and to write code to handle your various versions appropriately.
I went back and added a nice long design-name, and a version number, to the Forms tool from earlier:

Now, our GWS application currently list all workspace tools in the tools combo-box. This can easily be reduced to only display Forms tools, by checking the tool's type:
Tool
[] tools = toolsService.Read();
// Add the tools to the combobox (unselected).
foreach (Tool t in tools)
{
// Only add the tool to the list if it's a Forms tool
if (t.Type == "urn:groove.net:platform.tools.Forms")
{
ToolsCombo.Items.Add(
new ToolInfo(t));
}
}
We want to further restrict this to only include Forms tools with the design-name we chose. Only those tools will have the correct schema, and the data-transfer portion of my little application will be hard-coded to only expect the fields I created in that forms tool. The code for this is slightly more involved, because DesignName isn't a property on the Tool; it's a property on a ToolProperties class, which requires one extra web-services call to Groove.
if (t.Type == "urn:groove.net:platform.tools.Forms")
{
// Query the forms tool to find its "design name"
// (property set by the forms designer).
// The contacts tool we can connect with has a known type (which we made up):
// urn:groove.net:pdc2005.demonstration.Contacts
// Only add these special tools to the tools combobox.
string toolURI = t.Data;
GrooveForms formsService = new GrooveForms();
formsService.GrooveRequestHeaderValue =
new GrooveFormsWebService.GrooveRequestHeader();
formsService.GrooveRequestHeaderValue.GrooveRequestKey =
GWSUtil.GrooveLocalRequestKey;
formsService.GrooveRequestHeaderValue.GrooveIdentityURL = selectedIdentity.URI;
formsService.Url =
GWSUtil.GrooveURL + toolURI;
ToolProperties tp = formsService.ReadToolProperties();
if (tp.DesignTemplateName == "urn:groove.net:pdc2005.demonstration.Contacts")
{
ToolsCombo.Items.Add(
new ToolInfo(t));
}
}
The behaviour of our application, once this code is added, isn't really optimal: you're presented with a list of workspaces, even those which don't contain any matching tools. Doing this "properly" is left as an exercise to the reader :-)