Duplicate a Draft

9 views
Skip to first unread message

Bruno Buzzi Brassesco

unread,
Oct 5, 2020, 12:23:04 PM10/5/20
to orb...@googlegroups.com
Hi,

Why when duplicating a draft the service call is to:
'/crud/{3}/{2}/data/{1}/data.xml?data-format-version={4}'

Instead of:
'/crud/{3}/{2}/draft/{1}/data.xml?data-format-version={4}'

Is there any reason for this ?

The GemStone/S PL was expecting the second call (with draft in the route)...

regards,
bruno

BrunoBB

unread,
Oct 5, 2020, 12:24:26 PM10/5/20
to orb...@googlegroups.com
Hi,

It is correct to duplicate a Draft ?

Because if i select to duplicate a draft the Orbeon process to duplicate
call:
'/crud/{3}/{2}/data/{1}/data.xml?data-format-version={4}'

Instead of:
'/crud/{3}/{2}/draft/{1}/data.xml?data-format-version={4}'

regards,
bruno

--
Sent from: http://discuss.orbeon.com/

Alessandro Vernet

unread,
Oct 5, 2020, 11:44:08 PM10/5/20
to orb...@googlegroups.com
Hi Bruno,

Are you saying that when, from the summary page, you duplicate form data
that has been auto-saved, you end up with a copy of that form data, but not
marked as auto-saved?

The semantic of a duplicate on auto-saved data is also a bit unclear to me.
Right now:

- If there is no manually saved data for the same document id, i.e. users
went to `/new` and didn't save manually, it would be as if users went twice
to `/new` and did that. I guess this makes sense.
- But if there is manually saved data, then it would be as if some user went
to `/new` and created the draft this way.

Do you have a particular use case in mind for duplicating drafts?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet

Bruno Buzzi Brassesco

unread,
Oct 6, 2020, 1:33:27 PM10/6/20
to orb...@googlegroups.com
Hi Alex,

There is no manually saved data.

In the summary there is an autosaved form, then this form is selected for duplication.

If i trace all service called to the PL to duplicate the form the at some point the following service is called:
'/crud/{app}/{form}/data/{id}/data.xml?data-format-version={version}'

My question is if this service should be called or following service should be called:
'/crud/{app}/{form}/draft/{id}/data.xml?data-format-version={version}'

Note that the only difference is 'data' and 'draft'.

It is something more semantic rather than a bug ;)

regards,
bruno

BrunoBB

unread,
Oct 7, 2020, 1:22:23 PM10/7/20
to orb...@googlegroups.com
Hi Alex,

There is no manually saved data.

In the summary there is an autosaved form, then this form is selected for
duplication.

If i trace all service called to the PL to duplicate the form the at some
point the following service is called:
'/crud/{app}/{form}/*data*/{id}/data.xml?data-format-version={version}'

My question is if this service should be called or following service should
be called:
'/crud/{app}/{form}/*draft*/{id}/data.xml?data-format-version={version}'

Note that the only difference is 'data' and 'draft'.

regards,
bruno

Alessandro Vernet

unread,
Oct 7, 2020, 7:07:56 PM10/7/20
to orb...@googlegroups.com
Hi Bruno,

The duplication API does not support auto-saved data, as it doesn't provide
a way for callers to specify whether the data to be duplicated was
auto-saved or not. I've added a precision about this in the documentation
(see 1st link below). And since the summary page is using this API, the
Duplicate button should be disabled when auto-saved data is selected. I've
created and fixed #4683 (see 2nd link below) for this. This will be in
2020.1.

https://doc.orbeon.com/form-runner/api/other-apis/duplicate-form-data#purpose
https://github.com/orbeon/orbeon-forms/issues/4683

I can conceptualize cases where one would like to duplicate some auto-saved
data (but not if there is a corresponding explicitly-saved document), but we
haven't come across that use case yet, so I think it is fine not to support
this for now. You'll let me know if this makes sense.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet

Bruno Buzzi Brassesco

unread,
Oct 8, 2020, 1:26:59 PM10/8/20
to orb...@googlegroups.com
Alex,

Ok got it. To duplicate an autosave form is unimplemented/forbidden.
All you say makes sense to me.
About to release another version of the PL for GemStone/S and I was testing different things then I came across this issue.
So there is NO use case for autosave duplication (it was just a test).

regards,
bruno

Alessandro Vernet

unread,
Oct 8, 2020, 6:07:29 PM10/8/20
to orb...@googlegroups.com
Perfect then!
Reply all
Reply to author
Forward
0 new messages