Provides access to members that manage versions.
Description
A VersionedWorkspace is a workspace that supports versioning. It provides the ability to set the version in which the workspace will reference. It also provides methods to enumerate through all the versions in the database and the ability to compress.
When To Use
The IVersionedWorkspace is the main interface for accessing versions. For example, use its methods to retrieve versions, find versions and create new versions.
Members
Name | Description | |
---|---|---|
Compress | Compresses the database by removing states not referenced by a version. | |
DefaultVersion | The Default version. | |
DescendantVersions | A list of descendant versions of a version that can be sorted to optimize reconcile and post. | |
FindVersion | Finds a specific version given it's name. | |
ParentVersions | A list of versions that have child versions. | |
RecommendedReconcileOrder | An ordered list of versions that can be used to optimize reconciliation against the default version. | |
RecommendedSyncOrder | An ordered list of replicas that need to be synchronized in order to optimize reconciliation against the default version. | |
Versions | All versions the user owns and those which are public or protected. |
IVersionedWorkspace.Compress Method
Compresses the database by removing states not referenced by a version.
Public Sub Compress ( _
)
public void Compress (
);
Errors Returned
FDO_E_NO_PERMISSION: No permissions to compress.
FDO_E_SE_STATE_TREE_INUSE: Attepting to lock entire state tree, but state locks are present.
Remarks
Versioned workspace compression is available using the Compressmethod. Compressing the versioned workspace will remove those database states not referenced by a version.
Only the ArcSDE administrator user can execute the compress method.
IVersionedWorkspace.DefaultVersion Property
The Default version.
Public ReadOnly Property DefaultVersion As IVersion
public IVersion DefaultVersion {get;}
Remarks
`The DEFAULT version is always owned by the ArcSDE administrative user. The version is required by the geodatabase and its access property should remain public or protected.
If it is the application developer's goal to obtain a reference to the DEFAULT version, it is recommended to use the DefaultVersion property as opposed to passing in a literal string to FindVersion method. The DefaultVersion method will always return a IVersion object referencing the default version of the workspace from which the name can be obtained through VersionName property on the IVersionInfo interface.`
IVersionedWorkspace.DescendantVersions Property
A list of descendant versions of a version that can be sorted to optimize reconcile and post.
Public Function get_DescendantVersions ( _
ByVal Version As String, _
ByVal orderForReconcileAndPost As Boolean _
) As IEnumVersionInfo
public IEnumVersionInfo get_DescendantVersions (
string Version,
bool orderForReconcileAndPost
);
IVersionedWorkspace.FindVersion Method
Finds a specific version given it's name.
Public Function FindVersion ( _
ByVal Name As String _
) As IVersion
public IVersion FindVersion (
string Name
);
Errors Returned
FDO_E_SE_VERSION_NOEXIST: Version not found.
Remarks
FindVersion returns an IVersion interface which is commonly used to read or set a version's properties. The interface requires a string as input. The value of the string is case sensitive and a version's owner should be prefixed as owner.version. If an owner is not specified, only the versions which the user is connected owns are searched.
If it is the application developer's goal to obtain a reference to the DEFAULT version, it is recommended to use the DefaultVersion property as opposed to passing in a literal string to FindVersion method. The DefaultVersion method will always return a IVersion object referencing the default version of the workspace from which the name can be obtained through VersionName property on the IVersionInfo interface.
IVersionedWorkspace.ParentVersions Property
A list of versions that have child versions.
Public ReadOnly Property ParentVersions As IEnumVersionInfo
public IEnumVersionInfo ParentVersions {get;}
IVersionedWorkspace.RecommendedReconcileOrder Property
An ordered list of versions that can be used to optimize reconciliation against the default version.
Public ReadOnly Property RecommendedReconcileOrder As IEnumVersionInfo
public IEnumVersionInfo RecommendedReconcileOrder {get;}
IVersionedWorkspace.RecommendedSyncOrder Property
An ordered list of replicas that need to be synchronized in order to optimize reconciliation against the default version.
Public ReadOnly Property RecommendedSyncOrder As IEnumBSTR
public IEnumBSTR RecommendedSyncOrder {get;}
IVersionedWorkspace.Versions Property
All versions the user owns and those which are public or protected.
Public ReadOnly Property Versions As IEnumVersionInfo
public IEnumVersionInfo Versions {get;}
Remarks
The Versionsmethod will return an enumeration of all versions which the connected user owns and versions owned by other users whose access property is "public".
Classes that implement IVersionedWorkspace
Classes | Description |
---|
// Get dataset from the map service
IDataset defaultDataset = mapServerDataAccess.GetDataSource(mapService.DefaultMapName, 0 ) as IDataset;
IWorkspace workspace = defaultDataset.Workspace;
IVersionedWorkspace versionedWorkspace = (IVersionedWorkspace)workspace;
// Default Version
IVersion defaultVersion = versionedWorkspace.DefaultVersion;
string defaultVersionName = defaultVersion.VersionName;