Version Control

WebDAV Document Versions

The WebDAV document versions view provides you with the ability to manage versions of a document when versioning is enabled for it.

There are two main ways to access the WebDAV document versions view:

  1. Via the WebdavDocumentUploadField component by clicking on the link that displays the version number of a document.

    link for open versions
  2. Via the Manage versions button on the WebDAV Documents view.

Once you have performed either of these actions, the WebDAV document versions dialog window will be displayed.

web dav document versions

The WebDAV document versions dialog supports the following operations:

  1. Creating a new document version: Clicking Upload allows you to select files to upload to the system. The uploaded files will be numbered in accordance with the latest document version number, with the numbers of new versions tagged with the * symbol to indicate that they have been uploaded but not yet linked to a document. The version numbers are updated after saving the changes. If you close the dialog window without saving, all versions tagged with * will be removed after the WebdavDocumentVersionsCleaningJob is run.

  2. Creating a new document version based on another one: Select a document version and click the Copy to head button to copy it and assign it a number in accordance with the latest document version number. The numbers of new versions are tagged with the * symbol to indicate that they have been uploaded but not yet linked to a document. The version numbers are updated after saving the changes. If you close the dialog window without saving, all versions tagged with * will be removed after the WebdavDocumentVersionsCleaningJob is run.

  3. Opening a document for editing: Select a document version and click the Open button to open the document for editing. Each time a document is saved in an external application, a new version of the document is sent to the database. Use the Refresh button to update the list of document versions displayed in the WebDAV document versions dialog.

    Clicking Refresh deletes all unsaved document versions. Therefore, if a document version was copied but not saved, the changes will be discarded.
  4. Opening a document for reading (read-only): To open a document for reading, click on the link with the file name.

  5. Downloading a ZIP archive with one or several document versions: The Download button provides two options for downloading selected documents/versions. The first option allows you to download documents as separate files. The Download as ZIP option allows you to send all selected documents to a ZIP archive and download it. For convenience, file names contain -v suffixes with the corresponding version numbers, for example, example-v3.docx, document-v1.docx.

Conflict Resolution Policies

Several policies are available to resolve conflicts that may occur when multiple users edit the same document simultaneously.

For example, consider a scenario where two users open the same document in WebDAV document versions and add several new versions. The first user completes their work on their versions and saves the changes. Subsequently, the second user does the same. As a result, the database contains versions created by both users. However, each user can only see their own versions in WebDAV document versions.

This situation can lead to problems with ordering and saving these conflicting document versions. To resolve such conflicts, you can utilize the policies described below.

By default, the RejectMergePolicy is applied.

RebaseMergePolicy

The RebaseMergePolicy allows for the insertion of new document versions after those already existing in the database. New versions are numbered in accordance with the latest document version number present in the database.

CancelMyMergePolicy

If document versions have changed while working in WebDAV document versions, all non-persistent versions (marked with *) are deleted.

CancelTheirMergePolicy

If document versions have changed while working in WebDAV document versions, all versions marked with * are saved instead of those added in WebDAV document versions.

RejectMergePolicy

If a conflict occurs, a warning is displayed, and all new versions are discarded.

Overriding Default Conflict Resolution Policy

To override the default conflict resolution policy, declare a bean of the DefaultMergePolicy type in a Spring configuration class. This bean should provide the specific merge policy required. For example:

@Bean
public DefaultMergePolicy defaultMergePolicy() {
    return RebaseMergePolicy::new;
}