SnapshotManager

Interface SnapshotManager contains a number of methods to allow applications to create and restore snapshots.

A snapshot contains all the form state data for an application and all the information required to restore the application at some time in the future. From the user's perspective, this allows them to save their work and continue at some future point; for example when completing a tax return, the user might need to suspend completing the form while she requests additional information from a savings company.

Each snapshot is identified by a unique identifier which is system generated and cannot be modified.

Snapshots can optionally contain any number of snapshot fields. These are key value pairs that are used to provide additional information to the snapshot, for example they might be used to save the form id, the user id, a password or additional security questions.

The following illustrates a typical save/restore scenario:

Save:
The user requests the creation of a snapshot by clicking on a save button. The application then displays a page requesting information that uniquely identifies the user such as an email address - if the user is already signed on, this is probably not necessary. Additional security such as a password and/or additional information may also be requested at this time. The application then calls method #createSnapshot(Map, Date) to create the snapshot. The user can continue to work on the form or not as they choose.

Restore:
At some time in the future, the user requests a restore to a snapshot, possibly by clicking on a restore button. The application asks the user to identify themselves - again, this may not be necessary if the user is already signed on. The application then requests a list of candidate snapshots by calling method #getSnapshots(SnapshotQuery). This list is displayed to the user, typically showing the date and time each snapshot was created. When the user makes a selection, they are prompted to supply any additional security information such as a password and/or additional information. The application checks this security information against the snapshot and if successful calls #restoreSnapshot(String) to restore the snapshot. All state data is restored from the snapshot and the user is returned to the page where the snapshot was created.


Designer Note:
Please note that it might not be possible to restore a snapshot between different versions of the Verj.io software. The system tries to support the restoration of snapshots between different versions, but cannot guarantee that a snapshot saved in one particular version will restore in a newer version.

Know snapshot issues:
It is not possible to restore snapshots saved in V4.4.3 or before. From V4.4.4 snapshots are release independent.

Further documentation.

SnapshotManager Functions

createSnapshot SnapshotManager.createSnapshot( snapshotFields , expiryDate ) Creates a snapshot for the application currently being executed.
getSnapshots SnapshotManager.getSnapshots( query ) Returns an array of candidate snapshots that match the search criteria specified in query.
removeSnapshot SnapshotManager.removeSnapshot( snapshotId ) Removes the snapshot from the server store.
restoreSnapshot SnapshotManager.restoreSnapshot( snapshotId ) Restores the state of all forms to the specified snapshot.