Re: [fpc-pascal] fpweb tutorial

2010-07-16 Thread Michael Van Canneyt




On Fri, 16 Jul 2010, Felipe Monteiro de Carvalho wrote:


I added a small introduction here: http://wiki.lazarus.freepascal.org/fcl-web

Having said that, I think that fpWeb worked quite well for my very
simple web page and all kinds of web applications could be developed
with it.


Great work.

I have expanded the page with some explanations on multiple modules and
actions.

Some things that need more work:
- Templates
- Content producers
- Difference between HTML Web module and regular web module

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-16 Thread Marcos Douglas
On Fri, Jul 16, 2010 at 2:23 AM, Felipe Monteiro de Carvalho
felipemonteiro.carva...@gmail.com wrote:
 I added a small introduction here: http://wiki.lazarus.freepascal.org/fcl-web

 Having said that, I think that fpWeb worked quite well for my very
 simple web page and all kinds of web applications could be developed
 with it.

Great work, congratulations.


MD
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-16 Thread ABorka
I've added some words on templates that points to the readme files and 
the example projects now coming with Lazarus demonstrating the usage of 
templates.


AB

On 7/16/2010 00:35, Michael Van Canneyt wrote:




On Fri, 16 Jul 2010, Felipe Monteiro de Carvalho wrote:


I added a small introduction here:
http://wiki.lazarus.freepascal.org/fcl-web

Having said that, I think that fpWeb worked quite well for my very
simple web page and all kinds of web applications could be developed
with it.


Great work.

I have expanded the page with some explanations on multiple modules and
actions.

Some things that need more work:
- Templates
- Content producers
- Difference between HTML Web module and regular web module

Michael.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-15 Thread Felipe Monteiro de Carvalho
I added a small introduction here: http://wiki.lazarus.freepascal.org/fcl-web

Having said that, I think that fpWeb worked quite well for my very
simple web page and all kinds of web applications could be developed
with it.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] fpweb tutorial

2010-07-13 Thread Felipe Monteiro de Carvalho
Hello,

Does anyone know where I can find documentation or a tutorial about fpweb?

Also, is the version included in FPC 2.4.0 very old and I should
really use the FPC SVN code or can I use the units that come with FPC
2.4.0?

I want to make a simple page which converts hexadecimal to a string. I
found some, but they were really crappy. Plain CGI should be the
prefered format, as apache modules are too much for this simple task.

thanks,
-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread Luiz Americo Pereira Camara

Felipe Monteiro de Carvalho escreveu:

Hello,

Does anyone know where I can find documentation or a tutorial about fpweb?
  


http://blog.silvioprog.com.br/2010/06/criando-um-aplicativo-cgi-com_27.html

It's in portuguese

Luiz

Also, is the version included in FPC 2.4.0 very old and I should
really use the FPC SVN code or can I use the units that come with FPC
2.4.0?

I want to make a simple page which converts hexadecimal to a string. I
found some, but they were really crappy. Plain CGI should be the
prefered format, as apache modules are too much for this simple task.

thanks,
  


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread Felipe Monteiro de Carvalho
Hello,

Thanks, with this blog I seam to be going somewhere and it worked ok
with fpc 2.4.0 and the weblaz.lpk package.

One thing still: Is there support for templates?

I am doing something like this to load my page:

procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest: TRequest;
  AResponse: TResponse; var Handled: Boolean);
begin
  AResponse.ContentType := 'text/html;charset=utf-8';
  AResponse.Contents.LoadFromFile(ExtractFilePath(ParamStr(0)) +
'mainpage.html');
  Handled := True;
end;

Something like powutils templates would be extremely handy ... all
that html mixed with pascal doesn't look very nice.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread Felipe Monteiro de Carvalho
Ah ... I see that you can just use Format for that ...

And what about reading a GET input =D Any ideas how to do that?

thanks,
-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread Michael Van Canneyt



On Tue, 13 Jul 2010, Felipe Monteiro de Carvalho wrote:


Hello,

Thanks, with this blog I seam to be going somewhere and it worked ok
with fpc 2.4.0 and the weblaz.lpk package.

One thing still: Is there support for templates?

I am doing something like this to load my page:

procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest: TRequest;
 AResponse: TResponse; var Handled: Boolean);
begin
 AResponse.ContentType := 'text/html;charset=utf-8';
 AResponse.Contents.LoadFromFile(ExtractFilePath(ParamStr(0)) +
'mainpage.html');
 Handled := True;
end;

Something like powutils templates would be extremely handy ... all
that html mixed with pascal doesn't look very nice.


You have templates, if you use actions.

Just create an action, and assign a template to it.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread Michael Van Canneyt



On Tue, 13 Jul 2010, Felipe Monteiro de Carvalho wrote:


Ah ... I see that you can just use Format for that ...

And what about reading a GET input =D Any ideas how to do that?


Well, Request.Variables['Myvar'] is enough, no ?

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread Marcos Douglas
On Tue, Jul 13, 2010 at 11:47 AM, Felipe Monteiro de Carvalho
felipemonteiro.carva...@gmail.com wrote:
 (...)
 Something like powutils templates would be extremely handy ... all
 that html mixed with pascal doesn't look very nice.

Read fpc/packages/fcl-web/fptemplate.txt


MD.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread Felipe Monteiro de Carvalho
On Tue, Jul 13, 2010 at 5:10 PM, Michael Van Canneyt
mich...@freepascal.org wrote:
 Well, Request.Variables['Myvar'] is enough, no ?

Doesn't seam to exist in fpc 2.4.0, any idea how to do that with that
version? I found a couple of stuff which didn't work, including:

Request.GetFieldByName();
Self.GetParam();

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread Michael Van Canneyt



On Tue, 13 Jul 2010, Felipe Monteiro de Carvalho wrote:


On Tue, Jul 13, 2010 at 5:10 PM, Michael Van Canneyt
mich...@freepascal.org wrote:

Well, Request.Variables['Myvar'] is enough, no ?


Doesn't seam to exist in fpc 2.4.0, any idea how to do that with that
version? I found a couple of stuff which didn't work, including:


My mistake, the correct name is 'Queryfields':

Avar:=Request.QueryFields['MyVar'];

And fieldByName() exists already in 2.2, but that queries environment
variables, not query variables (hence it will get stuff like 'QUERY_STRING').

I've never heard of GetParam()

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread ABorka

/lazarus/components/fpweb/demo/fptemplate/*.*

has examples of how to use templates and template tags.

On 7/13/2010 07:47, Felipe Monteiro de Carvalho wrote:

Hello,

Thanks, with this blog I seam to be going somewhere and it worked ok
with fpc 2.4.0 and the weblaz.lpk package.

One thing still: Is there support for templates?

I am doing something like this to load my page:

procedure TFPWebModule1.DataModuleRequest(Sender: TObject; ARequest: TRequest;
   AResponse: TResponse; var Handled: Boolean);
begin
   AResponse.ContentType := 'text/html;charset=utf-8';
   AResponse.Contents.LoadFromFile(ExtractFilePath(ParamStr(0)) +
'mainpage.html');
   Handled := True;
end;

Something like powutils templates would be extremely handy ... all
that html mixed with pascal doesn't look very nice.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb tutorial

2010-07-13 Thread Michael Van Canneyt



On Tue, 13 Jul 2010, Felipe Monteiro de Carvalho wrote:


By the way, is there a page in the wiki about fpweb? I used the wiki
search and found none. I would like to add this info to the wiki, but
thought about asking if there is already a page about it (the wiki
search isn't very reliable).


look for fcl-web, but the page is very limited :-)

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal