Upgrading form definitions from Home page

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Upgrading form definitions from Home page

Bruno
Hi,

From:

Specifically, this operation, for each selected form definition:

  1. Reads the latest version (or selected version [SINCE Orbeon Forms 2020.1]) of the published form definition, whether it is available or unavailable.

  2. Loads the latest versions of the published section templates that might be associated with that form definition.

    • TODO: this needs fixing, see #3885

  3. Upgrades the form definition markup to the latest format, as if loading it in Form Builder and saving it again.

  4. Includes the latest section templates loaded above into the form definition.

  5. Saves back the form definition, either as a new version or as the same version (see below for details).

Which PL service should implement step 3 ?

It seems that the following service it should be used to implement step 3:
(path: /crud/{2}/{1}/form/form.xhtml)

But in the body of this service call the XML of the form does not have the attribute [fr:data-format-version="2019.1.0"].

But this attribute ( [fr:data-format-version="2019.1.0"]) is set if I save the form in the Form Builder....

At the end I can upgrade my forms to "2019.1.0" format from the Home web page.
Maybe a problem with my PL but not sure

regards,
bruno

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/CALjxVcSgk4XNOz43eTPfRCHLLrXoE-N4-EtVk2RB%3DWiD%2B2SSyw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading form definitions from Home page

Bruno
Hi,

Another problem that I have (home page) is  that "Make available local forms" and "Upgrade local forms definitions" call the same service "/crud/{app}/{form}/form/form.xhtml".

How to know when is "make available" or "upgrade form" from the HTTP Request ?

regards,
bruno

El vie, 19 mar 2021 a las 17:55, Bruno Buzzi Brassesco (<[hidden email]>) escribió:
Hi,

From:

Specifically, this operation, for each selected form definition:

  1. Reads the latest version (or selected version [SINCE Orbeon Forms 2020.1]) of the published form definition, whether it is available or unavailable.

  2. Loads the latest versions of the published section templates that might be associated with that form definition.

    • TODO: this needs fixing, see #3885

  3. Upgrades the form definition markup to the latest format, as if loading it in Form Builder and saving it again.

  4. Includes the latest section templates loaded above into the form definition.

  5. Saves back the form definition, either as a new version or as the same version (see below for details).

Which PL service should implement step 3 ?

It seems that the following service it should be used to implement step 3:
(path: /crud/{2}/{1}/form/form.xhtml)

But in the body of this service call the XML of the form does not have the attribute [fr:data-format-version="2019.1.0"].

But this attribute ( [fr:data-format-version="2019.1.0"]) is set if I save the form in the Form Builder....

At the end I can upgrade my forms to "2019.1.0" format from the Home web page.
Maybe a problem with my PL but not sure

regards,
bruno

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/CALjxVcSY_GWkhfc%3DRPTnvtVnzSFvzO4gf0udMt%3D2CC5nLbCWbQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading form definitions from Home page

Alessandro  Vernet
Administrator
In reply to this post by Bruno
Hi Bruno,

The whole thing is done by the publish API, passing the
`upgrade-form-definition=true` request parameter. In `home.xhtml`, see the
`publish-submission`, and how it is being called:

https://github.com/orbeon/orbeon-forms/blob/tag-release-2020.1-ce/form-runner/jvm/src/main/resources/apps/fr/home/home.xhtml#L452

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1616560819573-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading form definitions from Home page

Alessandro  Vernet
Administrator
In reply to this post by Bruno
Hi Bruno,


BrunoBB wrote
> Another problem that I have (home page) is  that "Make available local
> forms" and "Upgrade local forms definitions" call the same service
> "/crud/{app}/{form}/form/form.xhtml".
>
> How to know when is "make available" or "upgrade form" from the HTTP
> Request ?

They call the API you mentioned to read the form definition (this is the
`<xf:submission id="read-form">` in `home.xhtml`), and then pass it to the
`/publish` API (this is the `<xf:submission id="publish-submission">` in
`home.xhtml`), and most of the work is done by that API, based on parameters
it receives. You can find more in `home.xhtml` I was pointing to in my
previous message, but let me know if anything isn't clear enough.

