Embebbed Javascript API Autosave

20 views
Skip to first unread message

Mark Kurley

unread,
Oct 5, 2021, 4:49:48 PM10/5/21
to Orbeon Forms
Does the autosave feature work with the embedded javascript API?  If so is there any special configuration.

Thanks

Alessandro Vernet

unread,
Oct 6, 2021, 12:13:45 AM10/6/21
to Orbeon Forms
Hi Mark,

It does not, and we added a note about this in the Limitations section linked below. To be more precise, the autosave will happen just fine, but later on, if a draft is found, in some cases when users make a selection, a page navigation happens, which isn't supported with embedding.


-Alex

On Tue, Oct 5, 2021 at 1:49 PM Mark Kurley <mark....@globaldms.com> wrote:
Does the autosave feature work with the embedded javascript API?  If so is there any special configuration.

Thanks

--
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/56fc20f2-795d-4163-ad61-1f6414be3857n%40googlegroups.com.

Alessandro Vernet

unread,
Dec 15, 2022, 4:55:37 PM12/15/22
to Orbeon Forms
For reference, this is tracked by the following RFE:

-Alex

Nick Tates

unread,
Jan 18, 2023, 3:38:34 PM1/18/23
to Orbeon Forms
Alex:

For now, I implemented the below design in our application using the Embedded JS API and we are able to auto-save a "draft" of the document. Can you review our design approach for now and let me know if you have any thoughts or concerns?

  • Added a new hidden button to the page that calls "save-progress" and triggers a web service call that sends the document id.

  • On the web service call, save off the document id.

  • Initially load the form in "new" mode"

  • Setup input field change events to trigger the new button added above as the user enters values on the page.

  • When the page is reloaded, the form is loaded in "edit" mode using the document id saved from the web service call.

Each time the button is triggered, Orbeon saves off a new version of the report. Our web service saves off the document id when first passed. This allows users to naviage back to that page and see where they left off.

Thanks,

Alessandro Vernet

unread,
Jan 19, 2023, 4:39:49 PM1/19/23
to orb...@googlegroups.com
Hi Nick,

What you're doing is most likely ok, but there are few things that I don't quite understand. You have a `save-progress` process that corresponds to your trigger, right? Could you paste its code, for clarity. I am not sure what you mean by "save off the document id"; i.e. where is that id saved, and how do you retrieve it when the page is loaded again to open the form in edit mode?

-Alex

Nick Tates

unread,
Jan 20, 2023, 8:33:15 AM1/20/23
to Orbeon Forms
Alex:

Sure, below is the process defined in Orbeon. I'll explain what we do based on the process below. The web service call triggered sends the document_id to the endpoint as a query string "document". We capture that value in our web service and save that in our database to reference later. If the page is reloaded by the user, we pull out the value for the document_id saved. If there is a value then we change the mode to "edit", pass in that document_id, and load the form.

<property as="xs:string" name="oxf.fr.detail.process.evo-save-draft.*.*">
save-progress
then send(uri = "http://localhost/mywsapi/orbeon/draft",
method = "POST",
headers = "OrderUID:{//order-uid} \n ServiceUID:{//service-uid} \n UserUID:{//user-uid}")
</property>

Thanks,

Alessandro Vernet

unread,
Jan 23, 2023, 5:15:16 PM1/23/23
to orb...@googlegroups.com
Got it Nick, thank you for the clarification, and yes, that seems fine to me.

-Alex

Reply all
Reply to author
Forward
0 new messages