Coding Groove Web Services Applications with the Groove 2007 SDK (Part 1 of 2)

Summary: Learn to develop Groove Web Services (GWS) applications using Microsoft Office Groove 2007 SDK and CodePlex GWS Helpers Library. (2 printed pages)

Office Visual How To

Applies to: Microsoft Office Groove 2007, Microsoft Visual Studio 2008

Supriyo "SB" Chatterjee, Microsoft MVP – Groove:Architecture

April 2009

Overview

Develop web services applications for Office Groove 2007 by using the Groove SDK and Visual Studio 2008. This is Part 1 of a two-part series on building Groove Web Services applications using the Groove SDK.

Code It

Download the Code Sample

Setting up the communications using the GrooveSettings Class.

C#
// Class for setting Groove communications parameters
// See MSDN article  - http://msdn.microsoft.com/en-us/magazine/cc163424.aspx
static class GrooveSettings
{
    /// <summary>
    /// Get the URL for Groove web services including the port
    /// </summary>
    public static string GrooveHost
    {...}
    /// <summary>
    /// Get the LocalRequestKey for authentication
    /// </summary>
    public static string RequestKey
    {...}
    /// <summary>
    /// Get the LocalResponseKey for authentication
    /// </summary>
    private static string ResponseKey
    {...}

    /// <summary>
    /// Checks the returned response key
    /// </summary>
    public static void VerifyResponseKey(string returnedResponseKey)
    {...}
}

Reading Accounts and Identities

Groove Accounts Read2 call obtains all the installed accounts in the machine. Note the use of GrooveSettings class to set the call parameters. In our demonstration, there are two accounts on the system.

C#
// Set up the web service call for GrooveAccounts
GrooveAccounts.GrooveAccounts svc = new GrooveAccounts.GrooveAccounts();
svc.GrooveRequestHeaderValue = new GrooveAccounts.GrooveRequestHeader();
svc.GrooveRequestHeaderValue.GrooveRequestKey = GrooveSettings.RequestKey;
svc.Url = GrooveSettings.GrooveHost + "/GWS/Groove/2.0/Accounts/";

// Get all the accounts on the client machine
GrooveAccounts.Account2[] accounts = svc.Read2();

Groove Identities are obtained from each Account obtained in the above Accounts call.

C#
// Load all identities
_identities = new List<GrooveAccounts.Identity2>();

foreach (GrooveAccounts.Identity2 identity in account.Identities)
{...}

Reading Spaces and Tools

Groove Spaces are obtained from each Identity obtained above.

C#
// Set up the web service call for GrooveSpaces
GrooveSpaces.GrooveSpaces spc = new GrooveSpaces.GrooveSpaces();
spc.GrooveRequestHeaderValue = new GrooveSpaces.GrooveRequestHeader();
spc.GrooveRequestHeaderValue.GrooveRequestKey = GrooveSettings.RequestKey;
spc.GrooveRequestHeaderValue.GrooveIdentityURL = identity.URI;
spc.Url = GrooveSettings.GrooveHost + identity.Spaces;

// Get the list of spaces
GrooveSpaces.Space[] allSpaces = spc.Read("");

Groove Tools from each Space are obtained from each Space. If the Groove user is a member of a space but the space is not installed locally on the system, the example does not attempt to get information about the tools. This information is available only for spaces that are installed locally.

C#
if(space.Local) // only spaces that are local
{
    // Set up the web service call for GrooveTools
    GrooveTools.GrooveTools stl = new GrooveTools.GrooveTools();
    stl.GrooveRequestHeaderValue = new GrooveTools.GrooveRequestHeader();
    stl.GrooveRequestHeaderValue.GrooveRequestKey = GrooveSettings.RequestKey;
    stl.GrooveRequestHeaderValue.GrooveIdentityURL = space.IdentityURL;
    stl.Url = GrooveSettings.GrooveHost + space.Tools;
    GrooveTools.Tool[] tools = stl.Read();
    ...
}
Read It

Run the demonstration example using F5 Debug key. The application writes out the following in sequence –

  • Account Name

  • Identity Name

  • List of Spaces

  • List of Tools per Space

At the end of each loop (per Account) – the applications writes out the above list for another account present in the client.

Compare this example with the code and output from the second part of the demonstration: Coding Groove Web Services Applications with CodePlex GWS Helpers (Part 2 of 2)

See It Video splash screen

Watch the Video

Video Length: 00:05:07

File Size: 8.2 MB WMV

Explore It
Tags :


Page view tracker