Embedding Orbeon form in .NET web-application

89 views
Skip to first unread message

dmz1970

unread,
Sep 25, 2015, 12:55:20 PM9/25/15
to orb...@googlegroups.com
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.

--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

Alessandro Vernet

unread,
Sep 27, 2015, 1:50:00 AM9/27/15
to orb...@googlegroups.com
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
--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660549.html

dmz1970

unread,
Sep 27, 2015, 10:46:09 AM9/27/15
to orb...@googlegroups.com
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?

--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660552.html

Alessandro Vernet

unread,
Sep 28, 2015, 2:00:29 PM9/28/15
to orb...@googlegroups.com
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
--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660559.html

dmz1970

unread,
Sep 29, 2015, 12:46:55 AM9/29/15
to orb...@googlegroups.com
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

--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660565.html

Alessandro Vernet

unread,
Sep 29, 2015, 7:35:04 PM9/29/15
to orb...@googlegroups.com
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
--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660571.html

dmz1970

unread,
Sep 30, 2015, 10:08:22 PM9/30/15
to orb...@googlegroups.com
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?

<http://discuss.orbeon.com/file/n4660584/CharacterEncoding.png>

--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660584.html

bruno.buzzi

unread,
Sep 30, 2015, 10:56:35 PM9/30/15
to orb...@googlegroups.com
Hi,

I think you have an encoding issue.
JavaScript use UTF-8, you should encode and decode strings with a UTF-8
function.
It is a similar problema i has a cuplé of weeks ago.

Regaras,
Bruno

--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660585.html

dmz1970

unread,
Oct 2, 2015, 12:50:01 PM10/2/15
to orb...@googlegroups.com
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?*

<http://discuss.orbeon.com/file/n4660598/EmbeddedForm.png>

--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660598.html

dmz1970

unread,
Oct 4, 2015, 9:05:03 PM10/4/15
to orb...@googlegroups.com
Can anyone 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.

--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660605.html

Alessandro Vernet

unread,
Oct 6, 2015, 9:29:37 PM10/6/15
to orb...@googlegroups.com
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
--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660622.html

Alessandro Vernet

unread,
Oct 6, 2015, 9:33:57 PM10/6/15
to orb...@googlegroups.com
(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
--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660623.html

dmz1970

unread,
Oct 7, 2015, 9:08:56 AM10/7/15
to orb...@googlegroups.com
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.


--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660632.html

Alessandro Vernet

unread,
Oct 7, 2015, 12:50:19 PM10/7/15
to orb...@googlegroups.com
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
--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660636.html

dmz1970

unread,
Oct 7, 2015, 12:53:26 PM10/7/15
to orb...@googlegroups.com
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.

--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660637.html

Alessandro Vernet

unread,
Oct 8, 2015, 2:12:17 PM10/8/15
to orb...@googlegroups.com
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
--
View this message in context: http://discuss.orbeon.com/Embedding-Orbeon-form-in-NET-web-application-tp4660540p4660648.html
Reply all
Reply to author
Forward
0 new messages