-Alex


-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1616561156725-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading form definitions from Home page

Bruno
In reply to this post by Bruno
Alex,

But the PUT service "/crud/{app}/{form}/form/form.xhtml" should receive in the Http Request's body the XML generated by Orbeon that could be an upgrade for "Make un/available local forms" or "Upgrade local form definition".
The Persistence Layer just stores the XML on the repository.

If this is ok, then i have some questions:
1) The XML received from ("/crud/{app}/{form}/form/form.xhtml") should be stored on the Published Form or in the last Save Form ? (in the db it would be tables orbeon_form_definition or orbeon_form_data)
   (I think the Published Form is the one to update but not sure)

2) Do Form Instances are also upgraded ?
    (from the services trace it seems that they are not upgraded)
   2.1) Then how to upgrade form instances ???

These questions come to my mind because when "Upgrade local form definition" the XML of the service "/crud/{app}/{form}/form/form.xhtml" does not have the "fr:data-format-version" attribute.
But if I save the form inside Form Builder then the attribute is present in the XML.

regards,
bruno

El lun, 22 mar 2021 a las 16:52, Bruno Buzzi Brassesco (<[hidden email]>) escribió:
Hi,

Another problem that I have (home page) is  that "Make available local forms" and "Upgrade local forms definitions" call the same service "/crud/{app}/{form}/form/form.xhtml".

How to know when is "make available" or "upgrade form" from the HTTP Request ?

regards,
bruno

El vie, 19 mar 2021 a las 17:55, Bruno Buzzi Brassesco (<[hidden email]>) escribió:
Hi,

From:

Specifically, this operation, for each selected form definition:

  1. Reads the latest version (or selected version [SINCE Orbeon Forms 2020.1]) of the published form definition, whether it is available or unavailable.

  2. Loads the latest versions of the published section templates that might be associated with that form definition.

    • TODO: this needs fixing, see #3885

  3. Upgrades the form definition markup to the latest format, as if loading it in Form Builder and saving it again.

  4. Includes the latest section templates loaded above into the form definition.

  5. Saves back the form definition, either as a new version or as the same version (see below for details).

Which PL service should implement step 3 ?

It seems that the following service it should be used to implement step 3:
(path: /crud/{2}/{1}/form/form.xhtml)

But in the body of this service call the XML of the form does not have the attribute [fr:data-format-version="2019.1.0"].

But this attribute ( [fr:data-format-version="2019.1.0"]) is set if I save the form in the Form Builder....

At the end I can upgrade my forms to "2019.1.0" format from the Home web page.
Maybe a problem with my PL but not sure

regards,
bruno

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/CALjxVcS3pehh16Nn2uJZYJyZ5iCzGoVWWg7BLJHRFHbEfdoURw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading form definitions from Home page

Alessandro  Vernet
Administrator
Hi Bruno,


BrunoBB wrote
> If this is ok, then i have some questions:
> 1) The XML received from ("/crud/{app}/{form}/form/form.xhtml") should be
> stored on the Published Form or in the last Save Form ? (in the db it
> would
> be tables orbeon_form_definition or orbeon_form_data)
>    (I think the Published Form is the one to update but not sure)

You are correct: this is the published form (which is stored in
`orbeon_form_definition` by the relational implementation of the persistence
API).


BrunoBB wrote
> 2) Do Form Instances are also upgraded ?
>     (from the services trace it seems that they are not upgraded)
>    2.1) Then how to upgrade form instances ???

Form data isn't upgraded in the database, and is always stored in the same
format, which out-of-the-box is the 4.0.0 format (see the
`oxf.fr.persistence.*.data-format-version` property). Instead, for data is
"upgraded" when loaded, and "downgraded" when saved. This way we can have a
stable format in the database, and in memory have whatever format a given
version of Orbeon Forms prefers.

-Alex


-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1617056276356-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading form definitions from Home page

Bruno
In reply to this post by Bruno
Alex,

