Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-06 Thread ABorka

Sorry Joost, but I posted 2(+1) more, much smaller ones though :)

http://bugs.freepascal.org/view.php?id=13280
and
http://bugs.freepascal.org/view.php?id=13287

The third I submitted contains the rest of the example CGI/Apache 
projects to demonstrate the use of FCL-web with templates.

http://bugs.freepascal.org/view.php?id=13288


I promise these are the last bugs I found while creating these example 
applications for fcl-web. All started by trying to reply to some people 
on the forum asking questions about using fpweb :)


I attached the README.txt for the whole set of examples if anyone is 
interested what is in there (don't panic, only about 50 something lines).


AB


Joost van der Sluis wrote:

Op zaterdag 28-02-2009 om 22:06 uur [tijdzone -0800], schreef ABorka:

I posted the following patch as
http://bugs.freepascal.org/view.php?id=13254

(includes the changes posted in 13250 and 13228 too)


It takes soo long before the patches are applied because they are too
large. ;)

Now you create more patches which are even longer and then another one
which is again longer... That doesn't make it easier for us.

It takes hours to look at such patches.

So next time (not this time, we're already on it now) provide small
patches if you can and try not to include old patches into new ones.
Although I do admit that that's more work, that way we can apply faster
and that way it's easier for you to make new changes...

Joost.

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

These examples are demonstrating some uses of templates (with FPTemplate) when 
generating HTML pages by CGI programs or Apache modules.

The main idea is to leave the web page designing and lookfeel to the web page 
designers. Separating the web page design from the back end CGI/Apache 
application makes it possible to design, change or redesign a whole website 
without modifying a single line of code in the CGI/Apache application. 
Back end programmers and web page designers can work parallel easily and 
neither side needs extensive knowledge of the other (doesn't hurt, just not 
necessary most of the time). 

With all this said, none of the examples are focusing on nice look and feel in 
their template designs, merely on demonstrating the functionality and use of 
templates, template tags and template tag parameters with live applications.


Examples list:

1. /simpletemplate/*.*
The simplest template with one template tag in it to be replaced by the 
CGI/Apache application when generating the response page - {TagName1}

2. /tagparam/*.*
Demonstrating the set up and use of the template tag parameter(s) 
- {+DATETIME [-FORMAT=MM/DD hh:mm:ss-]+}

3. /listrecords/*.*
Demonstrates the use of a template tag with multiple template tag parameters 
to list multiple records, tables, lists, etc.

4. /fileupload/*.*
Demonstrates uploading file(s) to a web server with the help of a CGI program 
or Apache module by using so called multipart html forms.
See README.txt

5. /sessions/*.*
These examples demonstrate three different ways to maintain and use sessions 
when building web sites that need to carry over or store information to 
following web pages, differentiate between visitors, etc.

5.a. /sessions/cookiesessions-auto/*.*
See README.txt

5.b. /sessions/cookiesessions-login/*.*
See README.txt

5.c. /sessions/urlsessions-login/*.*
See README.txt


Note: All of the examples have both CGI and Apache subdirectories. The web 
modules (unit1.pas, unit1.lfm) for the paired CGI/Apache subdirectories are 
exactly the same showing that from a developer's standpoint there is not too 
much difference between writing CGI programs or Apache modules.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-04 Thread Florian Klaempfl
Graeme Geldenhuys schrieb:
 This is where a Git repository comes in really handy. Create a new
 local feature branch or stash existing changes while working on new
 changes. Then unstash / pop old changes again.
 
 Florian, do you read freeX magazine (same people as Toolbox)?

No.

 I wrote
 an Introduction to Git article for the magazine - so I could learn
 more about Git as well. In the process, I have learnt such a lot. Git
 has some truly amazing (and maybe not that well known) features that
 really impressed be.

It doesn't help if it can not do basic things like:
- Windows support (console *and* GUI)
- line feed conversion
right.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-04 Thread Florian Klaempfl
Alexander Klenin schrieb:
 On Sun, Mar 1, 2009 at 21:06, Florian Klaempfl flor...@freepascal.org wrote:
 If one has more patches, something like using mercurial queues is a good
 idea. Maybe Alexander Klenin could write a short tutorial how to use mq
 to maintain patches.
 
 There are many tutorials already:
 http://www.google.ru/search?q=mercurial+queues+tutorial
 The only thing I should note is that, contrary to recommendation by
 some tutorials,
 one must _not_ turn on git diff option, since resulting patches will
 not be applicable by svn.

Due to their flexible concept, DVCS require good descriptions of working
practices especially because most people are not common with DVCS and as
the win32text documentation showed, their documentation is still far
from perfect.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-03 Thread Graeme Geldenhuys
On Sun, Mar 1, 2009 at 11:50 AM, Joost van der Sluis jo...@cnoc.nl wrote:

 So next time (not this time, we're already on it now) provide small
 patches if you can and try not to include old patches into new ones.
 Although I do admit that that's more work, that way we can apply faster
 and that way it's easier for you to make new changes...

This is where a Git repository comes in really handy. Create a new
local feature branch or stash existing changes while working on new
changes. Then unstash / pop old changes again.

Florian, do you read freeX magazine (same people as Toolbox)? I wrote
an Introduction to Git article for the magazine - so I could learn
more about Git as well. In the process, I have learnt such a lot. Git
has some truly amazing (and maybe not that well known) features that
really impressed be.

Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-03 Thread Alexander Klenin
On Sun, Mar 1, 2009 at 21:06, Florian Klaempfl flor...@freepascal.org wrote:
 If one has more patches, something like using mercurial queues is a good
 idea. Maybe Alexander Klenin could write a short tutorial how to use mq
 to maintain patches.

There are many tutorials already:
http://www.google.ru/search?q=mercurial+queues+tutorial
The only thing I should note is that, contrary to recommendation by
some tutorials,
one must _not_ turn on git diff option, since resulting patches will
not be applicable by svn.

On Tue, Mar 3, 2009 at 19:17, Graeme Geldenhuys graemeg.li...@gmail.com wrote:
 This is where a Git repository comes in really handy. Create a new
 local feature branch or stash existing changes while working on new
 changes. Then unstash / pop old changes again.

Indeed -- while Mercurial Queues provide necessary tools, Git rebase
--interactive
is more powerful and easier to work with.

-- 
Alexander S. Klenin
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-01 Thread Michael Van Canneyt


On Sat, 28 Feb 2009, ABorka wrote:

 Hi,
 
 I posted the following patch as
 http://bugs.freepascal.org/view.php?id=13254
 
 (includes the changes posted in 13250 and 13228 too)

I am looking at the patch and will apply it ASAP.

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


Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-01 Thread Joost van der Sluis
Op zaterdag 28-02-2009 om 22:06 uur [tijdzone -0800], schreef ABorka:
 I posted the following patch as
 http://bugs.freepascal.org/view.php?id=13254
 
 (includes the changes posted in 13250 and 13228 too)

It takes soo long before the patches are applied because they are too
large. ;)

Now you create more patches which are even longer and then another one
which is again longer... That doesn't make it easier for us.

It takes hours to look at such patches.

So next time (not this time, we're already on it now) provide small
patches if you can and try not to include old patches into new ones.
Although I do admit that that's more work, that way we can apply faster
and that way it's easier for you to make new changes...

Joost.

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


Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-01 Thread Florian Klaempfl
 
 So next time (not this time, we're already on it now) provide small
 patches if you can and try not to include old patches into new ones.
 Although I do admit that that's more work, that way we can apply faster
 and that way it's easier for you to make new changes...

If one has more patches, something like using mercurial queues is a good
idea. Maybe Alexander Klenin could write a short tutorial how to use mq
to maintain patches.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-01 Thread ABorka

Sorry guys, I knew I should have called them service packs, not patches :)

In the future I would like to do it in the right way, but I'm not 
exactly sure how. Lets say I check out the latest SVN and make some 
changes in a few files in /FCL-web/ .

I generate a patch file which contains the differences.
I create a mantis report and submit the patch there. So far so good.
Now, I would like to do more changes in /FCL-web/ , how do I make the 
SVN client to not include the previous changes in the following patch 
file generations until the patches are all applied to the SVN trunk?


AB

Joost van der Sluis wrote:

Op zaterdag 28-02-2009 om 22:06 uur [tijdzone -0800], schreef ABorka:

I posted the following patch as
http://bugs.freepascal.org/view.php?id=13254

(includes the changes posted in 13250 and 13228 too)


It takes soo long before the patches are applied because they are too
large. ;)

Now you create more patches which are even longer and then another one
which is again longer... That doesn't make it easier for us.

It takes hours to look at such patches.

So next time (not this time, we're already on it now) provide small
patches if you can and try not to include old patches into new ones.
Although I do admit that that's more work, that way we can apply faster
and that way it's easier for you to make new changes...

Joost.

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



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


Re: [fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-03-01 Thread Florian Klaempfl
ABorka schrieb:
 Sorry guys, I knew I should have called them service packs, not patches :)
 
 In the future I would like to do it in the right way, but I'm not
 exactly sure how. Lets say I check out the latest SVN and make some
 changes in a few files in /FCL-web/ .
 I generate a patch file which contains the differences.
 I create a mantis report and submit the patch there. So far so good.
 Now, I would like to do more changes in /FCL-web/ , how do I make the
 SVN client to not include the previous changes in the following patch
 file generations until the patches are all applied to the SVN trunk?

The best solution to handle this is to use patch queues. For example
mercurial offers this with Mercurial Queues:
http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension

As base for your patches you can use the fpc mercurial ready only
mirror: http://florianklaempfl.de:8000/fpctrunk
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Patch for FCL-web; bug fixes and improvements for CGI and Apache applications

2009-02-28 Thread ABorka

Hi,

I posted the following patch as
http://bugs.freepascal.org/view.php?id=13254

(includes the changes posted in 13250 and 13228 too)

1. Added: CGI and Apache applications' temporary uploaded files will be 
deleted after a request is handled /html forms with file upload(s)/ so 
the files are not left there in the temporary directory.


2. Fixed: Temporary files are not created with a single CRLF in them for 
html forms where no file(s) were uploaded.


3. Added: Apache applications are now processing and passing the input 
parameters (QueryFields, ContentFields, uploaded files, etc.). This was 
only there for CGI applications.


4. THTTPHeader and descendants RemoteAddress property renamed to 
RemoteAddr for Delphi compatibility


5. Note: For some unknown reason for apache mods the

ap_get_remote_host(FRequest^.Connection, FRequest^.Per_Dir_Config, 
REMOTE_HOST, Nil)
call is always crashing, therefore for now this field is not populated. 
This would force a DNS lookup according to the HostnameLookups setting 
in the Apache configuration.


6. Minor changes and corrections in comments here and there in FCL-web

7. Added custom header handling to CGI and Apache applications
(ex: can send Pragma: no-cache header now, can do redirects, etc.)

8. Added the procedure SendRedirect(const TargetURL:String) to CGI and 
Apache applications

(302 Found for HTTP/1.0 and 307 Temporary Redirect for HTTP/1.1)

9. Fixed a bug for Apache applications that returned with the same 
action results after any action with the use of TFPTemplate called
(the FPTemplate which is a global property for a web module was not 
reset after an action was handled)


10. Fixed a bug for Apache applications to pass the Status Code and 
Content Encoding to the web server in the response.
(ex: can send 'Content-Type: text/html; charset=ISO-8859-2' now to the 
clients, redirects need it too to pass the status code, etc.)


11. Fixed the header name/value pair passing for Apache applications
(do not need the extra space for the header values, apache puts it there
automatically)

12. Minor changes to the template usage example projects in some 
comments (the Template:TFPTemplate is a property of the web module, not 
the web action)


13. Changed the behaviour for CGI and Apache applications when non 
existing actions are called. Until now, an error message was displayed. 
Now the default action is called if it exists. If not, an error message 
is displayed.


14. fptemplate.txt is extended with more code snippets and step by step 
instructions on how to create apache and cgi applications that are using 
templates.


15. Example projects were created for the above step by step guide into
/packages/fcl-web/examples/ about the usage of template files


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