XForm to update my XML files in the backend

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

XForm to update my XML files in the backend

Tinkerer
Hi,

I am new to Orbeon Forms; my humble apologies for asking any stupid questions. I want to build a web app that allows users to submit info into a web-form that will update upto 4 different XML files in the backend (server side). These 4 XML files mimic a database and share some kind of a "relational" dependency. Since I am dealing with multiple XML/XSD files as my dB, I have settled for XFORMS and preferred Orbeon Forms for it's Form Builder Tool and it's ability to handle different browsers without the need of a plugin and the hope that I wouldn't need any Javascript/AJAX knowledge. My form must allow users an easy way to add, edit, delete elements in the back-end XML files as well as offer some kind of query and also display data from the XML if needed. My form would need to update different elements in the 4 back-end XML files. What is the best way to design this webapp. What will I need at a minimum? Are there any examples that you can point me to for the first version of my "XML editing" webapp. Thanks for any guidance.
SD
Reply | Threaded
Open this post in threaded view
|

Re: XForm to update my XML files in the backend

SD
Hi Tinkerer,

The bookcast example should be a good place to start with
http://wiki.orbeon.com/forms/doc/developer-guide/orbeon-forms-xforms-tutorial

--SD
Reply | Threaded
Open this post in threaded view
|

Re: XForm to update my XML files in the backend

Erik Bruchez
Administrator
In reply to this post by Tinkerer
Hard to make a quick answer on this, but there are a few questions you
will have to answer:

* Whether you want/can use Form Builder. Your requirements may not fit
what Form Builder does out of the box. In other words, do you plan
write your app with XForms from scratch, or to leverage Form Builder
and Form Runner.

* What kind of storage you want. You mention storing XML files on the
server, but usually Orbeon Forms apps don't write "files" as such:
they store data in some kind of storage, such as the eXist XML
database.

-Erik

On Sun, Apr 24, 2011 at 5:55 PM, Tinkerer <[hidden email]> wrote:

> Hi,
>
> I am new to Orbeon Forms; my humble apologies for asking any stupid
> questions. I want to build a web app that allows users to submit info into a
> web-form that will update upto 4 different XML files in the backend (server
> side). These 4 XML files mimic a database and share some kind of a
> "relational" dependency. Since I am dealing with multiple XML/XSD files as
> my dB, I have settled for XFORMS and preferred Orbeon Forms for it's Form
> Builder Tool and it's ability to handle different browsers without the need
> of a plugin and the hope that I wouldn't need any Javascript/AJAX knowledge.
> My form must allow users an easy way to add, edit, delete elements in the
> back-end XML files as well as offer some kind of query and also display data
> from the XML if needed. My form would need to update different elements in
> the 4 back-end XML files. What is the best way to design this webapp. What
> will I need at a minimum? Are there any examples that you can point me to
> for the first version of my "XML editing" webapp. Thanks for any guidance.
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/XForm-to-update-my-XML-files-in-the-backend-tp3472381p3472381.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XForm to update my XML files in the backend

Tinkerer
In reply to this post by SD
Thanks SD. I am looking to adapt from the bookcast example. But how do I store all my XML/XSD files in the eXist database under Orbeon? Do I have to have an external dB instance? my files are about 150 kb total. and I was clueless about the rest interfaces to exist. Is that something I need to create for my app?
Reply | Threaded
Open this post in threaded view
|

Re: XForm to update my XML files in the backend

Tinkerer
In reply to this post by Erik Bruchez
Thanks Erik. I could use Formbuilder to create my forms, one form for each of my XML, but I wanted to create a wizard-like flow. Do I have to use PFC to achieve this? Also since I am using the CE edition, do I have to write my own form field validations from my XSD/schema?

Regarding the XML files, I intend to store them in a database. Do I need to store them in a separate eXist dB? My files are ~150kb. There is an example called Bookcast that uses an embedded dB. I would appreciate any guidance on setting up the eXist dB with my files and then hooking up to my forms on formbuilder. I thought the Bookcast example was simple to understand, but with multiple xml files and with one form potentially affecting more than one XML file in the backend, it seems a little more complicated. Also, in my XML I don't expect all my elements to be user-inputs, some elements need to be autogenerated/computed using my own rules that should not be visible to my user. Is that possible? I'd appreciate your input.
Reply | Threaded
Open this post in threaded view
|

Re: XForm to update my XML files in the backend

Tinkerer
On second thought, I could just use the Bookcast example UI for the way it displays my existing XML data records from the dB. All major operations CRUD in one form UI. I could just create 4 such forms for my 4 XML and somehow create a wizard like flow from one form to another and that should serve my purpose. What I am clueless about is how to create my dB backend and expose the REST interfaces like in the BookCast example for all 4 of my XML files. Appreciate any inputs.
SD
Reply | Threaded
Open this post in threaded view
|

Re: Re: XForm to update my XML files in the backend

SD
In reply to this post by Tinkerer
Hi Tinkerer,

Setting up eXist can be done either within the app server which has Orbeon in it (within the same app server eXist can lie either inside Orbeon or outside, I have it outside, so on tomcat the path to eXist would be /webapps/eXist) or it can be done on a standalone server. Once set create a new DB, and collections with appropriate permissions.

There are quite a few different types of submissions possible from xforms to the eXist database, mostly one uses GET, PUT, POST and DELETE (http://www.w3.org/TR/xforms11/#submit-options) and the signature od xforms:submission can be found here http://www.w3.org/TR/xforms11/#submit and http://wiki.orbeon.com/forms/doc/developer-guide/processors-xforms-submission. Also there are events associate with submission that can come into handy http://www.w3.org/TR/xforms11/#evt-submit-done

eg: A typical GET submission looks as follows

<xforms:submission xforms:username="DB_USER_NAME" xforms:password="DB_PASSWORD" id="SUBMIT_ID"     serialization="none" method="get" action="http://localhost:80/exist/rest/db/DB_NAME/DB_COLLECTION/FILE_NAME.xml"
replace="instance" instance="INSTANCE_TO_BE_REPLACED">
</xforms:submission>

Treat the above code is a function and to call this you require a 
<xforms:send ev:event="xforms-ready" submission="SUBMIT_ID"/> (Note the xforms:send requires an event handler to run)

parameters written in CAPS are to be replaced by your local parameters.

Hope this helps

regards
--SD



On Thu, Apr 28, 2011 at 3:50 AM, Tinkerer <[hidden email]> wrote:
Thanks SD. I am looking to adapt from the bookcast example. But how do I
store all my XML/XSD files in the eXist database under Orbeon? Do I have to
have an external dB instance? my files are about 150 kb total. and I was
clueless about the rest interfaces to exist. Is that something I need to
create for my app?

--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/XForm-to-update-my-XML-files-in-the-backend-tp3472381p3480546.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws