Icon View Thread

The following is the text of the current message along with any replies.
Messages 21 to 24 of 24 total
Thread Raul's comment Re: Frustrated
Sun, Jul 22 2012 5:10 PMPermanent Link

Raul

Team Elevate Team Elevate



Yes - i wanted to have something generic so i can build a generic helper
library for this once and then just reuse.

Forgot to mention the field support - this was me just playing around so
i only did common fields for this one so string,integer,boolean and
TDateTime are OK but most others are stripped for now. It's easy to add
support for those as process is simple as it's same process over and over.

Also i did not mention was that the server uses the URL "/table" as path
as "actionable" uRL indicating we want table content - otherwise it's
doing file serving - hence the url+'/table' in requests.

I realized my JSON server side code is very similar to the sample
dbserver Tim posted so you can just use that as its easily available.

Look for :
- function BuildRows(Table: TDBISAMTable): String;"
- function BuildColumns(Table: TDBISAMTable): String;
in main.pas file
http://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_demos&msg=26&page=1

The JSON reference is also handy :
http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=JSON_Reference

JSON is text format similar to but with less overhead than XML but since
it is text all you're doing is building the text string as you loop thru
the table and in my case i have not even bothered to use a 3rd part
library (like SuperObject) but doing my own string building and parsing.

The web sever side otherwise just really just needs to return 3 things:
- response code 200 (OK)
- preferably proper mime content type of application/json though EWB
does not really care and is o with text/html even
- actual JSON as generated by functions above

Let me know if you need more info

Raul

On 7/22/2012 3:17 PM, Jerry Clancy wrote:
> Raul,
>
> I have no problem with long posts, particularly when they are so useful.
>
> The demo you sent worked fine with a couple of DBISAM files I copied
> over, except that the server conversion program doesn't like Date fields
> -- it stripped them all out.
>
> I get the EWB side and it also uses the TServerRequest.URL field as I
> expected. What I would like to see is your server-side JSON-related code
> (without any of the proprietary stuff if you can extract it). I should
> be able to cobble together a Delphi project to handle the calls and do
> the conversion and run it as an .exe or callable .dll on our server. If
> I can then develop and run a simple EWB project working on "my" data, I
> should then be home free.
>
> The EWB code you sent below is easily generalized for any DBISAM table
> "open" as a TDataSet.
>
> Can't thank you enough for the help.
>
> Jerry
>
Sun, Jul 22 2012 5:31 PMPermanent Link

Gerald J. Clancy, Jr.

See below.

"Raul" <raul@removethis.raul.ca> wrote in message
news:5C71F674-0EF1-4481-80ED-2736566A7A32@news.elevatesoft.com...
>
>
> Yes - i wanted to have something generic so i can build a generic helper
> library for this once and then just reuse.

Me, too.

> Forgot to mention the field support - this was me just playing around so i
> only did common fields for this one so string,integer,boolean and
> TDateTime are OK but most others are stripped for now. It's easy to add
> support for those as process is simple as it's same process over and over.

Understood. It turns out that Tim covers all the data types in his Test
Server code. Really appreciate Tim for having done this. I just had to find
it.

>
> Also i did not mention was that the server uses the URL "/table" as path
> as "actionable" uRL indicating we want table content - otherwise it's
> doing file serving - hence the url+'/table' in requests.
>
> I realized my JSON server side code is very similar to the sample dbserver
> Tim posted so you can just use that as its easily available.

Yep. But your effort is likewise appreciated.

> Look for :
> - function BuildRows(Table: TDBISAMTable): String;"
> - function BuildColumns(Table: TDBISAMTable): String;
> in main.pas file
> http://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_demos&msg=26&page=1

I've already got both of these, as well as the Reference below and have
reviewed the two funtions you mention above. Now I have the comfort zone I
was looking for.

> The JSON reference is also handy :
> http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=JSON_Reference
>
> JSON is text format similar to but with less overhead than XML but since
> it is text all you're doing is building the text string as you loop thru
> the table and in my case i have not even bothered to use a 3rd part
> library (like SuperObject) but doing my own string building and parsing.
>
> The web sever side otherwise just really just needs to return 3 things:
> - response code 200 (OK)
> - preferably proper mime content type of application/json though EWB does
> not really care and is o with text/html even
> - actual JSON as generated by functions above

Understood. We do this for other apps.

> Let me know if you need more info
>
> Raul

Will do, and thanks. Have one question that I'll post under a new subject.

Jerry

Mon, Jul 23 2012 1:06 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jerry,

<< As for the DBISAM comments, I am referring to server-side components that
can be accessed in a datamodule-like unit (or a form itself) and used to
generate data to be sent to the client. In other words, that the TDataSet
component can evenually be tied to a DBISAM table bringing with it paths and
field references or auto-generated JSON structures. Don't use EDB. All our
projects (and code) are tied to DBISAM. >>

More than likely, I'll simply be adding a native DBISAM PHP extension at
some point that will surface functions for generating the JSON (EDB will
have this first).  You'll still need to do some coding, but it will be minor
and application-specific.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Jul 23 2012 1:25 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jerry,

<< The demo you sent worked fine with a couple of DBISAM files I copied
over, except that the server conversion program doesn't like Date fields --  
it stripped them all out. >>

This may be due to some changes during EWB development when native DateTime
field support was added to the data-handling in EWB.  Originally, date/times
were being handled as text until the proper formatting, etc. support could
be added to the RTL.

I'll see if I can post a sample web server shortly that will host up DBISAM
tables exactly as required.  That will help everyone see what's involved and
alleviate having everything fall on Raul's (very capable) shoulders.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
« Previous PagePage 3 of 3
Jump to Page:  1 2 3
Image