README 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. This is the beginning of a server side web system for FPC.
  2. Although it is non-visual, it is geared towards use in Lazarus.
  3. Architecture:
  4. htmldefs
  5. --------
  6. (in ../inc) contains basic HTML declarations.
  7. httpdefs
  8. --------
  9. contains the basic HTTP system definitions:
  10. header field names
  11. TCookie(s):
  12. collection with cookies in web request
  13. TUploadedFile(s):
  14. collection with uploaded files in request
  15. THTTPHeader:
  16. Class describes HTTP Request/Response headers.
  17. it has properties for all possible HTTP headers, including cookies
  18. TRequest:
  19. Descendent of THTTPHeader, describes client request.
  20. Contains uploaded files.
  21. TResponse:
  22. describes the web server response. Includes headers and contents.
  23. TCustomSession:
  24. Base for all session components.
  25. fphttp:
  26. -------
  27. Basic web system components/classes
  28. TCustomHTTPModule:
  29. Abstract TDataModule descendant, which processes a webrequest
  30. and prepares a response.
  31. TModuleFactory/TModuleItem:
  32. Module registration and creation system.
  33. TCustomWebAction(s):
  34. Webactions.
  35. RegisterHTTPModule():
  36. routine registers a module with the web system.
  37. THTTPContentProducer :
  38. abstract HTTP producer component.
  39. The idea is that the URL relative to the server is taken and parsed as
  40. follows
  41. http://www.server.org/Path1/Path2
  42. Path1 determines which module in the system is created to handle the
  43. request. (the factory is queried)
  44. Path2 determines which web action inside the module is used to handle the
  45. request. (implemented in TWebModule, see fpweb)
  46. websession
  47. ----------
  48. Implements basic session support.
  49. TSessionHTTPModule:
  50. TCustomHTTPModule descendent with session support.
  51. TIniWebSession:
  52. TCustomSession descendent which stores session variables in inifiles.
  53. TFPWebSession:
  54. TIniWebSession descendent for use in fpweb. Uses cookies to store session info.
  55. GetDefaultSession() :
  56. returns default session object.
  57. fptemplate
  58. ----------
  59. Unit which implements template support.
  60. TTemplateParser:
  61. Template parse object. Does the actual parsing and replacing. Delimiters
  62. are configurable. Standard variables can be specified, callbacks for unknown
  63. values can be set.
  64. TFPCustomTemplate:
  65. TPersistent for use in components. Allows properties to configure the
  66. TTemplateParser. Supports streams, template and template files.
  67. fpweb
  68. -----
  69. Actual usable implementation of TCustomHTTPModule.
  70. TFPWebAction(s):
  71. Web actions with template support.
  72. TCustomFPWebModule:
  73. Descends from TSessionHTTPModule, implements WebActions and has template support.
  74. TFPWebModule:
  75. published TCustomFPWebModule properties for use in Lazarus.
  76. fphtml
  77. ------
  78. This creates web modules specialized in creating HTML content.
  79. THTMLContentProducer:
  80. Descendent of THTTPContentProducer which produces HTML
  81. THTMLCustomDatasetContentProducer:
  82. Descendent of THTTPContentProducer which produces HTML from datasets.
  83. THTMLDatasetContentProducer:
  84. Descendent of THTMLCustomDatasetContentProducer which publishes some
  85. properties.
  86. THTMLSelectProducer:
  87. Produces a combo box.
  88. THTMLDatasetSelectProducer
  89. Produces a combo box bases on values in a dataset.
  90. TCustomHTMLModule:
  91. TCustomHTTPModule descendent which produces HTML content only.
  92. htmlelements
  93. ------------
  94. Implements a DOM for HTML content. Contains a TDOMElement descendent for
  95. all valid HTML 4.1 tags.
  96. THtmlCustomElement:
  97. Basis for all HTML tag elements.
  98. THTMLDocument:
  99. TDOMDocument descendent
  100. THTMLIDElement:
  101. element representing <ID> tag
  102. All tags are in tagsintf.inc.
  103. htmlwriter
  104. ----------
  105. Implements a verified HTML producer.
  106. THTMLwriter:
  107. This is a class which allows to write certified correct HTML.
  108. It works using the DOM for HTML.
  109. It also has forms support.
  110. Writing HTML is done as follows:
  111. StartBold;
  112. Write('This text is bold');
  113. EndBold;
  114. or
  115. Bold('This text is bold');
  116. But the following is also possible
  117. Bold(Center('Bold centered text'));
  118. Open tags will be closed automatically.
  119. wtagsintf.inc contains all possible tags.
  120. fpdatasetform
  121. -------------
  122. This contains classes which allow to create complicated HTML/forms
  123. based on a TDataset.
  124. THTMLDatasetFormProducer
  125. Creates an edit form for a TDataset record.
  126. Complicated table layouts are possible.
  127. THTMLDatasetFormGridProducer
  128. Creates a grid with data from a TDataset
  129. Complicated table formatting is possible.
  130. custcgi:
  131. --------
  132. CGI application base class. It knows nothing of the fp
  133. HTTP module system.
  134. TCustomCGIApplication :
  135. TCustomApplication descendent which handles a CGI request.
  136. No instance of this class is created, this is done in fpcgi.
  137. TCGIRequest:
  138. TRequest descendent which retrieves content from the CGI
  139. environment.
  140. TCGIResponse:
  141. TResponse descendent which returns content to the CGI environment.
  142. fpcgi:
  143. ------
  144. Standard CGI application instance.
  145. TCGIApplication:
  146. TCustomCGIApplication descendent which uses the fpWeb system
  147. to create a TCustomHTTPModuleClass to handle the request.
  148. It contains an Application instance which handles everything.