Changeset 32 for trunk/Application


Ignore:
Timestamp:
Sep 13, 2010, 8:35:39 AM (14 years ago)
Author:
george
Message:
  • Upraveno: Třída pro obsluhu CGI aplikace přepracována na obecný HTTP server s podporou pro CGI HTTP server a přímý TCP HTTP server dle výběru zděděných tříd.
  • Přidáno: Podpůrné obecné třídy ve složce Common.
  • Přidáno: Komponenta Synapse pro obsluhu TCP spojení.
Location:
trunk/Application
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/UCustomCGIApplication.pas

    r29 r32  
    66
    77uses
    8   Classes, SysUtils, UCGIApplication, Contnrs, USqlDatabase, UConfig, DateUtils,
    9   UXmlClasses, UHtmlClasses, UCore, UStringListEx;
     8  Classes, SysUtils, UHTTPServerCGI, Contnrs, USqlDatabase, UConfig, DateUtils,
     9  UXmlClasses, UHtmlClasses, UCore, UStringListEx, UHTTPServer;
    1010
    1111type
     
    2121  { TCustomCGIApplication }
    2222
    23   TCustomCGIApplication = class(TCGIApplication)
     23  TCustomCGIApplication = class(THTTPServerCGI)
    2424  private
    2525    procedure Footer;
     
    4343    PageName: string;
    4444    ModuleName: string;
    45     procedure Execute; override;
     45    BaseURL: string;
     46    procedure Execute(HandlerData: THTTPHandlerData);
    4647    constructor Create;
    4748    destructor Destroy; override;
     
    8485end;
    8586
    86 procedure TCustomCGIApplication.Execute;
     87procedure TCustomCGIApplication.Execute(HandlerData: THTTPHandlerData);
    8788var
    8889  I: Integer;
    8990  TitleTag: THtmlString;
    9091begin
     92  with HandlerData do begin
    9193  Style := ConfigStyle;
    9294  BaseURL := ConfigBaseURL;
     
    98100  HtmlDocument.Scripts.Add(NavigationLink('/Style/' + Style + '/jquery.js'));
    99101
    100   if QueryParts.Count > 0 then PageName := QueryParts[0]
     102  if Request.QueryParts.Count > 0 then PageName := Request.QueryParts[0]
    101103    else PageName := '';
    102104  I := 0;
     
    112114    with HtmlDocument.AsXmlDocument do try
    113115      Formated := ConfigFormatHTML;
    114       Output.Add(AsString);
     116      Response.Stream.WriteString(AsString);
    115117    finally
    116118      Free;
    117119    end;
    118   end else Output.Add(SPageNotFound);
     120  end else Response.Stream.WriteString(SPageNotFound);
     121  end;
    119122end;
    120123
     
    126129  Pages := TObjectList.Create;
    127130  HtmlDocument := THtmlDocument.Create;
     131  OnRequest := Execute;
    128132end;
    129133
Note: See TracChangeset for help on using the changeset viewer.