Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-03

New version of WebDesign available

29 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Schnell
to Joost van der Sluis
Joost van der Sluis wrote
This package can be used to develop webpages for FCL-Web using a Lazarus-designer.

Can you elaborate what the package does and or provide a link to a documentation ?

it seems to be something similar to ExtP (which is a Lazarus package to help using ExtPascal, which helps Pascal programmers with using EXTJS <by Google> )

-Thanks

Reply by email

Joost van der Sluis
to Michael Schnell
Michael Schnell wrote 6 lines
On 03/12/2010 12:42 PM, Joost van der Sluis wrote: > This package can be used to develop webpages for FCL-Web using a > Lazarus-designer. > Can you elaborate what the package does and or provide a link to a documentation ?

See my mail from jan 24th.

it seems to be something similar to ExtP (which is a Lazarus package to help using ExtPascal, which helps Pascal programmers with using EXTJS <by Google> )

I've used some ideas from ExtPas, yes.

This is more general, though. You can use it with jQuery (which is provided) but also with ExtPas (or Qooxdoo if you want). Although there's no code for those yet.

Joost.

Reply by email

Michael Schnell
to Joost van der Sluis
Joost van der Sluis wrote
See my mail from jan 24th.

Thanks. Found it in the Backlog. (I (was not subscribed to this mailing list at this date)

Do these web-applications support persistent CGI programs using AJAX / Comet ?

If yes, how is this done ?

If no, do you want to cooperate with me on this (see my message 02/11 12:28 (creating a Lazarus package "NoGUIApplication")

-Michael

Reply by email

Michael Schnell
to Michael Schnell

In your mail from jan 24 I found:

"adds some functionality for server based and client site event handling"

This sounds as if persistent CGI would be supported.

Would it be possible to create a CGI that allows for this:

- The Browser surfs to the CGI location
- some Web page is shown containing some kind of Memo-Box
- the user does nothing at all
- whenever a character is received at the server's TTYS0 port, it is shown in the MEMO

- no project specific Java script programming is done (just using the AJAX / Comet stuff)
- no fast polling is done by the Java script code, Only avoiding TCP/IP timeout requites some activity now and then.

Another example (avoiding any hardware binding) would be a simple http chat cgi.

-Michael

Reply by email

Joost van der Sluis
to Michael Schnell
Michael Schnell wrote 16 lines
In your mail from jan 24 I found: "adds some functionality for server based and client site event handling" This sounds as if persistent CGI would be supported. Would it be possible to create a CGI that allows for this: - no project specific Java script programming is done (just using the AJAX / Comet stuff) - no fast polling is done by the Java script code, Only avoiding TCP/IP timeout requites some activity now and then. Another example (avoiding any hardware binding) would be a simple http chat cgi.

Not without polling

Joost.

Reply by email

Michael Schnell
to Joost van der Sluis
Joost van der Sluis wrote 6 lines
> Another example (avoiding any hardware binding) would be a simple http > chat cgi. > Not without polling

I'm not sure what you mean by "polling" here.

Of course a chat CGI (and the other examples I mentioned) do need polling for remote updates of the web page by Java script on the Browser site to avoid HTTP timeout. To avoid unnecessary communication, AJAX/Comet can be used to create "hanging" HTTP requests that only are answered by the CGI program when an update is available or before a timeout hits.

OTOH with the standard CGI paradigm, with each HTTP communication the CGI program starts and finishes. So the CGI program does not have any permanent "states". Thus a "chat" would need to store the text to be transferred in a file or a database, creating a huge overhead.

With the "persistent" CGI paradigm, the CGI program keeps living and can transfer the text it received from one user to the other just by managing the requests that come in from the web server as byte streams.

The NoGUIApplication package, I am planning, will allow for doing such persistent CGI applications. I feel that you could create a very viable enhancement for WebDesign, optionally enabling persistent CGI, using NoGUIApplication. So I'd be happy if you can test this, once I'm able to provide a working version.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 31 lines
On 03/15/2010 08:56 PM, Joost van der Sluis wrote: >> Another example (avoiding any hardware binding) would be a simple http >> chat cgi. >> > Not without polling > > I'm not sure what you mean by "polling" here. Of course a chat CGI (and the other examples I mentioned) do need polling for remote updates of the web page by Java script on the Browser site to avoid HTTP timeout. To avoid unnecessary communication, AJAX/Comet can be used to create "hanging" HTTP requests that only are answered by the CGI program when an update is available or before a timeout hits. OTOH with the standard CGI paradigm, with each HTTP communication the CGI program starts and finishes. So the CGI program does not have any permanent "states". Thus a "chat" would need to store the text to be transferred in a file or a database, creating a huge overhead. With the "persistent" CGI paradigm, the CGI program keeps living and can transfer the text it received from one user to the other just by managing the requests that come in from the web server as byte streams. The NoGUIApplication package, I am planning, will allow for doing such persistent CGI applications. I feel that you could create a very viable enhancement for WebDesign, optionally enabling persistent CGI, using NoGUIApplication. So I'd be happy if you can test this, once I'm able to provide a working version.

If I understand your explanation correct, all this already exists since quite some time in the fastcgi application type. See the custfcgi and fpfcgi unit.

Michael.

Reply by email

Joost van der Sluis
to Michael Schnell: I'm not sure what you mean by "polling" here. Of course a chat CGI (and the other…
Michael Schnell wrote 16 lines
On 03/15/2010 08:56 PM, Joost van der Sluis wrote: >> Another example (avoiding any hardware binding) would be a simple http >> chat cgi. >> > Not without polling > > I'm not sure what you mean by "polling" here. Of course a chat CGI (and the other examples I mentioned) do need polling for remote updates of the web page by Java script on the Browser site to avoid HTTP timeout. To avoid unnecessary communication, AJAX/Comet can be used to create "hanging" HTTP requests that only are answered by the CGI program when an update is available or before a timeout hits.

By polling I meant that you need it to see if there are any changes. Not only for the timeout. That's because you can not use a "hanging" http request.

This can be solved, though. (I don't even think it's much work, we only need an interface to read the output from the client after the initial request-headers are parsed. Now the rest of the input is simply ignored)

OTOH with the standard CGI paradigm, with each HTTP communication the CGI program starts and finishes. So the CGI program does not have any permanent "states". Thus a "chat" would need to store the text to be transferred in a file or a database, creating a huge overhead.

That's not true. What you could do is keep your program/module persistent in memory. In every cgi-call from the client you include a session-identifier. Then you can decide on the server side to which persistent module this call has to be referred to.

With the "persistent" CGI paradigm, the CGI program keeps living and can transfer the text it received from one user to the other just by managing the requests that come in from the web server as byte streams.

Yes, but not using a 'byte stream' but separate requests. (byte stream is offcource also possible, but see above)

Show quoted text 5 lines
The NoGUIApplication package, I am planning, will allow for doing such persistent CGI applications. I feel that you could create a very viable enhancement for WebDesign, optionally enabling persistent CGI, using NoGUIApplication. So I'd be happy if you can test this, once I'm able to provide a working version.

The fcl-web examples that are online now, all uses rest-handling of data. If I have some more time i'll write an example to show the behaviour as described above.

Joost.

Reply by email

Michael Schnell
to Joost van der Sluis: By polling I meant that you need it to see if there are any changes. Not only for the…
Joost van der Sluis wrote 5 lines
That's not true. What you could do is keep your program/module persistent in memory. In every cgi-call from the client you include a session-identifier. Then you can decide on the server side to which persistent module this call has to be referred to.

AFAIK, the web server will not send anything to the browser unless it detects that the CGI program exits. So polling does not work, as the http client does not see any answers.

Yes, but not using a 'byte stream' but separate requests. (byte stream is offcource also possible, but see above)

According to my research this is not possible. But maybe I'm wrong.

The fcl-web examples that are online now, all uses rest-handling of data. If I have some more time i'll write an example to show the behaviour as described above.

Great !
Looking forward to this !

Thanks,
-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 8 lines
On 03/17/2010 10:42 AM, Michael Van Canneyt wrote: > > If I understand your explanation correct, all this already exists since > quite some time in the fastcgi application type. See the custfcgi and > fpfcgi unit. > Is there an example of a "fastcgi" project that uses a TTimer or something similar ?

No, but a fastcgi application is an application as any other.

It cannot use a TTimer, since TTimer presupposes a GUI and an X server. It can use a TFPTimer, which does not suppose a GUI and X server.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote
It cannot use a TTimer, since TTimer presupposes a GUI and an X server.

That is what I did expect.

It can use a TFPTimer, which does not suppose a GUI and X server.

Sounds good. So it might have an event queue.

I'll take a fastCGI Application in fact implements the NoGUIApplication that I need and I can use it, even if I will not do a CGI. Perhaps just the name is confusing...

My intention is to create a "toolbox" that allows to convert free running (embedded) "normal" applications to not needing the GTK binding (after having stripped them from the user interface). But they still do need things like Timers, TCP/IP communication, serial interfaces, threads (with "synchronize" and "postmessage" / "procedure...message")

I'll take a deep look at it :)

Thanks for your advice !
-Michael

Reply by email

Joost van der Sluis
to Michael Schnell: AFAIK, the web server will not send anything to the browser unless it detects that the…
Michael Schnell wrote 9 lines
On 03/17/2010 11:58 AM, Joost van der Sluis wrote: > That's not true. What you could do is keep your program/module > persistent in memory. In every cgi-call from the client you include a > session-identifier. Then you can decide on the server side to which > persistent module this call has to be referred to. > AFAIK, the web server will not send anything to the browser unless it detects that the CGI program exits. So polling does not work, as the http client does not see any answers.

In all cases I'm talking about fcgi, offcourse. Or you can make it an Apache module. Or, indeed Isapi. But the headers for this are still missing.

Note however that this is all really build for web-applications. If you want to make some embedded-remote-gui system. This all won't work and you have to build your own TApplication type, indeed.

Joost.

Reply by email

Joost van der Sluis
to Michael Schnell: That is what I did expect. Sounds good. So it might have an event queue. I'll take a …
Michael Schnell wrote 9 lines
On 03/17/2010 01:32 PM, Michael Van Canneyt wrote: > It cannot use a TTimer, since TTimer presupposes a GUI and an X server. That is what I did expect. > It can use a TFPTimer, which does not suppose > a GUI and X server. Sounds good. So it might have an event queue.

It doesn't need to. It has a web-server, which queues all requests, and sends them one-by-one to the fcgi application. (If you configure it right)

Maybe fastCGI Application in fact implements the NoGUIApplication that I need and I can use it, even if I will not do a CGI. Perhaps just the name is confusing...

No, it implements a fastCGI application. You can not use it for what you want. Otoh, what you want is not necessary to build a persistent web-application. That can be done much easier. (As is done in the fastCgi application)

Show quoted text 5 lines
My intention is to create a "toolbox" that allows to convert free running (embedded) "normal" applications to not needing the GTK binding (after having stripped them from the user interface). But they still do need things like Timers, TCP/IP communication, serial interfaces, threads (with "synchronize" and "postmessage" / "procedure...message")

Well, the fcl-web applications do not support timers, TCP/IP, serial interfases and postmessage functionality.

So you cannot use it for anything you want, would be my guess.

You can use the same mechanism as is used by the TWebApplication, though. Build your own TApplication descendent, which does all this. But I thought that was precisely what you are working on?

Joost.

Reply by email

Michael Van Canneyt
to Joost van der Sluis
Joost van der Sluis wrote 32 lines
On Wed, 2010-03-17 at 14:15 +0100, Michael Schnell wrote: > On 03/17/2010 01:32 PM, Michael Van Canneyt wrote: >> It cannot use a TTimer, since TTimer presupposes a GUI and an X server. > > That is what I did expect. > >> It can use a TFPTimer, which does not suppose >> a GUI and X server. > > Sounds good. So it might have an event queue. It doesn't need to. It has a web-server, which queues all requests, and sends them one-by-one to the fcgi application. (If you configure it right) > Maybe fastCGI Application in fact implements the NoGUIApplication that I > need and I can use it, even if I will not do a CGI. Perhaps just the > name is confusing... No, it implements a fastCGI application. You can not use it for what you want. Otoh, what you want is not necessary to build a persistent web-application. That can be done much easier. (As is done in the fastCgi application) > My intention is to create a "toolbox" that allows to convert free > running (embedded) "normal" applications to not needing the GTK binding > (after having stripped them from the user interface). But they still do > need things like Timers, TCP/IP communication, serial interfaces, > threads (with "synchronize" and "postmessage" / "procedure...message") Well, the fcl-web applications do not support timers, TCP/IP, serial interfases and postmessage functionality.

Why not ?
My fcl-web application does a SOAP request to another server. What is this other than a TCP/IP request to another machine ?

Michael.

Reply by email

Michael Schnell
to Joost van der Sluis: It doesn't need to. It has a web-server, which queues all requests, and sends them…
Joost van der Sluis wrote 5 lines
No, it implements a fastCGI application. You can not use it for what you want. Otoh, what you want is not necessary to build a persistent web-application. That can be done much easier. (As is done in the fastCgi application)

I see. What I intend to do can be extended be a persistent web-application, So there is an example of a persistent web-application that can't be done with fastCGI :).

OTOH, I feel that any persistent web-application can be done with a NoGUIApplication infrastructure, the advantage for those that _can_ be done as fastCGI applications is that with same, the normal "Delphi"-paradigm of event-driven main-thread programming can be used, making it a lot easier to use for experienced Delphi programmers without much CGI background.

Show quoted text 5 lines
Well, the fcl-web applications do not support timers, TCP/IP, serial interfases and postmessage functionality. So you cannot use it for anything you want, would be my guess.

That is what I supposed :( .

You can use the same mechanism as is used by the TWebApplication, though. Build your own TApplication descendent, which does all this. But I thought that was precisely what you are working on?

That is what I already have :).

But (see my earlier mails) I feel it would be more appropriate to do a new Widget Type than a new Application Type.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 16 lines
On 03/17/2010 02:34 PM, Joost van der Sluis wrote: > No, it implements a fastCGI application. You can not use it for what you > want. Otoh, what you want is not necessary to build a persistent > web-application. That can be done much easier. (As is done in the > fastCgi application) > I see. What I intend to do can be extended be a persistent web-application, So there is an example of a persistent web-application that can't be done with fastCGI :). OTOH, I feel that any persistent web-application can be done with a NoGUIApplication infrastructure, the advantage for those that _can_ be done as fastCGI applications is that with same, the normal "Delphi"-paradigm of event-driven main-thread programming can be used, making it a lot easier to use for experienced Delphi programmers without much CGI background.

There is no reason why fcl-web cannot be used for this; it is totally event driven. The only "event" currently defined is the request from the client.

Show quoted text 16 lines
> Well, the fcl-web applications do not support timers, TCP/IP, serial > interfases and postmessage functionality. > > So you cannot use it for anything you want, would be my guess. > That is what I supposed :( . > You can use the same mechanism as is used by the TWebApplication, > though. Build your own TApplication descendent, which does all this. But > I thought that was precisely what you are working on? > That is what I already have :). But (see my earlier mails) I feel it would be more appropriate to do a new Widget Type than a new Application Type.

This I really don't understand, and never have since you started the discussion.

There are no widgets in your application. It's a server application that sits in the background. So why create a new widget type ?

There is, if I understand you correct, an event loop.

All fine, but an event loop can be programmed in various ways, without the HUGE overhead of the LCL widgetset.

Michael.

Reply by email

Paul Breneman
to Michael Schnell: That is what I did expect. Sounds good. So it might have an event queue. I'll take a …

Michael,

Show quoted text 5 lines
My intention is to create a "toolbox" that allows to convert free running (embedded) "normal" applications to not needing the GTK binding (after having stripped them from the user interface). But they still do need things like Timers, TCP/IP communication, serial interfaces, threads (with "synchronize" and "postmessage" / "procedure...message")

I've been using FreePascal and fpGUI on this 7" Linux touchscreen: http://www.embeddedarm.com/products/board-detail.php?product=TS-TPC-7390

I also need to run the same program (without the GUI) on similar Linux boards. What you are seeking is something I need as well. I hope we can keep in touch and get this accomplished.

Regards, Paul Breneman www.dbReplication.com - VCL database replication components www.TurboControl.com - Hardware and software development services - Educational programming project for environment monitoring - Information on using FreePascal for embedded systems - Support information for the TurboPower open source libraries

Reply by email

Michael Schnell
to Paul Breneman: I've been using FreePascal and fpGUI on this 7" Linux touchscreen:…
Paul Breneman wrote 5 lines
I also need to run the same program (without the GUI) on similar Linux boards. What you are seeking is something I need as well. I hope we can keep in touch and get this accomplished.

I'm intending to do this as an open source project, hopefully as a Lazarus package to make it easy to use.

As I seem to be forced to copy a lot LCL code (i.e. the event queue implementation) from the "gtk" Widget Type folder into the folder I'll be using for the new Widget Type, I hope I can work with the Lazarus "powers" to move this code into a dedicated unit or include file to be used by both Widget Types.

I'll be happy if you could test the stuff once it's in a state you can take a look at. Please stay tuned; I'll post a message here once I have something I can show.

-Michael

Reply by email

Michael Schnell
to Paul Breneman: I've been using FreePascal and fpGUI on this 7" Linux touchscreen:…
Paul Breneman wrote

Nice !

The work I'm doing here is triggered by the need to use a very low power consuming processor PCB for this Delphi-program. This will be an ARM in the first intended implementation.

In fact the TX-TXP-7390 is an interesting hardware for some applications we intend. (There are some that do require a local GUI.)

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell: I see. If nothing else is needed you are fine. :) -Michael
Michael Schnell wrote 7 lines
On 03/17/2010 03:06 PM, Michael Van Canneyt wrote: > > There is no reason why fcl-web cannot be used for this; it is totally > event driven. The only "event" currently defined is the request from > the client. I see. If nothing else is needed you are fine. :)

That still does not explain why you think it is necessary to create a new widget type instead of just implementing a more general event loop ?

Lazarus can be used perfectly for applications that do not have a widget set or do not use the LCL.

Michael.

Reply by email

Michael Schnell
to Michael Van Canneyt
Michael Van Canneyt wrote 8 lines
That still does not explain why you think it is necessary to create a new widget type instead of just implementing a more general event loop ? Lazarus can be used perfectly for applications that do not have a widget set or do not use the LCL.

I need to do a kind of tool box that allows my colleagues who do "embedded" Delphi programs, to create versions of same that - instead of a PC - run on a "headless" Linux enabled ARM-PCB (without any support for user interface). The necessary code changes should be as minimal as possible and the final source code needs to be compilable as well with Delphi - to create exactly the application that they already have - and with Lazarus - to create an application for the ARM PCB.

And these colleagues do use stuff like "TTimer", "procedure ... message", "postmessage", TThread.Synchronize, serial interfaces, TCP/IP, ...

The Lazarus team did a great work providing a decently Delphi-compatible LCL implementation to use Linux/GTK. And thus concentrating the solution for the additional differences (avoiding the GTK binding) in a new Widget Type seems the best way to go.

-Michael

Reply by email

Michael Van Canneyt
to Michael Schnell
Michael Schnell wrote 24 lines
On 03/17/2010 03:33 PM, Michael Van Canneyt wrote: > > That still does not explain why you think it is necessary to create > a new widget type instead of just implementing a more general event > loop ? > > Lazarus can be used perfectly for applications that do not have a > widget set or do not use the LCL. > I need to do a kind of tool box that allows my colleagues who do "embedded" Delphi programs, to create versions of same that - instead of a PC - run on a "headless" Linux enabled ARM-PCB (without any support for user interface). The necessary code changes should be as minimal as possible and the final source code needs to be compilable as well with Delphi - to create exactly the application that they already have - and with Lazarus - to create an application for the ARM PCB. And these colleagues do use stuff like "TTimer", "procedure ... message", "postmessage", TThread.Synchronize, serial interfaces, TCP/IP, ... The Lazarus team did a great work providing a decently Delphi-compatible LCL implementation to use Linux/GTK. And thus concentrating the solution for the additional differences (avoiding the GTK binding) in a new Widget Type seems the best way to go.

Aha, now I get it.

So a typical case of "problem between chair and monitor"...

Well, I would re-educate my colleagues, nothing for it. Because before you know it, you'll find yourself re-creating the entire windows API, and where does that end... :/

Thanks for the explanation.

Michael.

Reply by email

Lee Jenkins
to Joost van der Sluis: In all cases I'm talking about fcgi, offcourse. Or you can make it an Apache module. Or,…
Joost van der Sluis wrote 15 lines
On Wed, 2010-03-17 at 12:57 +0100, Michael Schnell wrote: > On 03/17/2010 11:58 AM, Joost van der Sluis wrote: >> That's not true. What you could do is keep your program/module >> persistent in memory. In every cgi-call from the client you include a >> session-identifier. Then you can decide on the server side to which >> persistent module this call has to be referred to. >> > AFAIK, the web server will not send anything to the browser unless it > detects that the CGI program exits. So polling does not work, as the > http client does not see any answers. In all cases I'm talking about fcgi, offcourse. Or you can make it an Apache module. Or, indeed Isapi. But the headers for this are still missing.

It seems that you started on the ISAPI implementation. How is that going?

Warm Regards, Lee

Reply by email

Joost van der Sluis
to Michael Van Canneyt: Why not ? My fcl-web application does a SOAP request to another server. What is this…
Michael Van Canneyt wrote 39 lines
On Wed, 17 Mar 2010, Joost van der Sluis wrote: > On Wed, 2010-03-17 at 14:15 +0100, Michael Schnell wrote: >> On 03/17/2010 01:32 PM, Michael Van Canneyt wrote: >>> It cannot use a TTimer, since TTimer presupposes a GUI and an X server. >> >> That is what I did expect. >> >>> It can use a TFPTimer, which does not suppose >>> a GUI and X server. >> >> Sounds good. So it might have an event queue. > > It doesn't need to. It has a web-server, which queues all requests, and > sends them one-by-one to the fcgi application. (If you configure it > right) > >> Maybe fastCGI Application in fact implements the NoGUIApplication that I >> need and I can use it, even if I will not do a CGI. Perhaps just the >> name is confusing... > > No, it implements a fastCGI application. You can not use it for what you > want. Otoh, what you want is not necessary to build a persistent > web-application. That can be done much easier. (As is done in the > fastCgi application) > >> My intention is to create a "toolbox" that allows to convert free >> running (embedded) "normal" applications to not needing the GTK binding >> (after having stripped them from the user interface). But they still do >> need things like Timers, TCP/IP communication, serial interfaces, >> threads (with "synchronize" and "postmessage" / "procedure...message") > > Well, the fcl-web applications do not support timers, TCP/IP, serial > interfases and postmessage functionality. Why not ? My fcl-web application does a SOAP request to another server. What is this other than a TCP/IP request to another machine ?

I meant that it is not implemented within the framework. It uses the webserver for all that.

Joost.

Reply by email