Programming Patterns with Publication

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Just as a client must subscribe to receive provisioned data, a client must publish to send presence data to a subscriber. More accurately, a client publishes data to an Office Communications Server computer. The server, in turn, provisions interested clients with the data.

Programming Patterns in Publication

A publication manager interface is obtained by casting from an enabled endpoint. It is a good idea to obtain the publication manager interface in the OnEnable event handler.

When you obtain the publication manager, you can call methods exposed by the publication manager to create publications and publish them.

Create a Publication

  • Get a publishable category instance to be published in one of two possible ways:

    • Call into CreatePublishableCategoryInstance on the category instance object that has been modified. This is appropriate when updating a category instance previously provisioned on the client in a self-subscription object. The category instance values must be updated on the original category instance before calling this method.
    • Call into CreatePublishableCategoryInstance on the publication manager object. Use this method when creating a new instance of a category that has not been previously published. Values are set on this category instance prior to publication.
  • Set publication operation values on each category to be published. Values can be UCC_PUBLICATION_OPERATION_TYPE.UCCPOT_NONE, UCC_PUBLICATION_OPERATION_TYPE.UCCPOT_ADD, or UCC_PUBLICATION_OPERATION_TYPE.UCCPOT_REMOVE. Use UCCPOT_NONE when you publish modified category instance values.

  • Instantiate a publication object by calling into CreatePublication on the publication manager.

  • Advise the new publication object of implemented publication event callback functions in your class.

    Note

    The class must implement the _IUccPublicationEvent dispinterface. Advising for these events allows the caller to receive operational status after a request to publish category data. For an example of an advising operation, see Advise for and Handle Events in a Unified Communications Client API Client.

  • Call AddPublishableCategoryInstance on the new publication object for each category instance to be published.

    Note

    The publication operation is considered to be atomic. This means that if a single category instance in the operation fails to publish, the entire publication operation fails.

  • Call Publish on the publication object.

See Also

Concepts

Publication and Subscription Objects