Share via


IUccPublicationManager.CreateContainer Method

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.

Creates a container to set up new access permissions for the to-be-published category instances.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)

Syntax

'Declaration
Function CreateContainer ( _
    lContainerId As Integer _
) As IUccContainer
IUccContainer CreateContainer (
    int lContainerId
)
IUccContainer^ CreateContainer (
    int lContainerId
)
IUccContainer CreateContainer (
    int lContainerId
)
function CreateContainer (
    lContainerId : int
) : IUccContainer

Parameters

  • lContainerId
    A value of the LONG (int, for a .NET application) type. This specifies the ID of the container.

Return Value

A value of the IUccContainer** (IUccContainer, for a .NET application) type. This returns the newly created container on which a membership scope is set.

Remarks

A Unified Communications server provides a set of standard containers encapsulating the standard Access Control Lists. Normally a client will use these pre-existing containers for published catgory access control. In the event a local user needs a custom ACL for a subset of published categories, a new container must be created. The CreateContainer method returns a new empty container to be customized.

The following generalized programming steps should be followed to create and publish a new category:

  1. Create a new IUccContainer with call to CreateContainer

  2. Create a new IUccContainerMember with call to CreateContainerMember

  3. Add the new container member to the container with a call to IUccContainerMember.

  4. Cast the container to the IUccCategoryInstance.

  5. Create publishable container instance with call to CreatePublishableCategoryInstance.

  6. Add the publishable category to an IUccPublication object and call PublishableCategoryInstances.

Win32 COM/C++ Syntax

HRESULT CreateContainer
(
   LONG lContainerId,
   IUccContainer** pContainer
);

Note

In a Win32 application, the return value of a method or property is always an HRESULT value indicating the status of the call to the interface member. Any result of the operation is returned as a parameter marked with the [out, retval] attribute. In contrast, in a .NET application the HRESULT value indicating an error condition is returned as a COM exception and the [out, retval] parameter becomes the return value. For the UCC API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API.

Example

The following example creates a new IUccContainer object using the publication manager as a factory object. The example has assigned a container Id of 105 to the new container.

IUccContainer cc = pubMgr.CreateContainer(105);
IUccContainerMember cm = pubMgr.CreateContainerMember(
   "SIP:jaya@contoso.com",
   UCC_CONTAINER_MEMBERSHIP_SCOPE.UCCCMS_USER);
cc.AddMember(cm);
IUccCategoryInstance cx = cc as IUccCategoryInstance;
IUccCategoryInstance pcx = cx.CreatePublishableCategoryInstance();
IUccPublication pub = pubMgr.CreatePublication() as IUccPublication;

//advise for publication events to catch OnPublish
UCC_Advise<_IUccPublicationEvent>(pub, this);
pub.AddPublishableCategoryInstance(cat);
pub.Publish(null);

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2000 with Service Pack 4, Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

IUccPublicationManager Interface
IUccPublicationManager Members
Microsoft.Office.Interop.UccApi Namespace

Other Resources

Code Listing: Basic Event Registration and Other Helper Methods in C#