[Lazarus] Convert standard Lazarus application (Tforms and TButtons etc) into >>> a web application

Peter E Williams pewtas at gmail.com
Sat Dec 25 10:37:55 CET 2010


Hi All,

see comments inline.

Fond Regards, Peter Eric WILLIAMS
--- Hobart, Tasmania, Australia
--- Phone: +61 (03) 6236-9675
My free websites are:  http://pewink.info   (&)
   http://pewslinuxvault.googlepages.com
My free blog is: patientxmarksthespot.wordpress.com



2010/12/24 ik <idokan at gmail.com>

>  Hi,
>
> Please see my answers inline.
>
> 2010/12/24 Peter E Williams <pewslinuxvault at gmail.com>
>
> Hi all,
>>
>> Please excuse me if this is an obvious question.
>>
>> I have an application called Adv_Player which I programmed in Delphi 7
>> Enterprise project and I have since converted it to a Lazarus 0.9.28.2
>> project. (It is a very stable and fully test application available for
>> Windows XP from my download page in a setup exe file).
>>
>> Yes, I still have all the fully working original source code.
>>
>> Now I want to convert it into a web based application. I know that Delphi
>> 7 Enterprise can do this but I never got around to investigating HOW to go
>> about doing this.
>>
>> The application has a Adv_Main : TForm and lots of TEdit's, TButton's and
>> TCheckbox'es and TRadioButton's and a few TGroupBox'es (or do I mean
>> TRadioGroup ?) and TFrame's and maybe a TSplitter.
>>
>> The rest of the work is all done with my own code and reads and write some
>> text files with readln and writeln statements. These can be thought of as
>> comma separated value files.
>>
>
> First tip: HTTP is a stateless protocol. And you can get many requests at
> the same time, so handling text files by yourself is not recommended.
>
> Thanks for pointing that out but I already know this. I used to write
websites for the Royal Australian Navy up until 8 years ago with Dreamweaver
3 and html (also a little bit with Dreamweaver MX Studio). I have legal
copies of these from my Defence job.


> There are databases such as Redis <http://redis.io/> (it's non SQL based
> database) that know how to work with key-value data, but know how to handle
> multiple requests. And can save you a lot of issues with it.
>

Does Redis come with sample databases and websites? Where can I view these?


>  Questions:
>> What do I need to do in order for my application (currently about 5-6
>> TForms) into a web based application? Another application has about 10-12
>> TForms in it.
>>
>
> Translate your forms into HTML Forms<http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html>.
> One of the things I want to do but lack the time to do is to write a Lazarus
> Widget that is actually translating normal GUI forms into HTML Forms, but
> that's just a dream for now.
>
> I think this is called Webification, correct? Are there any software tools
to do this or is all done by hand?

>
>
>> How many of those components do I keep and what needs to be replaced and
>> with what equivalent components. E.g. what is the web based version of
>> TButton or TEdit etc?
>>
>
> Everything should be in HTML regarding what the client see. The logic is in
> the Server side.
>

Okay. Perhaps you misinterpreted my question. What is the HTML version of a
TButton, TEdit, TRadioButton, TCheckBox, etc. I know the basics of form
design with Dreamweaver 3 and I also have Dreamweaver MX Studio. It has been
a few years since I used them.

>
>> How do I tell Lazarus that my binary file will be launched from within my
>> html code?
>>
>
> You do not :) You have a web server. It tells regarding your route how the
> request will be handled, and send it to your application (CGI -> Common
> Gateway Interface) to work with it if configured properly.
>
>
Okay. So then my question is HOW do I write Java or JavaScript based on my
existing Lazarus 0.9.28.2 OO Pascal code which is fully working and
debugged?

Are there any software tools for conversion of Pascal to Java or JavaScript
[ called the CGI ]? I think that there are some but in a half hour google
for it I could not find them. If they are Windows-based then I can run them
with Wine. If they are Linux based then that's better.

I thought that I needed to use Lazarus and fpWeb to create some kind of
binary file which I upload to my Hosting24.com server so that I can use my
html code to use Java or JavaScript in my html file to call the binary
generated with Lazarus (which I would ftp to my server). Is this correct?


>> Can Lazarus do this?
>>
>
> Yes, I'm writing a commercial app just now using fpWeb and Lazarus.
>

Are there any Open Source examples of fpWeb and Lazarus.

I am thinking about either learning Java or NetBeans. My gut tells me to go
with Lazarus if I can find a sample O.S. fpWeb application I can study and
learn from.


>
>>
>> Would I be correct in assuming that ShowMessage() would not work it was
>> hosted on a website?
>>
>
> For that there is a dynamic language called JavaScript (or Emca Script)
> that does this. And client side work can also be done with it, but please
> note that on the server side, you can not assume that the data itself is
> valid if you tried to sanitize it in client side, so Javascript is to help
> your users not to help yourself (please remember it).
>
> Ok. So if I want to display a message on the users' system then I use
JavaScript. Thanks.


> You have also a lot of Javascript libraries. for webapps, you have ExtJS,
> and Lazarus have also ExtPascal for that. But if your application is
> commercial, you must buy a license for ExtJS afaik.
>

My application will be either non-commerical closed source or open source
with the same license as Lazarus (probably this option).


> You have also dojo, jquery mootools and more that provide a better
> javascript framework to work with.
>
>
HaHa ... now you're just throwing acronyms around :)


>
>> I want to how it on my own website which is hosted by Hosted24.com with my
>> Silver membership payment plan.
>>
>
read Hosting24.com not Hosted24


>
>> I also have Dreamweaver 3, Studio MX (including Dreamweaver MX) and
>> KompoZer for Mint 10 and Wine 1.3.
>>
>
> Personally I use regular editor such as vim, lazarus (it's not an IDE for
> non pascal code), kate/gedit for this type of tasks. In Linux you also have
> dedicated editors for working with web based technology, and you can use
> Oracle's NetBeans as an IDE, but for me as I said, I use regular text
> editors for that.
>
>
I had a quick look at NetBeans IDE today. It is big and a bit confusing.

How do you compare NetBeans IDE with Delphi 7 Enterprise and Dreamweaver MX
for HTML form designing? (I have all of these available to me).


>
>> Regards,
>>     PEW
>>
>> Fond Regards, Peter Eric WILLIAMS
>> --- Hobart, Tasmania, Australia
>> --- Phone: +61 (03) 6236-9675
>> My free websites are:  http://pewink.info   (&)
>>    http://pewslinuxvault.googlepages.com
>>
>> --
>> _______________________________________________
>> Lazarus mailing list
>> Lazarus at lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>>
> Ido
> LINESIP - Opening the source for communication
> http://www.linesip.com
> http://www.linesip.co.il
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
PEW
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20101225/7f876438/attachment-0003.html>


More information about the Lazarus mailing list