Start page
Start page

Start page / Advanced topics / Tracking changes / Get revision

Get revision

FirstSpirit works with a revision-based repository. With it, special administration of chronological development of data is used. This is revision management.

A revision can be presented as a type of "Snapshot" across the entire repository at a certain point in time. In contrast to a version, which is usually only related to a single object, during a revision, the total state of all objects in the repository are listed.

Revisions are listed with sequential numbering (revision ID), where there is always exactly one current revision for the whole repository. If a repository is edited, all changes carried out are linked to a new revision number. The revision number is the last current revision number of the entire repository, increased by one. All unchanged objects retain their old revision numbers. If an object is changed, it is not overwritten in the repository, but rather inserted as a new object (with a higher revision number).

In order to determine in what time frame certain changes took place within the program, first the corresponding revision for the repository has to be retrieved.

The revision can be retrieved directly via the project. In doing so, either the desired unique revision ID, such as:

project.getRevision(revisionId); 

or the date of the desired revision were transferred, such as:

project.getRevision(context.getStartTime()); 

The transitioned date does not have to be assigned to a unique revision. Any desired data value can be transferred. If at this date a revision exists, it is returned; otherwise the methods return the next lowest revision.

A selection of revisions within a certain time frame can be made available via the method:

project.getRevisions(Revision from, Revision to, int maxCount, Filter<Revision> filter);

made available. Two revisions are transferred. The first revision (“from”) defines the lower revision limit and the second revision (“to”) defines the upper revision limit. Along with both of these revisions, all revisions which have a higher revision ID than the lower revision limit and a lower revision ID than the upper revision limit are returned.

The respective most current version can be retrieved via:

getRevision(new Date());

via:

start = project.getRevision(context.getStartTime()); 
end = project.getRevision(new Date());
revisions = project.getRevisions(start, end, 0, null);

Optionally, the parameter “maxCount” can be passed, which limits the number of the returned revisions to a highest value, and – likewise optionally – provides a filter for further limitation.

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2014-05-19