mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-22 06:09:14 +02:00
* Description of the fpweb system
git-svn-id: trunk@4978 -
This commit is contained in:
parent
ae29d531d6
commit
885a65c7c6
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1057,6 +1057,7 @@ fcl/unix/resolve.inc svneol=native#text/plain
|
|||||||
fcl/unix/simpleipc.inc svneol=native#text/plain
|
fcl/unix/simpleipc.inc svneol=native#text/plain
|
||||||
fcl/web/Makefile svneol=native#text/plain
|
fcl/web/Makefile svneol=native#text/plain
|
||||||
fcl/web/Makefile.fpc svneol=native#text/plain
|
fcl/web/Makefile.fpc svneol=native#text/plain
|
||||||
|
fcl/web/README svneol=native#text/plain
|
||||||
fcl/web/custcgi.pp svneol=native#text/plain
|
fcl/web/custcgi.pp svneol=native#text/plain
|
||||||
fcl/web/fpcgi.pp svneol=native#text/plain
|
fcl/web/fpcgi.pp svneol=native#text/plain
|
||||||
fcl/web/fpdatasetform.pp svneol=native#text/plain
|
fcl/web/fpdatasetform.pp svneol=native#text/plain
|
||||||
|
188
fcl/web/README
Normal file
188
fcl/web/README
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
This is the beginning of a server side web system for FPC.
|
||||||
|
Although it is non-visual, it is geared towards use in Lazarus.
|
||||||
|
|
||||||
|
Architecture:
|
||||||
|
|
||||||
|
htmldefs
|
||||||
|
--------
|
||||||
|
(in ../inc) contains basic HTML declarations.
|
||||||
|
|
||||||
|
httpdefs
|
||||||
|
--------
|
||||||
|
contains the basic HTTP system definitions:
|
||||||
|
header field names
|
||||||
|
TCookie(s):
|
||||||
|
collection with cookies in web request
|
||||||
|
TUploadedFile(s):
|
||||||
|
collection with uploaded files in request
|
||||||
|
THTTPHeader:
|
||||||
|
Class describes HTTP Request/Response headers.
|
||||||
|
it has properties for all possible HTTP headers, including cookies
|
||||||
|
TRequest:
|
||||||
|
Descendent of THTTPHeader, describes client request.
|
||||||
|
Contains uploaded files.
|
||||||
|
TResponse:
|
||||||
|
describes the web server response. Includes headers and contents.
|
||||||
|
TCustomSession:
|
||||||
|
Base for all session components.
|
||||||
|
|
||||||
|
fphttp:
|
||||||
|
-------
|
||||||
|
Basic web system components/classes
|
||||||
|
|
||||||
|
TCustomHTTPModule:
|
||||||
|
Abstract TDataModule descendant, which processes a webrequest
|
||||||
|
and prepares a response.
|
||||||
|
TModuleFactory/TModuleItem:
|
||||||
|
Module registration and creation system.
|
||||||
|
TCustomWebAction(s):
|
||||||
|
Webactions.
|
||||||
|
RegisterHTTPModule():
|
||||||
|
routine registers a module with the web system.
|
||||||
|
THTTPContentProducer :
|
||||||
|
abstract HTTP producer component.
|
||||||
|
|
||||||
|
The idea is that the URL relative to the server is taken and parsed as
|
||||||
|
follows
|
||||||
|
http://www.server.org/Path1/Path2
|
||||||
|
|
||||||
|
Path1 determines which module in the system is created to handle the
|
||||||
|
request. (the factory is queried)
|
||||||
|
Path2 determines which web action inside the module is used to handle the
|
||||||
|
request. (implemented in TWebModule, see fpweb)
|
||||||
|
|
||||||
|
websession
|
||||||
|
----------
|
||||||
|
Implements basic session support.
|
||||||
|
|
||||||
|
TSessionHTTPModule:
|
||||||
|
TCustomHTTPModule descendent with session support.
|
||||||
|
TIniWebSession:
|
||||||
|
TCustomSession descendent which stores session variables in inifiles.
|
||||||
|
TFPWebSession:
|
||||||
|
TIniWebSession descendent for use in fpweb. Uses cookies to store session info.
|
||||||
|
GetDefaultSession() :
|
||||||
|
returns default session object.
|
||||||
|
|
||||||
|
fptemplate
|
||||||
|
----------
|
||||||
|
Unit which implements template support.
|
||||||
|
|
||||||
|
TTemplateParser:
|
||||||
|
Template parse object. Does the actual parsing and replacing. Delimiters
|
||||||
|
are configurable. Standard variables can be specified, callbacks for unknown
|
||||||
|
values can be set.
|
||||||
|
|
||||||
|
TFPCustomTemplate:
|
||||||
|
TPersistent for use in components. Allows properties to configure the
|
||||||
|
TTemplateParser. Supports streams, template and template files.
|
||||||
|
|
||||||
|
fpweb
|
||||||
|
-----
|
||||||
|
Actual usable implementation of TCustomHTTPModule.
|
||||||
|
|
||||||
|
TFPWebAction(s):
|
||||||
|
Web actions with template support.
|
||||||
|
TCustomFPWebModule:
|
||||||
|
Descends from TSessionHTTPModule, implements WebActions and has template support.
|
||||||
|
TFPWebModule:
|
||||||
|
published TCustomFPWebModule properties for use in Lazarus.
|
||||||
|
|
||||||
|
fphtml
|
||||||
|
------
|
||||||
|
This creates web modules specialized in creating HTML content.
|
||||||
|
|
||||||
|
THTMLContentProducer:
|
||||||
|
Descendent of THTTPContentProducer which produces HTML
|
||||||
|
THTMLCustomDatasetContentProducer:
|
||||||
|
Descendent of THTTPContentProducer which produces HTML from datasets.
|
||||||
|
THTMLDatasetContentProducer:
|
||||||
|
Descendent of THTMLCustomDatasetContentProducer which publishes some
|
||||||
|
properties.
|
||||||
|
THTMLSelectProducer:
|
||||||
|
Produces a combo box.
|
||||||
|
THTMLDatasetSelectProducer
|
||||||
|
Produces a combo box bases on values in a dataset.
|
||||||
|
TCustomHTMLModule:
|
||||||
|
TCustomHTTPModule descendent which produces HTML content only.
|
||||||
|
|
||||||
|
htmlelements
|
||||||
|
------------
|
||||||
|
|
||||||
|
Implements a DOM for HTML content. Contains a TDOMElement descendent for
|
||||||
|
all valid HTML 4.1 tags.
|
||||||
|
|
||||||
|
THtmlCustomElement:
|
||||||
|
Basis for all HTML tag elements.
|
||||||
|
THTMLDocument:
|
||||||
|
TDOMDocument descendent
|
||||||
|
THTMLIDElement:
|
||||||
|
element representing <ID> tag
|
||||||
|
|
||||||
|
All tags are in tagsintf.inc.
|
||||||
|
|
||||||
|
htmlwriter
|
||||||
|
----------
|
||||||
|
|
||||||
|
Implements a verified HTML producer.
|
||||||
|
|
||||||
|
THTMLwriter:
|
||||||
|
This is a class which allows to write certified correct HTML.
|
||||||
|
It works using the DOM for HTML.
|
||||||
|
It also has forms support.
|
||||||
|
|
||||||
|
Writing HTML is done as follows:
|
||||||
|
|
||||||
|
StartBold;
|
||||||
|
Write('This text is bold');
|
||||||
|
EndBold;
|
||||||
|
or
|
||||||
|
Bold('This text is bold');
|
||||||
|
|
||||||
|
But the following is also possible
|
||||||
|
Bold(Center('Bold centered text'));
|
||||||
|
|
||||||
|
Open tags will be closed automatically.
|
||||||
|
|
||||||
|
wtagsintf.inc contains all possible tags.
|
||||||
|
|
||||||
|
fpdatasetform
|
||||||
|
-------------
|
||||||
|
|
||||||
|
This contains classes which allow to create complicated HTML/forms
|
||||||
|
based on a TDataset.
|
||||||
|
|
||||||
|
THTMLDatasetFormProducer
|
||||||
|
Creates an edit form for a TDataset record.
|
||||||
|
Complicated table layouts are possible.
|
||||||
|
|
||||||
|
THTMLDatasetFormGridProducer
|
||||||
|
Creates a grid with data from a TDataset
|
||||||
|
Complicated table formatting is possible.
|
||||||
|
|
||||||
|
|
||||||
|
custcgi:
|
||||||
|
--------
|
||||||
|
CGI application base class. It knows nothing of the fp
|
||||||
|
HTTP module system.
|
||||||
|
|
||||||
|
TCustomCGIApplication :
|
||||||
|
TCustomApplication descendent which handles a CGI request.
|
||||||
|
No instance of this class is created, this is done in fpcgi.
|
||||||
|
|
||||||
|
TCGIRequest:
|
||||||
|
TRequest descendent which retrieves content from the CGI
|
||||||
|
environment.
|
||||||
|
|
||||||
|
TCGIResponse:
|
||||||
|
TResponse descendent which returns content to the CGI environment.
|
||||||
|
|
||||||
|
fpcgi:
|
||||||
|
------
|
||||||
|
Standard CGI application instance.
|
||||||
|
|
||||||
|
TCGIApplication:
|
||||||
|
TCustomCGIApplication descendent which uses the fpWeb system
|
||||||
|
to create a TCustomHTTPModuleClass to handle the request.
|
||||||
|
|
||||||
|
It contains an Application instance which handles everything.
|
Loading…
Reference in New Issue
Block a user