Teamspaces

Teamspaces contain the objects and processes that describe a set of collaborative activities among a specified group of users. Each new teamspace, such as the default teamspace installed by the FileNet Team Collaboration Manager application, provides a structure to contain and manage documents, folders, tasks, meetings, discussions, polls, member data, workflow data, custom objects, and all other elements and processes that together represent an independent collaborative work environment. Content Engine object stores can contain any number of teamspaces.

The Collaboration API contains elements that developers can use to create, access, and manage teamspaces from within FileNet P8 applications. Key member elements are:

Creating a Teamspace

The following code describes how a teamspace is created in a known object store. For information on creating and managing object stores, see the Content Java API topic, Working With Object Stores.

    /*
      If parentFolder is null, the teamspace is created in the
      specified object store's rootFolder.
    */
    Folder parentFolder = (Folder) objectStore.getObject(ObjectStore.TYPE_FOLDER,
      "/" + TEAMSPACE_PARENT_FOLDER_NAME);

    String ownerID = CollaborationFactory.getCurrentUserId(objectStore);

    /*
      null or Collaboration.COLLABORATION_TEAMSPACE_CLASSNAME (default)

    */
    String teamspaceFolderClass = null;

    String teamspaceName = "NewTeamspace";

    Properties teamspaceProperties = ObjectFactory.getProperties();
    Property teamspaceProperty = ObjectFactory.getProperty(Collaboration.DESCRIPTION_SYMNAME);
    teamspaceProperty.setValue("Description of Teamspace");
    teamspaceProperties.add(teamspaceProperty);

    /*
      Populate the teamspace membership: get user or group object
      For information on populating a teamspace with group information,
      see the Content Java Java API topic,
      Working With High-Level Objects: Working with Realm Objects
      and the getUsers() method,
      Users and Groups
    */
    SubjectInfo teamspaceMembers = CollaborationFactory.getSubjectInfos
      (session, new String[] {users}, null, vwSession);

    /*
      A null containerInfo parameter generates only the standard teamspace containers;
      see the API entries for ContainerInfo and ContainerDefinition
      for information on adding custom containers
    */
    ContainerInfo[] containerInfo = null;

    /*
    For sample code demonstrating how to 
    connect to the Process Engine Router and get a VWSession object,
    see Create a Workflow Subscription in the Content Java Developer's Guide.
    */
    VWSession vwSession = getVWSession();

    Teamspace teamSpace = CollaborationFactory.createTeamspace (
        objectStore,
        parentFolder,
        ownerID,
        teamspaceFolderClass,
        teamspaceName,
        teamspaceProperties,
        teamspaceMembers,
        containerInfo,
        vwSession );

Performance Note

Important: An instance of a Teamspace object caches member and container data so as to avoid frequent roundtrips to reacquire that data. To prevent unnecessary roundtrips, it is recommended that an application cache teamspace objects and that the cached objects be used until a specific user request to refresh teamspace data is issued and a new instance of the teamspace is retrieved.

Additional Information

For information on how teamspaces are created and managed within the FileNet P8 TCM application, see Overview of Teamspaces.