Pb with http-serializer and orbeon 4.5

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

Pb with http-serializer and orbeon 4.5

Grégoire Neuville-2
Hello,

I'm in the process of migrating some forms from 3.9 to 4.5. Those make
use of a "save" button that by-passes the persistence layer and simply
offers to save the edited instance as an xml file on the user's disk.

In 3.9, this button was implemented as an XBL component declared in the
"properties-local" file along those supplied with the platform (such as
the "clear" button for example). This component contained an
"xforms:trigger" that would call an XPL service - through an
"xforms:submission" - wich utilised the
http-serializer to prompt the user for a location to save the xml
content to. The whole thing used to work fine.

In 4.5, I've replaced that component by simple declarations in the
"properties-local" file (following
https://github.com/orbeon/orbeon-forms/wiki/Form-Runner:-Buttons-and-Processes). More
precisely, the process I've declared dispatches an event that triggers
the aforementionned submission. Now, the submission and the XPL service
do get called when the "save" button is pressed, but nothing else
happens : the user is never prompted to save the file (it seems like the
http response produced by the http-serializer isn't the one that the
browser receives...).

Am I missing something ? Does a working example of use of the http-serializer
exists in 4.5 ?

Thanks,

Grégoire Neuville.

--
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: Pb with http-serializer and orbeon 4.5

Alessandro  Vernet
Administrator
Hi Grégoire,

Are you using the xf:send() action to run your custom submission? Are you sure your submission runs? I imagine it is a submission replace="all"? And I imagine you're injecting the submission in the form leveraging the oxf.fr.detail.model.custom.*.* property?

https://github.com/orbeon/orbeon-forms/wiki/Form-Runner:-Custom-Model-Logic

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Pb with http-serializer and orbeon 4.5

Grégoire Neuville-2
Hi Alessandro,

> Are you using the xf:send() action to run your custom submission? Are you
> sure your submission runs?

Sorry, my previous post was imprecise. No, I'm using the xf:dispatch
action because, in the model, I use an action to choose which submission
to call based on a request parameter.

> And I
> imagine you're injecting the submission in the form leveraging the
> oxf.fr.detail.model.custom.*.* property?

No, I was using xi:include instructions in all of my forms ; will
definitely switch to the use of that property though !

>I imagine it is a submission replace="all"?

No again, and seeing the security warning in the paragraph describing the
send action, I think this is the problem. Indeed, in the case of
replace="none", the submission is called (I can see it thanks to debug
instructions in my XPL service) but the http response the browser
receives is not the one set by the http-serializer ; on the other hand,
with a replace="all" submission, the browser gets back a 403 error. I
thus don't know what to do exactly to obtain the following behaviour :
stay on the current form, and just offer the user to save the edited
instance (fr-form-instance)...

Should I go the replace="all" way, and try to fix the security issue ?
Or is there a bug and the response sent back to the browser should be
the one set by the http-serializer even in the case of a replace="none"
submission ?

Thanks,

Grégoire.

>
> https://github.com/orbeon/orbeon-forms/wiki/Form-Runner:-Custom-Model-Logic
>
> Alex
>
> -----
> --
> Follow Orbeon on Twitter: @orbeon
> Follow me on Twitter: @avernet
> --
> View this message in context: http://discuss.orbeon.com/Pb-with-http-serializer-and-orbeon-4-5-tp4658361p4658365.html
> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.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: Pb with http-serializer and orbeon 4.5

Alessandro  Vernet
Administrator
Hi Grégoire,

Grégoire Neuville-2 wrote
Sorry, my previous post was imprecise. No, I'm using the xf:dispatch
action because, in the model, I use an action to choose which submission
to call based on a request parameter.
OK, got it.

Grégoire Neuville-2 wrote
No, I was using xi:include instructions in all of my forms ; will
definitely switch to the use of that property though !
Indeed, that will help you in the sense that you won't need to change every form source, or some built-in XSLT.

Grégoire Neuville-2 wrote
No again, and seeing the security warning in the paragraph describing the
send action, I think this is the problem. Indeed, in the case of
replace="none", the submission is called (I can see it thanks to debug
instructions in my XPL service) but the http response the browser
receives is not the one set by the http-serializer ; on the other hand,
with a replace="all" submission, the browser gets back a 403 error. I
thus don't know what to do exactly to obtain the following behaviour :
stay on the current form, and just offer the user to save the edited
instance (fr-form-instance)...

Should I go the replace="all" way, and try to fix the security issue ?
Or is there a bug and the response sent back to the browser should be
the one set by the http-serializer even in the case of a replace="none"
submission ?
Yes, if you want the result of a submission to be sent to the browser, then you need to use a replace="all". And the current page won't be really replaced if what the browser gets is something it "decides" not to show but to download, for instance based on the content type. Now I'm not sure why you're getting a 403. Maybe there is more information about this in the logs? (But yes, I think this is the problem you now want to solve.)

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Pb with http-serializer and orbeon 4.5

Grégoire Neuville
Hi Alessandro,

Yes, if you want the result of a submission to be sent to the browser, then
you need to use a replace="all". And the current page won't be really
replaced if what the browser gets is something it "decides" not to show but
to download, for instance based on the content type. Now I'm not sure why
you're getting a 403. Maybe there is more information about this in the
logs? (But yes, I think this is the problem you now want to solve.)

With the proper configuration (taken from 

Grégoire.

--
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].