Class FormDesignerSyncPersistBean
java.lang.Object
de.xima.fc.gui.designer.form.bean.FormDesignerSyncPersistBean
- All Implemented Interfaces:
Serializable
Controller bean for the form designer handling changes to the form persist JSON.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Remote command that accepts a list of patches to the persist JSON.void
Remote command that accepts a list of patches to the persist JSON.
-
Constructor Details
-
FormDesignerSyncPersistBean
public FormDesignerSyncPersistBean()
-
-
Method Details
-
syncPersistPatches
public void syncPersistPatches()Remote command that accepts a list of patches to the persist JSON. Takes the JSON patches for the form persist JSON, applies the patches to the JSON, records the modifications, i.e. which form items were changed, and posts an event to the designer conversation event bus.Used to sync the client state to the server. We keep a copy of the form persist JSON on the server so all beans can access it. To prevent us from having to send the entire persist JSON on every change, we compute a diff between the last and the current state on the client in the form of JSON patches, and only send those patches to the server. When this fails (such as because patches were sent in the wrong order etc.), we return an error to the client: This in turns causes the client to send a full copy of the persist JSON to the server, see
syncPersist()
. -
syncPersist
public void syncPersist()Remote command that accepts a list of patches to the persist JSON. See notes insyncPersistPatches()
. This is used (a) as a fallback when the patches could not be applied and (b) when the entire form is replaced and the patches would be as large or larger than the persist JSON itself, such as when the user loads a backup persist JSON.
-