IVersionCol::Add

Meta Data Services Programming

Meta Data Services Programming

IVersionCol::Add

Adds an object version to the collection.

Syntax

HRESULT Add(     IRepositoryObjectVersion *pIReposVersion
    IRepositoryObjectVersion **ppIAddedVersion
);

Parts

*pIReposVersion

[in]
The IRepositoryObjectVersion interface pointer to the object version to be added to the collection.

**ppIAddedVersion

[in]

  1. For Target-Versions, ppIAddedVersion is the same as the first parameter: pIReposVersion.

  2. For Versions-of-Workspace, ppIAddedVersion is the workspace-scoped version of pIReposVersion.
Return Value

S_OK

The method completed successfully.

Error Values

This method failed to complete successfully.

Remarks

There are many different kinds of object version collections. You can apply this method to some of them, but not to others. This method works for:

  • TargetVersions collection. You can use this method to enlarge the set of versions of a particular target object that are related to a particular source object.

  • Contents collection. You can use this method to add an object version to the set of items contained in the workspace.

This method does not work for:

  • Predecessor collection. To enlarge an object version's set of predecessors, use the MergeVersion method of the IRepositoryObjectVersion interface.

  • Successor collection. To enlarge an object version's set of successors, use the CreateVersion method of the IRepositoryObjectVersion interface.

  • ObjectVersions collection. To enlarge an object's set of versions, use the CreateVersion method of the IRepositoryObjectVersion interface.

  • Workspaces collection. To enlarge the set of workspaces to which an object version belongs, you do not add a workspace to an object version—rather you add the object version to a workspace. In other words, you use the Add method of the IVersionCol interface. In this case, the version collection you are manipulating is the Contents collection, not the Workspaces collection.

  • Checkouts collection. To check out another item to a workspace, use the Checkout method of the IWorkspaceItem interface.

See Also

IVersionCol Interface