Platform SDK: Team Productivity Update

TeamAppManager::RegisterAppFactory[C++]

TeamAppManager.RegisterAppFactory[Visual Basic]

The RegisterAppFactory method notifies the Team Productivity Update that an application is available for instantiation within a Team Workspace. This method is called during an application's setup on the server computer.

[C++]
HRESULT RegisterAppFactory(
    BSTR* pbstrFactoryID,
    BSTR bstrInstantiate,
    TeamAppFactoryType type,
    BSTR bstrFriendlyName,
    BSTR bstrIconPath,
    BSTR bstrDescription
);
[Visual Basic]
Function RegisterAppFactory(
bstrInstantiate As String, 
type As TeamAppFactoryType, 
bstrFriendlyName As String, 
[bstrIconPath As String = "0"], 
[bstrDescription As String = "0"]) As String

Parameters

bstrInstantiate
[in] The URL that contains the Active Server Pages (.asp) file called to instantiate an application in a Team Workspace.
type
[in] Designates the type of instantiation the URL in bstrInstantiate will perform. The type parameter is an enum defined using typedef as TeamAppFactoryType.

The following table describes the constants passed to indicate the instantiation mode an application can invoke.
Constant Integer value Usage
TAFT_LINK 1 When an application only puts a link on a Team Workspace and supports none of the Team Workspace interfaces.
TAFT_DEPLOY 2 When an application can instantiate itself without any input from an administrator or Team Workspace owner.
TAFT_FACTORY 3 When the application needs information from the Team Workspace owner prior to instantiation. When this value is passed, bstrInstantiate must return an XML stream that specifies a URL for Configure, a URL for Deploy, and an optional URL for Cancel. For more information, see Instantiation URL: Configure URL and DeployURL.

bstrFriendlyName
[in] The name of the application used in various user interface elements in the Team Productivity Update. The friendly name is the default name for the link to the application placed on Outlook Bar of the requesting Team Workspace.
bstrIconPath
[in, optional, defaultvalue(NULL)] A path to an icon that can be displayed, along with the application's friendly name, on the Outlook Bar of the requesting Team Workspace. The bstrIconPath parameter should be the path to a particular default icon for an application. Team Productivity Update reads and caches the icon once the application has been instantiated. A user can change the icon, but the change will only affect the user's local version and will not be propagated back to the original icon path.
bstrDescription
[in, optional, defaultvalue(NULL)] Provides a description of the application so the Team Workspace owner can understand the application before requesting it.
pbstrFactoryID[C++]
[out, retval] A pointer to a GUID used by the Team Productivity Update to identify a Team Workspace registered application.

Return Values[C++]

S_OK
The Team Productivity Update was successfully notified of the application.
E_FAIL
An error occurred during notification.

Return Values[Visual Basic]

pbstrFactoryID
A GUID used by the Team Productivity Update to identify a registered team application.

Example[C++]

For a discussion of sample code that uses the TeamAppManager::RegisterAppFactory method, see TeamAppManager Method Calls .

Example[Visual Basic]

The following code sample creates an instance of the TeamAppManager object and calls the RegisterAppFactory method. This procedure handles the Register button's Click event on the form described in Gathering Parameters with a Visual Basic Form. Note that the code uses a combo box control to gather the TeamAppFactoryType parameter.

Private Sub cmdRegister_Click()
    Dim oTK As TeamAppManagerLib.TeamAppManager
    
    On Error GoTo ErrorHandler
    
    ' Create a new instance of the TeamAppManager
    Set oTK = New TeamAppManagerLib.TeamAppManager
    
    ' Register the application with the TPU and display the new FactoryID (GUID)
    txtFactoryIDResult.Text = oTK.RegisterAppFactory( _
                        txtInstantiateURL.Text, _
                        cmbTeamFactoryType.ItemData(cmbTeamFactoryType.ListIndex), _
                        txtFriendlyName.Text, _
                        txtIconPath.Text, _
                        txtDescription.Text)
    
    ' Cleanup
    Set oTK = Nothing
    
    Exit Sub
ErrorHandler:
    MsgBox Err.Description
End Sub