Use of arcengine versions

Source: Internet
Author: User

The procedure of using a version is as follows:
1. Register a workspace or dataset as a workspace or dataset of the available version.
Iversionedobject verobj = ds as iversionedobject; // assume that DS is a dataset.
If (verobj! = NULL &&(! Verobj. pverdobj. isregisteredasversioned ))
{
// The dataset can be registered and has not been registered as a version dataset.
// If the following method uses the false parameter, it indicates that the data is registered as non-version data.
// That is, anti-registration
Verobj. registerasversioned (true );
}
2. Get version data
The process of obtaining version data is relatively simple. You must provide a version string when connecting to the database.
By default, SDE. Default is used. If a string of another version is used, data of another version is obtained.
3. Create a new version
// Assume that space is a workspace and an enterprise database workspace. My database and file workspace is
// Version is not available.
Iversionedworkspace pverws = (iversionedworkspace) space;
Iversion Pv = pverws. defaultversion; // the previous version uses the default version as the previous version.
Iversion PVC = pv. createversion (vername); // create a version
PVC. Description = verdesc; // version description
PVC. Access = esriversionaccess. esriversionaccessprivate; // the access policy of the version is private.
Pnewverws = (iversionedworkspace) PVC; // obtain a shortcut for using the new version of Workspace
4. Merge version data
Use the iversionedit interface to merge data
This interface is implemented by versionedworkspace.
This interface is described below
Can canpost versions being edited be submitted to the target version.
The common ancestor of the current and target versions of commonancestorversion.
Conflictclasses has conflicting classes.
Modifiedclasses is a class in two versions.
Post submit version data
The status of the target prereconcileversion before the conflict detection (?).
Reconcile test data conflict. If true is returned, a conflict exists.
The status of the target version of reconcileversion at the beginning of conflict detection (?)
Status when the target version of starteditingversion is edited (?)
You must call reconcile before submitting data. Otherwise, an error may be returned.

5. Browse the metadata of a working version
View version Metadata refers to the versions in a statistical workspace. Who is the father or ancestor of a specified version?
what other derived versions does it have?
the iversioninfo interface provides this information
The following is the details of the iversioninfo interface:
access policy of the access interface
all the ancestors of the Ancestors version, sort by order from near to far
directly derived versions of children.
creation time of created
description
does the current isowner have this version?
last modified modification time
the parent of the parent version directly calls
name of versionname
note that versioninfo implements the preceding interface, but versioninfo is not a class that can be used to create objects. We can only obtain the iversionedworkspace from
other methods.
. findversion ("target version name");
or
iversionedworkapce. versions gets the versions available to all current users. This includes creating public and protected versions created by others.
however, if the version created by others is protected, you can only view the data. Cannot be edited.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.