Implementing an Event Sink and Event Handlers

In the FileNet Application Integration Add-In architecture, events are handled through the use of an event sink which is responsible for trapping events fired from the infrastructure and routing them to the appropriate event handler. Both the event sink, as well as the event handlers must be implemented by the third-party application.

During command execution, the ExpressAddin component and Application Integration Add-In infrastructure perform operations until information or behavior is required from the third-party application. At that point, events are fired to request the information or behavior from the application. The events are trapped by the event sink and are routed to the corresponding _IExpressAddinEvents interface event handler method. The event handler performs the required action and transfers any requested information back to the ExpressAddin. This process continues until the command has completed execution.

Each FileNet Application Integration command that is supported for use by the ExpressAddin component has a corresponding set of event handlers. For every command that an Add-In application intends to execute, the application must provide these valid event handlers in order to manage the events fired by the command. The Add-In Sample Application demonstrates how to implement the event sink and basic event handlers.

The following table lists the required event handlers for each supported FileNet Application Integration command. The table also describes how the client preference settings are used by the commands, and identifies which portions of the FileNet Workplace GUI are displayed during command execution. (The client preference settings are specified in the bstrPreferencesXml parameter of the IExpressAddin::Startup method.)

Supported Command Required Event Handlers

Add Document
using Add Wizard

  1. OnAppBeginWaitCursor
  2. OnAppExistsActiveDocument
    1. The document must be inspected to see whether it is new or modified:
    2. If new or modified, the document must eventually be saved:
  3. OnAppGetActiveDocumentPath
    • If the user is not already logged on when this command is executed, the FileNet Workplace Login dialog is displayed.
    • The FileNet Workplace Add Wizard is displayed to guide the user through the process of adding a document.
  4. OnAppCloseActiveDocument
  5. OnAppEndWaitCursor

Add Document
using Entry Template

This command requires the same list of event handlers as the Add Document using Add Wizard command. The only difference is that this command displays the FileNet Workplace Add Via Template Wizard to guide the user through the process of adding a document, rather than the Add Wizard.

Add Folder
using Add Folder Wizard
  1. OnAppBeginWaitCursor
  2. OnAppEndWaitCursor
Cancel Checkout

This command requires the same list of event handlers as the Add Document using Add Wizard command. However, the following differences exist between this command and Add Document using Add Wizard:

  • The OnAppCloseActiveDocument handler does not need to be implemented in order to use this command.
  • This command does not display the Add Wizard; it displays the FileNet Workplace Cancel Checkout JSP page to enable the user to cancel the checkout operation.
  • The applicationMimeTypes setting of the bstrPreferencesXml parameter is used to filter which documents are displayed (if necessary).
Checkin Document
using Checkin Wizard

This command requires the same list of event handlers as the Add Document using Add Wizard command. However, the following differences exist between this command and Add Document using Add Wizard:

  • This command does not display the Add Wizard; it displays the FileNet Workplace Checkin Wizard to enable the user to check-in the document.
  • The applicationMimeTypes setting of the bstrPreferencesXml parameter is used to filter which documents are displayed.
Checkin Document
using Quick Checkin

This command requires the same list of event handlers as the Add Document using Add Wizard command. However, the following differences exist between this command and Add Document using Add Wizard:

  • This command does not display the Add Wizard; it displays the FileNet Workplace Checkin Wizard to enable the user to quickly check-in the document. The contents of the Checkin Wizard pages are modified to support the quick checkin process.
  • The applicationMimeTypes setting of the bstrPreferencesXml parameter is used to filter which documents are displayed.

Get Info

This command requires the same list of event handlers as the Add Document using Add Wizard command. However, the following differences exist between this command and Add Document using Add Wizard:

  • The OnAppCloseActiveDocument handler does not need to be implemented in order to use this command.
  • This command does not display the Add Wizard; it displays the FileNet Workplace Properties JSP page page for the document.
  • The applicationMimeTypes setting of the bstrPreferencesXml parameter is used to filter which documents are displayed.
Logoff
  1. OnAppBeginWaitCursor
  2. OnAppEndWaitCursor
Open
using My Checkouts
  1. OnAppBeginWaitCursor
    • If the user is not already logged on when this command is executed, the FileNet Workplace Login dialog is displayed.
    • The FileNet Workplace Checkout List JSP page is used to display the list of documents available for opening.
    • The applicationMimeTypes setting of the bstrPreferencesXml parameter is used to filter which documents are displayed.
  2. OnAppOpenDocument
  3. OnAppEndWaitCursor
Open
using Select Item

This command requires the same list of event handlers as the Open using My Checkouts command. However, this command differs from Open using My Checkouts in that it displays the FileNet Workplace Select Item (Open) JSP page to display the list of documents available for opening, rather than the Checkout List JSP page. In addition, this command does not use the applicationMimeTypes setting of the bstrPreferencesXml parameter to filter which documents are displayed.

Save Document

This command requires the same list of event handlers as the Add Document using Add Wizard command. However, the following differences exist between this command and Add Document using Add Wizard:

  • The OnAppCloseActiveDocument handler does not need to be implemented in order to use this command.
  • This command does not display the Add Wizard; it displays the FileNet Workplace Save JSP page to enable the user to save the document.
  • The applicationMimeTypes setting of the bstrPreferencesXml parameter is used to filter which documents are displayed.
Show My Inbox Tasks
  1. OnAppBeginWaitCursor
  2. OnAppEndWaitCursor
Insert >
Insert a Hyperlink
  1. OnAppBeginWaitCursor
  2. OnAppExistsActiveDocument
    • If the user is not already logged on when this command is executed, the FileNet Workplace Login dialog is displayed.
    • The FileNet Workplace Insert Hyperlink page is displayed to enable the user to insert the hyperlink into the document.
  3. OnAppInsertHyperlink
  4. OnAppEndWaitCursor