Page 13 of 28

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sat Jun 09, 2012 1:05 pm
by Roberto Lopez
rathinagiri wrote:In that case, can we mingle uhttp and websocket server so that we can use single Harbour server to produce both html and data over network?
Eventually yes.

But I'm not interested in generating dynamic html pages from a Harbour server. That is the classic/old model with all the problems related to sessions, security, speed and program logic.

The HMGSCRIPT idea is that the program logic be in the client with the server providing data services (basically: query, append, delete and modify tables).

In such context, we only need an http server to make our client applications available (html+javascript). Those applications will connect with a websockets server to manage data.

The beauty of this is that (eventually) we could change servers, from (ie) a Harbour websockets server to a PHP one, capable to manage MySql.

Despite this (of course) everyone can made their choice and use mixed programming models, but IMHO that will only make the things more complex.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sat Jun 09, 2012 1:28 pm
by Rathinagiri
I do like the thin server concept. This will make the server free.

IMHO, raw data (with encryption and compression if possible) shall be sent over the network by the server and html pages creation (even tagging like <td><tr><tr/></td>) shall be done at client side. This will save the bandwidth a lot.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sat Jun 09, 2012 1:50 pm
by Roberto Lopez
rathinagiri wrote:I do like the thin server concept. This will make the server free.

IMHO, raw data (with encryption and compression if possible) shall be sent over the network by the server and html pages creation (even tagging like <td><tr><tr/></td>) shall be done at client side. This will save the bandwidth a lot.
Regarding (ie) query sample, a more clean design should send the data to the client in xml, json or any other format, then decode in the client and 'load' the table with it.

But consider that encoding the data (ie) in xml, will add some load to the original data, making bigger, as the table tags do.

We must study this carefully.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sat Jun 09, 2012 1:59 pm
by Rathinagiri
Yes. There are open source Pure JavaScript GZip decompressors available. And if we can gzip the whole thing at the server and send that will be nice.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sat Jun 09, 2012 2:59 pm
by Roberto Lopez
rathinagiri wrote:Yes. There are open source Pure JavaScript GZip decompressors available. And if we can gzip the whole thing at the server and send that will be nice.
Sounds good.

Anyway, prior to that, we must create a nice generic query function on the server to avoiding to recode every time we need a new one for other table and/or filter conditions.

I'm facing a problem with that, since doing this:

Code: Select all

   Button( 'button_1' , 'win' , 390 , 110 , "Exec. QueryTest() " , "SendMessage( 'QueryTest()' , processresponse );" );  
Works fine, but, trying to include a character parameter to specify table name, the JS application crash. ie:

Code: Select all

   Button( 'button_1' , 'win' , 390 , 110 , "Exec. QueryTest() " , "SendMessage( 'QueryTest( "test" )' , processresponse );" );  
I'm stuck here...

Making only four generic routines like these:

Query ( cTable , cFIlter , cOrder , aFields )
Append ( cTable , aFields, aValues)
Replace ( cTable , cForCondition , aFields, aValues )
Delete ( cTable , cForCondition )

We will not need to create our own server routines in most cases and we could easily adapt them for another websockets server (ie: a PHP one) that we could host everywhere (no necessarily an in-house server).

ANy help with JS problem described above is welcome.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sat Jun 09, 2012 3:45 pm
by Rathinagiri
Can't we do like this and alter prg source to accommodate this?

Code: Select all

Button( 'button_1' , 'win' , 390 , 110 , "Exec. QueryTest() " , "SendMessage( 'QueryTest( )', 'test' , processresponse );" );  

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sat Jun 09, 2012 6:50 pm
by Roberto Lopez
rathinagiri wrote:Can't we do like this and alter prg source to accommodate this?

Code: Select all

Button( 'button_1' , 'win' , 390 , 110 , "Exec. QueryTest() " , "SendMessage( 'QueryTest( )', 'test' , processresponse );" );  
I'm trying to make it in the most intuitive and easy way as possible... I'll still thinking about that...

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sat Jun 09, 2012 9:28 pm
by apais
since clipper days [ and ] are also string delimiters IE: Querytest([string])

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sun Jun 10, 2012 2:12 am
by Roberto Lopez
HMGSCRIPT R011

I've added 'Panel'. it serves as container. It is basically a scrollable div intended to be an HTML container (I've used in the server demo to put the query table there).

I've enhanced server query() function. It includes now checkboxes. I've changed the client too. It allows to select/unselect rows, show selected rows content and change cell content.

Enjoy!

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Posted: Sun Jun 10, 2012 2:21 am
by Roberto Lopez
apais wrote:since clipper days [ and ] are also string delimiters IE: Querytest([string])
It Works!

I've use Clipper since Autumn'86 and I've don't knew that :)

Thanks!