Form data isn't upgraded in the database, and is always stored in the same
format, which out-of-the-box is the 4.0.0 format (see the
`oxf.fr.persistence.*.data-format-version` property). Instead, for data is
"upgraded" when loaded, and "downgraded" when saved. This way we can have a
stable format in the database, and in memory have whatever format a given
version of Orbeon Forms prefers.

This clarifies everything !!!
It is stated in the documents but somehow I did not figure it out -  I'm more a diagram guy than text :)

In a clean database "2019.1.0" format can be used at database level. But what happens with "oxf.fr.detail.new.service.enable" property?
From documents: "this property always assumes data in 4.0.0 format even if the property above is set to a different value".

regards,
bruno


El vie, 26 mar 2021 a las 17:25, Bruno Buzzi Brassesco (<[hidden email]>) escribió:
Alex,

But the PUT service "/crud/{app}/{form}/form/form.xhtml" should receive in the Http Request's body the XML generated by Orbeon that could be an upgrade for "Make un/available local forms" or "Upgrade local form definition".
The Persistence Layer just stores the XML on the repository.

If this is ok, then i have some questions:
1) The XML received from ("/crud/{app}/{form}/form/form.xhtml") should be stored on the Published Form or in the last Save Form ? (in the db it would be tables orbeon_form_definition or orbeon_form_data)
   (I think the Published Form is the one to update but not sure)

2) Do Form Instances are also upgraded ?
    (from the services trace it seems that they are not upgraded)
   2.1) Then how to upgrade form instances ???

These questions come to my mind because when "Upgrade local form definition" the XML of the service "/crud/{app}/{form}/form/form.xhtml" does not have the "fr:data-format-version" attribute.
But if I save the form inside Form Builder then the attribute is present in the XML.

regards,
bruno

El lun, 22 mar 2021 a las 16:52, Bruno Buzzi Brassesco (<[hidden email]>) escribió:
Hi,

Another problem that I have (home page) is  that "Make available local forms" and "Upgrade local forms definitions" call the same service "/crud/{app}/{form}/form/form.xhtml".

How to know when is "make available" or "upgrade form" from the HTTP Request ?

regards,
bruno

El vie, 19 mar 2021 a las 17:55, Bruno Buzzi Brassesco (<[hidden email]>) escribió:
Hi,

From:

Specifically, this operation, for each selected form definition:

  1. Reads the latest version (or selected version [SINCE Orbeon Forms 2020.1]) of the published form definition, whether it is available or unavailable.

  2. Loads the latest versions of the published section templates that might be associated with that form definition.

    • TODO: this needs fixing, see #3885

  3. Upgrades the form definition markup to the latest format, as if loading it in Form Builder and saving it again.

  4. Includes the latest section templates loaded above into the form definition.

  5. Saves back the form definition, either as a new version or as the same version (see below for details).

Which PL service should implement step 3 ?

It seems that the following service it should be used to implement step 3:
(path: /crud/{2}/{1}/form/form.xhtml)

But in the body of this service call the XML of the form does not have the attribute [fr:data-format-version="2019.1.0"].

But this attribute ( [fr:data-format-version="2019.1.0"]) is set if I save the form in the Form Builder....

At the end I can upgrade my forms to "2019.1.0" format from the Home web page.
Maybe a problem with my PL but not sure

regards,
bruno

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/CALjxVcRMjFzER7UZVcbxC8nJPE%3DTO5Tz8013SVeRy0NekRSZNA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrading form definitions from Home page

Alessandro  Vernet
Administrator
Hi Bruno,


BrunoBB wrote
> This clarifies everything !!!
> It is stated in the documents but somehow I did not figure it out -  I'm
> more a diagram guy than text :)

I like diagrams very much as well! They are just harder to make, and
maintain, and while Markdown is quite stable and wildly supported for
textual content, there isn't something as mainstream for diagrams.


BrunoBB wrote
> In a clean database "2019.1.0" format can be used at database level. But
> what happens with "oxf.fr.detail.new.service.enable" property?
> From documents: "this *property always assumes data in **4.0.0** format
> even if the property above is set to a different value*".

This has no influence on the "new service"; as stated by the sentence you
were quoting, it will always expect data in the 4.0.0 format. Ideally, this
should be configurable.

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1617141701653-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet