Parsing large amounts of post data

View: New views
4 Messages — Rating Filter:   Alert me  

Parsing large amounts of post data

by Vanya, Scott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a form with form fields that are each loaded with data from eXist. The number and data within each form field that eXist outputs depends on which user is logged in.
 
I need to be able to update the db when there is a change to the page (exiting, adding a new record, etc). I thought to do this by parsing the Post data similar to:
 
Is this the correct/most efficient approach to this?  Note: there may be many form fields on the page upwards of 40 or 50 or even more some of which are text areas, so I wrote off parameters.
 
Any help or guidance would be greatly appreciated.
 
Scott Vanya

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Parsing large amounts of post data

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The most efficent approach in my opinion would be to use an XForms
Server instead of your XHTML forms, in this way the XForms engine is
responsible for updating the db and you dont have to write lots of
manual parsing code!

Orbeon can be configured to work with an existing eXist instance or
Chiba can be setup in such a way that the updated document is either
POST (onto an XQuery with a little bit of storage login) or PUT to the
database.


2008/6/27 Vanya, Scott <Scott.Vanya@...>:

> I have a form with form fields that are each loaded with data from eXist.
> The number and data within each form field that eXist outputs depends on
> which user is logged in.
>
> I need to be able to update the db when there is a change to the page
> (exiting, adding a new record, etc). I thought to do this by parsing the
> Post data similar to:
> http://en.wikibooks.org/wiki/XQuery/Parsing_Query_Strings
>
> Is this the correct/most efficient approach to this?  Note: there may be
> many form fields on the page upwards of 40 or 50 or even more some of which
> are text areas, so I wrote off parameters.
>
> Any help or guidance would be greatly appreciated.
>
> Scott Vanya
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Exist-open mailing list
> Exist-open@...
> https://lists.sourceforge.net/lists/listinfo/exist-open
>
>



--
Adam Retter

eXist Developer
{ England }
adam@...
irc://irc.freenode.net/existdb

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Parent Message unknown Re: Parsing large amounts of post data

by Adam Retter-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you were to deliver XForms directly to the browser then yes there
is a client requirement.

However if you use an XForms Server such as Orbeon or Chiba then they
can deliver suitable content to the client, in this example XHTML
which they can both deliver - so with an XForms Server then no their
are no additonal client requirements.

Cheers Adam.

2008/6/30 Vanya, Scott <Scott.Vanya@...>:

> Hi, Adam, thanks, for your reply and suggestion. But doesn't the use of
> Xforms place a requirement on the user, i.e. they have to use a certain
> browser or add-in?  In my case, my users will all being bringing their
> own laptops, so their configurations will be very disparate.  It was
> because of this variety and that I can place no restrictions nor
> requirements on the browser they bring that I thought to use XHTML and
> parsing.
>
> Am I wrong about Xforms needing certain browsers or addins? And if not,
> then am I probably on the right path with the parsing idea?
>
> I very much appreciate your help and advise.
>
> Sincerely,
> Scott Vanya
>
>
> Scott Vanya
> scott.vanya@...
>
> -----Original Message-----
> From: Adam Retter [mailto:adam@...]
> Sent: Monday, June 30, 2008 6:04 AM
> To: Vanya, Scott
> Cc: exist-open@...
> Subject: Re: [Exist-open] Parsing large amounts of post data
>
> The most efficent approach in my opinion would be to use an XForms
> Server instead of your XHTML forms, in this way the XForms engine is
> responsible for updating the db and you dont have to write lots of
> manual parsing code!
>
> Orbeon can be configured to work with an existing eXist instance or
> Chiba can be setup in such a way that the updated document is either
> POST (onto an XQuery with a little bit of storage login) or PUT to the
> database.
>
>
> 2008/6/27 Vanya, Scott <Scott.Vanya@...>:
>> I have a form with form fields that are each loaded with data from
> eXist.
>> The number and data within each form field that eXist outputs depends
>> on which user is logged in.
>>
>> I need to be able to update the db when there is a change to the page
>> (exiting, adding a new record, etc). I thought to do this by parsing
>> the Post data similar to:
>> http://en.wikibooks.org/wiki/XQuery/Parsing_Query_Strings
>>
>> Is this the correct/most efficient approach to this?  Note: there may
>> be many form fields on the page upwards of 40 or 50 or even more some
>> of which are text areas, so I wrote off parameters.
>>
>> Any help or guidance would be greatly appreciated.
>>
>> Scott Vanya
>> ----------------------------------------------------------------------
>> --- Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for just about anything
>> Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> Exist-open mailing list
>> Exist-open@...
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>
>>
>
>
>
> --
> Adam Retter
>
> eXist Developer
> { England }
> adam@...
> irc://irc.freenode.net/existdb
>



--
Adam Retter

eXist Developer
{ England }
adam@...
irc://irc.freenode.net/existdb

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Parsing large amounts of post data

by Alessandro Vernet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Scott,

Vanya, Scott wrote:
I need to be able to update the db when there is a change to the page
(exiting, adding a new record, etc). I thought to do this by parsing the
Post data similar to:
http://en.wikibooks.org/wiki/XQuery/Parsing_Query_Strings
<http://en.wikibooks.org/wiki/XQuery/Parsing_Query_Strings>
The simplest way to do this is to:

* Have an XML document with only the data you want to store in the database (no UI).
* From XForms GET it from the eXist through the REST API when you need to read it to present the data to users.
* From XForms POST the document back to eXist after users have done modifications to the document through the form.

You can do this directly with the <xforms:submission> construct, which plays very well with the eXist REST API, and in most cases you'll see you won't even need to worry about writing XQuery.

Alex
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/