Embedding Orbeon form in .NET web-application

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

Embedding Orbeon form in .NET web-application

dmz1970
Is it possible to embed an Orbeon form in a page on a .NET-based web-application? The goal is to let the end-user fill the form and then read the data back into the application's database for further processing.
Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

Alessandro  Vernet
Administrator
Hi Daniel,

Right now, the 2 well supported mechanisms for embedding are:

- From your app, calling the Java embedding API (however, we have no equivalent for, say, C#).
- Using a Liferay portlet.

You can find more on this at:

https://github.com/orbeon/orbeon-forms/wiki/Form-Runner-~-APIs-~-Server-Side-Embedding

None of those options might work for you, and ideally you'd maybe create (or work with Orbeon to create) a .NET embedding API, which does something similar to what the current Java API does. Is this something that you could contemplate?

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

Re: Embedding Orbeon form in .NET web-application

dmz1970
Alessandro Vernet wrote
Is this something that you could contemplate?
Absolutely!

As you can see from the other thread I have hard time to get Orbeon function properly. If it's resolved and I convince my peers that Orbeon is an important long-term investment for our company, we'll make it work with .NET.

In the meanwhile, what alternatives to embedding are there? Let's say we want the users to click a link to a form that will open in a separate Form Runner window. Then Form Runner will store the entered data along with a token that our application will provide, so that the data can be retrieved by that token. Does Orbeon support this out-of-the-box?
Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

Alessandro  Vernet
Administrator
Hi Daniel,

Having an API would be the best. For a demo, I imagine you could embed the form "yourself" by making a server-side call to Orbeon Forms passing the parameter ?orbeon-embeddable=true, which returns "just a <div>", which you can more easily embed in your page. Then, at the minimum, you'll also need to proxy Ajax requests, and requests for resources.

http://wiki.orbeon.com/forms/doc/contributor-guide/proxying-orbeon-forms#TOC-HTML-fragment

But really, the best way would be to do on .NET an API similar to what has been done for Java.

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

Re: Embedding Orbeon form in .NET web-application

dmz1970
Alex,

Let's say we build a .NET version of API.embedFormJava(), what should the hosting page include/reference? I assume it must reference jQuery. Anything else?

Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

Alessandro  Vernet
Administrator
Daniel,

There is nothing you need to include on the page. All the required dependencies will be loaded from within that <div>.

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

Re: Embedding Orbeon form in .NET web-application

dmz1970
Alex,

I'm making some progress, but encounter something that looks like a character code issue. Please, see the screen shot - any idea why this happens?

Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

bruno.buzzi
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

dmz1970
Thank you, Bruno! The encoding issue has been resolved.

My development/testing environment contains an Orbeon server running on http://192.168.137.112:8080/orbeon and .NET web server at http://localhost:51270. I embed an Orbeon form by pulling the HTML from http://192.168.137.112:8080/orbeon/fr/orbeon/w9/new?orbeon-embeddable=true and injecting it into the page generated by .NET MVC.
Also, I've implemented a proxy that receives GETs and POSTs to http://localhost:51270/orbeon and forwards them to http://192.168.137.112:8080/orbeon.
Is this how orbeon-embedding.jar works? Or does it utilize some internal API to communicate with Orbeon server?

Anyway, I'm able to embed a form, enter data, navigate through pages and save. Now I have new questions:
1. How do I get rid of the "Summary" button? I don't want the end users to view it.
2. When I click "Review", instead of seeing a read-only summary, I either get a list of failed validations (if the form is not complete), or get a blank form. What am doing wrong?


Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

dmz1970
This post was updated on .
Can anyone address my questions from the previous post, especially about how Java form embedding API works internally? I'm trying to implement a similar functionality in .NET.
Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

Alessandro  Vernet
Administrator
In reply to this post by dmz1970
Hi Daniel,

Regarding your questions:

1. You can setup which buttons you want to be displayed on the summary page by setting the oxf.fr.detail.buttons.*.* property. More on this on:
http://doc.orbeon.com/setup/properties/form-runner.html#buttons-on-the-detail-page

2. Getting a list of errors when you hit review is intended: you must first "properly" complete the form before reviewing it. Getting a blank page however isn't expected. Are you also getting this when you access the form directly on http://192.168.137.112:8080/orbeon?

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

Re: Embedding Orbeon form in .NET web-application

Alessandro  Vernet
Administrator
(And in the first point above, instead of "summary page", I meant "detail page", which is what you were asking about.)
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

dmz1970
In reply to this post by Alessandro Vernet
Alessandro Vernet wrote
.... Getting a blank page however isn't expected. Are you also getting this when you access the form directly on http://192.168.137.112:8080/orbeon? ...
No. I get blank forms only with embedded forms. When working directly with the server everything looks good.
Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

Alessandro  Vernet
Administrator
Daniel, supporting "review"is a bit trickier. Is this something that you really need right now? Would you be able to do a prototype without it? What do you want to happen when users submit the form?

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

Re: Embedding Orbeon form in .NET web-application

dmz1970
Alessandro Vernet wrote
Daniel, supporting "review"is a bit trickier. Is this something that you really need right now? Would you be able to do a prototype without it? What do you want to happen when users submit the form?

Alex
Can live without "Review". If Orbeon just closes the form upon Submit, and somehow "informs" the hosting application - good enough.
Reply | Threaded
Open this post in threaded view
|

Re: Embedding Orbeon form in .NET web-application

Alessandro  Vernet
Administrator
Hi Daniel,

OK, cool, and BTW you don't have to feel too bad for not supporting navigation between pages with the "Review" button, as it isn't supported by the Java API either. For more on this, see the "Limitations" section at the bottom of:

http://doc.orbeon.com/form-runner/embedding/java-api.html

To notify your page that the form has been submitted, you can have the button, in addition to saving the data, run the navigate() action, but instead of telling the browser to go to URL you can tell it to run a JavaScript function you implement, e.g. navigate(uri = 'javascript:saveDone()').

http://doc.orbeon.com/form-runner/advanced/buttons-and-processes.html

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