Reading Workspaces

The GrooveSpaces service accesses workspaces. This section covers the Read operation, which provides information about the specified identity's workspaces.

The GrooveSpaces Read operation gets information about the spaces of the specified type for the identity. Space types fall into two categories:

  • Standard workspaces—these workspaces are opened with the Groove Workspace Explorer and have the type “urn:groove.net:Groove.Core.Tools.System.TelespaceTypes.Generic”, which is the default in GrooveSpacesRead.

  • File Sharing workspaces—these workspaces are opened with Windows Explorer and have the type “urn:groove.net:Groove.Core.Tools.System.TelespaceTypes.GFS”.

To get information about all Groove workspaces other than Groove File Sharing workspaces, you should call the GrooveSpacesRead operation with an empty string for the SpaceType parameter. The Read operation returns information workspaces in an array of Space objects, each of which includes information such as:

  • Workspace name.

  • Description of the workspace.

  • Boolean specifying whether the workspace is local (whether it is on the system providing the service).

  • GrooveSpaces service URI, which allows you to create an invitation file for the workspace, delete the workspace, and update the workspace.

  • GrooveTools service URI, which provides access to the tools in the workspace.

  • GrooveMembers service URI, which provides access to the workspace members.

  • GrooveLocal service URI, which allows you to display the workspace properties to the user.

  • Number of unread items in the workspace.

  • Version of the workspace template, which helps you determine what version of Groove created the workspace and what versions of tools it may contain.

  • Information about when the workspace was created and when it was last modified.

If the workspace is available on the local system then you can discover the tools in the shared space by calling the GrooveTools service. In some cases, an identity can be a member of a workspace, but not have the workspace on the local system. Typically, this can occur when a user has a Groove account on more than one system. When this user accepts an invitation, the workspace is installed on the system on which they accepted the invitation, but is not on the user's other systems until they fetch it.

The following sample code reads the workspaces for an identity.

// Create new service and header
GrooveSpaces.GrooveSpaces spacesSvc = new GrooveSpaces.GrooveSpaces();
spacesSvc.GrooveRequestHeaderValue = new GrooveSpaces.GrooveRequestHeader();

// Get the Identity2 from GrooveAccounts.Read2
GrooveAccounts.Identity2 ident = ... ;

spacesSvc.GrooveRequestHeaderValue.GrooveIdentityURL = ident.URI;

// Get the request key, HTTP address, and port number.
// See examples in Reading Groove Registry Keys
string requestKey = ... ; 
string HTTPAddressAndPort = ... ;

spacesSvc.GrooveRequestHeaderValue.GrooveRequestKey = requestKey;

// Get the GrooveSpaces PostURL from Identity2
spacesSvc.Url =  HTTPAddressAndPort + ident.Spaces;

GrooveSpaces.Space[] spaces = spacesSvc.Read("");

for (int i =0; i < spaces.Length; i++)
{
    GrooveSpaces.Space space = spaces[i];
    string spaceName = space.Name;
    string spaceDescription = space.Description;
    string spacesURI = space.URI; // use for GrooveSpaces
    string toolsURI = space.Tools;  // use for GrooveTools
    string membersURI = space.Members; // use for GrooveMembers
    string localURI = space.LocalURI; // use for GrooveLocal

    // Test whether workspace is present on device
    if (space.Local)
    {
        // Can access workpspace tools
    }
}

The following sample demonstrates how to use GrooveSpacesRead to get information about File Sharing Workspaces:

GrooveSpaces.Space[] gfsSpaces = spacesSvc.Read(
    "urn:groove.net:Groove.Core.Tools.System.TelespaceTypes.GFS");

for (int i = 0; i < gfsSpaces.Length; i++)
{
    GrooveSpaces.Space space = gfsSpaces[i];
    string spaceName = space.Name;
    string spaceDescription = space.Description;
    string spacesURI = space.URI; // use for GrooveSpaces
    string membersURI = space.Members; // use for GrooveMembers
    string localURI = space.LocalURI; // use for GrooveLocal
}

When you get information about File Sharing Spaces, the returned Space types include an empty string for the Tools element. Consequently, you cannot read the tools in a File Sharing Space or access any of the files in the workspace through Groove Web Services.

Note

The Created and Modified date-times are specified as UTC date-times. If you want to display the equivalent local time, you must convert it from UTC to local time.

See Also

Reference

GrooveSpaces Web Service

Concepts

Creating Workspaces
Updating and Deleting Workspaces
Accessing Tools in a Workspace