Yep, we do it all of time.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Rob Sobers
Sent: Thursday, December 09, 2010 6:53 PM
To: U2 Users List
Subject: Re: [U2] Sparse array population in Pick

Doug,

I love JSON and use it all the time, mainly in JavaScript and Python, but
how do you propose persisting it to a U2 database?  Or are you proposing
that one would persist data in the native attribute, value, sub-value format
and then de-serialize into JSON for the purpose of transporting?

-Rob

On Thu, Dec 9, 2010 at 7:41 PM, Doug <[email protected]> wrote:

> Read up about JSON (JavaScript Object Notation).  At least JSON is 
> compatible with Java, JavaScript, PHP, Python, and Ruby to name a few, 
> see http://json.org.  Your field names can be dictionaries or meta names.
> Most other languages besides Unidata or Universe are not happy with 
> dots in the named fields so you need to replace them with some other 
> character like a underline. You will have to write a parser in 
> UniBasic but you can do in about 30 lines of code.  This syntax 
> supports multi-values or even sub-values.  Here are some simple examples:
>
> Here is a single valued record:
>  [{"IdCode":"A","Desc":"Active","ReportColor":"#CCFFFF","No_AR":""}]
>
> Here is a multivalued record:
>
> [{"IdCode":"178*MAINT","CustomerNo":"178,"G1EffectiveDate":[["10/01/20
> 07"],[ "12/31/2010"]],"G1BillRate":[["0.00"],["1.00"]]}]"
>
> JavaScript Reference would be for the first line if it was loaded as 
> an object called oData as:
>
> Single array reference:
> oData[0].IdCode would be "178*MAINT"
>
> Multiple array reference:
> oData[0].G1EffectiveDate[1][0] would be "12/31/2010"
>
> We use this format in our U2WebLink middleware running under UniObjects
for
> Java for the Web.   The data is much more compact than XML and very
> readable.  Most of the languages have the ability to parse this in a 
> single function.  In JavaScript it takes around 7 to 10 milliseconds 
> to parse a pretty big JSON string into a JSON array.
>
> Regards,
> Doug 

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to