Persistence Layer: get source of definition

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

Persistence Layer: get source of definition

bruno.buzzi
Alex/Erik,

The following service is called to get the source of a Form Definition:
(1) /crud/{app-name}/{form-name}/form/form.xhtml

Do you know/differenciate (from the request) when this service is called to
display New/Summary or Publish/Unpublish a form ?

This is the problem i having:
If in this service (1) i check isAvailable (definition is published or not)
so i can answer 404 when New/Summary page is requested --> i can not
republish a form from /orbeon/fr/.
Because when republish the service (1) is called and answer 404. So the next
cal fail and the form is not published.

If in this service (1) i do NOT check isAvailable --> after unpublish a form
then it can be accessed (new and summary) as it is published.

If from the request i can see if it is for New/Summary or for
Publish/Unpublish --> problem solved.

Tomorrow i try to go deep in this issue maybe i'm able to fix it...

regards,
bruno

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

Alessandro  Vernet
Administrator
Hi Bruno,

I am not sure to understand your question. It seems to me that in general a
GET needs to check if the form is available and answer 404 if it isn't. But
a PUT (publish or republish) wouldn't need to do that check. Am I missing
something?

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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

bruno.buzzi
Alex,

To Publish/Unpublish a form from /orbeon/fr/ i see the following sequence:
(Orbeon Forms 2017.1.agesic.201709051724 PE)

1) GET /orbeon-gemstone-api/crud/{app}/{form}/form/form.xhtml'

2) PUT  /orbeon-gemstone-api/crud/{app}/{form}/form/form.xhtml

3) GET /orbeon-gemstone-api/form

So if i control not available forms at 1) by answering 404 --> when i try to
re-publish from /orbeon/fr then 1) answer a 404 and 2) is never called.

Tomorrow i will try to reproduce this with Orbeon 2017.2

regards,
bruno


--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

Alessandro  Vernet
Administrator
Hi Bruno,

If there is a GET for the form definition before the PUT, then it should be
find if that GET returns a 404. Off the top of my head, I think the GET is
made to check the description for the form, that users can enter when
publishing, and which isn't part of the metadata. But again, it should be
fine if the API returns a 404. You'll let me know what you see with 2017.2.

https://doc.orbeon.com/form-runner/api/persistence/forms-metadata.html

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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

bruno.buzzi
Alex,

Still trying to find a solution...

RePublish (a previously unpublish form) - Orbeon Forms 2017.2.201712300806
PE
(1) GET uri: /orbeon-gemstone-api/crud/ue/test/form/form.xhtml
(2) GET uri: /orbeon-gemstone-api/crud/orbeon/library/form/form.xhtml
(3) GET uri: /orbeon-gemstone-api/crud/ue/library/form/form.xhtml
(4) PUT uri: /orbeon-gemstone-api/crud/ue/test/form/form.xhtml
(5) GET uri: /orbeon-gemstone-api/form

The form is currently unavailable then:
Case A
If (1) GET answer 404 --> (4) PUT is never called (problem here).

Case B
If (1) GET answer the XML of the definition --> i can republish it but when
*unpublish *it again --> NEW & SUMMARY pages are available (problem here)
(because the service answer the XML instead of 404)

regards,
bruno

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

Alessandro  Vernet
Administrator
Bruno,

What do you mean by "republish"? Are you using the "Upgrade local/remote
form definitions" on the Form Runner home page as an admin?

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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

bruno.buzzi
Alex,

Yes from /orbeon/fr/ (Form Runner home page as an admin).

Check the attached image...

<http://discuss.orbeon.com/file/t374762/orbeon-fr.jpg>

regards,
bruno

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

Alessandro  Vernet
Administrator
Bruno, got it, so the form had already been published in the past, but is
currently unavailable. So when you "publish it" from the home page (which
could also be called "make available"), Form Runner reads the form, and
writes it back as "available". You're saying that the reading part returns a
404; how so, if the form had already been published?

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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

bruno.buzzi
This post was updated on .
Alex,

Yes, the form was published then was made unavailable from Form Runner home
(orbeon/fr/).

Now i want to make it available again from Form Runner home (orbeon/fr/).

But if i return 404 in the GET
(/orbeon-gemstone-api/crud/{app}/{form}/form/form.xhtml) --> the PUT is
never called (PUT  /orbeon-gemstone-api/crud/{app}/{form}/form/form.xhtml)

If in the GET i do *not* control available metadata --> i can make the form
available again *BUT* if i do this when a form is made unavailable --> NEW
and SUMMARY pages are available (because GET does not control availability
metadata).

i'm trying to figure it out how do you solve this for relational database.

regards,
bruno

--
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 orbeon+unsubscribe@googlegroups.com.
To post to this group, send email to orbeon@googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

Alessandro  Vernet
Administrator
Hi Bruno,

Let me first clarify some terminology that might be confusing:

- A form can be published or not.
- A publish form can be available or not.

So far so good, I imagine. The confusing part is that what is called
"unpublish" in the Form Runner home page, doesn't "unpublish", it makes the
published form unavailable.

So if the Form Runner home page shows the form, a GET should succeed. If the
form is unavailable, then its metadata should say so. Does that make more
sense?

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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

bruno.buzzi
Hi Alex,

Returning to this issue.. (with Orbeon 2017.2)

We are on ../orbeon/fr/ page. All forms has been published.

A Form is made unavailable (no problem here).

Now the user want to make it available again.

Orbeon services calls:
GET uri: /orbeon-gemstone-api/crud/agesic/test-lease/form/form.xhtml
(answer 404 because the form is unavailable)

GET uri: /orbeon-gemstone-api/form (to render forms list)

No more call are made, so PUT is not called (to make it available):
PUT crud/agesic/test-lease/form/form.xhtml
(this service is never called i think because of 404 of the first GET)

So the form is not made available.

Do i have explained the scenario or is still confusing ?

regards,
bruno

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

Alessandro  Vernet
Administrator
Hi Bruno,

The GET operation shouldn't return a 404 when the form is unavailable. It
should just return the form definition, but in its `fr-form-metadata` it
will have `<available>false</available>`.

In fact, there is nothing related to the availability of form definitions
that your implementation of the persistence API should worry about: this is
something implemented at the Form Runner level, and your implementation can
treat it as an opaque piece of information that is part of the form
metadata. Does this make sense?

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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

bruno.buzzi
Alex,

Got it !!!
Now the PL does NOT return a 404 when the form is unavailable.

After several test i found a Bug in the PL when making a form unavaible.

The xml string of a Form Definition can be found in two places in the PL:
in OrbeonPublishedFormDefinition and OrbeonSavedFormDefinition.
In a relational database is the same can be found on orbeon_form_definition
table or in orbeon_form_data table.

So the PL was making available false only to OrbeonPublishedFormDefinition
(orbeon_form_definition) but new/summary links get the xml string from
OrbeonSavedFormDefinition (orbeon_form_data).
After available: false, OrbeonSavedFormDefinition (orbeon_form_data) still
has available true --> new/summary where displayed.

Now this bug is fixed !!!

thank for the information and your patience :)

regards,
bruno

--
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 post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Persistence Layer: get source of definition

Alessandro  Vernet
Administrator
Perfect Bruno! And for 2018.1, we've also change the terminology used on the
Form Runner home page to use "make unavailable" instead of "unpublish",
which I image, must have things confusing (why is an "unpublished" form
still "published"?!).

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 post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet