Skip to content

Autosave

Grant edited this page Apr 19, 2018 · 6 revisions

This functionality MARLO helps to temporarily save the progress the user made ​​on a form of the platform.

Functionality

  • When the user makes changes to a form with information in a short time (15 seconds) save the form information, the system notify the user that the information is temporarily stored.

  • When the changes are made, the form is in version "draft"

  • The user can discard the changes.

  • The system notifies you that changes have been discarded.


Technical scheme.

The system auto save works with reading and writing JSON files.

Script file

The file is created by a "Request" AJAX that shoots 15 seconds after the user makes changes a form of the platform.

The AJAX function is configured in the file autosave.js (src / main / webapp / js / global /)

which validates if any component of the form made ​​any changes to activate the timer (15 seconds) to send a "request" AJAX calling AutoSaveAction.java as parameter for all components of the form with your information stored serialized manner.

the role of AutoSaveAction.java be converted into JSON file information sends the "Request" AJAX, the files will be stored in thefolder / home /uroot/ tempfiles / and file naming is: id_model_crp_section.json.These variables will be within all form with auto save.

Reading file.

Before loading the original form information, the system checks if the form contains a JSON file, if it containsinvokes the class AutoSaveReader.java to read the file and load on the form.