Kentico CMS 7.0 Developer's Guide

Using object versioning

Using object versioning

Previous topic Next topic Mail us feedback on this topic!  

Using object versioning

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

If object versioning is enabled as described in the Configuring object versioning topic, the Versions tab is displayed in editing interfaces of objects whose versioning is allowed. On this tab, particular versions of the currently edited object are created when objects are edited under certain circumstances described in the following paragraph.

 

How versions are created and numbered

 

The following points summarize when new versions are created and what numbering is used for them:

 

The current version is always the one in the top line of the grid. If object versioning is disabled additionally when there are already some versions, the top version needn't contain current object data if the object was edited after object versioning had been disabled.

 

If you create a new object, the initial 0.1 version is created on the tab automatically.

 

If you edit an existing object that had been created before object versioning was enabled, there are no versions on the tab initially. When you edit it and save the modifications, two versions are created: 1.0 with the original data and 1.1 with the currently saved data.

 

Every other edit and save creates a new minor version (the version number is incremented by 0.1) if you save after the number of minutes configured in the Save to last version if younger than (minutes) setting since last save. If you save within the number of minutes, object data is saved to the last version.

 

If you edit and save after the number of hours configured in the Promote to major version if older than (hours) setting, the latest version is promoted to a major version and the new version follows the new major numbering (i.e. latest 2.3 is promoted to 3.0 and the new one is numbered 3.1).

 

The current version can also be promoted to a major version manually by clicking the Make current version major button above the Object history listing.

 

Management of versions on the Versions tab

 

You can perform a number of actions with versions listed on the Versions tab. Above the grid, you can find the following two buttons:

 

Make current version major - promotes the current object version to a new major version (e.g. if the latest version is 2.3, it is promoted to 3.0).

Destroy history - deletes all listed versions of the object.

 

In each objects's row, you can find the following actions in the Actions column:

 

View View version - opens a new window where field data of the version can be inspected and compared side-by-side with data of another version. See the Version data view and comparison section below for more details.

Undo Rollback version - performs rollback of the object to the particular version. If the object has some child objects (e.g. alternative forms, transformations, queries, ...), they are not included in the rollback.

Delete Delete - deletes the version so that it is no longer available in the version history.

 

The following action is available in the object menu accessible by clicking the ArrowBottom button in an object's line:

 

RollbackWithChildren Rollback with children - if the object has some child objects (e.g. alternative forms, transformations, queries, ...), it performs rollback of the object to the particular version, while child object data are rolled back as well. If it does not have any child objects, only the object itself is rolled back.

 

devguide_clip1142

 

Management of versions in CMS Desk -> Content -> Edit -> Design

 

If you expand a page template's drop-down menu and hold your mouse pointer over the EditLayout Edit layout menu item, an additional menu item Shared version layouts appears.

 

devguide_clip1178

 

Similarly, if you hold the mouse pointer over the Template Edit template menu item, an additional menu item Template versions appears.

 

devguide_clip1186

 

After clicking both of the menu items mentioned above, a dialog box appears, letting you view and manage versions of the page layout or template. The same actions as on the Versions tab described above can be performed here.

 

devguide_clip1181

 

The Versions tab is also available in the Web part properties dialog if you choose a custom layout on the Layout tab. Again, the same options as described above can be performed here.

 

devguide_clip1202

 

Version data view and comparison

 

If you click the View View version icon in a version's row in the listing, a pop-up window is displayed. In this pop-up window, you can view data stored in fields of an object version and compare it to another version. If there is more than version of the object, the following options are available:

 

Compare to - by selecting a version in this drop-down list, field data of the selected version get compared side-by-side with field data of the originally viewed version in the table below. Differences between the two versions are highlighted in red font.

Display all data - by enabling this option, all data related to the object and all its child objects will be displayed in the table below.

 

In the top right corner of a version's column in the table, you can find the following action icons:

 

Undo Roll back to this version - this icon is displayed when the Display all data option is disabled. Clicking the icon performs rollback of the object to the respective version. If the object has some child objects (e.g. alternative forms, transformations, queries, ...), they are not included in the rollback.

RollbackWithChildren Roll back with children to this version - this icon is displayed instead of the one above when the Display all data option is enabled. If the object has some child objects (e.g. alternative forms, transformations, queries, ...), it performs rollback of the object to the particular version, while child object data are rolled back as well. If it does not have any child objects, only the object itself is rolled back.

 

devguide_clip1141