Integration in PHP app

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

Integration in PHP app

sorin
Hi,

I'm trying to integrate a form in a PHP app using the linking functionality here: https://doc.orbeon.com/form-runner/link-embed/linking
It works, it's displaying the form into an iframe, but I have 2 issues:

1. I want the form to break out of the iframe when displaying the response

My understanding is that there's a "target" property that should work the same as an <a> element's target. I have this config made:
<property as="xs:string" name="oxf.fr.detail.process.save.test-app.*">
        require-valid
        then send(
            uri = "http://localhost/form-done",
            method = "POST",
            replace = "all",
            target = "_top"
        )
    </property>

The request to that URL is going through, but instead of replacing the content of the main page with the content of my URL, just the iframe content gets replaced.

Is that not how it's supposed to function, did I misunderstand?

2. I need to pass some stuff to the response URL, which I can supply to the form in the iframe, by any means, including adding <input> elements to the form with JavaScript, or anything.
I need the form runner to pass along those values to my destination URL, like in the POST variables or something. For example, I'm talking about a CSRF token value at the moment, but other stuff may be needed (userid in order to match the document id with the user, etc)

Is there anyway to do this?

Thanks,
Sorin.

--
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: Integration in PHP app

Erik Bruchez
Administrator
Sorin,

> Is that not how it's supposed to function, did I misunderstand?

I cannot rule out that there is a bug when using `target = "_top"` that's
probably never been tried before.

> I need to pass some stuff to the response URL, which I can supply to the
> form in the iframe, by any means, including adding <input> elements to the
> form with JavaScript, or anything.
I need the form runner to pass along those values to my destination URL,
like in the POST variables or something. For example, I'm talking about a
CSRF token value at the moment, but other stuff may be needed (userid in
order to match the document id with the user, etc)

The `uri` is actually a template, so you can pass parameters to it, for
example "

    uri =
"http://localhost/form-done?foo={encode-for-uri(xxf:get-request-parameter('bar'))}"

When loading the form, pass `?bar=baz`, and that should be propagated.

You’ll let us know if this works for you!

Regards,

-Erik

--
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: Integration in PHP app

Erik Bruchez
Administrator
And here is a link to the doc:

   
https://doc.orbeon.com/form-runner/advanced/buttons-and-processes/actions-form-runner/actions-form-runner-send#properties-and-xpath-value-templates

-Erik

--
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: Integration in PHP app

sorin
Hi, Erik,

Thanks for the reply, it was most helpful.

What you said about passing a variable was spot on, it works like a charm.
I was also able to circumvent the first issue through a JavaScript on that page that breaks out of the iframe. Would you like me to open a bug for that one?

Best regards,
Sorin.

Sorin Vasilescu
[hidden email]
+40726144965


On Fri, Aug 10, 2018 at 1:58 AM Erik Bruchez <[hidden email]> wrote:
And here is a link to the doc:


https://doc.orbeon.com/form-runner/advanced/buttons-and-processes/actions-form-runner/actions-form-runner-send#properties-and-xpath-value-templates

-Erik

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

--
You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orbeon/d8LIuhp9SMM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
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: Integration in PHP app

Erik Bruchez
Administrator
Great to hear!

Sure, please go ahead and enter an issue.

-Erik

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