Marco's Web Center

Menu for Development

Site Menu
Object Pascal Handbook
Delphi Handbooks Collection
Mastering Borland Delphi 2005
(Old) White Papers
(Old)Tools
(Old) Conferences

My Other Sites
Italian Site (www.marcocantu.it)
the delphi search

Spirit of delphi

Advertising
Home My Blog Books Object Pascal Marco

Home: Code Repository: Mastering Delphi 5

Project IEFIRST

Project Structure


IEFIRST.DPR

program IeFirst;

{$APPTYPE CONSOLE}

uses
  WebBroker,
  CGIApp,
  IeFirstDm in 'IeFirstDm.pas' {WebModule1: TWebModule};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TWebModule1, WebModule1);
  Application.Run;
end.

IEFIRSTDM.PAS

unit IeFirstDm;

interface

uses
  Windows, Messages, SysUtils, Classes, HTTPApp, MidItems, Db, DBClient,
  MConnect, SConnect, CompProd, PagItems, MidProd, XMLBrokr;

type
  TWebModule1 = class(TWebModule)
    XMLBroker1: TXMLBroker;
    MidasPageProducer1: TMidasPageProducer;
    DataForm1: TDataForm;
    DataGrid1: TDataGrid;
    DataNavigator1: TDataNavigator;
    DCOMConnection1: TDCOMConnection;
    PageProducer1: TPageProducer;
    procedure XMLBroker1GetResponse(Sender: TObject; Request: TWebRequest;
      Response: TWebResponse; var Handled: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  WebModule1: TWebModule1;

implementation

{$R *.DFM}

procedure TWebModule1.XMLBroker1GetResponse(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
  Response.Content := '<h1>Updated</h1><p>' +
    MidasPageProducer1.Content;
  Handled := True;
end;

end.

IEFIRSTDM.DFM

object WebModule1: TWebModule1
  OldCreateOrder = False
  Actions = <
    item
      Default = True
      Name = 'WebActionItem1'
      PathInfo = '/MidasPageProducer1'
      Producer = MidasPageProducer1
    end>
  Left = 243
  Top = 200
  Height = 480
  Width = 696
  object XMLBroker1: TXMLBroker
    Params = <>
    ProviderName = 'DataSetProvider1'
    RemoteServer = DCOMConnection1
    WebDispatch.MethodType = mtAny
    WebDispatch.PathInfo = 'XMLBroker1'
    ReconcileProducer = PageProducer1
    OnGetResponse = XMLBroker1GetResponse
    Left = 64
    Top = 96
  end
  object MidasPageProducer1: TMidasPageProducer
    HTMLDoc.Strings = (
      '<HTML>'
      '<HEAD>'
      '</HEAD>'
      '<BODY>'
      '<#INCLUDES><#STYLES><#WARNINGS><#FORMS><#SCRIPT>'
      '</BODY>'
      '</HTML>')
    IncludePathURL = 'C:/Program Files/Borland/Delphi5/Source/Webmidas/'
    Left = 64
    Top = 152
    object DataForm1: TDataForm
      object DataGrid1: TDataGrid
        XMLBroker = XMLBroker1
        DisplayRows = 8
        TableAttributes.CellSpacing = 0
      end
      object DataNavigator1: TDataNavigator
        XMLComponent = DataGrid1
      end
    end
  end
  object DCOMConnection1: TDCOMConnection
    Connected = True
    ServerGUID = '{09E11D63-4A55-11D3-B9F1-00000100A27B}'
    ServerName = 'AppServ1.AppServerOne'
    Left = 64
    Top = 40
  end
  object PageProducer1: TPageProducer
    HTMLDoc.Strings = (
      '<h1>Update Errors</h1>'
      ''
      '<p>Something went wrong in your udpate request....'
      '<p>Get back to previous page.'
      ''
      ''
      '')
    Left = 136
    Top = 96
  end
end