Class FormDesignerSyncPersistBean

  • All Implemented Interfaces:
    Serializable

    @ViewScoped
    @Named
    public class FormDesignerSyncPersistBean
    extends Object
    implements Serializable
    Controller bean for the form designer handling changes to the form persist JSON.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form
    • Constructor Detail

      • FormDesignerSyncPersistBean

        public FormDesignerSyncPersistBean()
    • Method Detail

      • 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 in syncPersistPatches(). 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.