multiple users editing a single form

33 views
Skip to first unread message

Brian Wallis

unread,
Jan 20, 2022, 3:43:54 PM1/20/22
to Orbeon Forms
Is there any support in orbeon that would allow for a single form to be edited by multiple users at the same time with some protection between them to control what is changed and saved.

The type of form I am thinking of is one that has a list of text areas where new text areas can be added to the form or existing ones removed and any text area in the form can be edited but this could apply to other controls or maybe even sections.
  • If a user starts editing a text area, a subsequent attempt to edit that same text area by another user is refused and a message shown to the second user.
  • The second user can add a new entry or edit one of the other text areas that has not been edited by the first user.
  • When the form is saved by the first user, only the information that the first user changed is updated in the forms store
  • When the second user saves their changes, the already saved changes by the first user are retained in the final stored form.
  • If the first user has edited a particular text area then the second user cannot delete that text area.
  • if the first user deletes a text area the second user cannot edit that text area and it a popup message should say it was deleted.
  • for bonus marks, changes being made by the first user can be seen by the second user as they occur. 
There are probably other scenarios but I think that covers the gist of it. I've seen multi user editing in other applications and it seems to be a feature that orbeon users may be interested in having for forms.

So, is any of this possible now?

thanks
brian wallis...


Alessandro Vernet

unread,
Jan 22, 2022, 12:57:30 AM1/22/22
to Orbeon Forms
Hi Brian,

If you have multiple users potentially editing the same form data, you really ought to enable the lease feature [1]. This doesn't provide Google Docs-like concurrent editing, but instead makes sure that at any given time, for each form data, at most one user can edit that form data.

Next, on a field-per-field basis, you want to "assign" the field to the user who starts editing it, and make the field read-only to other users. For this, I think you'd need to write some XForms in a custom model [2]. That XForms would maintain a structure telling you what field is assigned to what user. That structure, in XML, would be stored in a custom instance, every time it is modified you'd serialize it to a hidden field, and when the form is loaded you'd initialize the instance from the value of the hidden field. Then fields would be made read-only based on the content of that structure. It would require a bit of tinkering, but looks quite feasible.

Just some ideas. And you'll let me know if this makes sense, or if I'm missing something.

-Alex


--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/a346f711-e35d-4629-8067-aec2e126666an%40googlegroups.com.

Alessandro Vernet

unread,
Jan 28, 2022, 12:38:41 PM1/28/22
to Orbeon Forms
Hi Brian,

Did you get a chance to look into the lease feature + some logic in your form to keep track of which field is "assigned" to which user? If so, would a solution along the lines suggested earlier work for you?

-Alex

Brian Wallis

unread,
Jan 31, 2022, 2:43:07 PM1/31/22
to Orbeon Forms
Hi Alex, 
  I haven't had a chance to look into it much as yet but did read about the features. 

The tracking of who owns a field seems feasible to me but I will need to prototype something first to see how that goes.

The lease feature is not really what we are after for the other requirement. What we really need is the ability for two users to actually be editing two different entries in the form at the same time. So for example if it is a simple form with two text areas we would need two users to be able to be editing the two text areas at the same time. We don't need the edits to be visible to the other user(s) in real time, only one user can edit a single field and who can edit which field could be based on the owner (first to edit) of the field.

I'm chasing up our requirements in more detail as it seems a bit confused exactly what it is we need.

thanks
brian...

Alessandro Vernet

unread,
Feb 1, 2022, 7:10:13 PM2/1/22
to Orbeon Forms
Hi Brian

About supporting different users, editing different fields, in the same form data, at the same time: that is a tough one, which you won't be able to do without having your own implementation of the persistence API.

When Form Runner sends data to be saved to the persistence API, it sends the whole updated form data, and the out-of-the-box implementation of the persistence API overwrites what was previously saved (or to be more precise, adds it to the journal, but this doesn't matter for this discussion).

Instead you would need the implementation of the persistence API to say: ok, this is a save done by jsmith, so I'm going to only update in the saved data the value for the fields that have been "assigned" to jsmith. That is not necessarily rocket science, but you'll have to weigh whether you want to write your implementation of the persistence API.

-Alex

Brian Wallis

unread,
Feb 1, 2022, 7:35:03 PM2/1/22
to Orbeon Forms
Thanks Alex,
  Interesting you should suggest that, we already have our own persistence API implementation as we don't store the forms in a database, they are stored to a medical records system via our persistence API.

I hadn't thought about it that way, doing the separation of who saves what at the persistence level. Worth looking into

thanks for the suggestion
brian...

Alessandro Vernet

unread,
Feb 2, 2022, 6:07:18 PM2/2/22
to Orbeon Forms
Hi Brian,

Got it, then if you have your own implementation of the persistence API, this might be much easier to do, as you might already have code that looks at the XML field-by-field, and does something appropriate for each field. In that code, skipping the fields values for fields not assigned to the current user might not be too hard to do.

-Alex

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages