diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.Sample.html new file mode 100644 index 0000000..3698485 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.Sample.html @@ -0,0 +1,31 @@ + + + + + + + + + +

+ Briefcase model sample +

+ + +

Purpose

+

+ This example shows how to create a briefcase model using a Data Abstract Client. +

+

Getting Started

+ + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.bdsgroup new file mode 100644 index 0000000..1bf8297 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + BriefcaseModelServer.bdsproj + BriefcaseModelClient.bdsproj + BriefcaseModelServer.exe BriefcaseModelClient.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.bpg new file mode 100644 index 0000000..ef89764 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = BriefcaseModelServer.exe BriefcaseModelClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +BriefcaseModelServer.exe: BriefcaseModelServer.dpr + $(DCC) + +BriefcaseModelClient.exe: BriefcaseModelClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.groupproj new file mode 100644 index 0000000..25568d5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModel.groupproj @@ -0,0 +1,40 @@ + + + {8aedcb5a-78e5-4e85-8261-093aa6a47a12} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.bdsproj new file mode 100644 index 0000000..e3d7939 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + BriefcaseModelClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.dpr new file mode 100644 index 0000000..71bcbd6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.dpr @@ -0,0 +1,19 @@ +program BriefcaseModelClient; + +uses + uROComInit, + Forms, + MidasLib, + BriefcaseModelClientMain in 'BriefcaseModelClientMain.pas' {BriefcaseModelClientMainForm}, + BriefcaseModelClientData in 'BriefcaseModelClientData.pas' {BriefcaseModelClientDataModule: TDAClientDataModule}, + BriefcaseModelClientChanges in 'BriefcaseModelClientChanges.pas' {BriefcaseModelClientChangesForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Briefcase Model Client'; + Application.CreateForm(TBriefcaseModelClientDataModule, BriefcaseModelClientDataModule); + Application.CreateForm(TBriefcaseModelClientMainForm, BriefcaseModelClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.dproj new file mode 100644 index 0000000..0d29ec6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.dproj @@ -0,0 +1,78 @@ + + + {bbc1c7e0-ae64-480d-a016-c817f7590577} + BriefcaseModelClient.dpr + Debug + AnyCPU + DCC32 + BriefcaseModelClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + BriefcaseModelClient.dpr + + + + + + + MainSource + + +
BriefcaseModelClientChangesForm
+
+ +
BriefcaseModelClientDataModule
+
+ +
BriefcaseModelClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientChanges.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientChanges.dfm new file mode 100644 index 0000000..ccdcd29 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientChanges.dfm @@ -0,0 +1,58 @@ +object BriefcaseModelClientChangesForm: TBriefcaseModelClientChangesForm + Left = 108 + Top = 133 + AutoScroll = False + Caption = 'Changes' + ClientHeight = 352 + ClientWidth = 405 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object Splitter1: TSplitter + Left = 0 + Top = 123 + Width = 405 + Height = 8 + Cursor = crVSplit + Align = alBottom + Beveled = True + end + object ListView: TListView + Left = 0 + Top = 131 + Width = 405 + Height = 221 + Align = alBottom + Columns = < + item + Caption = 'Name' + Width = 200 + end + item + Caption = 'Old value' + Width = 100 + end + item + Caption = 'New value' + Width = 100 + end> + OwnerData = True + ReadOnly = True + RowSelect = True + TabOrder = 0 + ViewStyle = vsReport + OnData = ListViewData + end + object ListBox: TListBox + Left = 0 + Top = 0 + Width = 405 + Height = 123 + Align = alClient + ItemHeight = 13 + TabOrder = 1 + OnClick = ListBoxClick + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientChanges.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientChanges.pas new file mode 100644 index 0000000..5218501 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientChanges.pas @@ -0,0 +1,115 @@ +unit BriefcaseModelClientChanges; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, ComCtrls; + +type + TBriefcaseModelClientChangesForm = class(TForm) + ListView: TListView; + Splitter1: TSplitter; + ListBox: TListBox; + procedure ListBoxClick(Sender: TObject); + procedure ListViewData(Sender: TObject; Item: TListItem); + private + { Private declarations } + procedure SetupListview; + procedure Setup; + public + { Public declarations } + + end; + +var + BriefcaseModelClientChangesForm: TBriefcaseModelClientChangesForm; + +procedure ShowChanges; +implementation +uses + uDADelta, BriefcaseModelClientData, uDAInterfaces; + +{$R *.dfm} + +procedure ShowChanges; +begin + with TBriefcaseModelClientChangesForm.Create(Application) do try + Setup; + if ListBox.Count = 0 then Exit; + ShowModal; + finally + Release; + end; +end; + +procedure TBriefcaseModelClientChangesForm.ListBoxClick(Sender: TObject); +begin + SetupListView; +end; + +procedure TBriefcaseModelClientChangesForm.SetupListview; +begin + ListView.Items.Count := 0; + if ListBox.ItemIndex = -1 then Exit; + ListView.Items.Count := TDADeltaChange(Listbox.Items.Objects[ListBox.ItemIndex]).Delta.LoggedFieldCount; +end; + +procedure TBriefcaseModelClientChangesForm.ListViewData(Sender: TObject; + Item: TListItem); +var + DeltaChange: TDADeltaChange; +begin + if (Item = nil) or (Item.Index >= ListView.Items.Count) then Exit; + DeltaChange := TDADeltaChange(Listbox.Items.Objects[ListBox.ItemIndex]); + Item.Caption := DeltaChange.Delta.LoggedFieldNames[Item.Index]; + if DeltaChange.ChangeType <> ctInsert then + Item.SubItems.Add(VarToStr(DeltaChange.OldValueByName[Item.Caption])) + else + Item.SubItems.Add(''); + if DeltaChange.ChangeType <> ctDelete then + Item.SubItems.Add(VarToStr(DeltaChange.NewValueByName[Item.Caption])) + else + Item.SubItems.Add(''); +end; + +procedure TBriefcaseModelClientChangesForm.Setup; + + procedure AddDelta(Delta: IDADelta); + var + str: string; + i, j: integer; + begin + for i := 0 to Delta.Count - 1 do + with Delta.Changes[i] do begin + case ChangeType of + ctInsert: str := '[New]'; + ctUpdate: str := '[Update]'; + ctDelete: str := '[Delete]'; + end; + str := str + ' ' + Delta.LogicalName + ': '; + for j := 0 to delta.KeyFieldCount - 1 do begin + if ChangeType = ctDelete then + str := str + VarToStr(OldValueByName[delta.KeyFieldNames[j]]) + ',' + else + str := str + VarToStr(NewValueByName[delta.KeyFieldNames[j]]) + ',' + end; + if delta.KeyFieldCount > 0 then SetLength(Str, Length(str) - 1); + ListBox.Items.AddObject(str, Delta.Changes[i]); + end; + end; + +begin + ListBox.Items.Clear; + with BriefcaseModelClientDataModule do begin + if tbl_Customers.DeltaInitialized then AddDelta(tbl_Customers.Delta); + if tbl_Orders.DeltaInitialized then AddDelta(tbl_Orders.Delta); + end; + if ListBox.Count > 0 then begin + ListBox.ItemIndex := 0; + ListBoxClick(ListBox); + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientData.dfm new file mode 100644 index 0000000..fee315d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientData.dfm @@ -0,0 +1,383 @@ +object BriefcaseModelClientDataModule: TBriefcaseModelClientDataModule + OldCreateOrder = True + Left = 126 + Top = 134 + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'BriefcaseModelService' + Left = 40 + Top = 96 + end + object DataStreamer: TDABinDataStreamer + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 40 + Top = 184 + end + object tbl_Customers: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + LocalDataStreamer = DataStreamer + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 184 + Top = 144 + end + object ds_Customers: TDADataSource + DataSet = tbl_Customers.Dataset + DataTable = tbl_Customers + Left = 136 + Top = 144 + end + object tbl_Orders: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + LogChanges = False + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DefaultValue = '0' + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + LocalDataStreamer = DataStreamer + MasterSource = ds_Customers + MasterFields = 'CustomerID' + DetailFields = 'CustomerID' + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Orders' + IndexDefs = <> + Left = 184 + Top = 192 + end + object ds_Orders: TDADataSource + DataSet = tbl_Orders.Dataset + DataTable = tbl_Orders + Left = 136 + Top = 192 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientData.pas new file mode 100644 index 0000000..e206cde --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientData.pas @@ -0,0 +1,36 @@ +unit BriefcaseModelClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, uDAInterfaces, + uDADataStreamer, uDARemoteDataAdapter, uDAScriptingProvider, + uDACDSDataTable, uDAClasses; + +type + TBriefcaseModelClientDataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABinDataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + tbl_Customers: TDACDSDataTable; + ds_Customers: TDADataSource; + tbl_Orders: TDACDSDataTable; + ds_Orders: TDADataSource; + private + { Private declarations } + public + { Public declarations } + end; + +var + BriefcaseModelClientDataModule: TBriefcaseModelClientDataModule; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientMain.dfm new file mode 100644 index 0000000..9699d89 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientMain.dfm @@ -0,0 +1,131 @@ +object BriefcaseModelClientMainForm: TBriefcaseModelClientMainForm + Left = 85 + Top = 124 + AutoScroll = False + Caption = 'Briefcase Model Client' + ClientHeight = 398 + ClientWidth = 567 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Splitter1: TSplitter + Left = 0 + Top = 215 + Width = 567 + Height = 5 + Cursor = crVSplit + Align = alBottom + Beveled = True + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 567 + Height = 34 + Align = alTop + TabOrder = 0 + object OpenButton: TButton + Left = 10 + Top = 7 + Width = 90 + Height = 22 + Caption = 'Fetch Data' + TabOrder = 0 + OnClick = OpenButtonClick + end + object ApplyUpdateButton: TButton + Left = 101 + Top = 7 + Width = 90 + Height = 22 + Action = ApplyUpdateAction + TabOrder = 1 + end + object DiscardChangesButton: TButton + Left = 192 + Top = 7 + Width = 90 + Height = 22 + Action = DiscardChangesAction + TabOrder = 2 + end + object ShowChangesButton: TButton + Left = 283 + Top = 7 + Width = 90 + Height = 22 + Action = ShowChangesAction + TabOrder = 3 + end + end + object gCustomers: TDBGrid + Left = 0 + Top = 59 + Width = 567 + Height = 156 + Align = alClient + DataSource = BriefcaseModelClientDataModule.ds_Customers + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object gOrders: TDBGrid + Left = 0 + Top = 220 + Width = 567 + Height = 153 + Align = alBottom + DataSource = BriefcaseModelClientDataModule.ds_Orders + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object dbnCustomers: TDBNavigator + Left = 0 + Top = 34 + Width = 567 + Height = 25 + DataSource = BriefcaseModelClientDataModule.ds_Customers + Align = alTop + TabOrder = 3 + end + object dbnOrders: TDBNavigator + Left = 0 + Top = 373 + Width = 567 + Height = 25 + DataSource = BriefcaseModelClientDataModule.ds_Orders + Align = alBottom + TabOrder = 4 + end + object ActionList1: TActionList + Left = 337 + Top = 87 + object ApplyUpdateAction: TAction + Caption = 'Apply update' + OnExecute = ApplyUpdateButtonClick + OnUpdate = ApplyUpdateActionUpdate + end + object DiscardChangesAction: TAction + Caption = 'Discard changes' + OnExecute = DiscardChangesButtonClick + OnUpdate = ApplyUpdateActionUpdate + end + object ShowChangesAction: TAction + Caption = 'Show changes' + OnExecute = ShowChangesButtonClick + OnUpdate = ApplyUpdateActionUpdate + end + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientMain.pas new file mode 100644 index 0000000..6b421d5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelClientMain.pas @@ -0,0 +1,140 @@ +unit BriefcaseModelClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, ExtCtrls, + DBCtrls, Grids, DBGrids, ActnList; + +type + TBriefcaseModelClientMainForm = class(TForm) + Panel1: TPanel; + gCustomers: TDBGrid; + gOrders: TDBGrid; + dbnCustomers: TDBNavigator; + dbnOrders: TDBNavigator; + Splitter1: TSplitter; + OpenButton: TButton; + ApplyUpdateButton: TButton; + DiscardChangesButton: TButton; + ShowChangesButton: TButton; + ActionList1: TActionList; + ApplyUpdateAction: TAction; + DiscardChangesAction: TAction; + ShowChangesAction: TAction; + procedure ApplyUpdateButtonClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure OpenButtonClick(Sender: TObject); + procedure DiscardChangesButtonClick(Sender: TObject); + procedure ShowChangesButtonClick(Sender: TObject); + procedure ApplyUpdateActionUpdate(Sender: TObject); + private + { Private declarations } + procedure Load; + procedure Save; + procedure FetchData; + public + { Public declarations } + end; + +var + BriefcaseModelClientMainForm: TBriefcaseModelClientMainForm; + +implementation + +uses + BriefcaseModelClientData, uDADataTable, BriefcaseModelClientChanges; + +{$R *.dfm} + +procedure TBriefcaseModelClientMainForm.ApplyUpdateButtonClick(Sender: TObject); +begin + BriefcaseModelClientDataModule.RemoteDataAdapter.ApplyUpdates([BriefcaseModelClientDataModule.tbl_Customers]); +end; + +procedure TBriefcaseModelClientMainForm.Load; + + function loadTable(ATable: TDADataTable): Boolean; + var + aFileName: string; + begin + aFileName := ExtractFilePath(Application.ExeName) + ATable.LogicalName + '.table'; + if FileExists(aFileName) then begin + aTable.LoadFromFile(aFileName); + Result := True; + end else + Result := False; + end; + +begin + if not loadTable(BriefcaseModelClientDataModule.tbl_Customers) or not loadTable(BriefcaseModelClientDataModule.tbl_Orders) then begin + if MessageDlg('No data table files could be found, do you want to fetch the data from the server?', mtConfirmation, [mbYes, mbNo], 0) = idYes then begin + FetchData; + end; + end; +end; + +procedure TBriefcaseModelClientMainForm.Save; + + procedure SaveTable(ATable: TDADataTable); + begin + with ATable do + if active then + SaveToFile(ExtractFilePath(Application.ExeName) + LogicalName + '.table'); + end; + +begin + with BriefcaseModelClientDataModule do begin + SaveTable(tbl_Customers); + SaveTable(tbl_Orders); + end; +end; + +procedure TBriefcaseModelClientMainForm.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Save; +end; + +procedure TBriefcaseModelClientMainForm.FormCreate(Sender: TObject); +begin + Load; +end; + +procedure TBriefcaseModelClientMainForm.OpenButtonClick(Sender: TObject); +begin + FetchData; +end; + +procedure TBriefcaseModelClientMainForm.FetchData; +begin + BriefcaseModelClientDataModule.tbl_Orders.close; + BriefcaseModelClientDataModule.tbl_Customers.close; + BriefcaseModelClientDataModule.RemoteDataAdapter.Fill([BriefcaseModelClientDataModule.tbl_Customers, + BriefcaseModelClientDataModule.tbl_Orders], true, false); +end; + +procedure TBriefcaseModelClientMainForm.DiscardChangesButtonClick(Sender: TObject); +begin + with BriefcaseModelClientDataModule do begin + tbl_Customers.CancelUpdates; + end; +end; + +procedure TBriefcaseModelClientMainForm.ShowChangesButtonClick(Sender: TObject); +begin + ShowChanges; +end; + +procedure TBriefcaseModelClientMainForm.ApplyUpdateActionUpdate( + Sender: TObject); +begin + with BriefcaseModelClientDataModule do + TAction(Sender).Enabled := + (tbl_Customers.DeltaInitialized) and ((tbl_Customers.Delta.Count > 0)) or + (tbl_Orders.DeltaInitialized) and ((tbl_Orders.Delta.Count > 0)) +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelLibrary.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelLibrary.rodl new file mode 100644 index 0000000..4c957b1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelLibrary.rodl @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelLibrary_Intf.pas new file mode 100644 index 0000000..48b30f5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelLibrary_Intf.pas @@ -0,0 +1,77 @@ +unit BriefcaseModelLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{0C6D69E2-2FEC-49FE-B07B-EE237D69F422}'; + TargetNamespace = ''; + + { Service Interface ID's } + IBriefcaseModelService_IID : TGUID = '{DF3E1E54-2924-4DE3-9834-4B225408D09F}'; + + { Event ID's } + +type + { Forward declarations } + IBriefcaseModelService = interface; + + + + + { IBriefcaseModelService } + IBriefcaseModelService = interface(IDataAbstractService) + ['{DF3E1E54-2924-4DE3-9834-4B225408D09F}'] + end; + + { CoBriefcaseModelService } + CoBriefcaseModelService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IBriefcaseModelService; + end; + + { TBriefcaseModelService_Proxy } + TBriefcaseModelService_Proxy = class(TDataAbstractService_Proxy, IBriefcaseModelService) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoBriefcaseModelService } + +class function CoBriefcaseModelService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IBriefcaseModelService; +begin + result := TBriefcaseModelService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TBriefcaseModelService_Proxy.__GetInterfaceName:string; +begin + result := 'BriefcaseModelService'; +end; + +initialization + RegisterProxyClass(IBriefcaseModelService_IID, TBriefcaseModelService_Proxy); + + +finalization + UnregisterProxyClass(IBriefcaseModelService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelLibrary_Invk.pas new file mode 100644 index 0000000..34ea4df --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelLibrary_Invk.pas @@ -0,0 +1,32 @@ +unit BriefcaseModelLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} BriefcaseModelLibrary_Intf; + +type + TBriefcaseModelService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.bdsproj new file mode 100644 index 0000000..bf8e10d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + BriefcaseModelServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.dpr new file mode 100644 index 0000000..715dd7e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.dpr @@ -0,0 +1,24 @@ +program BriefcaseModelServer; + +{#ROGEN:BriefcaseModelLibrary.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + BriefcaseModelServerMain in 'BriefcaseModelServerMain.pas' {BriefcaseModelServerMainForm}, + BriefcaseModelServerData in 'BriefcaseModelServerData.pas' {BriefcaseModelServerDataModule: TDataModule}, + BriefcaseModelLibrary_Intf in 'BriefcaseModelLibrary_Intf.pas', + BriefcaseModelLibrary_Invk in 'BriefcaseModelLibrary_Invk.pas', + BriefcaseModelService_Impl in 'BriefcaseModelService_Impl.pas' {BriefcaseModelService: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'Briefcase Model Server'; + Application.CreateForm(TBriefcaseModelServerDataModule, BriefcaseModelServerDataModule); + Application.CreateForm(TBriefcaseModelServerMainForm, BriefcaseModelServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.dproj new file mode 100644 index 0000000..7a42c8d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.dproj @@ -0,0 +1,80 @@ + + + {55d87c1e-5021-4276-a4c8-aef5b2fb31d9} + BriefcaseModelServer.dpr + Debug + AnyCPU + DCC32 + BriefcaseModelServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + BriefcaseModelServer.dpr + + + + + + + MainSource + + + + +
BriefcaseModelServerDataModule
+
+ +
BriefcaseModelServerMainForm
+
+ +
BriefcaseModelService
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerData.dfm new file mode 100644 index 0000000..e6fc791 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerData.dfm @@ -0,0 +1,60 @@ +object BriefcaseModelServerDataModule: TBriefcaseModelServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 226 + Top = 160 + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI' + Description = 'Microsoft SQL Server 2000, localhost' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerData.pas new file mode 100644 index 0000000..dcd422e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerData.pas @@ -0,0 +1,41 @@ +unit BriefcaseModelServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAADODriver, uROIndyTCPServer; + +type + TBriefcaseModelServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + SessionManager: TROInMemorySessionManager; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + BriefcaseModelServerDataModule: TBriefcaseModelServerDataModule; + +implementation + +{$R *.dfm} + +procedure TBriefcaseModelServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerMain.dfm new file mode 100644 index 0000000..406f003 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerMain.dfm @@ -0,0 +1,21 @@ +object BriefcaseModelServerMainForm: TBriefcaseModelServerMainForm + Left = 185 + Top = 138 + BorderStyle = bsDialog + Caption = 'Briefcase Model Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerMain.pas new file mode 100644 index 0000000..269ea1a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelServerMain.pas @@ -0,0 +1,25 @@ +unit BriefcaseModelServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton; + +type + TBriefcaseModelServerMainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + BriefcaseModelServerMainForm: TBriefcaseModelServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelService_Impl.dfm new file mode 100644 index 0000000..786a369 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelService_Impl.dfm @@ -0,0 +1,500 @@ +object BriefcaseModelService: TBriefcaseModelService + OldCreateOrder = True + SessionManager = BriefcaseModelServerDataModule.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Left = 196 + Top = 147 + Height = 164 + Width = 174 + object Schema: TDASchema + ConnectionManager = BriefcaseModelServerDataModule.ConnectionManager + DataDictionary = BriefcaseModelServerDataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'Northwind' + Default = True + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = <> + Statements = < + item + Connection = 'Northwind' + Default = True + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10' FROM'#10' ' + + ' Orders'#10#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + LogChanges = False + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DefaultValue = '0' + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = < + item + Name = 'FK_Orders_Customers' + MasterDatasetName = 'Customers' + MasterFields = 'CustomerID' + DetailDatasetName = 'Orders' + DetailFields = 'CustomerID' + RelationshipType = rtForeignKey + end> + UpdateRules = <> + Version = 0 + Left = 32 + Top = 56 + end + object DataStreamer: TDABinDataStreamer + BufferSize = 262144 + IsCompatibleV4 = True + Left = 32 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelService_Impl.pas new file mode 100644 index 0000000..5600ede --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/BriefcaseModelService_Impl.pas @@ -0,0 +1,48 @@ +unit BriefcaseModelService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} BriefcaseModelLibrary_Intf, uDADataStreamer, uDABinAdapter, + uDAClasses; + +type + { TBriefcaseModelService } + TBriefcaseModelService = class(TDataAbstractService, IBriefcaseModelService) + DataStreamer: TDABinDataStreamer; + Schema: TDASchema; + private + protected + { IBriefcaseModelService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} BriefcaseModelLibrary_Invk,BriefcaseModelServerData; + +procedure Create_BriefcaseModelService(out anInstance : IUnknown); +begin + anInstance := TBriefcaseModelService.Create(nil); +end; + +{ BriefcaseModelService } +initialization + TROClassFactory.Create('BriefcaseModelService', Create_BriefcaseModelService, TBriefcaseModelService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/RODLFILE.res new file mode 100644 index 0000000..8e8bd7e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Briefcase/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BizSchemaClient.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BizSchemaClient.pas new file mode 100644 index 0000000..f58294f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BizSchemaClient.pas @@ -0,0 +1,171 @@ +unit BizSchemaClient; + +interface +uses + Classes, + SchemaClient_Intf; + +type + IBizCustomers = interface(ICustomers) + ['{63BAECDD-6091-4A86-BA58-E6FFD5330240}'] + end; + + TBizCustomersDataTableRules = class(TCustomersDataTableRules, IBizCustomers) + end; + + IBizOrders = interface(IOrders) + ['{E43D1B71-EEF0-4805-9F1E-EE032353BD0F}'] + end; + + TBizOrdersDataTableRules = class(TOrdersDataTableRules, IBizOrders) + end; + + TBizErrorMessageItem = class + public + Field: string; + ErrorMessage: string; + end; + + TBizErrorMessage = class + private + FMessage: string; + FList: TList; + function GetItems(Index: integer): TBizErrorMessageItem; + function GetCount: integer; + function GetAsString: string; + procedure SetAsString(const Value: string); + public + constructor Create; + destructor Destroy; override; + function Add(AField: string; AErrorMessage: string): integer; + procedure Clear; + property ItemCount: integer read GetCount; + property Message: string read FMessage write FMessage; + property Items[Index: integer]: TBizErrorMessageItem read GetItems; + property AsString: string read GetAsString write SetAsString; + end; + +implementation + +uses uDADataTable, Variants; + +{ TBizErrorMessage } + +function TBizErrorMessage.Add(AField: string; AErrorMessage: string): integer; +var + Aitem: TBizErrorMessageItem; +begin + Aitem := TBizErrorMessageItem.Create; + Aitem.Field := AField; + Aitem.ErrorMessage := AErrorMessage; + Result := FList.Add(AItem); +end; + +procedure TBizErrorMessage.Clear; +var + i: integer; +begin + for i := 0 to Flist.Count - 1 do + TBizErrorMessageItem(FList[i]).Free; + FList.Clear; +end; + +constructor TBizErrorMessage.Create; +begin + inherited; + FList := TList.Create; +end; + +destructor TBizErrorMessage.Destroy; +begin + Clear; + Flist.Free; + inherited; +end; + +function TBizErrorMessage.GetAsString: string; + + procedure WriteStringToStream(Str: string; Stream: TMemoryStream); + var + size: LongInt; + begin + size := Length(Str)*sizeof(char); + stream.Write(size, Sizeof(LongInt)); + stream.Write(Str[1], size); + end; + +var + Stream: TMemoryStream; + cnt: integer; + i: integer; +begin + Stream := TMemoryStream.Create(); + try + cnt := Length(Message); + i := Stream.Write(Message[1], cnt*SizeOf(char)); + i := 0; + stream.Write(i, sizeof(i)); + cnt := GetCount; + stream.Write(cnt, SizeOf(cnt)); + for i := 0 to cnt - 1 do + with Items[i] do begin + WriteStringToStream(Field, Stream); + WriteStringToStream(ErrorMessage, Stream); + end; + SetLength(Result, Stream.Size div sizeof(char)); + Stream.Seek(0, soFromBeginning); + i := Stream.Read(Result[1], Stream.Size); + finally + Stream.Free; + end; +end; + +function TBizErrorMessage.GetCount: integer; +begin + Result := FList.Count; +end; + +function TBizErrorMessage.GetItems(Index: integer): TBizErrorMessageItem; +begin + Result := TBizErrorMessageItem(FList[Index]); +end; + +procedure TBizErrorMessage.SetAsString(const Value: string); + + function ReadStringToStream(Stream: TMemoryStream): string; + var + Size: LongInt; + begin + stream.Read(size, Sizeof(size)); + SetLength(result, Size div SizeOf(char)); + stream.Read(Result[1], size); + end; + +var + Stream: TMemoryStream; + i, cnt: integer; +begin + Clear; + Stream := TMemoryStream.Create(); + cnt := Length(Value)*SizeOf(char); + Stream.Write(Value[1], cnt); + try + Message := Pchar(Value); + if Stream.Size < Length(Message)*SizeOf(char) + sizeof(integer) then exit; + Stream.Seek(Length(Message)*SizeOf(char) + sizeof(integer), soFromBeginning); + stream.Read(cnt, SizeOf(cnt)); + for i := 0 to cnt - 1 do + with Items[Add('', '')] do begin + Field := ReadStringToStream(Stream); + ErrorMessage := ReadStringToStream(Stream); + end; + finally + Stream.Free; + end; +end; + +initialization + RegisterDataTableRules('Customers.ClientRules', TBizCustomersDataTableRules); + RegisterDataTableRules('Orders.ClientRules', TBizOrdersDataTableRules); +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BizSchemaServer.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BizSchemaServer.pas new file mode 100644 index 0000000..708c409 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BizSchemaServer.pas @@ -0,0 +1,128 @@ +unit BizSchemaServer; + +interface + +uses Classes, SysUtils, uDADataTable, uDABusinessProcessor, + SchemaServer_Intf, BizSchemaClient, uDADelta, uDAInterfaces; + +type + TBizCustomersServerRules = class(TCustomersBusinessProcessorRules) + protected + // Business events + procedure BeforeProcessChange(Sender: TDABusinessProcessor; aChangeType: TDAChangeType; aChange: TDADeltaChange; var ProcessChange: boolean); override; + procedure ProcessError(Sender: TDABusinessProcessor; aChangeType: TDAChangeType; aChange: TDADeltaChange; + const aCommand: IDASQLCommand; var CanRemoveFromDelta: boolean; Error: Exception); override; + end; + + TBizOrdersServerRules = class(TOrdersBusinessProcessorRules) + protected + // Business events + procedure BeforeProcessChange(Sender: TDABusinessProcessor; aChangeType: TDAChangeType; aChange: TDADeltaChange; var ProcessChange: boolean); override; + procedure ProcessError(Sender: TDABusinessProcessor; aChangeType: TDAChangeType; aChange: TDADeltaChange; + const aCommand: IDASQLCommand; var CanRemoveFromDelta: boolean; Error: Exception); override; + + end; + +implementation +uses + ServerGlobal, dialogs; +{ TBizCustomersServerRules } + +function CheckCustomer(CustID: string): boolean; +var + i: integer; +begin + Result := False; + if Length(CustID) <> 5 then Exit; + for i := 1 to Length(CustID) do + if not (CustID[i] in ['A'..'Z', 'a'..'z']) then Exit; + Result := True; +end; + +procedure TBizCustomersServerRules.BeforeProcessChange(Sender: TDABusinessProcessor; + aChangeType: TDAChangeType; aChange: TDADeltaChange; var ProcessChange: boolean); +begin + inherited; + aChange.Message := ''; + if (aChangeType = ctInsert) then begin + with TBizErrorMessage.Create do try + if gCheckCustomerID and not checkCustomer(CustomerID) then + Add('CustomerID', 'CustomerID needs at least 5 characters'); + if gCompanyCheck and not SameText(CompanyName, gCompany) then + Add('CompanyName', 'Company name should be ' + gCompany); + finally + if ItemCount > 0 then begin + Message := 'Cannot process an insert ' + sLineBreak + + '(Customer = ''' + CustomerID + ''')'; + aChange.Message := asString; + end; + Free; + end; + end; + + if (aChangeType = ctDelete) and gDeclineDeleteCustomers then begin + with TBizErrorMessage.Create do try + Message := 'Deleting of customers is not allowed ' + sLineBreak + + '(Customer = ''' + OldCustomerID + ''')'; + aChange.Message := asString; + finally + Free; + end; + end; + ProcessChange := aChange.Message = ''; + if not ProcessChange then aChange.Status := csFailed; +end; + +procedure TBizCustomersServerRules.ProcessError( + Sender: TDABusinessProcessor; aChangeType: TDAChangeType; + aChange: TDADeltaChange; const aCommand: IDASQLCommand; + var CanRemoveFromDelta: boolean; Error: Exception); +begin + aChange.Message := Error.Message; +end; + +{ TBizOrdersServerRules } + +procedure TBizOrdersServerRules.BeforeProcessChange( + Sender: TDABusinessProcessor; aChangeType: TDAChangeType; + aChange: TDADeltaChange; var ProcessChange: boolean); +begin + inherited; + aChange.Message := ''; + if aChangeType <> ctDelete then + if gFreightCheck and (Freight < gFreight) then begin + with TBizErrorMessage.Create do try + Message := 'Cannot process operation ' + sLineBreak + '(OrderID = ' + intToStr(OrderID) + ')'; + Add('Freight', 'Freight should be greater than ' + IntToStr(gFreight)); + aChange.Message := asString; + finally + Free; + end; + end; + if (aChangeType = ctDelete) and gDeclineDeleteOrders then begin + with TBizErrorMessage.Create do try + Message := 'Deleting of orders is not allowed ' + sLineBreak + + '(OrderID = ''' + IntToStr(OldOrderID) + ''')'; + aChange.Message := asString; + finally + Free; + end; + end; + ProcessChange := aChange.Message = ''; + if not ProcessChange then aChange.Status := csFailed; +end; + +procedure TBizOrdersServerRules.ProcessError(Sender: TDABusinessProcessor; + aChangeType: TDAChangeType; aChange: TDADeltaChange; + const aCommand: IDASQLCommand; var CanRemoveFromDelta: boolean; + Error: Exception); +begin + aChange.Message := Error.Message; + aChange.Status := csFailed; +end; + +initialization + RegisterBusinessProcessorRules('Customers.ServerRules', TBizCustomersServerRules); + RegisterBusinessProcessorRules('Orders.ServerRules', TBizOrdersServerRules); +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.Sample.html new file mode 100644 index 0000000..3a99fee --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.Sample.html @@ -0,0 +1,35 @@ + + + + + + + + + +

+ Business Processor sample +

+ +

Purpose

+ +

+ This is a good example to show the advantages of a multi-tier architecture: systems can be updated via a server re-deploy without the need to update any client. Also, + the sample shows advanced handling on the client of any errors returned from the + server. +

+ +

Examine the Code

+ + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.bdsgroup new file mode 100644 index 0000000..f4f1dd2 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + BusinessProcessorServer.bdsproj + BusinessProcessorClient.bdsproj + BusinessProcessorServer.exe BusinessProcessorClient.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.bpg new file mode 100644 index 0000000..ed4c7cc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = BusinessProcessorServer.exe BusinessProcessorClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +BusinessProcessorServer.exe: BusinessProcessorServer.dpr + $(DCC) + +BusinessProcessorClient.exe: BusinessProcessorClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.groupproj new file mode 100644 index 0000000..2cdc078 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessor.groupproj @@ -0,0 +1,40 @@ + + + {e64b5502-8847-4dd5-8e67-4e6d0176cf50} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.bdsproj new file mode 100644 index 0000000..22248ef --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + BusinessProcessorClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.dpr new file mode 100644 index 0000000..67f0b32 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.dpr @@ -0,0 +1,20 @@ +program BusinessProcessorClient; + +uses + uROComInit, + Forms, + MidasLib, + BusinessProcessorClientMain in 'BusinessProcessorClientMain.pas' {BusinessProcessorClientMainForm}, + BusinessProcessorClientData in 'BusinessProcessorClientData.pas' {BusinessProcessorClientDataModule: TDAClientDataModule}, + BizSchemaClient in 'BizSchemaClient.pas', + BusinessProcessorClientUnit1 in 'BusinessProcessorClientUnit1.pas' {BusinessProcessorClientForm2}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TBusinessProcessorClientDataModule, BusinessProcessorClientDataModule); + Application.CreateForm(TBusinessProcessorClientMainForm, BusinessProcessorClientMainForm); + Application.Run; +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.dproj new file mode 100644 index 0000000..e6a4576 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.dproj @@ -0,0 +1,79 @@ + + + {701a77fa-871d-41bc-ab21-ba2b8d978e5b} + BusinessProcessorClient.dpr + Debug + AnyCPU + DCC32 + BusinessProcessorClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + BusinessProcessorClient.dpr + + + + + + + MainSource + + + +
BusinessProcessorClientDataModule
+
+ +
BusinessProcessorClientMainForm
+
+ +
BusinessProcessorClientForm2
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientData.dfm new file mode 100644 index 0000000..a7e6ea9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientData.dfm @@ -0,0 +1,422 @@ +object BusinessProcessorClientDataModule: TBusinessProcessorClientDataModule + OldCreateOrder = True + Left = 345 + Top = 206 + Height = 266 + Width = 184 + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'BusinessProcessorService' + Left = 40 + Top = 96 + end + object DataStreamer: TDABinDataStreamer + BufferSize = 262144 + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + FailureBehavior = fbShowReconcile + OnGenerateRecordMessage = RemoteDataAdapterGenerateRecordMessage + OnShowReconcileRecordInAppUI = RemoteDataAdapterShowReconcileRecordInAppUI + Left = 40 + Top = 184 + end + object tbl_Customers: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + BusinessRulesID = 'Customers.ClientRules' + IndexDefs = <> + Left = 89 + Top = 100 + end + object ds_Customers: TDADataSource + DataSet = tbl_Customers.Dataset + DataTable = tbl_Customers + Left = 118 + Top = 99 + end + object tbl_Orders: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + LogChanges = False + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DefaultValue = '0' + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + Value = 'ALFKI' + ParamType = daptUnknown + end> + MasterParamsMappings.Strings = ( + 'CustomerID=CustomerID') + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + MasterSource = ds_Customers + MasterFields = 'CustomerID' + DetailFields = 'CustomerID' + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Orders' + BusinessRulesID = 'Orders.ClientRules' + IndexDefs = <> + Left = 99 + Top = 151 + end + object ds_Orders: TDADataSource + DataSet = tbl_Orders.Dataset + DataTable = tbl_Orders + Left = 128 + Top = 149 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientData.pas new file mode 100644 index 0000000..9f96a19 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientData.pas @@ -0,0 +1,86 @@ +unit BusinessProcessorClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, Variants, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, uDAInterfaces, + uDADataStreamer, uDARemoteDataAdapter, uDAScriptingProvider, + uDACDSDataTable, uDADelta; + +type + TBusinessProcessorClientDataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABinDataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + tbl_Customers: TDACDSDataTable; + ds_Customers: TDADataSource; + tbl_Orders: TDACDSDataTable; + ds_Orders: TDADataSource; + procedure RemoteDataAdapterGenerateRecordMessage(Sender: TObject; + aChange: TDADeltaChange; ADatatable: TDADataTable; + var aMessage: string); + procedure RemoteDataAdapterShowReconcileRecordInAppUI(Sender: TObject; + aChange: TDADeltaChange; aDatatable: TDADataTable; + var aHandled: Boolean; var aAction: TDAReconcileDialogAction); + private + { Private declarations } + public + { Public declarations } + end; + +var + BusinessProcessorClientDataModule: TBusinessProcessorClientDataModule; + +implementation +uses BusinessProcessorClientUnit1; +{$R *.dfm} + +procedure TBusinessProcessorClientDataModule.RemoteDataAdapterGenerateRecordMessage( + Sender: TObject; aChange: TDADeltaChange; ADatatable: TDADataTable; + var aMessage: string); +var + i: integer; +begin + aMessage := 'A problem occured while '; + case achange.ChangeType of + ctInsert: aMessage := aMessage + 'inserting'; + ctUpdate: aMessage := aMessage + 'updating'; + ctDelete: aMessage := aMessage + 'deleting'; + end; + aMessage := aMessage + ' a record in table "' + ADatatable.LogicalName + '"'; + if ADatatable = tbl_Customers then begin + aMessage := aMessage + ' , CustomerID = '''; + if aChange.ChangeType = ctInsert then + aMessage := aMessage + VarToStr(aChange.NewValueByName['CustomerID']) + '''' + else + aMessage := aMessage + VarToStr(aChange.OldValueByName['CustomerID']) + ''''; + end + else begin + aMessage := aMessage + ' , OrderID = '''; + if aChange.ChangeType = ctInsert then + aMessage := aMessage + VarToStr(aChange.NewValueByName['OrderID']) + '''' + else + aMessage := aMessage + VarToStr(aChange.OldValueByName['OrderID']) + ''''; + end; + + i := pos(sLineBreak, aChange.Message); + if i = 0 then + aMessage := aMessage + sLineBreak + sLineBreak + aChange.Message + else + aMessage := aMessage + sLineBreak + sLineBreak + copy(aChange.Message, 1, i - 1); +end; + +procedure TBusinessProcessorClientDataModule.RemoteDataAdapterShowReconcileRecordInAppUI( + Sender: TObject; aChange: TDADeltaChange; aDatatable: TDADataTable; + var aHandled: Boolean; var aAction: TDAReconcileDialogAction); +begin + BusinessProcessorClientUnit1.ReconcileDialogShowDetails(aChange, ADatatable, AAction); + AHandled := True; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientMain.dfm new file mode 100644 index 0000000..3078e36 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientMain.dfm @@ -0,0 +1,130 @@ +object BusinessProcessorClientMainForm: TBusinessProcessorClientMainForm + Left = 320 + Top = 215 + AutoScroll = False + Caption = 'BusinessProcessor Client' + ClientHeight = 414 + ClientWidth = 624 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Splitter1: TSplitter + Left = 0 + Top = 266 + Width = 624 + Height = 3 + Cursor = crVSplit + Align = alBottom + end + object gCustomers: TDBGrid + Left = 0 + Top = 58 + Width = 624 + Height = 208 + Align = alClient + DataSource = BusinessProcessorClientDataModule.ds_Customers + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object dbnCustomers: TDBNavigator + Left = 0 + Top = 33 + Width = 624 + Height = 25 + DataSource = BusinessProcessorClientDataModule.ds_Customers + Align = alTop + TabOrder = 1 + end + object Button1: TButton + Left = 13 + Top = 8 + Width = 75 + Height = 25 + Caption = 'Open' + TabOrder = 2 + OnClick = Button1Click + end + object Button2: TButton + Left = 91 + Top = 7 + Width = 75 + Height = 25 + Caption = 'Button2' + TabOrder = 3 + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 624 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 4 + object ApplyUpdateButton: TButton + Left = 92 + Top = 6 + Width = 74 + Height = 25 + Caption = 'Apply Update' + TabOrder = 0 + OnClick = ApplyUpdateButtonClick + end + object OpenButton: TButton + Left = 13 + Top = 6 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 1 + OnClick = Button1Click + end + object CreateCustomerButton: TButton + Left = 222 + Top = 6 + Width = 95 + Height = 25 + Caption = 'Create customer' + TabOrder = 2 + OnClick = CreateCustomerButtonClick + end + object CreateOrderButton: TButton + Left = 322 + Top = 6 + Width = 75 + Height = 25 + Caption = 'Create order' + TabOrder = 3 + OnClick = CreateOrderButtonClick + end + end + object gOrders: TDBGrid + Left = 0 + Top = 269 + Width = 624 + Height = 120 + Align = alBottom + DataSource = BusinessProcessorClientDataModule.ds_Orders + TabOrder = 5 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object dbnOrders: TDBNavigator + Left = 0 + Top = 389 + Width = 624 + Height = 25 + DataSource = BusinessProcessorClientDataModule.ds_Orders + Align = alBottom + TabOrder = 6 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientMain.pas new file mode 100644 index 0000000..7da77cd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientMain.pas @@ -0,0 +1,77 @@ +unit BusinessProcessorClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, ExtCtrls, + DBCtrls, Grids, DBGrids; + +type + TBusinessProcessorClientMainForm = class(TForm) + gCustomers: TDBGrid; + dbnCustomers: TDBNavigator; + Button1: TButton; + Button2: TButton; + Panel1: TPanel; + ApplyUpdateButton: TButton; + OpenButton: TButton; + gOrders: TDBGrid; + dbnOrders: TDBNavigator; + Splitter1: TSplitter; + CreateCustomerButton: TButton; + CreateOrderButton: TButton; + procedure Button1Click(Sender: TObject); + procedure ApplyUpdateButtonClick(Sender: TObject); + procedure CreateCustomerButtonClick(Sender: TObject); + procedure CreateOrderButtonClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + BusinessProcessorClientMainForm: TBusinessProcessorClientMainForm; + +implementation + +uses + BusinessProcessorClientData, BizSchemaClient, SchemaClient_Intf; + +{$R *.dfm} + +procedure TBusinessProcessorClientMainForm.Button1Click(Sender: TObject); +begin + with BusinessProcessorClientDataModule.tbl_Customers do + Active := not Active; +end; + +procedure TBusinessProcessorClientMainForm.ApplyUpdateButtonClick(Sender: TObject); +begin + with BusinessProcessorClientDataModule.tbl_Customers do + ApplyUpdates(); +end; + +procedure TBusinessProcessorClientMainForm.CreateCustomerButtonClick(Sender: TObject); +begin + with BusinessProcessorClientDataModule.tbl_Customers as IBizCustomers do begin + Insert; + CustomerID := 'test'; + CompanyName := 'test company'; + Post; + end; +end; + +procedure TBusinessProcessorClientMainForm.CreateOrderButtonClick(Sender: TObject); +begin + with BusinessProcessorClientDataModule.tbl_Orders as IBizOrders do begin + Insert; + OrderID := 1; + Freight := 10; + Post; + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientUnit1.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientUnit1.dfm new file mode 100644 index 0000000..6f0b690 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientUnit1.dfm @@ -0,0 +1,82 @@ +object BusinessProcessorClientForm2: TBusinessProcessorClientForm2 + Left = 358 + Top = 217 + Width = 490 + Height = 298 + BorderIcons = [biSystemMenu] + Caption = 'Show Details' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poOwnerFormCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object ScrollBox: TScrollBox + Left = 0 + Top = 148 + Width = 482 + Height = 85 + Align = alClient + BevelInner = bvNone + BevelOuter = bvNone + BorderStyle = bsNone + TabOrder = 0 + end + object BottomPanel: TPanel + Left = 0 + Top = 233 + Width = 482 + Height = 32 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + DesignSize = ( + 482 + 32) + object OkButton: TButton + Left = 225 + Top = 4 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = '&Ok' + Default = True + ModalResult = 1 + TabOrder = 0 + OnClick = OkButtonClick + end + object CancelButton: TButton + Left = 304 + Top = 4 + Width = 95 + Height = 25 + Anchors = [akRight, akBottom] + Caption = '&Cancel Change' + ModalResult = 2 + TabOrder = 1 + OnClick = CancelButtonClick + end + object CloseButton: TButton + Left = 404 + Top = 4 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Close' + ModalResult = 7 + TabOrder = 2 + OnClick = CancelButtonClick + end + end + object TopPanel: TPanel + Left = 0 + Top = 0 + Width = 482 + Height = 148 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientUnit1.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientUnit1.pas new file mode 100644 index 0000000..40a8e92 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorClientUnit1.pas @@ -0,0 +1,298 @@ +unit BusinessProcessorClientUnit1; + +interface +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, uDADelta, uDADataTable, DB, BizSchemaClient, uDARemoteDataAdapter; + +type + TBusinessProcessorClientForm2 = class(TForm) + ScrollBox: TScrollBox; + BottomPanel: TPanel; + TopPanel: TPanel; + OkButton: TButton; + CancelButton: TButton; + CloseButton: TButton; + procedure FormCreate(Sender: TObject); + procedure OkButtonClick(Sender: TObject); + procedure CancelButtonClick(Sender: TObject); + private + { Private declarations } + dbeditHeight, labelheight: integer; + FChange: TDADeltaChange; + Datasource: TDADataSource; + procedure Setup; + procedure GenerateControls; + procedure ApplyErrorMessage(BizErrorMessage: TBizErrorMessage); + procedure OnFieldValueChanged(Sender: TObject); + public + { Public declarations } + + end; + +procedure ReconcileDialogShowDetails(AChange: TDADeltaChange; aTable: TDADataTable;var AAction: TDAReconcileDialogAction); +implementation +uses + uDAInterfaces, uROClasses, dbCtrls; +{$R *.dfm} + +const + labelWidth = 100; + editWidth = 200; + c_Color: TColor = clMoneyGreen; + +procedure ReconcileDialogShowDetails(AChange: TDADeltaChange; aTable: TDADataTable;var AAction: TDAReconcileDialogAction); +var + FFiltered: Boolean; + FMasterDS: TDADataSource; + FRemoteFetchEnabled: Boolean; + FMasterFields: string; +begin + with TBusinessProcessorClientForm2.Create(Application) do try + FChange := AChange; + FFiltered := ATable.Filtered; + FMasterDS := aTable.MasterSource; + FMasterFields := aTable.MasterFields; + FRemoteFetchEnabled := aTable.RemoteFetchEnabled; + try + ATable.Filtered := False; + aTable.MasterSource := nil; + aTable.MasterFields := ''; + aTable.RemoteFetchEnabled := False; + DataSource.DataTable := aTable; + Setup; + case ShowModal() of + mrOk: AAction := rdlgSkip; + mrCancel: AAction := rdlgCancel; + else AAction := rdlgNone; + end; + finally + aTable.RemoteFetchEnabled := FRemoteFetchEnabled; + aTable.Filtered := FFiltered; + aTable.MasterSource := FMasterDS; + aTable.MasterFields := FMasterFields + end; + finally + Release; + end; +end; + +{ TShowDetailsForm } + +procedure TBusinessProcessorClientForm2.Setup; +var + BizErrorMessage: TBizErrorMessage; +begin + if FChange.ChangeType <> ctDelete then + with DataSource.DataTable do + if not Locate(RecIDFieldName, FChange.RecID, []) then RaiseError('Couldn''t find record #' + FormatRecIDString(FChange.RecID)); + GenerateControls; + BizErrorMessage := TBizErrorMessage.Create; + try + BizErrorMessage.AsString := FChange.Message; + ApplyErrorMessage(BizErrorMessage); + finally + BizErrorMessage.Free; + end; + + if Screen.Height > Self.Height + (ScrollBox.VertScrollBar.Range - ScrollBox.Height) then + Self.Height := Self.Height + (ScrollBox.VertScrollBar.Range - ScrollBox.Height) + else + Self.Height := Screen.Height; + case FChange.ChangeType of + ctInsert: OkButton.Caption := 'Skip'; + ctUpdate: OkButton.Caption := 'Skip'; + ctDelete: OkButton.Caption := 'Skip'; + end; +end; + +procedure TBusinessProcessorClientForm2.GenerateControls; +var + i: integer; + aField: string; + aTop, aleft: integer; + FLabel: TLabel; + FdbEdit: TDBEdit; + FEdit: TEdit; +begin + aleft := 7; + aTop := 7; + for i := 0 to FChange.Delta.LoggedFieldCount - 1 do begin + aField := FChange.Delta.LoggedFieldNames[i]; + aTop := 7 + (3 + dbeditHeight) * i; + aleft := 7; + + FLabel := TLabel.Create(Self); + with FLabel do begin + Parent := ScrollBox; + Name := 'l_' + aField; + Caption := aField; + Left := aleft; + Top := (dbeditHeight - Height) div 2 + aTop + 1; + Width := labelWidth; + aleft := aleft + 7 + labelWidth; + end; + + if FChange.ChangeType in [ctInsert, ctUpdate] then begin + if Self.DataSource.DataTable.FieldByName(aField).DataType = datBlob then begin + FEdit := TEdit.Create(Self); + with FEdit do begin + Name := 'dbe_' + aField; + Parent := ScrollBox; + Left := aleft; + aleft := aleft + 7 + editWidth; + Top := aTop; + Width := editWidth; + ReadOnly := True; + Text := '[blob]'; + end; + end + else begin + FdbEdit := TDBEdit.Create(Self); + with FdbEdit do begin + Name := 'dbe_' + aField; + DataSource := Self.DataSource; + Parent := ScrollBox; + DataField := aField; + Left := aleft; + Top := aTop; + Width := editWidth; + OnChange := OnFieldValueChanged; + aleft := aleft + 7 + editWidth; + if (FChange.ChangeType = ctUpdate) and + not ROVariantsEqual(FChange.OldValues[i], FChange.NewValues[i]) then + Color := c_Color; + end; + end; + end; + + if FChange.ChangeType in [ctUpdate, ctDelete] then begin + FEdit := TEdit.Create(Self); + with FEdit do begin + Name := 'e_' + aField; + Parent := ScrollBox; + Left := aleft; + aleft := aleft + 7 + editWidth; + Top := aTop; + Width := editWidth; + ReadOnly := True; + Color := clBtnFace; + if Self.DataSource.DataTable.FieldByName(aField).DataType = datBlob then begin + Text := '[blob]' + end + else begin + case FChange.ChangeType of + ctDelete: text := VarToStr(FChange.OldValues[i]); + ctUpdate: begin + if not Self.DataSource.DataTable.HasReducedDelta then + text := VarToStr(FChange.OldValues[i]) + else + if not VarIsEmpty(FChange.OldValues[i]) then + text := VarToStr(FChange.OldValues[i]) + else text := Self.DataSource.DataTable.FieldByName(aField).AsString; + end; + end; + end; + end; + end; + end; + inc(aTop, 20); + inc(aLeft, 7); + //ScrollBox.HorzScrollBar.Range := aleft; + Self.ClientWidth := aleft + ScrollBox.VertScrollBar.Size + 2; + Self.Constraints.MinWidth := Self.Width; + Self.Constraints.MaxWidth := Self.Width; + + ScrollBox.VertScrollBar.Range := aTop; +end; + +procedure TBusinessProcessorClientForm2.FormCreate(Sender: TObject); +begin + inherited; + with TDBEdit.Create(Self) do try + dbeditHeight := Height; + finally + free; + end; + with TLabel.Create(Self) do try + labelheight := Height; + finally + free; + end; + Datasource := TDADataSource.Create(Self); +end; + +procedure TBusinessProcessorClientForm2.OkButtonClick(Sender: TObject); +begin + if DataSource.DataTable.State in [dsEdit, dsInsert] then DataSource.DataTable.Post; +end; + +procedure TBusinessProcessorClientForm2.CancelButtonClick(Sender: TObject); +begin + if DataSource.DataTable.State in [dsEdit, dsInsert] then DataSource.DataTable.Cancel; +end; + +procedure TBusinessProcessorClientForm2.ApplyErrorMessage( + BizErrorMessage: TBizErrorMessage); +var + i: integer; + FLabel: TLabel; + Fcomp: TComponent; + aTop: integer; +begin + ShowHint := True; + Caption := Datasource.DataTable.LogicalName; + FLabel := TLabel.Create(Self); + with FLabel do begin + Parent := TopPanel; + i := pos(sLineBreak, BizErrorMessage.Message); + if i = 0 then + Caption := BizErrorMessage.Message + else + Caption := copy(BizErrorMessage.Message, 1, i-1); + Hint := Caption; + Left := 7; + Top := 7; + AutoSize := true; + WordWrap := True; + AutoSize := False; + Height:= labelheight * (Width div (Parent.ClientWidth - Left * 2)+1); + Width := Parent.ClientWidth - Left * 2; +{ if BizErrorMessage.ItemCount = 0 then + Height := labelheight * 4 + else + Height := labelheight; } + aTop := Height + Top + 3; + Anchors := Anchors + [akRight]; + end; + + for i := 0 to BizErrorMessage.ItemCount - 1 do begin + with BizErrorMessage.Items[i] do begin + Fcomp := Self.FindComponent('l_' + Field); + if Fcomp <> nil then TLabel(Fcomp).Font.Color := clRed; + + FLabel := TLabel.Create(Self); + with FLabel do begin + Parent := TopPanel; + Name := 'error_' + Field; + Caption := ErrorMessage; + Left := 7; + Top := aTop; + AutoSize := True; + Font.Color := clRed; + aTop := Height + Top + 3; + end; + end; + end; + + TopPanel.ClientHeight := aTop; +end; + +procedure TBusinessProcessorClientForm2.OnFieldValueChanged( + Sender: TObject); +begin + OkButton.Caption := 'Update'; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorLibrary.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorLibrary.RODL new file mode 100644 index 0000000..60a510d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorLibrary.RODL @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorLibrary_Intf.pas new file mode 100644 index 0000000..2ff6be0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorLibrary_Intf.pas @@ -0,0 +1,77 @@ +unit BusinessProcessorLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{EBAEAB9A-1E78-4BB3-8417-2E226959496F}'; + TargetNamespace = ''; + + { Service Interface ID's } + IBusinessProcessorService_IID : TGUID = '{4404161B-2A9E-4711-AADF-4493AC19BB34}'; + + { Event ID's } + +type + { Forward declarations } + IBusinessProcessorService = interface; + + + + + { IBusinessProcessorService } + IBusinessProcessorService = interface(IDataAbstractService) + ['{4404161B-2A9E-4711-AADF-4493AC19BB34}'] + end; + + { CoBusinessProcessorService } + CoBusinessProcessorService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IBusinessProcessorService; + end; + + { TBusinessProcessorService_Proxy } + TBusinessProcessorService_Proxy = class(TDataAbstractService_Proxy, IBusinessProcessorService) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoBusinessProcessorService } + +class function CoBusinessProcessorService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IBusinessProcessorService; +begin + result := TBusinessProcessorService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TBusinessProcessorService_Proxy.__GetInterfaceName:string; +begin + result := 'BusinessProcessorService'; +end; + +initialization + RegisterProxyClass(IBusinessProcessorService_IID, TBusinessProcessorService_Proxy); + + +finalization + UnregisterProxyClass(IBusinessProcessorService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorLibrary_Invk.pas new file mode 100644 index 0000000..a265b95 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorLibrary_Invk.pas @@ -0,0 +1,32 @@ +unit BusinessProcessorLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} BusinessProcessorLibrary_Intf; + +type + TBusinessProcessorService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.bdsproj new file mode 100644 index 0000000..4053265 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + BusinessProcessorServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.dpr new file mode 100644 index 0000000..b304ddc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.dpr @@ -0,0 +1,27 @@ +program BusinessProcessorServer; + +{#ROGEN:BusinessProcessorLibrary.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + BusinessProcessorServerMain in 'BusinessProcessorServerMain.pas' {BusinessProcessorServerMainForm}, + BusinessProcessorServerData in 'BusinessProcessorServerData.pas' {BusinessProcessorServerDataModule: TDataModule}, + SchemaClient_Intf in 'SchemaClient_Intf.pas', + SchemaServer_Intf in 'SchemaServer_Intf.pas', + BizSchemaServer in 'BizSchemaServer.pas', + ServerGlobal in 'ServerGlobal.pas', + BusinessProcessorLibrary_Intf in 'BusinessProcessorLibrary_Intf.pas', + BusinessProcessorLibrary_Invk in 'BusinessProcessorLibrary_Invk.pas', + BusinessProcessorService_Impl in 'BusinessProcessorService_Impl.pas' {BusinessProcessorService: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.CreateForm(TBusinessProcessorServerDataModule, BusinessProcessorServerDataModule); + Application.CreateForm(TBusinessProcessorServerMainForm, BusinessProcessorServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.dproj new file mode 100644 index 0000000..fc2e95e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.dproj @@ -0,0 +1,84 @@ + + + {dac310a9-44d2-4920-b4d5-46703300c98d} + BusinessProcessorServer.dpr + Debug + AnyCPU + DCC32 + BusinessProcessorServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + BusinessProcessorServer.dpr + + + + + + + MainSource + + + + + +
BusinessProcessorServerDataModule
+
+ +
BusinessProcessorServerMainForm
+
+ +
BusinessProcessorService
+
+ + + +
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerData.dfm new file mode 100644 index 0000000..5268506 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerData.dfm @@ -0,0 +1,60 @@ +object BusinessProcessorServerDataModule: TBusinessProcessorServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 186 + Top = 136 + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI;' + Description = 'Microsoft SQL Server 2000, localhost' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerData.pas new file mode 100644 index 0000000..871cd5e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerData.pas @@ -0,0 +1,42 @@ +unit BusinessProcessorServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAADODriver, uROIndyTCPServer; + +type + TBusinessProcessorServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + SessionManager: TROInMemorySessionManager; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + BusinessProcessorServerDataModule: TBusinessProcessorServerDataModule; + +implementation + +{$R *.dfm} + +procedure TBusinessProcessorServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerMain.dfm new file mode 100644 index 0000000..c60cbf3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerMain.dfm @@ -0,0 +1,105 @@ +object BusinessProcessorServerMainForm: TBusinessProcessorServerMainForm + Left = 100 + Top = 111 + BorderStyle = bsDialog + Caption = 'Business Processor Server' + ClientHeight = 170 + ClientWidth = 380 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 7 + Top = 7 + Width = 39 + Height = 13 + Caption = 'Checks:' + end + object GroupBox1: TGroupBox + Left = 7 + Top = 24 + Width = 365 + Height = 73 + Anchors = [akLeft, akTop, akRight] + Caption = 'Customers' + TabOrder = 0 + object cbCheckCustomerID: TCheckBox + Left = 8 + Top = 15 + Width = 321 + Height = 17 + Caption = 'New records: CustomerID needs at least 5 characters' + TabOrder = 0 + OnClick = cbCheckCustomerIDClick + end + object cbDeclineDeleteCustomers: TCheckBox + Left = 8 + Top = 49 + Width = 216 + Height = 17 + Caption = 'Restrict deleting records' + TabOrder = 1 + OnClick = cbDeclineDeleteCustomersClick + end + object cbCompany: TCheckBox + Left = 8 + Top = 32 + Width = 228 + Height = 17 + Caption = 'New records: Company name for should be ' + TabOrder = 2 + OnClick = cbCompanyClick + end + object eCompany: TEdit + Left = 245 + Top = 30 + Width = 110 + Height = 21 + TabOrder = 3 + Text = 'Company' + OnChange = eCompanyChange + end + end + object GroupBox2: TGroupBox + Left = 7 + Top = 100 + Width = 365 + Height = 60 + Anchors = [akLeft, akTop, akRight] + Caption = 'Orders' + TabOrder = 1 + object cbFreight: TCheckBox + Left = 8 + Top = 15 + Width = 218 + Height = 17 + Caption = 'Freight should be greater than' + TabOrder = 0 + OnClick = cbFreightClick + end + object cbDeclineDeleteOrders: TCheckBox + Left = 8 + Top = 33 + Width = 216 + Height = 17 + Caption = 'Restrict deleting of orders' + TabOrder = 1 + OnClick = cbDeclineDeleteOrdersClick + end + object eFreight: TSpinEdit + Left = 245 + Top = 12 + Width = 110 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 2 + Value = 0 + OnChange = eFreightChange + end + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerMain.pas new file mode 100644 index 0000000..7d70ed7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorServerMain.pas @@ -0,0 +1,96 @@ +unit BusinessProcessorServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, Spin; + +type + TBusinessProcessorServerMainForm = class(TForm) + Label1: TLabel; + GroupBox1: TGroupBox; + cbCheckCustomerID: TCheckBox; + cbDeclineDeleteCustomers: TCheckBox; + cbCompany: TCheckBox; + eCompany: TEdit; + GroupBox2: TGroupBox; + cbFreight: TCheckBox; + cbDeclineDeleteOrders: TCheckBox; + eFreight: TSpinEdit; + procedure cbCompanyClick(Sender: TObject); + procedure eCompanyChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure cbFreightClick(Sender: TObject); + procedure eFreightChange(Sender: TObject); + procedure cbDeclineDeleteCustomersClick(Sender: TObject); + procedure cbDeclineDeleteOrdersClick(Sender: TObject); + procedure cbCheckCustomerIDClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + BusinessProcessorServerMainForm : TBusinessProcessorServerMainForm; + +implementation +uses + ServerGlobal; +{$R *.dfm} + +procedure TBusinessProcessorServerMainForm.cbCompanyClick(Sender: TObject); +begin + eCompany.Enabled := cbCompany.Checked; + gCompanyCheck := cbCompany.Checked; + eCompanyChange(eCompany); +end; + +procedure TBusinessProcessorServerMainForm.eCompanyChange(Sender: TObject); +begin + gCompany := eCompany.Text; +end; + +procedure TBusinessProcessorServerMainForm.FormShow(Sender: TObject); +begin + eCompany.Text := gCompany; + eFreight.Value := gFreight; + cbCompany.Checked := gCompanyCheck; + cbFreight.Checked := gFreightCheck; + cbCompanyClick(cbCompany); + cbFreightClick(cbFreight); + cbDeclineDeleteCustomers.Checked := gDeclineDeleteCustomers; + cbDeclineDeleteOrders.Checked := gDeclineDeleteOrders; + cbCheckCustomerID.Checked := gCheckCustomerID; +end; + +procedure TBusinessProcessorServerMainForm.cbFreightClick(Sender: TObject); +begin + eFreight.Enabled := cbFreight.Checked; + gFreightCheck := cbFreight.Checked; + eFreightChange(eFreight); +end; + +procedure TBusinessProcessorServerMainForm.eFreightChange(Sender: TObject); +begin + gFreight := eFreight.Value; +end; + +procedure TBusinessProcessorServerMainForm.cbDeclineDeleteCustomersClick(Sender: TObject); +begin + gDeclineDeleteCustomers := cbDeclineDeleteCustomers.Checked; +end; + +procedure TBusinessProcessorServerMainForm.cbDeclineDeleteOrdersClick(Sender: TObject); +begin + gDeclineDeleteOrders := cbDeclineDeleteOrders.Checked; +end; + +procedure TBusinessProcessorServerMainForm.cbCheckCustomerIDClick(Sender: TObject); +begin + gCheckCustomerID := cbCheckCustomerID.Checked; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorService_Impl.dfm new file mode 100644 index 0000000..227e306 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorService_Impl.dfm @@ -0,0 +1,712 @@ +object BusinessProcessorService: TBusinessProcessorService + OldCreateOrder = True + SessionManager = BusinessProcessorServerDataModule.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Left = 200 + Top = 200 + Height = 300 + Width = 300 + object DataStreamer: TDABinDataStreamer + Left = 32 + Top = 8 + end + object Schema: TDASchema + ConnectionManager = BusinessProcessorServerDataModule.ConnectionManager + DataDictionary = BusinessProcessorServerDataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10' FROM'#10' ' + + ' Orders'#10' WHERE'#10' CustomerID = :CustomerID'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + LogChanges = False + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = < + item + Params = < + item + Name = 'CustomerID' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'CompanyName' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'ContactName' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'ContactTitle' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Address' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'City' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Region' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'PostalCode' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Country' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Phone' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Fax' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Customers' + SQL = + 'INSERT'#10' INTO Customers'#10' (CustomerID, CompanyName, ContactNam' + + 'e, ContactTitle, '#10' Address, City, Region, PostalCode, Countr' + + 'y, Phone, '#10' Fax)'#10' VALUES'#10' (:CustomerID, :CompanyName, :C' + + 'ontactName, :ContactTitle, '#10' :Address, :City, :Region, :Post' + + 'alCode, :Country, :Phone, '#10' :Fax)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Insert_Customers' + end + item + Params = < + item + Name = 'OLD_CustomerID' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Customers' + SQL = + 'DELETE '#10' FROM'#10' Customers'#10' WHERE'#10' (CustomerID = :OLD_Cust' + + 'omerID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Delete_Customers' + end + item + Params = < + item + Name = 'CustomerID' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'CompanyName' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'ContactName' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'ContactTitle' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Address' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'City' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Region' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'PostalCode' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Country' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Phone' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'Fax' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end + item + Name = 'OLD_CustomerID' + DataType = datWideString + BlobType = dabtUnknown + Value = '' + ParamType = daptUnknown + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Customers' + SQL = + 'UPDATE Customers'#10' SET '#10' CustomerID = :CustomerID, '#10' Compa' + + 'nyName = :CompanyName, '#10' ContactName = :ContactName, '#10' Con' + + 'tactTitle = :ContactTitle, '#10' Address = :Address, '#10' City = ' + + ':City, '#10' Region = :Region, '#10' PostalCode = :PostalCode, '#10' ' + + ' Country = :Country, '#10' Phone = :Phone, '#10' Fax = :Fax'#10' WHE' + + 'RE'#10' (CustomerID = :OLD_CustomerID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Update_Customers' + end> + RelationShips = < + item + Name = 'Relationship' + MasterDatasetName = 'Customers' + MasterFields = 'CustomerID' + DetailDatasetName = 'Orders' + DetailFields = 'CustomerID' + end> + UpdateRules = <> + Left = 32 + Top = 56 + end + object bpCustomers: TDABusinessProcessor + Schema = Schema + InsertCommandName = 'Insert_Customers' + DeleteCommandName = 'Delete_Customers' + UpdateCommandName = 'Update_Customers' + ReferencedDataset = 'Customers' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete, poAutoGenerateRefreshDataset, poPrepareCommands] + UpdateMode = updWhereKeyOnly + BusinessRulesID = 'Customers.ServerRules' + Left = 76 + Top = 55 + end + object bpOrders: TDABusinessProcessor + Schema = Schema + ReferencedDataset = 'Orders' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete, poAutoGenerateRefreshDataset, poPrepareCommands] + UpdateMode = updWhereKeyOnly + BusinessRulesID = 'Orders.ServerRules' + Left = 80 + Top = 98 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorService_Impl.pas new file mode 100644 index 0000000..f0baff7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/BusinessProcessorService_Impl.pas @@ -0,0 +1,50 @@ +unit BusinessProcessorService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} BusinessProcessorLibrary_Intf, uDAScriptingProvider, + uDABusinessProcessor, uDAClasses, uDADataStreamer, uDABinAdapter; + +type + { TBusinessProcessorService } + TBusinessProcessorService = class(TDataAbstractService, IBusinessProcessorService) + DataStreamer: TDABinDataStreamer; + Schema: TDASchema; + bpCustomers: TDABusinessProcessor; + bpOrders: TDABusinessProcessor; + private + protected + { IBusinessProcessorService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} BusinessProcessorLibrary_Invk,BusinessProcessorServerData; + +procedure Create_BusinessProcessorService(out anInstance : IUnknown); +begin + anInstance := TBusinessProcessorService.Create(nil); +end; + +{ BusinessProcessorService } +initialization + TROClassFactory.Create('BusinessProcessorService', Create_BusinessProcessorService, TBusinessProcessorService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/RODLFILE.res new file mode 100644 index 0000000..6919cc8 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/SchemaClient_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/SchemaClient_Intf.pas new file mode 100644 index 0000000..e7dda72 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/SchemaClient_Intf.pas @@ -0,0 +1,981 @@ +unit SchemaClient_Intf; + +interface + +uses + Classes, DB, SysUtils, uROClasses, uDADataTable; + +const + { Data table rules ids + Feel free to change them to something more human readable + but make sure they are unique in the context of your application } + RID_Customers = '{A9F7C630-77E0-44A8-B46B-E3EE67954A42}'; + RID_Orders = '{B5125DCD-A27D-488D-A1A2-4FB5D49D7079}'; + + { Data table names } + nme_Customers = 'Customers'; + nme_Orders = 'Orders'; + + { Customers fields } + fld_CustomersCustomerID = 'CustomerID'; + fld_CustomersCompanyName = 'CompanyName'; + fld_CustomersContactName = 'ContactName'; + fld_CustomersContactTitle = 'ContactTitle'; + fld_CustomersAddress = 'Address'; + fld_CustomersCity = 'City'; + fld_CustomersRegion = 'Region'; + fld_CustomersPostalCode = 'PostalCode'; + fld_CustomersCountry = 'Country'; + fld_CustomersPhone = 'Phone'; + fld_CustomersFax = 'Fax'; + + { Customers field indexes } + idx_CustomersCustomerID = 0; + idx_CustomersCompanyName = 1; + idx_CustomersContactName = 2; + idx_CustomersContactTitle = 3; + idx_CustomersAddress = 4; + idx_CustomersCity = 5; + idx_CustomersRegion = 6; + idx_CustomersPostalCode = 7; + idx_CustomersCountry = 8; + idx_CustomersPhone = 9; + idx_CustomersFax = 10; + + { Orders fields } + fld_OrdersOrderID = 'OrderID'; + fld_OrdersCustomerID = 'CustomerID'; + fld_OrdersEmployeeID = 'EmployeeID'; + fld_OrdersOrderDate = 'OrderDate'; + fld_OrdersRequiredDate = 'RequiredDate'; + fld_OrdersShippedDate = 'ShippedDate'; + fld_OrdersShipVia = 'ShipVia'; + fld_OrdersFreight = 'Freight'; + fld_OrdersShipName = 'ShipName'; + fld_OrdersShipAddress = 'ShipAddress'; + fld_OrdersShipCity = 'ShipCity'; + fld_OrdersShipRegion = 'ShipRegion'; + fld_OrdersShipPostalCode = 'ShipPostalCode'; + fld_OrdersShipCountry = 'ShipCountry'; + + { Orders field indexes } + idx_OrdersOrderID = 0; + idx_OrdersCustomerID = 1; + idx_OrdersEmployeeID = 2; + idx_OrdersOrderDate = 3; + idx_OrdersRequiredDate = 4; + idx_OrdersShippedDate = 5; + idx_OrdersShipVia = 6; + idx_OrdersFreight = 7; + idx_OrdersShipName = 8; + idx_OrdersShipAddress = 9; + idx_OrdersShipCity = 10; + idx_OrdersShipRegion = 11; + idx_OrdersShipPostalCode = 12; + idx_OrdersShipCountry = 13; + +type + { ICustomers } + ICustomers = interface(IDAStronglyTypedDataTable) + ['{AD74260F-B808-430E-85E6-FB469055C068}'] + { Property getters and setters } + function GetCustomerIDValue: WideString; + procedure SetCustomerIDValue(const aValue: WideString); + function GetCustomerIDIsNull: Boolean; + procedure SetCustomerIDIsNull(const aValue: Boolean); + function GetCompanyNameValue: WideString; + procedure SetCompanyNameValue(const aValue: WideString); + function GetCompanyNameIsNull: Boolean; + procedure SetCompanyNameIsNull(const aValue: Boolean); + function GetContactNameValue: WideString; + procedure SetContactNameValue(const aValue: WideString); + function GetContactNameIsNull: Boolean; + procedure SetContactNameIsNull(const aValue: Boolean); + function GetContactTitleValue: WideString; + procedure SetContactTitleValue(const aValue: WideString); + function GetContactTitleIsNull: Boolean; + procedure SetContactTitleIsNull(const aValue: Boolean); + function GetAddressValue: WideString; + procedure SetAddressValue(const aValue: WideString); + function GetAddressIsNull: Boolean; + procedure SetAddressIsNull(const aValue: Boolean); + function GetCityValue: WideString; + procedure SetCityValue(const aValue: WideString); + function GetCityIsNull: Boolean; + procedure SetCityIsNull(const aValue: Boolean); + function GetRegionValue: WideString; + procedure SetRegionValue(const aValue: WideString); + function GetRegionIsNull: Boolean; + procedure SetRegionIsNull(const aValue: Boolean); + function GetPostalCodeValue: WideString; + procedure SetPostalCodeValue(const aValue: WideString); + function GetPostalCodeIsNull: Boolean; + procedure SetPostalCodeIsNull(const aValue: Boolean); + function GetCountryValue: WideString; + procedure SetCountryValue(const aValue: WideString); + function GetCountryIsNull: Boolean; + procedure SetCountryIsNull(const aValue: Boolean); + function GetPhoneValue: WideString; + procedure SetPhoneValue(const aValue: WideString); + function GetPhoneIsNull: Boolean; + procedure SetPhoneIsNull(const aValue: Boolean); + function GetFaxValue: WideString; + procedure SetFaxValue(const aValue: WideString); + function GetFaxIsNull: Boolean; + procedure SetFaxIsNull(const aValue: Boolean); + + + { Properties } + property CustomerID: WideString read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull: Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property CompanyName: WideString read GetCompanyNameValue write SetCompanyNameValue; + property CompanyNameIsNull: Boolean read GetCompanyNameIsNull write SetCompanyNameIsNull; + property ContactName: WideString read GetContactNameValue write SetContactNameValue; + property ContactNameIsNull: Boolean read GetContactNameIsNull write SetContactNameIsNull; + property ContactTitle: WideString read GetContactTitleValue write SetContactTitleValue; + property ContactTitleIsNull: Boolean read GetContactTitleIsNull write SetContactTitleIsNull; + property Address: WideString read GetAddressValue write SetAddressValue; + property AddressIsNull: Boolean read GetAddressIsNull write SetAddressIsNull; + property City: WideString read GetCityValue write SetCityValue; + property CityIsNull: Boolean read GetCityIsNull write SetCityIsNull; + property Region: WideString read GetRegionValue write SetRegionValue; + property RegionIsNull: Boolean read GetRegionIsNull write SetRegionIsNull; + property PostalCode: WideString read GetPostalCodeValue write SetPostalCodeValue; + property PostalCodeIsNull: Boolean read GetPostalCodeIsNull write SetPostalCodeIsNull; + property Country: WideString read GetCountryValue write SetCountryValue; + property CountryIsNull: Boolean read GetCountryIsNull write SetCountryIsNull; + property Phone: WideString read GetPhoneValue write SetPhoneValue; + property PhoneIsNull: Boolean read GetPhoneIsNull write SetPhoneIsNull; + property Fax: WideString read GetFaxValue write SetFaxValue; + property FaxIsNull: Boolean read GetFaxIsNull write SetFaxIsNull; + end; + + { TCustomersDataTableRules } + TCustomersDataTableRules = class(TDADataTableRules, ICustomers) + private + protected + { Property getters and setters } + function GetCustomerIDValue: WideString; virtual; + procedure SetCustomerIDValue(const aValue: WideString); virtual; + function GetCustomerIDIsNull: Boolean; virtual; + procedure SetCustomerIDIsNull(const aValue: Boolean); virtual; + function GetCompanyNameValue: WideString; virtual; + procedure SetCompanyNameValue(const aValue: WideString); virtual; + function GetCompanyNameIsNull: Boolean; virtual; + procedure SetCompanyNameIsNull(const aValue: Boolean); virtual; + function GetContactNameValue: WideString; virtual; + procedure SetContactNameValue(const aValue: WideString); virtual; + function GetContactNameIsNull: Boolean; virtual; + procedure SetContactNameIsNull(const aValue: Boolean); virtual; + function GetContactTitleValue: WideString; virtual; + procedure SetContactTitleValue(const aValue: WideString); virtual; + function GetContactTitleIsNull: Boolean; virtual; + procedure SetContactTitleIsNull(const aValue: Boolean); virtual; + function GetAddressValue: WideString; virtual; + procedure SetAddressValue(const aValue: WideString); virtual; + function GetAddressIsNull: Boolean; virtual; + procedure SetAddressIsNull(const aValue: Boolean); virtual; + function GetCityValue: WideString; virtual; + procedure SetCityValue(const aValue: WideString); virtual; + function GetCityIsNull: Boolean; virtual; + procedure SetCityIsNull(const aValue: Boolean); virtual; + function GetRegionValue: WideString; virtual; + procedure SetRegionValue(const aValue: WideString); virtual; + function GetRegionIsNull: Boolean; virtual; + procedure SetRegionIsNull(const aValue: Boolean); virtual; + function GetPostalCodeValue: WideString; virtual; + procedure SetPostalCodeValue(const aValue: WideString); virtual; + function GetPostalCodeIsNull: Boolean; virtual; + procedure SetPostalCodeIsNull(const aValue: Boolean); virtual; + function GetCountryValue: WideString; virtual; + procedure SetCountryValue(const aValue: WideString); virtual; + function GetCountryIsNull: Boolean; virtual; + procedure SetCountryIsNull(const aValue: Boolean); virtual; + function GetPhoneValue: WideString; virtual; + procedure SetPhoneValue(const aValue: WideString); virtual; + function GetPhoneIsNull: Boolean; virtual; + procedure SetPhoneIsNull(const aValue: Boolean); virtual; + function GetFaxValue: WideString; virtual; + procedure SetFaxValue(const aValue: WideString); virtual; + function GetFaxIsNull: Boolean; virtual; + procedure SetFaxIsNull(const aValue: Boolean); virtual; + + { Properties } + property CustomerID: WideString read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull: Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property CompanyName: WideString read GetCompanyNameValue write SetCompanyNameValue; + property CompanyNameIsNull: Boolean read GetCompanyNameIsNull write SetCompanyNameIsNull; + property ContactName: WideString read GetContactNameValue write SetContactNameValue; + property ContactNameIsNull: Boolean read GetContactNameIsNull write SetContactNameIsNull; + property ContactTitle: WideString read GetContactTitleValue write SetContactTitleValue; + property ContactTitleIsNull: Boolean read GetContactTitleIsNull write SetContactTitleIsNull; + property Address: WideString read GetAddressValue write SetAddressValue; + property AddressIsNull: Boolean read GetAddressIsNull write SetAddressIsNull; + property City: WideString read GetCityValue write SetCityValue; + property CityIsNull: Boolean read GetCityIsNull write SetCityIsNull; + property Region: WideString read GetRegionValue write SetRegionValue; + property RegionIsNull: Boolean read GetRegionIsNull write SetRegionIsNull; + property PostalCode: WideString read GetPostalCodeValue write SetPostalCodeValue; + property PostalCodeIsNull: Boolean read GetPostalCodeIsNull write SetPostalCodeIsNull; + property Country: WideString read GetCountryValue write SetCountryValue; + property CountryIsNull: Boolean read GetCountryIsNull write SetCountryIsNull; + property Phone: WideString read GetPhoneValue write SetPhoneValue; + property PhoneIsNull: Boolean read GetPhoneIsNull write SetPhoneIsNull; + property Fax: WideString read GetFaxValue write SetFaxValue; + property FaxIsNull: Boolean read GetFaxIsNull write SetFaxIsNull; + + public + constructor Create(aDataTable: TDADataTable); override; + destructor Destroy; override; + + end; + + { IOrders } + IOrders = interface(IDAStronglyTypedDataTable) + ['{837F52E1-CF1E-44B5-9026-31E65685B868}'] + { Property getters and setters } + function GetOrderIDValue: Integer; + procedure SetOrderIDValue(const aValue: Integer); + function GetOrderIDIsNull: Boolean; + procedure SetOrderIDIsNull(const aValue: Boolean); + function GetCustomerIDValue: WideString; + procedure SetCustomerIDValue(const aValue: WideString); + function GetCustomerIDIsNull: Boolean; + procedure SetCustomerIDIsNull(const aValue: Boolean); + function GetEmployeeIDValue: Integer; + procedure SetEmployeeIDValue(const aValue: Integer); + function GetEmployeeIDIsNull: Boolean; + procedure SetEmployeeIDIsNull(const aValue: Boolean); + function GetOrderDateValue: DateTime; + procedure SetOrderDateValue(const aValue: DateTime); + function GetOrderDateIsNull: Boolean; + procedure SetOrderDateIsNull(const aValue: Boolean); + function GetRequiredDateValue: DateTime; + procedure SetRequiredDateValue(const aValue: DateTime); + function GetRequiredDateIsNull: Boolean; + procedure SetRequiredDateIsNull(const aValue: Boolean); + function GetShippedDateValue: DateTime; + procedure SetShippedDateValue(const aValue: DateTime); + function GetShippedDateIsNull: Boolean; + procedure SetShippedDateIsNull(const aValue: Boolean); + function GetShipViaValue: Integer; + procedure SetShipViaValue(const aValue: Integer); + function GetShipViaIsNull: Boolean; + procedure SetShipViaIsNull(const aValue: Boolean); + function GetFreightValue: Float; + procedure SetFreightValue(const aValue: Float); + function GetFreightIsNull: Boolean; + procedure SetFreightIsNull(const aValue: Boolean); + function GetShipNameValue: WideString; + procedure SetShipNameValue(const aValue: WideString); + function GetShipNameIsNull: Boolean; + procedure SetShipNameIsNull(const aValue: Boolean); + function GetShipAddressValue: WideString; + procedure SetShipAddressValue(const aValue: WideString); + function GetShipAddressIsNull: Boolean; + procedure SetShipAddressIsNull(const aValue: Boolean); + function GetShipCityValue: WideString; + procedure SetShipCityValue(const aValue: WideString); + function GetShipCityIsNull: Boolean; + procedure SetShipCityIsNull(const aValue: Boolean); + function GetShipRegionValue: WideString; + procedure SetShipRegionValue(const aValue: WideString); + function GetShipRegionIsNull: Boolean; + procedure SetShipRegionIsNull(const aValue: Boolean); + function GetShipPostalCodeValue: WideString; + procedure SetShipPostalCodeValue(const aValue: WideString); + function GetShipPostalCodeIsNull: Boolean; + procedure SetShipPostalCodeIsNull(const aValue: Boolean); + function GetShipCountryValue: WideString; + procedure SetShipCountryValue(const aValue: WideString); + function GetShipCountryIsNull: Boolean; + procedure SetShipCountryIsNull(const aValue: Boolean); + + + { Properties } + property OrderID: Integer read GetOrderIDValue write SetOrderIDValue; + property OrderIDIsNull: Boolean read GetOrderIDIsNull write SetOrderIDIsNull; + property CustomerID: WideString read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull: Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property EmployeeID: Integer read GetEmployeeIDValue write SetEmployeeIDValue; + property EmployeeIDIsNull: Boolean read GetEmployeeIDIsNull write SetEmployeeIDIsNull; + property OrderDate: DateTime read GetOrderDateValue write SetOrderDateValue; + property OrderDateIsNull: Boolean read GetOrderDateIsNull write SetOrderDateIsNull; + property RequiredDate: DateTime read GetRequiredDateValue write SetRequiredDateValue; + property RequiredDateIsNull: Boolean read GetRequiredDateIsNull write SetRequiredDateIsNull; + property ShippedDate: DateTime read GetShippedDateValue write SetShippedDateValue; + property ShippedDateIsNull: Boolean read GetShippedDateIsNull write SetShippedDateIsNull; + property ShipVia: Integer read GetShipViaValue write SetShipViaValue; + property ShipViaIsNull: Boolean read GetShipViaIsNull write SetShipViaIsNull; + property Freight: Float read GetFreightValue write SetFreightValue; + property FreightIsNull: Boolean read GetFreightIsNull write SetFreightIsNull; + property ShipName: WideString read GetShipNameValue write SetShipNameValue; + property ShipNameIsNull: Boolean read GetShipNameIsNull write SetShipNameIsNull; + property ShipAddress: WideString read GetShipAddressValue write SetShipAddressValue; + property ShipAddressIsNull: Boolean read GetShipAddressIsNull write SetShipAddressIsNull; + property ShipCity: WideString read GetShipCityValue write SetShipCityValue; + property ShipCityIsNull: Boolean read GetShipCityIsNull write SetShipCityIsNull; + property ShipRegion: WideString read GetShipRegionValue write SetShipRegionValue; + property ShipRegionIsNull: Boolean read GetShipRegionIsNull write SetShipRegionIsNull; + property ShipPostalCode: WideString read GetShipPostalCodeValue write SetShipPostalCodeValue; + property ShipPostalCodeIsNull: Boolean read GetShipPostalCodeIsNull write SetShipPostalCodeIsNull; + property ShipCountry: WideString read GetShipCountryValue write SetShipCountryValue; + property ShipCountryIsNull: Boolean read GetShipCountryIsNull write SetShipCountryIsNull; + end; + + { TOrdersDataTableRules } + TOrdersDataTableRules = class(TDADataTableRules, IOrders) + private + protected + { Property getters and setters } + function GetOrderIDValue: Integer; virtual; + procedure SetOrderIDValue(const aValue: Integer); virtual; + function GetOrderIDIsNull: Boolean; virtual; + procedure SetOrderIDIsNull(const aValue: Boolean); virtual; + function GetCustomerIDValue: WideString; virtual; + procedure SetCustomerIDValue(const aValue: WideString); virtual; + function GetCustomerIDIsNull: Boolean; virtual; + procedure SetCustomerIDIsNull(const aValue: Boolean); virtual; + function GetEmployeeIDValue: Integer; virtual; + procedure SetEmployeeIDValue(const aValue: Integer); virtual; + function GetEmployeeIDIsNull: Boolean; virtual; + procedure SetEmployeeIDIsNull(const aValue: Boolean); virtual; + function GetOrderDateValue: DateTime; virtual; + procedure SetOrderDateValue(const aValue: DateTime); virtual; + function GetOrderDateIsNull: Boolean; virtual; + procedure SetOrderDateIsNull(const aValue: Boolean); virtual; + function GetRequiredDateValue: DateTime; virtual; + procedure SetRequiredDateValue(const aValue: DateTime); virtual; + function GetRequiredDateIsNull: Boolean; virtual; + procedure SetRequiredDateIsNull(const aValue: Boolean); virtual; + function GetShippedDateValue: DateTime; virtual; + procedure SetShippedDateValue(const aValue: DateTime); virtual; + function GetShippedDateIsNull: Boolean; virtual; + procedure SetShippedDateIsNull(const aValue: Boolean); virtual; + function GetShipViaValue: Integer; virtual; + procedure SetShipViaValue(const aValue: Integer); virtual; + function GetShipViaIsNull: Boolean; virtual; + procedure SetShipViaIsNull(const aValue: Boolean); virtual; + function GetFreightValue: Float; virtual; + procedure SetFreightValue(const aValue: Float); virtual; + function GetFreightIsNull: Boolean; virtual; + procedure SetFreightIsNull(const aValue: Boolean); virtual; + function GetShipNameValue: WideString; virtual; + procedure SetShipNameValue(const aValue: WideString); virtual; + function GetShipNameIsNull: Boolean; virtual; + procedure SetShipNameIsNull(const aValue: Boolean); virtual; + function GetShipAddressValue: WideString; virtual; + procedure SetShipAddressValue(const aValue: WideString); virtual; + function GetShipAddressIsNull: Boolean; virtual; + procedure SetShipAddressIsNull(const aValue: Boolean); virtual; + function GetShipCityValue: WideString; virtual; + procedure SetShipCityValue(const aValue: WideString); virtual; + function GetShipCityIsNull: Boolean; virtual; + procedure SetShipCityIsNull(const aValue: Boolean); virtual; + function GetShipRegionValue: WideString; virtual; + procedure SetShipRegionValue(const aValue: WideString); virtual; + function GetShipRegionIsNull: Boolean; virtual; + procedure SetShipRegionIsNull(const aValue: Boolean); virtual; + function GetShipPostalCodeValue: WideString; virtual; + procedure SetShipPostalCodeValue(const aValue: WideString); virtual; + function GetShipPostalCodeIsNull: Boolean; virtual; + procedure SetShipPostalCodeIsNull(const aValue: Boolean); virtual; + function GetShipCountryValue: WideString; virtual; + procedure SetShipCountryValue(const aValue: WideString); virtual; + function GetShipCountryIsNull: Boolean; virtual; + procedure SetShipCountryIsNull(const aValue: Boolean); virtual; + + { Properties } + property OrderID: Integer read GetOrderIDValue write SetOrderIDValue; + property OrderIDIsNull: Boolean read GetOrderIDIsNull write SetOrderIDIsNull; + property CustomerID: WideString read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull: Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property EmployeeID: Integer read GetEmployeeIDValue write SetEmployeeIDValue; + property EmployeeIDIsNull: Boolean read GetEmployeeIDIsNull write SetEmployeeIDIsNull; + property OrderDate: DateTime read GetOrderDateValue write SetOrderDateValue; + property OrderDateIsNull: Boolean read GetOrderDateIsNull write SetOrderDateIsNull; + property RequiredDate: DateTime read GetRequiredDateValue write SetRequiredDateValue; + property RequiredDateIsNull: Boolean read GetRequiredDateIsNull write SetRequiredDateIsNull; + property ShippedDate: DateTime read GetShippedDateValue write SetShippedDateValue; + property ShippedDateIsNull: Boolean read GetShippedDateIsNull write SetShippedDateIsNull; + property ShipVia: Integer read GetShipViaValue write SetShipViaValue; + property ShipViaIsNull: Boolean read GetShipViaIsNull write SetShipViaIsNull; + property Freight: Float read GetFreightValue write SetFreightValue; + property FreightIsNull: Boolean read GetFreightIsNull write SetFreightIsNull; + property ShipName: WideString read GetShipNameValue write SetShipNameValue; + property ShipNameIsNull: Boolean read GetShipNameIsNull write SetShipNameIsNull; + property ShipAddress: WideString read GetShipAddressValue write SetShipAddressValue; + property ShipAddressIsNull: Boolean read GetShipAddressIsNull write SetShipAddressIsNull; + property ShipCity: WideString read GetShipCityValue write SetShipCityValue; + property ShipCityIsNull: Boolean read GetShipCityIsNull write SetShipCityIsNull; + property ShipRegion: WideString read GetShipRegionValue write SetShipRegionValue; + property ShipRegionIsNull: Boolean read GetShipRegionIsNull write SetShipRegionIsNull; + property ShipPostalCode: WideString read GetShipPostalCodeValue write SetShipPostalCodeValue; + property ShipPostalCodeIsNull: Boolean read GetShipPostalCodeIsNull write SetShipPostalCodeIsNull; + property ShipCountry: WideString read GetShipCountryValue write SetShipCountryValue; + property ShipCountryIsNull: Boolean read GetShipCountryIsNull write SetShipCountryIsNull; + + public + constructor Create(aDataTable: TDADataTable); override; + destructor Destroy; override; + + end; + +implementation + +uses Variants; + +{ TCustomersDataTableRules } +constructor TCustomersDataTableRules.Create(aDataTable: TDADataTable); +begin + inherited; +end; + +destructor TCustomersDataTableRules.Destroy; +begin + inherited; +end; + +function TCustomersDataTableRules.GetCustomerIDValue: WideString; +begin + result := DataTable.Fields[idx_CustomersCustomerID].AsWideString; +end; + +procedure TCustomersDataTableRules.SetCustomerIDValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersCustomerID].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetCustomerIDIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersCustomerID].IsNull; +end; + +procedure TCustomersDataTableRules.SetCustomerIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersCustomerID].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetCompanyNameValue: WideString; +begin + result := DataTable.Fields[idx_CustomersCompanyName].AsWideString; +end; + +procedure TCustomersDataTableRules.SetCompanyNameValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersCompanyName].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetCompanyNameIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersCompanyName].IsNull; +end; + +procedure TCustomersDataTableRules.SetCompanyNameIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersCompanyName].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetContactNameValue: WideString; +begin + result := DataTable.Fields[idx_CustomersContactName].AsWideString; +end; + +procedure TCustomersDataTableRules.SetContactNameValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersContactName].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetContactNameIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersContactName].IsNull; +end; + +procedure TCustomersDataTableRules.SetContactNameIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersContactName].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetContactTitleValue: WideString; +begin + result := DataTable.Fields[idx_CustomersContactTitle].AsWideString; +end; + +procedure TCustomersDataTableRules.SetContactTitleValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersContactTitle].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetContactTitleIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersContactTitle].IsNull; +end; + +procedure TCustomersDataTableRules.SetContactTitleIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersContactTitle].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetAddressValue: WideString; +begin + result := DataTable.Fields[idx_CustomersAddress].AsWideString; +end; + +procedure TCustomersDataTableRules.SetAddressValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersAddress].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetAddressIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersAddress].IsNull; +end; + +procedure TCustomersDataTableRules.SetAddressIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersAddress].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetCityValue: WideString; +begin + result := DataTable.Fields[idx_CustomersCity].AsWideString; +end; + +procedure TCustomersDataTableRules.SetCityValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersCity].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetCityIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersCity].IsNull; +end; + +procedure TCustomersDataTableRules.SetCityIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersCity].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetRegionValue: WideString; +begin + result := DataTable.Fields[idx_CustomersRegion].AsWideString; +end; + +procedure TCustomersDataTableRules.SetRegionValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersRegion].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetRegionIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersRegion].IsNull; +end; + +procedure TCustomersDataTableRules.SetRegionIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersRegion].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetPostalCodeValue: WideString; +begin + result := DataTable.Fields[idx_CustomersPostalCode].AsWideString; +end; + +procedure TCustomersDataTableRules.SetPostalCodeValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersPostalCode].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetPostalCodeIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersPostalCode].IsNull; +end; + +procedure TCustomersDataTableRules.SetPostalCodeIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersPostalCode].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetCountryValue: WideString; +begin + result := DataTable.Fields[idx_CustomersCountry].AsWideString; +end; + +procedure TCustomersDataTableRules.SetCountryValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersCountry].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetCountryIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersCountry].IsNull; +end; + +procedure TCustomersDataTableRules.SetCountryIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersCountry].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetPhoneValue: WideString; +begin + result := DataTable.Fields[idx_CustomersPhone].AsWideString; +end; + +procedure TCustomersDataTableRules.SetPhoneValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersPhone].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetPhoneIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersPhone].IsNull; +end; + +procedure TCustomersDataTableRules.SetPhoneIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersPhone].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetFaxValue: WideString; +begin + result := DataTable.Fields[idx_CustomersFax].AsWideString; +end; + +procedure TCustomersDataTableRules.SetFaxValue(const aValue: WideString); +begin + DataTable.Fields[idx_CustomersFax].AsWideString := aValue; +end; + +function TCustomersDataTableRules.GetFaxIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersFax].IsNull; +end; + +procedure TCustomersDataTableRules.SetFaxIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersFax].AsVariant := Null; +end; + + +{ TOrdersDataTableRules } +constructor TOrdersDataTableRules.Create(aDataTable: TDADataTable); +begin + inherited; +end; + +destructor TOrdersDataTableRules.Destroy; +begin + inherited; +end; + +function TOrdersDataTableRules.GetOrderIDValue: Integer; +begin + result := DataTable.Fields[idx_OrdersOrderID].AsInteger; +end; + +procedure TOrdersDataTableRules.SetOrderIDValue(const aValue: Integer); +begin + DataTable.Fields[idx_OrdersOrderID].AsInteger := aValue; +end; + +function TOrdersDataTableRules.GetOrderIDIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersOrderID].IsNull; +end; + +procedure TOrdersDataTableRules.SetOrderIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersOrderID].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetCustomerIDValue: WideString; +begin + result := DataTable.Fields[idx_OrdersCustomerID].AsWideString; +end; + +procedure TOrdersDataTableRules.SetCustomerIDValue(const aValue: WideString); +begin + DataTable.Fields[idx_OrdersCustomerID].AsWideString := aValue; +end; + +function TOrdersDataTableRules.GetCustomerIDIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersCustomerID].IsNull; +end; + +procedure TOrdersDataTableRules.SetCustomerIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersCustomerID].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetEmployeeIDValue: Integer; +begin + result := DataTable.Fields[idx_OrdersEmployeeID].AsInteger; +end; + +procedure TOrdersDataTableRules.SetEmployeeIDValue(const aValue: Integer); +begin + DataTable.Fields[idx_OrdersEmployeeID].AsInteger := aValue; +end; + +function TOrdersDataTableRules.GetEmployeeIDIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersEmployeeID].IsNull; +end; + +procedure TOrdersDataTableRules.SetEmployeeIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersEmployeeID].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetOrderDateValue: DateTime; +begin + result := DataTable.Fields[idx_OrdersOrderDate].AsDateTime; +end; + +procedure TOrdersDataTableRules.SetOrderDateValue(const aValue: DateTime); +begin + DataTable.Fields[idx_OrdersOrderDate].AsDateTime := aValue; +end; + +function TOrdersDataTableRules.GetOrderDateIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersOrderDate].IsNull; +end; + +procedure TOrdersDataTableRules.SetOrderDateIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersOrderDate].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetRequiredDateValue: DateTime; +begin + result := DataTable.Fields[idx_OrdersRequiredDate].AsDateTime; +end; + +procedure TOrdersDataTableRules.SetRequiredDateValue(const aValue: DateTime); +begin + DataTable.Fields[idx_OrdersRequiredDate].AsDateTime := aValue; +end; + +function TOrdersDataTableRules.GetRequiredDateIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersRequiredDate].IsNull; +end; + +procedure TOrdersDataTableRules.SetRequiredDateIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersRequiredDate].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShippedDateValue: DateTime; +begin + result := DataTable.Fields[idx_OrdersShippedDate].AsDateTime; +end; + +procedure TOrdersDataTableRules.SetShippedDateValue(const aValue: DateTime); +begin + DataTable.Fields[idx_OrdersShippedDate].AsDateTime := aValue; +end; + +function TOrdersDataTableRules.GetShippedDateIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShippedDate].IsNull; +end; + +procedure TOrdersDataTableRules.SetShippedDateIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShippedDate].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipViaValue: Integer; +begin + result := DataTable.Fields[idx_OrdersShipVia].AsInteger; +end; + +procedure TOrdersDataTableRules.SetShipViaValue(const aValue: Integer); +begin + DataTable.Fields[idx_OrdersShipVia].AsInteger := aValue; +end; + +function TOrdersDataTableRules.GetShipViaIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipVia].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipViaIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipVia].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetFreightValue: Float; +begin + result := DataTable.Fields[idx_OrdersFreight].AsFloat; +end; + +procedure TOrdersDataTableRules.SetFreightValue(const aValue: Float); +begin + DataTable.Fields[idx_OrdersFreight].AsFloat := aValue; +end; + +function TOrdersDataTableRules.GetFreightIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersFreight].IsNull; +end; + +procedure TOrdersDataTableRules.SetFreightIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersFreight].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipNameValue: WideString; +begin + result := DataTable.Fields[idx_OrdersShipName].AsWideString; +end; + +procedure TOrdersDataTableRules.SetShipNameValue(const aValue: WideString); +begin + DataTable.Fields[idx_OrdersShipName].AsWideString := aValue; +end; + +function TOrdersDataTableRules.GetShipNameIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipName].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipNameIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipName].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipAddressValue: WideString; +begin + result := DataTable.Fields[idx_OrdersShipAddress].AsWideString; +end; + +procedure TOrdersDataTableRules.SetShipAddressValue(const aValue: WideString); +begin + DataTable.Fields[idx_OrdersShipAddress].AsWideString := aValue; +end; + +function TOrdersDataTableRules.GetShipAddressIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipAddress].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipAddressIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipAddress].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipCityValue: WideString; +begin + result := DataTable.Fields[idx_OrdersShipCity].AsWideString; +end; + +procedure TOrdersDataTableRules.SetShipCityValue(const aValue: WideString); +begin + DataTable.Fields[idx_OrdersShipCity].AsWideString := aValue; +end; + +function TOrdersDataTableRules.GetShipCityIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipCity].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipCityIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipCity].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipRegionValue: WideString; +begin + result := DataTable.Fields[idx_OrdersShipRegion].AsWideString; +end; + +procedure TOrdersDataTableRules.SetShipRegionValue(const aValue: WideString); +begin + DataTable.Fields[idx_OrdersShipRegion].AsWideString := aValue; +end; + +function TOrdersDataTableRules.GetShipRegionIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipRegion].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipRegionIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipRegion].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipPostalCodeValue: WideString; +begin + result := DataTable.Fields[idx_OrdersShipPostalCode].AsWideString; +end; + +procedure TOrdersDataTableRules.SetShipPostalCodeValue(const aValue: WideString); +begin + DataTable.Fields[idx_OrdersShipPostalCode].AsWideString := aValue; +end; + +function TOrdersDataTableRules.GetShipPostalCodeIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipPostalCode].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipPostalCodeIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipPostalCode].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipCountryValue: WideString; +begin + result := DataTable.Fields[idx_OrdersShipCountry].AsWideString; +end; + +procedure TOrdersDataTableRules.SetShipCountryValue(const aValue: WideString); +begin + DataTable.Fields[idx_OrdersShipCountry].AsWideString := aValue; +end; + +function TOrdersDataTableRules.GetShipCountryIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipCountry].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipCountryIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipCountry].AsVariant := Null; +end; + + +initialization + RegisterDataTableRules(RID_Customers, TCustomersDataTableRules); + RegisterDataTableRules(RID_Orders, TOrdersDataTableRules); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/SchemaServer_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/SchemaServer_Intf.pas new file mode 100644 index 0000000..8ca7acc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/SchemaServer_Intf.pas @@ -0,0 +1,1168 @@ +unit SchemaServer_Intf; + +interface + +uses + Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, SchemaClient_Intf; + +const + { Delta rules ids + Feel free to change them to something more human readable + but make sure they are unique in the context of your application } + RID_CustomersDelta = '{484D754F-68A9-4DC0-AADF-EBDB00C9E40F}'; + RID_OrdersDelta = '{6D8F66A7-58AC-4768-AC95-3437EABB042A}'; + +type + { ICustomersDelta } + ICustomersDelta = interface(ICustomers) + ['{484D754F-68A9-4DC0-AADF-EBDB00C9E40F}'] + { Property getters and setters } + function GetOldCustomerIDValue : WideString; + function GetOldCompanyNameValue : WideString; + function GetOldContactNameValue : WideString; + function GetOldContactTitleValue : WideString; + function GetOldAddressValue : WideString; + function GetOldCityValue : WideString; + function GetOldRegionValue : WideString; + function GetOldPostalCodeValue : WideString; + function GetOldCountryValue : WideString; + function GetOldPhoneValue : WideString; + function GetOldFaxValue : WideString; + + { Properties } + property OldCustomerID : WideString read GetOldCustomerIDValue; + property OldCompanyName : WideString read GetOldCompanyNameValue; + property OldContactName : WideString read GetOldContactNameValue; + property OldContactTitle : WideString read GetOldContactTitleValue; + property OldAddress : WideString read GetOldAddressValue; + property OldCity : WideString read GetOldCityValue; + property OldRegion : WideString read GetOldRegionValue; + property OldPostalCode : WideString read GetOldPostalCodeValue; + property OldCountry : WideString read GetOldCountryValue; + property OldPhone : WideString read GetOldPhoneValue; + property OldFax : WideString read GetOldFaxValue; + end; + + { TCustomersBusinessProcessorRules } + TCustomersBusinessProcessorRules = class(TDABusinessProcessorRules, ICustomers, ICustomersDelta) + private + protected + { Property getters and setters } + function GetCustomerIDValue: WideString; virtual; + function GetCustomerIDIsNull: Boolean; virtual; + function GetOldCustomerIDValue: WideString; virtual; + function GetOldCustomerIDIsNull: Boolean; virtual; + procedure SetCustomerIDValue(const aValue: WideString); virtual; + procedure SetCustomerIDIsNull(const aValue: Boolean); virtual; + function GetCompanyNameValue: WideString; virtual; + function GetCompanyNameIsNull: Boolean; virtual; + function GetOldCompanyNameValue: WideString; virtual; + function GetOldCompanyNameIsNull: Boolean; virtual; + procedure SetCompanyNameValue(const aValue: WideString); virtual; + procedure SetCompanyNameIsNull(const aValue: Boolean); virtual; + function GetContactNameValue: WideString; virtual; + function GetContactNameIsNull: Boolean; virtual; + function GetOldContactNameValue: WideString; virtual; + function GetOldContactNameIsNull: Boolean; virtual; + procedure SetContactNameValue(const aValue: WideString); virtual; + procedure SetContactNameIsNull(const aValue: Boolean); virtual; + function GetContactTitleValue: WideString; virtual; + function GetContactTitleIsNull: Boolean; virtual; + function GetOldContactTitleValue: WideString; virtual; + function GetOldContactTitleIsNull: Boolean; virtual; + procedure SetContactTitleValue(const aValue: WideString); virtual; + procedure SetContactTitleIsNull(const aValue: Boolean); virtual; + function GetAddressValue: WideString; virtual; + function GetAddressIsNull: Boolean; virtual; + function GetOldAddressValue: WideString; virtual; + function GetOldAddressIsNull: Boolean; virtual; + procedure SetAddressValue(const aValue: WideString); virtual; + procedure SetAddressIsNull(const aValue: Boolean); virtual; + function GetCityValue: WideString; virtual; + function GetCityIsNull: Boolean; virtual; + function GetOldCityValue: WideString; virtual; + function GetOldCityIsNull: Boolean; virtual; + procedure SetCityValue(const aValue: WideString); virtual; + procedure SetCityIsNull(const aValue: Boolean); virtual; + function GetRegionValue: WideString; virtual; + function GetRegionIsNull: Boolean; virtual; + function GetOldRegionValue: WideString; virtual; + function GetOldRegionIsNull: Boolean; virtual; + procedure SetRegionValue(const aValue: WideString); virtual; + procedure SetRegionIsNull(const aValue: Boolean); virtual; + function GetPostalCodeValue: WideString; virtual; + function GetPostalCodeIsNull: Boolean; virtual; + function GetOldPostalCodeValue: WideString; virtual; + function GetOldPostalCodeIsNull: Boolean; virtual; + procedure SetPostalCodeValue(const aValue: WideString); virtual; + procedure SetPostalCodeIsNull(const aValue: Boolean); virtual; + function GetCountryValue: WideString; virtual; + function GetCountryIsNull: Boolean; virtual; + function GetOldCountryValue: WideString; virtual; + function GetOldCountryIsNull: Boolean; virtual; + procedure SetCountryValue(const aValue: WideString); virtual; + procedure SetCountryIsNull(const aValue: Boolean); virtual; + function GetPhoneValue: WideString; virtual; + function GetPhoneIsNull: Boolean; virtual; + function GetOldPhoneValue: WideString; virtual; + function GetOldPhoneIsNull: Boolean; virtual; + procedure SetPhoneValue(const aValue: WideString); virtual; + procedure SetPhoneIsNull(const aValue: Boolean); virtual; + function GetFaxValue: WideString; virtual; + function GetFaxIsNull: Boolean; virtual; + function GetOldFaxValue: WideString; virtual; + function GetOldFaxIsNull: Boolean; virtual; + procedure SetFaxValue(const aValue: WideString); virtual; + procedure SetFaxIsNull(const aValue: Boolean); virtual; + + { Properties } + property CustomerID : WideString read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull : Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property OldCustomerID : WideString read GetOldCustomerIDValue; + property OldCustomerIDIsNull : Boolean read GetOldCustomerIDIsNull; + property CompanyName : WideString read GetCompanyNameValue write SetCompanyNameValue; + property CompanyNameIsNull : Boolean read GetCompanyNameIsNull write SetCompanyNameIsNull; + property OldCompanyName : WideString read GetOldCompanyNameValue; + property OldCompanyNameIsNull : Boolean read GetOldCompanyNameIsNull; + property ContactName : WideString read GetContactNameValue write SetContactNameValue; + property ContactNameIsNull : Boolean read GetContactNameIsNull write SetContactNameIsNull; + property OldContactName : WideString read GetOldContactNameValue; + property OldContactNameIsNull : Boolean read GetOldContactNameIsNull; + property ContactTitle : WideString read GetContactTitleValue write SetContactTitleValue; + property ContactTitleIsNull : Boolean read GetContactTitleIsNull write SetContactTitleIsNull; + property OldContactTitle : WideString read GetOldContactTitleValue; + property OldContactTitleIsNull : Boolean read GetOldContactTitleIsNull; + property Address : WideString read GetAddressValue write SetAddressValue; + property AddressIsNull : Boolean read GetAddressIsNull write SetAddressIsNull; + property OldAddress : WideString read GetOldAddressValue; + property OldAddressIsNull : Boolean read GetOldAddressIsNull; + property City : WideString read GetCityValue write SetCityValue; + property CityIsNull : Boolean read GetCityIsNull write SetCityIsNull; + property OldCity : WideString read GetOldCityValue; + property OldCityIsNull : Boolean read GetOldCityIsNull; + property Region : WideString read GetRegionValue write SetRegionValue; + property RegionIsNull : Boolean read GetRegionIsNull write SetRegionIsNull; + property OldRegion : WideString read GetOldRegionValue; + property OldRegionIsNull : Boolean read GetOldRegionIsNull; + property PostalCode : WideString read GetPostalCodeValue write SetPostalCodeValue; + property PostalCodeIsNull : Boolean read GetPostalCodeIsNull write SetPostalCodeIsNull; + property OldPostalCode : WideString read GetOldPostalCodeValue; + property OldPostalCodeIsNull : Boolean read GetOldPostalCodeIsNull; + property Country : WideString read GetCountryValue write SetCountryValue; + property CountryIsNull : Boolean read GetCountryIsNull write SetCountryIsNull; + property OldCountry : WideString read GetOldCountryValue; + property OldCountryIsNull : Boolean read GetOldCountryIsNull; + property Phone : WideString read GetPhoneValue write SetPhoneValue; + property PhoneIsNull : Boolean read GetPhoneIsNull write SetPhoneIsNull; + property OldPhone : WideString read GetOldPhoneValue; + property OldPhoneIsNull : Boolean read GetOldPhoneIsNull; + property Fax : WideString read GetFaxValue write SetFaxValue; + property FaxIsNull : Boolean read GetFaxIsNull write SetFaxIsNull; + property OldFax : WideString read GetOldFaxValue; + property OldFaxIsNull : Boolean read GetOldFaxIsNull; + + public + constructor Create(aBusinessProcessor: TDABusinessProcessor); override; + destructor Destroy; override; + + end; + + { IOrdersDelta } + IOrdersDelta = interface(IOrders) + ['{6D8F66A7-58AC-4768-AC95-3437EABB042A}'] + { Property getters and setters } + function GetOldOrderIDValue : Integer; + function GetOldCustomerIDValue : WideString; + function GetOldEmployeeIDValue : Integer; + function GetOldOrderDateValue : DateTime; + function GetOldRequiredDateValue : DateTime; + function GetOldShippedDateValue : DateTime; + function GetOldShipViaValue : Integer; + function GetOldFreightValue : Float; + function GetOldShipNameValue : WideString; + function GetOldShipAddressValue : WideString; + function GetOldShipCityValue : WideString; + function GetOldShipRegionValue : WideString; + function GetOldShipPostalCodeValue : WideString; + function GetOldShipCountryValue : WideString; + + { Properties } + property OldOrderID : Integer read GetOldOrderIDValue; + property OldCustomerID : WideString read GetOldCustomerIDValue; + property OldEmployeeID : Integer read GetOldEmployeeIDValue; + property OldOrderDate : DateTime read GetOldOrderDateValue; + property OldRequiredDate : DateTime read GetOldRequiredDateValue; + property OldShippedDate : DateTime read GetOldShippedDateValue; + property OldShipVia : Integer read GetOldShipViaValue; + property OldFreight : Float read GetOldFreightValue; + property OldShipName : WideString read GetOldShipNameValue; + property OldShipAddress : WideString read GetOldShipAddressValue; + property OldShipCity : WideString read GetOldShipCityValue; + property OldShipRegion : WideString read GetOldShipRegionValue; + property OldShipPostalCode : WideString read GetOldShipPostalCodeValue; + property OldShipCountry : WideString read GetOldShipCountryValue; + end; + + { TOrdersBusinessProcessorRules } + TOrdersBusinessProcessorRules = class(TDABusinessProcessorRules, IOrders, IOrdersDelta) + private + protected + { Property getters and setters } + function GetOrderIDValue: Integer; virtual; + function GetOrderIDIsNull: Boolean; virtual; + function GetOldOrderIDValue: Integer; virtual; + function GetOldOrderIDIsNull: Boolean; virtual; + procedure SetOrderIDValue(const aValue: Integer); virtual; + procedure SetOrderIDIsNull(const aValue: Boolean); virtual; + function GetCustomerIDValue: WideString; virtual; + function GetCustomerIDIsNull: Boolean; virtual; + function GetOldCustomerIDValue: WideString; virtual; + function GetOldCustomerIDIsNull: Boolean; virtual; + procedure SetCustomerIDValue(const aValue: WideString); virtual; + procedure SetCustomerIDIsNull(const aValue: Boolean); virtual; + function GetEmployeeIDValue: Integer; virtual; + function GetEmployeeIDIsNull: Boolean; virtual; + function GetOldEmployeeIDValue: Integer; virtual; + function GetOldEmployeeIDIsNull: Boolean; virtual; + procedure SetEmployeeIDValue(const aValue: Integer); virtual; + procedure SetEmployeeIDIsNull(const aValue: Boolean); virtual; + function GetOrderDateValue: DateTime; virtual; + function GetOrderDateIsNull: Boolean; virtual; + function GetOldOrderDateValue: DateTime; virtual; + function GetOldOrderDateIsNull: Boolean; virtual; + procedure SetOrderDateValue(const aValue: DateTime); virtual; + procedure SetOrderDateIsNull(const aValue: Boolean); virtual; + function GetRequiredDateValue: DateTime; virtual; + function GetRequiredDateIsNull: Boolean; virtual; + function GetOldRequiredDateValue: DateTime; virtual; + function GetOldRequiredDateIsNull: Boolean; virtual; + procedure SetRequiredDateValue(const aValue: DateTime); virtual; + procedure SetRequiredDateIsNull(const aValue: Boolean); virtual; + function GetShippedDateValue: DateTime; virtual; + function GetShippedDateIsNull: Boolean; virtual; + function GetOldShippedDateValue: DateTime; virtual; + function GetOldShippedDateIsNull: Boolean; virtual; + procedure SetShippedDateValue(const aValue: DateTime); virtual; + procedure SetShippedDateIsNull(const aValue: Boolean); virtual; + function GetShipViaValue: Integer; virtual; + function GetShipViaIsNull: Boolean; virtual; + function GetOldShipViaValue: Integer; virtual; + function GetOldShipViaIsNull: Boolean; virtual; + procedure SetShipViaValue(const aValue: Integer); virtual; + procedure SetShipViaIsNull(const aValue: Boolean); virtual; + function GetFreightValue: Float; virtual; + function GetFreightIsNull: Boolean; virtual; + function GetOldFreightValue: Float; virtual; + function GetOldFreightIsNull: Boolean; virtual; + procedure SetFreightValue(const aValue: Float); virtual; + procedure SetFreightIsNull(const aValue: Boolean); virtual; + function GetShipNameValue: WideString; virtual; + function GetShipNameIsNull: Boolean; virtual; + function GetOldShipNameValue: WideString; virtual; + function GetOldShipNameIsNull: Boolean; virtual; + procedure SetShipNameValue(const aValue: WideString); virtual; + procedure SetShipNameIsNull(const aValue: Boolean); virtual; + function GetShipAddressValue: WideString; virtual; + function GetShipAddressIsNull: Boolean; virtual; + function GetOldShipAddressValue: WideString; virtual; + function GetOldShipAddressIsNull: Boolean; virtual; + procedure SetShipAddressValue(const aValue: WideString); virtual; + procedure SetShipAddressIsNull(const aValue: Boolean); virtual; + function GetShipCityValue: WideString; virtual; + function GetShipCityIsNull: Boolean; virtual; + function GetOldShipCityValue: WideString; virtual; + function GetOldShipCityIsNull: Boolean; virtual; + procedure SetShipCityValue(const aValue: WideString); virtual; + procedure SetShipCityIsNull(const aValue: Boolean); virtual; + function GetShipRegionValue: WideString; virtual; + function GetShipRegionIsNull: Boolean; virtual; + function GetOldShipRegionValue: WideString; virtual; + function GetOldShipRegionIsNull: Boolean; virtual; + procedure SetShipRegionValue(const aValue: WideString); virtual; + procedure SetShipRegionIsNull(const aValue: Boolean); virtual; + function GetShipPostalCodeValue: WideString; virtual; + function GetShipPostalCodeIsNull: Boolean; virtual; + function GetOldShipPostalCodeValue: WideString; virtual; + function GetOldShipPostalCodeIsNull: Boolean; virtual; + procedure SetShipPostalCodeValue(const aValue: WideString); virtual; + procedure SetShipPostalCodeIsNull(const aValue: Boolean); virtual; + function GetShipCountryValue: WideString; virtual; + function GetShipCountryIsNull: Boolean; virtual; + function GetOldShipCountryValue: WideString; virtual; + function GetOldShipCountryIsNull: Boolean; virtual; + procedure SetShipCountryValue(const aValue: WideString); virtual; + procedure SetShipCountryIsNull(const aValue: Boolean); virtual; + + { Properties } + property OrderID : Integer read GetOrderIDValue write SetOrderIDValue; + property OrderIDIsNull : Boolean read GetOrderIDIsNull write SetOrderIDIsNull; + property OldOrderID : Integer read GetOldOrderIDValue; + property OldOrderIDIsNull : Boolean read GetOldOrderIDIsNull; + property CustomerID : WideString read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull : Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property OldCustomerID : WideString read GetOldCustomerIDValue; + property OldCustomerIDIsNull : Boolean read GetOldCustomerIDIsNull; + property EmployeeID : Integer read GetEmployeeIDValue write SetEmployeeIDValue; + property EmployeeIDIsNull : Boolean read GetEmployeeIDIsNull write SetEmployeeIDIsNull; + property OldEmployeeID : Integer read GetOldEmployeeIDValue; + property OldEmployeeIDIsNull : Boolean read GetOldEmployeeIDIsNull; + property OrderDate : DateTime read GetOrderDateValue write SetOrderDateValue; + property OrderDateIsNull : Boolean read GetOrderDateIsNull write SetOrderDateIsNull; + property OldOrderDate : DateTime read GetOldOrderDateValue; + property OldOrderDateIsNull : Boolean read GetOldOrderDateIsNull; + property RequiredDate : DateTime read GetRequiredDateValue write SetRequiredDateValue; + property RequiredDateIsNull : Boolean read GetRequiredDateIsNull write SetRequiredDateIsNull; + property OldRequiredDate : DateTime read GetOldRequiredDateValue; + property OldRequiredDateIsNull : Boolean read GetOldRequiredDateIsNull; + property ShippedDate : DateTime read GetShippedDateValue write SetShippedDateValue; + property ShippedDateIsNull : Boolean read GetShippedDateIsNull write SetShippedDateIsNull; + property OldShippedDate : DateTime read GetOldShippedDateValue; + property OldShippedDateIsNull : Boolean read GetOldShippedDateIsNull; + property ShipVia : Integer read GetShipViaValue write SetShipViaValue; + property ShipViaIsNull : Boolean read GetShipViaIsNull write SetShipViaIsNull; + property OldShipVia : Integer read GetOldShipViaValue; + property OldShipViaIsNull : Boolean read GetOldShipViaIsNull; + property Freight : Float read GetFreightValue write SetFreightValue; + property FreightIsNull : Boolean read GetFreightIsNull write SetFreightIsNull; + property OldFreight : Float read GetOldFreightValue; + property OldFreightIsNull : Boolean read GetOldFreightIsNull; + property ShipName : WideString read GetShipNameValue write SetShipNameValue; + property ShipNameIsNull : Boolean read GetShipNameIsNull write SetShipNameIsNull; + property OldShipName : WideString read GetOldShipNameValue; + property OldShipNameIsNull : Boolean read GetOldShipNameIsNull; + property ShipAddress : WideString read GetShipAddressValue write SetShipAddressValue; + property ShipAddressIsNull : Boolean read GetShipAddressIsNull write SetShipAddressIsNull; + property OldShipAddress : WideString read GetOldShipAddressValue; + property OldShipAddressIsNull : Boolean read GetOldShipAddressIsNull; + property ShipCity : WideString read GetShipCityValue write SetShipCityValue; + property ShipCityIsNull : Boolean read GetShipCityIsNull write SetShipCityIsNull; + property OldShipCity : WideString read GetOldShipCityValue; + property OldShipCityIsNull : Boolean read GetOldShipCityIsNull; + property ShipRegion : WideString read GetShipRegionValue write SetShipRegionValue; + property ShipRegionIsNull : Boolean read GetShipRegionIsNull write SetShipRegionIsNull; + property OldShipRegion : WideString read GetOldShipRegionValue; + property OldShipRegionIsNull : Boolean read GetOldShipRegionIsNull; + property ShipPostalCode : WideString read GetShipPostalCodeValue write SetShipPostalCodeValue; + property ShipPostalCodeIsNull : Boolean read GetShipPostalCodeIsNull write SetShipPostalCodeIsNull; + property OldShipPostalCode : WideString read GetOldShipPostalCodeValue; + property OldShipPostalCodeIsNull : Boolean read GetOldShipPostalCodeIsNull; + property ShipCountry : WideString read GetShipCountryValue write SetShipCountryValue; + property ShipCountryIsNull : Boolean read GetShipCountryIsNull write SetShipCountryIsNull; + property OldShipCountry : WideString read GetOldShipCountryValue; + property OldShipCountryIsNull : Boolean read GetOldShipCountryIsNull; + + public + constructor Create(aBusinessProcessor: TDABusinessProcessor); override; + destructor Destroy; override; + + end; + +implementation + +uses + Variants, uROBinaryHelpers; + +{ TCustomersBusinessProcessorRules } +constructor TCustomersBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); +begin + inherited; +end; + +destructor TCustomersBusinessProcessorRules.Destroy; +begin + inherited; +end; + +function TCustomersBusinessProcessorRules.GetCustomerIDValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCustomerID]; +end; + +function TCustomersBusinessProcessorRules.GetCustomerIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCustomerID]); +end; + +function TCustomersBusinessProcessorRules.GetOldCustomerIDValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCustomerID]; +end; + +function TCustomersBusinessProcessorRules.GetOldCustomerIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCustomerID]); +end; + +procedure TCustomersBusinessProcessorRules.SetCustomerIDValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCustomerID] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetCustomerIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCustomerID] := Null; +end; + +function TCustomersBusinessProcessorRules.GetCompanyNameValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCompanyName]; +end; + +function TCustomersBusinessProcessorRules.GetCompanyNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCompanyName]); +end; + +function TCustomersBusinessProcessorRules.GetOldCompanyNameValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCompanyName]; +end; + +function TCustomersBusinessProcessorRules.GetOldCompanyNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCompanyName]); +end; + +procedure TCustomersBusinessProcessorRules.SetCompanyNameValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCompanyName] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetCompanyNameIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCompanyName] := Null; +end; + +function TCustomersBusinessProcessorRules.GetContactNameValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactName]; +end; + +function TCustomersBusinessProcessorRules.GetContactNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactName]); +end; + +function TCustomersBusinessProcessorRules.GetOldContactNameValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersContactName]; +end; + +function TCustomersBusinessProcessorRules.GetOldContactNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersContactName]); +end; + +procedure TCustomersBusinessProcessorRules.SetContactNameValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactName] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetContactNameIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactName] := Null; +end; + +function TCustomersBusinessProcessorRules.GetContactTitleValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactTitle]; +end; + +function TCustomersBusinessProcessorRules.GetContactTitleIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactTitle]); +end; + +function TCustomersBusinessProcessorRules.GetOldContactTitleValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersContactTitle]; +end; + +function TCustomersBusinessProcessorRules.GetOldContactTitleIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersContactTitle]); +end; + +procedure TCustomersBusinessProcessorRules.SetContactTitleValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactTitle] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetContactTitleIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactTitle] := Null; +end; + +function TCustomersBusinessProcessorRules.GetAddressValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersAddress]; +end; + +function TCustomersBusinessProcessorRules.GetAddressIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersAddress]); +end; + +function TCustomersBusinessProcessorRules.GetOldAddressValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersAddress]; +end; + +function TCustomersBusinessProcessorRules.GetOldAddressIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersAddress]); +end; + +procedure TCustomersBusinessProcessorRules.SetAddressValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersAddress] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetAddressIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersAddress] := Null; +end; + +function TCustomersBusinessProcessorRules.GetCityValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCity]; +end; + +function TCustomersBusinessProcessorRules.GetCityIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCity]); +end; + +function TCustomersBusinessProcessorRules.GetOldCityValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCity]; +end; + +function TCustomersBusinessProcessorRules.GetOldCityIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCity]); +end; + +procedure TCustomersBusinessProcessorRules.SetCityValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCity] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetCityIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCity] := Null; +end; + +function TCustomersBusinessProcessorRules.GetRegionValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersRegion]; +end; + +function TCustomersBusinessProcessorRules.GetRegionIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersRegion]); +end; + +function TCustomersBusinessProcessorRules.GetOldRegionValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersRegion]; +end; + +function TCustomersBusinessProcessorRules.GetOldRegionIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersRegion]); +end; + +procedure TCustomersBusinessProcessorRules.SetRegionValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersRegion] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetRegionIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersRegion] := Null; +end; + +function TCustomersBusinessProcessorRules.GetPostalCodeValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPostalCode]; +end; + +function TCustomersBusinessProcessorRules.GetPostalCodeIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPostalCode]); +end; + +function TCustomersBusinessProcessorRules.GetOldPostalCodeValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersPostalCode]; +end; + +function TCustomersBusinessProcessorRules.GetOldPostalCodeIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersPostalCode]); +end; + +procedure TCustomersBusinessProcessorRules.SetPostalCodeValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPostalCode] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetPostalCodeIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPostalCode] := Null; +end; + +function TCustomersBusinessProcessorRules.GetCountryValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCountry]; +end; + +function TCustomersBusinessProcessorRules.GetCountryIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCountry]); +end; + +function TCustomersBusinessProcessorRules.GetOldCountryValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCountry]; +end; + +function TCustomersBusinessProcessorRules.GetOldCountryIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCountry]); +end; + +procedure TCustomersBusinessProcessorRules.SetCountryValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCountry] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetCountryIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCountry] := Null; +end; + +function TCustomersBusinessProcessorRules.GetPhoneValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPhone]; +end; + +function TCustomersBusinessProcessorRules.GetPhoneIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPhone]); +end; + +function TCustomersBusinessProcessorRules.GetOldPhoneValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersPhone]; +end; + +function TCustomersBusinessProcessorRules.GetOldPhoneIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersPhone]); +end; + +procedure TCustomersBusinessProcessorRules.SetPhoneValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPhone] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetPhoneIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPhone] := Null; +end; + +function TCustomersBusinessProcessorRules.GetFaxValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersFax]; +end; + +function TCustomersBusinessProcessorRules.GetFaxIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersFax]); +end; + +function TCustomersBusinessProcessorRules.GetOldFaxValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersFax]; +end; + +function TCustomersBusinessProcessorRules.GetOldFaxIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersFax]); +end; + +procedure TCustomersBusinessProcessorRules.SetFaxValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersFax] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetFaxIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersFax] := Null; +end; + + +{ TOrdersBusinessProcessorRules } +constructor TOrdersBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); +begin + inherited; +end; + +destructor TOrdersBusinessProcessorRules.Destroy; +begin + inherited; +end; + +function TOrdersBusinessProcessorRules.GetOrderIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderID]; +end; + +function TOrdersBusinessProcessorRules.GetOrderIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderID]); +end; + +function TOrdersBusinessProcessorRules.GetOldOrderIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersOrderID]; +end; + +function TOrdersBusinessProcessorRules.GetOldOrderIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersOrderID]); +end; + +procedure TOrdersBusinessProcessorRules.SetOrderIDValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderID] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetOrderIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderID] := Null; +end; + +function TOrdersBusinessProcessorRules.GetCustomerIDValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersCustomerID]; +end; + +function TOrdersBusinessProcessorRules.GetCustomerIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersCustomerID]); +end; + +function TOrdersBusinessProcessorRules.GetOldCustomerIDValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersCustomerID]; +end; + +function TOrdersBusinessProcessorRules.GetOldCustomerIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersCustomerID]); +end; + +procedure TOrdersBusinessProcessorRules.SetCustomerIDValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersCustomerID] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetCustomerIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersCustomerID] := Null; +end; + +function TOrdersBusinessProcessorRules.GetEmployeeIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersEmployeeID]; +end; + +function TOrdersBusinessProcessorRules.GetEmployeeIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersEmployeeID]); +end; + +function TOrdersBusinessProcessorRules.GetOldEmployeeIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersEmployeeID]; +end; + +function TOrdersBusinessProcessorRules.GetOldEmployeeIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersEmployeeID]); +end; + +procedure TOrdersBusinessProcessorRules.SetEmployeeIDValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersEmployeeID] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetEmployeeIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersEmployeeID] := Null; +end; + +function TOrdersBusinessProcessorRules.GetOrderDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderDate]; +end; + +function TOrdersBusinessProcessorRules.GetOrderDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderDate]); +end; + +function TOrdersBusinessProcessorRules.GetOldOrderDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersOrderDate]; +end; + +function TOrdersBusinessProcessorRules.GetOldOrderDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersOrderDate]); +end; + +procedure TOrdersBusinessProcessorRules.SetOrderDateValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderDate] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetOrderDateIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderDate] := Null; +end; + +function TOrdersBusinessProcessorRules.GetRequiredDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersRequiredDate]; +end; + +function TOrdersBusinessProcessorRules.GetRequiredDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersRequiredDate]); +end; + +function TOrdersBusinessProcessorRules.GetOldRequiredDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersRequiredDate]; +end; + +function TOrdersBusinessProcessorRules.GetOldRequiredDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersRequiredDate]); +end; + +procedure TOrdersBusinessProcessorRules.SetRequiredDateValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersRequiredDate] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetRequiredDateIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersRequiredDate] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShippedDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShippedDate]; +end; + +function TOrdersBusinessProcessorRules.GetShippedDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShippedDate]); +end; + +function TOrdersBusinessProcessorRules.GetOldShippedDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShippedDate]; +end; + +function TOrdersBusinessProcessorRules.GetOldShippedDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShippedDate]); +end; + +procedure TOrdersBusinessProcessorRules.SetShippedDateValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShippedDate] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShippedDateIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShippedDate] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipViaValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipVia]; +end; + +function TOrdersBusinessProcessorRules.GetShipViaIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipVia]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipViaValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipVia]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipViaIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipVia]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipViaValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipVia] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipViaIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipVia] := Null; +end; + +function TOrdersBusinessProcessorRules.GetFreightValue: Float; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersFreight]; +end; + +function TOrdersBusinessProcessorRules.GetFreightIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersFreight]); +end; + +function TOrdersBusinessProcessorRules.GetOldFreightValue: Float; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersFreight]; +end; + +function TOrdersBusinessProcessorRules.GetOldFreightIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersFreight]); +end; + +procedure TOrdersBusinessProcessorRules.SetFreightValue(const aValue: Float); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersFreight] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetFreightIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersFreight] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipNameValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipName]; +end; + +function TOrdersBusinessProcessorRules.GetShipNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipName]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipNameValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipName]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipName]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipNameValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipName] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipNameIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipName] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipAddressValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipAddress]; +end; + +function TOrdersBusinessProcessorRules.GetShipAddressIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipAddress]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipAddressValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipAddress]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipAddressIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipAddress]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipAddressValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipAddress] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipAddressIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipAddress] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipCityValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCity]; +end; + +function TOrdersBusinessProcessorRules.GetShipCityIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCity]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipCityValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipCity]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipCityIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipCity]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipCityValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCity] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipCityIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCity] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipRegionValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipRegion]; +end; + +function TOrdersBusinessProcessorRules.GetShipRegionIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipRegion]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipRegionValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipRegion]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipRegionIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipRegion]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipRegionValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipRegion] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipRegionIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipRegion] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipPostalCodeValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipPostalCode]; +end; + +function TOrdersBusinessProcessorRules.GetShipPostalCodeIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipPostalCode]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipPostalCodeValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipPostalCode]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipPostalCodeIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipPostalCode]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipPostalCodeValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipPostalCode] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipPostalCodeIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipPostalCode] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipCountryValue: WideString; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCountry]; +end; + +function TOrdersBusinessProcessorRules.GetShipCountryIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCountry]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipCountryValue: WideString; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipCountry]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipCountryIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipCountry]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipCountryValue(const aValue: WideString); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCountry] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipCountryIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCountry] := Null; +end; + + +initialization + RegisterBusinessProcessorRules(RID_CustomersDelta, TCustomersBusinessProcessorRules); + RegisterBusinessProcessorRules(RID_OrdersDelta, TOrdersBusinessProcessorRules); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/ServerGlobal.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/ServerGlobal.pas new file mode 100644 index 0000000..2bbee06 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Processor/ServerGlobal.pas @@ -0,0 +1,15 @@ +unit ServerGlobal; + +interface +var + gCompany: string = 'Company'; + gCompanyCheck: Boolean = True; + gFreightCheck: Boolean = True; + gFreight: integer = 20; + gDeclineDeleteCustomers: Boolean = True; + gDeclineDeleteOrders: Boolean = True; + gCheckCustomerID: Boolean = True; +implementation + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.Sample.html new file mode 100644 index 0000000..5e87368 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.Sample.html @@ -0,0 +1,40 @@ + + + + + + + + + +

+ BusinessRulesScripts +

+ + +

Purpose

+

+ This example demonstrates how client side scripts can be modified on the server + and then downloaded to the client via a simple call. +

+

+ When you compile and launch the server, it displays a memo containing various client + side rules executed within event handlers such as BeforePost. +

+

+ You can test it by compiling and launching the client. Try deleting an + item with a gain > 90, for example. +

+

+ Next modify the server memo and click Refresh Scripts from Server + to see that your change has been actioned. +

+

+ Note how the strong typing allows simple reference to field names, thus + making script changes as simple as possible. +

+ + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.bdsgroup new file mode 100644 index 0000000..2245049 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + BusinessRulesScripts_Server.bdsproj + BusinessRulesScripts_Client.bdsproj + BusinessRulesScripts_Server.exe BusinessRulesScripts_Client.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.bpg new file mode 100644 index 0000000..12ab893 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = BusinessRulesScripts_Server.exe BusinessRulesScripts_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +BusinessRulesScripts_Server.exe: BusinessRulesScripts_Server.dpr + $(DCC) + +BusinessRulesScripts_Client.exe: BusinessRulesScripts_Client.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.groupproj new file mode 100644 index 0000000..181c87d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts.groupproj @@ -0,0 +1,40 @@ + + + {d1f18c23-83b8-4d53-bd98-adcf9fdf1af0} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScriptsLibrary.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScriptsLibrary.rodl new file mode 100644 index 0000000..003f8dc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScriptsLibrary.rodl @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScriptsLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScriptsLibrary_Intf.pas new file mode 100644 index 0000000..11fa2f4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScriptsLibrary_Intf.pas @@ -0,0 +1,95 @@ +unit BusinessRulesScriptsLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{E97481D6-EA65-4F8F-8CB0-128A20DA2B2C}'; + + { Service Interface ID's } + INewService_IID : TGUID = '{25DCCAE5-CA08-41B5-8DFC-03C4E548FE33}'; + + { Event ID's } + +type + { Forward declarations } + INewService = interface; + + + + + { INewService } + INewService = interface(IDataAbstractService) + ['{25DCCAE5-CA08-41B5-8DFC-03C4E548FE33}'] + function GetDatasetScripts(const DatasetNames: String): String; + end; + + { CoNewService } + CoNewService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): INewService; + end; + + { TNewService_Proxy } + TNewService_Proxy = class(TDataAbstractService_Proxy, INewService) + protected + function __GetInterfaceName:string; override; + + function GetDatasetScripts(const DatasetNames: String): String; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoNewService } + +class function CoNewService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): INewService; +begin + result := TNewService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TNewService_Proxy } + +function TNewService_Proxy.__GetInterfaceName:string; +begin + result := 'NewService'; +end; + +function TNewService_Proxy.GetDatasetScripts(const DatasetNames: String): String; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'BusinessRulesScriptsLibrary', __InterfaceName, 'GetDatasetScripts'); + __Message.Write('DatasetNames', TypeInfo(String), DatasetNames, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(String), result, []); + finally + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(INewService_IID, TNewService_Proxy); + + +finalization + UnregisterProxyClass(INewService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScriptsLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScriptsLibrary_Invk.pas new file mode 100644 index 0000000..07c636c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScriptsLibrary_Invk.pas @@ -0,0 +1,54 @@ +unit BusinessRulesScriptsLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} BusinessRulesScriptsLibrary_Intf; + +type + TNewService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + procedure Invoke_GetDatasetScripts(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TNewService_Invoker } + +procedure TNewService_Invoker.Invoke_GetDatasetScripts(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetDatasetScripts(const DatasetNames: String): String; } +var + DatasetNames: String; + lResult: String; +begin + try + __Message.Read('DatasetNames', TypeInfo(String), DatasetNames, []); + + lResult := (__Instance as INewService).GetDatasetScripts(DatasetNames); + + __Message.InitializeResponseMessage(__Transport, 'BusinessRulesScriptsLibrary', 'NewService', 'GetDatasetScriptsResponse'); + __Message.Write('Result', TypeInfo(String), lResult, []); + __Message.Finalize; + + finally + end; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.bdsproj new file mode 100644 index 0000000..3727fb3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + BusinessRulesScripts_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.dpr new file mode 100644 index 0000000..49b86b7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.dpr @@ -0,0 +1,17 @@ +program BusinessRulesScripts_Client; + +uses + uROComInit, + Forms, + BusinessRulesScripts_ClientMain in 'BusinessRulesScripts_ClientMain.pas' {BusinessRulesScripts_ClientMainForm}, + BusinessRulesScripts_ClientData in 'BusinessRulesScripts_ClientData.pas' {BusinessRulesScripts_ClientDataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'BusinessRulesScripts Client'; + Application.CreateForm(TBusinessRulesScripts_ClientDataModule, BusinessRulesScripts_ClientDataModule); + Application.CreateForm(TBusinessRulesScripts_ClientMainForm, BusinessRulesScripts_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.dproj new file mode 100644 index 0000000..71f4c0d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.dproj @@ -0,0 +1,75 @@ + + + {d6188ece-37af-4464-a5cb-347a71598f81} + BusinessRulesScripts_Client.dpr + Debug + AnyCPU + DCC32 + BusinessRulesScripts_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + BusinessRulesScripts_Client.dpr + + + + + + + MainSource + + +
BusinessRulesScripts_ClientDataModule
+
+ +
BusinessRulesScripts_ClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Client.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientData.dfm new file mode 100644 index 0000000..f4415e5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientData.dfm @@ -0,0 +1,386 @@ +object BusinessRulesScripts_ClientDataModule: TBusinessRulesScripts_ClientDataModule + OldCreateOrder = True + Left = 447 + Top = 246 + Height = 382 + Width = 300 + object ROChannel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object ROMessage: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'NewService' + Left = 41 + Top = 96 + end + object BinDataStreamer: TDABinDataStreamer + Left = 40 + Top = 142 + end + object dtProducts: TDACDSDataTable + ScriptingProvider = DAPSScriptingProvider + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ProductID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ProductName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'SupplierID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CategoryID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'QuantityPerUnit' + DataType = datWideString + Size = 20 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitPrice' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitsInStock' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitsOnOrder' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ReorderLevel' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Discontinued' + DataType = datBoolean + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Gain' + DataType = datFloat + BlobType = dabtUnknown + LogChanges = False + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = True + Lookup = False + LookupCache = False + end> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soIgnoreStreamSchema, soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Products' + IndexDefs = <> + Left = 128 + Top = 160 + end + object dsProducts: TDADataSource + DataSet = dtProducts.Dataset + DataTable = dtProducts + Left = 127 + Top = 187 + end + object DAPSScriptingProvider: TDAPSScriptingProvider + ScriptEngine.CompilerOptions = [icAllowNoBegin, icAllowNoEnd, icBooleanShortCircuit] + ScriptEngine.Plugins = < + item + Plugin = DAPSScriptingProvider.PluginClasses + end + item + Plugin = DAPSScriptingProvider.PluginDB + end + item + Plugin = DAPSScriptingProvider.PluginDateUtils + end> + ScriptEngine.UsePreProcessor = False + Left = 128 + Top = 256 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetSchemaCall.MethodName = 'GetSchema' + GetSchemaCall.Params = < + item + Name = 'aFilter' + DataType = rtString + Flag = fIn + Value = Null + end + item + Name = 'Result' + DataType = rtString + Flag = fResult + Value = Null + end> + GetSchemaCall.Default = False + GetSchemaCall.IncomingSchemaParameter = 'Result' + GetSchemaCall.OutgoingFilterParameter = 'aFilter' + GetDataCall.RemoteService = RemoteService + GetDataCall.MethodName = 'GetData' + GetDataCall.Params = < + item + Name = 'aTableNameArray' + DataType = rtUserDefined + Flag = fIn + TypeName = 'StringArray' + Value = Null + end + item + Name = 'aTableRequestInfoArray' + DataType = rtUserDefined + Flag = fIn + TypeName = 'TableRequestInfoArray' + Value = Null + end + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end> + GetDataCall.Default = False + GetDataCall.OutgoingTableNamesParameter = 'aTableNameArray' + GetDataCall.OutgoingTableRequestInfosParameter = 'aTableRequestInfoArray' + GetDataCall.IncomingDataParameter = 'Result' + UpdateDataCall.RemoteService = RemoteService + UpdateDataCall.MethodName = 'UpdateData' + UpdateDataCall.Params = < + item + Name = 'aDelta' + DataType = rtBinary + Flag = fIn + end + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + end> + UpdateDataCall.Default = False + UpdateDataCall.OutgoingDeltaParameter = 'aDelta' + UpdateDataCall.IncomingDeltaParameter = 'Result' + GetScriptsCall.RemoteService = RemoteService + GetScriptsCall.MethodName = 'GetDatasetScripts' + GetScriptsCall.Params = < + item + Name = 'Result' + DataType = rtString + Flag = fResult + end + item + Name = 'DatasetNames' + DataType = rtString + Flag = fIn + Value = Null + end> + GetScriptsCall.Default = False + GetScriptsCall.OutgoingTableNamesParameter = 'DatasetNames' + GetScriptsCall.IncomingScriptParameter = 'Result' + RemoteService = RemoteService + DataStreamer = BinDataStreamer + AutoFillScripts = True + Left = 128 + Top = 103 + end + object dtOrderDetails: TDACDSDataTable + ScriptingProvider = DAPSScriptingProvider + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ProductName' + DataType = datString + Size = 50 + BlobType = dabtUnknown + LogChanges = False + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = True + LookupSource = dsProducts + LookupKeyFields = 'ProductID' + LookupResultField = 'ProductName' + KeyFields = 'ProductID' + LookupCache = True + end + item + Name = 'ProductID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Visible = False + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitPrice' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Quantity' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Discount' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayFormat = '0.##' + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Gain' + DataType = datFloat + BlobType = dabtUnknown + LogChanges = False + DisplayWidth = 0 + DisplayFormat = '0.##' + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = True + Lookup = False + LookupCache = False + end> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soIgnoreStreamSchema, soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'OrderDetails' + IndexDefs = <> + Left = 157 + Top = 159 + end + object dsOrderDetails: TDADataSource + DataSet = dtOrderDetails.Dataset + DataTable = dtOrderDetails + Left = 158 + Top = 188 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientData.pas new file mode 100644 index 0000000..3a2634c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientData.pas @@ -0,0 +1,37 @@ +unit BusinessRulesScripts_ClientData; + +interface + +uses {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, uDAInterfaces, + uDAScriptingProvider, uDACDSDataTable, + uDAPSScriptingProvider, uDADataStreamer, uDARemoteDataAdapter; + +type + TBusinessRulesScripts_ClientDataModule = class(TDataModule) + ROMessage: TROBinMessage; + ROChannel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + BinDataStreamer: TDABinDataStreamer; + dtProducts: TDACDSDataTable; + dsProducts: TDADataSource; + DAPSScriptingProvider: TDAPSScriptingProvider; + RemoteDataAdapter: TDARemoteDataAdapter; + dtOrderDetails: TDACDSDataTable; + dsOrderDetails: TDADataSource; + private + { Private declarations } + public + { Public declarations } + end; + +var + BusinessRulesScripts_ClientDataModule: TBusinessRulesScripts_ClientDataModule; + +implementation + +{$R *.dfm} + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientMain.dfm new file mode 100644 index 0000000..09aec1d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientMain.dfm @@ -0,0 +1,79 @@ +object BusinessRulesScripts_ClientMainForm: TBusinessRulesScripts_ClientMainForm + Left = 163 + Top = 30 + AutoScroll = False + BorderWidth = 5 + Caption = 'Business Rules Script Client' + ClientHeight = 316 + ClientWidth = 565 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object BitBtn1: TBitBtn + Left = 0 + Top = 0 + Width = 169 + Height = 25 + Caption = 'Refresh Scripts from Server' + TabOrder = 0 + OnClick = BitBtn1Click + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000120B0000120B00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFA467698E5D598E5D598E5D598E5D598E5D598E + 5D598E5D598E5D598E5D598E5D598E5D5980504BFF00FFFF00FFFF00FFA46769 + FCEACEF3DABCF2D5B1F0D0A7EECB9EEDC793EDC28BE9BD81E9BD7FE9BD7FEFC4 + 8180504BFF00FFFF00FFFF00FFA0675BFEEFDAF6E0C6F2DABCF2D5B2C1C18800 + 7000007000BDB672E9BD82E9BD7FEFC48180504BFF00FFFF00FFFF00FFA0675B + FFF4E5F7E5CF007000C4CA97007000C2C187C0BD80007000BDB66FEABF81EFC4 + 8080504BFF00FFFF00FFFF00FFA7756BFFFBF0F8EADC007000007000C4C998F2 + D5B1F0D0A9BFBD80007000EBC28AEFC58380504BFF00FFFF00FFFF00FFA7756B + FFFFFCFAF0E6007000007000007000F2DABAF2D5B1F0D0A7EECB9DEBC793F2C9 + 8C80504BFF00FFFF00FFFF00FFBC8268FFFFFFFEF7F2FAEFE6F8EAD9F7E3CFF6 + E0C5007000007000007000EECC9EF3CE9780504BFF00FFFF00FFFF00FFBC8268 + FFFFFFFFFEFC007000CADABAF7EADAF6E3CFC5CE9F007000007000F0D0A6F6D3 + A080504BFF00FFFF00FFFF00FFD1926DFFFFFFFFFFFFCEE7CC007000CADAB8C9 + D7B0007000C6CC9E007000F4D8B1EBCFA480504BFF00FFFF00FFFF00FFD1926D + FFFFFFFFFFFFFFFFFFCEE7CC007000007000C9D5B0F8E7D1FBEACEDECEB4B6AA + 9380504BFF00FFFF00FFFF00FFDA9D75FFFFFFFFFFFFFFFFFFFFFFFFFFFEFCFC + F6EFFCF3E6EDD8C9A0675BA0675BA0675BA0675BFF00FFFF00FFFF00FFDA9D75 + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFBFFFEF7DAC1BAA0675BE19E55E68F + 31B56D4DFF00FFFF00FFFF00FFE7AB79FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFDCC7C5A0675BF8B55CBF7A5CFF00FFFF00FFFF00FFFF00FFE7AB79 + FBF4F0FBF4EFFAF3EFFAF3EFF8F2EFF7F2EFF7F2EFD8C2C0A0675BC1836CFF00 + FFFF00FFFF00FFFF00FFFF00FFE7AB79CF8E68CF8E68CF8E68CF8E68CF8E68CF + 8E68CF8E68CF8E68A0675BFF00FFFF00FFFF00FFFF00FFFF00FF} + end + object gOrderDetails: TDBGrid + Left = 0 + Top = 33 + Width = 565 + Height = 283 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = BusinessRulesScripts_ClientDataModule.dsOrderDetails + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'Tahoma' + TitleFont.Style = [] + end + object DBNavigator1: TDBNavigator + Left = 176 + Top = 0 + Width = 370 + Height = 25 + DataSource = BusinessRulesScripts_ClientDataModule.dsOrderDetails + TabOrder = 2 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientMain.pas new file mode 100644 index 0000000..61142e6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ClientMain.pas @@ -0,0 +1,45 @@ +unit BusinessRulesScripts_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROIndyHTTPChannel, + Buttons, ExtCtrls, DBCtrls, Grids, DBGrids; + +type + TBusinessRulesScripts_ClientMainForm = class(TForm) + BitBtn1: TBitBtn; + gOrderDetails: TDBGrid; + DBNavigator1: TDBNavigator; + procedure BitBtn1Click(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + BusinessRulesScripts_ClientMainForm: TBusinessRulesScripts_ClientMainForm; + +implementation + +uses + BusinessRulesScripts_ClientData; + +{$R *.dfm} + +procedure TBusinessRulesScripts_ClientMainForm.BitBtn1Click(Sender: TObject); +begin + BusinessRulesScripts_ClientDataModule.dtOrderDetails.LoadScript(); + gOrderDetails.Refresh(); +end; + +procedure TBusinessRulesScripts_ClientMainForm.FormCreate(Sender: TObject); +begin + BusinessRulesScripts_ClientDataModule.dtOrderDetails.Open(); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.bdsproj new file mode 100644 index 0000000..98c5c99 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + BusinessRulesScripts_Server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.dpr new file mode 100644 index 0000000..22834ce --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.dpr @@ -0,0 +1,23 @@ +program BusinessRulesScripts_Server; + +{#ROGEN:BusinessRulesScriptsLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + BusinessRulesScripts_ServerMain in 'BusinessRulesScripts_ServerMain.pas' {BusinessRulesScripts_ServerMainForm}, + BusinessRulesScripts_ServerData in 'BusinessRulesScripts_ServerData.pas' {BusinessRulesScripts_ServerDataModule: TDataModule}, + BusinessRulesScriptsLibrary_Intf in 'BusinessRulesScriptsLibrary_Intf.pas', + BusinessRulesScriptsLibrary_Invk in 'BusinessRulesScriptsLibrary_Invk.pas', + NewService_Impl in 'NewService_Impl.pas' {NewService: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'BusinessRulesScripts Server'; + Application.CreateForm(TBusinessRulesScripts_ServerDataModule, BusinessRulesScripts_ServerDataModule); + Application.CreateForm(TBusinessRulesScripts_ServerMainForm, BusinessRulesScripts_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.dproj new file mode 100644 index 0000000..bffa2c6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.dproj @@ -0,0 +1,80 @@ + + + {61f4e143-e541-455f-bfd4-108c7175e3aa} + BusinessRulesScripts_Server.dpr + Debug + AnyCPU + DCC32 + BusinessRulesScripts_Server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + BusinessRulesScripts_Server.dpr + + + + + + + MainSource + + + + +
BusinessRulesScripts_ServerDataModule
+
+ +
BusinessRulesScripts_ServerMainForm
+
+ +
NewService
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_Server.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerData.dfm new file mode 100644 index 0000000..d8371c2 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerData.dfm @@ -0,0 +1,336 @@ +object BusinessRulesScripts_ServerDataModule: TBusinessRulesScripts_ServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 340 + Top = 54 + Height = 399 + Width = 342 + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object ROMessage: TROBinMessage + Left = 34 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object Schema: TDASchema + ConnectionManager = ConnectionManager + DataDictionary = DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Products' + SQL = + 'SELECT '#10' ProductID, ProductName, SupplierID, CategoryID, Quan' + + 'tityPerUnit, '#10' UnitPrice, UnitsInStock, UnitsOnOrder, Reorder' + + 'Level, '#10' Discontinued'#10' FROM'#10' Products' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ProductID' + TableField = 'ProductID' + end + item + DatasetField = 'ProductName' + TableField = 'ProductName' + end + item + DatasetField = 'SupplierID' + TableField = 'SupplierID' + end + item + DatasetField = 'CategoryID' + TableField = 'CategoryID' + end + item + DatasetField = 'QuantityPerUnit' + TableField = 'QuantityPerUnit' + end + item + DatasetField = 'UnitPrice' + TableField = 'UnitPrice' + end + item + DatasetField = 'UnitsInStock' + TableField = 'UnitsInStock' + end + item + DatasetField = 'UnitsOnOrder' + TableField = 'UnitsOnOrder' + end + item + DatasetField = 'ReorderLevel' + TableField = 'ReorderLevel' + end + item + DatasetField = 'Discontinued' + TableField = 'Discontinued' + end> + end> + Name = 'Products' + Fields = < + item + Name = 'ProductID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ProductName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'SupplierID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CategoryID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'QuantityPerUnit' + DataType = datWideString + Size = 20 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitPrice' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitsInStock' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitsOnOrder' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ReorderLevel' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Discontinued' + DataType = datBoolean + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'OrderDetails' + SQL = + 'SELECT '#10' OrderID, ProductID, UnitPrice, Quantity, Discount'#10' ' + + 'FROM'#10' [Order Details]' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'ProductID' + TableField = 'ProductID' + end + item + DatasetField = 'UnitPrice' + TableField = 'UnitPrice' + end + item + DatasetField = 'Quantity' + TableField = 'Quantity' + end + item + DatasetField = 'Discount' + TableField = 'Discount' + end> + end> + Name = 'OrderDetails' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ProductID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitPrice' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Quantity' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Discount' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.Script = + 'procedure BeforeDelete;'#10'begin'#10' if Gain > 50 then'#10' RaiseError' + + '('#39'Cannot delete orders that make us more then 50$'#39');'#10'end;'#10#10'pro' + + 'cedure BeforePost;'#10'begin'#10' if VarIsNull(ProductID) then'#10' Rais' + + 'eError('#39'Please specify a name.'#39');'#10' '#10' if Quantity < 1 then'#10' ' + + ' RaiseError('#39'Quantity can not be less 1 !'#39');'#10#10' if UnitPrice < ' + + '10 then'#10' Quantity := 10;'#10'end;'#10#10'procedure OnCalcFields;'#10'begin'#10 + + ' Gain := UnitPrice*Quantity*(1-Discount);'#10'end;'#10#10'procedure OnNew' + + 'Record;'#10'begin'#10' Quantity := 1;'#10'end;' + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 43 + Top = 150 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 40 + Top = 200 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerData.pas new file mode 100644 index 0000000..6e4f778 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerData.pas @@ -0,0 +1,39 @@ +unit BusinessRulesScripts_ServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDADriverManager, uDAClasses, uDAEngine, uDAADODriver, uROIndyTCPServer, + uDADataTable, uDABINAdapter; + +type + TBusinessRulesScripts_ServerDataModule = class(TDataModule) + ROServer: TROIndyHTTPServer; + ROMessage: TROBinMessage; + DriverManager: TDADriverManager; + ConnectionManager: TDAConnectionManager; + Schema: TDASchema; + DataDictionary: TDADataDictionary; + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + BusinessRulesScripts_ServerDataModule: TBusinessRulesScripts_ServerDataModule; + +implementation + +{$R *.dfm} + +procedure TBusinessRulesScripts_ServerDataModule.DataModuleCreate(Sender: TObject); +begin + ROServer.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerMain.dfm new file mode 100644 index 0000000..6975a5e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerMain.dfm @@ -0,0 +1,40 @@ +object BusinessRulesScripts_ServerMainForm: TBusinessRulesScripts_ServerMainForm + Left = 90 + Top = 79 + AutoScroll = False + BorderWidth = 5 + Caption = 'Business Rules Scripts Server' + ClientHeight = 406 + ClientWidth = 614 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 0 + Top = 0 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object ed_Script: TMemo + Left = 0 + Top = 54 + Width = 614 + Height = 352 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ScrollBars = ssVertical + TabOrder = 0 + OnChange = ed_ScriptChange + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerMain.pas new file mode 100644 index 0000000..4c13c25 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/BusinessRulesScripts_ServerMain.pas @@ -0,0 +1,45 @@ +unit BusinessRulesScripts_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer; + +type + TBusinessRulesScripts_ServerMainForm = class(TForm) + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + ed_Script: TMemo; + procedure FormCreate(Sender: TObject); + procedure ed_ScriptChange(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + BusinessRulesScripts_ServerMainForm: TBusinessRulesScripts_ServerMainForm; + +implementation + +uses + BusinessRulesScripts_ServerData; + +{$R *.dfm} + +procedure TBusinessRulesScripts_ServerMainForm.FormCreate(Sender: TObject); +begin + with BusinessRulesScripts_ServerDataModule.Schema.Datasets.DatasetByName('OrderDetails').BusinessRulesClient do + ed_Script.Text := StringReplace(Script, #10, sLineBreak, [rfReplaceAll]); +end; + +procedure TBusinessRulesScripts_ServerMainForm.ed_ScriptChange(Sender: TObject); +begin + with BusinessRulesScripts_ServerDataModule.Schema.Datasets.DatasetByName('OrderDetails').BusinessRulesClient do + Script := ed_Script.Text; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/NewService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/NewService_Impl.dfm new file mode 100644 index 0000000..3cac002 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/NewService_Impl.dfm @@ -0,0 +1,15 @@ +object NewService: TNewService + OldCreateOrder = True + AcquireConnection = True + ServiceSchema = BusinessRulesScripts_ServerDataModule.Schema + ServiceDataStreamer = BinDataStreamer + ExportedDataTables = <> + Left = 188 + Top = 181 + Height = 150 + Width = 205 + object BinDataStreamer: TDABinDataStreamer + Left = 33 + Top = 18 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/NewService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/NewService_Impl.pas new file mode 100644 index 0000000..51b6c4f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/NewService_Impl.pas @@ -0,0 +1,45 @@ +unit NewService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} BusinessRulesScriptsLibrary_Intf, uDADataStreamer, + uDABinAdapter,uDAInterfaces; + +type + { TNewService } + TNewService = class(TDataAbstractService, INewService) + BinDataStreamer: TDABinDataStreamer; + private + protected + end; + +implementation + +{$R *.dfm} +uses + {Generated:} BusinessRulesScriptsLibrary_Invk, BusinessRulesScripts_ServerData,TypInfo; + +procedure Create_NewService(out anInstance: IUnknown); +begin + anInstance := TNewService.Create(nil); +end; + +initialization + TROClassFactory.Create('NewService', Create_NewService, TNewService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/RODLFILE.res new file mode 100644 index 0000000..53e3ab7 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Business Rules Scripts/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.Sample.html new file mode 100644 index 0000000..2d8151b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.Sample.html @@ -0,0 +1,31 @@ + + + + + + + + +

+ Calculated Fields Example +

+

Purpose

+

+ This example shows how to handle calculated fields server side and client + side. +

+

Examine the Code

+

+ Server side fields are processed via the BinAdapter's OnWriteFieldValue + event handler (see CalcFieldsService_Impl). +

+

+ On the client side, they are handled as you would expect via dtCustomers.OnCalcFields + (see CalcFields_ClientData). Note though, how the client field actually references + the server value. +

+ + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.bdsgroup new file mode 100644 index 0000000..9fa715f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + CalcFields_Server.bdsproj + CalcFields_Client.bdsproj + CalcFields_Server.exe CalcFields_Client.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.bpg new file mode 100644 index 0000000..024afdc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = CalcFields_Server.exe CalcFields_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +CalcFields_Client.exe: CalcFields_Client.dpr + $(DCC) + +CalcFields_Server.exe: CalcFields_Server.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.groupproj new file mode 100644 index 0000000..f6d8ad4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields.groupproj @@ -0,0 +1,40 @@ + + + {70b86ab1-4399-4031-8bb6-28a50d072647} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsLibrary.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsLibrary.rodl new file mode 100644 index 0000000..d2b0b72 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsLibrary.rodl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsLibrary_Intf.pas new file mode 100644 index 0000000..63bfd01 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsLibrary_Intf.pas @@ -0,0 +1,82 @@ +unit CalcFieldsLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{A54F3492-C4C5-4161-8536-FE04F7DE88E5}'; + TargetNamespace = ''; + + { Service Interface ID's } + ICalcFieldsService_IID : TGUID = '{7113FC5C-4AB9-4583-B4E6-5F7F5A975E0A}'; + + { Event ID's } + +type + { Forward declarations } + ICalcFieldsService = interface; + + + + + + { Enumerateds } + + { ICalcFieldsService } + ICalcFieldsService = interface(IDataAbstractService) + ['{7113FC5C-4AB9-4583-B4E6-5F7F5A975E0A}'] + end; + + { CoCalcFieldsService } + CoCalcFieldsService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ICalcFieldsService; + end; + + { TCalcFieldsService_Proxy } + TCalcFieldsService_Proxy = class(TDataAbstractService_Proxy, ICalcFieldsService) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoCalcFieldsService } + +class function CoCalcFieldsService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ICalcFieldsService; +begin + result := TCalcFieldsService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TCalcFieldsService_Proxy.__GetInterfaceName:string; +begin + result := 'CalcFieldsService'; +end; + +initialization + RegisterProxyClass(ICalcFieldsService_IID, TCalcFieldsService_Proxy); + + +finalization + UnregisterProxyClass(ICalcFieldsService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsLibrary_Invk.pas new file mode 100644 index 0000000..e3e62a2 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsLibrary_Invk.pas @@ -0,0 +1,35 @@ +unit CalcFieldsLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} CalcFieldsLibrary_Intf; + +type + TCalcFieldsService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsService_Impl.dfm new file mode 100644 index 0000000..2d9dc08 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsService_Impl.dfm @@ -0,0 +1,83 @@ +object CalcFieldsService: TCalcFieldsService + OldCreateOrder = True + OnCreate = DataAbstractServiceCreate + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Height = 300 + Width = 300 + object DataStreamer: TDABin2DataStreamer + OnWriteFieldValue = DataStreamerWriteFieldValue + Left = 32 + Top = 8 + end + object Schema: TDASchema + ConnectionManager = CalcFields_ServerDataForm.ConnectionManager + DataDictionary = DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = 'SELECT '#10' CustomerID, CompanyName'#10#10' FROM'#10' Customers'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ServerCalculated' + TableField = '' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + InPrimaryKey = True + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + end + item + Name = 'ServerCalculated' + DataType = datInteger + LogChanges = False + ReadOnly = True + ServerCalculated = True + end> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 32 + Top = 56 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 103 + end + object bpCustomers: TDABusinessProcessor + Schema = Schema + ReferencedDataset = 'Customers' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete, poPrepareCommands] + UpdateMode = updWhereKeyOnly + Left = 112 + Top = 56 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsService_Impl.pas new file mode 100644 index 0000000..66b73ec --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFieldsService_Impl.pas @@ -0,0 +1,75 @@ +unit CalcFieldsService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} CalcFieldsLibrary_Intf, uDAScriptingProvider, + uDABusinessProcessor, uDAInterfaces, uDAClasses, uDADataStreamer, + uDABin2DataStreamer; + +const + { Dataset names for Schema } + ds_Customers = 'Customers'; + +type + { TCalcFieldsService } + TCalcFieldsService = class(TDataAbstractService, ICalcFieldsService) + DataStreamer: TDABin2DataStreamer; + bpCustomers: TDABusinessProcessor; + Schema: TDASchema; + DataDictionary: TDADataDictionary; + procedure DataStreamerWriteFieldValue(const aField: TDAField; + var Value: Variant); + procedure DataAbstractServiceCreate(Sender: TObject); + private + fNextCalcValue: Integer; + protected + end; + +implementation + +{$R *.dfm} +uses + {Generated:} CalcFieldsLibrary_Invk, CalcFields_ServerData; + +procedure Create_CalcFieldsService(out anInstance: IUnknown); +begin + anInstance := TCalcFieldsService.Create(nil); +end; + +{ CalcFieldsService } + +procedure TCalcFieldsService.DataStreamerWriteFieldValue( + const aField: TDAField; var Value: Variant); +begin + if SameText(aField.Name, 'ServerCalculated') then + begin + Value := fNextCalcValue; + Inc(fNextCalcValue); + end; +end; + +procedure TCalcFieldsService.DataAbstractServiceCreate(Sender: TObject); +begin + inherited; + fNextCalcValue := 100; +end; + +initialization + TROClassFactory.Create('CalcFieldsService', Create_CalcFieldsService, TCalcFieldsService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.bdsproj new file mode 100644 index 0000000..5415a64 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + CalcFields_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.dpr new file mode 100644 index 0000000..b5f93c5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.dpr @@ -0,0 +1,17 @@ +program CalcFields_Client; + +uses + uROComInit, + Forms, + CalcFields_ClientMain in 'CalcFields_ClientMain.pas' {CalcFields_ClientMainForm}, + CalcFields_ClientData in 'CalcFields_ClientData.pas' {CalcFields_ClientDataForm: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'CalcFields - Client'; + Application.CreateForm(TCalcFields_ClientDataForm, CalcFields_ClientDataForm); + Application.CreateForm(TCalcFields_ClientMainForm, CalcFields_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.dproj new file mode 100644 index 0000000..b9f6c7d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.dproj @@ -0,0 +1,75 @@ + + + {507351df-1ced-4f28-becd-e7e287bd9083} + CalcFields_Client.dpr + Debug + AnyCPU + DCC32 + CalcFields_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + CalcFields_Client.dpr + + + + + + + MainSource + + +
CalcFields_ClientDataForm
+
+ +
CalcFields_ClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.res new file mode 100644 index 0000000..cd90391 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Client.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientData.dfm new file mode 100644 index 0000000..243d2aa --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientData.dfm @@ -0,0 +1,88 @@ +object CalcFields_ClientDataForm: TCalcFields_ClientDataForm + OldCreateOrder = True + OnCreate = DataModuleCreate + Height = 300 + Width = 300 + object ROChannel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 42 + Top = 10 + end + object ROMessage: TROBinMessage + Left = 41 + Top = 52 + end + object RORemoteService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'CalcFieldsService' + Left = 40 + Top = 95 + end + object DARemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RORemoteService + GetDataCall.RemoteService = RORemoteService + UpdateDataCall.RemoteService = RORemoteService + GetScriptsCall.RemoteService = RORemoteService + RemoteService = RORemoteService + DataStreamer = DataStreamer + Left = 128 + Top = 82 + end + object DataStreamer: TDABin2DataStreamer + Left = 40 + Top = 144 + end + object tbl_Customers: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + InPrimaryKey = True + OnChange = tbl_CustomersCustomerIDChange + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + OnChange = tbl_CustomersCompanyNameChange + end + item + Name = 'ServerCalculated' + DataType = datInteger + LogChanges = False + ReadOnly = True + ServerCalculated = True + end + item + Name = 'ClientCalculated' + DataType = datString + Size = 50 + LogChanges = False + DisplayWidth = 50 + ReadOnly = True + Calculated = True + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = DARemoteDataAdapter + OnCalcFields = tbl_CustomersCalcFields + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 136 + Top = 136 + end + object ds_Customers: TDADataSource + DataSet = tbl_Customers.Dataset + DataTable = tbl_Customers + Left = 168 + Top = 136 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientData.pas new file mode 100644 index 0000000..178fcdd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientData.pas @@ -0,0 +1,66 @@ +unit CalcFields_ClientData; + +interface + +uses {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, uDAInterfaces, + uDACDSDataTable, uDAScriptingProvider, + uDARemoteDataAdapter, uDADataStreamer, uROIndyTCPChannel, + uROIndyHTTPChannel, uDABin2DataStreamer, uDAMemDataTable; + +type + TCalcFields_ClientDataForm = class(TDataModule) + ROMessage: TROBinMessage; + ROChannel: TROWinInetHTTPChannel; + RORemoteService: TRORemoteService; + DARemoteDataAdapter: TDARemoteDataAdapter; + DataStreamer: TDABin2DataStreamer; + tbl_Customers: TDAMemDataTable; + ds_Customers: TDADataSource; + procedure DataModuleCreate(Sender: TObject); + procedure tbl_CustomersCustomerIDChange(Sender: TDACustomField); + procedure tbl_CustomersCompanyNameChange(Sender: TDACustomField); + procedure tbl_CustomersCalcFields(DataTable: TDADataTable); + private + { Private declarations } + public + { Public declarations } + end; + +var + CalcFields_ClientDataForm: TCalcFields_ClientDataForm; + +implementation +{$R *.dfm} + +procedure TCalcFields_ClientDataForm.tbl_CustomersCalcFields( + DataTable: TDADataTable); +begin + if DataTable.FieldByName('ServerCalculated').IsNULL then + DataTable.FieldByName('ClientCalculated').AsString := '' + else + DataTable.FieldByName('ClientCalculated').AsString := + 'Got #' + DataTable.FieldByName('ServerCalculated').AsString; +end; + +procedure TCalcFields_ClientDataForm.tbl_CustomersCompanyNameChange( + Sender: TDACustomField); +begin + Beep; +end; + +procedure TCalcFields_ClientDataForm.tbl_CustomersCustomerIDChange( + Sender: TDACustomField); +begin + Beep; +end; + +procedure TCalcFields_ClientDataForm.DataModuleCreate(Sender: TObject); +begin + DARemoteDataAdapter.SetupDefaultRequest; +end; + +initialization +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientMain.dfm new file mode 100644 index 0000000..b5b48a0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientMain.dfm @@ -0,0 +1,56 @@ +object CalcFields_ClientMainForm: TCalcFields_ClientMainForm + Left = 243 + Top = 213 + Width = 420 + Height = 311 + BorderWidth = 5 + Caption = 'CalcFields - Client' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 178 + Top = 0 + Width = 212 + Height = 48 + Cursor = crHandPoint + Anchors = [akTop, akRight] + ApplicationType = atClient + end + object OpenCloseButton: TButton + Left = 0 + Top = 0 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 0 + OnClick = OpenCloseButtonClick + end + object gCustomers: TDBGrid + Left = 0 + Top = 53 + Width = 394 + Height = 212 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = CalcFields_ClientDataForm.ds_Customers + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object ApplyUpdatesButton: TButton + Left = 80 + Top = 0 + Width = 89 + Height = 25 + Caption = 'Apply Updates' + TabOrder = 2 + OnClick = ApplyUpdatesButtonClick + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientMain.pas new file mode 100644 index 0000000..5f9701f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ClientMain.pas @@ -0,0 +1,45 @@ +unit CalcFields_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROIndyHTTPChannel, + Grids, DBGrids, uROPoweredByRemObjectsButton; + +type + TCalcFields_ClientMainForm = class(TForm) + OpenCloseButton: TButton; + gCustomers: TDBGrid; + ApplyUpdatesButton: TButton; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + procedure OpenCloseButtonClick(Sender: TObject); + procedure ApplyUpdatesButtonClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + CalcFields_ClientMainForm: TCalcFields_ClientMainForm; + +implementation + +uses CalcFields_ClientData; + +{$R *.dfm} + +procedure TCalcFields_ClientMainForm.OpenCloseButtonClick(Sender: TObject); +begin + with CalcFields_ClientDataForm do + tbl_Customers.Active := not tbl_Customers.Active; +end; + +procedure TCalcFields_ClientMainForm.ApplyUpdatesButtonClick(Sender: TObject); +begin + CalcFields_ClientDataForm.tbl_Customers.ApplyUpdates(True) +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.bdsproj new file mode 100644 index 0000000..e42d0d9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + CalcFields_Server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.dpr new file mode 100644 index 0000000..6a5f57f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.dpr @@ -0,0 +1,23 @@ +program CalcFields_Server; + +{#ROGEN:CalcFieldsLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + CalcFields_ServerMain in 'CalcFields_ServerMain.pas' {CalcFields_ServerMainForm}, + CalcFields_ServerData in 'CalcFields_ServerData.pas' {CalcFields_ServerDataForm: TDataModule}, + CalcFieldsLibrary_Intf in 'CalcFieldsLibrary_Intf.pas', + CalcFieldsLibrary_Invk in 'CalcFieldsLibrary_Invk.pas', + CalcFieldsService_Impl in 'CalcFieldsService_Impl.pas' {CalcFieldsService: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'CalcFields - Server'; + Application.CreateForm(TCalcFields_ServerDataForm, CalcFields_ServerDataForm); + Application.CreateForm(TCalcFields_ServerMainForm, CalcFields_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.dproj new file mode 100644 index 0000000..8fcb2de --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.dproj @@ -0,0 +1,80 @@ + + + {e6dc35c7-8101-4b42-8f70-e31cf121c23b} + CalcFields_Server.dpr + Debug + AnyCPU + DCC32 + CalcFields_Server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + CalcFields_Server.dpr + + + + + + + MainSource + + + + +
CalcFieldsService
+
+ +
CalcFields_ServerDataForm
+
+ +
CalcFields_ServerMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.res new file mode 100644 index 0000000..ec4433b Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_Server.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerData.dfm new file mode 100644 index 0000000..6229eb8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerData.dfm @@ -0,0 +1,49 @@ +object CalcFields_ServerDataForm: TCalcFields_ServerDataForm + OldCreateOrder = False + OnCreate = DataModuleCreate + Height = 207 + Width = 352 + object ROServer: TROIndyHTTPServer + Active = True + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object ROMessage: TROBinMessage + Left = 34 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI;' + Description = 'Borland ADOExpress Connection' + Default = True + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 232 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerData.pas new file mode 100644 index 0000000..3d4b59a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerData.pas @@ -0,0 +1,38 @@ +unit CalcFields_ServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDADriverManager, uDAClasses, uDADBXDriver, uDAEngine, uDAADODriver, + uROIndyTCPServer; + +type + TCalcFields_ServerDataForm = class(TDataModule) + ROServer: TROIndyHTTPServer; + ROMessage: TROBinMessage; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + ConnectionManager: TDAConnectionManager; + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + CalcFields_ServerDataForm: TCalcFields_ServerDataForm; + +implementation + +{$R *.dfm} + +procedure TCalcFields_ServerDataForm.DataModuleCreate(Sender: TObject); +begin + ROServer.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerMain.dfm new file mode 100644 index 0000000..39d1baa --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerMain.dfm @@ -0,0 +1,21 @@ +object CalcFields_ServerMainForm: TCalcFields_ServerMainForm + Left = 122 + Top = 243 + BorderStyle = bsDialog + Caption = 'CalcFields - Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerMain.pas new file mode 100644 index 0000000..9fa2b27 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/CalcFields_ServerMain.pas @@ -0,0 +1,26 @@ +unit CalcFields_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer; + +type + TCalcFields_ServerMainForm = class(TForm) + RoPoweredByRemObjectsButton: TROPoweredByRemObjectsButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + CalcFields_ServerMainForm: TCalcFields_ServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/RODLFILE.res new file mode 100644 index 0000000..09082da Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Calculated Fields/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.Sample.html new file mode 100644 index 0000000..33b66bf --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.Sample.html @@ -0,0 +1,44 @@ + + + + + + + + + +

+ Connection By User +

+

Purpose

+

+ Shows various methods how a standard application (i.e. not a RemObjects server or + client) can obtain a database connection at runtime. +
+ The application uses four Data Abstract components:  TDAADODriver, + TDADriverManager, TDAConnectionManager and + TROInMemorySessionManager.

+ +

+ All tests above connect via the DAConnectionManager except for + #4.

+ + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.bdsproj new file mode 100644 index 0000000..b010e02 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ConnectionByUser.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.dpr new file mode 100644 index 0000000..460e7fd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.dpr @@ -0,0 +1,14 @@ +program ConnectionByUser; + +uses + Forms, + ConnectionByUserMain in 'ConnectionByUserMain.pas' {ConnectionByUserMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Connection By User'; + Application.CreateForm(TConnectionByUserMainForm, ConnectionByUserMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.dproj new file mode 100644 index 0000000..e17d67b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.dproj @@ -0,0 +1,72 @@ + + + {3a10f6d7-3d2b-4bea-bad3-215392d8b601} + ConnectionByUser.dpr + Debug + AnyCPU + DCC32 + ConnectionByUser.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ConnectionByUser.dpr + + + + + + + MainSource + + +
ConnectionByUserMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.res new file mode 100644 index 0000000..6a1db77 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUser.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUserMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUserMain.dfm new file mode 100644 index 0000000..d039031 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUserMain.dfm @@ -0,0 +1,168 @@ +object ConnectionByUserMainForm: TConnectionByUserMainForm + Left = 32 + Top = 37 + AutoScroll = False + Caption = 'Connection by User' + ClientHeight = 313 + ClientWidth = 506 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Label3: TLabel + Left = 309 + Top = 18 + Width = 117 + Height = 13 + Caption = 'Open default connection' + end + object Label4: TLabel + Left = 309 + Top = 52 + Width = 174 + Height = 13 + Caption = 'Delayed "Open" after supplying login' + end + object Label5: TLabel + Left = 309 + Top = 82 + Width = 155 + Height = 13 + Caption = 'One-liner Open with custom login' + end + object Label6: TLabel + Left = 309 + Top = 114 + Width = 133 + Height = 13 + Caption = 'Using the DADriverManager' + end + object GroupBox1: TGroupBox + Left = 8 + Top = 8 + Width = 217 + Height = 89 + Caption = 'Login Info' + TabOrder = 0 + object Label1: TLabel + Left = 29 + Top = 28 + Width = 36 + Height = 13 + Caption = 'UserID:' + end + object Label2: TLabel + Left = 16 + Top = 60 + Width = 49 + Height = 13 + Caption = 'Password:' + end + object eUserID: TEdit + Left = 72 + Top = 24 + Width = 121 + Height = 24 + TabOrder = 0 + Text = 'sa' + end + object ePassword: TEdit + Left = 72 + Top = 56 + Width = 121 + Height = 24 + TabOrder = 1 + end + end + object Acquire1Button: TButton + Left = 229 + Top = 12 + Width = 75 + Height = 25 + Caption = 'Acquire #1' + TabOrder = 1 + OnClick = Acquire1ButtonClick + end + object Acquire2Button: TButton + Left = 229 + Top = 44 + Width = 75 + Height = 25 + Caption = 'Acquire #2' + TabOrder = 2 + OnClick = Acquire2ButtonClick + end + object Acquire3Button: TButton + Left = 229 + Top = 76 + Width = 75 + Height = 25 + Caption = 'Acquire #3' + TabOrder = 3 + OnClick = Acquire3ButtonClick + end + object Acquire4Button: TButton + Left = 229 + Top = 108 + Width = 75 + Height = 25 + Caption = 'Acquire #4' + TabOrder = 4 + OnClick = Acquire4ButtonClick + end + object AcquireHoldButton: TButton + Left = 229 + Top = 140 + Width = 209 + Height = 25 + Caption = 'Acquire and Hold in a Session' + TabOrder = 5 + OnClick = AcquireHoldButtonClick + end + object Memo: TMemo + Left = 4 + Top = 173 + Width = 496 + Height = 137 + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssVertical + TabOrder = 6 + end + object DAADODriver: TDAADODriver + Left = 57 + Top = 127 + end + object DADriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 91 + Top = 127 + end + object DAConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'ADOPartial' + ConnectionString = 'ADO?Server=localhost;Database=Northwind;AuxDriver=SQLOLEDB.1' + Default = False + Tag = 0 + end + item + Name = 'ADOComplete' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = False + Tag = 0 + end> + DriverManager = DADriverManager + PoolingEnabled = False + Left = 23 + Top = 127 + end + object ROSessionManager: TROInMemorySessionManager + Left = 129 + Top = 127 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUserMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUserMain.pas new file mode 100644 index 0000000..0ae0360 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection By User/ConnectionByUserMain.pas @@ -0,0 +1,187 @@ +unit ConnectionByUserMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, uDAClasses, uDADriverManager, uDAEngine, uDAADODriver, + uROSessions, uROClient; + +type + TConnectionByUserMainForm = class(TForm) + GroupBox1: TGroupBox; + Label1: TLabel; + Label2: TLabel; + eUserID: TEdit; + ePassword: TEdit; + Acquire1Button: TButton; + Acquire2Button: TButton; + Acquire3Button: TButton; + DAADODriver: TDAADODriver; + DADriverManager: TDADriverManager; + DAConnectionManager: TDAConnectionManager; + Acquire4Button: TButton; + ROSessionManager: TROInMemorySessionManager; + AcquireHoldButton: TButton; + Label3: TLabel; + Label4: TLabel; + Label5: TLabel; + Label6: TLabel; + Memo: TMemo; + procedure Acquire1ButtonClick(Sender: TObject); + procedure Acquire2ButtonClick(Sender: TObject); + procedure Acquire3ButtonClick(Sender: TObject); + procedure Acquire4ButtonClick(Sender: TObject); + procedure AcquireHoldButtonClick(Sender: TObject); + private + { Private declarations } + procedure Log(Str: string); + public + { Public declarations } + end; + +var + ConnectionByUserMainForm: TConnectionByUserMainForm; + +implementation + +uses uDAInterfaces; + +{$R *.dfm} + +procedure TConnectionByUserMainForm.Acquire1ButtonClick(Sender: TObject); +var + conn: IDAConnection; +begin + try + conn := DAConnectionManager.NewConnection('ADOComplete'); + finally + if (Conn <> nil) and conn.Connected then begin + Log(TButton(Sender).Caption + ': Connection successful'); + log('Connection via "' + conn.ConnectionString + '"'); + end + else begin + Log(TButton(Sender).Caption + ': Connection failed'); + end; + end; +end; + +procedure TConnectionByUserMainForm.Acquire2ButtonClick(Sender: TObject); +var + conn: IDAConnection; +begin + try + conn := DAConnectionManager.NewConnection('ADOPartial', FALSE); + conn.UserID := eUserID.Text; + conn.Password := ePassword.Text; + conn.Open; + finally + if (Conn <> nil) and conn.Connected then begin + Log(TButton(Sender).Caption + ': Connection successful'); + log('Connection via "' + conn.ConnectionString + '"'); + end + else begin + Log(TButton(Sender).Caption + ': Connection failed'); + end; + end; +end; + +procedure TConnectionByUserMainForm.Acquire3ButtonClick(Sender: TObject); +var + conn: IDAConnection; +begin + try + conn := DAConnectionManager.NewConnection('ADOPartial', TRUE, eUserID.Text, ePassword.Text); + finally + if (Conn <> nil) and conn.Connected then begin + Log(TButton(Sender).Caption + ': Connection successful'); + log('Connection via "' + conn.ConnectionString + '"'); + end + else begin + Log(TButton(Sender).Caption + ': Connection failed'); + end; + end; +end; + +procedure TConnectionByUserMainForm.Acquire4ButtonClick(Sender: TObject); +var + drv: IDADriver; + conn: IDAConnection; +begin + try + drv := DriverManager.DriverByDriverID('ADO'); // Raises exception if not found + conn := drv.NewConnection; + // If not empty strings, these will override any specific UserID, Password specified below + conn.ConnectionString := Format('Server=localhost;Database=Northwind;AuxDriver=SQLOLEDB.1;UserID=%s;Password=%s;', [eUserID.Text, ePassword.Text]); + conn.Open; + finally + if (Conn <> nil) and conn.Connected then begin + Log(TButton(Sender).Caption + ': Connection successful'); + log('Connection via "' + conn.ConnectionString + '"'); + end + else begin + Log(TButton(Sender).Caption + ': Connection failed'); + end; + end; +end; + +procedure TConnectionByUserMainForm.AcquireHoldButtonClick(Sender: TObject); +const + MySessionID: TGUID = '{2B0ABD74-465A-45A6-AAD7-837709A66DB9}'; +var + session: TROSession; + conn: IDAConnection; +begin + + conn := DAConnectionManager.NewConnection('ADOComplete'); + + with ROSessionManager do try + session := CreateSession(MySessionID); + + // #1: How to store IDAConnections in RO sessions ---------------------------------------- + conn._AddRef; // We increment its ref count because we want it locked by the session + session.Values['MyADOConnection'] := integer(conn); + // End of #1 ----------------------------------------------------------------------------- + + conn := nil; // We set it to NIL to simulate what would happen in a real RO Datamodule when the vars get out of scope + ReleaseSession(session, TRUE); +{$WARNINGS OFF} + session := nil; // Just to simulate real re-initialization +{$WARNINGS ON} + session := FindSession(MySessionID); + + // #2: How to get IDAConnections from RO Sessions ---------------------------------------- + try + conn := IDAConnection(pointer(integer(session.Values['MyADOConnection']))); + finally + if (Conn <> nil) and conn.Connected then begin + Log(TButton(Sender).Caption + ': Connection successful'); + log('Connection via "' + conn.ConnectionString + '"'); + end + else begin + Log(TButton(Sender).Caption + ': Connection failed'); + end; + end; + + // End of #2 ----------------------------------------------------------------------------- + + // #3: How to finally release the connection from the session. This should be done when you ------ + // want to get rid of the connection for good... + conn.Close; // Optional. Implicit when it gets freed + conn._Release; // Removes the lock we imposed on the connection at the very beginning + // End of #3 ------------------------------------------------------------------------------------- + + conn := nil; // This is only useful in this example because the ref count is still held up to one by the local "conn" variable. + + finally + DeleteSession(MySessionID, FALSE); // This is what the RO session manager does for you, so ignore this too + end; +end; + +procedure TConnectionByUserMainForm.Log(Str: string); +begin + Memo.Lines.Add(Str); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.Sample.html new file mode 100644 index 0000000..f4e1e4c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.Sample.html @@ -0,0 +1,34 @@ + + + + + + + + + +

+ Connection Pooling +

+ + +

Purpose

+

+ Shows how connections can be managed via a pool (ADO/Northwind & IBX/Employee + connections). +

+

+ Use the three pairs of Acquire/Release connection buttons to experiment + with pooling. Note how connections timeout later than the Release call and how + the delay + depends on the selected PoolTimeoutSeconds value selected via the + track bar. +

+

+ Examine the code in ConnectionPoolingMain - you will see that it is minimal - all one + or two liners. +

+ + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.bdsproj new file mode 100644 index 0000000..557c349 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ConnectionPooling.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.dpr new file mode 100644 index 0000000..90d1fad --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.dpr @@ -0,0 +1,14 @@ +program ConnectionPooling; + +uses + Forms, + ConnectionPoolingMain in 'ConnectionPoolingMain.pas' {ConnectionPoolingMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'ConnectionPooling'; + Application.CreateForm(TConnectionPoolingMainForm, ConnectionPoolingMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.dproj new file mode 100644 index 0000000..5559d22 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.dproj @@ -0,0 +1,72 @@ + + + {1087a4d3-a1bb-4f0d-8193-c91d9ddf3a55} + ConnectionPooling.dpr + Debug + AnyCPU + DCC32 + ConnectionPooling.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ConnectionPooling.dpr + + + + + + + MainSource + + +
ConnectionPoolingMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.res new file mode 100644 index 0000000..b946fbb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPooling.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPoolingMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPoolingMain.dfm new file mode 100644 index 0000000..79dd5a0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPoolingMain.dfm @@ -0,0 +1,162 @@ +object ConnectionPoolingMainForm: TConnectionPoolingMainForm + Left = 392 + Top = 182 + AutoScroll = False + BorderWidth = 5 + Caption = 'Connection Pooling' + ClientHeight = 323 + ClientWidth = 365 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 3 + Top = 0 + Width = 102 + Height = 13 + Caption = 'Selected Connection:' + end + object lPoolTimeoutSeconds: TLabel + Left = 3 + Top = 48 + Width = 113 + Height = 13 + Caption = 'PoolTimeoutSeconds: 5' + end + object Acquire1Button: TButton + Left = 208 + Top = 0 + Width = 75 + Height = 25 + Caption = '&Acquire #1' + TabOrder = 0 + OnClick = Acquire1ButtonClick + end + object cbConnections: TComboBox + Left = 3 + Top = 18 + Width = 193 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 1 + end + object Release1Button: TButton + Left = 288 + Top = 0 + Width = 75 + Height = 25 + Caption = '&Release #1' + TabOrder = 2 + OnClick = Release1ButtonClick + end + object Memo: TMemo + Left = 0 + Top = 97 + Width = 365 + Height = 226 + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssVertical + TabOrder = 3 + end + object Acquire2Button: TButton + Left = 208 + Top = 32 + Width = 75 + Height = 25 + Caption = '&Acquire #2' + TabOrder = 4 + OnClick = Acquire2ButtonClick + end + object Release2Button: TButton + Left = 288 + Top = 32 + Width = 75 + Height = 25 + Caption = '&Release #2' + TabOrder = 5 + OnClick = Release2ButtonClick + end + object Acquire3Button: TButton + Left = 208 + Top = 64 + Width = 75 + Height = 25 + Caption = '&Acquire #3' + TabOrder = 6 + OnClick = Acquire3ButtonClick + end + object Release3Button: TButton + Left = 288 + Top = 64 + Width = 75 + Height = 25 + Caption = '&Release #3' + TabOrder = 7 + OnClick = Release3ButtonClick + end + object TrackBar: TTrackBar + Left = -4 + Top = 64 + Width = 208 + Height = 30 + Max = 20 + Min = 1 + Orientation = trHorizontal + ParentShowHint = False + PageSize = 1 + Frequency = 1 + Position = 5 + SelEnd = 0 + SelStart = 0 + ShowHint = True + TabOrder = 8 + TickMarks = tmBottomRight + TickStyle = tsAuto + OnChange = TrackBarChange + end + object DAConnectionManager: TDAConnectionManager + PoolTimeoutSeconds = 5 + OnConnectionTimedOut = DAConnectionManagerConnectionTimedOut + OnConnectionCreated = DAConnectionManagerConnectionCreated + Connections = < + item + Name = 'MSSQL' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI;' + Description = 'Microsoft SQL Server Northwind Connection' + Default = True + Tag = 0 + end + item + Name = 'IBEmployees' + ConnectionString = + 'IBX?Server=;UserID=sysdba;Password=masterkey;Database=C:\Program' + + ' Files\Borland\InterBase\examples\Database\Employee.gdb' + Description = 'Borland Interbase Employee Connection' + Default = False + Tag = 0 + end> + DriverManager = DADriverManager + PoolingEnabled = True + Left = 48 + Top = 112 + end + object DADriverManager: TDADriverManager + DriverDirectory = '%MODULE%\' + TraceActive = False + TraceFlags = [] + Left = 16 + Top = 112 + end + object DAADODriver: TDAADODriver + Left = 16 + Top = 144 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPoolingMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPoolingMain.pas new file mode 100644 index 0000000..fb442ab --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Connection Pooling/ConnectionPoolingMain.pas @@ -0,0 +1,152 @@ +unit ConnectionPoolingMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uDADriverManager, uDAClasses, StdCtrls, uDAInterfaces, + uDAIBXDriver, uDAEngine, uDAADODriver, ExtCtrls, ComCtrls; + +type + TConnectionPoolingMainForm = class(TForm) + DADriverManager: TDADriverManager; + DAConnectionManager: TDAConnectionManager; + Acquire1Button: TButton; + cbConnections: TComboBox; + DAADODriver: TDAADODriver; + Release1Button: TButton; + Memo: TMemo; + Acquire2Button: TButton; + Release2Button: TButton; + Acquire3Button: TButton; + Release3Button: TButton; + Label1: TLabel; + TrackBar: TTrackBar; + lPoolTimeoutSeconds: TLabel; + procedure FormCreate(Sender: TObject); + procedure Acquire1ButtonClick(Sender: TObject); + procedure Release1ButtonClick(Sender: TObject); + procedure Acquire2ButtonClick(Sender: TObject); + procedure Acquire3ButtonClick(Sender: TObject); + procedure Release2ButtonClick(Sender: TObject); + procedure Release3ButtonClick(Sender: TObject); + procedure DAConnectionManagerConnectionAcquired( + Sender: TDAConnectionManager; const Connection: IDAConnection); + procedure DAConnectionManagerConnectionCreated( + Sender: TDAConnectionManager; const Connection: IDAConnection); + procedure DAConnectionManagerConnectionTimedOut( + Sender: TDAConnectionManager); + procedure TrackBarChange(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + fConnection, + fConnection2, + fConnection3: IDAConnection; + procedure Log(Str: string); + public + + end; + +var + ConnectionPoolingMainForm: TConnectionPoolingMainForm; + +implementation + +{$R *.dfm} + +procedure TConnectionPoolingMainForm.FormCreate(Sender: TObject); +var + i: integer; +begin + for i := 0 to (DAConnectionManager.Connections.Count - 1) do + cbConnections.Items.Add(DAConnectionManager.Connections[i].Name); + + cbConnections.ItemIndex := 0; +end; + +procedure TConnectionPoolingMainForm.Acquire1ButtonClick(Sender: TObject); +begin + if not assigned(fConnection) then begin + fConnection := DAConnectionManager.NewConnection(cbConnections.Text); + Log('Connection #1 acquired...'); + end; +end; + +procedure TConnectionPoolingMainForm.Release1ButtonClick(Sender: TObject); +begin + if assigned(fConnection) then begin + fConnection := nil; + Log('Connection #1 released'); + end; +end; + +procedure TConnectionPoolingMainForm.Acquire2ButtonClick(Sender: TObject); +begin + if not assigned(fConnection2) then begin + fConnection2 := DAConnectionManager.NewConnection(cbConnections.Text); + Log('Connection #2 acquired...'); + end; +end; + +procedure TConnectionPoolingMainForm.Acquire3ButtonClick(Sender: TObject); +begin + if not assigned(fConnection3) then begin + fConnection3 := DAConnectionManager.NewConnection(cbConnections.Text); + Log('Connection #3 acquired...'); + end; +end; + +procedure TConnectionPoolingMainForm.Release2ButtonClick(Sender: TObject); +begin + if assigned(fConnection2) then begin + fConnection2 := nil; + Log('Connection #2 released'); + end; +end; + +procedure TConnectionPoolingMainForm.Release3ButtonClick(Sender: TObject); +begin + if assigned(fConnection3) then begin + fConnection3 := nil; + Log('Connection #3 released'); + end; +end; + +procedure TConnectionPoolingMainForm.DAConnectionManagerConnectionAcquired( + Sender: TDAConnectionManager; const Connection: IDAConnection); +begin + Log('EVENT -> Connection acquired from the pool at ' + TimeToStr(Now)); +end; + +procedure TConnectionPoolingMainForm.DAConnectionManagerConnectionCreated( + Sender: TDAConnectionManager; const Connection: IDAConnection); +begin + Log('EVENT -> New connection created at ' + TimeToStr(Now)); +end; + +procedure TConnectionPoolingMainForm.DAConnectionManagerConnectionTimedOut( + Sender: TDAConnectionManager); +begin + Log('EVENT -> A connection timed out at ' + TimeToStr(Now)); +end; + +procedure TConnectionPoolingMainForm.TrackBarChange(Sender: TObject); +begin + DAConnectionManager.PoolTimeoutSeconds := TrackBar.Position; + lPoolTimeoutSeconds.Caption := Format('PoolTimeoutSeconds: %d', [TrackBar.Position]); +end; + +procedure TConnectionPoolingMainForm.Log(Str: string); +begin + Memo.Lines.Add(Str); +end; + +procedure TConnectionPoolingMainForm.FormDestroy(Sender: TObject); +begin + fConnection:=nil; + fConnection2:=nil; + fConnection3:=nil; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.Sample.html new file mode 100644 index 0000000..c7a3cfa --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.Sample.html @@ -0,0 +1,50 @@ + + + + + + + + + +

+ Custom User Logon +

+ + +

Purpose

+

+ A very simple example showing two methods of opening a connection at runtime. +

+ +

+ The example uses DAConnectionManager.Connections[0] as the connection + it opens. Examining its ConnectionString value via the Object Inspector, + you will see that it is set to: +

+

+   +

+

+ ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI; +

+

+   +

+

+ Modify it as needed to access a different database. See FAQ37 + for examples of connection strings. +

+ + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.bdsproj new file mode 100644 index 0000000..8f5cb42 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + CustomUserLogon.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.dpr new file mode 100644 index 0000000..d837771 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.dpr @@ -0,0 +1,14 @@ +program CustomUserLogon; + +uses + Forms, + CustomUserLogonMain in 'CustomUserLogonMain.pas' {CustomUserLogonMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'CustomUserLogon'; + Application.CreateForm(TCustomUserLogonMainForm, CustomUserLogonMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.dproj new file mode 100644 index 0000000..e42accf --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.dproj @@ -0,0 +1,36 @@ + + + {ec6ab974-9d80-4b73-9f09-b3948cbfef67} + CustomUserLogon.dpr + Debug + AnyCPU + DCC32 + CustomUserLogon.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + +FalseTrueFalseFalseFalse1000FalseFalseFalseFalseFalse105812511.0.0.01.0.0.0CustomUserLogon.dpr + + + + + MainSource + + +
CustomUserLogonMainForm
+
+
+
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.res new file mode 100644 index 0000000..b946fbb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogon.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogonMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogonMain.dfm new file mode 100644 index 0000000..eb7b35f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogonMain.dfm @@ -0,0 +1,102 @@ +object TCustomUserLogonMainForm + Left = 294 + Top = 99 + BorderStyle = bsDialog + Caption = 'Custom User Logon' + ClientHeight = 158 + ClientWidth = 207 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 8 + Top = 7 + Width = 191 + Height = 81 + Caption = 'User Info' + TabOrder = 0 + object Label1: TLabel + Left = 21 + Top = 28 + Width = 36 + Height = 13 + Caption = 'UserID:' + end + object Label2: TLabel + Left = 8 + Top = 52 + Width = 49 + Height = 13 + Caption = 'Password:' + end + object eUserID: TEdit + Left = 62 + Top = 24 + Width = 121 + Height = 21 + TabOrder = 0 + Text = 'sa' + end + object ePassword: TEdit + Left = 62 + Top = 48 + Width = 121 + Height = 21 + TabOrder = 1 + end + end + object Open1Button: TButton + Left = 20 + Top = 95 + Width = 167 + Height = 25 + Caption = 'Open Connection (1st way)' + Default = True + TabOrder = 1 + OnClick = Open1ButtonClick + end + object Open2Button: TButton + Left = 20 + Top = 127 + Width = 167 + Height = 25 + Caption = 'Open Connection (2nd way)' + Default = True + TabOrder = 2 + OnClick = Open2ButtonClick + end + object DADriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 120 + Top = 40 + end + object DAConnectionManager: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Description = 'Borland ADOExpress Connection' + Default = True + Tag = 0 + end> + DriverManager = DADriverManager + PoolingEnabled = False + Left = 152 + Top = 40 + end + object DAADODriver: TDAADODriver + Left = 32 + Top = 88 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogonMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogonMain.pas new file mode 100644 index 0000000..d11ce41 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Custom User Logon/CustomUserLogonMain.pas @@ -0,0 +1,57 @@ +unit CustomUserLogonMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uDAClasses, uDADriverManager, StdCtrls, uDAIBXDriver, + uDAEngine, uDAADODriver; + +type + TCustomUserLogonMainForm = class(TForm) + DADriverManager: TDADriverManager; + DAConnectionManager: TDAConnectionManager; + GroupBox1: TGroupBox; + Open1Button: TButton; + eUserID: TEdit; + ePassword: TEdit; + Label1: TLabel; + Label2: TLabel; + DAADODriver: TDAADODriver; + Open2Button: TButton; + procedure Open1ButtonClick(Sender: TObject); + procedure Open2ButtonClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + CustomUserLogonMainForm: TCustomUserLogonMainForm; + +implementation + +{$R *.dfm} + +uses uDAInterfaces; + +procedure TCustomUserLogonMainForm.Open1ButtonClick(Sender: TObject); +var + conn: IDAConnection; +begin + conn := DAConnectionManager.NewConnection(DAConnectionManager.Connections[0].Name, TRUE, eUserID.Text, ePassword.Text); + MessageDlg('Connection created!', mtInformation, [mbOK], 0); +end; + +procedure TCustomUserLogonMainForm.Open2ButtonClick(Sender: TObject); +var + conn: IDAConnection; +begin + conn := DAConnectionManager.NewConnection(DAConnectionManager.Connections[0].Name, FALSE); + conn.Open(eUserID.Text, ePassword.Text); + MessageDlg('Connection created!', mtInformation, [mbOK], 0); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersMain.dfm new file mode 100644 index 0000000..a5b499f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersMain.dfm @@ -0,0 +1,723 @@ +object DataStreamersMainForm: TDataStreamersMainForm + Left = 221 + Top = 146 + BorderWidth = 5 + Caption = 'DataStreamers Tester' + ClientHeight = 517 + ClientWidth = 611 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object gCustomers: TDBGrid + Left = 0 + Top = 228 + Width = 611 + Height = 91 + Align = alClient + DataSource = dsCustomers + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object gOrders: TDBGrid + Left = 0 + Top = 354 + Width = 611 + Height = 163 + Align = alBottom + DataSource = dsOrders + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel1: TPanel + Left = 0 + Top = 319 + Width = 611 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object dbnOrders: TDBNavigator + Left = 240 + Top = 5 + Width = 240 + Height = 25 + DataSource = dsOrders + TabOrder = 0 + end + object btn_OpenOrders: TButton + Left = 152 + Top = 5 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 1 + OnClick = btn_OpenOrdersClick + end + object cbApplyOrdersSchema: TCheckBox + Left = 4 + Top = 9 + Width = 133 + Height = 17 + Caption = 'Apply Orders Schema' + Checked = True + State = cbChecked + TabOrder = 2 + end + end + object Panel2: TPanel + Left = 0 + Top = 193 + Width = 611 + Height = 35 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object cbApplyCustomersSchema: TCheckBox + Left = 4 + Top = 9 + Width = 141 + Height = 17 + Caption = 'Apply Customers Schema' + Checked = True + State = cbChecked + TabOrder = 0 + end + object btn_OpenCustomers: TButton + Left = 160 + Top = 5 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 1 + OnClick = btn_OpenCustomersClick + end + object dbnCustomers: TDBNavigator + Left = 248 + Top = 5 + Width = 240 + Height = 25 + DataSource = dsCustomers + TabOrder = 2 + end + end + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 611 + Height = 193 + Align = alTop + BevelOuter = bvNone + Caption = 'Panel3' + TabOrder = 4 + object Panel4: TPanel + Left = 346 + Top = 0 + Width = 265 + Height = 193 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btn_TestDatasets: TButton + Left = 8 + Top = 75 + Width = 129 + Height = 25 + Caption = 'Test Datasets' + TabOrder = 0 + OnClick = btn_TestDatasetsClick + end + object cbSkipCustomers: TCheckBox + Left = 8 + Top = 40 + Width = 97 + Height = 17 + Caption = 'Skip Customers' + TabOrder = 1 + end + object cbSkipOrders: TCheckBox + Left = 8 + Top = 56 + Width = 97 + Height = 17 + Caption = 'Skip Orders' + TabOrder = 2 + end + object btn_TurnMD: TButton + Left = 8 + Top = 139 + Width = 129 + Height = 25 + Caption = 'Turn M/D on/off' + TabOrder = 3 + OnClick = btn_TurnMDClick + end + object cbCloseBeforeTest: TCheckBox + Left = 8 + Top = 11 + Width = 113 + Height = 17 + Caption = 'Close Before Test' + Checked = True + State = cbChecked + TabOrder = 4 + end + object btn_ShowDeltaCounters: TButton + Left = 8 + Top = 168 + Width = 129 + Height = 25 + Caption = 'Show Delta Counters' + TabOrder = 5 + OnClick = btn_ShowDeltaCountersClick + end + object btn_TestDeltas: TButton + Left = 8 + Top = 107 + Width = 129 + Height = 25 + Caption = 'Test Deltas' + TabOrder = 6 + OnClick = btn_TestDeltasClick + end + object btn_ClearMemo: TButton + Left = 144 + Top = 168 + Width = 97 + Height = 25 + Caption = 'Clear Memo' + TabOrder = 7 + OnClick = btn_ClearMemoClick + end + end + object Memo: TMemo + Left = 0 + Top = 0 + Width = 346 + Height = 193 + Align = alClient + ScrollBars = ssVertical + TabOrder = 1 + end + end + object DADriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 16 + Top = 8 + end + object DAConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DADriverManager + PoolingEnabled = True + Left = 80 + Top = 8 + end + object DASchema: TDASchema + ConnectionManager = DAConnectionManager + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10' FROM'#10' ' + + ' Orders' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 48 + Top = 8 + end + object DAADODriver: TDAADODriver + Left = 112 + Top = 8 + end + object dtCustomers: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + IndexDefs = <> + Left = 276 + Top = 27 + end + object dsCustomers: TDADataSource + DataSet = dtCustomers.Dataset + DataTable = dtCustomers + Left = 292 + Top = 43 + end + object dtOrders: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + IndexDefs = <> + Left = 340 + Top = 27 + end + object dsOrders: TDADataSource + DataSet = dtOrders.Dataset + DataTable = dtOrders + Left = 356 + Top = 43 + end + object DABinDataStreamer: TDABinDataStreamer + Left = 146 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersMain.pas new file mode 100644 index 0000000..4cc3fb9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersMain.pas @@ -0,0 +1,240 @@ +unit DataStreamersMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, DB, Grids, DBGrids, ExtCtrls, DBCtrls, + uDADataTable, uDABINAdapter, uDAClasses, uDADriverManager, uDAInterfaces, + uDADataStreamer, uDAScriptingProvider, uDACDSDataTable, uDAEngine, + uDAADODriver; + +type + TDataStreamersMainForm = class(TForm) + DADriverManager: TDADriverManager; + DAADODriver: TDAADODriver; + DAConnectionManager: TDAConnectionManager; + dtCustomers: TDACDSDataTable; + dsCustomers: TDADataSource; + gCustomers: TDBGrid; + dtOrders: TDACDSDataTable; + dsOrders: TDADataSource; + gOrders: TDBGrid; + Panel1: TPanel; + dbnOrders: TDBNavigator; + btn_OpenOrders: TButton; + cbApplyOrdersSchema: TCheckBox; + Panel2: TPanel; + cbApplyCustomersSchema: TCheckBox; + btn_OpenCustomers: TButton; + dbnCustomers: TDBNavigator; + Panel3: TPanel; + Panel4: TPanel; + btn_TestDatasets: TButton; + cbSkipCustomers: TCheckBox; + cbSkipOrders: TCheckBox; + btn_TurnMD: TButton; + cbCloseBeforeTest: TCheckBox; + btn_ShowDeltaCounters: TButton; + btn_TestDeltas: TButton; + btn_ClearMemo: TButton; + Memo: TMemo; + DASchema: TDASchema; + DABinDataStreamer: TDABinDataStreamer; + procedure FormCreate(Sender: TObject); + procedure btn_TestDatasetsClick(Sender: TObject); + procedure btn_OpenCustomersClick(Sender: TObject); + procedure btn_OpenOrdersClick(Sender: TObject); + procedure btn_TurnMDClick(Sender: TObject); + procedure btn_ShowDeltaCountersClick(Sender: TObject); + procedure btn_TestDeltasClick(Sender: TObject); + procedure btn_ClearMemoClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + fConnection: IDAConnection; + end; + +var + DataStreamersMainForm: TDataStreamersMainForm; + +implementation + +uses uROTypes, uDADelta; + +{$R *.dfm} + +procedure TDataStreamersMainForm.FormCreate(Sender: TObject); +begin + fConnection := DAConnectionManager.NewConnection('ADO'); +end; + +procedure TDataStreamersMainForm.FormDestroy(Sender: TObject); +begin +fConnection:=nil; +end; + +procedure TDataStreamersMainForm.btn_TestDatasetsClick(Sender: TObject); +var + stream: Binary; + customers, + orders: IDADataset; + i: integer; + start: Cardinal; +begin + if cbCloseBeforeTest.Checked then begin + dtCustomers.Close; + dtOrders.Close; + end; + + stream := Binary.Create; + + with DABinDataStreamer do try + customers := DASchema.NewDataset(fConnection, 'Customers'); + //customers.Where.AddText(' 1=2'); + orders := DASchema.NewDataset(fConnection, 'Orders'); + //orders.Where.AddText(' 1=2'); + + start := GetTickCount; + + // Writes the data + Initialize(stream, aiWrite); + if not cbSkipCustomers.Checked then WriteDataset(customers, [woSchema, woRows], -1); + + if not cbSkipOrders.Checked then WriteDataset(orders, [woRows, woSchema], -1); + Finalize; + // End of write data + + Memo.Lines.Add('WRITE completed in ' + IntToStr(GetTickCount - start) + 'ms'); + + // Logging info + Memo.Lines.Add('Stream is now ' + IntToStr(stream.Size) + ' bytes long'); + + start := GetTickCount; + Initialize(stream, aiReadFromBeginning); + + // Reads the data + if not cbSkipCustomers.Checked then begin + if cbApplyCustomersSchema.Checked then + ReadDataset('Customers', dtCustomers, TRUE) + else + ReadDataset('Customers', dtCustomers); + end; + + if not cbSkipOrders.Checked then begin + if cbApplyOrdersSchema.Checked then + ReadDataset('Orders', dtOrders, TRUE) + else + ReadDataset('Orders', dtOrders); + end; + + Finalize; + + // End of read data + Memo.Lines.Add('READ completed in ' + IntToStr(GetTickCount - start) + 'ms'); + + // Logging info + Memo.Lines.Add('The stream contains ' + IntToStr(DatasetCount) + ' datasets and ' + IntToStr(DeltaCount) + ' deltas'); + for i := 0 to (DatasetCount - 1) do Memo.Lines.Add('Dataset -> ' + DatasetNames[i]); + for i := 0 to (DeltaCount - 1) do Memo.Lines.Add('Delta -> ' + DeltaNames[i]); + Memo.Lines.Add(' '); + finally + stream.Free; + end; +end; + +procedure TDataStreamersMainForm.btn_OpenCustomersClick(Sender: TObject); +begin + dtCustomers.Active := dtCustomers.Active xor TRUE; +end; + +procedure TDataStreamersMainForm.btn_OpenOrdersClick(Sender: TObject); +begin + dtOrders.Active := dtOrders.Active xor TRUE +end; + +procedure TDataStreamersMainForm.btn_TurnMDClick(Sender: TObject); +begin + if dtOrders.MasterSource = nil then begin + dtOrders.MasterFields := 'CustomerID'; + dtOrders.DetailFields := 'CustomerID'; + dtOrders.MasterSource := dsCustomers; + end + + else begin + dtOrders.MasterSource := nil; + dtOrders.MasterFields := ''; + dtOrders.DetailFields := ''; + end; + + btn_TestDatasets.Enabled := dtOrders.MasterSource = nil; +end; + +procedure TDataStreamersMainForm.btn_ShowDeltaCountersClick(Sender: TObject); +begin + ShowMessage(Format('Changes: Customers %d, Orders %d', [dtCustomers.Delta.Count, dtOrders.Delta.Count])); +end; + +procedure TDataStreamersMainForm.btn_TestDeltasClick(Sender: TObject); +var + stream: TStream; + i: integer; + orddelta, + custdelta: TDADelta; +begin + if not dtCustomers.Active or not dtOrders.Active then begin + MessageDlg('Both datatables must be open!', mtError, [mbOK], 0); + Exit; + end; + + stream := TMemoryStream.Create; + + custdelta := TDADelta.Create(dtCustomers); + orddelta := TDADelta.Create(dtOrders); + with DABinDataStreamer do try + // Writes the data + Initialize(stream, aiWrite); + if not cbSkipCustomers.Checked then WriteDelta(dtCustomers); + + if not cbSkipOrders.Checked then WriteDelta(dtOrders); + Finalize; + // End of write data + + // Logging info + Memo.Lines.Add('Stream is now ' + IntToStr(stream.Size) + ' bytes long'); + + Initialize(stream, aiReadFromBeginning); + + // Reads the data + if not cbSkipCustomers.Checked then begin + ReadDelta('dtCustomers', custdelta); + Memo.Lines.Add('Customers delta contains ' + IntToStr(custdelta.Count) + ' changes'); + end; + + if not cbSkipOrders.Checked then begin + ReadDelta('dtOrders', orddelta); + Memo.Lines.Add('Orders delta contains ' + IntToStr(orddelta.Count) + ' changes'); + end; + + Finalize; + + // Logging info + Memo.Lines.Add('The stream contains ' + IntToStr(DatasetCount) + ' datasets and ' + IntToStr(DeltaCount) + ' deltas'); + for i := 0 to (DatasetCount - 1) do Memo.Lines.Add('Dataset -> ' + DatasetNames[i]); + for i := 0 to (DeltaCount - 1) do Memo.Lines.Add('Delta -> ' + DeltaNames[i]); + Memo.Lines.Add(' '); + + finally + stream.Free; + + custdelta.Free; + orddelta.Free; + end; +end; + +procedure TDataStreamersMainForm.btn_ClearMemoClick(Sender: TObject); +begin + Memo.Lines.Clear; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.Sample.html new file mode 100644 index 0000000..1babacb --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.Sample.html @@ -0,0 +1,19 @@ + + + + + + + + + +

Data Streamers Sample


+

This example shows how a dataset can be written to a stream and read from it using the TDABinDataStreamer class.

+

When you compile and launch this example it displays two grids, the sources for which are datasets dynamically read using TStream.

+

Modify some data in the grids.

+

When you press the "Test Deltas" button, it shows the size of the delta containing the data to update the dataset.

+

The "Turn M/D on/off" button toggles the top grid as the master source for the bottom grid.

+ + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.bdsproj new file mode 100644 index 0000000..9a4eae0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DataStreamersTest.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.dpr new file mode 100644 index 0000000..d388589 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.dpr @@ -0,0 +1,14 @@ +program DataStreamersTest; + +uses + Forms, + DataStreamersMain in 'DataStreamersMain.pas' {DataStreamersMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Adapters Test'; + Application.CreateForm(TDataStreamersMainForm, DataStreamersMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.dproj new file mode 100644 index 0000000..e5ff5da --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.dproj @@ -0,0 +1,72 @@ + + + {0d9a7452-75b7-4181-9053-aa039d95be41} + DataStreamersTest.dpr + Debug + AnyCPU + DCC32 + DataStreamersTest.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + DataStreamersTest.dpr + + + + + + + MainSource + + +
DataStreamersMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.res new file mode 100644 index 0000000..6a1db77 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/DataStreamersTest.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/fMainForm.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/fMainForm.dfm new file mode 100644 index 0000000..3de76b7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/fMainForm.dfm @@ -0,0 +1,725 @@ +object Form1: TForm1 + Left = 70 + Top = 51 + Width = 807 + Height = 632 + BorderWidth = 5 + Caption = 'DataStream Tester' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object DBGrid1: TDBGrid + Left = 0 + Top = 228 + Width = 789 + Height = 163 + Align = alClient + DataSource = dsCustomers + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DBGrid2: TDBGrid + Left = 0 + Top = 426 + Width = 789 + Height = 163 + Align = alBottom + DataSource = dsOrders + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel1: TPanel + Left = 0 + Top = 391 + Width = 789 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object DBNavigator2: TDBNavigator + Left = 240 + Top = 5 + Width = 240 + Height = 25 + DataSource = dsOrders + TabOrder = 0 + end + object Button3: TButton + Left = 152 + Top = 5 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 1 + OnClick = Button3Click + end + object cbApplyOrdersSchema: TCheckBox + Left = 4 + Top = 9 + Width = 133 + Height = 17 + Caption = 'Apply Orders Schema' + Checked = True + State = cbChecked + TabOrder = 2 + end + end + object Panel2: TPanel + Left = 0 + Top = 193 + Width = 789 + Height = 35 + Align = alTop + BevelOuter = bvNone + TabOrder = 3 + object cbApplyCustomersSchema: TCheckBox + Left = 4 + Top = 9 + Width = 141 + Height = 17 + Caption = 'Apply Customers Schema' + Checked = True + State = cbChecked + TabOrder = 0 + end + object Button2: TButton + Left = 160 + Top = 5 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 1 + OnClick = Button2Click + end + object DBNavigator1: TDBNavigator + Left = 248 + Top = 5 + Width = 240 + Height = 25 + DataSource = dsCustomers + TabOrder = 2 + end + end + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 789 + Height = 193 + Align = alTop + BevelOuter = bvNone + Caption = 'Panel3' + TabOrder = 4 + object Panel4: TPanel + Left = 524 + Top = 0 + Width = 265 + Height = 193 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btn_TestDatasets: TButton + Left = 8 + Top = 75 + Width = 129 + Height = 25 + Caption = 'Test Datasets' + TabOrder = 0 + OnClick = btn_TestDatasetsClick + end + object cbSkipCustomers: TCheckBox + Left = 8 + Top = 40 + Width = 97 + Height = 17 + Caption = 'Skip Customers' + TabOrder = 1 + end + object cbSkipOrders: TCheckBox + Left = 8 + Top = 56 + Width = 97 + Height = 17 + Caption = 'Skip Orders' + TabOrder = 2 + end + object btn_TurnMD: TButton + Left = 8 + Top = 139 + Width = 129 + Height = 25 + Caption = 'Turn M/D on/off' + TabOrder = 3 + OnClick = btn_TurnMDClick + end + object cbCloseBeforeTest: TCheckBox + Left = 8 + Top = 11 + Width = 113 + Height = 17 + Caption = 'Close Before Test' + Checked = True + State = cbChecked + TabOrder = 4 + end + object btn_ShowDeltaCounters: TButton + Left = 8 + Top = 168 + Width = 129 + Height = 25 + Caption = 'Show Delta Counters' + TabOrder = 5 + OnClick = btn_ShowDeltaCountersClick + end + object btn_TestDeltas: TButton + Left = 8 + Top = 107 + Width = 129 + Height = 25 + Caption = 'Test Deltas' + TabOrder = 6 + OnClick = btn_TestDeltasClick + end + object btn_ClearMemo: TButton + Left = 144 + Top = 168 + Width = 97 + Height = 25 + Caption = 'Clear Memo' + TabOrder = 7 + OnClick = btn_ClearMemoClick + end + end + object Memo: TMemo + Left = 0 + Top = 0 + Width = 524 + Height = 193 + Align = alClient + ScrollBars = ssVertical + TabOrder = 1 + end + end + object DADriverManager1: TDADriverManager + DriverDirectory = '%SYSTEM%\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 16 + Top = 8 + end + object DAConnectionManager1: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DADriverManager1 + PoolingEnabled = True + Left = 80 + Top = 8 + end + object DASchema1: TDASchema + ConnectionManager = DAConnectionManager1 + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10' FROM'#10' ' + + ' Orders' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 48 + Top = 8 + end + object DAADODriver1: TDAADODriver + Left = 112 + Top = 8 + end + object dtCustomers: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + IndexDefs = <> + Left = 276 + Top = 27 + end + object dsCustomers: TDADataSource + DataTable = dtCustomers + Left = 292 + Top = 43 + end + object dtOrders: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + IndexDefs = <> + Left = 340 + Top = 27 + end + object dsOrders: TDADataSource + DataTable = dtOrders + Left = 356 + Top = 43 + end + object DABinDataStreamer: TDABinDataStreamer + Left = 146 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/fMainForm.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/fMainForm.pas new file mode 100644 index 0000000..07dfc8a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Data Streamers/fMainForm.pas @@ -0,0 +1,234 @@ +unit fMainForm; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, DB, Grids, DBGrids, ExtCtrls, DBCtrls, + uDADataTable, uDABINAdapter, uDAClasses, uDADriverManager, uDAInterfaces, + uDADataStreamer, uDAScriptingProvider, uDACDSDataTable, uDAEngine, + uDAADODriver; + +type + TForm1 = class(TForm) + DADriverManager1: TDADriverManager; + DAADODriver1: TDAADODriver; + DAConnectionManager1: TDAConnectionManager; + dtCustomers: TDACDSDataTable; + dsCustomers: TDADataSource; + DBGrid1: TDBGrid; + dtOrders: TDACDSDataTable; + dsOrders: TDADataSource; + DBGrid2: TDBGrid; + Panel1: TPanel; + DBNavigator2: TDBNavigator; + Button3: TButton; + cbApplyOrdersSchema: TCheckBox; + Panel2: TPanel; + cbApplyCustomersSchema: TCheckBox; + Button2: TButton; + DBNavigator1: TDBNavigator; + Panel3: TPanel; + Panel4: TPanel; + btn_TestDatasets: TButton; + cbSkipCustomers: TCheckBox; + cbSkipOrders: TCheckBox; + btn_TurnMD: TButton; + cbCloseBeforeTest: TCheckBox; + btn_ShowDeltaCounters: TButton; + btn_TestDeltas: TButton; + btn_ClearMemo: TButton; + Memo: TMemo; + DASchema1: TDASchema; + DABinDataStreamer: TDABinDataStreamer; + procedure FormCreate(Sender: TObject); + procedure btn_TestDatasetsClick(Sender: TObject); + procedure Button2Click(Sender: TObject); + procedure Button3Click(Sender: TObject); + procedure btn_TurnMDClick(Sender: TObject); + procedure btn_ShowDeltaCountersClick(Sender: TObject); + procedure btn_TestDeltasClick(Sender: TObject); + procedure btn_ClearMemoClick(Sender: TObject); + private + fConnection: IDAConnection; + end; + +var + Form1: TForm1; + +implementation + +uses uROTypes, uDADelta; + +{$R *.dfm} + +procedure TForm1.FormCreate(Sender: TObject); +begin + fConnection := DAConnectionManager1.NewConnection('ADO'); +end; + +procedure TForm1.btn_TestDatasetsClick(Sender: TObject); +var + stream: Binary; + customers, + orders: IDADataset; + i: integer; + start: Cardinal; +begin + if cbCloseBeforeTest.Checked then begin + dtCustomers.Close; + dtOrders.Close; + end; + + stream := Binary.Create; + + with DABinDataStreamer do try + customers := DASchema1.NewDataset(fConnection, 'Customers'); + //customers.Where.AddText(' 1=2'); + orders := DASchema1.NewDataset(fConnection, 'Orders'); + //orders.Where.AddText(' 1=2'); + + start := GetTickCount; + + // Writes the data + Initialize(stream, aiWrite); + if not cbSkipCustomers.Checked then WriteDataset(customers, [woSchema, woRows], -1); + + if not cbSkipOrders.Checked then WriteDataset(orders, [woRows, woSchema], -1); + Finalize; + // End of write data + + Memo.Lines.Add('WRITE completed in ' + IntToStr(GetTickCount - start) + 'ms'); + + // Logging info + Memo.Lines.Add('Stream is now ' + IntToStr(stream.Size) + ' bytes long'); + + start := GetTickCount; + Initialize(stream, aiReadFromBeginning); + + // Reads the data + if not cbSkipCustomers.Checked then begin + if cbApplyCustomersSchema.Checked then + ReadDataset('Customers', dtCustomers, TRUE) + else + ReadDataset('Customers', dtCustomers); + end; + + if not cbSkipOrders.Checked then begin + if cbApplyOrdersSchema.Checked then + ReadDataset('Orders', dtOrders, TRUE) + else + ReadDataset('Orders', dtOrders); + end; + + Finalize; + + // End of read data + Memo.Lines.Add('READ completed in ' + IntToStr(GetTickCount - start) + 'ms'); + + // Logging info + Memo.Lines.Add('The stream contains ' + IntToStr(DatasetCount) + ' datasets and ' + IntToStr(DeltaCount) + ' deltas'); + for i := 0 to (DatasetCount - 1) do Memo.Lines.Add('Dataset -> ' + DatasetNames[i]); + for i := 0 to (DeltaCount - 1) do Memo.Lines.Add('Delta -> ' + DeltaNames[i]); + Memo.Lines.Add(' '); + finally + stream.Free; + end; +end; + +procedure TForm1.Button2Click(Sender: TObject); +begin + dtCustomers.Active := dtCustomers.Active xor TRUE; +end; + +procedure TForm1.Button3Click(Sender: TObject); +begin + dtOrders.Active := dtOrders.Active xor TRUE +end; + +procedure TForm1.btn_TurnMDClick(Sender: TObject); +begin + if dtOrders.MasterSource = nil then begin + dtOrders.MasterFields := 'CustomerID'; + dtOrders.DetailFields := 'CustomerID'; + dtOrders.MasterSource := dsCustomers; + end + + else begin + dtOrders.MasterSource := nil; + dtOrders.MasterFields := ''; + dtOrders.DetailFields := ''; + end; + + btn_TestDatasets.Enabled := dtOrders.MasterSource = nil; +end; + +procedure TForm1.btn_ShowDeltaCountersClick(Sender: TObject); +begin + ShowMessage(Format('Changes: Customers %d, Orders %d', [dtCustomers.Delta.Count, dtOrders.Delta.Count])); +end; + +procedure TForm1.btn_TestDeltasClick(Sender: TObject); +var + stream: TStream; + i: integer; + orddelta, + custdelta: TDADelta; +begin + if not dtCustomers.Active or not dtOrders.Active then begin + MessageDlg('Both datatables must be open!', mtError, [mbOK], 0); + Exit; + end; + + stream := TMemoryStream.Create; + + custdelta := TDADelta.Create(dtCustomers); + orddelta := TDADelta.Create(dtOrders); + with DABinDataStreamer do try + // Writes the data + Initialize(stream, aiWrite); + if not cbSkipCustomers.Checked then WriteDelta(dtCustomers); + + if not cbSkipOrders.Checked then WriteDelta(dtOrders); + Finalize; + // End of write data + + // Logging info + Memo.Lines.Add('Stream is now ' + IntToStr(stream.Size) + ' bytes long'); + + Initialize(stream, aiReadFromBeginning); + + // Reads the data + if not cbSkipCustomers.Checked then begin + ReadDelta('dtCustomers', custdelta); + Memo.Lines.Add('Customers delta contains ' + IntToStr(custdelta.Count) + ' changes'); + end; + + if not cbSkipOrders.Checked then begin + ReadDelta('dtOrders', orddelta); + Memo.Lines.Add('Orders delta contains ' + IntToStr(orddelta.Count) + ' changes'); + end; + + Finalize; + + // Logging info + Memo.Lines.Add('The stream contains ' + IntToStr(DatasetCount) + ' datasets and ' + IntToStr(DeltaCount) + ' deltas'); + for i := 0 to (DatasetCount - 1) do Memo.Lines.Add('Dataset -> ' + DatasetNames[i]); + for i := 0 to (DeltaCount - 1) do Memo.Lines.Add('Delta -> ' + DeltaNames[i]); + Memo.Lines.Add(' '); + + finally + stream.Free; + + custdelta.Free; + orddelta.Free; + end; +end; + +procedure TForm1.btn_ClearMemoClick(Sender: TObject); +begin + Memo.Lines.Clear; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.Sample.html new file mode 100644 index 0000000..c0e0088 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.Sample.html @@ -0,0 +1,81 @@ + + + + + + + + + +

+ Dynamic SQL +

+ + +

Purpose

+

+ This demo shows how to retrieve schema and/or data via SQL generated at + runtime. +

+

+ When you compile and run the server, you will see it contains a memo displaying + "SQL details generated for Update will be displayed here". + The + demo does not actually attempt to update server data but merely display + the fields + that would be updated by processing the delta. See the TDynSQLService.UpdateData + code in DynSQLService_Impl to see how the delta is being processed. +

+

+ Having next compiled and run the client, the first thing to try + is clicking + on the Retrieve Schema and Data button and you should then see the + Customers + data displayed in the grid. Changing the text in the memo, e.g. to + Select + * from "Order Details" and clicking the button again results + in the + display of a different dataset with a totally different schema. Any of + the datasets + in the database (Northwind, by default) may be accessed in this manner. +

+

+ Other points of interest: +

+ + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.bdsgroup new file mode 100644 index 0000000..91866a0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + DynSQLServer.bdsproj + DynSQLClient.bdsproj + DynSQLServer.exe DynSQLClient.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.bpg new file mode 100644 index 0000000..ef95e27 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = DynSQLServer.exe DynSQLClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +DynSQLServer.exe: DynSQLServer.dpr + $(DCC) + +DynSQLClient.exe: DynSQLClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.groupproj new file mode 100644 index 0000000..a79c349 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQL.groupproj @@ -0,0 +1,40 @@ + + + {67b524b6-f332-475d-8d78-7edde30d8a99} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.bdsproj new file mode 100644 index 0000000..7936d9b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DynSQLClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.dpr new file mode 100644 index 0000000..81907da --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.dpr @@ -0,0 +1,15 @@ +program DynSQLClient; + +uses + Forms, + DynSQLMainClient in 'DynSQLMainClient.pas' {DynSQLMainClientForm}, + DynSQLLibrary_Intf in 'DynSQLLibrary_Intf.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'DynSQL Client'; + Application.CreateForm(TDynSQLMainClientForm, DynSQLMainClientForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.dproj new file mode 100644 index 0000000..c320b4c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.dproj @@ -0,0 +1,37 @@ + + + {a6ec96d6-69bf-4815-b64d-37174ee1d1be} + DynSQLClient.dpr + Debug + AnyCPU + DCC32 + DynSQLClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + +FalseTrueFalseFalseFalse1000FalseFalseFalseFalseFalse105812511.0.0.01.0.0.0DynSQLClient.dpr + + + + + MainSource + + + +
DynSQLMainClientForm
+
+
+
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLLibrary.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLLibrary.RODL new file mode 100644 index 0000000..4e4f4d4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLLibrary.RODL @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLLibrary_Intf.pas new file mode 100644 index 0000000..ab41146 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLLibrary_Intf.pas @@ -0,0 +1,104 @@ +unit DynSQLLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{7DDA8CC1-A876-4A25-9280-3352E8A464EB}'; + TargetNamespace = ''; + + { Service Interface ID's } + IDynSQLService_IID : TGUID = '{02F71273-9E5C-4BD7-81EF-3BD4663EA0AB}'; + + { Event ID's } + +type + { Forward declarations } + IDynSQLService = interface; + + + + + + { Enumerateds } + + { IDynSQLService } + IDynSQLService = interface(IDataAbstractService) + ['{02F71273-9E5C-4BD7-81EF-3BD4663EA0AB}'] + function MyUpdateData(const aTableName: String; const Delta: Binary): Binary; + end; + + { CoDynSQLService } + CoDynSQLService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDynSQLService; + end; + + { TDynSQLService_Proxy } + TDynSQLService_Proxy = class(TDataAbstractService_Proxy, IDynSQLService) + protected + function __GetInterfaceName:string; override; + + function MyUpdateData(const aTableName: String; const Delta: Binary): Binary; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoDynSQLService } + +class function CoDynSQLService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDynSQLService; +begin + result := TDynSQLService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TDynSQLService_Proxy } + +function TDynSQLService_Proxy.__GetInterfaceName:string; +begin + result := 'DynSQLService'; +end; + +function TDynSQLService_Proxy.MyUpdateData(const aTableName: String; const Delta: Binary): Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'DynSQLLibrary', __InterfaceName, 'MyUpdateData'); + __Message.Write('aTableName', TypeInfo(String), aTableName, []); + __Message.Write('Delta', TypeInfo(Binary), Delta, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IDynSQLService_IID, TDynSQLService_Proxy); + + +finalization + UnregisterProxyClass(IDynSQLService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLLibrary_Invk.pas new file mode 100644 index 0000000..f0118bb --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLLibrary_Invk.pas @@ -0,0 +1,70 @@ +unit DynSQLLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} DynSQLLibrary_Intf; + +type + TDynSQLService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + procedure Invoke_MyUpdateData(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TDynSQLService_Invoker } + +procedure TDynSQLService_Invoker.Invoke_MyUpdateData(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function MyUpdateData(const aTableName: String; const Delta: Binary): Binary; } +var + aTableName: String; + Delta: Binary; + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + Delta := nil; + lResult := nil; + try + __Message.Read('aTableName', TypeInfo(String), aTableName, []); + __Message.Read('Delta', TypeInfo(Binary), Delta, []); + + lResult := (__Instance as IDynSQLService).MyUpdateData(aTableName, Delta); + + __Message.InitializeResponseMessage(__Transport, 'DynSQLLibrary', 'DynSQLService', 'MyUpdateDataResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(Delta); + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLMainClient.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLMainClient.dfm new file mode 100644 index 0000000..a987190 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLMainClient.dfm @@ -0,0 +1,244 @@ +object DynSQLMainClientForm: TDynSQLMainClientForm + Left = 466 + Top = 173 + Width = 549 + Height = 406 + BorderWidth = 5 + Caption = 'DynSQL Client' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 136 + Width = 66 + Height = 13 + Caption = 'Max Records:' + end + object Memo: TMemo + Left = 0 + Top = 0 + Width = 523 + Height = 124 + Align = alTop + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + Lines.Strings = ( + 'SELECT * FROM Customers') + ParentFont = False + ScrollBars = ssBoth + TabOrder = 0 + end + object seMaxRecs: TSpinEdit + Left = 80 + Top = 133 + Width = 65 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 1 + Value = -1 + end + object RetrieveSchema: TButton + Left = 0 + Top = 160 + Width = 92 + Height = 25 + Caption = 'Retrieve Schema' + TabOrder = 2 + OnClick = RetrieveSchemaClick + end + object Grid: TDBGrid + Left = 0 + Top = 212 + Width = 523 + Height = 148 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = DADataSource + TabOrder = 3 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object RetrieveData: TButton + Left = 95 + Top = 160 + Width = 92 + Height = 25 + Caption = 'Retrieve Data' + TabOrder = 4 + OnClick = RetrieveDataClick + end + object RetrieveSchemaAndData: TButton + Left = 191 + Top = 160 + Width = 154 + Height = 25 + Caption = 'Retrieve Schema and Data' + TabOrder = 5 + OnClick = RetrieveSchemaAndDataClick + end + object Save: TButton + Left = 349 + Top = 160 + Width = 45 + Height = 25 + Caption = 'Save' + TabOrder = 6 + OnClick = SaveClick + end + object Load: TButton + Left = 398 + Top = 160 + Width = 45 + Height = 25 + Caption = 'Load' + TabOrder = 7 + OnClick = LoadClick + end + object Update: TButton + Left = 446 + Top = 160 + Width = 75 + Height = 25 + Caption = 'Update' + TabOrder = 8 + OnClick = UpdateClick + end + object dbNavigator: TDBNavigator + Left = 151 + Top = 129 + Width = 320 + Height = 25 + DataSource = DADataSource + ParentShowHint = False + ShowHint = True + TabOrder = 9 + end + object cbUpdateviaRDA: TCheckBox + Left = 400 + Top = 192 + Width = 121 + Height = 17 + Caption = 'Update via RDA' + TabOrder = 10 + end + object ROBINMessage: TROBinMessage + Left = 32 + Top = 40 + end + object ROWinInetHTTPChannel1: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 64 + Top = 40 + end + object DataStreamer: TDABin2DataStreamer + Left = 128 + Top = 40 + end + object DataTable: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = DARemoteDataAdapter + BeforeRefresh = DataTableBeforeRefresh + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'DynamicDataset' + IndexDefs = <> + Left = 32 + Top = 80 + end + object DADataSource: TDADataSource + DataSet = DataTable.Dataset + DataTable = DataTable + Left = 64 + Top = 80 + end + object svcDynSQLService: TRORemoteService + Message = ROBINMessage + Channel = ROWinInetHTTPChannel1 + ServiceName = 'DynSQLService' + Left = 96 + Top = 40 + end + object DARemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = svcDynSQLService + GetDataCall.RemoteService = svcDynSQLService + GetDataCall.MethodName = 'SQLGetData' + GetDataCall.Params = < + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end + item + Name = 'aSQLText' + DataType = rtString + Flag = fIn + Value = Null + end + item + Name = 'aIncludeSchema' + DataType = rtBoolean + Flag = fIn + Value = Null + end + item + Name = 'aMaxRecords' + DataType = rtInteger + Flag = fIn + Value = Null + end> + GetDataCall.Default = False + GetDataCall.OutgoingTableNamesParameter = 'aTableNameArray' + GetDataCall.OutgoingTableRequestInfosParameter = 'aTableRequestInfoArray' + GetDataCall.IncomingDataParameter = 'Result' + GetDataCall.OutgoingIncludeSchemaParameter = 'aIncludeSchema' + GetDataCall.OutgoingMaxRecordsParameter = 'aMaxRecords' + UpdateDataCall.RemoteService = svcDynSQLService + UpdateDataCall.MethodName = 'MyUpdateData' + UpdateDataCall.Params = < + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end + item + Name = 'aTableName' + DataType = rtString + Flag = fIn + Value = Null + end + item + Name = 'Delta' + DataType = rtBinary + Flag = fIn + Value = Null + end> + UpdateDataCall.Default = False + UpdateDataCall.OutgoingDeltaParameter = 'Delta' + UpdateDataCall.IncomingDeltaParameter = 'Result' + GetScriptsCall.RemoteService = svcDynSQLService + RemoteService = svcDynSQLService + DataStreamer = DataStreamer + Left = 98 + Top = 80 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLMainClient.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLMainClient.pas new file mode 100644 index 0000000..1172ee8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLMainClient.pas @@ -0,0 +1,151 @@ +unit DynSQLMainClient; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uROWinInetHttpChannel, uROClient, + uROBINMessage, StdCtrls, Spin, uDADataTable, + DB, Grids, DBGrids, uRORemoteService, + uDAScriptingProvider, ExtCtrls, DBCtrls, uDARemoteDataAdapter, + uDADataStreamer, uDAInterfaces, uDABin2DataStreamer, + uDAMemDataTable; + +type + TDynSQLMainClientForm = class(TForm) + ROBINMessage: TROBINMessage; + ROWinInetHTTPChannel1: TROWinInetHTTPChannel; + Memo: TMemo; + seMaxRecs: TSpinEdit; + Label1: TLabel; + RetrieveSchema: TButton; + DataStreamer: TDABin2DataStreamer; + DataTable: TDAMemDataTable; + Grid: TDBGrid; + DADataSource: TDADataSource; + svcDynSQLService: TRORemoteService; + RetrieveData: TButton; + RetrieveSchemaAndData: TButton; + Save: TButton; + Load: TButton; + Update: TButton; + dbNavigator: TDBNavigator; + DARemoteDataAdapter: TDARemoteDataAdapter; + cbUpdateviaRDA: TCheckBox; + procedure RetrieveSchemaClick(Sender: TObject); + procedure RetrieveDataClick(Sender: TObject); + procedure RetrieveSchemaAndDataClick(Sender: TObject); + procedure SaveClick(Sender: TObject); + procedure LoadClick(Sender: TObject); + procedure UpdateClick(Sender: TObject); + procedure DataTableBeforeRefresh(DataTable: TDADataTable); + private + { Private declarations } + fSavedTablename: String; + procedure InitRDA(aIncludeSchema: Boolean; AMaxRecords: integer); + public + { Public declarations } + end; + +var + DynSQLMainClientForm: TDynSQLMainClientForm; + +implementation + +uses DynSQLLibrary_Intf, uROTypes, uDARemoteDataAdapterRequests, uRODL; + +{$R *.dfm} + +procedure TDynSQLMainClientForm.RetrieveSchemaClick(Sender: TObject); +begin + InitRDA(True, 0); + DataTable.Close; +end; + +procedure TDynSQLMainClientForm.RetrieveDataClick(Sender: TObject); +begin + InitRDA(False, seMaxRecs.Value); +end; + +procedure TDynSQLMainClientForm.RetrieveSchemaAndDataClick(Sender: TObject); +begin + InitRDA(True, seMaxRecs.Value); +end; + +procedure TDynSQLMainClientForm.SaveClick(Sender: TObject); +begin + DataTable.SaveToFile(ExtractFilePath(Application.ExeName) + 'Data.dat'); +end; + +procedure TDynSQLMainClientForm.LoadClick(Sender: TObject); +begin + DataTable.LoadFromFile(ExtractFilePath(Application.ExeName) + 'Data.dat'); +end; + +procedure TDynSQLMainClientForm.UpdateClick(Sender: TObject); +var + deltadata, r: Binary; + +begin + if not DataTable.Active then begin + ShowMessage('Please open table'); + Exit; + end; + if DataTable.Delta.Count=0 then begin + ShowMessage('No changes are found'); + Exit; + end; + fSavedTablename:=InputBox('Enter table name','Please enter table name.'+sLineBreak+'Use an empty table name for fake update.',fSavedTablename); + + if cbUpdateviaRDA.Checked then begin + DARemoteDataAdapter.UpdateDataCall.ParamByName('aTableName').AsString:= fSavedTablename; + DataTable.ApplyUpdates(); + end + else begin + deltadata := Binary.Create; + try + // Packs the delta of the data table and sends it over. + DataStreamer.Initialize(deltadata, aiWrite); + try + DataStreamer.WriteDelta(DataTable); + finally + DataStreamer.Finalize; + end; + + r:=(svcDynSQLService as IDynSQLService).MyUpdateData(fSavedTablename,deltadata); + try + DataTable.Delta.Clear(); + DataStreamer.Initialize(r, aiReadFromBeginning); + try + DataStreamer.ReadDelta(DataStreamer.DeltaNames[0], DataTable.Delta); + finally + DataStreamer.Finalize; + end; + DataTable.MergeDelta; + finally + r.Free; + end; + finally + deltadata.Free; + end; + end; +end; + +procedure TDynSQLMainClientForm.DataTableBeforeRefresh(DataTable: TDADataTable); +begin + DaRemoteDataAdapter.GetDataCall.ParamByName('aSQLText').AsString := Memo.Lines.Text; +end; + +procedure TDynSQLMainClientForm.InitRDA(aIncludeSchema: Boolean; + AMaxRecords: integer); +begin + with DataTable do begin + Close; + DARemoteDataAdapter.GetDataCall.ParamByName('aSQLText').AsString := Memo.Lines.Text; + MaxRecords := AMaxRecords; + DARemoteDataAdapter.Fill([DataTable], true, aIncludeSchema); + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.bdsproj new file mode 100644 index 0000000..233d818 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DynSQLServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.dpr new file mode 100644 index 0000000..f5094ec --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.dpr @@ -0,0 +1,21 @@ +program DynSQLServer; + +{#ROGEN:DynSQLLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROCOMInit, + Forms, + DynSQLServerMain in 'DynSQLServerMain.pas' {DynSQLServerMainForm}, + DynSQLLibrary_Intf in 'DynSQLLibrary_Intf.pas', + DynSQLLibrary_Invk in 'DynSQLLibrary_Invk.pas', + DynSQLService_Impl in 'DynSQLService_Impl.pas' {DynSQLService: TRORemoteDataModule}; + +{$R *.RES} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'DynSQL Server'; + Application.CreateForm(TDynSQLServerMainForm, DynSQLServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.dproj new file mode 100644 index 0000000..789dac4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.dproj @@ -0,0 +1,77 @@ + + + {2d78a543-7091-4d6f-9ce8-69b6915cef48} + DynSQLServer.dpr + Debug + AnyCPU + DCC32 + DynSQLServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + DynSQLServer.dpr + + + + + + + MainSource + + + + +
DynSQLServerMainForm
+
+ +
DynSQLService
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServerMain.dfm new file mode 100644 index 0000000..3275dca --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServerMain.dfm @@ -0,0 +1,88 @@ +object DynSQLServerMainForm: TDynSQLServerMainForm + Left = 285 + Top = 181 + AutoScroll = False + BorderWidth = 5 + Caption = 'DynSQL Server' + ClientHeight = 221 + ClientWidth = 413 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Form1' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 14 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 0 + Top = 0 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Memo: TMemo + Left = 0 + Top = 54 + Width = 413 + Height = 167 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + Lines.Strings = ( + 'SQL details generated for Update will be displayed here') + ReadOnly = True + ScrollBars = ssBoth + TabOrder = 0 + end + object Button1: TButton + Left = 336 + Top = 24 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Clear' + TabOrder = 1 + OnClick = Button1Click + end + object ROMessage: TROBinMessage + Left = 256 + end + object ROServer: TROIndyHTTPServer + Active = True + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'BIN' + end> + Port = 8099 + Left = 288 + end + object DADriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 320 + end + object DAConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Description = 'Borland ADOExpress Connection' + Default = True + end> + DriverManager = DADriverManager + PoolingEnabled = True + Left = 384 + end + object DAADODriver: TDAADODriver + Left = 352 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServerMain.pas new file mode 100644 index 0000000..d9ab672 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLServerMain.pas @@ -0,0 +1,73 @@ +unit DynSQLServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, uROClient, uROBINMessage, uROClientIntf, uROServer, uROIndyHTTPServer, + uROIndyTCPServer, uROPoweredByRemObjectsButton, SyncObjs, + uDAClasses, uDADriverManager, uDAEngine, uDAADODriver; + +type + TDynSQLServerMainForm = class(TForm) + ROMessage: TROBINMessage; + ROServer: TROIndyHTTPServer; + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + DADriverManager: TDADriverManager; + DAConnectionManager: TDAConnectionManager; + DAADODriver: TDAADODriver; + Memo: TMemo; + Button1: TButton; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure Button1Click(Sender: TObject); + private + { Private declarations } + CriticalSection: TCriticalSection; + public + { Public declarations } + procedure LOG(str: string); + end; + +var + DynSQLServerMainForm: TDynSQLServerMainForm; + +implementation + +{$R *.dfm} + +{ TDynSQLServerMainForm } + +procedure TDynSQLServerMainForm.LOG(str: string); +begin + CriticalSection.Enter; + try + Memo.Lines.Add(str); + finally + CriticalSection.Leave; + end; +end; + +procedure TDynSQLServerMainForm.FormCreate(Sender: TObject); +begin + CriticalSection := TCriticalSection.Create; + Button1Click(Self); +end; + +procedure TDynSQLServerMainForm.FormDestroy(Sender: TObject); +begin + CriticalSection.Free; +end; + +procedure TDynSQLServerMainForm.Button1Click(Sender: TObject); +begin + CriticalSection.Enter; + try + Memo.Clear; + finally + CriticalSection.Leave; + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLService_Impl.dfm new file mode 100644 index 0000000..46e9d93 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLService_Impl.dfm @@ -0,0 +1,51 @@ +object DynSQLService: TDynSQLService + OldCreateOrder = True + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + AllowExecuteSQL = True + ExportedDataTables = <> + Left = 430 + Top = 70 + Height = 300 + Width = 300 + object DataStreamer: TDABin2DataStreamer + Left = 24 + Top = 72 + end + object Schema: TDASchema + ConnectionManager = DynSQLServerMainForm.DAConnectionManager + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + Default = True + Name = 'ADO' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'ReferencedDataset' + Fields = <> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 24 + Top = 16 + end + object BusinessProcessor: TDABusinessProcessor + OnAfterProcessChange = BusinessProcessorAfterProcessChange + OnProcessError = BusinessProcessorProcessError + OnGenerateSQL = BusinessProcessorGenerateSQL + Schema = Schema + ReferencedDataset = 'ReferencedDataset' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete, poAutoGenerateRefreshDataset, poPrepareCommands] + UpdateMode = updWhereAll + Left = 24 + Top = 120 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLService_Impl.pas new file mode 100644 index 0000000..d14d724 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/DynSQLService_Impl.pas @@ -0,0 +1,165 @@ +unit DynSQLService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, uDAInterfaces, + {Generated:} DynSQLLibrary_Intf, uDAClasses, uDADelta, + uDABin2DataStreamer, uDADataStreamer, uDAScriptingProvider, + uDABusinessProcessor; + +type + { TDynSQLService } + TDynSQLService = class(TDataAbstractService, IDynSQLService) + DataStreamer: TDABin2DataStreamer; + BusinessProcessor: TDABusinessProcessor; + Schema: TDASchema; + procedure BusinessProcessorGenerateSQL(Sender: TDABusinessProcessor; + ChangeType: TDAChangeType; const ReferencedStatement: TDAStatement; + const aDelta: IDADelta; var SQL: String); + procedure BusinessProcessorProcessError(Sender: TDABusinessProcessor; + aChangeType: TDAChangeType; aChange: TDADeltaChange; + const aCommand: IDASQLCommand; var CanRemoveFromDelta: Boolean; + Error: Exception); + procedure BusinessProcessorAfterProcessChange( + Sender: TDABusinessProcessor; aChange: TDADeltaChange; + Processed: Boolean; var CanRemoveFromDelta: Boolean); + private + procedure Log(aStr: string); + function _GetConnection: IDAConnection; + protected + function MyUpdateData(const aTableName: String; const Delta: Binary): Binary; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} DynSQLLibrary_Invk, DynSQLServerMain, Dialogs, TypInfo; + +procedure Create_DynSQLService(out anInstance: IUnknown); +begin + anInstance := TDynSQLService.Create(nil); +end; + +{ TDynSQLService } + +function TDynSQLService._GetConnection: IDAConnection; +begin + Result := DynSQLServerMainForm.DAConnectionManager.NewConnection('ADO'); +end; + +procedure TDynSQLService.Log(aStr: string); +begin + DynSQLServerMainForm.Log(aStr); +end; + +function TDynSQLService.MyUpdateData(const aTableName: String; const Delta: Binary): Binary; +var + conn: IDAConnection; + realdelta: IDADelta; + i: integer; + sql: string; + fOldDeltaname: string; +begin + Log(''); + Log(''); + // Opens a connection + conn := _GetConnection; + + // Creates a delta object + realdelta := NewDelta('tempDelta'); + + // Converts the binary stream we just received. + DataStreamer.Initialize(Delta, aiReadFromBeginning); + try + fOldDeltaname:=DataStreamer.DeltaNames[0]; + DataStreamer.ReadDelta(DataStreamer.DeltaNames[0], realdelta); + finally + DataStreamer.Finalize; + end; + + if (aTableName = '') or (realdelta.Count=0) then begin + // Builds a fake SQL string for updating and displays it + sql := 'Updating query "' + DataStreamer.DeltaNames[0] + '", fields '; + + for i := 0 to (realdelta.LoggedFieldCount - 1) do + sql := sql + realdelta.LoggedFieldNames[i] + '(' + GetEnumName(TypeInfo(TDADataType), Ord(realdelta.LoggedFieldTypes[i])) + '), '; + + sql := Copy(sql, 1, Length(sql) - 2); + + Log(sql); + end + else begin + realDelta.LogicalName:= aTableName; + // setup of ReferencedDataset used in BP.ProcessDelta + with Schema.Datasets.DatasetByName(BusinessProcessor.ReferencedDataset),Statements[0] do begin + TargetTable:=aTableName; + ColumnMappings.Clear; + Fields.Clear; + for i:=0 to realdelta.LoggedFieldCount-1 do begin + Fields.Add(realdelta.LoggedFieldNames[i],realdelta.LoggedFieldTypes[i]); + with ColumnMappings.Add do begin + DatasetField:= realdelta.LoggedFieldNames[i]; + TableField:= realdelta.LoggedFieldNames[i]; + SQLOrigin:= realdelta.LoggedFieldNames[i]; + end; + end; + end; + BusinessProcessor.ProcessDelta(conn,realdelta); + end; + + Result:=Binary.Create; + realdelta.LogicalName:=fOldDeltaname; + DataStreamer.Initialize(Result, aiWrite); + try + DataStreamer.WriteDelta(realdelta); + finally + DataStreamer.Finalize; + end; +end; + +procedure TDynSQLService.BusinessProcessorGenerateSQL( + Sender: TDABusinessProcessor; ChangeType: TDAChangeType; + const ReferencedStatement: TDAStatement; const aDelta: IDADelta; + var SQL: String); +begin + Log('Generated SQL: '+SQL); +end; + +procedure TDynSQLService.BusinessProcessorProcessError( + Sender: TDABusinessProcessor; aChangeType: TDAChangeType; + aChange: TDADeltaChange; const aCommand: IDASQLCommand; + var CanRemoveFromDelta: Boolean; Error: Exception); +begin + Log('Error during processing change (RecID=' + IntToStr(aChange.RecID)+')'); + Log(Error.Message); +end; + +procedure TDynSQLService.BusinessProcessorAfterProcessChange( + Sender: TDABusinessProcessor; aChange: TDADeltaChange; + Processed: Boolean; var CanRemoveFromDelta: Boolean); +begin + if Processed then + Log('Change (RecID=' + IntToStr(aChange.RecID) +') is processed') + else + Log('Change (RecID=' + IntToStr(aChange.RecID) +') isn''t processed'); +end; + +initialization + TROClassFactory.Create('DynSQLService', Create_DynSQLService, TDynSQLService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/RODLFILE.res new file mode 100644 index 0000000..746553e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic SQL/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere.Sample.html new file mode 100644 index 0000000..da1066f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere.Sample.html @@ -0,0 +1,30 @@ + + + + + + + + +
+

+ Dynamic Where Sample +

+ +
+

Purpose

+

+ This example illustrates how work with the Dynamic Where.

+

+ +

Getting Started

+ + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere.bpg new file mode 100644 index 0000000..0a914f1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = DynWhere_Server.exe DynWhere_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +DynWhere_Server.exe: DynWhere_Server.dpr + $(DCC) + +DynWhere_Client.exe: DynWhere_Client.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere.groupproj new file mode 100644 index 0000000..7b0c875 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere.groupproj @@ -0,0 +1,44 @@ + + + {efdbc0b3-3cba-4a73-9888-3efa9fa82a97} + + + + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Client.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Client.dpr new file mode 100644 index 0000000..d7403c8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Client.dpr @@ -0,0 +1,20 @@ +program DynWhere_Client; + +uses + uROComInit, + Forms, + MidasLib, + DynWhere_ClientMain in 'DynWhere_ClientMain.pas' {DynWhere_ClientForm}, + DynWhere_ClientData in 'DynWhere_ClientData.pas' {DynWhere_ClientDataForm: TDAClientDataModule}, + memoForm in 'memoForm.pas' {frmMemo}, + WhereExpression in 'WhereExpression.pas' {WhereExpressionForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Dynamic Where - Client'; + Application.CreateForm(TDynWhere_ClientDataForm, DynWhere_ClientDataForm); + Application.CreateForm(TDynWhere_ClientForm, DynWhere_ClientForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Client.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Client.dproj new file mode 100644 index 0000000..d6cc0bb --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Client.dproj @@ -0,0 +1,219 @@ + + + {32915d98-851f-4ad4-b94c-2f0ce6942b73} + DynWhere_Client.dpr + Debug + AnyCPU + DCC32 + DynWhere_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Core Lab Data Access GUI related Components + Core Lab Data Access Components + Data Access Components for MySQL + MySQL Data Access GUI related Components + Oracle Data Access Components + Oracle Data Access GUI related Components + SQL Server Data Access Components + SQL Server Data Access GUI related Components + RemObjects Data Abstract - InterBase Express Driver + RemObjects Data Abstract - Scripting Integration Library + RemObjects Data Abstract - dbExpress Driver + RemObjects Data Abstract - SQLite Driver + RemObjects Data Abstract - DBISAM Driver + RemObjects Data Abstract - ElevateDB Driver + RemObjects Data Abstract - FIBPlus Driver + RemObjects Data Abstract - CoreLabs IBDAC Driver + RemObjects Data Abstract - CoreLabs MyDAC Driver + Data Abstract - NexusDB Driver + RemObjects Data Abstract - CoreLabs ODAC Driver + RemObjects Data Abstract - MicroOlap PostgresDAC Driver + RemObjects Data Abstract - 'Rosetta' + RemObjects Data Abstract - CoreLabs SDAC Driver + CodeGear C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + Core Lab InterBase Data Access Components + Data Access Components for MySQL - TMySQLMonitor + + + DynWhere_Client.dpr + + + + + + + MainSource + + +
DynWhere_ClientDataForm
+ TDAClientDataModule +
+ +
DynWhere_ClientForm
+
+ +
frmMemo
+
+ +
WhereExpressionForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Client.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Client.res new file mode 100644 index 0000000..cc22935 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Client.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientData.dfm new file mode 100644 index 0000000..63c6f90 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientData.dfm @@ -0,0 +1,60 @@ +object DynWhere_ClientDataForm: TDynWhere_ClientDataForm + OldCreateOrder = True + OnCreate = DataModuleCreate + Left = 439 + Top = 220 + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'DynWhere_Service' + Left = 40 + Top = 96 + end + object DataStreamer: TDABin2DataStreamer + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 40 + Top = 184 + end + object tbl_Data: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + LocalDataStreamer = DataStreamer + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Employees' + Left = 136 + Top = 24 + end + object ds_Data: TDADataSource + DataSet = tbl_Data.Dataset + DataTable = tbl_Data + Left = 136 + Top = 80 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientData.pas new file mode 100644 index 0000000..5dec311 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientData.pas @@ -0,0 +1,39 @@ +unit DynWhere_ClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABin2DataStreamer, uDAInterfaces, uDARemoteDataAdapter, + uDADataStreamer, uDAScriptingProvider, uDAMemDataTable; + +type + TDynWhere_ClientDataForm = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABin2DataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + tbl_Data: TDAMemDataTable; + ds_Data: TDADataSource; + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + DynWhere_ClientDataForm: TDynWhere_ClientDataForm; + +implementation + +{$R *.dfm} + +procedure TDynWhere_ClientDataForm.DataModuleCreate(Sender: TObject); +begin + RemoteDataAdapter.SetupDefaultRequest; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientMain.dfm new file mode 100644 index 0000000..21d782e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientMain.dfm @@ -0,0 +1,637 @@ +object DynWhere_ClientForm: TDynWhere_ClientForm + Left = 329 + Top = 175 + AutoScroll = False + Caption = 'Dynamic Where Client' + ClientHeight = 442 + ClientWidth = 700 + Color = clBtnFace + Constraints.MinHeight = 478 + Constraints.MinWidth = 640 + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 700 + Height = 201 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 233 + Height = 201 + Align = alLeft + BevelOuter = bvNone + TabOrder = 1 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object btnOpenClose: TButton + Left = 16 + Top = 72 + Width = 75 + Height = 25 + Caption = 'Open' + TabOrder = 0 + OnClick = btnOpenCloseClick + end + object btnXML: TButton + Left = 16 + Top = 112 + Width = 75 + Height = 25 + Caption = 'Show XML' + TabOrder = 1 + Visible = False + OnClick = btnXMLClick + end + object btnDelphi: TButton + Left = 16 + Top = 152 + Width = 75 + Height = 25 + Caption = 'Delphi Code' + TabOrder = 2 + Visible = False + OnClick = btnDelphiClick + end + end + object Pan_Cond: TPanel + Left = 233 + Top = 0 + Width = 467 + Height = 201 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + Visible = False + object panSet: TPanel + Left = 0 + Top = 0 + Width = 467 + Height = 25 + Align = alTop + BevelOuter = bvNone + Caption = + 'Set Values for appropriated fields and click Open/Refresh button' + + ':' + TabOrder = 0 + end + object Panel4: TPanel + Left = 0 + Top = 25 + Width = 467 + Height = 151 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + object lbOper: TListBox + Left = 0 + Top = 0 + Width = 416 + Height = 151 + Align = alClient + ItemHeight = 13 + TabOrder = 0 + OnClick = lbOperClick + OnDblClick = lbOperDblClick + OnKeyDown = lbOperKeyDown + end + object Panel5: TPanel + Left = 416 + Top = 0 + Width = 51 + Height = 151 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 27 + Height = 151 + Align = alLeft + AutoSize = True + ButtonHeight = 24 + Caption = 'ToolBar1' + EdgeInner = esNone + EdgeOuter = esNone + Images = ImageList1 + Indent = 4 + ParentShowHint = False + ShowHint = True + TabOrder = 0 + Wrapable = False + object tbCondNew: TToolButton + Left = 4 + Top = 2 + Action = aCondNew + Wrap = True + end + object TToolButton + Left = 4 + Top = 26 + Action = aCondEdit + Wrap = True + end + object TToolButton + Left = 4 + Top = 50 + Action = aCondDelete + Wrap = True + end + object TToolButton + Left = 4 + Top = 74 + Action = aCondUp + Wrap = True + end + object TToolButton + Left = 4 + Top = 98 + Action = aCondDown + Wrap = True + end + end + end + end + object Panel6: TPanel + Left = 0 + Top = 176 + Width = 467 + Height = 25 + Align = alBottom + BevelOuter = bvNone + Caption = 'All logical operators have equal precedence!' + TabOrder = 2 + end + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 201 + Width = 700 + Height = 241 + Align = alClient + DataSource = DynWhere_ClientDataForm.ds_Data + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object CondActionList: TActionList + Images = ImageList1 + Left = 337 + Top = 49 + object aCondEdit: TAction + Caption = 'Edit' + Hint = 'Edit' + ImageIndex = 2 + OnExecute = aCondEditExecute + end + object aCondNew: TAction + Caption = 'aCondNew' + Hint = 'New' + ImageIndex = 0 + OnExecute = aCondNewExecute + end + object aCondDelete: TAction + Caption = 'aCondDelete' + Hint = 'Delete' + ImageIndex = 1 + OnExecute = aCondDeleteExecute + end + object aCondUp: TAction + Caption = 'aCondUp' + Hint = 'Up' + ImageIndex = 3 + OnExecute = aCondUpExecute + end + object aCondDown: TAction + Caption = 'aCondDown' + Hint = 'Down' + ImageIndex = 4 + OnExecute = aCondDownExecute + end + end + object ImageList1: TImageList + Left = 425 + Top = 57 + Bitmap = { + 494C010108000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000808000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 000000000000808000000000000000000000C0C0C00000000000000000000000 + 000080808000000000000000000000000000008080000000000000000000C0C0 + C000000000000000000000000000000000008080800000000000000000000000 + 00000000000000000000000000000080800000000000C0C0C00000000000C0C0 + C000000000000000000080808000000000000000000080800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 00000000000000000000000000000000000000000000C0C0C000000000000000 + 00000000000000000000C0C0C00000000000C0C0C00000000000000000000000 + 000000000000000000000000000000000000C0C0C00000000000000000000000 + 0000C0C0C0000000000000000000C0C0C00000000000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C0C0C00000000000000000000000000000000000C0C0C0000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 0000000000000000000000000000000000000000000000000000C0C0C0000000 + 000000000000C0C0C0000000000000000000C0C0C00000000000000000000000 + 0000C0C0C0000000000000000000000000000000000000000000C0C0C0000000 + 000000000000000000000000000000000000C0C0C000C0C0C000000000000000 + 00000000000000000000000000000000000000000000C0C0C00000000000C0C0 + C0000000000000000000C0C0C0000000000000000000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000C0C0C0000000 + 000000000000C0C0C0000000000000000000C0C0C00000000000000000000000 + 0000800000000000000000000000000000000000000080808000000000008080 + 80000000000000000000000000008080800000000000C0C0C000000000000000 + 00000000000000000000000000000080800000000000C0C0C00080008000C0C0 + C0000000000000000000C0C0C0000000000000000000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 00000000000000000000000000000000000000000000C0C0C000000000000000 + 00000000000000000000C0C0C00000000000C0C0C00000000000000000000000 + 000000000000C0C0C000000000000000000000000000C0C0C00000000000C0C0 + C0000000000000000000000000000000000000000000C0C0C000000000000000 + 0000000000000000000000000000000000000000000000000000C0C0C0000000 + 000000000000C0C0C00000000000000000000000000000000000C0C0C0000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000808080000000 + 000000000000808000000000000000000000C0C0C00000000000000000000000 + 0000800000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000008080800000000000C0C0 + C000000000000000000080808000000000000000000080800000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000848484008484 + 8400848484008484840084848400848484008484840084848400848484008484 + 8400848484008484840084848400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF0000000000848484000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00000000000000 + 0000FFFFFF0000FFFF00000000008484840000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF000000000084848400848484000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000000000C6C6 + C60000000000FFFFFF00000000008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C6000000000000000000848484000000840000000000FFFFFF0000FF + FF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF000000000000FF + FF00C6C6C60000000000000000008484840000000000FFFFFF00000000000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FFFF00FFFF + FF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF00000000000000 + 000000000000000000000000000084848400000084000000840000FFFF00FFFF + FF0000FFFF00FFFFFF00848484000000840000FFFF00FFFFFF00000000000000 + 00000000000000000000000000008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000FFFFFF0000000000FFFFFF008484 + 840000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000008484840084848400000084008484840000FF + FF00FFFFFF00848484000000840084848400FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000008484840000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000FFFFFF00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000008484840000FFFF0000FFFF008484 + 8400FFFFFF0000FFFF008484840000FFFF00FFFFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000000008400000084008484 + 840000FFFF000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000008484840000000000FFFFFF00000000000000 + 0000FFFFFF00FFFFFF00FFFFFF0000000000C6C6C60000000000FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 0000000000000000000000000000000000000000000084848400FFFFFF008484 + 840000FFFF008484840000FFFF00FFFFFF0000FFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF0000000000848484000000000084848400000084000000 + 84000000840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FF + FF00FFFFFF0000FFFF00000000008484840000000000FFFFFF0000000000C6C6 + C60000000000FFFFFF0000000000C6C6C60000000000C6C6C600000000000000 + 0000000000000000000084000000840000000000000000000000000000000000 + 0000848400008484000084840000848400008484000084840000848400000000 + 000000000000000000000000000000000000848484008484840084848400FFFF + FF0084848400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF0000000000848484000000000084848400000084000000 + 840000008400FFFFFF0000FFFF00FFFFFF0000FFFF00FFFFFF0000FFFF00FFFF + FF0000FFFF00FFFFFF00000000008484840000000000FFFFFF00FFFFFF000000 + 0000C6C6C60000000000C6C6C60000000000C6C6C60000000000C6C6C600C6C6 + C600C6C6C6000000000084000000840000000000000000000000000000000000 + 0000000000008484000084840000848400008484000084840000000000000000 + 000000000000000000000000000000000000FFFFFF0000FFFF008484840000FF + FF00FFFFFF008484840084848400848484008484840000000000000000000000 + 0000000000000000000000000000000000008484840000008400000084000000 + 8400000084008484840000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000C6C6C60000000000C6C6C60000000000C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C60084000000840000000000000000000000000000000000 + 0000000000000000000084840000848400008484000000000000000000000000 + 000000000000000000000000000000000000000000008484840000FFFF008484 + 840000FFFF008484840000FFFF00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000840000008400848484000000 + 0000000084000000840084848400000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000C6C6C60000000000C6C6C600C6C6C600C6C6C600C6C6 + C600C6C6C600C6C6C60084000000840000000000000000000000000000000000 + 0000000000000000000000000000848400000000000000000000000000000000 + 0000000000000000000000000000000000008484840000FFFF00000000008484 + 8400FFFFFF00000000008484840000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000840000008400848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000C6C6C600C6C6C600C6C6C600C6C6C600C6C6 + C600C6C6C6000000000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000000000000000008484 + 840000FFFF000000000000000000848484000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000008400000084008484840000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000084000000840000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008484 + 8400FFFFFF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC7FFFFF7591FFFF + F83FC33325162436F01F99370416A996E00F99278C168995C00799078C968991 + F83F99338D918996F83FC307FFFF2431F83FFFFFFFFFFFFFF83FFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC000C000000FFFFF + 80008000000FFFFF80008000000FFFFF80000000000FF83F80000000000FF83F + 80000000000FF83F00000000000FF83F00008000000FC007800080000004E00F + 000080000000F01F000100010000F83F81FF11FFF800FC7F24FFF8FFFC00FEFF + 66FFFC7FFE04FFFFE7FFFFFFFFFFFFFF00000000000000000000000000000000 + 000000000000} + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientMain.pas new file mode 100644 index 0000000..08fe292 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ClientMain.pas @@ -0,0 +1,499 @@ +unit DynWhere_ClientMain; + +interface + +uses + Forms, StdCtrls, Controls, Grids, DBGrids, Classes, ExtCtrls, + ActnList, Buttons, ImgList, ComCtrls, ToolWin, Menus, + uROPoweredByRemObjectsButton, + uDAPoweredByDataAbstractButton, + uDAInterfaces + ; + +type + TFldOperator = record + FldName: string; + LogOper: TDABinaryOperator; + Oper: TDABinaryOperator; + Value: variant; + end; + + TDynWhere_ClientForm = class(TForm) + Panel1: TPanel; + DBGrid: TDBGrid; + Panel2: TPanel; + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + btnOpenClose: TButton; + Pan_Cond: TPanel; + panSet: TPanel; + btnXML: TButton; + Panel4: TPanel; + lbOper: TListBox; + Panel5: TPanel; + Panel6: TPanel; + CondActionList: TActionList; + aCondEdit: TAction; + aCondNew: TAction; + aCondDelete: TAction; + aCondUp: TAction; + ImageList1: TImageList; + ToolBar1: TToolBar; + aCondDown: TAction; + tbCondNew: TToolButton; + btnDelphi: TButton; + procedure btnXMLClick(Sender: TObject); + procedure btnOpenCloseClick(Sender: TObject); + procedure lbOperDblClick(Sender: TObject); + procedure aCondEditExecute(Sender: TObject); + procedure aCondNewExecute(Sender: TObject); + procedure aCondDeleteExecute(Sender: TObject); + procedure aCondUpExecute(Sender: TObject); + procedure aCondDownExecute(Sender: TObject); + procedure lbOperKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure btnDelphiClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure lbOperClick(Sender: TObject); + private + { Private declarations } + fExpression: array of TFldOperator; + fXML: string; + fDelphiCode: string; + procedure CheckEditButtons(); + procedure RebuildCondList(); + function GetXML(): string; + public + { Public declarations } + end; + +var + DynWhere_ClientForm: TDynWhere_ClientForm; + +implementation + +uses + Windows, SysUtils, Variants, TypInfo, + uDADataTable, uDASQL92QueryBuilder, + DynWhere_ClientData, memoForm, WhereExpression; + +{$R *.dfm} + +const + c_Invalid_XML = '*'; + +procedure TDynWhere_ClientForm.FormCreate(Sender: TObject); +begin + fXML := c_Invalid_XML; + ActiveControl := btnOpenClose; +end; + +procedure TDynWhere_ClientForm.btnOpenCloseClick(Sender: TObject); +var + Tbl: TDADataTable; + OldCur: TCursor; + XML: string; +begin + OldCur := Screen.Cursor; + + try + Screen.Cursor := crHourGlass; + Tbl := DynWhere_ClientDataForm.tbl_Data; + + if Pan_Cond.Visible then + begin + Tbl.Active := False; + XML := GetXML(); + + if XML = '' then + Tbl.DynamicWhere.Clear() + else + Tbl.DynamicWhere.Xml := GetXML(); + + Tbl.Active := True; + end + else + begin + Tbl.Active := True; + Pan_Cond.Visible := True; + btnOpenClose.Caption := 'Refresh'; + btnXML.Visible := True; + btnDelphi.Visible := True; + end; + + ActiveControl := lbOper; + CheckEditButtons(); + finally + Screen.Cursor := OldCur; + end; +end; + +procedure TDynWhere_ClientForm.btnXMLClick(Sender: TObject); +begin + TfrmMemo.Execute('XML pass to Server', GetXML(), True); +end; + +procedure TDynWhere_ClientForm.lbOperDblClick(Sender: TObject); +begin + aCondEdit.Execute(); +end; + +procedure TDynWhere_ClientForm.lbOperClick(Sender: TObject); +begin + CheckEditButtons(); +end; + +procedure TDynWhere_ClientForm.aCondEditExecute(Sender: TObject); +var + i: integer; +begin + i := integer(lbOper.Items.Objects[lbOper.ItemIndex]); + + if TWhereExpressionForm.Execute(DynWhere_ClientDataForm.tbl_Data.Fields, + fExpression[i].FldName, fExpression[i].LogOper, + fExpression[i].Oper, fExpression[i].Value) then + RebuildCondList(); +end; + +procedure TDynWhere_ClientForm.aCondNewExecute(Sender: TObject); +var + FldName: string; + LogOper, Oper: TDABinaryOperator; + Value: variant; + i: integer; +begin + if TWhereExpressionForm.Execute(DynWhere_ClientDataForm.tbl_Data.Fields, + FldName, LogOper, Oper, Value) then + begin + SetLength(fExpression, Length(fExpression) + 1); + i := High(fExpression); + fExpression[i].FldName := FldName; + fExpression[i].LogOper := LogOper; + fExpression[i].Oper := Oper; + fExpression[i].Value := Value; + RebuildCondList(); + lbOper.ItemIndex := lbOper.Items.Count - 1; + CheckEditButtons(); + end; +end; + +procedure TDynWhere_ClientForm.aCondDeleteExecute(Sender: TObject); +var + i, ii: integer; +begin + ii := lbOper.ItemIndex; + + if ii >= 0 then + begin + ii := integer(lbOper.Items.Objects[ii]); + + for i := ii + 1 to High(fExpression) do + fExpression[i - 1] := fExpression[i]; + + SetLength(fExpression, Length(fExpression) - 1); + RebuildCondList(); + end; +end; + +procedure TDynWhere_ClientForm.aCondUpExecute(Sender: TObject); +var + i: integer; + Oper: TFldOperator; +begin + i := integer(lbOper.Items.Objects[lbOper.ItemIndex]); + Oper := fExpression[i]; + fExpression[i] := fExpression[i - 1]; + fExpression[i - 1] := Oper; + lbOper.ItemIndex := i - 1; + RebuildCondList(); +end; + +procedure TDynWhere_ClientForm.aCondDownExecute(Sender: TObject); +var + i: integer; + Oper: TFldOperator; +begin + i := integer(lbOper.Items.Objects[lbOper.ItemIndex]); + Oper := fExpression[i]; + fExpression[i] := fExpression[i + 1]; + fExpression[i + 1] := Oper; + lbOper.ItemIndex := i + 1; + RebuildCondList(); +end; + +procedure TDynWhere_ClientForm.CheckEditButtons(); +var + ii: integer; +begin + ii := lbOper.ItemIndex; + aCondUp.Enabled := (ii > 0); + aCondDown.Enabled := (ii >= 0) and (ii < (lbOper.Items.Count - 1)); + aCondEdit.Enabled := (ii >= 0); + aCondDelete.Enabled := (ii >= 0); + btnXML.Enabled := (lbOper.Items.Count > 0); +end; + +procedure TDynWhere_ClientForm.RebuildCondList(); + function Val2Str(const FldName: string; const Val: variant; IsList: Boolean): string; + var + DT: TDADataType; + Lst: TStrings; + i: integer; + begin + if IsList then + begin + Result := ''; + Lst := TStringList.Create(); + + try + Lst.CommaText := string(Val); + for i := 0 to Lst.Count - 1 do + if Result = '' then + Result := Val2Str(FldName, Lst[i], False) + else + Result := Result + ',' + Val2Str(FldName, Lst[i], False); + finally + Lst.Free(); + end; + end + else + begin + DT := DynWhere_ClientDataForm.tbl_Data.FieldByName(FldName).DataType; + + if DT = datDateTime then + if VarType(Val) = varString then + Result := '''' + Val + '''' + else + Result := '''' + DateTimeToStr(Val) + '''' + else + if DT in [datString, datWideString, datMemo, datWideMemo] then + Result := '''' + Val + '''' + else + Result := Val; + end; + end; +const + c_Oper: array[TDABinaryOperator] of string = + ('AND', 'OR', 'XOR', '<', '<=', '>', '>=', '!=', '=', 'like', 'in', '+', '-', '*', '/',''); +var + i, ii: integer; + sOper, sValue: string; +begin + fXML := c_Invalid_XML; + ii := lbOper.ItemIndex; + lbOper.Items.BeginUpdate; + + try + lbOper.Items.Clear; + + for i := Low(fExpression) to High(fExpression) do + begin + if fExpression[i].Oper = dboIn then + sValue := Format('in (%s)', [Val2Str(fExpression[i].FldName, fExpression[i].Value, True)]) else + if fExpression[i].Oper = dboNotIn then + sValue := Format('not in (%s)', [Val2Str(fExpression[i].FldName, fExpression[i].Value, True)]) else + if VarIsNULL(fExpression[i].Value) then + if fExpression[i].Oper = dboEqual then + sValue := 'is NULL' + else + sValue := 'is not NULL' + else + sValue := c_Oper[fExpression[i].Oper] + ' ' + + Val2Str(fExpression[i].FldName, fExpression[i].Value, False); + + sOper := c_Oper[fExpression[i].LogOper]; + + if lbOper.Items.Count = 0 then + sOper := '/* ' + sOper + ' */'; + + lbOper.Items.AddObject(Format('%s %s %s', + [sOper, fExpression[i].FldName, sValue]), + TObject(i)); + end; + finally + lbOper.Items.EndUpdate; + end; + + if ii >= lbOper.Items.Count then + ii := lbOper.Items.Count - 1; + + lbOper.ItemIndex := ii; + CheckEditButtons(); +end; + +procedure TDynWhere_ClientForm.lbOperKeyDown(Sender: TObject; + var Key: Word; Shift: TShiftState); +begin + if Key = VK_INSERT then + aCondNew.Execute() + else if Key = VK_DELETE then + aCondDelete.Execute() + else if (Key = VK_F2) or (Key = VK_RETURN) then + aCondEdit.Execute() + else if (Shift = [ssCtrl]) and (Key = VK_UP) then + aCondUp.Execute() + else if (Shift = [ssCtrl]) and (Key = VK_DOWN) then + aCondDown.Execute(); +end; + +procedure TDynWhere_ClientForm.btnDelphiClick(Sender: TObject); +begin + GetXML(); + TfrmMemo.Execute('Delphi Code', fDelphiCode, False); +end; + +function TDynWhere_ClientForm.GetXML(): string; +var + i, j: integer; + L, R, Where, Expr: TDAWhereExpression; + Lst: TStrings; + aExpr: array of TDAWhereExpression; + DT: TDADataType; + NeedNot: Boolean; + LogOper: TDABinaryOperator; + WB: TDAWhereBuilder; + Log: TStrings; + S: string; + + function sMake_Const(const V: variant): string; + begin + if VarIsNULL(V) then + Result := 'NewNull()' + else + begin + if DT = datDateTime then + if VarType(V) = varString then + Result := Format('StrToDateTime(''%s'')', [string(V)]) + else + Result := Format('StrToDateTime(''%s'')', [DateToStr(V)]) + else + if DT in [datString, datWideString, datMemo, datWideMemo] then + Result := Format('''%s''', [string(V)]) + else + Result := V; + + Result := Format('NewConstant(%s, %s)', + [Result, GetEnumName(TypeInfo(TDADataType), integer(DT))]); + end; + end; + +begin + if fXML = c_Invalid_XML then + begin + WB := nil; + Where := nil; + Log := TStringList.Create; + + try + Log.Add('procedure Make_DynamicWhere;'); + Log.Add('var'); + Log.Add(' L, R, Expr: TDAWhereExpression;'); + Log.Add('begin'); + Log.Add(' DADataTable.Close();'); + Log.Add(''); + Log.Add(' with DADataTable.DynamicWhere do'); + Log.Add(' begin'); + Log.Add(' Clear();'); + + for i := Low(fExpression) to High(fExpression) do + begin + if WB = nil then + WB := TDAWhereBuilder.Create(); + + NeedNot := False; + LogOper := fExpression[i].Oper; + DT := DynWhere_ClientDataForm.tbl_Data.FieldByName(fExpression[i].FldName).DataType; + + if LogOper = dboIn then + begin + Lst := TStringList.Create(); + + try + Lst.CommaText := fExpression[i].Value; + SetLength(aExpr, Lst.Count); + S := ''; + + for j := 0 to Lst.Count - 1 do + begin + if DT = datDateTime then + aExpr[j] := WB.NewConstant(StrToDateTime(Lst[j]), DT) + else + aExpr[j] := WB.NewConstant(Lst[j], DT); + + if S = '' then + S := sMake_Const(Lst[j]) + else + S := Format('%s, %s', [S, sMake_Const(Lst[j])]); + end; + finally + Lst.Free; + end; + + R := WB.NewList(aExpr); + Log.Add(Format(' R := NewList([%s]);', [S])); + end + else + begin + if VarIsNULL(fExpression[i].Value) then + begin + R := WB.NewNull(); + + if LogOper = dboNotEqual then + begin + LogOper := dboEqual; + NeedNot := True; + end; + end + else + R := WB.NewConstant(fExpression[i].Value, DT); + end; + + Log.Add(Format(' R := %s;', [sMake_Const(fExpression[i].Value)])); + L := WB.NewField('', fExpression[i].FldName); + Log.Add(Format(' L := NewField('''', ''%s'');', [fExpression[i].FldName])); + Expr := WB.NewBinaryExpression(L, R, LogOper); + Log.Add(Format(' Expr := NewBinaryExpression(L, R, %s);', + [GetEnumName(TypeInfo(TDABinaryOperator), integer(LogOper))])); + + if NeedNot then + begin + Expr := WB.NewUnaryExpression(Expr, duoNot); + Log.Add(' Expr := NewUnaryExpression(Expr, duoNot);'); + end; + + if Assigned(Where) then + begin + Where := WB.NewBinaryExpression(Where, Expr, fExpression[i].LogOper); + Log.Add(Format(' Expression := NewBinaryExpression(Expression, Expr, %s);', + [GetEnumName(TypeInfo(TDABinaryOperator), integer(fExpression[i].LogOper))])); + end + else + begin + Where := Expr; + Log.Add(' Expression := Expr;'); + end; + end; + + if Assigned(WB) then + begin + WB.Expression := Where; + fXML := WB.XML; + end + else + fXML := ''; + + Log.Add(' end;'); + Log.Add(''); + Log.Add(' DADataTable.Open();'); + Log.Add('end;'); + fDelphiCode := Log.Text; + finally + WB.Free; + Log.Free; + end; + end; + + Result := fXML; +end; + + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Library.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Library.rodl new file mode 100644 index 0000000..ddc076a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Library.rodl @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Library_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Library_Intf.pas new file mode 100644 index 0000000..28cc52f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Library_Intf.pas @@ -0,0 +1,82 @@ +unit DynWhere_Library_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{6FE385D0-259A-47F4-933C-9626A169FB88}'; + TargetNamespace = ''; + + { Service Interface ID's } + IDynWhere_Service_IID : TGUID = '{55D412A7-8A48-4BD1-B557-BCA976C2AF80}'; + + { Event ID's } + +type + { Forward declarations } + IDynWhere_Service = interface; + + + + + + { Enumerateds } + + { IDynWhere_Service } + IDynWhere_Service = interface(IDataAbstractService) + ['{55D412A7-8A48-4BD1-B557-BCA976C2AF80}'] + end; + + { CoDynWhere_Service } + CoDynWhere_Service = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDynWhere_Service; + end; + + { TDynWhere_Service_Proxy } + TDynWhere_Service_Proxy = class(TDataAbstractService_Proxy, IDynWhere_Service) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoDynWhere_Service } + +class function CoDynWhere_Service.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDynWhere_Service; +begin + result := TDynWhere_Service_Proxy.Create(aMessage, aTransportChannel); +end; + +function TDynWhere_Service_Proxy.__GetInterfaceName:string; +begin + result := 'DynWhere_Service'; +end; + +initialization + RegisterProxyClass(IDynWhere_Service_IID, TDynWhere_Service_Proxy); + + +finalization + UnregisterProxyClass(IDynWhere_Service_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Library_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Library_Invk.pas new file mode 100644 index 0000000..519605e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Library_Invk.pas @@ -0,0 +1,35 @@ +unit DynWhere_Library_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} DynWhere_Library_Intf; + +type + TDynWhere_Service_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Server.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Server.dpr new file mode 100644 index 0000000..782bc8b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Server.dpr @@ -0,0 +1,30 @@ +program DynWhere_Server; + +{#ROGEN:DynWhere_Library.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + DynWhere_ServerMain in 'DynWhere_ServerMain.pas' {ServerForm}, + DynWhere_ServerData in 'DynWhere_ServerData.pas' {ServerDataModule: TDataModule}, + DynWhere_Library_Intf in 'DynWhere_Library_Intf.pas', + DynWhere_Library_Invk in 'DynWhere_Library_Invk.pas', + DynWhere_Service_Impl in 'DynWhere_Service_Impl.pas' {DynWhere_Service: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + if ROStartService('DynWhere', 'DynWhere') then begin + ROService.CreateForm(TServerDataModule, ServerDataModule); + ROService.Run; + Exit; + end; + + Application.Initialize; + Application.Title := 'Dynamic Where - Server'; + Application.CreateForm(TServerDataModule, ServerDataModule); + Application.CreateForm(TServerForm, ServerForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Server.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Server.dproj new file mode 100644 index 0000000..0ee5b0a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Server.dproj @@ -0,0 +1,219 @@ + + + {d7530199-da63-4dbd-b1b3-7f797bcb5316} + DynWhere_Server.dpr + Debug + AnyCPU + DCC32 + DynWhere_Server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Core Lab Data Access GUI related Components + Core Lab Data Access Components + Data Access Components for MySQL + MySQL Data Access GUI related Components + Oracle Data Access Components + Oracle Data Access GUI related Components + SQL Server Data Access Components + SQL Server Data Access GUI related Components + RemObjects Data Abstract - InterBase Express Driver + RemObjects Data Abstract - Scripting Integration Library + RemObjects Data Abstract - dbExpress Driver + RemObjects Data Abstract - SQLite Driver + RemObjects Data Abstract - DBISAM Driver + RemObjects Data Abstract - ElevateDB Driver + RemObjects Data Abstract - FIBPlus Driver + RemObjects Data Abstract - CoreLabs IBDAC Driver + RemObjects Data Abstract - CoreLabs MyDAC Driver + Data Abstract - NexusDB Driver + RemObjects Data Abstract - CoreLabs ODAC Driver + RemObjects Data Abstract - MicroOlap PostgresDAC Driver + RemObjects Data Abstract - 'Rosetta' + RemObjects Data Abstract - CoreLabs SDAC Driver + CodeGear C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + Core Lab InterBase Data Access Components + Data Access Components for MySQL - TMySQLMonitor + + + DynWhere_Server.dpr + + + + + + + MainSource + + + + +
ServerDataModule
+ TDataModule +
+ +
ServerForm
+
+ +
DynWhere_Service
+ TDataAbstractService +
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Server.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Server.res new file mode 100644 index 0000000..7c48bdb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Server.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerData.dfm new file mode 100644 index 0000000..f46aae9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerData.dfm @@ -0,0 +1,63 @@ +object ServerDataModule: TServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 362 + Top = 208 + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'ADO Connection to Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI;' + ConnectionType = 'MSSQL' + Default = True + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object IBXDriver: TDAIBXDriver + Left = 256 + Top = 56 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerData.pas new file mode 100644 index 0000000..b987dda --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerData.pas @@ -0,0 +1,42 @@ +unit DynWhere_ServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAIBXDriver, uDAADODriver, uROIndyTCPServer; + +type + TServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + IBXDriver: TDAIBXDriver; + DataDictionary: TDADataDictionary; + SessionManager: TROInMemorySessionManager; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ServerDataModule: TServerDataModule; + +implementation + +{$R *.dfm} + +procedure TServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerMain.dfm new file mode 100644 index 0000000..4d24bf1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerMain.dfm @@ -0,0 +1,21 @@ +object ServerForm: TServerForm + Left = 372 + Top = 277 + BorderStyle = bsDialog + Caption = 'Dynamic Where Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerMain.pas new file mode 100644 index 0000000..198c6ec --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_ServerMain.pas @@ -0,0 +1,26 @@ +unit DynWhere_ServerMain; + +interface + +uses + Forms, Classes, Controls, + uROPoweredByRemObjectsButton, uDAPoweredByDataAbstractButton + ; + +type + TServerForm = class(TForm) + DAPoweredByDataAbstractButton: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + ServerForm: TServerForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Service_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Service_Impl.dfm new file mode 100644 index 0000000..756742d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Service_Impl.dfm @@ -0,0 +1,318 @@ +object DynWhere_Service: TDynWhere_Service + OldCreateOrder = True + SessionManager = ServerDataModule.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Left = 400 + Top = 232 + Height = 300 + Width = 300 + object Schema: TDASchema + ConnectionManager = ServerDataModule.ConnectionManager + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO Connection to Northwind' + ConnectionType = 'MSSQL' + Default = True + TargetTable = 'Employees' + Name = 'ADO Connection to Northwind' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'LastName' + TableField = 'LastName' + end + item + DatasetField = 'FirstName' + TableField = 'FirstName' + end + item + DatasetField = 'Title' + TableField = 'Title' + end + item + DatasetField = 'TitleOfCourtesy' + TableField = 'TitleOfCourtesy' + end + item + DatasetField = 'BirthDate' + TableField = 'BirthDate' + end + item + DatasetField = 'HireDate' + TableField = 'HireDate' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'HomePhone' + TableField = 'HomePhone' + end + item + DatasetField = 'Extension' + TableField = 'Extension' + end + item + DatasetField = 'Photo' + TableField = 'Photo' + end + item + DatasetField = 'Notes' + TableField = 'Notes' + end + item + DatasetField = 'ReportsTo' + TableField = 'ReportsTo' + end + item + DatasetField = 'PhotoPath' + TableField = 'PhotoPath' + end> + end> + Name = 'Employees' + Fields = < + item + Name = 'EmployeeID' + DataType = datAutoInc + GeneratorName = 'Employees' + Required = True + InPrimaryKey = True + end + item + Name = 'LastName' + DataType = datWideString + Size = 20 + Required = True + end + item + Name = 'FirstName' + DataType = datWideString + Size = 10 + Required = True + end + item + Name = 'Title' + DataType = datWideString + Size = 30 + end + item + Name = 'TitleOfCourtesy' + DataType = datWideString + Size = 25 + end + item + Name = 'BirthDate' + DataType = datDateTime + end + item + Name = 'HireDate' + DataType = datDateTime + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + end + item + Name = 'City' + DataType = datWideString + Size = 15 + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + end + item + Name = 'HomePhone' + DataType = datWideString + Size = 24 + end + item + Name = 'Extension' + DataType = datWideString + Size = 4 + end + item + Name = 'Photo' + DataType = datBlob + end + item + Name = 'Notes' + DataType = datMemo + end + item + Name = 'ReportsTo' + DataType = datInteger + end + item + Name = 'PhotoPath' + DataType = datWideString + Size = 255 + end> + end + item + Params = <> + Statements = < + item + Connection = 'ADO Connection to Northwind' + Default = True + TargetTable = 'Customers' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + Required = True + InPrimaryKey = True + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + Required = True + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + end + item + Name = 'City' + DataType = datWideString + Size = 15 + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + end> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 32 + Top = 24 + end + object DataStreamer: TDABin2DataStreamer + Left = 32 + Top = 72 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Service_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Service_Impl.pas new file mode 100644 index 0000000..51bad03 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/DynWhere_Service_Impl.pas @@ -0,0 +1,50 @@ +unit DynWhere_Service_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} DynWhere_Library_Intf, uDAClasses, uDADataStreamer, + uDABin2DataStreamer; + +type + { TDynWhere_Service } + TDynWhere_Service = class(TDataAbstractService, IDynWhere_Service) + DataStreamer: TDABin2DataStreamer; + Schema: TDASchema; + private + protected + { IDynWhere_Service methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} DynWhere_Library_Invk, DynWhere_ServerData; + +procedure Create_DynWhere_Service(out anInstance : IUnknown); +begin + anInstance := TDynWhere_Service.Create(nil); +end; + +{ DynWhere_Service } +initialization + TROClassFactory.Create('DynWhere_Service', Create_DynWhere_Service, TDynWhere_Service_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/RODLFILE.res new file mode 100644 index 0000000..5b009d0 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/WhereExpression.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/WhereExpression.dfm new file mode 100644 index 0000000..581c77b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/WhereExpression.dfm @@ -0,0 +1,151 @@ +object WhereExpressionForm: TWhereExpressionForm + Left = 299 + Top = 154 + BorderIcons = [biSystemMenu] + BorderStyle = bsSingle + Caption = 'Single Expresion' + ClientHeight = 147 + ClientWidth = 519 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 519 + Height = 106 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 72 + Top = 16 + Width = 53 + Height = 13 + Caption = 'Field Name' + end + object Label2: TLabel + Left = 216 + Top = 16 + Width = 46 + Height = 13 + Caption = 'Operation' + end + object lbValue: TLabel + Left = 304 + Top = 16 + Width = 27 + Height = 13 + Caption = 'Value' + Visible = False + end + object cmbFldName: TComboBox + Left = 72 + Top = 32 + Width = 137 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnClick = cmbFldNameClick + OnKeyPress = cmbFldNameKeyPress + end + object cmbOper: TComboBox + Left = 216 + Top = 32 + Width = 81 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 1 + OnClick = cmbOperClick + OnKeyPress = cmbOperKeyPress + end + object edtValue: TEdit + Left = 304 + Top = 32 + Width = 209 + Height = 21 + TabOrder = 2 + Visible = False + OnChange = edtValueChange + end + object dtValue: TDateTimePicker + Left = 304 + Top = 32 + Width = 97 + Height = 21 + Date = 39354.876083981480000000 + Time = 39354.876083981480000000 + TabOrder = 3 + Visible = False + OnChange = edtValueChange + end + object emValue: TRichEdit + Left = 304 + Top = 32 + Width = 209 + Height = 65 + ScrollBars = ssBoth + TabOrder = 4 + Visible = False + WordWrap = False + OnChange = edtValueChange + end + object cmbLogOper: TComboBox + Left = 8 + Top = 32 + Width = 57 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + ItemIndex = 0 + TabOrder = 5 + Text = 'AND' + OnClick = cmbLogOperClick + OnKeyPress = cmbLogOperKeyPress + Items.Strings = ( + 'AND' + 'OR' + 'XOR') + end + end + object Panel2: TPanel + Left = 0 + Top = 106 + Width = 519 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 1 + DesignSize = ( + 519 + 41) + object btnOK: TButton + Left = 330 + Top = 0 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 0 + OnClick = btnOKClick + end + object btnCancel: TButton + Left = 426 + Top = 0 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + end + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/WhereExpression.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/WhereExpression.pas new file mode 100644 index 0000000..539a7e0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/WhereExpression.pas @@ -0,0 +1,418 @@ +unit WhereExpression; + +interface + +uses + Forms, Controls, StdCtrls, Classes, ExtCtrls, + uDAInterfaces, ComCtrls + ; + +type + TWhereExpressionForm = class(TForm) + Panel1: TPanel; + Panel2: TPanel; + btnOK: TButton; + btnCancel: TButton; + Label1: TLabel; + cmbFldName: TComboBox; + Label2: TLabel; + cmbOper: TComboBox; + lbValue: TLabel; + edtValue: TEdit; + dtValue: TDateTimePicker; + emValue: TRichEdit; + cmbLogOper: TComboBox; + procedure cmbOperKeyPress(Sender: TObject; var Key: Char); + procedure cmbOperClick(Sender: TObject); + procedure cmbFldNameClick(Sender: TObject); + procedure cmbFldNameKeyPress(Sender: TObject; var Key: Char); + procedure edtValueChange(Sender: TObject); + procedure btnOKClick(Sender: TObject); + procedure cmbLogOperClick(Sender: TObject); + procedure cmbLogOperKeyPress(Sender: TObject; var Key: Char); + private + { Private declarations } + fFlds: TDAFieldCollection; + fDT: TDADataType; + procedure CheckOper(); + procedure CheckButtons(); + function CheckExpresion(): Boolean; + public + { Public declarations } + function ExecuteEx(AFlds: TDAFieldCollection; + var FldName: string; var LogOper, Oper: TDABinaryOperator; var Value: variant): Boolean; + class function Execute(AFlds: TDAFieldCollection; + var FldName: string; var LogOper, Oper: TDABinaryOperator; var Value: variant): Boolean; + end; + + +implementation + +uses + SysUtils, Variants, Dialogs + ; + +{$R *.dfm} + +const + c_is_NULL = -2; + c_is_not_NULL = -3; + +var + Frm: TWhereExpressionForm = nil; + +class function TWhereExpressionForm.Execute(AFlds: TDAFieldCollection; + var FldName: string; var LogOper, Oper: TDABinaryOperator; var Value: variant): Boolean; +begin + if not Assigned(Frm) then + Frm := TWhereExpressionForm.Create(Application); + + Result := Frm.ExecuteEx(AFlds, FldName, LogOper, Oper, Value); +end; + +function TWhereExpressionForm.ExecuteEx(AFlds: TDAFieldCollection; + var FldName: string; var LogOper, Oper: TDABinaryOperator; var Value: variant): Boolean; +var + i, ii: integer; +begin + Result := False; + fFlds := AFlds; + ii := -1; + fDT := datUnknown; + lbValue.Visible := False; + emValue.Visible := False; + dtValue.Visible := False; + edtValue.Visible := False; + + for i := 0 to fFlds.Count - 1 do + begin + cmbFldName.Items.AddObject(fFlds[i].Name, TObject(fFlds[i].DataType)); + + if AnsiSameText(FldName, fFlds[i].Name) then + ii := i; + end; + + emValue.Lines.Clear(); + edtValue.Clear(); + cmbFldName.ItemIndex := ii; + CheckOper(); + + if ii >= 0 then + begin + if VarIsNULL(Value) then + if Oper = dboEqual then + ii := c_is_NULL + else + ii := c_is_not_NULL + else + ii := integer(Oper); + + if LogOper = dboAnd then + cmbLogOper.ItemIndex := 0 + else + if LogOper = dboOr then + cmbLogOper.ItemIndex := 1 + else + if LogOper = dboXor then + cmbLogOper.ItemIndex := 2; + + for i := 0 to cmbOper.Items.Count - 1 do + if integer(cmbOper.Items.Objects[i]) = ii then + begin + cmbOper.ItemIndex := i; + cmbOperClick(cmbOper); + + if emValue.Visible then + emValue.Lines.CommaText := Value + else + if dtValue.Visible then + dtValue.Date := Value + else + if edtValue.Visible then + edtValue.Text := Value; + + break; + end; + end + else + cmbLogOper.ItemIndex := 0; + + btnOK.Enabled := False; + + if ShowModal = mrOK then + begin + FldName := cmbFldName.Items[cmbFldName.ItemIndex]; + ii := integer(cmbOper.Items.Objects[cmbOper.ItemIndex]); + + if ii = c_is_NULL then + begin + Oper := dboEqual; + Value := NULL; + end + else + if ii = c_is_not_NULL then + begin + Oper := dboNotEqual; + Value := NULL; + end + else + begin + if emValue.Visible then + begin + for i := emValue.Lines.Count - 1 downto 0 do + if Trim(emValue.Lines[i]) = '' then + emValue.Lines.Delete(i); + + if emValue.Lines.Count > 0 then + Value := Trim(emValue.Lines.CommaText) + else + begin + Result := False; + exit; + end; + end + else + if dtValue.Visible then + Value := VarFromDateTime(Trunc(dtValue.Date)) + else + if edtValue.Visible then + Value := Trim(edtValue.Text); + + Oper := TDABinaryOperator(ii); + end; + + if cmbLogOper.ItemIndex = 0 then + LogOper := dboAnd + else + if cmbLogOper.ItemIndex = 1 then + LogOper := dboOr + else + if cmbLogOper.ItemIndex = 2 then + LogOper := dboXor; + + Result := True; + end; +end; + +procedure TWhereExpressionForm.cmbOperClick(Sender: TObject); +begin + if cmbOper.DroppedDown + or (cmbOper.ItemIndex < 0) then + exit; + + if integer(cmbOper.Items.Objects[cmbOper.ItemIndex]) < 0 then + begin + lbValue.Visible := False; + emValue.Visible := False; + dtValue.Visible := False; + edtValue.Visible := False; + end + else + begin + lbValue.Visible := True; + + if TDABinaryOperator(cmbOper.Items.Objects[cmbOper.ItemIndex]) = dboIn then + begin + emValue.Visible := True; + dtValue.Visible := False; + edtValue.Visible := False; + end + else + begin + emValue.Visible := False; + + if TDADataType(cmbFldName.Items.Objects[cmbFldName.ItemIndex]) = datDateTime then + begin + dtValue.Visible := True; + edtValue.Visible := False; + end + else + begin + dtValue.Visible := False; + edtValue.Visible := True; + end; + end; + end; + + CheckButtons(); +end; + +procedure TWhereExpressionForm.cmbOperKeyPress(Sender: TObject; + var Key: Char); +begin + if Key = #13 then + begin + if cmbOper.DroppedDown then + cmbOper.DroppedDown := False; + + cmbOperClick(Sender); + Key := #0; + end; +end; + +procedure TWhereExpressionForm.cmbFldNameClick(Sender: TObject); +begin + if cmbFldName.DroppedDown + or (cmbFldName.ItemIndex < 0) then + exit; + + CheckOper(); +end; + +procedure TWhereExpressionForm.cmbFldNameKeyPress(Sender: TObject; + var Key: Char); +begin + if Key = #13 then + begin + if cmbFldName.DroppedDown then + cmbFldName.DroppedDown := False; + + cmbFldNameClick(Sender); + Key := #0; + end; +end; + +procedure TWhereExpressionForm.cmbLogOperClick(Sender: TObject); +begin + if cmbLogOper.DroppedDown + or (cmbLogOper.ItemIndex < 0) then + exit; + + CheckButtons(); +end; + +procedure TWhereExpressionForm.cmbLogOperKeyPress(Sender: TObject; + var Key: Char); +begin + if Key = #13 then + begin + if cmbLogOper.DroppedDown then + cmbLogOper.DroppedDown := False; + + cmbLogOperClick(Sender); + Key := #0; + end; +end; + +procedure TWhereExpressionForm.CheckOper(); + procedure Add_CmbOper(const Oper: array of TDABinaryOperator; + const Txt: array of string); + var + i: integer; + begin + cmbOper.Items.Clear; + + for i := Low(Oper) to High(Oper) do + cmbOper.Items.AddObject(Txt[i], TObject(integer(Oper[i]))); + + cmbOper.Items.AddObject('in', TObject(dboIn)); + cmbOper.Items.AddObject('not in', TObject(dboNotIn)); + cmbOper.Items.AddObject('is NULL', TObject(c_is_NULL)); + cmbOper.Items.AddObject('is not NULL', TObject(c_is_not_NULL)); + cmbOper.ItemIndex := 0; + end; + +var + DT: TDADataType; +begin + cmbOper.Enabled := (cmbFldName.ItemIndex >= 0); + + if cmbOper.Enabled then + begin + DT := TDADataType(cmbFldName.Items.Objects[cmbFldName.ItemIndex]); + + if fDT <> DT then + begin + if DT in [datString, datWideString, datMemo, datWideMemo] then + Add_CmbOper([dboLike, dboEqual, dboNotEqual], ['like', '=', '!=']) + else + Add_CmbOper([dboEqual, dboNotEqual, dboGreater, dboGreaterOrEqual, dboLess, dboLessOrEqual], + ['=', '!=', '>', '>=', '<', '<=']); + fDT := DT; + end; + end + else + cmbOper.Items.Clear; + + cmbOperClick(cmbOper); + CheckButtons(); +end; + +procedure TWhereExpressionForm.CheckButtons(); +begin + btnOK.Enabled := (cmbFldName.ItemIndex >= 0) + and (cmbOper.ItemIndex >= 0); + + if btnOK.Enabled then + if integer(cmbOper.Items.Objects[cmbOper.ItemIndex]) >= 0 then + begin + if emValue.Visible then + btnOK.Enabled := (Trim(emValue.Text) <> '') + else + if dtValue.Visible then + btnOK.Enabled := dtValue.Date > 0 + else + if edtValue.Visible then + btnOK.Enabled := (Trim(edtValue.Text) <> '') + else + btnOK.Enabled := False; + end; +end; + +procedure TWhereExpressionForm.edtValueChange(Sender: TObject); +begin + CheckButtons(); +end; + +procedure TWhereExpressionForm.btnOKClick(Sender: TObject); +begin + if CheckExpresion() then + ModalResult := mrOK + else + ModalResult := mrNone; +end; + +function TWhereExpressionForm.CheckExpresion(): Boolean; + function CheckData(const S: string): Boolean; + begin + Result := False; + + try + if S = '' then + else + if fDT in [datFloat, datCurrency, datDecimal, datSingleFloat] then + StrToFloat(S) + else + if fDT in [datAutoInc, datInteger, datLargeInt, datLargeAutoInc, + datShortInt, datWord, datSmallInt, datCardinal, datLargeUInt] then + StrToInt(S) + else + if fDT = datDateTime then + StrToDateTime(S); + + Result := True; + except + MessageDlg(Format('"%s" is not valid field value', [S]), mtError, [mbOK], 0); + end; + end; + +var + i: integer; +begin + Result := True; + + if emValue.Visible then + begin + for i := 0 to emValue.Lines.Count - 1 do + if not CheckData(Trim(emValue.Lines[i])) then + begin + Result := False; + break; + end; + end + else + if edtValue.Visible then + Result := CheckData(Trim(edtValue.Text)); +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/memoForm.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/memoForm.dfm new file mode 100644 index 0000000..07bcbf9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/memoForm.dfm @@ -0,0 +1,57 @@ +object frmMemo: TfrmMemo + Left = 385 + Top = 215 + AutoScroll = False + BorderIcons = [biSystemMenu] + ClientHeight = 442 + ClientWidth = 632 + Color = clBtnFace + Constraints.MinHeight = 480 + Constraints.MinWidth = 640 + KeyPreview = True + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnKeyDown = FormKeyDown + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 401 + Width = 632 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + DesignSize = ( + 632 + 41) + object btnOK: TButton + Left = 544 + Top = 8 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'OK' + Default = True + TabOrder = 0 + OnClick = btnOKClick + end + end + object edtMemo: TRichEdit + Left = 0 + Top = 0 + Width = 632 + Height = 401 + Align = alClient + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ReadOnly = True + ScrollBars = ssBoth + TabOrder = 1 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/memoForm.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/memoForm.pas new file mode 100644 index 0000000..8262a42 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Dynamic Where/memoForm.pas @@ -0,0 +1,61 @@ +unit memoForm; + +interface + +uses + Forms, StdCtrls, ComCtrls, Classes, Controls, ExtCtrls + ; + +type + TfrmMemo = class(TForm) + Panel1: TPanel; + edtMemo: TRichEdit; + btnOK: TButton; + procedure FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); + procedure btnOKClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + class procedure Execute(const ACaption: string; const Memos: string; WordWrap: Boolean); + end; + +implementation + +uses + Windows + ; + +{$R *.dfm} + +class procedure TfrmMemo.Execute(const ACaption: string; const Memos: string; + WordWrap: Boolean); +var + Frm: TfrmMemo; +begin + Frm := TfrmMemo.Create(Application); + + try + Frm.Caption := ACaption; + Frm.edtMemo.WordWrap := WordWrap; + Frm.edtMemo.Lines.Text := Memos; + Frm.ShowModal(); + finally + Frm.Release(); + end; +end; + +procedure TfrmMemo.FormKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if (Shift = []) and (Key = VK_ESCAPE) then + Close(); +end; + +procedure TfrmMemo.btnOKClick(Sender: TObject); +begin + Close(); +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClient.dpr new file mode 100644 index 0000000..fd9e269 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClient.dpr @@ -0,0 +1,17 @@ +program ExportedDataTablesClient; + +uses + uROComInit, + Forms, + MidasLib, + ExportedDataTablesClientMain in 'ExportedDataTablesClientMain.pas' {ExportedDataTablesClientMainForm}, + ExportedDataTablesClientData in 'ExportedDataTablesClientData.pas' {ExportedDataTablesClientDataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TExportedDataTablesClientDataModule, ExportedDataTablesClientDataModule); + Application.CreateForm(TExportedDataTablesClientMainForm, ExportedDataTablesClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClient.dproj new file mode 100644 index 0000000..f3a7404 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClient.dproj @@ -0,0 +1,213 @@ + + + {7f0aaa6f-1cc7-4281-bb0d-802a09720390} + ExportedDataTablesClient.dpr + Debug + AnyCPU + DCC32 + ExportedDataTablesClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Core Lab Data Access GUI related Components + Core Lab Data Access Components + Data Access Components for MySQL + MySQL Data Access GUI related Components + Oracle Data Access Components + Oracle Data Access GUI related Components + SQL Server Data Access Components + SQL Server Data Access GUI related Components + RemObjects Data Abstract - InterBase Express Driver + RemObjects Data Abstract - Scripting Integration Library + RemObjects Data Abstract - dbExpress Driver + RemObjects Data Abstract - SQLite Driver + RemObjects Data Abstract - DBISAM Driver + RemObjects Data Abstract - ElevateDB Driver + RemObjects Data Abstract - FIBPlus Driver + RemObjects Data Abstract - CoreLabs IBDAC Driver + RemObjects Data Abstract - CoreLabs MyDAC Driver + Data Abstract - NexusDB Driver + RemObjects Data Abstract - CoreLabs ODAC Driver + RemObjects Data Abstract - MicroOlap PostgresDAC Driver + RemObjects Data Abstract - 'Rosetta' + RemObjects Data Abstract - CoreLabs SDAC Driver + CodeGear C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + Core Lab InterBase Data Access Components + Data Access Components for MySQL - TMySQLMonitor + + + ExportedDataTablesClient.dpr + + + + + + + MainSource + + +
ExportedDataTablesClientDataModule
+ TDAClientDataModule +
+ +
ExportedDataTablesClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClient.res new file mode 100644 index 0000000..a8142cb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientData.dfm new file mode 100644 index 0000000..5511710 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientData.dfm @@ -0,0 +1,78 @@ +object ExportedDataTablesClientDataModule: TExportedDataTablesClientDataModule + OldCreateOrder = True + Left = 439 + Top = 220 + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'ExportedDataTablesService' + Left = 40 + Top = 96 + end + object DataStreamer: TDABin2DataStreamer + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 40 + Top = 184 + end + object tbl_Customers: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 128 + Top = 120 + end + object ds_Customers: TDADataSource + DataSet = tbl_Customers.Dataset + DataTable = tbl_Customers + Left = 136 + Top = 128 + end + object tbl_Region: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Region' + IndexDefs = <> + Left = 144 + Top = 136 + end + object ds_Region: TDADataSource + DataSet = tbl_Region.Dataset + DataTable = tbl_Region + Left = 152 + Top = 144 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientData.pas new file mode 100644 index 0000000..a719cf3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientData.pas @@ -0,0 +1,35 @@ +unit ExportedDataTablesClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABin2DataStreamer, uDAInterfaces, uDARemoteDataAdapter, + uDAScriptingProvider, uDAMemDataTable, uDADataStreamer; + +type + TExportedDataTablesClientDataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABin2DataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + tbl_Customers: TDAMemDataTable; + ds_Customers: TDADataSource; + tbl_Region: TDAMemDataTable; + ds_Region: TDADataSource; + private + { Private declarations } + public + { Public declarations } + end; + +var + ExportedDataTablesClientDataModule: TExportedDataTablesClientDataModule; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientMain.dfm new file mode 100644 index 0000000..4b7c122 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientMain.dfm @@ -0,0 +1,77 @@ +object ExportedDataTablesClientMainForm: TExportedDataTablesClientMainForm + Left = 431 + Top = 315 + AutoScroll = False + Caption = 'Exported DataTables - Client' + ClientHeight = 287 + ClientWidth = 494 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Splitter1: TSplitter + Left = 0 + Top = 163 + Width = 494 + Height = 3 + Cursor = crVSplit + Align = alBottom + end + object DBGrid1: TDBGrid + Left = 0 + Top = 41 + Width = 494 + Height = 122 + Align = alClient + DataSource = ExportedDataTablesClientDataModule.ds_Customers + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DBGrid2: TDBGrid + Left = 0 + Top = 166 + Width = 494 + Height = 121 + Align = alBottom + DataSource = ExportedDataTablesClientDataModule.ds_Region + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 494 + Height = 41 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object Button1: TButton + Left = 8 + Top = 8 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 0 + OnClick = Button1Click + end + object Button2: TButton + Left = 96 + Top = 8 + Width = 75 + Height = 25 + Caption = 'ApplyUpdate' + TabOrder = 1 + OnClick = Button2Click + end + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientMain.pas new file mode 100644 index 0000000..ed9b152 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesClientMain.pas @@ -0,0 +1,50 @@ +unit ExportedDataTablesClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, ExtCtrls, + Grids, DBGrids; + +type + TExportedDataTablesClientMainForm = class(TForm) + DBGrid1: TDBGrid; + DBGrid2: TDBGrid; + Splitter1: TSplitter; + Panel1: TPanel; + Button1: TButton; + Button2: TButton; + procedure Button1Click(Sender: TObject); + procedure Button2Click(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ExportedDataTablesClientMainForm: TExportedDataTablesClientMainForm; + +implementation + +uses + ExportedDataTablesClientData, uDADataTable; + +{$R *.dfm} + +procedure TExportedDataTablesClientMainForm.Button1Click(Sender: TObject); +begin + with ExportedDataTablesClientDataModule.tbl_Customers do + Active:= not Active; + with ExportedDataTablesClientDataModule.tbl_Region do + Active:= not Active; +end; + +procedure TExportedDataTablesClientMainForm.Button2Click(Sender: TObject); +begin + with ExportedDataTablesClientDataModule do + RemoteDataAdapter.ApplyUpdates([tbl_Customers,tbl_Region]); +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesGroup.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesGroup.Sample.html new file mode 100644 index 0000000..cae2130 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesGroup.Sample.html @@ -0,0 +1,33 @@ + + + + + + + + +
+

+ Exported DataTables Sample +

+ +
+

Purpose

+

+ This example illustrates the functionality of Exported Datatables. + Usually Exported Datatables can be used for working with Direct Access Components which currently isn't supported by DataAbstract + or for working with shared tables. + This sample shows how to receive and update data with TDataset and TDADataTable. + Exported Datatables don't need to declared in the ServiceSchema. + In this example, TADOTable and TDAMemDataTable are used as Exported Datatables. +

+ +

Getting Started

+ + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesGroup.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesGroup.bpg new file mode 100644 index 0000000..bc11f5a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesGroup.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = ExportedDataTablesServer.exe ExportedDataTablesClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +ExportedDataTablesServer.exe: ExportedDataTablesServer.dpr + $(DCC) + +ExportedDataTablesClient.exe: ExportedDataTablesClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesGroup.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesGroup.groupproj new file mode 100644 index 0000000..b6ce3e5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesGroup.groupproj @@ -0,0 +1,44 @@ + + + {1b923e1d-5c1f-42e1-8cf0-86e40fcf6cc9} + + + + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesLibrary.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesLibrary.rodl new file mode 100644 index 0000000..cc54180 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesLibrary.rodl @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesLibrary_Intf.pas new file mode 100644 index 0000000..ea56cba --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesLibrary_Intf.pas @@ -0,0 +1,82 @@ +unit ExportedDataTablesLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{8B75A505-94E9-4210-B49C-129C6622B98E}'; + TargetNamespace = ''; + + { Service Interface ID's } + IExportedDataTablesService_IID : TGUID = '{A76BB708-BF1F-4514-AC45-960F5E6199FA}'; + + { Event ID's } + +type + { Forward declarations } + IExportedDataTablesService = interface; + + + + + + { Enumerateds } + + { IExportedDataTablesService } + IExportedDataTablesService = interface(IDataAbstractService) + ['{A76BB708-BF1F-4514-AC45-960F5E6199FA}'] + end; + + { CoExportedDataTablesService } + CoExportedDataTablesService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IExportedDataTablesService; + end; + + { TExportedDataTablesService_Proxy } + TExportedDataTablesService_Proxy = class(TDataAbstractService_Proxy, IExportedDataTablesService) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoExportedDataTablesService } + +class function CoExportedDataTablesService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IExportedDataTablesService; +begin + result := TExportedDataTablesService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TExportedDataTablesService_Proxy.__GetInterfaceName:string; +begin + result := 'ExportedDataTablesService'; +end; + +initialization + RegisterProxyClass(IExportedDataTablesService_IID, TExportedDataTablesService_Proxy); + + +finalization + UnregisterProxyClass(IExportedDataTablesService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesLibrary_Invk.pas new file mode 100644 index 0000000..1f911fc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesLibrary_Invk.pas @@ -0,0 +1,35 @@ +unit ExportedDataTablesLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} ExportedDataTablesLibrary_Intf; + +type + TExportedDataTablesService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServer.dpr new file mode 100644 index 0000000..7a68dff --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServer.dpr @@ -0,0 +1,29 @@ +program ExportedDataTablesServer; + +{#ROGEN:ExportedDataTablesLibrary.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + ExportedDataTablesServerMain in 'ExportedDataTablesServerMain.pas' {ExportedDataTablesServerMainForm}, + ExportedDataTablesServerData in 'ExportedDataTablesServerData.pas' {ExportedDataTablesServerDataModule: TDataModule}, + ExportedDataTablesLibrary_Intf in 'ExportedDataTablesLibrary_Intf.pas', + ExportedDataTablesLibrary_Invk in 'ExportedDataTablesLibrary_Invk.pas', + ExportedDataTablesService_Impl in 'ExportedDataTablesService_Impl.pas' {ExportedDataTablesService: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + if ROStartService('ExportedDataTables', 'ExportedDataTables') then begin + ROService.CreateForm(TExportedDataTablesServerDataModule, ExportedDataTablesServerDataModule); + ROService.Run; + Exit; + end; + + Application.Initialize; + Application.CreateForm(TExportedDataTablesServerDataModule, ExportedDataTablesServerDataModule); + Application.CreateForm(TExportedDataTablesServerMainForm, ExportedDataTablesServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServer.dproj new file mode 100644 index 0000000..ea29d95 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServer.dproj @@ -0,0 +1,219 @@ + + + {aac31484-1919-4f53-b725-ac72b8534f54} + ExportedDataTablesServer.dpr + Debug + AnyCPU + DCC32 + ExportedDataTablesServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Core Lab Data Access GUI related Components + Core Lab Data Access Components + Data Access Components for MySQL + MySQL Data Access GUI related Components + Oracle Data Access Components + Oracle Data Access GUI related Components + SQL Server Data Access Components + SQL Server Data Access GUI related Components + RemObjects Data Abstract - InterBase Express Driver + RemObjects Data Abstract - Scripting Integration Library + RemObjects Data Abstract - dbExpress Driver + RemObjects Data Abstract - SQLite Driver + RemObjects Data Abstract - DBISAM Driver + RemObjects Data Abstract - ElevateDB Driver + RemObjects Data Abstract - FIBPlus Driver + RemObjects Data Abstract - CoreLabs IBDAC Driver + RemObjects Data Abstract - CoreLabs MyDAC Driver + Data Abstract - NexusDB Driver + RemObjects Data Abstract - CoreLabs ODAC Driver + RemObjects Data Abstract - MicroOlap PostgresDAC Driver + RemObjects Data Abstract - 'Rosetta' + RemObjects Data Abstract - CoreLabs SDAC Driver + CodeGear C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + Core Lab InterBase Data Access Components + Data Access Components for MySQL - TMySQLMonitor + + + ExportedDataTablesServer.dpr + + + + + + + MainSource + + + + +
ExportedDataTablesServerDataModule
+ TDataModule +
+ +
ExportedDataTablesServerMainForm
+
+ +
ExportedDataTablesService
+ TDataAbstractService +
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServer.res new file mode 100644 index 0000000..dc22e33 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerData.dfm new file mode 100644 index 0000000..de789cb --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerData.dfm @@ -0,0 +1,106 @@ +object ExportedDataTablesServerDataModule: TExportedDataTablesServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 411 + Top = 233 + Height = 251 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI' + Description = 'Microsoft SQL Server 2000, localhost' + ConnectionType = 'MSSQL' + Default = True + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end + object Schema: TDASchema + ConnectionManager = ConnectionManager + DataDictionary = DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + ConnectionType = 'MSSQL' + Default = True + TargetTable = 'Region' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'RegionID' + TableField = 'RegionID' + end + item + DatasetField = 'RegionDescription' + TableField = 'RegionDescription' + end> + end> + Name = 'Region' + Fields = < + item + Name = 'RegionID' + DataType = datInteger + Required = True + InPrimaryKey = True + end + item + Name = 'RegionDescription' + DataType = datWideString + Size = 50 + Required = True + end> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 256 + Top = 56 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerData.pas new file mode 100644 index 0000000..19b381b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerData.pas @@ -0,0 +1,44 @@ +unit ExportedDataTablesServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAIBXDriver, uDAADODriver, uROIndyTCPServer, uDADataStreamer, + uDABin2DataStreamer, DB, ADODB, uDAScriptingProvider, uDADataTable, + uDAMemDataTable; + +type + TExportedDataTablesServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + SessionManager: TROInMemorySessionManager; + Schema: TDASchema; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ExportedDataTablesServerDataModule: TExportedDataTablesServerDataModule; + +implementation + +{$R *.dfm} + +procedure TExportedDataTablesServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerMain.dfm new file mode 100644 index 0000000..96edeac --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerMain.dfm @@ -0,0 +1,21 @@ +object ExportedDataTablesServerMainForm: TExportedDataTablesServerMainForm + Left = 372 + Top = 277 + BorderStyle = bsDialog + Caption = 'Exported DataTables - Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerMain.pas new file mode 100644 index 0000000..3666032 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesServerMain.pas @@ -0,0 +1,25 @@ +unit ExportedDataTablesServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton; + +type + TExportedDataTablesServerMainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + ExportedDataTablesServerMainForm: TExportedDataTablesServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesService_Impl.dfm new file mode 100644 index 0000000..e5648b2 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesService_Impl.dfm @@ -0,0 +1,50 @@ +object ExportedDataTablesService: TExportedDataTablesService + OldCreateOrder = True + SessionManager = ExportedDataTablesServerDataModule.SessionManager + ServiceDataStreamer = DataStreamer + ExportedDataTables = < + item + DataTable = MemDataTable + LogicalName = 'Region' + end + item + DataTable = ADOTable + LogicalName = 'Customers' + end> + Left = 432 + Top = 189 + Height = 164 + Width = 244 + object DataStreamer: TDABin2DataStreamer + Left = 32 + Top = 8 + end + object MemDataTable: TDAMemDataTable + RemoteUpdatesOptions = [ruoOnPost] + Fields = <> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + LocalSchema = ExportedDataTablesServerDataModule.Schema + LocalDataStreamer = DABin2DataStreamer1 + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Region' + IndexDefs = <> + Left = 32 + Top = 56 + end + object ADOTable: TADOTable + ConnectionString = + 'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security In' + + 'fo=False;Initial Catalog=Northwind;Data Source=localhost' + CursorType = ctStatic + TableName = 'Customers' + Left = 136 + Top = 56 + end + object DABin2DataStreamer1: TDABin2DataStreamer + Left = 136 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesService_Impl.pas new file mode 100644 index 0000000..412a5ea --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/ExportedDataTablesService_Impl.pas @@ -0,0 +1,53 @@ +unit ExportedDataTablesService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} ExportedDataTablesLibrary_Intf, uDADataStreamer, + uDABin2DataStreamer, uDAClasses, uDAScriptingProvider, uDADataTable, + uDAMemDataTable, DB, ADODB; + +type + { TExportedDataTablesService } + TExportedDataTablesService = class(TDataAbstractService, IExportedDataTablesService) + DataStreamer: TDABin2DataStreamer; + MemDataTable: TDAMemDataTable; + ADOTable: TADOTable; + DABin2DataStreamer1: TDABin2DataStreamer; + private + protected + { IExportedDataTablesService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} ExportedDataTablesLibrary_Invk,ExportedDataTablesServerData; + +procedure Create_ExportedDataTablesService(out anInstance : IUnknown); +begin + anInstance := TExportedDataTablesService.Create(nil); +end; + +{ ExportedDataTablesService } +initialization + TROClassFactory.Create('ExportedDataTablesService', Create_ExportedDataTablesService, TExportedDataTablesService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/RODLFILE.res new file mode 100644 index 0000000..84655a5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Exported DataTables/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.Sample.html new file mode 100644 index 0000000..c101fc0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.Sample.html @@ -0,0 +1,61 @@ + + + + + + + + + +

+ Fetch +

+ + +

Purpose

+

+ This demo shows how to fetch paged orders and also master/detail via single + server call. See the + DA04 + + article for a discussion on Dynamic Method Binding using this + sample as its example.

+

Getting Started

+

+ When you compile and run both projects you will see the client present you + with two tabbed pages: +

+ + +

Examine the Code

+

+ The following methods are worth examining: +

+ + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.bdsgroup new file mode 100644 index 0000000..d2590a9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + FetchServer.bdsproj + FetchClient.bdsproj + FetchServer.exe FetchClient.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.bpg new file mode 100644 index 0000000..2469b7d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = FetchServer.exe FetchClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +FetchServer.exe: FetchServer.dpr + $(DCC) + +FetchClient.exe: FetchClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.groupproj new file mode 100644 index 0000000..deb928a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/Fetch.groupproj @@ -0,0 +1,44 @@ + + + {b6910b17-afe5-4bb5-af6f-cf820851de91} + + + + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.bdsproj new file mode 100644 index 0000000..87209ab --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + FetchClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.dpr new file mode 100644 index 0000000..f5f7e44 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.dpr @@ -0,0 +1,18 @@ +program FetchClient; + +uses + uROComInit, + Forms, + MidasLib, + FetchClientMain in 'FetchClientMain.pas' {FetchClientMainForm}, + FetchClientData in 'FetchClientData.pas' {FetchClientDataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Fetch Client'; + Application.CreateForm(TFetchClientDataModule, FetchClientDataModule); + Application.CreateForm(TFetchClientMainForm, FetchClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.dproj new file mode 100644 index 0000000..47c8158 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.dproj @@ -0,0 +1,44 @@ + + + {3ef0f4e0-3dde-4abb-b2e8-8b555c0f23dc} + FetchClient.dpr + Debug + AnyCPU + DCC32 + FetchClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + False + $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;D:\Jenya\DLIB\jcl\lib\d11\debug + $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;D:\Jenya\DLIB\jcl\lib\d11\debug + $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;D:\Jenya\DLIB\jcl\lib\d11\debug + $(BDS)\lib\Debug;$(BDS)\Lib\Debug\Indy10;D:\Jenya\DLIB\jcl\lib\d11\debug + + + Delphi.Personality + + +FalseTrueFalseFalseFalse1000FalseFalseFalseFalseFalse103312521.0.0.01.0.0.0FetchClient.dpr + + + + + MainSource + + +
FetchClientDataModule
+
+ +
FetchClientMainForm
+
+
+
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientData.dfm new file mode 100644 index 0000000..836db84 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientData.dfm @@ -0,0 +1,30 @@ +object FetchClientDataModule: TFetchClientDataModule + OldCreateOrder = True + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'FetchService' + Left = 40 + Top = 96 + end + object DataStreamer: TDABin2DataStreamer + BufferSize = 262144 + SendReducedDelta = False + Left = 40 + Top = 140 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientData.pas new file mode 100644 index 0000000..c80a7c8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientData.pas @@ -0,0 +1,32 @@ +unit FetchClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDABin2DataStreamer, uDADataStreamer; + +type + TFetchClientDataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABin2DataStreamer; + private + { Private declarations } + public + { Public declarations } + + end; + +var + FetchClientDataModule: TFetchClientDataModule; + +implementation + +uses + FetchClientMain; +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientMain.dfm new file mode 100644 index 0000000..a3ef419 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientMain.dfm @@ -0,0 +1,922 @@ +object FetchClientMainForm: TFetchClientMainForm + Left = 353 + Top = 279 + Caption = 'Fetch Client' + ClientHeight = 406 + ClientWidth = 447 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poDesigned + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 0 + Top = 0 + Width = 447 + Height = 406 + ActivePage = TabSheet2 + Align = alClient + TabOrder = 0 + object TabSheet1: TTabSheet + BorderWidth = 5 + Caption = 'Paged Orders' + object Label1: TLabel + Left = 0 + Top = 9 + Width = 115 + Height = 13 + Caption = 'Max Records Per Fetch:' + end + object lbFetchedRecs: TLabel + Left = 222 + Top = 9 + Width = 117 + Height = 13 + Caption = 'No records fetched yet...' + end + object gPagedOrders: TDBGrid + Left = 2 + Top = 51 + Width = 429 + Height = 207 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = ds_PagedOrders + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object seMaxRecords: TSpinEdit + Left = 126 + Top = 4 + Width = 81 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 1 + Value = 40 + end + object bFetchPagedOrders: TButton + Left = 354 + Top = 3 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Open/Close' + TabOrder = 2 + OnClick = bFetchPagedOrdersClick + end + object gPagedOrderDetails: TDBGrid + Left = 0 + Top = 264 + Width = 429 + Height = 104 + Align = alBottom + DataSource = ds_PagedOrderDetails + TabOrder = 3 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel1: TPanel + Left = 0 + Top = 259 + Width = 429 + Height = 5 + Align = alBottom + BevelOuter = bvNone + TabOrder = 4 + end + end + object TabSheet2: TTabSheet + BorderWidth = 5 + Caption = 'Fetch All' + ImageIndex = 1 + object Label2: TLabel + Left = 0 + Top = 3 + Width = 65 + Height = 13 + Caption = 'Start OrderID:' + end + object Label3: TLabel + Left = 0 + Top = 27 + Width = 62 + Height = 13 + Caption = 'End OrderID:' + end + object gOrders: TDBGrid + Left = 2 + Top = 51 + Width = 427 + Height = 207 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = ds_Orders + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object gOrderDetails: TDBGrid + Left = 0 + Top = 264 + Width = 429 + Height = 104 + Align = alBottom + DataSource = ds_OrderDetails + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object bFetchAll: TButton + Left = 354 + Top = 3 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Open/Close' + TabOrder = 2 + OnClick = bFetchAllClick + end + object seStart: TSpinEdit + Left = 72 + Top = 0 + Width = 76 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 3 + Value = 10248 + end + object seEnd: TSpinEdit + Left = 72 + Top = 24 + Width = 76 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 4 + Value = 10300 + end + object Panel2: TPanel + Left = 0 + Top = 259 + Width = 429 + Height = 5 + Align = alBottom + BevelOuter = bvNone + TabOrder = 5 + end + end + end + object daPaged: TDARemoteDataAdapter + GetSchemaCall.RemoteService = FetchClientDataModule.RemoteService + GetDataCall.RemoteService = FetchClientDataModule.RemoteService + UpdateDataCall.RemoteService = FetchClientDataModule.RemoteService + GetScriptsCall.RemoteService = FetchClientDataModule.RemoteService + RemoteService = FetchClientDataModule.RemoteService + DataStreamer = FetchClientDataModule.DataStreamer + FailureBehavior = fbBoth + Left = 117 + Top = 143 + end + object tbl_OrderDetails: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ProductID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitPrice' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Quantity' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Discount' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'StartingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end + item + Name = 'EndingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end> + MasterMappingMode = mmWhere + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + RemoteDataAdapter = daFetchAll + ReadOnly = False + MasterSource = ds_Orders + MasterFields = 'OrderID' + DetailFields = 'OrderID' + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'OrderDetails' + Left = 269 + Top = 157 + end + object ds_OrderDetails: TDADataSource + DataSet = tbl_OrderDetails.Dataset + DataTable = tbl_OrderDetails + Left = 297 + Top = 157 + end + object tbl_Orders: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + GeneratorName = 'Orders' + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'StartingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end + item + Name = 'EndingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = daFetchAll + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates, moAllInOneFetch] + LogicalName = 'Orders' + Left = 269 + Top = 129 + end + object ds_Orders: TDADataSource + DataSet = tbl_Orders.Dataset + DataTable = tbl_Orders + Left = 297 + Top = 129 + end + object tbl_PagedOrderDetails: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ProductID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitPrice' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Quantity' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Discount' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = <> + MasterMappingMode = mmWhere + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = daPaged + ReadOnly = False + MasterSource = ds_PagedOrders + MasterFields = 'OrderID' + DetailFields = 'OrderID' + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'PagedOrderDetails' + Left = 61 + Top = 157 + end + object ds_PagedOrderDetails: TDADataSource + DataSet = tbl_PagedOrderDetails.Dataset + DataTable = tbl_PagedOrderDetails + Left = 89 + Top = 157 + end + object tbl_PagedOrders: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + GeneratorName = 'Orders' + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'StartingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = daPaged + AfterScroll = tbl_PagedOrdersAfterScroll + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'PagedOrders' + Left = 61 + Top = 129 + end + object ds_PagedOrders: TDADataSource + DataSet = tbl_PagedOrders.Dataset + DataTable = tbl_PagedOrders + Left = 89 + Top = 129 + end + object daFetchAll: TDARemoteDataAdapter + GetSchemaCall.RemoteService = FetchClientDataModule.RemoteService + GetDataCall.RemoteService = FetchClientDataModule.RemoteService + GetDataCall.MethodName = 'GetOrdersAndDetails' + GetDataCall.Params = < + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end + item + Name = 'StartOrderID' + DataType = rtInteger + Flag = fIn + Value = Null + end + item + Name = 'EndOrderID' + DataType = rtInteger + Flag = fIn + Value = Null + end> + GetDataCall.Default = False + GetDataCall.OutgoingTableNamesParameter = 'aTableNameArray' + GetDataCall.OutgoingTableRequestInfosParameter = 'aTableRequestInfoArray' + GetDataCall.IncomingDataParameter = 'Result' + UpdateDataCall.RemoteService = FetchClientDataModule.RemoteService + GetScriptsCall.RemoteService = FetchClientDataModule.RemoteService + RemoteService = FetchClientDataModule.RemoteService + DataStreamer = FetchClientDataModule.DataStreamer + FailureBehavior = fbBoth + Left = 325 + Top = 143 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientMain.pas new file mode 100644 index 0000000..1be4b4e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchClientMain.pas @@ -0,0 +1,121 @@ +unit FetchClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, ExtCtrls, Spin, + Grids, DBGrids, ComCtrls, DB, uDAInterfaces, uDADataTable, + uDAScriptingProvider, uDAMemDataTable, uDARemoteDataAdapter; + +type + TFetchClientMainForm = class(TForm) + PageControl1: TPageControl; + TabSheet1: TTabSheet; + Label1: TLabel; + lbFetchedRecs: TLabel; + gPagedOrders: TDBGrid; + seMaxRecords: TSpinEdit; + bFetchPagedOrders: TButton; + gPagedOrderDetails: TDBGrid; + Panel1: TPanel; + TabSheet2: TTabSheet; + Label2: TLabel; + Label3: TLabel; + gOrders: TDBGrid; + gOrderDetails: TDBGrid; + bFetchAll: TButton; + seStart: TSpinEdit; + seEnd: TSpinEdit; + Panel2: TPanel; + daPaged: TDARemoteDataAdapter; + tbl_OrderDetails: TDAMemDataTable; + ds_OrderDetails: TDADataSource; + tbl_Orders: TDAMemDataTable; + ds_Orders: TDADataSource; + tbl_PagedOrderDetails: TDAMemDataTable; + ds_PagedOrderDetails: TDADataSource; + tbl_PagedOrders: TDAMemDataTable; + ds_PagedOrders: TDADataSource; + daFetchAll: TDARemoteDataAdapter; + procedure bFetchPagedOrdersClick(Sender: TObject); + procedure bFetchAllClick(Sender: TObject); + procedure tbl_PagedOrdersAfterScroll(DataTable: TDADataTable); + private + { Private declarations } + fFetchRequired: boolean; + public + { Public declarations } + end; + +var + FetchClientMainForm: TFetchClientMainForm; + +implementation + +uses + FetchClientData; + +{$R *.dfm} + +procedure TFetchClientMainForm.bFetchAllClick(Sender: TObject); +begin + { Sets the filtering options for the server method so we only retrieve the selected + records. It's good advice to always filter data like this to minimize network trafic. + + The server method is defined as: + + function GetOrdersAndDetails(const StartOrderID: Integer; + const EndOrderID: Integer): Binary; + + The Binary returned by the server contains a stream with all the orders and all the details } + + daFetchAll.GetDataCall.ParamByName('StartOrderID').AsInteger := seStart.Value; + daFetchAll.GetDataCall.ParamByName('EndOrderID').AsInteger := seEnd.Value; + tbl_Orders.Active :=not tbl_Orders.Active; +end; + +procedure TFetchClientMainForm.bFetchPagedOrdersClick(Sender: TObject); +begin + lbFetchedRecs.Caption := 'No records fetched yet...'; + if not tbl_PagedOrders.Active then begin + tbl_PagedOrders.ParamByName('StartingOrderID').AsInteger := 0; + tbl_PagedOrders.MaxRecords := seMaxRecords.Value; + lbFetchedRecs.Caption := 'No records fetched yet...'; + // fFetchedRequired is a flag that we set to FALSE when the last page is fetched + fFetchRequired := True; + end; + tbl_PagedOrders.Active := not tbl_PagedOrders.Active +end; + +procedure TFetchClientMainForm.tbl_PagedOrdersAfterScroll( + DataTable: TDADataTable); +var + lrecordcount: integer; +begin + { This is the core of the paging process. When we reach the last record in the current + set we want to issue a new request to the server to get the next packet. If the requested + records is different than the returned amount it means there's nothing more to fetch and + we're done with the paging. + + By doing paging this way we have full control on what happens server side and what SQL statements + are generated. This is only one of the many possible paging implementations you could do using + Data Abstract. The control is in your hands! } + + if fFetchRequired and DataTable.EOF and not DataTable.Fetching then + with DataTable do begin + ParamByName('StartingOrderID').AsInteger := FieldByName('OrderID').AsInteger; + MaxRecords := seMaxRecords.Value; + lrecordcount := DataTable.RecordCount; + LoadFromRemoteSource(True); + lrecordcount := RecordCount-lrecordcount; + + lbFetchedRecs.Caption := IntTostr(lrecordcount) + ' records retrieved'; + fFetchRequired := lrecordcount = MaxRecords; + if not fFetchRequired then + MessageDlg(Format('Done fetching!!! Expected %d rows but only got %d ', + [MaxRecords, lrecordcount]), mtInformation, [mbOK], 0); + end; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchLibrary.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchLibrary.RODL new file mode 100644 index 0000000..8f79f9a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchLibrary.RODL @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchLibrary_Intf.pas new file mode 100644 index 0000000..874a513 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchLibrary_Intf.pas @@ -0,0 +1,104 @@ +unit FetchLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{02C22018-F060-4159-A052-DDFAECD3EA97}'; + TargetNamespace = ''; + + { Service Interface ID's } + IFetchService_IID : TGUID = '{E70F3537-38F1-4C4E-AB64-6935C9C9CF69}'; + + { Event ID's } + +type + { Forward declarations } + IFetchService = interface; + + + + + + { Enumerateds } + + { IFetchService } + IFetchService = interface(IDataAbstractService) + ['{E70F3537-38F1-4C4E-AB64-6935C9C9CF69}'] + function GetOrdersAndDetails(const StartOrderID: Integer; const EndOrderID: Integer): Binary; + end; + + { CoFetchService } + CoFetchService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IFetchService; + end; + + { TFetchService_Proxy } + TFetchService_Proxy = class(TDataAbstractService_Proxy, IFetchService) + protected + function __GetInterfaceName:string; override; + + function GetOrdersAndDetails(const StartOrderID: Integer; const EndOrderID: Integer): Binary; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoFetchService } + +class function CoFetchService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IFetchService; +begin + result := TFetchService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TFetchService_Proxy } + +function TFetchService_Proxy.__GetInterfaceName:string; +begin + result := 'FetchService'; +end; + +function TFetchService_Proxy.GetOrdersAndDetails(const StartOrderID: Integer; const EndOrderID: Integer): Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'FetchLibrary', __InterfaceName, 'GetOrdersAndDetails'); + __Message.Write('StartOrderID', TypeInfo(Integer), StartOrderID, []); + __Message.Write('EndOrderID', TypeInfo(Integer), EndOrderID, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IFetchService_IID, TFetchService_Proxy); + + +finalization + UnregisterProxyClass(IFetchService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchLibrary_Invk.pas new file mode 100644 index 0000000..00626d4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchLibrary_Invk.pas @@ -0,0 +1,69 @@ +unit FetchLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} FetchLibrary_Intf; + +type + {$M+} + TFetchService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + procedure Invoke_GetOrdersAndDetails(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + {$M-} + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TFetchService_Invoker } + +procedure TFetchService_Invoker.Invoke_GetOrdersAndDetails(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetOrdersAndDetails(const StartOrderID: Integer; const EndOrderID: Integer): Binary; } +var + StartOrderID: Integer; + EndOrderID: Integer; + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + __Message.Read('StartOrderID', TypeInfo(Integer), StartOrderID, []); + __Message.Read('EndOrderID', TypeInfo(Integer), EndOrderID, []); + + lResult := (__Instance as IFetchService).GetOrdersAndDetails(StartOrderID, EndOrderID); + + __Message.InitializeResponseMessage(__Transport, 'FetchLibrary', 'FetchService', 'GetOrdersAndDetailsResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.bdsproj new file mode 100644 index 0000000..b800b9e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + FetchServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.dpr new file mode 100644 index 0000000..4d702b2 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.dpr @@ -0,0 +1,24 @@ +program FetchServer; + +{#ROGEN:FetchLibrary.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + FetchServerMain in 'FetchServerMain.pas' {FetchServerMainForm}, + FetchServerData in 'FetchServerData.pas' {FetchServerDataModule: TDataModule}, + FetchLibrary_Intf in 'FetchLibrary_Intf.pas', + FetchLibrary_Invk in 'FetchLibrary_Invk.pas', + FetchService_Impl in 'FetchService_Impl.pas' {FetchService: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'Fetch Server'; + Application.CreateForm(TFetchServerDataModule, FetchServerDataModule); + Application.CreateForm(TFetchServerMainForm, FetchServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.dproj new file mode 100644 index 0000000..7708464 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.dproj @@ -0,0 +1,44 @@ + + + {c960438c-973c-4609-85d8-f600fec539dc} + FetchServer.dpr + Debug + AnyCPU + DCC32 + FetchServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + + +FalseTrueFalseFalseFalse1000FalseFalseFalseFalseFalse103312521.0.0.01.0.0.0FetchServer.dpr + + + + + MainSource + + + + +
FetchServerDataModule
+
+ +
FetchServerMainForm
+
+ +
FetchService
+
+
+
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerData.dfm new file mode 100644 index 0000000..06b3c89 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerData.dfm @@ -0,0 +1,58 @@ +object FetchServerDataModule: TFetchServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI' + Description = 'Microsoft SQL Server 2000, localhost' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerData.pas new file mode 100644 index 0000000..d7ad9cb --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerData.pas @@ -0,0 +1,41 @@ +unit FetchServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAADODriver, uROIndyTCPServer; + +type + TFetchServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + SessionManager: TROInMemorySessionManager; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + FetchServerDataModule: TFetchServerDataModule; + +implementation + +{$R *.dfm} + +procedure TFetchServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerMain.dfm new file mode 100644 index 0000000..9839ce4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerMain.dfm @@ -0,0 +1,21 @@ +object FetchServerMainForm: TFetchServerMainForm + Left = 372 + Top = 277 + BorderStyle = bsDialog + Caption = 'Fetch Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerMain.pas new file mode 100644 index 0000000..6d39b86 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchServerMain.pas @@ -0,0 +1,25 @@ +unit FetchServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton; + +type + TFetchServerMainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + FetchServerMainForm: TFetchServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchService_Impl.dfm new file mode 100644 index 0000000..2d46bb3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchService_Impl.dfm @@ -0,0 +1,857 @@ +object FetchService: TFetchService + OldCreateOrder = True + SessionManager = FetchServerDataModule.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Height = 300 + Width = 300 + object Schema: TDASchema + ConnectionManager = FetchServerDataModule.ConnectionManager + DataDictionary = FetchServerDataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Order Details' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'ProductID' + TableField = 'ProductID' + end + item + DatasetField = 'UnitPrice' + TableField = 'UnitPrice' + end + item + DatasetField = 'Quantity' + TableField = 'Quantity' + end + item + DatasetField = 'Discount' + TableField = 'Discount' + end> + end> + Name = 'PagedOrderDetails' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ProductID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitPrice' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Quantity' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Discount' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = < + item + Name = 'StartingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end + item + Name = 'EndingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Order Details' + SQL = + 'SELECT '#10' OrderID, ProductID, UnitPrice, Quantity, Discount'#10'FR' + + 'OM'#10' [Order Details]'#10'WHERE'#10' OrderID >= :StartingOrderID an' + + 'd'#10' OrderID <= :EndingOrderID and'#10' {Where}'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'ProductID' + TableField = 'ProductID' + end + item + DatasetField = 'UnitPrice' + TableField = 'UnitPrice' + end + item + DatasetField = 'Quantity' + TableField = 'Quantity' + end + item + DatasetField = 'Discount' + TableField = 'Discount' + end> + end> + Name = 'OrderDetails' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ProductID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'UnitPrice' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Quantity' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Discount' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = < + item + Name = 'StartingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end + item + Name = 'EndingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10'FROM'#10' ' + + ' Orders'#10'WHERE'#10' OrderID >= :StartingOrderID and'#10' OrderID ' + + '<= :EndingOrderID and'#10' {Where}'#10' '#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + GeneratorName = 'Orders' + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = < + item + Name = 'StartingOrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10'FROM'#10' ' + + ' Orders'#10'WHERE'#10' OrderID > :StartingOrderID and'#10' {Where}'#10'ORD' + + 'ER BY'#10' OrderID'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'PagedOrders' + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + GeneratorName = 'Orders' + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 32 + Top = 56 + end + object DataStreamer: TDABin2DataStreamer + BufferSize = 262144 + SendReducedDelta = False + Left = 32 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchService_Impl.pas new file mode 100644 index 0000000..945d08d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/FetchService_Impl.pas @@ -0,0 +1,74 @@ +unit FetchService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} FetchLibrary_Intf, uDADataStreamer, uDABin2DataStreamer, + uDAClasses, FetchServerData, uDAInterfaces; + +type + { TFetchService } + TFetchService = class(TDataAbstractService, IFetchService) + DataStreamer: TDABin2DataStreamer; + Schema: TDASchema; + private + protected + { IFetchService methods } + function GetOrdersAndDetails(const StartOrderID: Integer; const EndOrderID: Integer): Binary; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} FetchLibrary_Invk; + +procedure Create_FetchService(out anInstance : IUnknown); +begin + anInstance := TFetchService.Create(nil); +end; + +{ FetchService } +function TFetchService.GetOrdersAndDetails(const StartOrderID: Integer; const EndOrderID: Integer): Binary; + + procedure ProcessDataset(aDataset: IDADataset); + begin + aDataset.ParamByName('StartingOrderID').AsInteger := StartOrderID; + aDataset.ParamByName('EndingOrderID').AsInteger := EndOrderID; + aDataset.Open; + DataStreamer.WriteDataset(aDataset, [woRows], -1); + end; + +begin + result := Binary.Create; + DataStreamer.Initialize(result, aiWrite); + try + // writing orders + ProcessDataset(Schema.NewDataset(Connection, 'Orders')); + // writing order details + ProcessDataset(Schema.NewDataset(Connection, 'OrderDetails')); + finally + DataStreamer.Finalize; + end; +end; + +initialization + TROClassFactory.Create('FetchService', Create_FetchService, TFetchService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/RODLFILE.res new file mode 100644 index 0000000..be37b0d Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Fetch/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.Sample.html new file mode 100644 index 0000000..02a861a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.Sample.html @@ -0,0 +1,42 @@ + + + + + + + + +
+

+ First Sample +

+ +
+

Purpose

+

+ This example illustrates the basic functionality of Data Abstract from RemObjects Software.

+ The application shows how to receive data from a remote database. +

+ +

Getting Started

+ +

Examine the Code

+ + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.bdsgroup new file mode 100644 index 0000000..3121f9f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + FirstSampleServer.bdsproj + FirstSampleClient.bdsproj + FirstSampleServer.exe FirstSampleClient.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.bpg new file mode 100644 index 0000000..1de9e53 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = FirstSampleServer.exe FirstSampleClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +FirstSampleServer.exe: FirstSampleServer.dpr + $(DCC) + +FirstSampleClient.exe: FirstSampleClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.groupproj new file mode 100644 index 0000000..26658df --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSample.groupproj @@ -0,0 +1,40 @@ + + + {7122486e-398e-464f-b75b-a8169350c11e} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.bdsproj new file mode 100644 index 0000000..df27704 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + FirstSampleClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.dpr new file mode 100644 index 0000000..7477e94 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.dpr @@ -0,0 +1,18 @@ +program FirstSampleClient; + +uses + uROComInit, + Forms, + MidasLib, + FirstSampleclientMain in 'FirstSampleclientMain.pas' {FirstSampleclientMainForm}, + FirstSampleClientData in 'FirstSampleClientData.pas' {FirstSampleClientDataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'First Sample Client'; + Application.CreateForm(TFirstSampleClientDataModule, FirstSampleClientDataModule); + Application.CreateForm(TFirstSampleclientMainForm, FirstSampleclientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.dproj new file mode 100644 index 0000000..d05ce2b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.dproj @@ -0,0 +1,75 @@ + + + {2ac631a8-06a9-4df5-8645-51b6996e3f52} + FirstSampleClient.dpr + Debug + AnyCPU + DCC32 + FirstSampleClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + FirstSampleClient.dpr + + + + + + + MainSource + + +
FirstSampleClientDataModule
+
+ +
FirstSampleclientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClientData.dfm new file mode 100644 index 0000000..30dab50 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClientData.dfm @@ -0,0 +1,191 @@ +object FirstSampleClientDataModule: TFirstSampleClientDataModule + OldCreateOrder = True + Left = 139 + Top = 77 + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'FirstSampleService' + Left = 40 + Top = 96 + end + object DataStreamer: TDABinDataStreamer + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 40 + Top = 184 + end + object tbl_Customers: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 130 + Top = 117 + end + object ds_Customers: TDADataSource + DataTable = tbl_Customers + Left = 138 + Top = 125 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClientData.pas new file mode 100644 index 0000000..45c6a8b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleClientData.pas @@ -0,0 +1,34 @@ +unit FirstSampleClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, uDAInterfaces, + uDADataStreamer, uDARemoteDataAdapter, uDAScriptingProvider, + uDACDSDataTable; + +type + TFirstSampleClientDataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABinDataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + tbl_Customers: TDACDSDataTable; + ds_Customers: TDADataSource; + private + { Private declarations } + public + { Public declarations } + end; + +var + FirstSampleClientDataModule: TFirstSampleClientDataModule; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleLibrary.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleLibrary.RODL new file mode 100644 index 0000000..b83e242 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleLibrary.RODL @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleLibrary_Intf.pas new file mode 100644 index 0000000..3b688bc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleLibrary_Intf.pas @@ -0,0 +1,76 @@ +unit FirstSampleLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{668FD1CF-765E-4C72-86E1-5BB53EA5CE34}'; + + { Service Interface ID's } + IFirstSampleService_IID : TGUID = '{58D29079-CADF-4D12-B78C-F1403B2BBF34}'; + + { Event ID's } + +type + { Forward declarations } + IFirstSampleService = interface; + + + + + { IFirstSampleService } + IFirstSampleService = interface(IDataAbstractService) + ['{58D29079-CADF-4D12-B78C-F1403B2BBF34}'] + end; + + { CoFirstSampleService } + CoFirstSampleService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IFirstSampleService; + end; + + { TFirstSampleService_Proxy } + TFirstSampleService_Proxy = class(TDataAbstractService_Proxy, IFirstSampleService) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoFirstSampleService } + +class function CoFirstSampleService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IFirstSampleService; +begin + result := TFirstSampleService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TFirstSampleService_Proxy.__GetInterfaceName:string; +begin + result := 'FirstSampleService'; +end; + +initialization + RegisterProxyClass(IFirstSampleService_IID, TFirstSampleService_Proxy); + + +finalization + UnregisterProxyClass(IFirstSampleService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleLibrary_Invk.pas new file mode 100644 index 0000000..d4eb2fb --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleLibrary_Invk.pas @@ -0,0 +1,32 @@ +unit FirstSampleLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} FirstSampleLibrary_Intf; + +type + TFirstSampleService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.bdsproj new file mode 100644 index 0000000..fa88e8c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + FirstSampleServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.dpr new file mode 100644 index 0000000..d8d551d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.dpr @@ -0,0 +1,30 @@ +program FirstSampleServer; + +{#ROGEN:FirstSampleLibrary.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + FirstSampleServerMain in 'FirstSampleServerMain.pas' {FirstSampleServerMainForm}, + FirstSampleService_Impl in 'FirstSampleService_Impl.pas' {FirstSampleService: TDARemoteService}, + FirstSampleServerData in 'FirstSampleServerData.pas' {FirstSampleServerDataModule: TDataModule}, + FirstSampleLibrary_Intf in 'FirstSampleLibrary_Intf.pas', + FirstSampleLibrary_Invk in 'FirstSampleLibrary_Invk.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + if ROStartService('FirstSample', 'FirstSample') then begin + ROService.CreateForm(TFirstSampleServerDataModule, FirstSampleServerDataModule); + ROService.Run; + Exit; + end; + + Application.Initialize; + Application.Title := 'First Sample Server'; + Application.CreateForm(TFirstSampleServerDataModule, FirstSampleServerDataModule); + Application.CreateForm(TFirstSampleServerMainForm, FirstSampleServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.dproj new file mode 100644 index 0000000..f5ec2f7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.dproj @@ -0,0 +1,80 @@ + + + {4845004a-289d-4c48-baea-2a580444e3a9} + FirstSampleServer.dpr + Debug + AnyCPU + DCC32 + FirstSampleServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + FirstSampleServer.dpr + + + + + + + MainSource + + + + +
FirstSampleServerDataModule
+
+ +
FirstSampleServerMainForm
+
+ +
FirstSampleService
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerData.dfm new file mode 100644 index 0000000..74f107a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerData.dfm @@ -0,0 +1,68 @@ +object FirstSampleServerDataModule: TFirstSampleServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 74 + Top = 68 + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Description = 'Microsoft SQL Server 2000, localhost' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object IBXDriver: TDAIBXDriver + Left = 256 + Top = 56 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerData.pas new file mode 100644 index 0000000..f093cee --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerData.pas @@ -0,0 +1,42 @@ +unit FirstSampleServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAIBXDriver, uDAADODriver, uROIndyTCPServer; + +type + TFirstSampleServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + IBXDriver: TDAIBXDriver; + DataDictionary: TDADataDictionary; + SessionManager: TROInMemorySessionManager; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + FirstSampleServerDataModule: TFirstSampleServerDataModule; + +implementation + +{$R *.dfm} + +procedure TFirstSampleServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerMain.dfm new file mode 100644 index 0000000..af7db88 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerMain.dfm @@ -0,0 +1,21 @@ +object FirstSampleServerMainForm: TFirstSampleServerMainForm + Left = 109 + Top = 97 + BorderStyle = bsDialog + Caption = 'First Sample Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerMain.pas new file mode 100644 index 0000000..bcaeffa --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleServerMain.pas @@ -0,0 +1,25 @@ +unit FirstSampleServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton; + +type + TFirstSampleServerMainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + FirstSampleServerMainForm: TFirstSampleServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleService_Impl.dfm new file mode 100644 index 0000000..75412ab --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleService_Impl.dfm @@ -0,0 +1,220 @@ +object FirstSampleService: TFirstSampleService + OldCreateOrder = True + SessionManager = FirstSampleServerDataModule.SessionManager + AcquireConnection = True + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Left = 69 + Top = 46 + Height = 212 + Width = 216 + object DataStreamer: TDABinDataStreamer + Left = 32 + Top = 8 + end + object Schema: TDASchema + ConnectionManager = FirstSampleServerDataModule.ConnectionManager + DataDictionary = FirstSampleServerDataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 32 + Top = 56 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleService_Impl.pas new file mode 100644 index 0000000..e5d0c19 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleService_Impl.pas @@ -0,0 +1,37 @@ +unit FirstSampleService_Impl; + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Data Abstract:} uDAClasses, uDADataTable, uDABinAdapter, uDAInterfaces, uDADataStreamer, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} FirstSampleLibrary_Intf; + +type + { TFirstSampleService } + TFirstSampleService = class(TDataAbstractService, IFirstSampleService) + DataStreamer: TDABinDataStreamer; + Schema: TDASchema; + private + protected + { IFirstSampleService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} FirstSampleLibrary_Invk, FirstSampleServerData; + +procedure Create_FirstSampleService(out anInstance: IUnknown); +begin + anInstance := TFirstSampleService.Create(nil); +end; + +initialization + TROClassFactory.Create('FirstSampleService', Create_FirstSampleService, TFirstSampleService_Invoker); +finalization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleclientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleclientMain.dfm new file mode 100644 index 0000000..82e5cea --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleclientMain.dfm @@ -0,0 +1,55 @@ +object FirstSampleclientMainForm: TFirstSampleclientMainForm + Left = 31 + Top = 80 + AutoScroll = False + Caption = 'First Sample Client' + ClientHeight = 411 + ClientWidth = 615 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 120 + TextHeight = 16 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 2 + Top = 5 + Width = 212 + Height = 48 + Cursor = crHandPoint + ApplicationType = atClient + end + object FillButton: TButton + Left = 384 + Top = 20 + Width = 92 + Height = 30 + Caption = '&Fill' + TabOrder = 0 + OnClick = FillButtonClick + end + object UpdateButton: TButton + Left = 512 + Top = 20 + Width = 92 + Height = 30 + Caption = '&Update' + Enabled = False + TabOrder = 1 + OnClick = UpdateButtonClick + end + object DBGrid1: TDBGrid + Left = 2 + Top = 70 + Width = 609 + Height = 336 + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = FirstSampleClientDataModule.ds_Customers + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -14 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleclientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleclientMain.pas new file mode 100644 index 0000000..22e50b7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/FirstSampleclientMain.pas @@ -0,0 +1,45 @@ +unit FirstSampleclientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, Grids, + DBGrids, uROPoweredByRemObjectsButton, uDAPoweredByDataAbstractButton; + +type + TFirstSampleclientMainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + FillButton: TButton; + UpdateButton: TButton; + DBGrid1: TDBGrid; + procedure FillButtonClick(Sender: TObject); + procedure UpdateButtonClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + FirstSampleclientMainForm: TFirstSampleclientMainForm; + +implementation + +uses + FirstSampleClientData; + +{$R *.dfm} + +procedure TFirstSampleclientMainForm.FillButtonClick(Sender: TObject); +begin + FirstSampleClientDataModule.tbl_Customers.Open; + UpdateButton.Enabled:=True; +end; + +procedure TFirstSampleclientMainForm.UpdateButtonClick(Sender: TObject); +begin + FirstSampleClientDataModule.tbl_Customers.ApplyUpdates; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample.Sample.html new file mode 100644 index 0000000..e518fc9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample.Sample.html @@ -0,0 +1,27 @@ + + + + + + + + + +

+ Generators Sample +

+ + +

Purpose

+

+ This example demonstrates how can be used AutoIncrement fields for different databases. +

+

Getting Started

+ + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample.bpg new file mode 100644 index 0000000..ee25a5a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = GeneratorsSample_Server.exe GeneratorsSample_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +GeneratorsSample_Server.exe: GeneratorsSample_Server.dpr + $(DCC) + +GeneratorsSample_Client.exe: GeneratorsSample_Client.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample.groupproj new file mode 100644 index 0000000..74bdfbc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample.groupproj @@ -0,0 +1,44 @@ + + + {28f5f5ec-0a09-44e3-8be1-af4f7b108269} + + + + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Client.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Client.dpr new file mode 100644 index 0000000..2aec367 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Client.dpr @@ -0,0 +1,18 @@ +program GeneratorsSample_Client; + +uses + uROComInit, + Forms, + MidasLib, + GeneratorsSample_ClientMain in 'GeneratorsSample_ClientMain.pas' {GeneratorsSample_ClientMainForm}, + GeneratorsSample_ClientData in 'GeneratorsSample_ClientData.pas' {GeneratorsSample_ClientDataForm: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Generators Client'; + Application.CreateForm(TGeneratorsSample_ClientDataForm, GeneratorsSample_ClientDataForm); + Application.CreateForm(TGeneratorsSample_ClientMainForm, GeneratorsSample_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Client.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Client.dproj new file mode 100644 index 0000000..0aeb717 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Client.dproj @@ -0,0 +1,76 @@ + + + {8f2e2787-1ab7-4ab7-bd5a-799e5a5eaa05} + GeneratorsSample_Client.dpr + Debug + AnyCPU + DCC32 + GeneratorsSample_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + GeneratorsSample_Client.dpr + + + + + + + MainSource + + +
GeneratorsSample_ClientDataForm
+ TDAClientDataModule +
+ +
GeneratorsSample_ClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Client.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Client.res new file mode 100644 index 0000000..19aaa87 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Client.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientData.dfm new file mode 100644 index 0000000..b55e30a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientData.dfm @@ -0,0 +1,59 @@ +object GeneratorsSample_ClientDataForm: TGeneratorsSample_ClientDataForm + OldCreateOrder = True + OnCreate = DataModuleCreate + Left = 439 + Top = 220 + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Envelopes = <> + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'GeneratorsSample_Service' + Left = 40 + Top = 96 + end + object DataStreamer: TDABin2DataStreamer + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 40 + Top = 184 + end + object tbl_Data: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + LocalDataStreamer = DataStreamer + IndexDefs = <> + Left = 152 + Top = 32 + end + object ds_Data: TDADataSource + DataSet = tbl_Data.Dataset + DataTable = tbl_Data + Left = 152 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientData.pas new file mode 100644 index 0000000..8bb974a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientData.pas @@ -0,0 +1,43 @@ +unit GeneratorsSample_ClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABin2DataStreamer, uDAInterfaces, uDARemoteDataAdapter, + uDADataStreamer, + GeneratorsSample_Library_Intf, uDAScriptingProvider, uDAMemDataTable; + +type + TGeneratorsSample_ClientDataForm = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABin2DataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + tbl_Data: TDAMemDataTable; + ds_Data: TDADataSource; + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + fService: IGeneratorsSample_Service; + + end; + +var + GeneratorsSample_ClientDataForm: TGeneratorsSample_ClientDataForm; + +implementation + + +{$R *.dfm} + +procedure TGeneratorsSample_ClientDataForm.DataModuleCreate(Sender: TObject); +begin + fService := RemoteService as IGeneratorsSample_Service; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientMain.dfm new file mode 100644 index 0000000..4246033 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientMain.dfm @@ -0,0 +1,94 @@ +object GeneratorsSample_ClientMainForm: TGeneratorsSample_ClientMainForm + Left = 280 + Top = 175 + Width = 640 + Height = 480 + Caption = 'AutoInc Field Client' + Color = clBtnFace + Constraints.MinHeight = 480 + Constraints.MinWidth = 640 + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + Scaled = False + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 624 + Height = 97 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + DesignSize = ( + 624 + 97) + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + ApplicationType = atClient + end + object Label2: TLabel + Left = 256 + Top = 8 + Width = 30 + Height = 13 + Caption = 'Table:' + end + object btnApply: TButton + Left = 545 + Top = 22 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Apply' + Enabled = False + TabOrder = 0 + OnClick = btnApplyClick + end + object DBNavigator1: TDBNavigator + Left = 6 + Top = 64 + Width = 230 + Height = 25 + DataSource = GeneratorsSample_ClientDataForm.ds_Data + ParentShowHint = False + ShowHint = True + TabOrder = 1 + BeforeAction = DBNavigator1Click + end + object cmbTables: TComboBox + Left = 256 + Top = 24 + Width = 281 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 2 + OnClick = cmbTablesClick + OnKeyPress = cmbTablesKeyPress + end + end + object DBGrid: TDBGrid + Left = 0 + Top = 97 + Width = 624 + Height = 347 + Align = alClient + DataSource = GeneratorsSample_ClientDataForm.ds_Data + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientMain.pas new file mode 100644 index 0000000..5af3039 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ClientMain.pas @@ -0,0 +1,177 @@ +unit GeneratorsSample_ClientMain; + +interface + +uses + Forms, Classes, ExtCtrls, StdCtrls, Controls, Grids, + DB, DBGrids, DBCtrls, + uROPoweredByRemObjectsButton, uDAPoweredByDataAbstractButton + ; + +type + TGeneratorsSample_ClientMainForm = class(TForm) + Panel1: TPanel; + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + DBGrid: TDBGrid; + btnApply: TButton; + DBNavigator1: TDBNavigator; + Label2: TLabel; + cmbTables: TComboBox; + procedure FormCreate(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure FormShow(Sender: TObject); + procedure cmbTablesClick(Sender: TObject); + procedure cmbTablesKeyPress(Sender: TObject; var Key: Char); + procedure btnApplyClick(Sender: TObject); + procedure DBNavigator1Click(Sender: TObject; Button: TNavigateBtn); + private + { Private declarations } + fTblIdx: integer; + procedure SetTable(const TblName: string); + function ApplyChanges: Boolean; + procedure ds_DataDataChange(Sender: TObject; Field: TField); + public + { Public declarations } + end; + +var + GeneratorsSample_ClientMainForm: TGeneratorsSample_ClientMainForm; + +implementation + +uses + SysUtils, Dialogs, + uDADataTable, DataAbstract4_Intf, + GeneratorsSample_ClientData, GeneratorsSample_Library_Intf; + +{$R *.dfm} + +procedure ShowErrMsg(const ErrMsg: string); +begin + MessageDlg(ErrMsg, mtError, [mbOK], 0); +end; + +procedure TGeneratorsSample_ClientMainForm.FormCreate(Sender: TObject); +begin + fTblIdx := -1; +end; + +procedure TGeneratorsSample_ClientMainForm.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +begin + CanClose := ApplyChanges(); +end; + +procedure TGeneratorsSample_ClientMainForm.FormShow(Sender: TObject); +var + Tables: StringArray; + i: integer; +begin + Tables := nil; + try + Tables := GeneratorsSample_ClientDataForm.fService.GetTableNames; + if Assigned(Tables) then + for i := 0 to Tables.Count - 1 do + cmbTables.Items.Add(Tables[i]); + finally + Tables.Free; + cmbTables.Enabled := (cmbTables.Items.Count > 0); + if cmbTables.Items.Count = 1 then cmbTables.ItemIndex := 0; + end; +end; + +function TGeneratorsSample_ClientMainForm.ApplyChanges: Boolean; +var + R: TModalResult; +begin + Result := True; + if btnApply.Enabled then begin + R := MessageDlg('Do you want to apply changes?', mtConfirmation, mbYesNoCancel, 0); + if R = mrCancel then begin + Result := False + end + else if R = mrNo then begin + Result := True + end + else begin + btnApply.Enabled := False; + try + GeneratorsSample_ClientDataForm.tbl_Data.ApplyUpdates; + btnApply.Enabled := GeneratorsSample_ClientDataForm.tbl_Data.HasDelta; + except + on e: Exception do raise ; + end; + Result := True; + end; + end; +end; + +procedure TGeneratorsSample_ClientMainForm.cmbTablesClick(Sender: TObject); +begin + if cmbTables.DroppedDown or (cmbTables.ItemIndex < 0) then exit; + SetTable(cmbTables.Text); +end; + +procedure TGeneratorsSample_ClientMainForm.cmbTablesKeyPress(Sender: TObject; var Key: Char); +begin + if Key = #13 then + begin + if cmbTables.DroppedDown then cmbTables.DroppedDown := False; + cmbTablesClick(Sender); + Key := #0; + end; +end; + +procedure TGeneratorsSample_ClientMainForm.SetTable(const TblName: string); +var + i: integer; + S: string; + Tbl: TDADataTable; + OldCurs: TCursor; +begin + i := Pos('(', TblName); + + if i > 0 then + S := Trim(Copy(TblName, 1, i - 1)) + else + S := Trim(TblName); + + Tbl := GeneratorsSample_ClientDataForm.tbl_Data; + + if (Tbl.LogicalName <> S) and ApplyChanges() then begin + OldCurs := Screen.Cursor; + try + fTblIdx := cmbTables.ItemIndex; + Screen.Cursor := crHourGlass; + GeneratorsSample_ClientDataForm.ds_Data.OnDataChange := nil; + Tbl.Close; + Tbl.Fields.Clear(); + Tbl.LogicalName := S; + Tbl.Open; + GeneratorsSample_ClientDataForm.ds_Data.OnDataChange := ds_DataDataChange; + btnApply.Enabled := False; + finally + Screen.Cursor := OldCurs; + end; + end + else + cmbTables.ItemIndex := fTblIdx; +end; + +procedure TGeneratorsSample_ClientMainForm.ds_DataDataChange(Sender: TObject; Field: TField); +begin + btnApply.Enabled := GeneratorsSample_ClientDataForm.tbl_Data.HasDelta; +end; + +procedure TGeneratorsSample_ClientMainForm.btnApplyClick(Sender: TObject); +begin + ApplyChanges(); +end; + +procedure TGeneratorsSample_ClientMainForm.DBNavigator1Click(Sender: TObject; + Button: TNavigateBtn); +begin + if (Button = nbRefresh) and not ApplyChanges() then Abort; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Library.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Library.RODL new file mode 100644 index 0000000..2a48ff2 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Library.RODL @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Library_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Library_Intf.pas new file mode 100644 index 0000000..8ae98a8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Library_Intf.pas @@ -0,0 +1,102 @@ +unit GeneratorsSample_Library_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{D2725B49-2EA8-4C0D-BEA6-7AD3CCCB0B4B}'; + TargetNamespace = ''; + + { Service Interface ID's } + IGeneratorsSample_Service_IID : TGUID = '{1E9E677F-A52A-44E9-9EBB-5DFE04D220D7}'; + + { Event ID's } + +type + { Forward declarations } + IGeneratorsSample_Service = interface; + + + + + + { Enumerateds } + + { IGeneratorsSample_Service } + IGeneratorsSample_Service = interface(IDataAbstractService) + ['{1E9E677F-A52A-44E9-9EBB-5DFE04D220D7}'] + function GetTableNames: StringArray; + end; + + { CoGeneratorsSample_Service } + CoGeneratorsSample_Service = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IGeneratorsSample_Service; + end; + + { TGeneratorsSample_Service_Proxy } + TGeneratorsSample_Service_Proxy = class(TDataAbstractService_Proxy, IGeneratorsSample_Service) + protected + function __GetInterfaceName:string; override; + + function GetTableNames: StringArray; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoGeneratorsSample_Service } + +class function CoGeneratorsSample_Service.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IGeneratorsSample_Service; +begin + result := TGeneratorsSample_Service_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TGeneratorsSample_Service_Proxy } + +function TGeneratorsSample_Service_Proxy.__GetInterfaceName:string; +begin + result := 'GeneratorsSample_Service'; +end; + +function TGeneratorsSample_Service_Proxy.GetTableNames: StringArray; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'GeneratorsSample_Library', __InterfaceName, 'GetTableNames'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DataAbstract4_Intf.StringArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IGeneratorsSample_Service_IID, TGeneratorsSample_Service_Proxy); + + +finalization + UnregisterProxyClass(IGeneratorsSample_Service_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Library_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Library_Invk.pas new file mode 100644 index 0000000..0c4dafd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Library_Invk.pas @@ -0,0 +1,71 @@ +unit GeneratorsSample_Library_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} GeneratorsSample_Library_Intf; + +type + TGeneratorsSample_Service_Invoker = class(TDataAbstractService_Invoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_GetTableNames(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TGeneratorsSample_Service_Invoker } + +constructor TGeneratorsSample_Service_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TGeneratorsSample_Service_Invoker.Invoke_GetTableNames(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetTableNames: StringArray; } +var + lResult: DataAbstract4_Intf.StringArray; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + lResult := (__Instance as IGeneratorsSample_Service).GetTableNames; + + __Message.InitializeResponseMessage(__Transport, 'GeneratorsSample_Library', 'GeneratorsSample_Service', 'GetTableNamesResponse'); + __Message.Write('Result', TypeInfo(DataAbstract4_Intf.StringArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Server.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Server.dpr new file mode 100644 index 0000000..8736bbd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Server.dpr @@ -0,0 +1,30 @@ +program GeneratorsSample_Server; + +{#ROGEN:GeneratorsSample_Library.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + GeneratorsSample_ServerMain in 'GeneratorsSample_ServerMain.pas' {GeneratorsSample_ServerForm}, + GeneratorsSample_ServerData in 'GeneratorsSample_ServerData.pas' {GeneratorsSample_ServerDataModule: TDataModule}, + GeneratorsSample_Library_Intf in 'GeneratorsSample_Library_Intf.pas', + GeneratorsSample_Library_Invk in 'GeneratorsSample_Library_Invk.pas', + GeneratorsSample_Service_Impl in 'GeneratorsSample_Service_Impl.pas' {GeneratorsSample_Service: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + if ROStartService('GeneratorsSample', 'Generators Sample') then begin + ROService.CreateForm(TGeneratorsSample_ServerDataModule, GeneratorsSample_ServerDataModule); + ROService.Run; + Exit; + end; + + Application.Initialize; + Application.Title := 'Generators Server'; + Application.CreateForm(TGeneratorsSample_ServerDataModule, GeneratorsSample_ServerDataModule); + Application.CreateForm(TGeneratorsSample_ServerForm, GeneratorsSample_ServerForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Server.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Server.dproj new file mode 100644 index 0000000..a97e5b1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Server.dproj @@ -0,0 +1,82 @@ + + + {29fec98e-98f9-4758-b3bb-2563f25fcfa8} + GeneratorsSample_Server.dpr + Debug + AnyCPU + DCC32 + GeneratorsSample_Server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + GeneratorsSample_Server.dpr + + + + + + + MainSource + + + + +
GeneratorsSample_ServerDataModule
+ TDataModule +
+ +
GeneratorsSample_ServerForm
+
+ +
GeneratorsSample_Service
+ TDataAbstractService +
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Server.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Server.res new file mode 100644 index 0000000..0dbc4d6 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Server.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerData.dfm new file mode 100644 index 0000000..e4563e9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerData.dfm @@ -0,0 +1,71 @@ +object GeneratorsSample_ServerDataModule: TGeneratorsSample_ServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 362 + Top = 208 + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Envelopes = <> + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'ADO Connection to Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI;' + ConnectionType = 'MSSQL' + end + item + Name = 'IBX Connection to EMPLOYEE.FDB' + ConnectionString = + 'IBX?Server=localhost;Database=D:\EMPLOYEE.FDB;UserID=sysdba;Pass' + + 'word=masterkey;' + ConnectionType = 'Interbase' + Default = True + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object IBXDriver: TDAIBXDriver + Left = 256 + Top = 56 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerData.pas new file mode 100644 index 0000000..ab3e3dd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerData.pas @@ -0,0 +1,42 @@ +unit GeneratorsSample_ServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAIBXDriver, uDAADODriver, uROIndyTCPServer; + +type + TGeneratorsSample_ServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + IBXDriver: TDAIBXDriver; + SessionManager: TROInMemorySessionManager; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + GeneratorsSample_ServerDataModule: TGeneratorsSample_ServerDataModule; + +implementation + +{$R *.dfm} + +procedure TGeneratorsSample_ServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerMain.dfm new file mode 100644 index 0000000..bd110b3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerMain.dfm @@ -0,0 +1,21 @@ +object GeneratorsSample_ServerForm: TGeneratorsSample_ServerForm + Left = 372 + Top = 277 + BorderStyle = bsDialog + Caption = 'Generators Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerMain.pas new file mode 100644 index 0000000..a84072e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_ServerMain.pas @@ -0,0 +1,26 @@ +unit GeneratorsSample_ServerMain; + +interface + +uses + Forms, Classes, Controls, + uROPoweredByRemObjectsButton, uDAPoweredByDataAbstractButton + ; + +type + TGeneratorsSample_ServerForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + GeneratorsSample_ServerForm: TGeneratorsSample_ServerForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Service_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Service_Impl.dfm new file mode 100644 index 0000000..b6cced7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Service_Impl.dfm @@ -0,0 +1,332 @@ +object GeneratorsSample_Service: TGeneratorsSample_Service + OldCreateOrder = True + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + ValidateDatasetAccess = DataAbstractServiceValidateDatasetAccess + Left = 401 + Top = 313 + Height = 300 + Width = 300 + object DataStreamer: TDABin2DataStreamer + Left = 32 + Top = 8 + end + object Schema: TDASchema + ConnectionManager = GeneratorsSample_ServerDataModule.ConnectionManager + DataDictionary = GeneratorsSample_ServerDataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO Connection to Northwind' + ConnectionType = 'MSSQL' + Default = True + TargetTable = 'Employees' + Name = 'MSSQL' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'LastName' + TableField = 'LastName' + end + item + DatasetField = 'FirstName' + TableField = 'FirstName' + end + item + DatasetField = 'Title' + TableField = 'Title' + end + item + DatasetField = 'TitleOfCourtesy' + TableField = 'TitleOfCourtesy' + end + item + DatasetField = 'BirthDate' + TableField = 'BirthDate' + end + item + DatasetField = 'HireDate' + TableField = 'HireDate' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'HomePhone' + TableField = 'HomePhone' + end + item + DatasetField = 'Extension' + TableField = 'Extension' + end + item + DatasetField = 'Photo' + TableField = 'Photo' + end + item + DatasetField = 'Notes' + TableField = 'Notes' + end + item + DatasetField = 'ReportsTo' + TableField = 'ReportsTo' + end + item + DatasetField = 'PhotoPath' + TableField = 'PhotoPath' + end> + end> + Name = 'Employee' + Description = 'MSSQL' + Fields = < + item + Name = 'EmployeeID' + DataType = datAutoInc + GeneratorName = 'Employees' + Required = True + InPrimaryKey = True + end + item + Name = 'LastName' + DataType = datWideString + Size = 20 + Required = True + end + item + Name = 'FirstName' + DataType = datWideString + Size = 10 + Required = True + end + item + Name = 'Title' + DataType = datWideString + Size = 30 + end + item + Name = 'TitleOfCourtesy' + DataType = datWideString + Size = 25 + end + item + Name = 'BirthDate' + DataType = datDateTime + end + item + Name = 'HireDate' + DataType = datDateTime + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + end + item + Name = 'City' + DataType = datWideString + Size = 15 + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + end + item + Name = 'HomePhone' + DataType = datWideString + Size = 24 + end + item + Name = 'Extension' + DataType = datWideString + Size = 4 + end + item + Name = 'Photo' + DataType = datBlob + end + item + Name = 'Notes' + DataType = datMemo + end + item + Name = 'ReportsTo' + DataType = datInteger + end + item + Name = 'PhotoPath' + DataType = datWideString + Size = 255 + end> + end + item + Params = <> + Statements = < + item + Connection = 'IBX Connection to EMPLOYEE.FDB' + ConnectionType = 'Interbase' + Default = True + TargetTable = 'CUSTOMER' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'CUST_NO' + TableField = 'CUST_NO' + end + item + DatasetField = 'CUSTOMER' + TableField = 'CUSTOMER' + end + item + DatasetField = 'CONTACT_FIRST' + TableField = 'CONTACT_FIRST' + end + item + DatasetField = 'CONTACT_LAST' + TableField = 'CONTACT_LAST' + end + item + DatasetField = 'PHONE_NO' + TableField = 'PHONE_NO' + end + item + DatasetField = 'ADDRESS_LINE1' + TableField = 'ADDRESS_LINE1' + end + item + DatasetField = 'ADDRESS_LINE2' + TableField = 'ADDRESS_LINE2' + end + item + DatasetField = 'CITY' + TableField = 'CITY' + end + item + DatasetField = 'STATE_PROVINCE' + TableField = 'STATE_PROVINCE' + end + item + DatasetField = 'COUNTRY' + TableField = 'COUNTRY' + end + item + DatasetField = 'POSTAL_CODE' + TableField = 'POSTAL_CODE' + end + item + DatasetField = 'ON_HOLD' + TableField = 'ON_HOLD' + end> + end> + Name = 'CUSTOMER' + Description = 'Interbase' + Fields = < + item + Name = 'CUST_NO' + DataType = datAutoInc + GeneratorName = 'CUST_NO_GEN' + LogChanges = False + Required = True + InPrimaryKey = True + end + item + Name = 'CUSTOMER' + DataType = datString + Size = 25 + Required = True + end + item + Name = 'CONTACT_FIRST' + DataType = datString + Size = 15 + end + item + Name = 'CONTACT_LAST' + DataType = datString + Size = 20 + end + item + Name = 'PHONE_NO' + DataType = datString + Size = 20 + end + item + Name = 'ADDRESS_LINE1' + DataType = datString + Size = 30 + end + item + Name = 'ADDRESS_LINE2' + DataType = datString + Size = 30 + end + item + Name = 'CITY' + DataType = datString + Size = 25 + end + item + Name = 'STATE_PROVINCE' + DataType = datString + Size = 15 + end + item + Name = 'COUNTRY' + DataType = datString + Size = 15 + end + item + Name = 'POSTAL_CODE' + DataType = datString + Size = 12 + end + item + Name = 'ON_HOLD' + DataType = datString + Size = 1 + end> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 32 + Top = 56 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Service_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Service_Impl.pas new file mode 100644 index 0000000..fea959f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/GeneratorsSample_Service_Impl.pas @@ -0,0 +1,89 @@ +unit GeneratorsSample_Service_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} GeneratorsSample_Library_Intf, uDAClasses, uDADataStreamer, + uDABin2DataStreamer, uDAInterfaces; + +type + { TGeneratorsSample_Service } + TGeneratorsSample_Service = class(TDataAbstractService, IGeneratorsSample_Service) + DataStreamer: TDABin2DataStreamer; + Schema: TDASchema; + procedure DataAbstractServiceValidateDatasetAccess(Sender: TObject; + const aConnection: IDAConnection; const aDatasetName: String; + const aParamNames: array of String; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); + private + protected + { IGeneratorsSample_Service methods } + function GetTableNames: StringArray; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} GeneratorsSample_Library_Invk; + +procedure Create_GeneratorsSample_Service(out anInstance : IUnknown); +begin + anInstance := TGeneratorsSample_Service.Create(nil); +end; + +{ GeneratorsSample_Service } +function TGeneratorsSample_Service.GetTableNames: StringArray; +var + i: integer; +begin + Result := StringArray.Create(); + + for i := 0 to Schema.Datasets.Count - 1 do + Result.Add(Schema.Datasets[i].Name + ' (' + Schema.Datasets[i].Description + ')'); +end; + +procedure TGeneratorsSample_Service.DataAbstractServiceValidateDatasetAccess( + Sender: TObject; const aConnection: IDAConnection; + const aDatasetName: String; const aParamNames: array of String; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); +var + i: integer; + ConName: string; +begin + ConName := ''; + + for i := 0 to aSchema.Datasets.Count - 1 do + if AnsiSameText(aSchema.Datasets[i].Name, aDatasetName) then begin + ConName := aSchema.Datasets[i].Statements[0].Connection; + break; + end; + + if not AnsiSameText(ConName, aConnection.Name) then begin + Connection := aSchema.ConnectionManager.NewConnection(ConName); + + for i := 0 to aSchema.ConnectionManager.Connections.Count - 1 do + aSchema.ConnectionManager.Connections[i].Default := + AnsiSameText(aSchema.ConnectionManager.Connections[i].Name, ConName); + end; +end; + +initialization + TROClassFactory.Create('GeneratorsSample_Service', Create_GeneratorsSample_Service, TGeneratorsSample_Service_Invoker); +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/RODLFILE.res new file mode 100644 index 0000000..a952c2e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/Generators/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/RODLFILE.res new file mode 100644 index 0000000..f3eeb87 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/First Sample/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysClient.dpr new file mode 100644 index 0000000..24283bc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysClient.dpr @@ -0,0 +1,18 @@ +program ForeignKeysClient; + +uses + uROComInit, + Forms, + MidasLib, + ForeignKeys_ClientMain in 'ForeignKeys_ClientMain.pas' {ForeignKeys_ClientMainForm}, + ForeignKeys_ClientData in 'ForeignKeys_ClientData.pas' {ForeignKeys_ClientDataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Foreign Keys Client'; + Application.CreateForm(TForeignKeys_ClientDataModule, ForeignKeys_ClientDataModule); + Application.CreateForm(TForeignKeys_ClientMainForm, ForeignKeys_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysGroup.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysGroup.Sample.html new file mode 100644 index 0000000..424a5fd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysGroup.Sample.html @@ -0,0 +1,32 @@ + + + + + + + + +

+ Foreign Keys Example +

+

Purpose

+

+ This example shows how DataAbstract works with tables which have relationship. Relationships usually + are created automatically from foreign keys. +

+

Examine the Code

+

+ The code is very simple: client-side application contains 2 tables which aren't linked as master/detail but + they are updated in one call. +

+

Required steps

+

+ Create a new record in the Categories table (it's the top table).
+ Create a new record in the Products table (it's the bottom table) and link this record with the + Categories table. So this record will be initialized with ProductID = -1 and CategoryID = -1.
+ Call ApplyUpdate and see that CategoryID for this record has correct value. +

+ + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysGroup.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysGroup.bpg new file mode 100644 index 0000000..d249152 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysGroup.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = ForeignKeysServer.exe ForeignKeysClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +ForeignKeysServer.exe: ForeignKeysServer.dpr + $(DCC) + +ForeignKeysClient.exe: ForeignKeysClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysLibrary.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysLibrary.RODL new file mode 100644 index 0000000..fa5231f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysLibrary.RODL @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysServer.dpr new file mode 100644 index 0000000..abdfabe --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysServer.dpr @@ -0,0 +1,30 @@ +program ForeignKeysServer; + +{#ROGEN:ForeignKeysLibrary.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + ForeignKeys_ServerMain in 'ForeignKeys_ServerMain.pas' {ForeignKeys_ServerMainForm}, + ForeignKeys_ServerData in 'ForeignKeys_ServerData.pas' {ForeignKeys_ServerDataModule: TDataModule}, + ForeignKeys_Library_Intf in 'ForeignKeys_Library_Intf.pas', + ForeignKeys_Library_Invk in 'ForeignKeys_Library_Invk.pas', + ForeignKeys_Service_Impl in 'ForeignKeys_Service_Impl.pas' {ForeignKeys_Service: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + if ROStartService('NewProject', 'NewProject') then begin + ROService.CreateForm(TForeignKeys_ServerDataModule, ForeignKeys_ServerDataModule); + ROService.Run; + Exit; + end; + + Application.Initialize; + Application.Title := 'Foreign Keys Server'; + Application.CreateForm(TForeignKeys_ServerDataModule, ForeignKeys_ServerDataModule); + Application.CreateForm(TForeignKeys_ServerMainForm, ForeignKeys_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeysServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientData.dfm new file mode 100644 index 0000000..b6a6d4c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientData.dfm @@ -0,0 +1,126 @@ +object ForeignKeys_ClientDataModule: TForeignKeys_ClientDataModule + OldCreateOrder = True + Left = 439 + Top = 220 + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Envelopes = <> + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'ForeignKeys_Service' + Left = 40 + Top = 96 + end + object DataStreamer: TDABin2DataStreamer + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 40 + Top = 184 + end + object tbl_Categories: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CategoryID' + DataType = datAutoInc + GeneratorName = 'Categories' + Required = True + InPrimaryKey = True + end + item + Name = 'CategoryName' + DataType = datWideString + Size = 15 + Required = True + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + LogicalName = 'Categories' + IndexDefs = <> + Left = 128 + Top = 120 + end + object ds_Categories: TDADataSource + DataSet = tbl_Categories.Dataset + DataTable = tbl_Categories + Left = 160 + Top = 120 + end + object tbl_Products: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ProductID' + DataType = datAutoInc + GeneratorName = 'Products' + Required = True + InPrimaryKey = True + end + item + Name = 'ProductName' + DataType = datWideString + Size = 40 + Required = True + end + item + Name = 'SupplierID' + DataType = datInteger + end + item + Name = 'CategoryID' + DataType = datInteger + end + item + Name = 'Discontinued' + DataType = datBoolean + Required = True + end + item + Name = 'CategoryName' + DataType = datWideString + Size = 15 + LogChanges = False + Lookup = True + LookupSource = ds_Categories + LookupKeyFields = 'CategoryID' + LookupResultField = 'CategoryName' + KeyFields = 'CategoryID' + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + OnNewRecord = tbl_ProductsNewRecord + LogicalName = 'Products' + IndexDefs = <> + Left = 128 + Top = 176 + end + object ds_Products: TDADataSource + DataSet = tbl_Products.Dataset + DataTable = tbl_Products + Left = 160 + Top = 176 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientData.pas new file mode 100644 index 0000000..7a4ac02 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientData.pas @@ -0,0 +1,42 @@ +unit ForeignKeys_ClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABin2DataStreamer, uDAInterfaces, uDARemoteDataAdapter, + uDAScriptingProvider, uDAMemDataTable, uDADataStreamer; + +type + TForeignKeys_ClientDataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABin2DataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + tbl_Categories: TDAMemDataTable; + ds_Categories: TDADataSource; + tbl_Products: TDAMemDataTable; + ds_Products: TDADataSource; + procedure tbl_ProductsNewRecord(DataTable: TDADataTable); + private + { Private declarations } + public + { Public declarations } + end; + +var + ForeignKeys_ClientDataModule: TForeignKeys_ClientDataModule; + +implementation + +{$R *.dfm} + +procedure TForeignKeys_ClientDataModule.tbl_ProductsNewRecord(DataTable: TDADataTable); +begin + DataTable.FieldByName('Discontinued').AsBoolean:=False; + DataTable.FieldByName('SupplierID').AsInteger:=1; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientMain.dfm new file mode 100644 index 0000000..9b73a39 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientMain.dfm @@ -0,0 +1,76 @@ +object ForeignKeys_ClientMainForm: TForeignKeys_ClientMainForm + Left = 374 + Top = 253 + Width = 685 + Height = 341 + Caption = 'Data Abstract Client' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Splitter1: TSplitter + Left = 0 + Top = 153 + Width = 669 + Height = 3 + Cursor = crVSplit + Align = alTop + end + object gCategories: TDBGrid + Left = 0 + Top = 41 + Width = 669 + Height = 112 + Align = alTop + DataSource = ForeignKeys_ClientDataModule.ds_Categories + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object gProducts: TDBGrid + Left = 0 + Top = 156 + Width = 669 + Height = 149 + Align = alClient + DataSource = ForeignKeys_ClientDataModule.ds_Products + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 669 + Height = 41 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object btnOpen: TButton + Left = 8 + Top = 8 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 0 + OnClick = btnOpenClick + end + object btnApplyUpdate: TButton + Left = 88 + Top = 8 + Width = 75 + Height = 25 + Caption = 'ApplyUpdate' + TabOrder = 1 + OnClick = btnApplyUpdateClick + end + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientMain.pas new file mode 100644 index 0000000..7d68cf5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ClientMain.pas @@ -0,0 +1,52 @@ +unit ForeignKeys_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, ExtCtrls, + Grids, DBGrids; + +type + TForeignKeys_ClientMainForm = class(TForm) + gCategories: TDBGrid; + gProducts: TDBGrid; + Panel1: TPanel; + btnOpen: TButton; + Splitter1: TSplitter; + btnApplyUpdate: TButton; + procedure btnOpenClick(Sender: TObject); + procedure btnApplyUpdateClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ForeignKeys_ClientMainForm: TForeignKeys_ClientMainForm; + +implementation + +uses + ForeignKeys_ClientData, uDADataTable; + +{$R *.dfm} + +procedure TForeignKeys_ClientMainForm.btnOpenClick(Sender: TObject); +begin + with ForeignKeys_ClientDataModule do begin + with tbl_Categories do + Active := not Active; + with tbl_Products do + Active := not Active; + end; +end; + +procedure TForeignKeys_ClientMainForm.btnApplyUpdateClick(Sender: TObject); +begin + with ForeignKeys_ClientDataModule do + RemoteDataAdapter.ApplyUpdates([tbl_Categories,tbl_Products],False); +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Library_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Library_Intf.pas new file mode 100644 index 0000000..c61d7cc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Library_Intf.pas @@ -0,0 +1,82 @@ +unit ForeignKeys_Library_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{07BE57FA-61DB-4B8D-BCC8-7ADA1DBADED9}'; + TargetNamespace = ''; + + { Service Interface ID's } + IForeignKeys_Service_IID : TGUID = '{BE3A920C-DDF7-4177-82FB-2DDE62253F10}'; + + { Event ID's } + +type + { Forward declarations } + IForeignKeys_Service = interface; + + + + + + { Enumerateds } + + { IForeignKeys_Service } + IForeignKeys_Service = interface(IDataAbstractService) + ['{BE3A920C-DDF7-4177-82FB-2DDE62253F10}'] + end; + + { CoForeignKeys_Service } + CoForeignKeys_Service = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IForeignKeys_Service; + end; + + { TForeignKeys_Service_Proxy } + TForeignKeys_Service_Proxy = class(TDataAbstractService_Proxy, IForeignKeys_Service) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoForeignKeys_Service } + +class function CoForeignKeys_Service.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IForeignKeys_Service; +begin + result := TForeignKeys_Service_Proxy.Create(aMessage, aTransportChannel); +end; + +function TForeignKeys_Service_Proxy.__GetInterfaceName:string; +begin + result := 'ForeignKeys_Service'; +end; + +initialization + RegisterProxyClass(IForeignKeys_Service_IID, TForeignKeys_Service_Proxy); + + +finalization + UnregisterProxyClass(IForeignKeys_Service_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Library_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Library_Invk.pas new file mode 100644 index 0000000..66a61f3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Library_Invk.pas @@ -0,0 +1,45 @@ +unit ForeignKeys_Library_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} ForeignKeys_Library_Intf; + +type + TForeignKeys_Service_Invoker = class(TDataAbstractService_Invoker) + private + protected + public + constructor Create; override; + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TForeignKeys_Service_Invoker } + +constructor TForeignKeys_Service_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerData.dfm new file mode 100644 index 0000000..4e556e6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerData.dfm @@ -0,0 +1,59 @@ +object ForeignKeys_ServerDataModule: TForeignKeys_ServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Envelopes = <> + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI' + Description = 'Microsoft SQL Server 2000, localhost' + ConnectionType = 'MSSQL' + Default = True + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerData.pas new file mode 100644 index 0000000..93cf780 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerData.pas @@ -0,0 +1,41 @@ +unit ForeignKeys_ServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAADODriver, uROIndyTCPServer; + +type + TForeignKeys_ServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + SessionManager: TROInMemorySessionManager; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ForeignKeys_ServerDataModule: TForeignKeys_ServerDataModule; + +implementation + +{$R *.dfm} + +procedure TForeignKeys_ServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerMain.dfm new file mode 100644 index 0000000..4ead4b5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerMain.dfm @@ -0,0 +1,21 @@ +object ForeignKeys_ServerMainForm: TForeignKeys_ServerMainForm + Left = 372 + Top = 277 + BorderStyle = bsDialog + Caption = 'ForeignKeys Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerMain.pas new file mode 100644 index 0000000..bc1958c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_ServerMain.pas @@ -0,0 +1,25 @@ +unit ForeignKeys_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton; + +type + TForeignKeys_ServerMainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + ForeignKeys_ServerMainForm: TForeignKeys_ServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Service_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Service_Impl.dfm new file mode 100644 index 0000000..361847d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Service_Impl.dfm @@ -0,0 +1,146 @@ +object ForeignKeys_Service: TForeignKeys_Service + OldCreateOrder = True + SessionManager = ForeignKeys_ServerDataModule.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Height = 300 + Width = 300 + object Schema: TDASchema + ConnectionManager = ForeignKeys_ServerDataModule.ConnectionManager + DataDictionary = ForeignKeys_ServerDataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + ConnectionType = 'MSSQL' + Default = True + TargetTable = 'Categories' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'CategoryID' + TableField = 'CategoryID' + end + item + DatasetField = 'CategoryName' + TableField = 'CategoryName' + end> + end> + Name = 'Categories' + Fields = < + item + Name = 'CategoryID' + DataType = datAutoInc + GeneratorName = 'Categories' + Required = True + InPrimaryKey = True + end + item + Name = 'CategoryName' + DataType = datWideString + Size = 15 + Required = True + end> + end + item + Params = <> + Statements = < + item + ConnectionType = 'MSSQL' + Default = True + TargetTable = 'Products' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'ProductID' + TableField = 'ProductID' + end + item + DatasetField = 'ProductName' + TableField = 'ProductName' + end + item + DatasetField = 'SupplierID' + TableField = 'SupplierID' + end + item + DatasetField = 'CategoryID' + TableField = 'CategoryID' + end + item + DatasetField = 'Discontinued' + TableField = 'Discontinued' + end> + end> + Name = 'Products' + Fields = < + item + Name = 'ProductID' + DataType = datAutoInc + GeneratorName = 'Products' + Required = True + InPrimaryKey = True + end + item + Name = 'ProductName' + DataType = datWideString + Size = 40 + Required = True + end + item + Name = 'SupplierID' + DataType = datInteger + end + item + Name = 'CategoryID' + DataType = datInteger + end + item + Name = 'Discontinued' + DataType = datBoolean + Required = True + end> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = < + item + Name = 'FK_Products_Categories' + MasterDatasetName = 'Categories' + MasterFields = 'CategoryID' + DetailDatasetName = 'Products' + DetailFields = 'CategoryID' + RelationshipType = rtForeignKey + end> + UpdateRules = < + item + Name = 'Products Delete' + DoUpdate = False + DoInsert = False + DatasetName = 'Products' + FailureBehavior = fbRaiseException + end + item + Name = 'Categories Rules' + DatasetName = 'Categories' + FailureBehavior = fbRaiseException + end + item + Name = 'Product Insert/Update' + DoUpdate = False + DoDelete = False + DatasetName = 'Products' + FailureBehavior = fbRaiseException + end> + Version = 0 + Left = 32 + Top = 56 + end + object DataStreamer: TDABin2DataStreamer + Left = 32 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Service_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Service_Impl.pas new file mode 100644 index 0000000..70a04d4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/ForeignKeys_Service_Impl.pas @@ -0,0 +1,50 @@ +unit ForeignKeys_Service_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} ForeignKeys_Library_Intf, uDADataStreamer, + uDABin2DataStreamer, uDAClasses; + +type + { TForeignKeys_Service } + TForeignKeys_Service = class(TDataAbstractService, IForeignKeys_Service) + Schema: TDASchema; + DataStreamer: TDABin2DataStreamer; + private + protected + { IForeignKeys_Service methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} ForeignKeys_Library_Invk, ForeignKeys_ServerData; + +procedure Create_ForeignKeys_Service(out anInstance : IUnknown); +begin + anInstance := TForeignKeys_Service.Create(nil); +end; + +{ ForeignKeys_Service } +initialization + TROClassFactory.Create('ForeignKeys_Service', Create_ForeignKeys_Service, TForeignKeys_Service_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/RODLFILE.res new file mode 100644 index 0000000..6c5abb7 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Foreign Keys/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.Sample.html new file mode 100644 index 0000000..6e6c2e4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.Sample.html @@ -0,0 +1,70 @@ + + + + + + + + + +

+ Local Schema Sample +

+ + +

Purpose

+

+ A simple demo showing the use of several Data Abstract components to select/update + a range of Customer records. +

+

Examine the Code

+

+ The Data Abstract components on the form are: +

+ +

+   +

+

+   +

+ + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.bdsproj new file mode 100644 index 0000000..0010851 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + LocalSchema.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.dpr new file mode 100644 index 0000000..ca77be5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.dpr @@ -0,0 +1,14 @@ +program LocalSchema; + +uses + Forms, + LocalSchemaMain in 'LocalSchemaMain.pas' {LocalSchemaMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Manual DataTable fill'; + Application.CreateForm(TLocalSchemaMainForm, LocalSchemaMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.dproj new file mode 100644 index 0000000..2b86fe9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.dproj @@ -0,0 +1,72 @@ + + + {836cc650-b903-40cd-bf94-647e264ddc3c} + LocalSchema.dpr + Debug + AnyCPU + DCC32 + LocalSchema.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + LocalSchema.dpr + + + + + + + MainSource + + +
LocalSchemaMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.res new file mode 100644 index 0000000..b946fbb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchema.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchemaMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchemaMain.dfm new file mode 100644 index 0000000..ee7d4e4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchemaMain.dfm @@ -0,0 +1,754 @@ +object LocalSchemaMainForm: TLocalSchemaMainForm + Left = 140 + Top = 73 + AutoScroll = False + BorderWidth = 5 + Caption = 'Local Schema Sample' + ClientHeight = 317 + ClientWidth = 502 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 0 + Top = 4 + Width = 84 + Height = 13 + Caption = 'From CustomerID:' + end + object Label2: TLabel + Left = 217 + Top = 4 + Width = 74 + Height = 13 + Caption = 'To CustomerID:' + end + object DBGrid1: TDBGrid + Left = 0 + Top = 25 + Width = 502 + Height = 262 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = DataSource + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object eCust1: TEdit + Left = 88 + Top = 0 + Width = 121 + Height = 21 + TabOrder = 1 + Text = 'ALFKI' + end + object eCust2: TEdit + Left = 296 + Top = 0 + Width = 121 + Height = 21 + TabOrder = 2 + Text = 'BOTTM' + end + object Panel1: TPanel + Left = 0 + Top = 287 + Width = 502 + Height = 30 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + DesignSize = ( + 502 + 30) + object DBNavigator1: TDBNavigator + Left = 0 + Top = 5 + Width = 230 + Height = 25 + DataSource = DataSource + Anchors = [akLeft] + TabOrder = 0 + end + object bOpenClose: TButton + Left = 240 + Top = 5 + Width = 75 + Height = 25 + Anchors = [akLeft] + Caption = 'Open/Close' + TabOrder = 1 + OnClick = bOpenCloseClick + end + object bApplyUpdates: TButton + Left = 315 + Top = 5 + Width = 97 + Height = 25 + Anchors = [akLeft] + Caption = 'Apply Updates' + TabOrder = 2 + OnClick = bApplyUpdatesClick + end + end + object ConnectionManager: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 24 + Top = 152 + end + object DriverManager: TDADriverManager + DriverDirectory = 'C:\Dev\DataAbstract\Bin\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 56 + Top = 152 + end + object ADODriver: TDAADODriver + Left = 88 + Top = 152 + end + object BINAdapter: TDABinDataStreamer + Left = 120 + Top = 152 + end + object DataSource: TDADataSource + DataTable = DataTable + Left = 72 + Top = 200 + end + object DataTable: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'CustA' + DataType = datString + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'CustB' + DataType = datString + BlobType = dabtUnknown + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + LocalSchema = DASchema + LocalDataStreamer = BINAdapter + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 64 + Top = 192 + end + object DASchema: TDASchema + ConnectionManager = ConnectionManager + Datasets = < + item + Params = < + item + Name = 'CustA' + DataType = datString + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'CustB' + DataType = datString + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers'#10' WHERE CustomerID>=:CustA and CustomerID<' + + '=:CustB' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = < + item + Params = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'TestNumeric' + DataType = datFloat + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'INSERT'#10' INTO Customers'#10' (CustomerID, CompanyName, ContactNam' + + 'e, ContactTitle, Address, City, Region, PostalCode, Country, Pho' + + 'ne, Fax, TestNumeric)'#10' VALUES'#10' (:CustomerID, :CompanyName, :' + + 'ContactName, :ContactTitle, :Address, :City, :Region, :PostalCod' + + 'e, :Country, :Phone, :Fax, :TestNumeric)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Insert_Customers' + end + item + Params = < + item + Name = 'OLD_CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'DELETE '#10' FROM'#10' Customers'#10' WHERE'#10' (CustomerID = :OLD_Cust' + + 'omerID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Delete_Customers' + end + item + Params = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'TestNumeric' + DataType = datFloat + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'OLD_CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'UPDATE Customers'#10' SET '#10' CustomerID = :CustomerID, '#10' Compa' + + 'nyName = :CompanyName, '#10' ContactName = :ContactName, '#10' Con' + + 'tactTitle = :ContactTitle, '#10' Address = :Address, '#10' City = ' + + ':City, '#10' Region = :Region, '#10' PostalCode = :PostalCode, '#10' ' + + ' Country = :Country, '#10' Phone = :Phone, '#10' Fax = :Fax, '#10' ' + + ' TestNumeric = :TestNumeric'#10' WHERE'#10' (CustomerID = :OLD_Custo' + + 'merID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Update_Customers' + end> + RelationShips = <> + UpdateRules = <> + Left = 160 + Top = 152 + end + object BusinessProcessor: TDABusinessProcessor + Schema = DASchema + ReferencedDataset = 'Customers' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete, poPrepareCommands] + UpdateMode = updWhereKeyOnly + Left = 112 + Top = 200 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchemaMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchemaMain.pas new file mode 100644 index 0000000..b1f750a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Local Schema/LocalSchemaMain.pas @@ -0,0 +1,62 @@ +unit LocalSchemaMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uDAEngine, uDAADODriver, uDADriverManager, uDAClasses, + uDADataTable, uDABINAdapter, uDACDSDataTable, DB, StdCtrls, ExtCtrls, + DBCtrls, Grids, DBGrids, uDABusinessProcessor, uDAScriptingProvider, + uDADataStreamer; + +type + TLocalSchemaMainForm = class(TForm) + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + BINAdapter: TDABinDataStreamer; + DataSource: TDADataSource; + DataTable: TDACDSDataTable; + DBGrid1: TDBGrid; + BusinessProcessor: TDABusinessProcessor; + eCust1: TEdit; + eCust2: TEdit; + Label1: TLabel; + Label2: TLabel; + ConnectionManager: TDAConnectionManager; + Panel1: TPanel; + DBNavigator1: TDBNavigator; + bOpenClose: TButton; + bApplyUpdates: TButton; + DASchema: TDASchema; + procedure bOpenCloseClick(Sender: TObject); + procedure bApplyUpdatesClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + LocalSchemaMainForm: TLocalSchemaMainForm; + +implementation + +{$R *.dfm} + +procedure TLocalSchemaMainForm.bOpenCloseClick(Sender: TObject); +begin + if not DataTable.Active then begin + DataTable.ParamByName('CustA').AsString := eCust1.Text; + DataTable.ParamByName('CustB').AsString := eCust2.Text; + end; + + DataTable.Active := DataTable.Active xor TRUE; +end; + +procedure TLocalSchemaMainForm.bApplyUpdatesClick(Sender: TObject); +begin + BusinessProcessor.ProcessDelta(DataTable, AllChanges); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.Sample.html new file mode 100644 index 0000000..2c21f56 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.Sample.html @@ -0,0 +1,33 @@ + + + + + + + + + +

+ Login Sample +

+ + +

Purpose

+ +

+ This example shows how to provide a simple Login.
+

+

+ The login data is held in Northwind's Employees table, with the FirstName and LastName fields used for UserName and Password respectively. +

+ +

Examine the Code

+ + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.bdsgroup new file mode 100644 index 0000000..ca45e64 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + LoginSample_server.bdsproj + LoginSample_Client.bdsproj + LoginSample_server.exe LoginSample_Client.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.bpg new file mode 100644 index 0000000..f74198c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = LoginSample_server.exe LoginSample_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +LoginSample_server.exe: LoginSample_server.dpr + $(DCC) + +LoginSample_Client.exe: LoginSample_Client.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.groupproj new file mode 100644 index 0000000..e9204af --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample.groupproj @@ -0,0 +1,40 @@ + + + {72af6019-78ce-45df-b5c2-80318d022ad3} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleLibrary.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleLibrary.RODL new file mode 100644 index 0000000..2daa08c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleLibrary.RODL @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleLibrary_Intf.pas new file mode 100644 index 0000000..aaa5a30 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleLibrary_Intf.pas @@ -0,0 +1,109 @@ +unit LoginSampleLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{8923B665-D147-4E49-B262-59B91DE7EF10}'; + + { Service Interface ID's } + ILoginSampleService_IID : TGUID = '{B3131769-5008-4AAE-A339-A65950032EEE}'; + ILoginService_IID : TGUID = '{4E74056F-733F-4415-81D2-D8E7297C9EC2}'; + + { Event ID's } + +type + { Forward declarations } + ILoginSampleService = interface; + ILoginService = interface; + + + + + { ILoginSampleService } + ILoginSampleService = interface(IDataAbstractService) + ['{B3131769-5008-4AAE-A339-A65950032EEE}'] + end; + + { CoLoginSampleService } + CoLoginSampleService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginSampleService; + end; + + { TLoginSampleService_Proxy } + TLoginSampleService_Proxy = class(TDataAbstractService_Proxy, ILoginSampleService) + protected + function __GetInterfaceName:string; override; + + end; + + { ILoginService } + ILoginService = interface(ISimpleLoginService) + ['{4E74056F-733F-4415-81D2-D8E7297C9EC2}'] + end; + + { CoLoginService } + CoLoginService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginService; + end; + + { TLoginService_Proxy } + TLoginService_Proxy = class(TSimpleLoginService_Proxy, ILoginService) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoLoginSampleService } + +class function CoLoginSampleService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginSampleService; +begin + result := TLoginSampleService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TLoginSampleService_Proxy.__GetInterfaceName:string; +begin + result := 'LoginSampleService'; +end; + +{ CoLoginService } + +class function CoLoginService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginService; +begin + result := TLoginService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TLoginService_Proxy.__GetInterfaceName:string; +begin + result := 'LoginService'; +end; + +initialization + RegisterProxyClass(ILoginSampleService_IID, TLoginSampleService_Proxy); + RegisterProxyClass(ILoginService_IID, TLoginService_Proxy); + + +finalization + UnregisterProxyClass(ILoginSampleService_IID); + UnregisterProxyClass(ILoginService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleLibrary_Invk.pas new file mode 100644 index 0000000..5997211 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleLibrary_Invk.pas @@ -0,0 +1,38 @@ +unit LoginSampleLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} LoginSampleLibrary_Intf; + +type + TLoginSampleService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + + TLoginService_Invoker = class(TSimpleLoginService_Invoker) + private + protected + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleService_Impl.dfm new file mode 100644 index 0000000..f91ab57 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleService_Impl.dfm @@ -0,0 +1,335 @@ +object LoginSampleService: TLoginSampleService + OldCreateOrder = True + RequiresSession = True + SessionManager = LoginSample_ServerDataModule.SessionManager + AcquireConnection = True + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Left = 357 + Top = 213 + Height = 212 + Width = 216 + object DataStreamer: TDABinDataStreamer + Left = 32 + Top = 8 + end + object Schema: TDASchema + ConnectionManager = LoginSample_ServerDataModule.ConnectionManager + DataDictionary = LoginSample_ServerDataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Employees' + SQL = + 'SELECT '#10' EmployeeID, LastName, FirstName, Title, TitleOfCourt' + + 'esy, '#10' BirthDate, HireDate, Address, City, Region, PostalCode' + + ', '#10' Country, HomePhone, Extension, Photo, Notes, ReportsTo, '#10 + + ' PhotoPath'#10' FROM'#10' Employees' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'LastName' + TableField = 'LastName' + end + item + DatasetField = 'FirstName' + TableField = 'FirstName' + end + item + DatasetField = 'Title' + TableField = 'Title' + end + item + DatasetField = 'TitleOfCourtesy' + TableField = 'TitleOfCourtesy' + end + item + DatasetField = 'BirthDate' + TableField = 'BirthDate' + end + item + DatasetField = 'HireDate' + TableField = 'HireDate' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'HomePhone' + TableField = 'HomePhone' + end + item + DatasetField = 'Extension' + TableField = 'Extension' + end + item + DatasetField = 'Photo' + TableField = 'Photo' + end + item + DatasetField = 'Notes' + TableField = 'Notes' + end + item + DatasetField = 'ReportsTo' + TableField = 'ReportsTo' + end + item + DatasetField = 'PhotoPath' + TableField = 'PhotoPath' + end> + end> + Name = 'Employees' + Fields = < + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'LastName' + DataType = datWideString + Size = 20 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FirstName' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Title' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'TitleOfCourtesy' + DataType = datWideString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'BirthDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'HireDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'HomePhone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Extension' + DataType = datWideString + Size = 4 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Photo' + DataType = datBlob + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Notes' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ReportsTo' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PhotoPath' + DataType = datWideString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = < + item + Name = 'FK_Employees_Employees' + MasterDatasetName = 'Employees' + MasterFields = 'EmployeeID' + DetailDatasetName = 'Employees' + DetailFields = 'ReportsTo' + end> + UpdateRules = <> + Left = 32 + Top = 56 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleService_Impl.pas new file mode 100644 index 0000000..b003b0b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSampleService_Impl.pas @@ -0,0 +1,37 @@ +unit LoginSampleService_Impl; + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Data Abstract:} uDAClasses, uDADataTable, uDABinAdapter, uDAInterfaces, uDADataStreamer, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} LoginSampleLibrary_Intf; + +type + { TLoginSampleService } + TLoginSampleService = class(TDataAbstractService, ILoginSampleService) + DataStreamer: TDABinDataStreamer; + Schema: TDASchema; + private + protected + { ILoginSampleService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} LoginSampleLibrary_Invk, LoginSample_ServerData; + +procedure Create_LoginSampleService(out anInstance: IUnknown); +begin + anInstance := TLoginSampleService.Create(nil); +end; + +initialization + TROClassFactory.Create('LoginSampleService', Create_LoginSampleService, TLoginSampleService_Invoker); +finalization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.bdsproj new file mode 100644 index 0000000..42fff79 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + LoginSample_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.dpr new file mode 100644 index 0000000..56feae1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.dpr @@ -0,0 +1,18 @@ +program LoginSample_Client; + +uses + uROComInit, + Forms, + MidasLib, + LoginSample_ClientMain in 'LoginSample_ClientMain.pas' {LoginSample_ClientMainForm}, + LoginSample_ClientData in 'LoginSample_ClientData.pas' {LoginSample_ClientDataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'LoginSample Client'; + Application.CreateForm(TLoginSample_ClientDataModule, LoginSample_ClientDataModule); + Application.CreateForm(TLoginSample_ClientMainForm, LoginSample_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.dproj new file mode 100644 index 0000000..5aac6d1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.dproj @@ -0,0 +1,75 @@ + + + {fb47079d-d00b-4688-901d-b23e72791c7b} + LoginSample_Client.dpr + Debug + AnyCPU + DCC32 + LoginSample_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + LoginSample_Client.dpr + + + + + + + MainSource + + +
LoginSample_ClientDataModule
+
+ +
LoginSample_ClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_Client.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientData.dfm new file mode 100644 index 0000000..262f235 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientData.dfm @@ -0,0 +1,100 @@ +object LoginSample_ClientDataModule: TLoginSample_ClientDataModule + OldCreateOrder = True + Left = 81 + Top = 16 + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + ServiceName = 'LoginSampleService' + Message = Message + Channel = Channel + Left = 40 + Top = 96 + end + object DataStreamer: TDABinDataStreamer + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetSchemaCall.MethodName = 'GetSchema' + GetSchemaCall.Params = < + item + Name = 'aFilter' + DataType = rtString + Flag = fIn + Value = Null + end + item + Name = 'Result' + DataType = rtString + Flag = fResult + Value = Null + end> + GetSchemaCall.Default = False + GetSchemaCall.IncomingSchemaParameter = 'Result' + GetSchemaCall.OutgoingFilterParameter = 'aFilter' + GetDataCall.RemoteService = RemoteService + GetDataCall.MethodName = 'GetData' + GetDataCall.Params = < + item + Name = 'aTableNameArray' + DataType = rtUserDefined + Flag = fIn + TypeName = 'StringArray' + Value = Null + end + item + Name = 'aTableRequestInfoArray' + DataType = rtUserDefined + Flag = fIn + TypeName = 'TableRequestInfoArray' + Value = Null + end + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end> + GetDataCall.Default = False + GetDataCall.OutgoingTableNamesParameter = 'aTableNameArray' + GetDataCall.OutgoingTableRequestInfosParameter = 'aTableRequestInfoArray' + GetDataCall.IncomingDataParameter = 'Result' + UpdateDataCall.RemoteService = RemoteService + UpdateDataCall.MethodName = 'UpdateData' + UpdateDataCall.Params = < + item + Name = 'aDelta' + DataType = rtBinary + Flag = fIn + end + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + end> + UpdateDataCall.Default = False + UpdateDataCall.OutgoingDeltaParameter = 'aDelta' + UpdateDataCall.IncomingDeltaParameter = 'Result' + GetScriptsCall.RemoteService = RemoteService + GetScriptsCall.Params = <> + GetScriptsCall.Default = False + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 40 + Top = 183 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientData.pas new file mode 100644 index 0000000..8bae154 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientData.pas @@ -0,0 +1,31 @@ +unit LoginSample_ClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, uDAInterfaces, + uDADataStreamer, uDARemoteDataAdapter; + +type + TLoginSample_ClientDataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABinDataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + private + { Private declarations } + public + { Public declarations } + end; + +var + LoginSample_ClientDataModule: TLoginSample_ClientDataModule; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientMain.dfm new file mode 100644 index 0000000..96a47de --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientMain.dfm @@ -0,0 +1,320 @@ +object LoginSample_ClientMainForm: TLoginSample_ClientMainForm + Left = 357 + Top = 264 + AutoScroll = False + Caption = 'LoginSample Client' + ClientHeight = 174 + ClientWidth = 482 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 7 + Top = 17 + Width = 56 + Height = 13 + Caption = '&User Name:' + FocusControl = edUsername + end + object Label2: TLabel + Left = 7 + Top = 60 + Width = 49 + Height = 13 + Caption = '&Password:' + FocusControl = edPassword + end + object edPassword: TEdit + Left = 7 + Top = 78 + Width = 155 + Height = 21 + TabOrder = 1 + Text = 'davolio' + end + object edUsername: TEdit + Left = 7 + Top = 35 + Width = 155 + Height = 21 + TabOrder = 0 + Text = 'nancy' + end + object LoginButton: TButton + Left = 7 + Top = 102 + Width = 75 + Height = 22 + Caption = 'Login' + TabOrder = 2 + OnClick = LoginButtonClick + end + object LogoutButton: TButton + Left = 87 + Top = 102 + Width = 75 + Height = 22 + Caption = 'Logout' + Enabled = False + TabOrder = 3 + OnClick = LogoutButtonClick + end + object Grid: TDBGrid + Left = 171 + Top = 34 + Width = 303 + Height = 132 + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = DataSource + TabOrder = 5 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object FillButton: TButton + Left = 172 + Top = 6 + Width = 75 + Height = 22 + Caption = 'Fill' + Enabled = False + TabOrder = 4 + OnClick = FillButtonClick + end + object DataTable: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'LastName' + DataType = datWideString + Size = 20 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FirstName' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Title' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'TitleOfCourtesy' + DataType = datWideString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'BirthDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'HireDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'HomePhone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Extension' + DataType = datWideString + Size = 4 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Photo' + DataType = datBlob + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Notes' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ReportsTo' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PhotoPath' + DataType = datWideString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = <> + StreamingOptions = [soIgnoreStreamSchema, soDisableEventsWhileStreaming] + RemoteDataAdapter = LoginSample_ClientDataModule.RemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Employees' + IndexDefs = <> + Left = 336 + Top = 13 + end + object DataSource: TDADataSource + DataTable = DataTable + Left = 345 + Top = 21 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientMain.pas new file mode 100644 index 0000000..35151d4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ClientMain.pas @@ -0,0 +1,98 @@ +unit LoginSample_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, + DataAbstract4_Intf, LoginSampleLibrary_Intf, DB, uDADataTable, + uDAScriptingProvider, uDACDSDataTable, Grids, DBGrids; + +type + TLoginSample_ClientMainForm = class(TForm) + Label1: TLabel; + Label2: TLabel; + edPassword: TEdit; + edUsername: TEdit; + LoginButton: TButton; + LogoutButton: TButton; + Grid: TDBGrid; + DataTable: TDACDSDataTable; + DataSource: TDADataSource; + FillButton: TButton; + procedure FormDestroy(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure LoginButtonClick(Sender: TObject); + procedure LogoutButtonClick(Sender: TObject); + procedure FillButtonClick(Sender: TObject); + private + fLoggedIn: Boolean; + fUserInfo: UserInfo; + fLogin: ILoginService; + protected + procedure Login; + procedure Logout; + public + { Public declarations } + end; + +var + LoginSample_ClientMainForm: TLoginSample_ClientMainForm; + +implementation + +uses + LoginSample_ClientData; + +{$R *.dfm} + +procedure TLoginSample_ClientMainForm.FormShow(Sender: TObject); +begin + with LoginSample_ClientDataModule do + fLogin := CoLoginService.Create(Message, Channel); +end; + +procedure TLoginSample_ClientMainForm.FormDestroy(Sender: TObject); +begin + Logout; +end; + +procedure TLoginSample_ClientMainForm.Login; +begin + FreeAndNil(fUserInfo); + fLoggedIn := fLogin.Login(edUsername.Text, edPassword.Text, fUserInfo); + if not fLoggedIn then ShowMessage('Login failed!'); +end; + +procedure TLoginSample_ClientMainForm.Logout; +begin + if fLoggedIn then begin + fLogin.Logout(); + fLoggedIn := false; + end; +end; + +procedure TLoginSample_ClientMainForm.LoginButtonClick(Sender: TObject); +begin + Login; + LoginButton.Enabled := not fLoggedIn; + LogoutButton.Enabled := fLoggedIn; + FillButton.Enabled := fLoggedIn; +end; + +procedure TLoginSample_ClientMainForm.LogoutButtonClick(Sender: TObject); +begin + Logout; + if not fLoggedIn then DataTable.Active := False; + LoginButton.Enabled := not fLoggedIn; + LogoutButton.Enabled := fLoggedIn; + FillButton.Enabled := fLoggedIn; +end; + +procedure TLoginSample_ClientMainForm.FillButtonClick(Sender: TObject); +begin + DataTable.Active := True; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerData.dfm new file mode 100644 index 0000000..66c3ed1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerData.dfm @@ -0,0 +1,63 @@ +object LoginSample_ServerDataModule: TLoginSample_ServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 39 + Top = 15 + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Left = 34 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerData.pas new file mode 100644 index 0000000..ede8501 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerData.pas @@ -0,0 +1,41 @@ +unit LoginSample_ServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAADODriver, uROIndyTCPServer; + +type + TLoginSample_ServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + SessionManager: TROInMemorySessionManager; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + LoginSample_ServerDataModule: TLoginSample_ServerDataModule; + +implementation + +{$R *.dfm} + +procedure TLoginSample_ServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerMain.dfm new file mode 100644 index 0000000..7bd4f12 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerMain.dfm @@ -0,0 +1,21 @@ +object LoginSample_ServerMainForm: TLoginSample_ServerMainForm + Left = 95 + Top = 46 + BorderStyle = bsDialog + Caption = 'LoginSample Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerMain.pas new file mode 100644 index 0000000..301ddbd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_ServerMain.pas @@ -0,0 +1,25 @@ +unit LoginSample_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton; + +type + TLoginSample_ServerMainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + LoginSample_ServerMainForm: TLoginSample_ServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.bdsproj new file mode 100644 index 0000000..41de46c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + LoginSample_server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.dpr new file mode 100644 index 0000000..4c39cb0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.dpr @@ -0,0 +1,25 @@ +program LoginSample_server; + +{#ROGEN:LoginSampleLibrary.RODL}// RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + Forms, + LoginSample_ServerMain in 'LoginSample_ServerMain.pas' {LoginSample_ServerMainForm}, + LoginSampleService_Impl in 'LoginSampleService_Impl.pas' {LoginSampleService: TDARemoteService}, + LoginSample_ServerData in 'LoginSample_ServerData.pas' {LoginSample_ServerDataModule: TDataModule}, + LoginService_Impl in 'LoginService_Impl.pas' {LoginService: TSimpleLoginService}, + LoginSampleLibrary_Intf in 'LoginSampleLibrary_Intf.pas', + LoginSampleLibrary_Invk in 'LoginSampleLibrary_Invk.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'LoginSample Server'; + Application.CreateForm(TLoginSample_ServerDataModule, LoginSample_ServerDataModule); + Application.CreateForm(TLoginSample_ServerMainForm, LoginSample_ServerMainForm); + Application.Run; +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.dproj new file mode 100644 index 0000000..5ab3f7c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.dproj @@ -0,0 +1,83 @@ + + + {ae701f0a-2268-47e6-b890-c7deb4753af7} + LoginSample_server.dpr + Debug + AnyCPU + DCC32 + LoginSample_server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + LoginSample_server.dpr + + + + + + + MainSource + + + + +
LoginSampleService
+
+ +
LoginSample_ServerDataModule
+
+ +
LoginSample_ServerMainForm
+
+ +
LoginService
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginSample_server.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginService_Impl.dfm new file mode 100644 index 0000000..8d58d0a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginService_Impl.dfm @@ -0,0 +1,66 @@ +object LoginService: TLoginService + OldCreateOrder = True + SessionManager = LoginSample_ServerDataModule.SessionManager + OnLogout = SimpleLoginServiceLogout + OnLogin = SimpleLoginServiceLogin + Left = 321 + Top = 216 + Height = 96 + Width = 188 + object Schema: TDASchema + ConnectionManager = LoginSample_ServerDataModule.ConnectionManager + DataDictionary = LoginSample_ServerDataModule.DataDictionary + Datasets = < + item + Params = < + item + Name = 'UserId' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Pass' + DataType = datWideString + Size = 20 + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'ValidateLogin' + SQL = + 'SELECT Count(*) as Cnt FROM Employees WHERE (FirstName = :UserId' + + ') AND (LastName = :Pass)' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'Cnt' + TableField = 'Cnt' + end> + end> + Name = 'ValidateLogin' + Fields = < + item + Name = 'Cnt' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 17 + Top = 12 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginService_Impl.pas new file mode 100644 index 0000000..f29bd8d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/LoginService_Impl.pas @@ -0,0 +1,77 @@ +unit LoginService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} SimpleLoginService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} LoginSampleLibrary_Intf, uDAClasses; + +type + { TLoginService } + TLoginService = class(TSimpleLoginService, ILoginService) + Schema: TDASchema; + procedure SimpleLoginServiceLogout(Sender: TObject); + procedure SimpleLoginServiceLogin(Sender: TObject; aUserID, + aPassword: UTF8string; out aUserInfo: UserInfo; + var aLoginSuccessful: Boolean); + private + protected + { ILoginService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} LoginSampleLibrary_Invk, LoginSample_ServerData, uRORemoteDataModule, uDAInterfaces; + +procedure Create_LoginService(out anInstance: IUnknown); +begin + anInstance := TLoginService.Create(nil); +end; + +{ LoginService } + +procedure TLoginService.SimpleLoginServiceLogin(Sender: TObject; aUserID, + aPassword: UTF8string; out aUserInfo: UserInfo; + var aLoginSuccessful: Boolean); +var + cmd: IDADataset; +begin + cmd := Schema.NewDataset(Schema.ConnectionManager.NewConnection(Schema.ConnectionManager.GetDefaultConnectionName), 'ValidateLogin', ['UserId', 'Pass'], [aUserID, aPassword]); + cmd.Open; + + aLoginSuccessful := (cmd.Fields[0].AsInteger <> 0); + if (ALoginSuccessful) then begin + aUserInfo := UserInfo.Create; + aUserInfo.SessionID := GuidToString(ClientID); + aUserInfo.UserID := aUserID; + Session['UserID'] := aUserID; + end + else begin + DestroySession; + end; +end; + +procedure TLoginService.SimpleLoginServiceLogout(Sender: TObject); +begin + DestroySession; +end; + +initialization + TROClassFactory.Create('LoginService', Create_LoginService, TLoginService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/RODLFILE.res new file mode 100644 index 0000000..1643ed4 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Login Sample/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/LoginService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/LoginService_Impl.dfm new file mode 100644 index 0000000..752ea72 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/LoginService_Impl.dfm @@ -0,0 +1,185 @@ +object LoginService: TLoginService + OldCreateOrder = True + SessionManager = MegaDemoServer_DataModule.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = BinDataStreamer + ExportedDataTables = <> + BeforeAcquireConnection = DataAbstractServiceBeforeAcquireConnection + Left = 170 + Top = 200 + Height = 124 + Width = 208 + object Schema: TDASchema + ConnectionManager = MegaDemoServer_DataModule.ConnectionManager + DataDictionary = MegaDemoServer_DataModule.DataDictionary + Datasets = < + item + Params = < + item + Name = 'UserName' + DataType = datString + Size = 20 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'Password' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end> + Statements = < + item + Connection = 'Employees' + TargetTable = 'EMPLOYEE' + SQL = + 'SELECT'#10' E.EMP_NO, E.FIRST_NAME, E.LAST_NAME, J.JOB_TITLE'#10#10'FROM'#10 + + ' EMPLOYEE E'#10' '#10'JOIN JOB J ON'#10' (J.JOB_CODE=E.JOB_CODE) AND'#10' (J' + + '.JOB_GRADE=E.JOB_GRADE) AND'#10' (J.JOB_COUNTRY='#39'USA'#39')'#10' ' + + ' '#10'WHERE'#10' E.FIRST_NAME=:UserName AND'#10' E.LAST_NAME=:Password' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'EmployeeID' + TableField = 'EMP_NO' + end + item + DatasetField = 'FirstName' + TableField = 'FIRST_NAME' + end + item + DatasetField = 'LastName' + TableField = 'LAST_NAME' + end + item + DatasetField = 'JobTitle' + TableField = 'JOB_TITLE' + end> + end + item + Connection = 'Northwind' + TargetTable = 'Employees' + SQL = + 'SELECT Emps.EmployeeID, Emps.FirstName, Emps.LastName, Emps.Titl' + + 'e'#10'FROM Employees Emps'#10'WHERE Emps.FirstName=:UserName AND Emps.La' + + 'stName=:Password' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'FirstName' + TableField = 'FirstName' + end + item + DatasetField = 'LastName' + TableField = 'LastName' + end + item + DatasetField = 'JobTitle' + TableField = 'Title' + end> + end> + Name = 'FindEmployee' + Description = + 'Query that validates a username and password against the first n' + + 'ame and last name of the employees in the target databases' + Fields = < + item + Name = 'EmployeeID' + DataType = datAutoInc + Description = 'A numeric number used to reference the employee in other tables' + BlobType = dabtUnknown + GeneratorName = 'EMP_NO_GEN' + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + DisplayLabel = 'Employee ID' + Alignment = taLeftJustify + ServerAutoRefresh = True + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FirstName' + DataType = datString + Size = 10 + Description = 'The employee'#39's first name' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + DisplayLabel = 'First Name' + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'LastName' + DataType = datString + Size = 20 + Description = 'The employee'#39's last name' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + DisplayLabel = 'Last Name' + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'JobTitle' + DataType = datString + Size = 25 + Description = 'The employee'#39's job title' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + DisplayLabel = 'Job Title' + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 28 + Top = 11 + end + object BinDataStreamer: TDABinDataStreamer + BufferSize = 262144 + Left = 77 + Top = 12 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/LoginService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/LoginService_Impl.pas new file mode 100644 index 0000000..6d20988 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/LoginService_Impl.pas @@ -0,0 +1,111 @@ +unit LoginService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} MegaDemoLibrary_Intf, uDADataStreamer, uDABinAdapter, + uDAClasses, uDAInterfaces; + +type + { TLoginService } + TLoginService = class(TDataAbstractService, ILoginService) + BinDataStreamer: TDABinDataStreamer; + Schema: TDASchema; + procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; + var aConnectionName: string); + private + protected + { ILoginService methods } + function Login(const UserName: Ansistring; const Password: Ansistring; out aLoginInfo: LoginInfo): Boolean; + procedure Logout; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} MegaDemoLibrary_Invk, MegaDemoServer_Data, MegaDemoServer_Main; + +procedure Create_LoginService(out anInstance: IUnknown); +begin + anInstance := TLoginService.Create(nil); +end; + +{ LoginService } + +function TLoginService.Login(const UserName: Ansistring; const Password: Ansistring; out aLoginInfo: LoginInfo): Boolean; +var + jobTitle, Upper_jobTitle: string; + loginReader: IDADataset; +begin + aLoginInfo := nil; + loginReader := Schema.NewDataset(Connection, 'FindEmployee', ['UserName', 'Password'], [UserName, Password]); + jobTitle := ''; + try + if (loginReader.IsEmpty) then begin + DestroySession; + Result := false; + end + else begin + aLoginInfo := LoginInfo.Create; + + // Prepares the LoginInfo struct that will be sent back to the client + aLoginInfo.EmployeeID := loginReader.Fields[0].AsInteger; + aLoginInfo.FirstName := loginReader.Fields[1].AsString; + aLoginInfo.LastName := loginReader.Fields[2].AsString; + + // Determines the job type by parsing the JobTitle returned + jobTitle := loginReader.Fields[3].AsString; + Upper_jobTitle := UpperCase(jobTitle); + if Pos('PRESIDENT', Upper_jobTitle) >= 1 then aLoginInfo.Job_Type := JobType_Manager + else if Pos('MANAGER', Upper_jobTitle) >= 1 then aLoginInfo.Job_Type := JobType_Manager + else if Pos('SALES', Upper_jobTitle) >= 1 then aLoginInfo.Job_Type := JobType_SalesRep + else if Pos('CHIEF', Upper_jobTitle) >= 1 then aLoginInfo.Job_Type := JobType_Manager + else aLoginInfo.Job_Type := JobType_Engineer; + + aLoginInfo.JobTitle := jobTitle; + aLoginInfo.SessionID := GUIDToString(Session.SessionID); + + // Saves information in the current session for the other services to use + Session['EmployeeID'] := aLoginInfo.EmployeeID; + Session['JobType'] := aLoginInfo.Job_Type; + + Result := true; + end + finally + if loginReader.Active then loginReader.Close; + if Connection.InTransaction then Connection.CommitTransaction; + end; +end; + +procedure TLoginService.Logout; +begin + DestroySession; +end; + +procedure TLoginService.DataAbstractServiceBeforeAcquireConnection( + aSender: TObject; var aConnectionName: string); +begin + // Reads the connection name from the main form. + aConnectionName := MegaDemoServer_MainForm.GetSelectedConnectionName; +end; + +initialization + TROClassFactory.Create('LoginService', Create_LoginService, TLoginService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.bdsproj new file mode 100644 index 0000000..6717d6f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MegaDemoClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.dpr new file mode 100644 index 0000000..24b238b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.dpr @@ -0,0 +1,17 @@ +program MegaDemoClient; + +uses + uROComInit, + Forms, + MidasLib, + MegaDemoClient_Main in 'MegaDemoClient_Main.pas' {MegaDemoClient_MainForm}, + MegaDemoClient_Data in 'MegaDemoClient_Data.pas' {MegaDemoClient_DataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TMegaDemoClient_DataModule, MegaDemoClient_DataModule); + Application.CreateForm(TMegaDemoClient_MainForm, MegaDemoClient_MainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.dproj new file mode 100644 index 0000000..9ca14d2 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.dproj @@ -0,0 +1,75 @@ + + + {691439f0-e360-44b6-972b-b2ffccfc5582} + MegaDemoClient.dpr + Debug + AnyCPU + DCC32 + MegaDemoClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MegaDemoClient.dpr + + + + + + + MainSource + + +
MegaDemoClient_DataModule
+
+ +
MegaDemoClient_MainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Data.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Data.dfm new file mode 100644 index 0000000..20f84ec --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Data.dfm @@ -0,0 +1,236 @@ +object MegaDemoClient_DataModule: TMegaDemoClient_DataModule + OldCreateOrder = True + OnCreate = DataModuleCreate + OnDestroy = DataModuleDestroy + Left = 439 + Top = 220 + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'OrdersService' + Left = 40 + Top = 96 + end + object DataStreamer: TDABinDataStreamer + Left = 40 + Top = 140 + end + object rdaCustomers: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 195 + Top = 119 + end + object tbl_Customers: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + Description = 'The customer'#39's code' + BlobType = dabtUnknown + GeneratorName = 'CUST_NO_GEN' + DisplayWidth = 0 + DisplayLabel = 'Customer ID' + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerName' + DataType = datString + Size = 40 + Description = 'The customer'#39's name' + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Name' + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 25 + Description = 'The customer'#39's city' + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = rdaCustomers + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 167 + Top = 119 + end + object ds_Customers: TDADataSource + DataSet = tbl_Customers.Dataset + DataTable = tbl_Customers + Left = 140 + Top = 119 + end + object tbl_OrdersByCustomer: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + Description = 'The identifier of the customer that placed this order' + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Customer ID' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + Description = 'The order'#39's date' + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Order Date' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + Description = 'The date by which the order has to be received' + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Required Date' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + Description = 'The date this order has been shipped' + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Shipped Date' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderAmount' + DataType = datCurrency + Description = 'The order'#39's amount' + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Order Amount' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + MasterParamsMappings.Strings = ( + 'CustomerID=CustomerID') + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = rdaOrders + ReadOnly = False + MasterSource = ds_Customers + MasterFields = 'CustomerID' + DetailFields = 'CustomerID' + MasterRequestMappings.Strings = ( + 'CustomerID=CustomerID') + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'OrdersByCustomer' + IndexDefs = <> + Left = 167 + Top = 167 + end + object ds_OrdersByCustomer: TDADataSource + DataSet = tbl_OrdersByCustomer.Dataset + DataTable = tbl_OrdersByCustomer + Left = 139 + Top = 166 + end + object rdaOrders: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + GetDataCall.MethodName = 'GetCustomerOrders' + GetDataCall.Params = < + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end + item + Name = 'CustomerID' + DataType = rtString + Flag = fIn + Value = Null + end> + GetDataCall.Default = False + GetDataCall.IncomingDataParameter = 'Result' + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 194 + Top = 167 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Data.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Data.pas new file mode 100644 index 0000000..359a7ed --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Data.pas @@ -0,0 +1,62 @@ +unit MegaDemoClient_Data; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, uDAInterfaces, + uDADataStreamer, uDARemoteDataAdapter, MegaDemoLibrary_Intf, + uDAScriptingProvider, uDACDSDataTable; + +type + TMegaDemoClient_DataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABinDataStreamer; + rdaCustomers: TDARemoteDataAdapter; + tbl_Customers: TDACDSDataTable; + ds_Customers: TDADataSource; + tbl_OrdersByCustomer: TDACDSDataTable; + ds_OrdersByCustomer: TDADataSource; + rdaOrders: TDARemoteDataAdapter; + procedure DataModuleCreate(Sender: TObject); + procedure DataModuleDestroy(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + fLoginInfo: LoginInfo; + fLoginService: ILoginService; + fOrdersService: IOrdersService; + function LoggedIn: Boolean; + end; + +var + MegaDemoClient_DataModule: TMegaDemoClient_DataModule; + +implementation + +{$R *.dfm} + +{ TMegaDemoClient_DataModule } + +function TMegaDemoClient_DataModule.LoggedIn: Boolean; +begin + Result := fLoginInfo <> nil; +end; + +procedure TMegaDemoClient_DataModule.DataModuleCreate(Sender: TObject); +begin + fLoginService := CoLoginService.Create(Message, Channel); + fOrdersService := CoOrdersService.Create(message, Channel); +end; + +procedure TMegaDemoClient_DataModule.DataModuleDestroy(Sender: TObject); +begin + if fLoginInfo <> nil then fLoginInfo.Free; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Main.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Main.dfm new file mode 100644 index 0000000..ccac44b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Main.dfm @@ -0,0 +1,301 @@ +object MegaDemoClient_MainForm: TMegaDemoClient_MainForm + Left = 224 + Top = 141 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'Data Abstract Client' + ClientHeight = 322 + ClientWidth = 617 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 6 + Top = 5 + Width = 605 + Height = 296 + ActivePage = tpLogin + Anchors = [akLeft, akTop, akRight, akBottom] + TabIndex = 0 + TabOrder = 0 + OnChange = PageControl1Change + OnChanging = PageControl1Changing + object tpLogin: TTabSheet + Caption = 'Login' + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 17 + Top = 16 + Width = 212 + Height = 48 + Cursor = crHandPoint + ApplicationType = atClient + end + object GroupBox1: TGroupBox + Left = 38 + Top = 93 + Width = 246 + Height = 105 + Caption = 'Login Information' + TabOrder = 0 + DesignSize = ( + 246 + 105) + object Label2: TLabel + Left = 7 + Top = 24 + Width = 56 + Height = 13 + Caption = 'User Name:' + end + object Label3: TLabel + Left = 14 + Top = 47 + Width = 49 + Height = 13 + Caption = 'Password:' + end + object tbUserName: TEdit + Left = 72 + Top = 20 + Width = 164 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + object tbPassword: TEdit + Left = 72 + Top = 43 + Width = 164 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + end + object bLogin: TButton + Left = 80 + Top = 74 + Width = 75 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Login' + TabOrder = 2 + OnClick = bLoginClick + end + object bLogout: TButton + Left = 161 + Top = 74 + Width = 75 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Logout' + TabOrder = 3 + OnClick = bLogoutClick + end + end + object GroupBox2: TGroupBox + Left = 335 + Top = 61 + Width = 239 + Height = 168 + Caption = 'Pre-configured Logins' + TabOrder = 1 + DesignSize = ( + 239 + 168) + object Label4: TLabel + Left = 2 + Top = 16 + Width = 234 + Height = 13 + Alignment = taCenter + Anchors = [akLeft, akTop, akRight] + AutoSize = False + Caption = 'SQL Server'#39's Northwind' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 1 + Top = 93 + Width = 235 + Height = 13 + Alignment = taCenter + Anchors = [akLeft, akTop, akRight] + AutoSize = False + Caption = 'Firebird Employee' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object rbPreDefLogin1: TRadioButton + Left = 4 + Top = 33 + Width = 230 + Height = 17 + Caption = 'Nancy/Davolio (Sales Representative)' + TabOrder = 0 + OnClick = rbPreDefLoginClick + end + object rbPreDefLogin2: TRadioButton + Left = 4 + Top = 50 + Width = 230 + Height = 17 + Caption = 'Andrew/Fuller (Vice President, Sales)' + TabOrder = 1 + OnClick = rbPreDefLoginClick + end + object rbPreDefLogin3: TRadioButton + Left = 4 + Top = 67 + Width = 230 + Height = 17 + Caption = 'Laura/Callahan (Inside Sales Coordinator)' + TabOrder = 2 + OnClick = rbPreDefLoginClick + end + object rbPreDefLogin4: TRadioButton + Left = 4 + Top = 110 + Width = 230 + Height = 17 + Caption = 'Claudia/Sutherland (Sales Representative)' + TabOrder = 3 + OnClick = rbPreDefLoginClick + end + object rbPreDefLogin5: TRadioButton + Left = 4 + Top = 127 + Width = 230 + Height = 17 + Caption = 'Luke/Leung (Sales Representative)' + TabOrder = 4 + OnClick = rbPreDefLoginClick + end + object rbPreDefLogin6: TRadioButton + Left = 4 + Top = 144 + Width = 230 + Height = 17 + Caption = 'Takashi/Yamamoto (Sales Representative)' + TabOrder = 5 + OnClick = rbPreDefLoginClick + end + end + end + object tpCustomerManagement: TTabSheet + Caption = 'Customer Management' + ImageIndex = 1 + object Splitter1: TSplitter + Left = 0 + Top = 174 + Width = 597 + Height = 8 + Cursor = crVSplit + Align = alBottom + Beveled = True + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 597 + Height = 22 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object DBNavigator1: TDBNavigator + Left = 0 + Top = 0 + Width = 240 + Height = 22 + DataSource = MegaDemoClient_DataModule.ds_Customers + Align = alLeft + TabOrder = 0 + end + object tsbApplyUpdatesCustomers: TButton + Left = 240 + Top = 0 + Width = 100 + Height = 22 + Action = aApplyUpdate + TabOrder = 1 + end + end + object gCustomers: TDBGrid + Left = 0 + Top = 22 + Width = 597 + Height = 152 + Align = alClient + DataSource = MegaDemoClient_DataModule.ds_Customers + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object gOrdersByCustomer: TDBGrid + Left = 0 + Top = 182 + Width = 597 + Height = 86 + Align = alBottom + DataSource = MegaDemoClient_DataModule.ds_OrdersByCustomer + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + end + object tpBank: TTabSheet + Caption = 'Bank' + ImageIndex = 3 + object Label1: TLabel + Left = 4 + Top = 5 + Width = 592 + Height = 149 + Anchors = [akLeft, akTop, akRight, akBottom] + AutoSize = False + Caption = 'This tab doesn'#39't really do anything beside being accessible ' + Font.Charset = DEFAULT_CHARSET + Font.Color = clGreen + Font.Height = -16 + Font.Name = 'Tahoma' + Font.Style = [fsBold, fsItalic] + ParentFont = False + WordWrap = True + end + end + end + object sslPageHint: TStatusBar + Left = 0 + Top = 303 + Width = 617 + Height = 19 + Panels = <> + SimplePanel = True + end + object ActionList1: TActionList + Left = 544 + Top = 58 + object aApplyUpdate: TAction + Caption = 'Apply Update' + OnExecute = aApplyUpdateExecute + OnUpdate = aApplyUpdateUpdate + end + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Main.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Main.pas new file mode 100644 index 0000000..6e1b7a1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoClient_Main.pas @@ -0,0 +1,168 @@ +unit MegaDemoClient_Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, ComCtrls, + uROPoweredByRemObjectsButton, uDAPoweredByDataAbstractButton, ExtCtrls, + Grids, DBGrids, DBCtrls, ActnList; + +type + TMegaDemoClient_MainForm = class(TForm) + PageControl1: TPageControl; + tpLogin: TTabSheet; + tpCustomerManagement: TTabSheet; + tpBank: TTabSheet; + Label1: TLabel; + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + sslPageHint: TStatusBar; + GroupBox1: TGroupBox; + Label2: TLabel; + Label3: TLabel; + tbUserName: TEdit; + tbPassword: TEdit; + bLogin: TButton; + bLogout: TButton; + GroupBox2: TGroupBox; + Label4: TLabel; + rbPreDefLogin1: TRadioButton; + rbPreDefLogin2: TRadioButton; + rbPreDefLogin3: TRadioButton; + Label5: TLabel; + rbPreDefLogin4: TRadioButton; + rbPreDefLogin5: TRadioButton; + rbPreDefLogin6: TRadioButton; + Panel1: TPanel; + DBNavigator1: TDBNavigator; + gCustomers: TDBGrid; + tsbApplyUpdatesCustomers: TButton; + ActionList1: TActionList; + aApplyUpdate: TAction; + gOrdersByCustomer: TDBGrid; + Splitter1: TSplitter; + procedure bLoginClick(Sender: TObject); + procedure bLogoutClick(Sender: TObject); + procedure rbPreDefLoginClick(Sender: TObject); + procedure PageControl1Changing(Sender: TObject; + var AllowChange: Boolean); + procedure FormShow(Sender: TObject); + procedure PageControl1Change(Sender: TObject); + procedure aApplyUpdateExecute(Sender: TObject); + procedure aApplyUpdateUpdate(Sender: TObject); + private + { Private declarations } + procedure PrivilegesSetup; + public + { Public declarations } + end; + +var + MegaDemoClient_MainForm: TMegaDemoClient_MainForm; + +implementation + +uses + MegaDemoClient_Data, MegaDemoLibrary_Intf, uDADataTable; + +{$R *.dfm} + +procedure TMegaDemoClient_MainForm.bLoginClick(Sender: TObject); +var + serverLoginInfo: LoginInfo; +begin + bLogout.Click; // Forces a logout click + if (MegaDemoClient_DataModule.fLoginService.Login(tbUserName.Text, tbPassword.Text, serverLoginInfo) = false) then begin + ShowMessage('Invalid login'); + end else begin + if MegaDemoClient_DataModule.fLoginInfo <> nil then MegaDemoClient_DataModule.fLoginInfo.Free; + MegaDemoClient_DataModule.fLoginInfo := serverLoginInfo; + ShowMessage('Welcome ' + MegaDemoClient_DataModule.fLoginInfo.JobTitle + ' ' + MegaDemoClient_DataModule.fLoginInfo.FirstName); + + MegaDemoClient_DataModule.tbl_Customers.Close; + MegaDemoClient_DataModule.tbl_Customers.Open; + + bLogin.Enabled := false; + bLogout.Enabled := true; + end; + PrivilegesSetup; +end; + +procedure TMegaDemoClient_MainForm.bLogoutClick(Sender: TObject); +begin + PrivilegesSetup; + if not MegaDemoClient_DataModule.LoggedIn then Exit; + if MegaDemoClient_DataModule.FLoginInfo <> nil then + FreeAndNil(MegaDemoClient_DataModule.FLoginInfo); + MegaDemoClient_DataModule.tbl_Customers.Close; + MegaDemoClient_DataModule.tbl_OrdersByCustomer.Close; + bLogin.Enabled := true; + bLogout.Enabled := false; +end; + +procedure TMegaDemoClient_MainForm.rbPreDefLoginClick(Sender: TObject); +var + senderRadioButton: TRadioButton; + ctrlLabel: string; + textIdx: integer; +begin + senderRadioButton := sender as TRadioButton; + if (senderRadioButton.Checked) then begin + ctrlLabel := senderRadioButton.Caption; + textIdx := pos('/', ctrlLabel); + tbUserName.Text := copy(ctrlLabel, 1, textIdx - 1); + tbPassword.Text := copy(ctrlLabel, textIdx + 1, Pos(' ', ctrlLabel) - textIdx - 1); + end; +end; + +procedure TMegaDemoClient_MainForm.PageControl1Changing(Sender: TObject; + var AllowChange: Boolean); +begin + if (not MegaDemoClient_DataModule.LoggedIn) and (PageControl1.TabIndex = 0) then begin + ShowMessage('You must login first'); + AllowChange := False; + end; +end; + +procedure TMegaDemoClient_MainForm.PrivilegesSetup; +begin + tpCustomerManagement.TabVisible := MegaDemoClient_DataModule.LoggedIn; + tpBank.TabVisible := MegaDemoClient_DataModule.LoggedIn and (MegaDemoClient_DataModule.fLoginInfo.Job_Type = JobType_Manager); + gOrdersByCustomer.Visible := MegaDemoClient_DataModule.LoggedIn and (MegaDemoClient_DataModule.fLoginInfo.Job_Type <> JobType_Engineer); + Splitter1.Visible := gOrdersByCustomer.Visible; + Splitter1.top := 0; +end; + +procedure TMegaDemoClient_MainForm.FormShow(Sender: TObject); +begin + PrivilegesSetup; + PageControl1.ActivePage := tpLogin; + PageControl1.OnChange(PageControl1); +end; + +procedure TMegaDemoClient_MainForm.PageControl1Change(Sender: TObject); +begin + case ((sender as TPageControl).ActivePageIndex) of + 0: sslPageHint.SimpleText := 'Login page. Click on the pre-configured logins to avoid typing a username and a password'; + 1: sslPageHint.SimpleText := 'Customer magamenet page. You can view all customers and create new ones, if your privileges allow you to'; + else + sslPageHint.SimpleText := ''; + end; +end; + +procedure TMegaDemoClient_MainForm.aApplyUpdateExecute(Sender: TObject); +begin + try + MegaDemoClient_DataModule.tbl_Customers.ApplyUpdates; + except + on e: Exception do ShowMessage(E.Message); + end; +end; + +procedure TMegaDemoClient_MainForm.aApplyUpdateUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := MegaDemoClient_DataModule.tbl_Customers.HasDelta; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.Sample.html new file mode 100644 index 0000000..5a4c9fd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.Sample.html @@ -0,0 +1,51 @@ + + + + + + + + + +

+ Mega Demo Sample +

+ + +

Purpose

+

+ The sample shows: +

+ + +

Examine the code

+ + +

Getting started

+ + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.bdsgroup new file mode 100644 index 0000000..a4c5907 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + MegaDemoServer.bdsproj + MegaDemoClient.bdsproj + MegaDemoServer.exe MegaDemoClient.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.bpg new file mode 100644 index 0000000..069815f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = MegaDemoServer.exe MegaDemoClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +MegaDemoServer.exe: MegaDemoServer.dpr + $(DCC) + +MegaDemoClient.exe: MegaDemoClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.groupproj new file mode 100644 index 0000000..e53f7be --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoGroup.groupproj @@ -0,0 +1,40 @@ + + + {6de371b5-c051-4282-a7a2-9b5eda33c8d4} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoLibrary.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoLibrary.RODL new file mode 100644 index 0000000..3fd1a70 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoLibrary.RODL @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoLibrary_Intf.pas new file mode 100644 index 0000000..b530e30 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoLibrary_Intf.pas @@ -0,0 +1,346 @@ +unit MegaDemoLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{7C1E1A6D-C50B-482D-AE41-090E9A61BBB0}'; + TargetNamespace = ''; + + { Service Interface ID's } + ILoginService_IID : TGUID = '{ABD98EFC-78DA-4704-A3EB-0D89CC8BC618}'; + IOrdersService_IID : TGUID = '{6EC8387D-B288-4EE0-BFB7-C4BAEF28E50B}'; + + { Event ID's } + +type + { Forward declarations } + ILoginService = interface; + IOrdersService = interface; + + + LoginInfo = class; + + + + { Enumerateds } + JobType = (JobType_SalesRep,JobType_Manager,JobType_Engineer); + + { LoginInfo } + LoginInfo = class(TROComplexType) + private + fSessionID: AnsiString; + fEmployeeID: Integer; + fFirstName: AnsiString; + fLastName: AnsiString; + fJob_Type: JobType; + fJobTitle: AnsiString; + public + procedure Assign(iSource: TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + published + property SessionID:AnsiString read fSessionID write fSessionID; + property EmployeeID:Integer read fEmployeeID write fEmployeeID; + property FirstName:AnsiString read fFirstName write fFirstName; + property LastName:AnsiString read fLastName write fLastName; + property Job_Type:JobType read fJob_Type write fJob_Type; + property JobTitle:AnsiString read fJobTitle write fJobTitle; + end; + + { LoginInfoCollection } + LoginInfoCollection = class(TROCollection) + protected + constructor Create(aItemClass: TCollectionItemClass); overload; + function GetItems(aIndex: integer): LoginInfo; + procedure SetItems(aIndex: integer; const Value: LoginInfo); + public + constructor Create; overload; + function Add: LoginInfo; reintroduce; + property Items[Index: integer]:LoginInfo read GetItems write SetItems; default; + end; + + { ILoginService } + ILoginService = interface(IDataAbstractService) + ['{ABD98EFC-78DA-4704-A3EB-0D89CC8BC618}'] + function Login(const UserName: AnsiString; const Password: AnsiString; out aLoginInfo: LoginInfo): Boolean; + procedure Logout; + end; + + { CoLoginService } + CoLoginService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginService; + end; + + { TLoginService_Proxy } + TLoginService_Proxy = class(TDataAbstractService_Proxy, ILoginService) + protected + function __GetInterfaceName:string; override; + + function Login(const UserName: AnsiString; const Password: AnsiString; out aLoginInfo: LoginInfo): Boolean; + procedure Logout; + end; + + { IOrdersService } + IOrdersService = interface(IDataAbstractService) + ['{6EC8387D-B288-4EE0-BFB7-C4BAEF28E50B}'] + function GetCustomerOrders(const CustomerID: AnsiString): Binary; + end; + + { CoOrdersService } + CoOrdersService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IOrdersService; + end; + + { TOrdersService_Proxy } + TOrdersService_Proxy = class(TDataAbstractService_Proxy, IOrdersService) + protected + function __GetInterfaceName:string; override; + + function GetCustomerOrders(const CustomerID: AnsiString): Binary; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ LoginInfo } + +procedure LoginInfo.Assign(iSource: TPersistent); +var lSource: MegaDemoLibrary_Intf.LoginInfo; +begin + inherited Assign(iSource); + if (iSource is MegaDemoLibrary_Intf.LoginInfo) then begin + lSource := MegaDemoLibrary_Intf.LoginInfo(iSource); + SessionID := lSource.SessionID; + EmployeeID := lSource.EmployeeID; + FirstName := lSource.FirstName; + LastName := lSource.LastName; + Job_Type := lSource.Job_Type; + JobTitle := lSource.JobTitle; + end; +end; + +procedure LoginInfo.ReadComplex(ASerializer: TObject); +var + l_EmployeeID: Integer; + l_FirstName: AnsiString; + l_JobTitle: AnsiString; + l_Job_Type: JobType; + l_LastName: AnsiString; + l_SessionID: AnsiString; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + l_SessionID := SessionID; + TROSerializer(ASerializer).ReadAnsiString('SessionID', l_SessionID); + SessionID := l_SessionID; + l_EmployeeID := EmployeeID; + TROSerializer(ASerializer).ReadInteger('EmployeeID', otSLong, l_EmployeeID); + EmployeeID := l_EmployeeID; + l_FirstName := FirstName; + TROSerializer(ASerializer).ReadAnsiString('FirstName', l_FirstName); + FirstName := l_FirstName; + l_LastName := LastName; + TROSerializer(ASerializer).ReadAnsiString('LastName', l_LastName); + LastName := l_LastName; + l_Job_Type := Job_Type; + TROSerializer(ASerializer).ReadEnumerated('Job_Type',TypeInfo(JobType), l_Job_Type); + Job_Type := l_Job_Type; + l_JobTitle := JobTitle; + TROSerializer(ASerializer).ReadAnsiString('JobTitle', l_JobTitle); + JobTitle := l_JobTitle; + end + else begin + l_EmployeeID := EmployeeID; + TROSerializer(ASerializer).ReadInteger('EmployeeID', otSLong, l_EmployeeID); + EmployeeID := l_EmployeeID; + l_FirstName := FirstName; + TROSerializer(ASerializer).ReadAnsiString('FirstName', l_FirstName); + FirstName := l_FirstName; + l_JobTitle := JobTitle; + TROSerializer(ASerializer).ReadAnsiString('JobTitle', l_JobTitle); + JobTitle := l_JobTitle; + l_Job_Type := Job_Type; + TROSerializer(ASerializer).ReadEnumerated('Job_Type',TypeInfo(JobType), l_Job_Type); + Job_Type := l_Job_Type; + l_LastName := LastName; + TROSerializer(ASerializer).ReadAnsiString('LastName', l_LastName); + LastName := l_LastName; + l_SessionID := SessionID; + TROSerializer(ASerializer).ReadAnsiString('SessionID', l_SessionID); + SessionID := l_SessionID; + end; +end; + +procedure LoginInfo.WriteComplex(ASerializer: TObject); +var + l_EmployeeID: Integer; + l_FirstName: AnsiString; + l_JobTitle: AnsiString; + l_Job_Type: JobType; + l_LastName: AnsiString; + l_SessionID: AnsiString; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + TROSerializer(ASerializer).ChangeClass(LoginInfo); + l_SessionID := SessionID; + TROSerializer(ASerializer).WriteAnsiString('SessionID', l_SessionID); + l_EmployeeID := EmployeeID; + TROSerializer(ASerializer).WriteInteger('EmployeeID', otSLong, l_EmployeeID); + l_FirstName := FirstName; + TROSerializer(ASerializer).WriteAnsiString('FirstName', l_FirstName); + l_LastName := LastName; + TROSerializer(ASerializer).WriteAnsiString('LastName', l_LastName); + l_Job_Type := Job_Type; + TROSerializer(ASerializer).WriteEnumerated('Job_Type',TypeInfo(JobType), l_Job_Type); + l_JobTitle := JobTitle; + TROSerializer(ASerializer).WriteAnsiString('JobTitle', l_JobTitle); + end + else begin + l_EmployeeID := EmployeeID; + TROSerializer(ASerializer).WriteInteger('EmployeeID', otSLong, l_EmployeeID); + l_FirstName := FirstName; + TROSerializer(ASerializer).WriteAnsiString('FirstName', l_FirstName); + l_JobTitle := JobTitle; + TROSerializer(ASerializer).WriteAnsiString('JobTitle', l_JobTitle); + l_Job_Type := Job_Type; + TROSerializer(ASerializer).WriteEnumerated('Job_Type',TypeInfo(JobType), l_Job_Type); + l_LastName := LastName; + TROSerializer(ASerializer).WriteAnsiString('LastName', l_LastName); + l_SessionID := SessionID; + TROSerializer(ASerializer).WriteAnsiString('SessionID', l_SessionID); + end; +end; + +{ LoginInfoCollection } +constructor LoginInfoCollection.Create; +begin + inherited Create(LoginInfo); +end; + +constructor LoginInfoCollection.Create(aItemClass: TCollectionItemClass); +begin + inherited Create(aItemClass); +end; + +function LoginInfoCollection.Add: LoginInfo; +begin + result := LoginInfo(inherited Add); +end; + +function LoginInfoCollection.GetItems(aIndex: integer): LoginInfo; +begin + result := LoginInfo(inherited Items[aIndex]); +end; + +procedure LoginInfoCollection.SetItems(aIndex: integer; const Value: LoginInfo); +begin + LoginInfo(inherited Items[aIndex]).Assign(Value); +end; + +{ CoLoginService } + +class function CoLoginService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginService; +begin + result := TLoginService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TLoginService_Proxy } + +function TLoginService_Proxy.__GetInterfaceName:string; +begin + result := 'LoginService'; +end; + +function TLoginService_Proxy.Login(const UserName: AnsiString; const Password: AnsiString; out aLoginInfo: LoginInfo): Boolean; +begin + try + aLoginInfo := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'Login'); + __Message.Write('UserName', TypeInfo(AnsiString), UserName, []); + __Message.Write('Password', TypeInfo(AnsiString), Password, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Boolean), result, []); + __Message.Read('aLoginInfo', TypeInfo(MegaDemoLibrary_Intf.LoginInfo), aLoginInfo, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TLoginService_Proxy.Logout; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'Logout'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.FreeStream; + end +end; + +{ CoOrdersService } + +class function CoOrdersService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IOrdersService; +begin + result := TOrdersService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TOrdersService_Proxy } + +function TOrdersService_Proxy.__GetInterfaceName:string; +begin + result := 'OrdersService'; +end; + +function TOrdersService_Proxy.GetCustomerOrders(const CustomerID: AnsiString): Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'GetCustomerOrders'); + __Message.Write('CustomerID', TypeInfo(AnsiString), CustomerID, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterROClass(LoginInfo); + RegisterProxyClass(ILoginService_IID, TLoginService_Proxy); + RegisterProxyClass(IOrdersService_IID, TOrdersService_Proxy); + + +finalization + UnregisterROClass(LoginInfo); + UnregisterProxyClass(ILoginService_IID); + UnregisterProxyClass(IOrdersService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoLibrary_Invk.pas new file mode 100644 index 0000000..1fc0287 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoLibrary_Invk.pas @@ -0,0 +1,139 @@ +unit MegaDemoLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} MegaDemoLibrary_Intf; + +type + TLoginService_Invoker = class(TDataAbstractService_Invoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + + TOrdersService_Invoker = class(TDataAbstractService_Invoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_GetCustomerOrders(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TLoginService_Invoker } + +constructor TLoginService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TLoginService_Invoker.Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Login(const UserName: AnsiString; const Password: AnsiString; out aLoginInfo: LoginInfo): Boolean; } +var + UserName: AnsiString; + Password: AnsiString; + aLoginInfo: MegaDemoLibrary_Intf.LoginInfo; + lResult: Boolean; + __lObjectDisposer: TROObjectDisposer; +begin + aLoginInfo := nil; + try + __Message.Read('UserName', TypeInfo(AnsiString), UserName, []); + __Message.Read('Password', TypeInfo(AnsiString), Password, []); + + lResult := (__Instance as ILoginService).Login(UserName, Password, aLoginInfo); + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'LoginService', 'LoginResponse'); + __Message.Write('Result', TypeInfo(Boolean), lResult, []); + __Message.Write('aLoginInfo', TypeInfo(MegaDemoLibrary_Intf.LoginInfo), aLoginInfo, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(aLoginInfo); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TLoginService_Invoker.Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure Logout; } +begin + try + (__Instance as ILoginService).Logout; + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'LoginService', 'LogoutResponse'); + __Message.Finalize; + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +{ TOrdersService_Invoker } + +constructor TOrdersService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TOrdersService_Invoker.Invoke_GetCustomerOrders(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetCustomerOrders(const CustomerID: AnsiString): Binary; } +var + CustomerID: AnsiString; + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + __Message.Read('CustomerID', TypeInfo(AnsiString), CustomerID, []); + + lResult := (__Instance as IOrdersService).GetCustomerOrders(CustomerID); + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'OrdersService', 'GetCustomerOrdersResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.bdsproj new file mode 100644 index 0000000..bf14e9b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MegaDemoServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.dpr new file mode 100644 index 0000000..a4f42f4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.dpr @@ -0,0 +1,26 @@ +program MegaDemoServer; + +{#ROGEN:MegaDemoLibrary.RODL}// RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + MegaDemoServer_Main in 'MegaDemoServer_Main.pas' {MegaDemoServer_MainForm}, + MegaDemoServer_Data in 'MegaDemoServer_Data.pas' {MegaDemoServer_DataModule: TDataModule}, + MegaDemoLibrary_Intf in 'MegaDemoLibrary_Intf.pas', + MegaDemoLibrary_Invk in 'MegaDemoLibrary_Invk.pas', + LoginService_Impl in 'LoginService_Impl.pas' {LoginService: TDataAbstractService}, + OrdersService_Impl in 'OrdersService_Impl.pas' {OrdersService: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'MegaDemo server'; + Application.CreateForm(TMegaDemoServer_DataModule, MegaDemoServer_DataModule); + Application.CreateForm(TMegaDemoServer_MainForm, MegaDemoServer_MainForm); + Application.Run; +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.dproj new file mode 100644 index 0000000..9977beb --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.dproj @@ -0,0 +1,83 @@ + + + {52bc4b5a-f3b4-4085-b7e9-63fe80cf7d83} + MegaDemoServer.dpr + Debug + AnyCPU + DCC32 + MegaDemoServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MegaDemoServer.dpr + + + + + + + MainSource + + +
LoginService
+
+ + + +
MegaDemoServer_DataModule
+
+ +
MegaDemoServer_MainForm
+
+ +
OrdersService
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Data.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Data.dfm new file mode 100644 index 0000000..9e14fb4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Data.dfm @@ -0,0 +1,74 @@ +object MegaDemoServer_DataModule: TMegaDemoServer_DataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 362 + Top = 208 + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'Employees' + ConnectionString = + 'IBX?Server=localhost;Database=C:\Program Files\Borland\InterBase' + + '\examples\Database\EMPLOYEE.FDB;UserID=SYSDBA;Password=masterkey' + + ';' + Description = 'Local connection to FireBird'#39's EMPLOYEE.FDB' + Default = False + Tag = 0 + end + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI' + Description = 'Microsoft SQL Server 2000, localhost' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%MODULE%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end + object DAADODriver: TDAADODriver + Left = 243 + Top = 11 + end + object DAIBXDriver: TDAIBXDriver + Left = 244 + Top = 59 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Data.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Data.pas new file mode 100644 index 0000000..a9b415b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Data.pas @@ -0,0 +1,43 @@ +unit MegaDemoServer_Data; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uROIndyTCPServer, uDAADODriver, uDAIBXDriver; + +type + TMegaDemoServer_DataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + SessionManager: TROInMemorySessionManager; + DAADODriver: TDAADODriver; + DAIBXDriver: TDAIBXDriver; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + MegaDemoServer_DataModule: TMegaDemoServer_DataModule; + +implementation + +{$R *.dfm} + +procedure TMegaDemoServer_DataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Main.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Main.dfm new file mode 100644 index 0000000..bc3d2fa --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Main.dfm @@ -0,0 +1,40 @@ +object MegaDemoServer_MainForm: TMegaDemoServer_MainForm + Left = 372 + Top = 277 + BorderStyle = bsDialog + Caption = 'Data Abstract Server' + ClientHeight = 108 + ClientWidth = 345 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 66 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Label1: TLabel + Left = 8 + Top = 60 + Width = 101 + Height = 13 + Caption = 'Selected connection:' + end + object cbConnectionName: TComboBox + Left = 7 + Top = 75 + Width = 329 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 0 + OnChange = cbConnectionNameChange + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Main.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Main.pas new file mode 100644 index 0000000..a935c0f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/MegaDemoServer_Main.pas @@ -0,0 +1,56 @@ +unit MegaDemoServer_Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton; + +type + TMegaDemoServer_MainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + Label1: TLabel; + cbConnectionName: TComboBox; + procedure FormCreate(Sender: TObject); + procedure cbConnectionNameChange(Sender: TObject); + private + fCurrentConnectionName: string; + public + { Public declarations } + function GetSelectedConnectionName: string; + end; + +var + MegaDemoServer_MainForm: TMegaDemoServer_MainForm; + +implementation +uses + MegaDemoServer_Data; +{$R *.dfm} + +procedure TMegaDemoServer_MainForm.FormCreate(Sender: TObject); +var + i: integer; +begin + with MegaDemoServer_DataModule.ConnectionManager.Connections do + for i := 0 to Count - 1 do begin + cbConnectionName.AddItem(Connections[i].Name + ' - ' + Connections[i].Description, nil); + if Connections[i].Default then begin + cbConnectionName.ItemIndex := i; + cbConnectionNameChange(cbConnectionName); + end; + end; +end; + +function TMegaDemoServer_MainForm.GetSelectedConnectionName: string; +begin + Result := fCurrentConnectionName; +end; + +procedure TMegaDemoServer_MainForm.cbConnectionNameChange(Sender: TObject); +begin + fCurrentConnectionName := copy(cbConnectionName.Text, 1, pos(' ', cbConnectionName.Text)-1); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/OrdersService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/OrdersService_Impl.dfm new file mode 100644 index 0000000..8eeb63c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/OrdersService_Impl.dfm @@ -0,0 +1,323 @@ +object OrdersService: TOrdersService + OldCreateOrder = True + RequiresSession = True + SessionManager = MegaDemoServer_DataModule.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = BinDataStreamer + ExportedDataTables = <> + BeforeAcquireConnection = DataAbstractServiceBeforeAcquireConnection + Left = 221 + Top = 190 + Height = 206 + Width = 256 + object bpCustomers: TDABusinessProcessor + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete, poAutoGenerateRefreshDataset, poPrepareCommands] + UpdateMode = updWhereKeyOnly + Left = 138 + Top = 60 + end + object BinDataStreamer: TDABinDataStreamer + BufferSize = 262144 + Left = 62 + Top = 60 + end + object Schema: TDASchema + ConnectionManager = MegaDemoServer_DataModule.ConnectionManager + DataDictionary = MegaDemoServer_DataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'Employees' + TargetTable = 'CUSTOMER' + SQL = 'SELECT C.CUST_NO, C.CUSTOMER, C.CITY'#10'FROM CUSTOMER C' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CUST_NO' + end + item + DatasetField = 'CustomerName' + TableField = 'CUSTOMER' + end + item + DatasetField = 'City' + TableField = 'CITY' + end> + end + item + Connection = 'Northwind' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' Custs.CustomerID, Custs.CompanyName, Custs.City'#10' FR' + + 'OM'#10' Customers Custs' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CustomerName' + TableField = 'CompanyName' + end + item + DatasetField = 'City' + TableField = 'City' + end> + end> + Name = 'Customers' + Description = 'Retrieves the list of customers in the database' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + Description = 'The customer'#39's code' + BlobType = dabtUnknown + GeneratorName = 'CUST_NO_GEN' + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + DisplayLabel = 'Customer ID' + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerName' + DataType = datString + Size = 40 + Description = 'The customer'#39's name' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + DisplayLabel = 'Name' + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 25 + Description = 'The customer'#39's city' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = < + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end> + Statements = < + item + Connection = 'Employees' + TargetTable = 'SALES' + SQL = + 'SELECT S.CUST_NO, S.ORDER_DATE, S.DATE_NEEDED, S.SHIP_DATE, S.TO' + + 'TAL_VALUE'#10'FROM SALES S'#10'WHERE S.SALES_REP=:EmployeeID AND S.CUST_' + + 'NO=:CustomerID' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CUST_NO' + end + item + DatasetField = 'OrderDate' + TableField = 'ORDER_DATE' + end + item + DatasetField = 'RequiredDate' + TableField = 'DATE_NEEDED' + end + item + DatasetField = 'ShippedDate' + TableField = 'SHIP_DATE' + end + item + DatasetField = 'OrderAmount' + TableField = 'TOTAL_VALUE' + end> + end + item + Connection = 'Northwind' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' Ords.CustomerID, Ords.OrderDate, Ords.RequiredDate, ' + + 'Ords.ShippedDate, Ords.Freight as OrderAmount'#10' FROM'#10' Orders ' + + 'Ords'#10'WHERE Ords.EmployeeID=:EmployeeID AND Ords.CustomerID=:Cust' + + 'omerID' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'OrderAmount' + TableField = 'OrderAmount' + end> + end> + Name = 'OrdersByCustomer' + Description = + 'Retrieves the list of orders for a specific customer entered by ' + + 'the loged employee' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + Description = 'The identifier of the customer that placed this order' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + LogChanges = False + DisplayWidth = 0 + DisplayLabel = 'Customer ID' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + Description = 'The order'#39's date' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + DisplayLabel = 'Order Date' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + Description = 'The date by which the order has to be received' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + DisplayLabel = 'Required Date' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + Description = 'The date this order has been shipped' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + DisplayLabel = 'Shipped Date' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderAmount' + DataType = datCurrency + Description = 'The order'#39's amount' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + DisplayLabel = 'Order Amount' + ReadOnly = True + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = < + item + Name = 'CustomersToOrders' + MasterDatasetName = 'Customers' + MasterFields = 'CustomerID' + DetailDatasetName = 'OrdersByCustomer' + DetailFields = 'CustomerID' + RelationshipType = rtForeignKey + end> + UpdateRules = <> + Version = 0 + Left = 62 + Top = 15 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/OrdersService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/OrdersService_Impl.pas new file mode 100644 index 0000000..2b7bcb9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/OrdersService_Impl.pas @@ -0,0 +1,97 @@ +unit OrdersService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, Variants, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} MegaDemoLibrary_Intf, uDAClasses, uDADataStreamer, + uDABinAdapter, uDAScriptingProvider, uDABusinessProcessor; + +type + { TOrdersService } + TOrdersService = class(TDataAbstractService, IOrdersService) + bpCustomers: TDABusinessProcessor; + BinDataStreamer: TDABinDataStreamer; + Schema: TDASchema; + procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; + var aConnectionName: string); + private + protected + { IOrdersService methods } + function GetCustomerOrders(const CustomerID: Ansistring): Binary; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} MegaDemoLibrary_Invk, + MegaDemoServer_Data, MegaDemoServer_Main; + +procedure Create_OrdersService(out anInstance: IUnknown); +begin + anInstance := TOrdersService.Create(nil); +end; + +{ OrdersService } + +function TOrdersService.GetCustomerOrders(const CustomerID: Ansistring): Binary; +var + aTableNameArray: StringArray; + aTableRequestInfoArray: TableRequestInfoArray; + aTableRequestInfo: TableRequestInfo; +begin + // This method reads all the orders of the specified customer and also filters + // based on the current employee's ID. The employee ID has been previously stored + // in the session upon the call to LoginService.Login. + + aTableNameArray := StringArray.Create; + aTableRequestInfoArray := TableRequestInfoArray.Create; + try + aTableNameArray.Add('OrdersByCustomer'); + aTableRequestInfo := aTableRequestInfoArray.Add; + with aTableRequestInfo do begin + IncludeSchema := True; + MaxRecords := -1; + UserFilter := ''; + with Parameters.Add do begin + Name := 'CustomerID'; + Value := CustomerID; + end; + with Parameters.Add do begin + Name := 'EmployeeID'; + Value := VarToStr(Session['EmployeeID']); + end; + end; + Result := GetData(aTableNameArray, aTableRequestInfoArray) + finally + aTableRequestInfoArray.Free; + aTableNameArray.Free; + end; +end; + +procedure TOrdersService.DataAbstractServiceBeforeAcquireConnection( + aSender: TObject; var aConnectionName: string); +begin + // Reads the connection name from the main form. + aConnectionName := MegaDemoServer_MainForm.GetSelectedConnectionName; +end; + +initialization + TROClassFactory.Create('OrdersService', Create_OrdersService, TOrdersService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/RODLFILE.res new file mode 100644 index 0000000..e8d19db Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/MegaDemo/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.Sample.html new file mode 100644 index 0000000..38fadb6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.Sample.html @@ -0,0 +1,40 @@ + + + + + + + + + +

+ Memory Data +

+ + +

Purpose

+ +

+ This example shows how to create and populate a virtual dataset dynamically.
+The client displays two grids: + +

+

+ +

Examine the Code

+ + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.bdsgroup new file mode 100644 index 0000000..515b8e1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + MemoryData_Server.bdsproj + MemoryData_Client.bdsproj + MemoryData_Server.exe MemoryData_Client.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.bpg new file mode 100644 index 0000000..0a15ec3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = MemoryData_Server.exe MemoryData_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +MemoryData_Server.exe: MemoryData_Server.dpr + $(DCC) + +MemoryData_Client.exe: MemoryData_Client.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.groupproj new file mode 100644 index 0000000..6c66ace --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData.groupproj @@ -0,0 +1,40 @@ + + + {3e35d412-e6fa-41c3-a9d2-f8c07e8dc6fb} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryDataLibrary.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryDataLibrary.rodl new file mode 100644 index 0000000..113ead8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryDataLibrary.rodl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryDataLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryDataLibrary_Intf.pas new file mode 100644 index 0000000..5594e0f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryDataLibrary_Intf.pas @@ -0,0 +1,76 @@ +unit MemoryDataLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{D4B11283-58D8-4C0D-9747-FEB990A41DEE}'; + + { Service Interface ID's } + INewService_IID : TGUID = '{1E22E1AC-FB18-4085-8260-F6AFF4E697BA}'; + + { Event ID's } + +type + { Forward declarations } + INewService = interface; + + + + + { INewService } + INewService = interface(IDataAbstractService) + ['{1E22E1AC-FB18-4085-8260-F6AFF4E697BA}'] + end; + + { CoNewService } + CoNewService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): INewService; + end; + + { TNewService_Proxy } + TNewService_Proxy = class(TDataAbstractService_Proxy, INewService) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoNewService } + +class function CoNewService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): INewService; +begin + result := TNewService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TNewService_Proxy.__GetInterfaceName:string; +begin + result := 'NewService'; +end; + +initialization + RegisterProxyClass(INewService_IID, TNewService_Proxy); + + +finalization + UnregisterProxyClass(INewService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryDataLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryDataLibrary_Invk.pas new file mode 100644 index 0000000..8f0bbd9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryDataLibrary_Invk.pas @@ -0,0 +1,32 @@ +unit MemoryDataLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} MemoryDataLibrary_Intf; + +type + TNewService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.bdsproj new file mode 100644 index 0000000..c07331f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MemoryData_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.dpr new file mode 100644 index 0000000..54e3179 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.dpr @@ -0,0 +1,17 @@ +program MemoryData_Client; + +uses + uROComInit, + Forms, + MemoryData_ClientMain in 'MemoryData_ClientMain.pas' {MemoryData_ClientMainForm}, + MemoryData_ClientData in 'MemoryData_ClientData.pas' {MemoryData_ClientDataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'MemoryData - Client'; + Application.CreateForm(TMemoryData_ClientDataModule, MemoryData_ClientDataModule); + Application.CreateForm(TMemoryData_ClientMainForm, MemoryData_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.dproj new file mode 100644 index 0000000..62803ed --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.dproj @@ -0,0 +1,75 @@ + + + {5aba4cae-f8e7-4072-9515-dc1d0e7611fe} + MemoryData_Client.dpr + Debug + AnyCPU + DCC32 + MemoryData_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MemoryData_Client.dpr + + + + + + + MainSource + + +
MemoryData_ClientDataModule
+
+ +
MemoryData_ClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Client.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientData.dfm new file mode 100644 index 0000000..21191e8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientData.dfm @@ -0,0 +1,197 @@ +object MemoryData_ClientDataModule: TMemoryData_ClientDataModule + OldCreateOrder = True + Left = 152 + Top = 69 + Height = 289 + Width = 252 + object ROChannel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 40 + Top = 8 + end + object ROMessage: TROBinMessage + Left = 40 + Top = 52 + end + object RORemoteService: TRORemoteService + ServiceName = 'NewService' + Message = ROMessage + Channel = ROChannel + Left = 40 + Top = 96 + end + object DABinAdapter: TDABinDataStreamer + Left = 40 + Top = 142 + end + object tbl_ComboDataset1: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'AutoIncField' + DataType = datAutoInc + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'TextField' + DataType = datString + Size = 50 + BlobType = dabtUnknown + DisplayWidth = 50 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'CustomParameter' + DataType = datString + Size = 50 + BlobType = dabtUnknown + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = DARemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'ComboDataset' + IndexDefs = <> + Left = 136 + Top = 16 + end + object ds_ComboDataset1: TDADataSource + DataTable = tbl_ComboDataset1 + Left = 152 + Top = 32 + end + object tbl_DirectoryData1: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'FileName' + DataType = datString + Size = 200 + BlobType = dabtUnknown + DisplayWidth = 50 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FileSize' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'Directory' + DataType = datString + Size = 200 + BlobType = dabtUnknown + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = DARemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'DirectoryData' + IndexDefs = <> + Left = 136 + Top = 112 + end + object ds_DirectoryData1: TDADataSource + DataTable = tbl_DirectoryData1 + Left = 152 + Top = 128 + end + object DARemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RORemoteService + GetSchemaCall.MethodName = 'GetSchema' + GetSchemaCall.Params = < + item + Name = 'aFilter' + DataType = rtString + Flag = fIn + Value = Null + end + item + Name = 'Result' + DataType = rtString + Flag = fResult + Value = Null + end> + GetSchemaCall.Default = False + GetSchemaCall.IncomingSchemaParameter = 'Result' + GetSchemaCall.OutgoingFilterParameter = 'aFilter' + GetDataCall.RemoteService = RORemoteService + GetDataCall.MethodName = 'GetData' + GetDataCall.Params = < + item + Name = 'aTableNameArray' + DataType = rtUserDefined + Flag = fIn + TypeName = 'StringArray' + end + item + Name = 'aTableRequestInfoArray' + DataType = rtUserDefined + Flag = fIn + TypeName = 'TableRequestInfoArray' + end + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + end> + GetDataCall.Default = False + GetDataCall.OutgoingTableNamesParameter = 'aTableNameArray' + GetDataCall.OutgoingTableRequestInfosParameter = 'aTableRequestInfoArray' + GetDataCall.IncomingDataParameter = 'Result' + UpdateDataCall.RemoteService = RORemoteService + UpdateDataCall.MethodName = 'UpdateData' + UpdateDataCall.Params = < + item + Name = 'aDelta' + DataType = rtBinary + Flag = fIn + end + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + end> + UpdateDataCall.Default = False + UpdateDataCall.OutgoingDeltaParameter = 'aDelta' + UpdateDataCall.IncomingDeltaParameter = 'Result' + GetScriptsCall.RemoteService = RORemoteService + GetScriptsCall.Params = <> + GetScriptsCall.Default = False + RemoteService = RORemoteService + DataStreamer = DABinAdapter + Left = 40 + Top = 192 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientData.pas new file mode 100644 index 0000000..244bca4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientData.pas @@ -0,0 +1,36 @@ +unit MemoryData_ClientData; + +interface + +uses {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, uDAInterfaces, + uDAScriptingProvider, uDACDSDataTable, + uDARemoteDataAdapter, uDADataStreamer; + +type + TMemoryData_ClientDataModule = class(TDataModule) + ROMessage: TROBinMessage; + ROChannel: TROWinInetHTTPChannel; + RORemoteService: TRORemoteService; + DABinAdapter: TDABinDataStreamer; + tbl_ComboDataset1: TDACDSDataTable; + ds_ComboDataset1: TDADataSource; + tbl_DirectoryData1: TDACDSDataTable; + ds_DirectoryData1: TDADataSource; + DARemoteDataAdapter: TDARemoteDataAdapter; + private + { Private declarations } + public + { Public declarations } + end; + +var + MemoryData_ClientDataModule: TMemoryData_ClientDataModule; + +implementation + +{$R *.dfm} + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientMain.dfm new file mode 100644 index 0000000..309925b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientMain.dfm @@ -0,0 +1,117 @@ +object MemoryData_ClientMainForm: TMemoryData_ClientMainForm + Left = 98 + Top = 36 + AutoScroll = False + BorderWidth = 5 + Caption = 'MemoryData - Client' + ClientHeight = 440 + ClientWidth = 512 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DBGrid1: TDBGrid + Left = 0 + Top = 35 + Width = 512 + Height = 122 + Align = alClient + DataSource = MemoryData_ClientDataModule.ds_ComboDataset1 + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DBGrid2: TDBGrid + Left = 0 + Top = 192 + Width = 512 + Height = 248 + Align = alBottom + DataSource = MemoryData_ClientDataModule.ds_DirectoryData1 + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 512 + Height = 35 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + DesignSize = ( + 512 + 35) + object Label1: TLabel + Left = 88 + Top = 11 + Width = 89 + Height = 13 + Caption = 'Custom Parameter:' + end + object Open1: TButton + Left = 0 + Top = 5 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 0 + OnClick = Open1Click + end + object eCustomParameter: TEdit + Left = 183 + Top = 8 + Width = 325 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Text = 'Regions, Customers, Employees' + end + end + object Panel2: TPanel + Left = 0 + Top = 157 + Width = 512 + Height = 35 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + DesignSize = ( + 512 + 35) + object Label2: TLabel + Left = 88 + Top = 10 + Width = 45 + Height = 13 + Caption = 'Directory:' + end + object open2: TButton + Left = 0 + Top = 5 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 0 + OnClick = open2Click + end + object eDirectory: TEdit + Left = 138 + Top = 8 + Width = 370 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Text = 'C:\Windows' + end + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientMain.pas new file mode 100644 index 0000000..fe8473b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ClientMain.pas @@ -0,0 +1,56 @@ +unit MemoryData_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROIndyHTTPChannel, + Grids, DBGrids, ExtCtrls; + +type + TMemoryData_ClientMainForm = class(TForm) + DBGrid1: TDBGrid; + DBGrid2: TDBGrid; + Panel1: TPanel; + Panel2: TPanel; + open2: TButton; + Label2: TLabel; + eDirectory: TEdit; + Open1: TButton; + Label1: TLabel; + eCustomParameter: TEdit; + procedure Open1Click(Sender: TObject); + procedure open2Click(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + MemoryData_ClientMainForm: TMemoryData_ClientMainForm; + +implementation + +uses MemoryData_ClientData; + +{$R *.dfm} + +procedure TMemoryData_ClientMainForm.Open1Click(Sender: TObject); +begin + with MemoryData_ClientDataModule.tbl_ComboDataset1 do begin + ParamByName('CustomParameter').AsString := eCustomParameter.Text; + Active := Active xor TRUE; + end; +end; + +procedure TMemoryData_ClientMainForm.open2Click(Sender: TObject); +begin + with MemoryData_ClientDataModule.tbl_DirectoryData1 do begin + ParamByName('Directory').AsString := eDirectory.Text; + Active := Active xor TRUE; + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.bdsproj new file mode 100644 index 0000000..48f2368 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MemoryData_Server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.dpr new file mode 100644 index 0000000..a8d30c4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.dpr @@ -0,0 +1,23 @@ +program MemoryData_Server; + +{#ROGEN:MemoryDataLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + MemoryData_ServerMain in 'MemoryData_ServerMain.pas' {MemoryData_ServerMainForm}, + NewService_Impl in 'NewService_Impl.pas' {NewService: TDARemoteService}, + MemoryData_ServerData in 'MemoryData_ServerData.pas' {MemoryData_ServerDataModule: TDataModule}, + MemoryDataLibrary_Intf in 'MemoryDataLibrary_Intf.pas', + MemoryDataLibrary_Invk in 'MemoryDataLibrary_Invk.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'MemoryData - Server'; + Application.CreateForm(TMemoryData_ServerDataModule, MemoryData_ServerDataModule); + Application.CreateForm(TMemoryData_ServerMainForm, MemoryData_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.dproj new file mode 100644 index 0000000..7ad4518 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.dproj @@ -0,0 +1,80 @@ + + + {36625199-3349-4952-8391-e35b3fcc6935} + MemoryData_Server.dpr + Debug + AnyCPU + DCC32 + MemoryData_Server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MemoryData_Server.dpr + + + + + + + MainSource + + + + +
MemoryData_ServerDataModule
+
+ +
MemoryData_ServerMainForm
+
+ +
NewService
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_Server.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerData.dfm new file mode 100644 index 0000000..215cbda --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerData.dfm @@ -0,0 +1,63 @@ +object MemoryData_ServerDataModule: TMemoryData_ServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 104 + Top = 110 + Height = 207 + Width = 352 + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object ROMessage: TROBinMessage + Left = 34 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object IBXDriver: TDAIBXDriver + Left = 256 + Top = 56 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerData.pas new file mode 100644 index 0000000..fa141a5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerData.pas @@ -0,0 +1,48 @@ +unit MemoryData_ServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDADriverManager, uDAClasses, uDAEngine, uDAIBXDriver, uDAADODriver, + uROIndyTCPServer; + +const + { Dataset names for Schema } + ds_Employees = 'Employees'; + ds_ComboDataset = 'ComboDataset'; + ds_Customers = 'Customers'; + ds_Region = 'Region'; + +type + TMemoryData_ServerDataModule = class(TDataModule) + ROServer: TROIndyHTTPServer; + ROMessage: TROBinMessage; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + IBXDriver: TDAIBXDriver; + ConnectionManager: TDAConnectionManager; + DataDictionary: TDADataDictionary; + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + MemoryData_ServerDataModule: TMemoryData_ServerDataModule; + +implementation + +{$R *.dfm} + +procedure TMemoryData_ServerDataModule.DataModuleCreate(Sender: TObject); +begin + ROServer.Active := true; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerMain.dfm new file mode 100644 index 0000000..559a782 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerMain.dfm @@ -0,0 +1,21 @@ +object MemoryData_ServerMainForm: TMemoryData_ServerMainForm + Left = 41 + Top = 43 + BorderStyle = bsDialog + Caption = 'MemoryData - Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton: TDAPoweredByDataAbstractButton + Left = 9 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerMain.pas new file mode 100644 index 0000000..7a60dcd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/MemoryData_ServerMain.pas @@ -0,0 +1,26 @@ +unit MemoryData_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, uDAPoweredByDataAbstractButton; + +type + TMemoryData_ServerMainForm = class(TForm) + DAPoweredByDataAbstractButton: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + MemoryData_ServerMainForm: TMemoryData_ServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/NewService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/NewService_Impl.dfm new file mode 100644 index 0000000..393cef1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/NewService_Impl.dfm @@ -0,0 +1,677 @@ +object NewService: TNewService + OldCreateOrder = True + ServiceSchema = Schema + ServiceDataStreamer = BinAdapter + ExportedDataTables = < + item + DataTable = dtComboDataset + end + item + DataTable = dtWindowsDir + end> + BeforeGetDatasetData = DataAbstractServiceBeforeGetDatasetData + ValidateDatasetAccess = DataAbstractServiceValidateDatasetAccess + Left = 339 + Top = 191 + Height = 149 + Width = 326 + object BinAdapter: TDABinDataStreamer + Left = 32 + Top = 8 + end + object Schema: TDASchema + ConnectionManager = MemoryData_ServerDataModule.ConnectionManager + DataDictionary = MemoryData_ServerDataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Employees' + SQL = + 'SELECT '#10' EmployeeID, LastName, FirstName, Title, TitleOfCourt' + + 'esy, '#10' BirthDate, HireDate, Address, City, Region, PostalCode' + + ', '#10' Country, HomePhone, Extension, Photo, Notes, ReportsTo, '#10 + + ' PhotoPath'#10' FROM'#10' Employees' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'LastName' + TableField = 'LastName' + end + item + DatasetField = 'FirstName' + TableField = 'FirstName' + end + item + DatasetField = 'Title' + TableField = 'Title' + end + item + DatasetField = 'TitleOfCourtesy' + TableField = 'TitleOfCourtesy' + end + item + DatasetField = 'BirthDate' + TableField = 'BirthDate' + end + item + DatasetField = 'HireDate' + TableField = 'HireDate' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'HomePhone' + TableField = 'HomePhone' + end + item + DatasetField = 'Extension' + TableField = 'Extension' + end + item + DatasetField = 'Photo' + TableField = 'Photo' + end + item + DatasetField = 'Notes' + TableField = 'Notes' + end + item + DatasetField = 'ReportsTo' + TableField = 'ReportsTo' + end + item + DatasetField = 'PhotoPath' + TableField = 'PhotoPath' + end> + end> + Name = 'Employees' + Fields = < + item + Name = 'EmployeeID' + DataType = datAutoInc + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'LastName' + DataType = datString + Size = 20 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FirstName' + DataType = datString + Size = 10 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Title' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'TitleOfCourtesy' + DataType = datString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'BirthDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'HireDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'HomePhone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Extension' + DataType = datString + Size = 4 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Photo' + DataType = datBlob + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Notes' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ReportsTo' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PhotoPath' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = <> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = <> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Region' + SQL = 'SELECT '#10' RegionID, RegionDescription'#10' FROM'#10' Region' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'RegionID' + TableField = 'RegionID' + end + item + DatasetField = 'RegionDescription' + TableField = 'RegionDescription' + end> + end> + Name = 'Regions' + Fields = < + item + Name = 'RegionID' + DataType = datAutoInc + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RegionDescription' + DataType = datString + Size = 50 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = < + item + Name = 'FK_Employees_Employees' + MasterDatasetName = 'Employees' + MasterFields = 'EmployeeID' + DetailDatasetName = 'Employees' + DetailFields = 'ReportsTo' + end> + UpdateRules = <> + Left = 32 + Top = 56 + end + object dtComboDataset: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'AutoIncField' + DataType = datAutoInc + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'TextField' + DataType = datString + Size = 50 + BlobType = dabtUnknown + DisplayWidth = 50 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'CustomParameter' + DataType = datString + Size = 50 + BlobType = dabtUnknown + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'ComboDataset' + IndexDefs = <> + Left = 128 + Top = 56 + end + object dtWindowsDir: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'FileName' + DataType = datString + Size = 200 + BlobType = dabtUnknown + DisplayWidth = 50 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FileSize' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'Directory' + DataType = datString + Size = 200 + BlobType = dabtUnknown + ParamType = daptInput + end> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'DirectoryData' + IndexDefs = <> + Left = 216 + Top = 56 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/NewService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/NewService_Impl.pas new file mode 100644 index 0000000..3d06ac6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/NewService_Impl.pas @@ -0,0 +1,173 @@ +unit NewService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} MemoryDataLibrary_Intf, uDAScriptingProvider, uDADataTable, + uDACDSDataTable, uDAClasses, uDADataStreamer, uDABinAdapter, uDAInterfaces; + +const + { Dataset names for Schema } + ds_Employees = 'Employees'; + ds_Customers = 'Customers'; + ds_Regions = 'Regions'; + +type + { TNewService } + TNewService = class(TDataAbstractService, INewService) + BinAdapter: TDABinDataStreamer; + dtComboDataset: TDACDSDataTable; + dtWindowsDir: TDACDSDataTable; + Schema: TDASchema; + procedure DataAbstractServiceBeforeGetDatasetData(aSender: TObject; + const aDataset: IDADataset; const aIncludeSchema: Boolean; + const aMaxRecords: Integer); + procedure DataAbstractServiceValidateDatasetAccess(Sender: TObject; + const aConnection: IDAConnection; const aDatasetName: string; + const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); + private + procedure FillComboDataset(const aDataset: IDAEditableDataset); + procedure FillWinDirDataset(const aDataset: IDAEditableDataset); + protected + { INewService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} MemoryDataLibrary_Invk, MemoryData_ServerData, Dialogs; + +procedure Create_NewService(out anInstance: IUnknown); +begin + anInstance := TNewService.Create(nil); +end; + +procedure TNewService.FillComboDataset(const aDataset: IDAEditableDataset); +var + employees, + customers, + regions: IDADataset; + textfield: TDAField; +begin + with aDataset do begin + // Opens the in memory data table + Open; + textfield := FieldByName('TextField'); + + // Adds 3 dummy records + Insert; + textfield.AsString := 'String A'; + Post; + + Insert; + textfield.AsString := 'String B'; + Post; + + Insert; + textfield.AsString := 'String C'; + Post; + + // Fetches data from other datasets, according to the value of the parameter "CustomParameter" + if (Pos('EMPLOYEES', UpperCase(ParamByName('CustomParameter').AsString)) > 0) then begin + employees := Schema.NewDataset(Connection, ds_Employees, [], [], TRUE); + while not employees.EOF do begin + Insert; + textfield.AsString := employees.FieldByName('FirstName').AsString + ' ' + employees.FieldByName('LastName').AsString; + Post; + + employees.Next; + end; + employees:=nil; + end; + if (Pos('CUSTOMERS', UpperCase(ParamByName('CustomParameter').AsString)) > 0) then begin + customers := Schema.NewDataset(Connection, ds_Customers, [], [], TRUE); + while not customers.EOF do begin + Insert; + textfield.AsString := customers.FieldByName('CompanyName').AsString; + Post; + + customers.Next; + end; + customers := nil; + end; + if (Pos('REGIONS', UpperCase(ParamByName('CustomParameter').AsString)) > 0) then begin + regions := Schema.NewDataset(Connection, ds_Regions, [], [], TRUE); + while not regions.EOF do begin + Insert; + textfield.AsString := regions.FieldByName('RegionDescription').AsString; + Post; + + regions.Next; + end; + regions := nil; + end; + end; +end; + +procedure TNewService.FillWinDirDataset(const aDataset: IDAEditableDataset); +var + dirinfo: TSearchRec; +begin + aDataset.Open; + if (FindFirst(IncludeTrailingPathDelimiter(aDataset.ParamByName('Directory').AsString) + '*.*', faArchive, dirinfo) = 0) then repeat + aDataset.Insert; + + aDataset.FieldByName('FileName').AsString := dirinfo.Name; + aDataset.FieldByName('FileSize').AsInteger := dirinfo.Size; + + aDataset.Post; + until (FindNext(dirinfo) <> 0); +end; + +procedure TNewService.DataAbstractServiceBeforeGetDatasetData( + aSender: TObject; const aDataset: IDADataset; + const aIncludeSchema: Boolean; const aMaxRecords: Integer); +begin + if SameText(aDataset.LogicalName, dtComboDataset.LogicalName) then + FillComboDataset((dtComboDataset as IDAEditableDataset)) + else if SameText(aDataset.LogicalName, dtWindowsDir.LogicalName) then + FillWinDirDataset((dtWindowsDir as IDAEditableDataset)); +end; + +procedure TNewService.DataAbstractServiceValidateDatasetAccess( + Sender: TObject; const aConnection: IDAConnection; + const aDatasetName: string; const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); + + procedure FillParameters(aDataSet: TDACDSDataTable); + var + i: integer; + begin + for i := Low(aParamNames) to High(aParamNames) do + aDataset.ParamByName(aParamNames[i]).Value := aParamValues[i]; + end; + +begin + if SameText(aDatasetName, dtComboDataset.LogicalName) then + FillParameters(dtComboDataset) + else if SameText(aDatasetName, dtWindowsDir.LogicalName) then + FillParameters(dtWindowsDir) +end; + +initialization + TROClassFactory.Create('NewService', Create_NewService, TNewService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/RODLFILE.res new file mode 100644 index 0000000..066b5bf Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Memory Data/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.Sample.html new file mode 100644 index 0000000..0c9d025 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.Sample.html @@ -0,0 +1,30 @@ + + + + + + + + + +

+ Multi Level Detail Sample +

+ + +

Purpose

+ +

+ This sample shows how to implement master/detail/detail updates as simply as possible.
+

+ +

Examine the Code

+ + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.bdsgroup new file mode 100644 index 0000000..14cde7c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + MultiLevelDetailServer.bdsproj + MultiLevelDetailClient.bdsproj + MultiLevelDetailServer.exe MultiLevelDetailClient.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.bpg new file mode 100644 index 0000000..514c8c0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = MultiLevelDetailServer.exe MultiLevelDetailClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +MultiLevelDetailServer.exe: MultiLevelDetailServer.dpr + $(DCC) + +MultiLevelDetailClient.exe: MultiLevelDetailClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.groupproj new file mode 100644 index 0000000..0249223 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetail.groupproj @@ -0,0 +1,40 @@ + + + {a8aee872-234f-4970-aa60-4963b9b3acfb} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.bdsproj new file mode 100644 index 0000000..98918df --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MultiLevelDetailClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.dpr new file mode 100644 index 0000000..c6d38c4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.dpr @@ -0,0 +1,18 @@ +program MultiLevelDetailClient; + +uses + uROComInit, + Forms, + MidasLib, + MultiLevelDetailClient_Main in 'MultiLevelDetailClient_Main.pas' {MultiLevelDetailClient_MainForm}, + MultiLevelDetailClient_Data in 'MultiLevelDetailClient_Data.pas' {MultiLevelDetailClient_DataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Multi Level Detail Client'; + Application.CreateForm(TMultiLevelDetailClient_DataModule, MultiLevelDetailClient_DataModule); + Application.CreateForm(TMultiLevelDetailClient_MainForm, MultiLevelDetailClient_MainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.dproj new file mode 100644 index 0000000..a75f4ff --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.dproj @@ -0,0 +1,75 @@ + + + {f33b19c1-5014-448b-8588-d80873810fe1} + MultiLevelDetailClient.dpr + Debug + AnyCPU + DCC32 + MultiLevelDetailClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MultiLevelDetailClient.dpr + + + + + + + MainSource + + +
MultiLevelDetailClient_DataModule
+
+ +
MultiLevelDetailClient_MainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Data.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Data.dfm new file mode 100644 index 0000000..1ccecda --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Data.dfm @@ -0,0 +1,195 @@ +object MultiLevelDetailClient_DataModule: TMultiLevelDetailClient_DataModule + OldCreateOrder = True + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Envelopes = <> + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'MultiLevelDetailService' + Left = 40 + Top = 96 + end + object DataStreamer: TDABinDataStreamer + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 40 + Top = 184 + end + object ds_Categories: TDADataSource + DataSet = tbl_Categories.Dataset + DataTable = tbl_Categories + Left = 133 + Top = 131 + end + object ds_Products: TDADataSource + DataSet = tbl_Products.Dataset + DataTable = tbl_Products + Left = 133 + Top = 177 + end + object ds_OrderDetails: TDADataSource + DataSet = tbl_OrderDetails.Dataset + DataTable = tbl_OrderDetails + Left = 133 + Top = 86 + end + object tbl_OrderDetails: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datInteger + Required = True + InPrimaryKey = True + end + item + Name = 'ProductID' + DataType = datInteger + Required = True + InPrimaryKey = True + end + item + Name = 'UnitPrice' + DataType = datCurrency + Required = True + end + item + Name = 'Quantity' + DataType = datSmallInt + Required = True + end + item + Name = 'Discount' + DataType = datFloat + Required = True + end> + Params = <> + MasterMappingMode = mmWhere + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + AfterInsert = tbl_OrderDetailsAfterInsert + MasterSource = ds_Products + MasterFields = 'ProductID' + DetailFields = 'ProductID' + LogicalName = 'Order Details' + IndexDefs = <> + Left = 221 + Top = 86 + end + object tbl_Products: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'ProductID' + DataType = datAutoInc + GeneratorName = 'Products' + Required = True + InPrimaryKey = True + end + item + Name = 'ProductName' + DataType = datWideString + Size = 40 + Required = True + end + item + Name = 'SupplierID' + DataType = datInteger + end + item + Name = 'CategoryID' + DataType = datInteger + end + item + Name = 'QuantityPerUnit' + DataType = datWideString + Size = 20 + end + item + Name = 'UnitPrice' + DataType = datCurrency + end + item + Name = 'UnitsInStock' + DataType = datSmallInt + end + item + Name = 'UnitsOnOrder' + DataType = datSmallInt + end + item + Name = 'ReorderLevel' + DataType = datSmallInt + end + item + Name = 'Discontinued' + DataType = datBoolean + Required = True + end> + Params = <> + MasterMappingMode = mmWhere + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + AfterInsert = tbl_ProductsAfterInsert + MasterSource = ds_Categories + MasterFields = 'CategoryID' + DetailFields = 'CategoryID' + LogicalName = 'Products' + IndexDefs = <> + Left = 218 + Top = 179 + end + object tbl_Categories: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CategoryID' + DataType = datAutoInc + GeneratorName = 'Categories' + Required = True + InPrimaryKey = True + end + item + Name = 'CategoryName' + DataType = datWideString + Size = 15 + Required = True + end + item + Name = 'Description' + DataType = datMemo + end + item + Name = 'Picture' + DataType = datBlob + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + LogicalName = 'Categories' + IndexDefs = <> + Left = 220 + Top = 131 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Data.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Data.pas new file mode 100644 index 0000000..b046fc2 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Data.pas @@ -0,0 +1,66 @@ +unit MultiLevelDetailClient_Data; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, uDAInterfaces, + uDADataStreamer, uDARemoteDataAdapter, uDAScriptingProvider, + uDACDSDataTable, uDAMemDataTable; + +type + TMultiLevelDetailClient_DataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABinDataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + ds_Categories: TDADataSource; + ds_Products: TDADataSource; + ds_OrderDetails: TDADataSource; + tbl_OrderDetails: TDAMemDataTable; + tbl_Products: TDAMemDataTable; + tbl_Categories: TDAMemDataTable; + procedure tbl_OrderDetailsAfterInsert(DataTable: TDADataTable); + procedure tbl_ProductsAfterInsert(DataTable: TDADataTable); + private + { Private declarations } + public + { Public declarations } + end; + +var + MultiLevelDetailClient_DataModule: TMultiLevelDetailClient_DataModule; + +implementation + +{$R *.dfm} + +procedure TMultiLevelDetailClient_DataModule.tbl_OrderDetailsAfterInsert( + DataTable: TDADataTable); +begin + if DataTable.FieldByName('UnitPrice').IsNull + then DataTable.FieldByName('UnitPrice').AsCurrency := 0.0; + if DataTable.FieldByName('Quantity').IsNull + then DataTable.FieldByName('Quantity').AsInteger := 1; + if DataTable.FieldByName('Discount').IsNull + then DataTable.FieldByName('Discount').AsFloat := 0.0; +end; + +procedure TMultiLevelDetailClient_DataModule.tbl_ProductsAfterInsert( + DataTable: TDADataTable); +begin + if DataTable.FieldByName('UnitPrice').IsNull + then DataTable.FieldByName('UnitPrice').AsCurrency := 0.0; + if DataTable.FieldByName('ReorderLevel').IsNull + then DataTable.FieldByName('ReorderLevel').AsSmallInt := 0; + if DataTable.FieldByName('UnitsInStock').IsNull + then DataTable.FieldByName('UnitsInStock').AsSmallInt := 0; + if DataTable.FieldByName('UnitsOnOrder').IsNull + then DataTable.FieldByName('UnitsOnOrder').AsSmallInt := 0; + if DataTable.FieldByName('Discontinued').IsNull + then DataTable.FieldByName('Discontinued').AsBoolean := false; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Main.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Main.dfm new file mode 100644 index 0000000..8ac5024 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Main.dfm @@ -0,0 +1,101 @@ +object MultiLevelDetailClient_MainForm: TMultiLevelDetailClient_MainForm + Left = 138 + Top = 151 + AutoScroll = False + Caption = 'Multi Level Detail Client' + ClientHeight = 380 + ClientWidth = 457 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Splitter1: TSplitter + Left = 0 + Top = 252 + Width = 457 + Height = 8 + Cursor = crVSplit + Align = alBottom + Beveled = True + end + object Splitter2: TSplitter + Left = 0 + Top = 124 + Width = 457 + Height = 8 + Cursor = crVSplit + Align = alBottom + Beveled = True + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 457 + Height = 27 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object FillButton: TButton + Left = 9 + Top = 3 + Width = 75 + Height = 22 + Caption = 'Fill' + TabOrder = 0 + OnClick = FillButtonClick + end + object UpdateButton: TButton + Left = 147 + Top = 3 + Width = 75 + Height = 22 + Caption = 'Update' + TabOrder = 1 + OnClick = UpdateButtonClick + end + end + object gOrderDetails: TDBGrid + Left = 0 + Top = 260 + Width = 457 + Height = 120 + Align = alBottom + DataSource = MultiLevelDetailClient_DataModule.ds_OrderDetails + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object gProducts: TDBGrid + Left = 0 + Top = 132 + Width = 457 + Height = 120 + Align = alBottom + DataSource = MultiLevelDetailClient_DataModule.ds_Products + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object gCategories: TDBGrid + Left = 0 + Top = 27 + Width = 457 + Height = 97 + Align = alClient + DataSource = MultiLevelDetailClient_DataModule.ds_Categories + TabOrder = 3 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Main.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Main.pas new file mode 100644 index 0000000..9eeba1e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailClient_Main.pas @@ -0,0 +1,49 @@ +unit MultiLevelDetailClient_Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, ExtCtrls, + Grids, DBGrids; + +type + TMultiLevelDetailClient_MainForm = class(TForm) + Panel1: TPanel; + FillButton: TButton; + gOrderDetails: TDBGrid; + Splitter1: TSplitter; + gProducts: TDBGrid; + Splitter2: TSplitter; + gCategories: TDBGrid; + UpdateButton: TButton; + procedure FillButtonClick(Sender: TObject); + procedure UpdateButtonClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + MultiLevelDetailClient_MainForm: TMultiLevelDetailClient_MainForm; + +implementation + +uses + MultiLevelDetailClient_Data; + +{$R *.dfm} + +procedure TMultiLevelDetailClient_MainForm.FillButtonClick(Sender: TObject); +begin + MultiLevelDetailClient_DataModule.tbl_Categories.Open; +end; + +procedure TMultiLevelDetailClient_MainForm.UpdateButtonClick(Sender: TObject); +begin + MultiLevelDetailClient_DataModule.tbl_Categories.ApplyUpdates; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailLibrary.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailLibrary.RODL new file mode 100644 index 0000000..d1e6d7a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailLibrary.RODL @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailLibrary_Intf.pas new file mode 100644 index 0000000..2edeeaf --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailLibrary_Intf.pas @@ -0,0 +1,82 @@ +unit MultiLevelDetailLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{C36F2B70-713D-4D12-A330-097CEF6EBDDB}'; + TargetNamespace = ''; + + { Service Interface ID's } + IMultiLevelDetailService_IID : TGUID = '{F2D11C9C-E4E6-4732-8692-0CAC26018C78}'; + + { Event ID's } + +type + { Forward declarations } + IMultiLevelDetailService = interface; + + + + + + { Enumerateds } + + { IMultiLevelDetailService } + IMultiLevelDetailService = interface(IDataAbstractService) + ['{F2D11C9C-E4E6-4732-8692-0CAC26018C78}'] + end; + + { CoMultiLevelDetailService } + CoMultiLevelDetailService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IMultiLevelDetailService; + end; + + { TMultiLevelDetailService_Proxy } + TMultiLevelDetailService_Proxy = class(TDataAbstractService_Proxy, IMultiLevelDetailService) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoMultiLevelDetailService } + +class function CoMultiLevelDetailService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IMultiLevelDetailService; +begin + result := TMultiLevelDetailService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TMultiLevelDetailService_Proxy.__GetInterfaceName:string; +begin + result := 'MultiLevelDetailService'; +end; + +initialization + RegisterProxyClass(IMultiLevelDetailService_IID, TMultiLevelDetailService_Proxy); + + +finalization + UnregisterProxyClass(IMultiLevelDetailService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailLibrary_Invk.pas new file mode 100644 index 0000000..52216c4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailLibrary_Invk.pas @@ -0,0 +1,45 @@ +unit MultiLevelDetailLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} MultiLevelDetailLibrary_Intf; + +type + TMultiLevelDetailService_Invoker = class(TDataAbstractService_Invoker) + private + protected + public + constructor Create; override; + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TMultiLevelDetailService_Invoker } + +constructor TMultiLevelDetailService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.bdsproj new file mode 100644 index 0000000..0a3e952 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MultiLevelDetailServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.dpr new file mode 100644 index 0000000..cd8a8ab --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.dpr @@ -0,0 +1,30 @@ +program MultiLevelDetailServer; + +{#ROGEN:MultiLevelDetailLibrary.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + MultiLevelDetailServer_Main in 'MultiLevelDetailServer_Main.pas' {MultiLevelDetailServer_MainForm}, + MultiLevelDetailService_Impl in 'MultiLevelDetailService_Impl.pas' {MultiLevelDetailService: TDARemoteService}, + MultiLevelDetailServer_Data in 'MultiLevelDetailServer_Data.pas' {MultiLevelDetailServer_DataModule: TDataModule}, + MultiLevelDetailLibrary_Intf in 'MultiLevelDetailLibrary_Intf.pas', + MultiLevelDetailLibrary_Invk in 'MultiLevelDetailLibrary_Invk.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + if ROStartService('MultiLevelDetail', 'MultiLevelDetail') then begin + ROService.CreateForm(TMultiLevelDetailServer_DataModule, MultiLevelDetailServer_DataModule); + ROService.Run; + Exit; + end; + + Application.Initialize; + Application.Title := 'Multi Level Detail Server'; + Application.CreateForm(TMultiLevelDetailServer_DataModule, MultiLevelDetailServer_DataModule); + Application.CreateForm(TMultiLevelDetailServer_MainForm, MultiLevelDetailServer_MainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.dproj new file mode 100644 index 0000000..171747e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.dproj @@ -0,0 +1,46 @@ + + + {b4f8c45f-3323-46d4-ba1a-8642a93d1e6e} + MultiLevelDetailServer.dpr + Debug + AnyCPU + DCC32 + MultiLevelDetailServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + +FalseTrueFalseFalseFalse1000FalseFalseFalseFalseFalse105812511.0.0.01.0.0.0MultiLevelDetailServer.dpr + + + + + MainSource + + + + +
MultiLevelDetailServer_DataModule
+ TDataModule +
+ +
MultiLevelDetailServer_MainForm
+
+ +
MultiLevelDetailService
+ TDARemoteService +
+
+
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Data.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Data.dfm new file mode 100644 index 0000000..faa7bc1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Data.dfm @@ -0,0 +1,62 @@ +object MultiLevelDetailServer_DataModule: TMultiLevelDetailServer_DataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Envelopes = <> + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI' + Description = 'Microsoft SQL Server 2000, localhost' + Default = True + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object IBXDriver: TDAIBXDriver + Left = 256 + Top = 56 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Data.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Data.pas new file mode 100644 index 0000000..8dd6a39 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Data.pas @@ -0,0 +1,42 @@ +unit MultiLevelDetailServer_Data; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAIBXDriver, uDAADODriver, uROIndyTCPServer; + +type + TMultiLevelDetailServer_DataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + IBXDriver: TDAIBXDriver; + SessionManager: TROInMemorySessionManager; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + MultiLevelDetailServer_DataModule: TMultiLevelDetailServer_DataModule; + +implementation + +{$R *.dfm} + +procedure TMultiLevelDetailServer_DataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Main.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Main.dfm new file mode 100644 index 0000000..aced753 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Main.dfm @@ -0,0 +1,21 @@ +object MultiLevelDetailServer_MainForm: TMultiLevelDetailServer_MainForm + Left = 372 + Top = 277 + BorderStyle = bsDialog + Caption = 'Multi Level Detail Server' + ClientHeight = 64 + ClientWidth = 277 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 34 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Main.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Main.pas new file mode 100644 index 0000000..bf43bb4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailServer_Main.pas @@ -0,0 +1,25 @@ +unit MultiLevelDetailServer_Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton; + +type + TMultiLevelDetailServer_MainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + MultiLevelDetailServer_MainForm: TMultiLevelDetailServer_MainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailService_Impl.dfm new file mode 100644 index 0000000..439eba3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailService_Impl.dfm @@ -0,0 +1,252 @@ +object MultiLevelDetailService: TMultiLevelDetailService + OldCreateOrder = True + SessionManager = MultiLevelDetailServer_DataModule.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Height = 212 + Width = 216 + object DataStreamer: TDABinDataStreamer + Left = 32 + Top = 8 + end + object Schema: TDASchema + ConnectionManager = MultiLevelDetailServer_DataModule.ConnectionManager + DataDictionary = MultiLevelDetailServer_DataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'Northwind' + Default = True + TargetTable = 'Categories' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'CategoryID' + TableField = 'CategoryID' + end + item + DatasetField = 'CategoryName' + TableField = 'CategoryName' + end + item + DatasetField = 'Description' + TableField = 'Description' + end + item + DatasetField = 'Picture' + TableField = 'Picture' + end> + end> + Name = 'Categories' + Fields = < + item + Name = 'CategoryID' + DataType = datAutoInc + GeneratorName = 'Categories' + Required = True + InPrimaryKey = True + end + item + Name = 'CategoryName' + DataType = datWideString + Size = 15 + Required = True + end + item + Name = 'Description' + DataType = datMemo + end + item + Name = 'Picture' + DataType = datBlob + end> + end + item + Params = <> + Statements = < + item + Connection = 'Northwind' + Default = True + TargetTable = 'Order Details' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'ProductID' + TableField = 'ProductID' + end + item + DatasetField = 'UnitPrice' + TableField = 'UnitPrice' + end + item + DatasetField = 'Quantity' + TableField = 'Quantity' + end + item + DatasetField = 'Discount' + TableField = 'Discount' + end> + end> + Name = 'Order Details' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + Required = True + InPrimaryKey = True + end + item + Name = 'ProductID' + DataType = datInteger + Required = True + InPrimaryKey = True + end + item + Name = 'UnitPrice' + DataType = datCurrency + Required = True + end + item + Name = 'Quantity' + DataType = datSmallInt + Required = True + end + item + Name = 'Discount' + DataType = datFloat + Required = True + end> + end + item + Params = <> + Statements = < + item + Connection = 'Northwind' + Default = True + TargetTable = 'Products' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'ProductID' + TableField = 'ProductID' + end + item + DatasetField = 'ProductName' + TableField = 'ProductName' + end + item + DatasetField = 'SupplierID' + TableField = 'SupplierID' + end + item + DatasetField = 'CategoryID' + TableField = 'CategoryID' + end + item + DatasetField = 'QuantityPerUnit' + TableField = 'QuantityPerUnit' + end + item + DatasetField = 'UnitPrice' + TableField = 'UnitPrice' + end + item + DatasetField = 'UnitsInStock' + TableField = 'UnitsInStock' + end + item + DatasetField = 'UnitsOnOrder' + TableField = 'UnitsOnOrder' + end + item + DatasetField = 'ReorderLevel' + TableField = 'ReorderLevel' + end + item + DatasetField = 'Discontinued' + TableField = 'Discontinued' + end> + end> + Name = 'Products' + Fields = < + item + Name = 'ProductID' + DataType = datAutoInc + GeneratorName = 'Products' + Required = True + InPrimaryKey = True + end + item + Name = 'ProductName' + DataType = datWideString + Size = 40 + Required = True + end + item + Name = 'SupplierID' + DataType = datInteger + end + item + Name = 'CategoryID' + DataType = datInteger + end + item + Name = 'QuantityPerUnit' + DataType = datWideString + Size = 20 + end + item + Name = 'UnitPrice' + DataType = datCurrency + end + item + Name = 'UnitsInStock' + DataType = datSmallInt + end + item + Name = 'UnitsOnOrder' + DataType = datSmallInt + end + item + Name = 'ReorderLevel' + DataType = datSmallInt + end + item + Name = 'Discontinued' + DataType = datBoolean + Required = True + end> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = < + item + Name = 'FK_Order Details_Products' + MasterDatasetName = 'Products' + MasterFields = 'ProductID' + DetailDatasetName = 'Order Details' + DetailFields = 'ProductID' + RelationshipType = rtForeignKey + end + item + Name = 'FK_Products_Categories' + MasterDatasetName = 'Categories' + MasterFields = 'CategoryID' + DetailDatasetName = 'Products' + DetailFields = 'CategoryID' + RelationshipType = rtForeignKey + end> + UpdateRules = <> + Version = 0 + Left = 32 + Top = 56 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailService_Impl.pas new file mode 100644 index 0000000..43f3d54 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/MultiLevelDetailService_Impl.pas @@ -0,0 +1,37 @@ +unit MultiLevelDetailService_Impl; + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Data Abstract:} uDAClasses, uDADataTable, uDABinAdapter, uDAInterfaces, uDADataStreamer, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} MultiLevelDetailLibrary_Intf; + +type + { TMultiLevelDetailService } + TMultiLevelDetailService = class(TDataAbstractService, IMultiLevelDetailService) + DataStreamer: TDABinDataStreamer; + Schema: TDASchema; + private + protected + { IMultiLevelDetailService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} MultiLevelDetailLibrary_Invk, MultiLevelDetailServer_Data; + +procedure Create_MultiLevelDetailService(out anInstance: IUnknown); +begin + anInstance := TMultiLevelDetailService.Create(nil); +end; + +initialization + TROClassFactory.Create('MultiLevelDetailService', Create_MultiLevelDetailService, TMultiLevelDetailService_Invoker); +finalization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/RODLFILE.res new file mode 100644 index 0000000..9bff87d Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Multi Level Detail/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/NewService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/NewService_Impl.dfm new file mode 100644 index 0000000..1007367 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/NewService_Impl.dfm @@ -0,0 +1,727 @@ +object NewService: TNewService + OldCreateOrder = True + AcquireConnection = True + ConnectionName = 'ADO' + ServiceSchema = Schema + ServiceDataStreamer = BinAdapter + ExportedDataTables = <> + Left = 372 + Top = 283 + Height = 364 + Width = 436 + object BinAdapter: TDABinDataStreamer + Left = 32 + Top = 8 + end + object Schema: TDASchema + ConnectionManager = QuantumGrid4_ServerDataModule.ConnectionManager + DataDictionary = DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = < + item + Name = 'CustomerID' + DataType = datString + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10' FROM'#10' ' + + ' Orders'#10' WHERE CustomerID=:CustomerID' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10' FROM'#10' ' + + ' Orders' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'AllOrders' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 32 + Top = 56 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 33 + Top = 104 + end + object bsCustomers: TDABusinessProcessor + Schema = Schema + ReferencedDataset = 'Customers' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete] + UpdateMode = updWhereKeyOnly + Left = 64 + Top = 176 + end + object bsOrders: TDABusinessProcessor + Schema = Schema + ReferencedDataset = 'Orders' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete] + UpdateMode = updWhereKeyOnly + Left = 160 + Top = 176 + end + object bsAllOrders: TDABusinessProcessor + Schema = Schema + ReferencedDataset = 'AllOrders' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete] + UpdateMode = updWhereKeyOnly + Left = 240 + Top = 176 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/NewService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/NewService_Impl.pas new file mode 100644 index 0000000..d601ce6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/NewService_Impl.pas @@ -0,0 +1,84 @@ +unit NewService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} QuantumGrid4Library_Intf, uDAScriptingProvider, uDABusinessProcessor, + uDAClasses, uDADataStreamer, uDABinAdapter; + +const + { Dataset names for Schema } + ds_Customers = 'Customers'; + ds_Orders = 'Orders'; + ds_AllOrders = 'AllOrders'; + +type + { TNewService } + TNewService = class(TDataAbstractService, INewService) + BinAdapter: TDABinDataStreamer; + bsCustomers: TDABusinessProcessor; + bsOrders: TDABusinessProcessor; + Schema: TDASchema; + DataDictionary: TDADataDictionary; + bsAllOrders: TDABusinessProcessor; + private + protected + { INewService methods } + function GetCustomers: Binary; + function UpdateCustomers(const IncomingData: Binary): Binary; + function GetOrders(const CustomerID: AnsiString): Binary; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} QuantumGrid4Library_Invk, QuantumGrid4_ServerData, uDAInterfaces; + +procedure Create_NewService(out anInstance : IUnknown); +begin + anInstance := TNewService.Create(NIL); +end; + + +{ TNewService } + + +function TNewService.GetCustomers: Binary; +begin + result := Binary.Create; + BinAdapter.Initialize(result, aiWrite); + BinAdapter.WriteDataset(Schema.NewDataset(Connection, ds_Customers), [woRows]); + BinAdapter.Finalize; +end; + +function TNewService.GetOrders(const CustomerID: AnsiString): Binary; +begin + result := Binary.Create; + BinAdapter.Initialize(result, aiWrite); + BinAdapter.WriteDataset(Schema.NewDataset(Connection, ds_Orders,['CustomerID'], [CustomerID]), [woRows]); + BinAdapter.Finalize; +end; + +function TNewService.UpdateCustomers(const IncomingData: Binary): Binary; +begin + result := UpdateData(IncomingData); +end; + +initialization + TROClassFactory.Create('NewService', Create_NewService, TNewService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.Sample.html new file mode 100644 index 0000000..fb68fed --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.Sample.html @@ -0,0 +1,58 @@ + + + + + + + + + +

+ QuantumGrid4 +

+ + +

Purpose

+ +

+ This example demonstrates how to use the QuantumGrid4 (or QuantumGrid5) + product from Developer Express (contact www.devexpress.com. for + licensing + information if you do not already have the product). +

+

+   +

+

+ Things to look at in QuantumGrid4_server.exe +

+

+ The most important methods in the host application are in the NewService_Impl + unit: +

+ +

+ Things to look at in QuantumGrid4_client.exe +

+

+ There's only two lines of code in QuantumGrid4_ClientMain, one for each button. +

+

+ Have a look at QuantumGrid4_ClientData though. This contains code that + saves references to customers previously accessed, thus avoiding re-fetching details. +

+

+   +

+ + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.bdsgroup new file mode 100644 index 0000000..23846d8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + QuantumGrid4_Client.bdsproj + QuantumGrid4_server.bdsproj + QuantumGrid4_Client.exe QuantumGrid4_server.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.bpg new file mode 100644 index 0000000..b2cc016 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = QuantumGrid4_Client.exe QuantumGrid4_server.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +QuantumGrid4_Client.exe: QuantumGrid4_Client.dpr + $(DCC) + +QuantumGrid4_server.exe: QuantumGrid4_server.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.groupproj new file mode 100644 index 0000000..abbfa8b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4.groupproj @@ -0,0 +1,40 @@ + + + {91a9ff88-032e-4329-a4e4-75d3d762f4d9} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4Library.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4Library.rodl new file mode 100644 index 0000000..be38352 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4Library.rodl @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4Library_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4Library_Intf.pas new file mode 100644 index 0000000..1f01454 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4Library_Intf.pas @@ -0,0 +1,131 @@ +unit QuantumGrid4Library_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{7EF63C27-FB17-4F10-985E-92BAF0E3E619}'; + + { Service Interface ID's } + INewService_IID : TGUID = '{E4E6FDE4-2542-4554-B59A-438E23439111}'; + + { Event ID's } + +type + { Forward declarations } + INewService = interface; + + + + + { INewService } + INewService = interface(IDataAbstractService) + ['{E4E6FDE4-2542-4554-B59A-438E23439111}'] + function GetCustomers: Binary; + function UpdateCustomers(const IncomingData: Binary): Binary; + function GetOrders(const CustomerID: String): Binary; + end; + + { CoNewService } + CoNewService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): INewService; + end; + + { TNewService_Proxy } + TNewService_Proxy = class(TDataAbstractService_Proxy, INewService) + protected + function __GetInterfaceName:string; override; + + function GetCustomers: Binary; + function UpdateCustomers(const IncomingData: Binary): Binary; + function GetOrders(const CustomerID: String): Binary; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoNewService } + +class function CoNewService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): INewService; +begin + result := TNewService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TNewService_Proxy } + +function TNewService_Proxy.__GetInterfaceName:string; +begin + result := 'NewService'; +end; + +function TNewService_Proxy.GetCustomers: Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'QuantumGrid4Library', __InterfaceName, 'GetCustomers'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.FreeStream; + end +end; + +function TNewService_Proxy.UpdateCustomers(const IncomingData: Binary): Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'QuantumGrid4Library', __InterfaceName, 'UpdateCustomers'); + __Message.Write('IncomingData', TypeInfo(Binary), IncomingData, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.FreeStream; + end +end; + +function TNewService_Proxy.GetOrders(const CustomerID: String): Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'QuantumGrid4Library', __InterfaceName, 'GetOrders'); + __Message.Write('CustomerID', TypeInfo(String), CustomerID, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(INewService_IID, TNewService_Proxy); + + +finalization + UnregisterProxyClass(INewService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4Library_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4Library_Invk.pas new file mode 100644 index 0000000..23590ae --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4Library_Invk.pas @@ -0,0 +1,117 @@ +unit QuantumGrid4Library_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} QuantumGrid4Library_Intf; + +type + TNewService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + procedure Invoke_GetCustomers(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_UpdateCustomers(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetOrders(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TNewService_Invoker } + +procedure TNewService_Invoker.Invoke_GetCustomers(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetCustomers: Binary; } +var + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + lResult := (__Instance as INewService).GetCustomers; + + __Message.InitializeResponseMessage(__Transport, 'QuantumGrid4Library', 'NewService', 'GetCustomersResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TNewService_Invoker.Invoke_UpdateCustomers(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function UpdateCustomers(const IncomingData: Binary): Binary; } +var + IncomingData: Binary; + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + IncomingData := nil; + lResult := nil; + try + __Message.Read('IncomingData', TypeInfo(Binary), IncomingData, []); + + lResult := (__Instance as INewService).UpdateCustomers(IncomingData); + + __Message.InitializeResponseMessage(__Transport, 'QuantumGrid4Library', 'NewService', 'UpdateCustomersResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(IncomingData); + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TNewService_Invoker.Invoke_GetOrders(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetOrders(const CustomerID: String): Binary; } +var + CustomerID: String; + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + __Message.Read('CustomerID', TypeInfo(String), CustomerID, []); + + lResult := (__Instance as INewService).GetOrders(CustomerID); + + __Message.InitializeResponseMessage(__Transport, 'QuantumGrid4Library', 'NewService', 'GetOrdersResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.bdsproj new file mode 100644 index 0000000..9f1d6d4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + QuantumGrid4_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.dpr new file mode 100644 index 0000000..e5424b7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.dpr @@ -0,0 +1,17 @@ +program QuantumGrid4_Client; + +uses + uROComInit, + Forms, + QuantumGrid4_ClientMain in 'QuantumGrid4_ClientMain.pas' {QuantumGrid4_ClientMainForm}, + QuantumGrid4_ClientData in 'QuantumGrid4_ClientData.pas' {QuantumGrid4_ClientDataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'QuantumGrid4 Client'; + Application.CreateForm(TQuantumGrid4_ClientDataModule, QuantumGrid4_ClientDataModule); + Application.CreateForm(TQuantumGrid4_ClientMainForm, QuantumGrid4_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.dproj new file mode 100644 index 0000000..d7eddb5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.dproj @@ -0,0 +1,75 @@ + + + {186a7cf2-9814-47d5-8eba-10b5c4756fee} + QuantumGrid4_Client.dpr + Debug + AnyCPU + DCC32 + QuantumGrid4_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + QuantumGrid4_Client.dpr + + + + + + + MainSource + + +
QuantumGrid4_ClientDataModule
+
+ +
QuantumGrid4_ClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_Client.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientData.dfm new file mode 100644 index 0000000..1ec161b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientData.dfm @@ -0,0 +1,308 @@ +object QuantumGrid4_ClientDataModule: TQuantumGrid4_ClientDataModule + OldCreateOrder = True + Left = 281 + Top = 207 + Height = 300 + Width = 437 + object ROChannel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object ROMessage: TROBinMessage + Left = 40 + Top = 52 + end + object RORemoteService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'NewService' + Left = 40 + Top = 96 + end + object bdsCustomers: TDABinDataStreamer + Left = 306 + Top = 49 + end + object dtCustomers: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + InPrimaryKey = True + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + end + item + Name = 'Address' + DataType = datString + Size = 60 + end + item + Name = 'City' + DataType = datString + Size = 15 + end + item + Name = 'Region' + DataType = datString + Size = 15 + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + end + item + Name = 'Country' + DataType = datString + Size = 15 + end + item + Name = 'Phone' + DataType = datString + Size = 24 + end + item + Name = 'Fax' + DataType = datString + Size = 24 + end> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = rdaCustomers + AfterOpen = dtCustomersAfterOpen + AfterScroll = dtCustomersAfterScroll + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 192 + Top = 32 + end + object dsCustomers: TDADataSource + DataTable = dtCustomers + Left = 208 + Top = 48 + end + object dtOrders: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + InPrimaryKey = True + end + item + Name = 'CustomerID' + DataType = datString + Size = 5 + end + item + Name = 'EmployeeID' + DataType = datInteger + end + item + Name = 'OrderDate' + DataType = datDateTime + end + item + Name = 'RequiredDate' + DataType = datDateTime + end + item + Name = 'ShippedDate' + DataType = datDateTime + end + item + Name = 'ShipVia' + DataType = datInteger + end + item + Name = 'Freight' + DataType = datFloat + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + end> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = rdaorders + MasterSource = dsCustomers + MasterRequestMappings.Strings = ( + 'CustomerID=CustomerID') + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Orders' + IndexDefs = <> + Left = 192 + Top = 120 + end + object dsOrders: TDADataSource + DataTable = dtOrders + Left = 208 + Top = 136 + end + object rdaCustomers: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RORemoteService + GetSchemaCall.MethodName = 'GetSchema' + GetSchemaCall.Params = < + item + Name = 'aFilter' + DataType = rtString + Flag = fIn + end + item + Name = 'Result' + DataType = rtString + Flag = fResult + end> + GetSchemaCall.Default = False + GetSchemaCall.IncomingSchemaParameter = 'Result' + GetSchemaCall.OutgoingFilterParameter = 'aFilter' + GetDataCall.RemoteService = RORemoteService + GetDataCall.MethodName = 'GetCustomers' + GetDataCall.Params = < + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end> + GetDataCall.Default = False + GetDataCall.IncomingDataParameter = 'Result' + UpdateDataCall.RemoteService = RORemoteService + UpdateDataCall.MethodName = 'UpdateCustomers' + UpdateDataCall.Params = < + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end + item + Name = 'IncomingData' + DataType = rtBinary + Flag = fIn + Value = Null + end> + UpdateDataCall.Default = False + UpdateDataCall.OutgoingDeltaParameter = 'IncomingData' + UpdateDataCall.IncomingDeltaParameter = 'Result' + GetScriptsCall.RemoteService = RORemoteService + RemoteService = RORemoteService + DataStreamer = bdsCustomers + Left = 278 + Top = 48 + end + object rdaorders: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RORemoteService + GetSchemaCall.MethodName = 'GetSchema' + GetSchemaCall.Params = < + item + Name = 'aFilter' + DataType = rtString + Flag = fIn + end + item + Name = 'Result' + DataType = rtString + Flag = fResult + end> + GetSchemaCall.Default = False + GetSchemaCall.IncomingSchemaParameter = 'Result' + GetSchemaCall.OutgoingFilterParameter = 'aFilter' + GetDataCall.RemoteService = RORemoteService + GetDataCall.MethodName = 'GetOrders' + GetDataCall.Params = < + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end + item + Name = 'CustomerID' + DataType = rtString + Flag = fIn + Value = Null + end> + GetDataCall.Default = False + GetDataCall.IncomingDataParameter = 'Result' + GetDataCall.OutgoingParamsParameter = 'CustomerID' + UpdateDataCall.RemoteService = RORemoteService + UpdateDataCall.MethodName = 'UpdateCustomers' + UpdateDataCall.Params = < + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + Value = Null + end + item + Name = 'IncomingData' + DataType = rtBinary + Flag = fIn + Value = Null + end> + UpdateDataCall.Default = False + UpdateDataCall.OutgoingDeltaParameter = 'IncomingData' + UpdateDataCall.IncomingDeltaParameter = 'Result' + GetScriptsCall.RemoteService = RORemoteService + RemoteService = RORemoteService + DataStreamer = bdsOrders + Left = 277 + Top = 141 + end + object bdsOrders: TDABinDataStreamer + Left = 306 + Top = 141 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientData.pas new file mode 100644 index 0000000..936f947 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientData.pas @@ -0,0 +1,83 @@ +unit QuantumGrid4_ClientData; + +interface + +uses {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABINAdapter, + uDACDSDataTable, uDAADODataTable, uDAScriptingProvider, + uDARemoteDataAdapter, uDADataStreamer, uDAInterfaces; + +type + TQuantumGrid4_ClientDataModule = class(TDataModule) + ROMessage: TROBinMessage; + ROChannel: TROWinInetHTTPChannel; + RORemoteService: TRORemoteService; + bdsCustomers: TDABinDataStreamer; + dtCustomers: TDACDSDataTable; + dsCustomers: TDADataSource; + dtOrders: TDACDSDataTable; + dsOrders: TDADataSource; + rdaCustomers: TDARemoteDataAdapter; + rdaorders: TDARemoteDataAdapter; + bdsOrders: TDABinDataStreamer; + procedure dtCustomersAfterScroll(DataTable: TDADataTable); + procedure dtCustomersAfterOpen(DataTable: TDADataTable); + private + fFetchedCustomers : TStringList; + + public + constructor Create(aOwner : TComponent); override; + destructor Destroy; override; + end; + +var + QuantumGrid4_ClientDataModule: TQuantumGrid4_ClientDataModule; + +implementation + + +{$R *.dfm} + +{ TClientDataModule } +constructor TQuantumGrid4_ClientDataModule.Create(aOwner: TComponent); +begin + inherited; + + fFetchedCustomers := TStringList.Create; + fFetchedCustomers.Sorted := TRUE; +end; + +destructor TQuantumGrid4_ClientDataModule.Destroy; +begin + fFetchedCustomers.Free; + inherited; +end; + +procedure TQuantumGrid4_ClientDataModule.dtCustomersAfterScroll( + DataTable: TDADataTable); +var lCustomerID : string; +begin + if dtCustomers.Fetching then Exit; + + with dtOrders do begin + lCustomerID := dtCustomers.FieldByName('CustomerID').AsString; + + if (fFetchedCustomers.IndexOf(lCustomerID)>=0) + then Exit + else fFetchedCustomers.Add(lCustomerID); + + rdaorders.GetDataCall.ParamByName('CustomerID').AsString := lCustomerID; + LoadFromRemoteSource; + end; +end; + +procedure TQuantumGrid4_ClientDataModule.dtCustomersAfterOpen(DataTable: TDADataTable); +begin + fFetchedCustomers.Clear; + dtCustomersAfterScroll(DataTable); +end; + +initialization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientMain.dfm new file mode 100644 index 0000000..f61ea94 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientMain.dfm @@ -0,0 +1,186 @@ +object QuantumGrid4_ClientMainForm: TQuantumGrid4_ClientMainForm + Left = 125 + Top = 83 + AutoScroll = False + BorderWidth = 5 + Caption = 'QuantumGrid 4 Client' + ClientHeight = 447 + ClientWidth = 506 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object PageControl: TPageControl + Left = 0 + Top = 33 + Width = 506 + Height = 414 + ActivePage = TabSheet2 + Align = alClient + TabIndex = 0 + TabOrder = 0 + object TabSheet2: TTabSheet + Caption = 'Quantum Grid 4 - OnDemand' + ImageIndex = 1 + object cxGrid1: TcxGrid + Left = 0 + Top = 0 + Width = 498 + Height = 261 + Align = alClient + TabOrder = 0 + LookAndFeel.Kind = lfFlat + object viewCustomers: TcxGridDBTableView + NavigatorButtons.ConfirmDelete = False + DataController.DataSource = QuantumGrid4_ClientDataModule.dsCustomers + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + object viewCustomersCustomerID: TcxGridDBColumn + DataBinding.FieldName = 'CustomerID' + end + object viewCustomersCompanyName: TcxGridDBColumn + DataBinding.FieldName = 'CompanyName' + end + object viewCustomersContactName: TcxGridDBColumn + DataBinding.FieldName = 'ContactName' + end + object viewCustomersContactTitle: TcxGridDBColumn + DataBinding.FieldName = 'ContactTitle' + end + object viewCustomersAddress: TcxGridDBColumn + DataBinding.FieldName = 'Address' + end + object viewCustomersCity: TcxGridDBColumn + DataBinding.FieldName = 'City' + end + object viewCustomersRegion: TcxGridDBColumn + DataBinding.FieldName = 'Region' + end + object viewCustomersPostalCode: TcxGridDBColumn + DataBinding.FieldName = 'PostalCode' + end + object viewCustomersCountry: TcxGridDBColumn + DataBinding.FieldName = 'Country' + end + object viewCustomersPhone: TcxGridDBColumn + DataBinding.FieldName = 'Phone' + end + object viewCustomersFax: TcxGridDBColumn + DataBinding.FieldName = 'Fax' + end + end + object viewOrders: TcxGridDBTableView + NavigatorButtons.ConfirmDelete = False + DataController.DataSource = QuantumGrid4_ClientDataModule.dsOrders + DataController.DetailKeyFieldNames = 'CustomerID' + DataController.KeyFieldNames = 'OrderID' + DataController.MasterKeyFieldNames = 'CustomerID' + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + object viewOrdersOrderID: TcxGridDBColumn + DataBinding.FieldName = 'OrderID' + end + object viewOrdersCustomerID: TcxGridDBColumn + DataBinding.FieldName = 'CustomerID' + end + object viewOrdersEmployeeID: TcxGridDBColumn + DataBinding.FieldName = 'EmployeeID' + end + object viewOrdersOrderDate: TcxGridDBColumn + DataBinding.FieldName = 'OrderDate' + end + object viewOrdersRequiredDate: TcxGridDBColumn + DataBinding.FieldName = 'RequiredDate' + end + object viewOrdersShippedDate: TcxGridDBColumn + DataBinding.FieldName = 'ShippedDate' + end + object viewOrdersShipVia: TcxGridDBColumn + DataBinding.FieldName = 'ShipVia' + end + object viewOrdersFreight: TcxGridDBColumn + DataBinding.FieldName = 'Freight' + end + object viewOrdersShipName: TcxGridDBColumn + DataBinding.FieldName = 'ShipName' + end + object viewOrdersShipAddress: TcxGridDBColumn + DataBinding.FieldName = 'ShipAddress' + end + object viewOrdersShipCity: TcxGridDBColumn + DataBinding.FieldName = 'ShipCity' + end + object viewOrdersShipRegion: TcxGridDBColumn + DataBinding.FieldName = 'ShipRegion' + end + object viewOrdersShipPostalCode: TcxGridDBColumn + DataBinding.FieldName = 'ShipPostalCode' + end + object viewOrdersShipCountry: TcxGridDBColumn + DataBinding.FieldName = 'ShipCountry' + end + end + object cxGrid1Level1: TcxGridLevel + GridView = viewCustomers + object cxGrid1Level2: TcxGridLevel + GridView = viewOrders + end + end + end + object DBGrid3: TDBGrid + Left = 0 + Top = 266 + Width = 498 + Height = 120 + Align = alBottom + DataSource = QuantumGrid4_ClientDataModule.dsOrders + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel2: TPanel + Left = 0 + Top = 261 + Width = 498 + Height = 5 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + end + end + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 506 + Height = 33 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Button1: TButton + Left = 80 + Top = 0 + Width = 97 + Height = 25 + Caption = 'Apply Updates' + TabOrder = 0 + OnClick = Button1Click + end + object Button2: TButton + Left = 0 + Top = 0 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 1 + OnClick = Button2Click + end + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientMain.pas new file mode 100644 index 0000000..13e8065 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ClientMain.pas @@ -0,0 +1,81 @@ +unit QuantumGrid4_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROIndyHTTPChannel, + Grids, DBGrids, ComCtrls, cxStyles, cxCustomData, cxGraphics, cxFilter, + cxData, cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxClasses, + cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView, + cxGridDBTableView, cxGrid, ExtCtrls, DBClient; + +type + TQuantumGrid4_ClientMainForm = class(TForm) + PageControl: TPageControl; + TabSheet2: TTabSheet; + viewCustomers: TcxGridDBTableView; + cxGrid1Level1: TcxGridLevel; + cxGrid1: TcxGrid; + viewOrders: TcxGridDBTableView; + viewCustomersCustomerID: TcxGridDBColumn; + viewCustomersCompanyName: TcxGridDBColumn; + viewCustomersContactName: TcxGridDBColumn; + viewCustomersContactTitle: TcxGridDBColumn; + viewCustomersAddress: TcxGridDBColumn; + viewCustomersCity: TcxGridDBColumn; + viewCustomersRegion: TcxGridDBColumn; + viewCustomersPostalCode: TcxGridDBColumn; + viewCustomersCountry: TcxGridDBColumn; + viewCustomersPhone: TcxGridDBColumn; + viewCustomersFax: TcxGridDBColumn; + Panel1: TPanel; + Button1: TButton; + Button2: TButton; + viewOrdersOrderID: TcxGridDBColumn; + viewOrdersCustomerID: TcxGridDBColumn; + viewOrdersEmployeeID: TcxGridDBColumn; + viewOrdersOrderDate: TcxGridDBColumn; + viewOrdersRequiredDate: TcxGridDBColumn; + viewOrdersShippedDate: TcxGridDBColumn; + viewOrdersShipVia: TcxGridDBColumn; + viewOrdersFreight: TcxGridDBColumn; + viewOrdersShipName: TcxGridDBColumn; + viewOrdersShipAddress: TcxGridDBColumn; + viewOrdersShipCity: TcxGridDBColumn; + viewOrdersShipRegion: TcxGridDBColumn; + viewOrdersShipPostalCode: TcxGridDBColumn; + viewOrdersShipCountry: TcxGridDBColumn; + cxGrid1Level2: TcxGridLevel; + DBGrid3: TDBGrid; + Panel2: TPanel; + procedure Button2Click(Sender: TObject); + procedure Button1Click(Sender: TObject); + private + fLastMaster: Variant; + public + + end; + +var + QuantumGrid4_ClientMainForm: TQuantumGrid4_ClientMainForm; + +implementation + +uses QuantumGrid4_ClientData, uDAInterfaces, uDADataTable; + +{$R *.dfm} + +procedure TQuantumGrid4_ClientMainForm.Button2Click(Sender: TObject); +begin + with QuantumGrid4_ClientDataModule.dtCustomers do + Active := Active xor TRUE; +end; + +procedure TQuantumGrid4_ClientMainForm.Button1Click(Sender: TObject); +begin + QuantumGrid4_ClientDataModule.dtCustomers.ApplyUpdates(TRUE); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerData.dfm new file mode 100644 index 0000000..af93c08 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerData.dfm @@ -0,0 +1,54 @@ +object QuantumGrid4_ServerDataModule: TQuantumGrid4_ServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 73 + Top = 69 + Height = 207 + Width = 352 + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 32 + Top = 8 + end + object ROMessage: TROBinMessage + Left = 34 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerData.pas new file mode 100644 index 0000000..f624b32 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerData.pas @@ -0,0 +1,38 @@ +unit QuantumGrid4_ServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDADriverManager, uDAClasses, uDADBXDriver, uDAIBXDriver, uDAEngine, uDAADODriver, + uROIndyTCPServer; + +type + TQuantumGrid4_ServerDataModule = class(TDataModule) + ROServer: TROIndyHTTPServer; + ROMessage: TROBinMessage; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + ConnectionManager: TDAConnectionManager; + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + QuantumGrid4_ServerDataModule: TQuantumGrid4_ServerDataModule; + +implementation + +{$R *.dfm} + +procedure TQuantumGrid4_ServerDataModule.DataModuleCreate(Sender: TObject); +begin + ROServer.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerMain.dfm new file mode 100644 index 0000000..ff5e505 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerMain.dfm @@ -0,0 +1,21 @@ +object QuantumGrid4_ServerMainForm: TQuantumGrid4_ServerMainForm + Left = 66 + Top = 76 + BorderStyle = bsDialog + Caption = 'QuantumGrid 4 Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerMain.pas new file mode 100644 index 0000000..a70c5a0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_ServerMain.pas @@ -0,0 +1,26 @@ +unit QuantumGrid4_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer; + +type + TQuantumGrid4_ServerMainForm = class(TForm) + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + QuantumGrid4_ServerMainForm: TQuantumGrid4_ServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.bdsproj new file mode 100644 index 0000000..862243b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + QuantumGrid4_server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.dpr new file mode 100644 index 0000000..de173a0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.dpr @@ -0,0 +1,23 @@ +program QuantumGrid4_server; + +{#ROGEN:QuantumGrid4Library.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + QuantumGrid4_ServerMain in 'QuantumGrid4_ServerMain.pas' {QuantumGrid4_ServerMainForm}, + NewService_Impl in 'NewService_Impl.pas' {NewService: TDARemoteService}, + QuantumGrid4_ServerData in 'QuantumGrid4_ServerData.pas' {QuantumGrid4_ServerDataModule: TDataModule}, + QuantumGrid4Library_Intf in 'QuantumGrid4Library_Intf.pas', + QuantumGrid4Library_Invk in 'QuantumGrid4Library_Invk.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'QuantumGrid4 Server'; + Application.CreateForm(TQuantumGrid4_ServerDataModule, QuantumGrid4_ServerDataModule); + Application.CreateForm(TQuantumGrid4_ServerMainForm, QuantumGrid4_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.dproj new file mode 100644 index 0000000..11b11c4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.dproj @@ -0,0 +1,80 @@ + + + {540b874b-c44a-4832-b75a-f3873582e77c} + QuantumGrid4_server.dpr + Debug + AnyCPU + DCC32 + QuantumGrid4_server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + QuantumGrid4_server.dpr + + + + + + + MainSource + + +
NewService
+
+ + + +
QuantumGrid4_ServerDataModule
+
+ +
QuantumGrid4_ServerMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/QuantumGrid4_server.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/RODLFILE.res new file mode 100644 index 0000000..66470ea Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/QuantumGrid 4/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.Sample.html new file mode 100644 index 0000000..8b2f535 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.Sample.html @@ -0,0 +1,30 @@ + + + + + + + + + +

+ QuickOpen +

+ + +

Purpose

+ +

+ This example shows how to receive data from a local database. +

+ +

Examine the Code

+ + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.bdsproj new file mode 100644 index 0000000..143c7d8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + QuickOpen.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.dpr new file mode 100644 index 0000000..02aced4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.dpr @@ -0,0 +1,14 @@ +program QuickOpen; + +uses + Forms, + QuickOpenMain in 'QuickOpenMain.pas' {QuickOpenMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'QuickOpen'; + Application.CreateForm(TQuickOpenMainForm, QuickOpenMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.dproj new file mode 100644 index 0000000..a6ad6ef --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.dproj @@ -0,0 +1,72 @@ + + + {b3f06429-5ddc-4ac4-8f56-ce4275c9a145} + QuickOpen.dpr + Debug + AnyCPU + DCC32 + QuickOpen.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + QuickOpen.dpr + + + + + + + MainSource + + +
QuickOpenMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.res new file mode 100644 index 0000000..b946fbb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpen.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpenMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpenMain.dfm new file mode 100644 index 0000000..3726ac6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpenMain.dfm @@ -0,0 +1,291 @@ +object QuickOpenMainForm: TQuickOpenMainForm + Left = 116 + Top = 122 + AutoScroll = False + Caption = 'Quick Open' + ClientHeight = 311 + ClientWidth = 539 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object OpenButton: TButton + Left = 8 + Top = 8 + Width = 75 + Height = 25 + Caption = 'Open' + TabOrder = 0 + OnClick = OpenButtonClick + end + object DBGrid1: TDBGrid + Left = 8 + Top = 40 + Width = 523 + Height = 269 + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = dsCustomers + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DADriverManager1: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 12 + Top = 11 + end + object DASchema1: TDASchema + ConnectionManager = DAConnectionManager1 + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 45 + Top = 11 + end + object DAConnectionManager1: TDAConnectionManager + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DADriverManager1 + PoolingEnabled = True + Left = 76 + Top = 11 + end + object DAADODriver1: TDAADODriver + Left = 109 + Top = 11 + end + object DataTable: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + LocalSchema = DASchema1 + LocalDataStreamer = DABINAdapter + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 140 + Top = 11 + end + object dsCustomers: TDADataSource + DataSet = DataTable.Dataset + DataTable = DataTable + Left = 156 + Top = 27 + end + object DABINAdapter: TDABinDataStreamer + Left = 192 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpenMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpenMain.pas new file mode 100644 index 0000000..5a4bba5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Quick Open/QuickOpenMain.pas @@ -0,0 +1,41 @@ +unit QuickOpenMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, DB, uDADataTable, uDACDSDataTable, uDAEngine, uDAADODriver, + uDAClasses, uDADriverManager, uDABINAdapter, Grids, DBGrids, StdCtrls, + uDAScriptingProvider, uDADataStreamer; + +type + TQuickOpenMainForm = class(TForm) + DADriverManager1: TDADriverManager; + DAADODriver1: TDAADODriver; + DataTable: TDACDSDataTable; + dsCustomers: TDADataSource; + DAConnectionManager1: TDAConnectionManager; + OpenButton: TButton; + DBGrid1: TDBGrid; + DABINAdapter: TDABinDataStreamer; + DASchema1: TDASchema; + procedure OpenButtonClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + QuickOpenMainForm: TQuickOpenMainForm; + +implementation + +{$R *.dfm} + +procedure TQuickOpenMainForm.OpenButtonClick(Sender: TObject); +begin + DataTable.Open; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/RODLFILE.res new file mode 100644 index 0000000..ef86df7 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.bdsproj new file mode 100644 index 0000000..7605f2b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.bdsproj @@ -0,0 +1,170 @@ + + + + + + + + + + + + ReducedDeltaClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.dpr new file mode 100644 index 0000000..69a8de0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.dpr @@ -0,0 +1,17 @@ +program ReducedDeltaClient; + +uses + uROComInit, + Forms, + MidasLib, + ReducedDeltaClientMain in 'ReducedDeltaClientMain.pas' {ReducedDeltaClientMainForm}, + ReducedDeltaClientData in 'ReducedDeltaClientData.pas' {ReducedDeltaClientDataModule: TDAClientDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TReducedDeltaClientDataModule, ReducedDeltaClientDataModule); + Application.CreateForm(TReducedDeltaClientMainForm, ReducedDeltaClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.dproj new file mode 100644 index 0000000..fdb2504 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.dproj @@ -0,0 +1,213 @@ + + + {f18f6eda-6e59-4bb6-95e0-7940cb0b9f70} + ReducedDeltaClient.dpr + Debug + AnyCPU + DCC32 + ReducedDeltaClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Core Lab Data Access GUI related Components + Core Lab Data Access Components + Data Access Components for MySQL + MySQL Data Access GUI related Components + Oracle Data Access Components + Oracle Data Access GUI related Components + SQL Server Data Access Components + SQL Server Data Access GUI related Components + RemObjects Data Abstract - InterBase Express Driver + RemObjects Data Abstract - Scripting Integration Library + RemObjects Data Abstract - dbExpress Driver + RemObjects Data Abstract - SQLite Driver + RemObjects Data Abstract - DBISAM Driver + RemObjects Data Abstract - ElevateDB Driver + RemObjects Data Abstract - FIBPlus Driver + RemObjects Data Abstract - CoreLabs IBDAC Driver + RemObjects Data Abstract - CoreLabs MyDAC Driver + Data Abstract - NexusDB Driver + RemObjects Data Abstract - CoreLabs ODAC Driver + RemObjects Data Abstract - MicroOlap PostgresDAC Driver + RemObjects Data Abstract - 'Rosetta' + RemObjects Data Abstract - CoreLabs SDAC Driver + CodeGear C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + Core Lab InterBase Data Access Components + Data Access Components for MySQL - TMySQLMonitor + + + ReducedDeltaClient.dpr + + + + + + + MainSource + + +
ReducedDeltaClientDataModule
+ TDAClientDataModule +
+ +
ReducedDeltaClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.res new file mode 100644 index 0000000..a8142cb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientData.dfm new file mode 100644 index 0000000..29f9713 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientData.dfm @@ -0,0 +1,117 @@ +object ReducedDeltaClientDataModule: TReducedDeltaClientDataModule + OldCreateOrder = True + Left = 439 + Top = 220 + Height = 300 + Width = 300 + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object Message: TROBinMessage + Left = 40 + Top = 52 + end + object RemoteService: TRORemoteService + Message = Message + Channel = Channel + ServiceName = 'ReducedDeltaService' + Left = 40 + Top = 96 + end + object DataStreamer: TDABin2DataStreamer + Left = 40 + Top = 140 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetDataCall.RemoteService = RemoteService + UpdateDataCall.RemoteService = RemoteService + GetScriptsCall.RemoteService = RemoteService + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 40 + Top = 184 + end + object tbl_Customers: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + Required = True + InPrimaryKey = True + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + Required = True + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + end + item + Name = 'City' + DataType = datWideString + Size = 15 + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 128 + Top = 120 + end + object ds_Customers: TDADataSource + DataSet = tbl_Customers.Dataset + DataTable = tbl_Customers + Left = 136 + Top = 128 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientData.pas new file mode 100644 index 0000000..80a5419 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientData.pas @@ -0,0 +1,33 @@ +unit ReducedDeltaClientData; + +interface + +uses + {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + {Data Abstract:} uDADataTable, uDABin2DataStreamer, uDAInterfaces, uDARemoteDataAdapter, + uDAScriptingProvider, uDAMemDataTable, uDADataStreamer; + +type + TReducedDeltaClientDataModule = class(TDataModule) + Message: TROBinMessage; + Channel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + DataStreamer: TDABin2DataStreamer; + RemoteDataAdapter: TDARemoteDataAdapter; + tbl_Customers: TDAMemDataTable; + ds_Customers: TDADataSource; + private + { Private declarations } + public + { Public declarations } + end; + +var + ReducedDeltaClientDataModule: TReducedDeltaClientDataModule; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientMain.dfm new file mode 100644 index 0000000..51be292 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientMain.dfm @@ -0,0 +1,56 @@ +object ReducedDeltaClientMainForm: TReducedDeltaClientMainForm + Left = 106 + Top = 100 + AutoScroll = False + Caption = 'Reduced Delta Client' + ClientHeight = 381 + ClientWidth = 640 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object OpenButton: TButton + Left = 8 + Top = 8 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 0 + OnClick = OpenButtonClick + end + object ApplyButton: TButton + Left = 88 + Top = 8 + Width = 75 + Height = 25 + Caption = 'ApplyUpdate' + TabOrder = 1 + OnClick = ApplyButtonClick + end + object DBGrid1: TDBGrid + Left = 8 + Top = 40 + Width = 624 + Height = 331 + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = ReducedDeltaClientDataModule.ds_Customers + TabOrder = 2 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object cbReducedDelta: TCheckBox + Left = 184 + Top = 12 + Width = 161 + Height = 17 + Caption = 'Send Reduced Delta' + TabOrder = 3 + OnClick = cbReducedDeltaClick + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientMain.pas new file mode 100644 index 0000000..9698592 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaClientMain.pas @@ -0,0 +1,56 @@ +unit ReducedDeltaClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, Grids, DBGrids; + +type + TReducedDeltaClientMainForm = class(TForm) + OpenButton: TButton; + ApplyButton: TButton; + DBGrid1: TDBGrid; + cbReducedDelta: TCheckBox; + procedure FormCreate(Sender: TObject); + procedure cbReducedDeltaClick(Sender: TObject); + procedure OpenButtonClick(Sender: TObject); + procedure ApplyButtonClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ReducedDeltaClientMainForm: TReducedDeltaClientMainForm; + +implementation + +uses + ReducedDeltaClientData, uDABin2DataStreamer, uDADataTable; + +{$R *.dfm} + +procedure TReducedDeltaClientMainForm.FormCreate(Sender: TObject); +begin + cbReducedDelta.Checked:= ReducedDeltaClientDataModule.DataStreamer.SendReducedDelta; +end; + +procedure TReducedDeltaClientMainForm.cbReducedDeltaClick(Sender: TObject); +begin + ReducedDeltaClientDataModule.DataStreamer.SendReducedDelta := cbReducedDelta.Checked; +end; + +procedure TReducedDeltaClientMainForm.OpenButtonClick(Sender: TObject); +begin + with ReducedDeltaClientDataModule.tbl_Customers do + Active := not Active; +end; + +procedure TReducedDeltaClientMainForm.ApplyButtonClick(Sender: TObject); +begin + ReducedDeltaClientDataModule.tbl_Customers.ApplyUpdates; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.Sample.html new file mode 100644 index 0000000..37f63f3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.Sample.html @@ -0,0 +1,30 @@ + + + + + + + + +
+

+ Reduced Delta Sample +

+ +
+

Purpose

+

+ This example illustrates how work the Send Reduced Delta property of TDABin2DataStreamer.

+

+ +

Getting Started

+ + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.bdsgroup new file mode 100644 index 0000000..943164e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + ReducedDeltaServer.bdsproj + ReducedDeltaClient.bdsproj + ReducedDeltaServer.exe ReducedDeltaClient.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.bpg new file mode 100644 index 0000000..c915246 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = ReducedDeltaServer.exe ReducedDeltaClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +ReducedDeltaServer.exe: ReducedDeltaServer.dpr + $(DCC) + +ReducedDeltaClient.exe: ReducedDeltaClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.groupproj new file mode 100644 index 0000000..cfa0c0c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaGroup.groupproj @@ -0,0 +1,44 @@ + + + {87fced28-a095-43cf-8e27-297b881ebb84} + + + + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaLibrary.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaLibrary.rodl new file mode 100644 index 0000000..50315bf --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaLibrary.rodl @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaLibrary_Intf.pas new file mode 100644 index 0000000..7aef22b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaLibrary_Intf.pas @@ -0,0 +1,82 @@ +unit ReducedDeltaLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{786E8771-A3CB-4F96-9FE4-E16120755985}'; + TargetNamespace = ''; + + { Service Interface ID's } + IReducedDeltaService_IID : TGUID = '{0391158F-E776-481E-91F1-45BF69296552}'; + + { Event ID's } + +type + { Forward declarations } + IReducedDeltaService = interface; + + + + + + { Enumerateds } + + { IReducedDeltaService } + IReducedDeltaService = interface(IDataAbstractService) + ['{0391158F-E776-481E-91F1-45BF69296552}'] + end; + + { CoReducedDeltaService } + CoReducedDeltaService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IReducedDeltaService; + end; + + { TReducedDeltaService_Proxy } + TReducedDeltaService_Proxy = class(TDataAbstractService_Proxy, IReducedDeltaService) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoReducedDeltaService } + +class function CoReducedDeltaService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IReducedDeltaService; +begin + result := TReducedDeltaService_Proxy.Create(aMessage, aTransportChannel); +end; + +function TReducedDeltaService_Proxy.__GetInterfaceName:string; +begin + result := 'ReducedDeltaService'; +end; + +initialization + RegisterProxyClass(IReducedDeltaService_IID, TReducedDeltaService_Proxy); + + +finalization + UnregisterProxyClass(IReducedDeltaService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaLibrary_Invk.pas new file mode 100644 index 0000000..fb750af --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaLibrary_Invk.pas @@ -0,0 +1,35 @@ +unit ReducedDeltaLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} ReducedDeltaLibrary_Intf; + +type + TReducedDeltaService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.bdsproj new file mode 100644 index 0000000..d8eb929 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.bdsproj @@ -0,0 +1,170 @@ + + + + + + + + + + + + ReducedDeltaServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.dpr new file mode 100644 index 0000000..bdf52ff --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.dpr @@ -0,0 +1,29 @@ +program ReducedDeltaServer; + +{#ROGEN:ReducedDeltaLibrary.RODL} // RemObjects SDK: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + ReducedDeltaServerMain in 'ReducedDeltaServerMain.pas' {ReducedDeltaServerMainForm}, + ReducedDeltaServerData in 'ReducedDeltaServerData.pas' {ReducedDeltaServerDataModule: TDataModule}, + ReducedDeltaLibrary_Intf in 'ReducedDeltaLibrary_Intf.pas', + ReducedDeltaLibrary_Invk in 'ReducedDeltaLibrary_Invk.pas', + ReducedDeltaService_Impl in 'ReducedDeltaService_Impl.pas' {ReducedDeltaService: TDataAbstractService}; + +{$R *.res} +{$R RODLFile.res} + +begin + if ROStartService('ReducedDelta', 'ReducedDelta') then begin + ROService.CreateForm(TReducedDeltaServerDataModule, ReducedDeltaServerDataModule); + ROService.Run; + Exit; + end; + + Application.Initialize; + Application.CreateForm(TReducedDeltaServerDataModule, ReducedDeltaServerDataModule); + Application.CreateForm(TReducedDeltaServerMainForm, ReducedDeltaServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.dproj new file mode 100644 index 0000000..2035cde --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.dproj @@ -0,0 +1,219 @@ + + + {eb6011e9-a892-4c76-bd07-170bbf6e5921} + ReducedDeltaServer.dpr + Debug + AnyCPU + DCC32 + ReducedDeltaServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Core Lab Data Access GUI related Components + Core Lab Data Access Components + Data Access Components for MySQL + MySQL Data Access GUI related Components + Oracle Data Access Components + Oracle Data Access GUI related Components + SQL Server Data Access Components + SQL Server Data Access GUI related Components + RemObjects Data Abstract - InterBase Express Driver + RemObjects Data Abstract - Scripting Integration Library + RemObjects Data Abstract - dbExpress Driver + RemObjects Data Abstract - SQLite Driver + RemObjects Data Abstract - DBISAM Driver + RemObjects Data Abstract - ElevateDB Driver + RemObjects Data Abstract - FIBPlus Driver + RemObjects Data Abstract - CoreLabs IBDAC Driver + RemObjects Data Abstract - CoreLabs MyDAC Driver + Data Abstract - NexusDB Driver + RemObjects Data Abstract - CoreLabs ODAC Driver + RemObjects Data Abstract - MicroOlap PostgresDAC Driver + RemObjects Data Abstract - 'Rosetta' + RemObjects Data Abstract - CoreLabs SDAC Driver + CodeGear C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + Core Lab InterBase Data Access Components + Data Access Components for MySQL - TMySQLMonitor + + + ReducedDeltaServer.dpr + + + + + + + MainSource + + + + +
ReducedDeltaServerDataModule
+ TDataModule +
+ +
ReducedDeltaServerMainForm
+
+ +
ReducedDeltaService
+ TDataAbstractService +
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerData.dfm new file mode 100644 index 0000000..d7dc73d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerData.dfm @@ -0,0 +1,65 @@ +object ReducedDeltaServerDataModule: TReducedDeltaServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 362 + Top = 208 + Height = 207 + Width = 352 + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + OnReadFromStream = ServerReadFromStream + Port = 8099 + Left = 32 + Top = 8 + end + object Message: TROBinMessage + Left = 32 + Top = 56 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Int' + + 'egrated Security=SSPI' + Description = 'Microsoft SQL Server 2000, localhost' + ConnectionType = 'MSSQL' + Default = True + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 136 + Top = 56 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 136 + Top = 10 + end + object ADODriver: TDAADODriver + Left = 256 + Top = 8 + end + object IBXDriver: TDAIBXDriver + Left = 256 + Top = 56 + end + object DataDictionary: TDADataDictionary + Fields = <> + Left = 32 + Top = 104 + end + object SessionManager: TROInMemorySessionManager + Left = 136 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerData.pas new file mode 100644 index 0000000..9695997 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerData.pas @@ -0,0 +1,50 @@ +unit ReducedDeltaServerData; + +interface + +uses + SysUtils, Classes, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, + uDAEngine, uDADriverManager, uDAClasses, uROSessions, + uDAIBXDriver, uDAADODriver, uROIndyTCPServer; + +type + TReducedDeltaServerDataModule = class(TDataModule) + Server: TROIndyHTTPServer; + Message: TROBinMessage; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + IBXDriver: TDAIBXDriver; + SessionManager: TROInMemorySessionManager; + DataDictionary: TDADataDictionary; + + procedure DataModuleCreate(Sender: TObject); + procedure ServerReadFromStream(aStream: TStream); + private + { Private declarations } + public + { Public declarations } + end; + +var + ReducedDeltaServerDataModule: TReducedDeltaServerDataModule; + +implementation +uses ReducedDeltaServerMain; + +{$R *.dfm} + +procedure TReducedDeltaServerDataModule.DataModuleCreate(Sender: TObject); +begin + Server.Active := true; +end; + +procedure TReducedDeltaServerDataModule.ServerReadFromStream( + aStream: TStream); +begin + ReducedDeltaServerMainForm.Log('StreamSize = '+IntToStr(aStream.Size)); +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerMain.dfm new file mode 100644 index 0000000..36f36e9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerMain.dfm @@ -0,0 +1,48 @@ +object ReducedDeltaServerMainForm: TReducedDeltaServerMainForm + Left = 79 + Top = 109 + AutoScroll = False + Caption = 'Reduced Delta Server' + ClientHeight = 364 + ClientWidth = 639 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 213 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Memo: TMemo + Left = 8 + Top = 64 + Width = 622 + Height = 292 + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ScrollBars = ssBoth + TabOrder = 0 + end + object Button1: TButton + Left = 555 + Top = 32 + Width = 75 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Clear' + TabOrder = 1 + OnClick = Button1Click + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerMain.pas new file mode 100644 index 0000000..1b012ab --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaServerMain.pas @@ -0,0 +1,64 @@ +unit ReducedDeltaServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton; + +type + TReducedDeltaServerMainForm = class(TForm) + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + Memo: TMemo; + Button1: TButton; + procedure Button1Click(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + { Private declarations } + sync: TMultiReadExclusiveWriteSynchronizer; + public + { Public declarations } + Procedure Log(const str: String); + end; + +var + ReducedDeltaServerMainForm: TReducedDeltaServerMainForm; + +implementation + +{$R *.dfm} + +{ TReducedDeltaServerMainForm } + +procedure TReducedDeltaServerMainForm.Log(const str: String); +begin + sync.BeginWrite; + try + Memo.Lines.Add(str); + finally + sync.EndWrite; + end; +end; + +procedure TReducedDeltaServerMainForm.Button1Click(Sender: TObject); +begin + sync.BeginWrite; + try + Memo.Clear; + finally + sync.EndWrite; + end; +end; + +procedure TReducedDeltaServerMainForm.FormCreate(Sender: TObject); +begin + sync:= TMultiReadExclusiveWriteSynchronizer.Create; +end; + +procedure TReducedDeltaServerMainForm.FormDestroy(Sender: TObject); +begin + sync.Free; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaService_Impl.dfm new file mode 100644 index 0000000..50d8297 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaService_Impl.dfm @@ -0,0 +1,152 @@ +object ReducedDeltaService: TReducedDeltaService + OldCreateOrder = True + SessionManager = ReducedDeltaServerDataModule.SessionManager + ServiceSchema = Schema + ServiceDataStreamer = DataStreamer + ExportedDataTables = <> + Left = 424 + Top = 208 + Height = 212 + Width = 216 + object Schema: TDASchema + ConnectionManager = ReducedDeltaServerDataModule.ConnectionManager + DataDictionary = ReducedDeltaServerDataModule.DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + ConnectionType = 'MSSQL' + Default = True + TargetTable = 'Customers' + StatementType = stAutoSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + Required = True + InPrimaryKey = True + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + Required = True + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + end + item + Name = 'City' + DataType = datWideString + Size = 15 + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + end> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 32 + Top = 56 + end + object DataStreamer: TDABin2DataStreamer + Left = 32 + Top = 8 + end + object BusinessProcessor: TDABusinessProcessor + OnBeforeProcessChange = BusinessProcessorBeforeProcessChange + Schema = Schema + ReferencedDataset = 'Customers' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete, poAutoGenerateRefreshDataset, poPrepareCommands] + UpdateMode = updWhereKeyOnly + Left = 32 + Top = 104 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaService_Impl.pas new file mode 100644 index 0000000..2d5196b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Reduced Delta/ReducedDeltaService_Impl.pas @@ -0,0 +1,101 @@ +unit ReducedDeltaService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} ReducedDeltaLibrary_Intf, uDAClasses, uDADataStreamer, + uDABin2DataStreamer, uDABusinessProcessor, uDAScriptingProvider, uDADelta, uDAInterfaces; + +type + { TReducedDeltaService } + TReducedDeltaService = class(TDataAbstractService, IReducedDeltaService) + Schema: TDASchema; + DataStreamer: TDABin2DataStreamer; + BusinessProcessor: TDABusinessProcessor; + procedure BusinessProcessorBeforeProcessChange( + Sender: TDABusinessProcessor; aChangeType: TDAChangeType; + aChange: TDADeltaChange; var ProcessChange: Boolean); + private + procedure Log(str: string); + protected + { IReducedDeltaService methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} ReducedDeltaLibrary_Invk,ReducedDeltaServerData, ReducedDeltaServerMain, + Variants; + +procedure Create_ReducedDeltaService(out anInstance : IUnknown); +begin + anInstance := TReducedDeltaService.Create(nil); +end; + +{ TReducedDeltaService } + +procedure TReducedDeltaService.Log(str: string); +begin + ReducedDeltaServerMainForm.Log(str); +end; + +procedure TReducedDeltaService.BusinessProcessorBeforeProcessChange( + Sender: TDABusinessProcessor; aChangeType: TDAChangeType; + aChange: TDADeltaChange; var ProcessChange: Boolean); + + function _VarToStr(const aValue: variant): string; + begin + if VarIsEmpty(aValue) then Result:='' else Result:= VarToStr(aValue); + end; + + function _CreateStr(const aStr: string; const aLen:integer): string; + begin + if Length(aStr) > aLen then + Result:=Copy(aStr,1,aLen-3)+'...' + else + Result:= aStr+ StringOfChar(' ', aLen-Length(aStr)); + end; + +const + TDAChangeTypeStr : array [TDAChangeType] of string = ('Insert','Update','Delete'); + +var + i: integer; +begin + Log('Reduced Delta = '+ BoolToStr(BusinessProcessor.HasReducedDelta,True)); + Log('RecID = '+inttostr(aChange.RecID)+', State = ' + TDAChangeTypeStr[aChangeType]); + for i:=0 to aChange.Delta.LoggedFieldCount-1 do begin + case aChangeType of + ctInsert: Log(_CreateStr(aChange.Delta.LoggedFieldNames[i]+':', 15)+ + _CreateStr('NEW:'+_VarToStr(aChange.OldValues[i]), 35)); + ctUpdate: Log(_CreateStr(aChange.Delta.LoggedFieldNames[i]+':', 15)+ + _CreateStr('OLD:'+_VarToStr(aChange.OldValues[i]), 35)+ + _CreateStr('NEW:'+_VarToStr(aChange.OldValues[i]), 35)); + ctDelete: Log(_CreateStr(aChange.Delta.LoggedFieldNames[i]+':', 15)+ + _CreateStr('OLD:'+_VarToStr(aChange.OldValues[i]), 35)); + end; + end; + Log(''); +end; + +initialization + TROClassFactory.Create('ReducedDeltaService', Create_ReducedDeltaService, TReducedDeltaService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.Sample.html new file mode 100644 index 0000000..410cdc8 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.Sample.html @@ -0,0 +1,30 @@ + + + + + + + + + +

+ Regular Expressions +

+ + +

Purpose

+ +

+ This sample illustrates the support provided for regular expressions.
+

+ +

Examine the Code

+ + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.bdsproj new file mode 100644 index 0000000..f07c865 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + RegularExpressions.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.dpr new file mode 100644 index 0000000..e39f53c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.dpr @@ -0,0 +1,14 @@ +program RegularExpressions; + +uses + Forms, + RegularExpressionsMain in 'RegularExpressionsMain.pas' {RegularExpressionsMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Regular Expressions'; + Application.CreateForm(TRegularExpressionsMainForm, RegularExpressionsMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.dproj new file mode 100644 index 0000000..3a4a572 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.dproj @@ -0,0 +1,72 @@ + + + {bb6ba93f-d097-423b-8543-9afc638ec2c4} + RegularExpressions.dpr + Debug + AnyCPU + DCC32 + RegularExpressions.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + RegularExpressions.dpr + + + + + + + MainSource + + +
RegularExpressionsMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.res new file mode 100644 index 0000000..b946fbb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressions.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressionsMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressionsMain.dfm new file mode 100644 index 0000000..14e1f76 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressionsMain.dfm @@ -0,0 +1,267 @@ +object RegularExpressionsMainForm: TRegularExpressionsMainForm + Left = 15 + Top = 41 + AutoScroll = False + BorderWidth = 5 + Caption = 'Regular Expression' + ClientHeight = 240 + ClientWidth = 740 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Label4: TLabel + Left = 355 + Top = 5 + Width = 242 + Height = 19 + Caption = 'Press a cell of a grid to fill the text' + Font.Charset = DEFAULT_CHARSET + Font.Color = clNavy + Font.Height = -16 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + end + object GroupBox1: TGroupBox + Left = 0 + Top = 0 + Width = 352 + Height = 129 + Caption = 'Test Expression' + TabOrder = 0 + object lbResult: TLabel + Left = 150 + Top = 102 + Width = 183 + Height = 13 + Caption = 'Click the button to verify your input...' + end + object Label1: TLabel + Left = 16 + Top = 20 + Width = 48 + Height = 13 + Caption = 'Template:' + end + object Label2: TLabel + Left = 9 + Top = 44 + Width = 56 + Height = 13 + Caption = 'Expression:' + end + object Label3: TLabel + Left = 39 + Top = 68 + Width = 26 + Height = 13 + Caption = 'Text:' + end + object cbExpression: TComboBox + Left = 68 + Top = 16 + Width = 273 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = cbExpressionChange + end + object eText: TEdit + Left = 68 + Top = 64 + Width = 273 + Height = 21 + TabOrder = 2 + end + object bCheck: TButton + Left = 68 + Top = 96 + Width = 75 + Height = 25 + Caption = '&Check' + Default = True + TabOrder = 3 + OnClick = bCheckClick + end + object eExpression: TEdit + Left = 68 + Top = 40 + Width = 273 + Height = 21 + TabOrder = 1 + end + end + object DBGrid1: TDBGrid + Left = 0 + Top = 136 + Width = 740 + Height = 104 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = DADataSource + ReadOnly = True + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'Tahoma' + TitleFont.Style = [] + OnCellClick = DBGrid1CellClick + Columns = < + item + Expanded = False + FieldName = 'USPhoneNumber' + Width = 100 + Visible = True + end + item + Expanded = False + FieldName = 'Email' + Width = 100 + Visible = True + end + item + Expanded = False + FieldName = 'RealNumber' + Width = 100 + Visible = True + end + item + Expanded = False + FieldName = 'RomanNumber' + Width = 100 + Visible = True + end + item + Expanded = False + FieldName = 'URL' + Width = 100 + Visible = True + end + item + Expanded = False + FieldName = 'ZipCode' + Width = 100 + Visible = True + end + item + Expanded = False + FieldName = 'Path' + Width = 100 + Visible = True + end> + end + object DACDSDataTable: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'USPhoneNumber' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Email' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RealNumber' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RomanNumber' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'URL' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ZipCode' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Path' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + IndexDefs = <> + Left = 411 + Top = 57 + end + object DADataSource: TDADataSource + DataSet = DACDSDataTable.Dataset + DataTable = DACDSDataTable + Left = 427 + Top = 73 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressionsMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressionsMain.pas new file mode 100644 index 0000000..243d144 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Regular Expressions/RegularExpressionsMain.pas @@ -0,0 +1,148 @@ +unit RegularExpressionsMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, DB, uDADataTable, uDACDSDataTable, ExtCtrls, DBCtrls, + Grids, DBGrids, uDAScriptingProvider; + +type + TRegExpressionTemplate = record + Description, + RegExpression: string; + end; + +const + RegExpressionTemplates: array[0..6] of TRegExpressionTemplate = ( + (Description: 'US Phone Number'; RegExpression: '^\d{3}-(\d{2}-\d{2}|\d{4})'), + (Description: 'Email'; RegExpression: '[_a-zA-Z\d\-\.]+@([_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+)'), + (Description: 'Real Number'; RegExpression: '^[+\-]?\d+(\.\d+)?([eE][+\-]?\d+)?$'), + (Description: 'Roman Number'; RegExpression: '^(?i)M*(D?C{0,3}|C[DM])(L?X{0,3}|X[LC])(V?I{0,3}|I[VX])$'), + (Description: 'URL'; RegExpression: '(?i)(FTP|HTTP)://([_a-z\d\-]+(\.[_a-z\d\-]+)+)((/[ _a-z\d\-\\\.]+)+)*'), + (Description: 'ZipCode'; RegExpression: '^\d{5}$'), + (Description: 'Path'; RegExpression: '[A-Za-z]:(\\[a-zA-Z0-9_]+)+')); + +type + TRegularExpressionsMainForm = class(TForm) + GroupBox1: TGroupBox; + cbExpression: TComboBox; + eText: TEdit; + bCheck: TButton; + lbResult: TLabel; + eExpression: TEdit; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + DACDSDataTable: TDACDSDataTable; + DADataSource: TDADataSource; + DBGrid1: TDBGrid; + Label4: TLabel; + procedure bCheckClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure cbExpressionChange(Sender: TObject); + procedure DBGrid1CellClick(Column: TColumn); + private + { Private declarations } + procedure SetupTable; + public + { Public declarations } + end; + +var + RegularExpressionsMainForm: TRegularExpressionsMainForm; + +implementation + +uses uDARegExpr; + +{$R *.dfm} + +procedure TRegularExpressionsMainForm.bCheckClick(Sender: TObject); +begin + if ExecRegExpr(eExpression.Text, eText.Text) then begin + lbResult.Caption := 'The text is valid!' + end + else begin + Beep; + lbResult.Caption := 'The text is INVALID!' + end; +end; + +procedure TRegularExpressionsMainForm.FormCreate(Sender: TObject); +var + i: integer; +begin + for i := 0 to High(RegExpressionTemplates) do + cbExpression.Items.Add(RegExpressionTemplates[i].Description); + cbExpression.ItemIndex := 0; + cbExpressionChange(nil); + SetupTable; +end; + +procedure TRegularExpressionsMainForm.cbExpressionChange(Sender: TObject); +begin + eExpression.Text := RegExpressionTemplates[cbExpression.ItemIndex].RegExpression +end; + +procedure TRegularExpressionsMainForm.DBGrid1CellClick(Column: TColumn); +begin + if (Column.Index >= 0) and (Column.Index < cbExpression.Items.Count) then begin + cbExpression.ItemIndex := Column.Index; + cbExpressionChange(cbExpression); + end; + eText.Text := DACDSDataTable.Fields[Column.Index].AsString; +end; + +procedure TRegularExpressionsMainForm.SetupTable; +begin + with DACDSDataTable do begin + Open; + First; + // valid record + Insert; + FieldByName('USPhoneNumber').AsString := '123-45-67'; + FieldByName('Email').AsString := 'test@test.com'; + FieldByName('RealNumber').AsString := '-12e+10'; + FieldByName('RomanNumber').AsString := 'MCXX'; + FieldByName('URL').AsString := 'http://www.site.com'; + FieldByName('ZipCode').AsString := '12345'; + FieldByName('path').AsString := 'c:\file.exe'; + post; + // invalid + Insert; + FieldByName('USPhoneNumber').AsString := '12-145-67'; + FieldByName('Email').AsString := 'test@testcom'; + FieldByName('RealNumber').AsString := '-12e'; + FieldByName('RomanNumber').AsString := 'MCXX1'; + FieldByName('URL').AsString := 'http:/www.site.com'; + FieldByName('ZipCode').AsString := '23 45'; + FieldByName('path').AsString := '\file.exe'; + post; + // mixed + Insert; + FieldByName('USPhoneNumber').AsString := '101-15-6917'; + FieldByName('Email').AsString := 'test@test.test.com'; + FieldByName('RealNumber').AsString := '-12'; + FieldByName('RomanNumber').AsString := 'IXM'; + FieldByName('URL').AsString := 'www.site.com'; + FieldByName('ZipCode').AsString := '0192'; + FieldByName('path').AsString := 'z:\folder\'; + post; + + // mixed + Insert; + FieldByName('USPhoneNumber').AsString := '101.15.6917'; + FieldByName('Email').AsString := 'test#test.com'; + FieldByName('RealNumber').AsString := '+1212'; + FieldByName('RomanNumber').AsString := 'MCIX'; + FieldByName('URL').AsString := 'http://www.site.com/files/program.zip'; + FieldByName('ZipCode').AsString := '192911'; + FieldByName('path').AsString := 'z:\folder\subfolder\program.exe'; + post; + + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ClientArchive.raf b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ClientArchive.raf new file mode 100644 index 0000000..8cf3638 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ClientArchive.raf differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/DARBService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/DARBService_Impl.dfm new file mode 100644 index 0000000..4475c80 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/DARBService_Impl.dfm @@ -0,0 +1,460 @@ +object DARBService: TDARBService + OldCreateOrder = True + OnActivate = DataAbstractServiceActivate + OnDeactivate = DataAbstractServiceDeactivate + AcquireConnection = True + ServiceSchema = DASchema + ServiceDataStreamer = BinDataStreamer + ExportedDataTables = <> + Left = 345 + Top = 207 + Height = 300 + Width = 300 + object DASchema: TDASchema + ConnectionManager = ReportBuilder_ServerMainForm.DAConnectionManager1 + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'SELECT '#13#10' CustomerID, CompanyName, ContactName, ContactTitle,' + + ' '#13#10' Address, City, Region, PostalCode, Country, Phone, '#13#10' ' + + 'Fax'#13#10' FROM'#13#10' Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = < + item + Params = < + item + Name = 'CustomerID' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'CompanyName' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'ContactName' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'ContactTitle' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Address' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'City' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Region' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'PostalCode' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Country' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Phone' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Fax' + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'INSERT'#13#10' INTO Customers'#13#10' (CustomerID, CompanyName, ContactN' + + 'ame, ContactTitle, Address, City, Region, PostalCode, Country, P' + + 'hone, Fax)'#13#10' VALUES'#13#10' (:CustomerID, :CompanyName, :ContactNa' + + 'me, :ContactTitle, :Address, :City, :Region, :PostalCode, :Count' + + 'ry, :Phone, :Fax)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Insert_Customers' + end + item + Params = < + item + Name = 'OLD_CustomerID' + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'DELETE '#13#10' FROM'#13#10' Customers'#13#10' WHERE'#13#10' (CustomerID = :OLD_' + + 'CustomerID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Delete_Customers' + end + item + Params = < + item + Name = 'CustomerID' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'CompanyName' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'ContactName' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'ContactTitle' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Address' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'City' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Region' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'PostalCode' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Country' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Phone' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'Fax' + BlobType = dabtUnknown + ParamType = daptInput + end + item + Name = 'OLD_CustomerID' + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'UPDATE Customers'#13#10' SET '#13#10' CustomerID = :CustomerID, '#13#10' Co' + + 'mpanyName = :CompanyName, '#13#10' ContactName = :ContactName, '#13#10' ' + + ' ContactTitle = :ContactTitle, '#13#10' Address = :Address, '#13#10' ' + + 'City = :City, '#13#10' Region = :Region, '#13#10' PostalCode = :Postal' + + 'Code, '#13#10' Country = :Country, '#13#10' Phone = :Phone, '#13#10' Fax ' + + '= :Fax'#13#10' WHERE'#13#10' (CustomerID = :OLD_CustomerID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Update_Customers' + end> + RelationShips = <> + UpdateRules = <> + Left = 24 + Top = 6 + end + object ppReport: TppDBPipeline + DataSource = dsReport + UserName = 'Pipeline' + Left = 68 + Top = 117 + end + object dtReport: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + IndexDefs = <> + Left = 22 + Top = 69 + end + object dsReport: TDADataSource + DataTable = dtReport + Left = 22 + Top = 117 + end + object Report: TppReport + AutoStop = False + DataPipeline = ppReport + PrinterSetup.BinName = 'Default' + PrinterSetup.DocumentName = 'Report' + PrinterSetup.PaperName = 'A4 210 x 297 mm' + PrinterSetup.PrinterName = 'Default' + PrinterSetup.mmMarginBottom = 6350 + PrinterSetup.mmMarginLeft = 6350 + PrinterSetup.mmMarginRight = 6350 + PrinterSetup.mmMarginTop = 6350 + PrinterSetup.mmPaperHeight = 297000 + PrinterSetup.mmPaperWidth = 210000 + PrinterSetup.PaperSize = 9 + Units = utMillimeters + DeviceType = 'ArchiveFile' + EmailSettings.ReportFormat = 'PDF' + OutlineSettings.CreateNode = True + OutlineSettings.CreatePageNodes = True + OutlineSettings.Enabled = True + OutlineSettings.Visible = True + ShowCancelDialog = False + ShowPrintDialog = False + TextSearchSettings.DefaultString = '' + TextSearchSettings.Enabled = True + Left = 68 + Top = 70 + Version = '10.02' + mmColumnWidth = 0 + DataPipelineName = 'ppReport' + object ppHeaderBand1: TppHeaderBand + mmBottomOffset = 0 + mmHeight = 13229 + mmPrintPosition = 0 + end + object ppDetailBand1: TppDetailBand + mmBottomOffset = 0 + mmHeight = 13229 + mmPrintPosition = 0 + end + object ppFooterBand1: TppFooterBand + mmBottomOffset = 0 + mmHeight = 13229 + mmPrintPosition = 0 + end + end + object BinDataStreamer: TDABinDataStreamer + Left = 85 + Top = 5 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/DARBService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/DARBService_Impl.pas new file mode 100644 index 0000000..a7f8d4c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/DARBService_Impl.pas @@ -0,0 +1,100 @@ +unit DARBService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} ReportBuilderLibrary_Intf, uDADataStreamer, uDABinAdapter, + ppBands, ppCache, ppClass, ppProd, ppReport, DB, uDADataTable, + uDAScriptingProvider, uDACDSDataTable, ppComm, ppRelatv, ppDB, ppDBPipe, + uDAClasses, uDaInterfaces; + +type + { TDARBService } + TDARBService = class(TDataAbstractService, IDARBService) + DASchema: TDASchema; + ppReport: TppDBPipeline; + dtReport: TDACDSDataTable; + dsReport: TDADataSource; + Report: TppReport; + ppHeaderBand1: TppHeaderBand; + ppDetailBand1: TppDetailBand; + ppFooterBand1: TppFooterBand; + BinDataStreamer: TDABinDataStreamer; + procedure DataAbstractServiceActivate(const aClientID: TGUID; + aSession: TROSession; const aMessage: IROMessage); + procedure DataAbstractServiceDeactivate(const aClientID: TGUID; + aSession: TROSession); + private + fConnection: IDAConnection; + protected + { IDARBService methods } + function DA_GenReport(const ReportName: Ansistring; const DatasetName: Ansistring): Binary; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} ReportBuilderLibrary_Invk, ReportBuilder_ServerMain; + +procedure Create_DARBService(out anInstance: IUnknown); +begin + anInstance := TDARBService.Create(nil); +end; + +{ DARBService } + +function TDARBService.DA_GenReport(const ReportName: Ansistring; const DatasetName: Ansistring): Binary; +var + ds: IDADataset; + s: TMemoryStream; +begin + s := TMemoryStream.Create; + result := Binary.Create; + try + Report.DataPipeline := ppReport; + Report.Template.FileName := ReportBuilder_ServerMainForm.AppPath + ReportName; + Report.Template.LoadFromFile; + Report.Template.Load; + ds := DASchema.NewDataset(fConnection, DatasetName); + BinDataStreamer.WriteDataset(s, ds, [woRows, woSchema], -1); + BinDataStreamer.ReadDataset(s, dtReport, TRUE, '', TRUE, TRUE); + Report.DeviceType := 'dtArchive'; + Report.ArchiveFileName := ReportBuilder_ServerMainForm.AppPath + 'ServerArchive.raf'; + Report.Print; + result.LoadFromFile(ReportBuilder_ServerMainForm.AppPath + 'ServerArchive.raf'); + finally + s.Free; + end; +end; + +procedure TDARBService.DataAbstractServiceActivate(const aClientID: TGUID; + aSession: TROSession; const aMessage: IROMessage); +begin + fConnection := ReportBuilder_ServerMainForm.DAConnectionManager1.NewConnection('ADO', TRUE); +end; + +procedure TDARBService.DataAbstractServiceDeactivate( + const aClientID: TGUID; aSession: TROSession); +begin + fConnection := nil; +end; + +initialization + TROClassFactory.Create('DARBService', Create_DARBService, TDARBService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/RODLFILE.res new file mode 100644 index 0000000..b23b77d Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/Report1.rtm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/Report1.rtm new file mode 100644 index 0000000..270bd58 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/Report1.rtm differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.Sample.html new file mode 100644 index 0000000..dd01eef --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.Sample.html @@ -0,0 +1,36 @@ + + + + + + + + + +

+ Report Builder Sample +

+ + +

Purpose

+ +

+ This example shows how to create the report on the server, stream it to the client and then display to the client.
+

+

+To use this sample, you will need to copy the report template file to the server folder. +

+

Examine the Code

+
    +
  • + See the simple code in DARBService_Impl.pas and ReportBuilder_ClientMain.pas. +
  • +
+

Note

+

+ This sample requires the installation of Report Builder (www.digital-metaphors.com). +

+ + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.bdsgroup new file mode 100644 index 0000000..f049f0b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + ReportBuilderClient.bdsproj + ReportBuilderServer.bdsproj + ReportBuilderClient.exe ReportBuilderServer.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.bpg new file mode 100644 index 0000000..f11e550 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = ReportBuilderClient.exe ReportBuilderServer.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +ReportBuilderClient.exe: ReportBuilderClient.dpr + $(DCC) + +ReportBuilderServer.exe: ReportBuilderServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.groupproj new file mode 100644 index 0000000..e59150b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder.groupproj @@ -0,0 +1,40 @@ + + + {edbe07cb-363c-46f5-a6d3-c92276275a6f} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.bdsproj new file mode 100644 index 0000000..1a2b7cf --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ReportBuilderClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.dpr new file mode 100644 index 0000000..890e31b --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.dpr @@ -0,0 +1,14 @@ +program ReportBuilderClient; + +uses + Forms, + ReportBuilder_ClientMain in 'ReportBuilder_ClientMain.pas' {ReportBuilderClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'ReportBuilder Client'; + Application.CreateForm(TReportBuilderClientMainForm, ReportBuilderClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.dproj new file mode 100644 index 0000000..fb953dd --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.dproj @@ -0,0 +1,72 @@ + + + {39e1b6f4-4674-4588-8f39-e3edce5eaa45} + ReportBuilderClient.dpr + Debug + AnyCPU + DCC32 + ReportBuilderClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ReportBuilderClient.dpr + + + + + + + MainSource + + +
ReportBuilderClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderLibrary.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderLibrary.rodl new file mode 100644 index 0000000..73faed0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderLibrary.rodl @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderLibrary_Intf.pas new file mode 100644 index 0000000..20eb590 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderLibrary_Intf.pas @@ -0,0 +1,97 @@ +unit ReportBuilderLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{AF63BD44-BEA9-4B7A-853F-3792A67A751B}'; + + { Service Interface ID's } + IDARBService_IID : TGUID = '{373D25E9-7848-4554-8AE7-7703C081E853}'; + + { Event ID's } + +type + { Forward declarations } + IDARBService = interface; + + + + + { IDARBService } + IDARBService = interface(IDataAbstractService) + ['{373D25E9-7848-4554-8AE7-7703C081E853}'] + function DA_GenReport(const ReportName: String; const DatasetName: String): Binary; + end; + + { CoDARBService } + CoDARBService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDARBService; + end; + + { TDARBService_Proxy } + TDARBService_Proxy = class(TDataAbstractService_Proxy, IDARBService) + protected + function __GetInterfaceName:string; override; + + function DA_GenReport(const ReportName: String; const DatasetName: String): Binary; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoDARBService } + +class function CoDARBService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDARBService; +begin + result := TDARBService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TDARBService_Proxy } + +function TDARBService_Proxy.__GetInterfaceName:string; +begin + result := 'DARBService'; +end; + +function TDARBService_Proxy.DA_GenReport(const ReportName: String; const DatasetName: String): Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'ReportBuilderLibrary', __InterfaceName, 'DA_GenReport'); + __Message.Write('ReportName', TypeInfo(String), ReportName, []); + __Message.Write('DatasetName', TypeInfo(String), DatasetName, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IDARBService_IID, TDARBService_Proxy); + + +finalization + UnregisterProxyClass(IDARBService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderLibrary_Invk.pas new file mode 100644 index 0000000..29131eb --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderLibrary_Invk.pas @@ -0,0 +1,64 @@ +unit ReportBuilderLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} ReportBuilderLibrary_Intf; + +type + TDARBService_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + procedure Invoke_DA_GenReport(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TDARBService_Invoker } + +procedure TDARBService_Invoker.Invoke_DA_GenReport(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function DA_GenReport(const ReportName: String; const DatasetName: String): Binary; } +var + ReportName: String; + DatasetName: String; + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + __Message.Read('ReportName', TypeInfo(String), ReportName, []); + __Message.Read('DatasetName', TypeInfo(String), DatasetName, []); + + lResult := (__Instance as IDARBService).DA_GenReport(ReportName, DatasetName); + + __Message.InitializeResponseMessage(__Transport, 'ReportBuilderLibrary', 'DARBService', 'DA_GenReportResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.bdsproj new file mode 100644 index 0000000..2eb51ac --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ReportBuilderServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.dpr new file mode 100644 index 0000000..80bdae4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.dpr @@ -0,0 +1,21 @@ +program ReportBuilderServer; + +{#ROGEN:ReportBuilderLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROCOMInit, + Forms, + ReportBuilderLibrary_Intf in 'ReportBuilderLibrary_Intf.pas', + ReportBuilderLibrary_Invk in 'ReportBuilderLibrary_Invk.pas', + DARBService_Impl in 'DARBService_Impl.pas' {DARBService: TDataAbstractService}, + ReportBuilder_ServerMain in 'ReportBuilder_ServerMain.pas' {ReportBuilder_ServerMainForm}; + +{$R *.RES} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'ReportBuilder Server'; + Application.CreateForm(TReportBuilder_ServerMainForm, ReportBuilder_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.dproj new file mode 100644 index 0000000..a0fc579 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.dproj @@ -0,0 +1,77 @@ + + + {c3bd883e-cf1f-451a-a2c0-b0a16351f9af} + ReportBuilderServer.dpr + Debug + AnyCPU + DCC32 + ReportBuilderServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ReportBuilderServer.dpr + + + + + + + MainSource + + +
DARBService
+
+ + + +
ReportBuilder_ServerMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilderServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ClientMain.dfm new file mode 100644 index 0000000..e9fd243 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ClientMain.dfm @@ -0,0 +1,521 @@ +object ReportBuilderClientMainForm: TReportBuilderClientMainForm + Left = 457 + Top = 208 + AutoScroll = False + Caption = 'ReportBuilder Client' + ClientHeight = 242 + ClientWidth = 571 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 232 + Top = 13 + Width = 58 + Height = 13 + Caption = 'Reportname' + end + object Grid: TDBGrid + Left = 0 + Top = 42 + Width = 571 + Height = 200 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = dsCustomers + TabOrder = 3 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object OpenButton: TButton + Left = 8 + Top = 8 + Width = 121 + Height = 25 + Caption = 'Close/Open Customers' + TabOrder = 1 + OnClick = OpenButtonClick + end + object ReportButton: TButton + Left = 152 + Top = 8 + Width = 75 + Height = 25 + Caption = 'GenReport' + TabOrder = 2 + OnClick = ReportButtonClick + end + object edtRN: TEdit + Left = 304 + Top = 8 + Width = 121 + Height = 21 + TabOrder = 0 + Text = 'Report1.rtm' + end + object BINMessage: TROBinMessage + UseCompression = False + Left = 128 + Top = 72 + end + object WinInetHTTPChannel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/bin' + Left = 160 + Top = 72 + end + object RemoteService: TRORemoteService + Message = BINMessage + Channel = WinInetHTTPChannel + ServiceName = 'DARBService' + Left = 193 + Top = 72 + end + object dtCustomers: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soIgnoreStreamSchema, soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 254 + Top = 72 + end + object dsCustomers: TDADataSource + DataTable = dtCustomers + Left = 288 + Top = 72 + end + object ArchiveReader: TppArchiveReader + AllowPrintToFile = True + DeviceType = 'Screen' + EmailSettings.ReportFormat = 'PDF' + PreviewFormSettings.WindowState = wsMaximized + PreviewFormSettings.ZoomSetting = zsPageWidth + SuppressOutline = False + TextSearchSettings.DefaultString = '' + TextSearchSettings.Enabled = True + Left = 320 + Top = 72 + Version = '10.02' + end + object Report: TppReport + AutoStop = False + DataPipeline = ppReport + PrinterSetup.BinName = 'Default' + PrinterSetup.DocumentName = 'Report' + PrinterSetup.PaperName = 'A4 210 x 297 mm' + PrinterSetup.PrinterName = 'Default' + PrinterSetup.mmMarginBottom = 6350 + PrinterSetup.mmMarginLeft = 6350 + PrinterSetup.mmMarginRight = 6350 + PrinterSetup.mmMarginTop = 6350 + PrinterSetup.mmPaperHeight = 297000 + PrinterSetup.mmPaperWidth = 210000 + PrinterSetup.PaperSize = 9 + Units = utMillimeters + DeviceType = 'ArchiveFile' + EmailSettings.ReportFormat = 'PDF' + OutlineSettings.CreateNode = True + OutlineSettings.CreatePageNodes = True + OutlineSettings.Enabled = True + OutlineSettings.Visible = True + ShowCancelDialog = False + ShowPrintDialog = False + TextSearchSettings.DefaultString = '' + TextSearchSettings.Enabled = True + Left = 320 + Top = 127 + Version = '10.02' + mmColumnWidth = 0 + DataPipelineName = 'ppReport' + object ppHeaderBand1: TppHeaderBand + mmBottomOffset = 0 + mmHeight = 13229 + mmPrintPosition = 0 + end + object ppDetailBand1: TppDetailBand + mmBottomOffset = 0 + mmHeight = 13229 + mmPrintPosition = 0 + end + object ppFooterBand1: TppFooterBand + mmBottomOffset = 0 + mmHeight = 13229 + mmPrintPosition = 0 + end + end + object ppReport: TppDBPipeline + DataSource = dsReport + UserName = 'Pipeline' + Left = 352 + Top = 127 + end + object dtReport: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soIgnoreStreamSchema, soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 256 + Top = 127 + end + object dsReport: TDADataSource + DataTable = dtReport + Left = 288 + Top = 128 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RemoteService + GetSchemaCall.MethodName = 'GetSchema' + GetSchemaCall.Params = < + item + Name = 'aFilter' + DataType = rtString + Flag = fIn + end + item + Name = 'Result' + DataType = rtString + Flag = fResult + end> + GetSchemaCall.Default = False + GetSchemaCall.IncomingSchemaParameter = 'Result' + GetSchemaCall.OutgoingFilterParameter = 'aFilter' + GetDataCall.RemoteService = RemoteService + GetDataCall.MethodName = 'GetData' + GetDataCall.Params = < + item + Name = 'aTableNameArray' + DataType = rtUserDefined + Flag = fIn + TypeName = 'StringArray' + end + item + Name = 'aTableRequestInfoArray' + DataType = rtUserDefined + Flag = fIn + TypeName = 'TableRequestInfoArray' + end + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + end> + GetDataCall.Default = False + GetDataCall.OutgoingTableNamesParameter = 'aTableNameArray' + GetDataCall.OutgoingTableRequestInfosParameter = 'aTableRequestInfoArray' + GetDataCall.IncomingDataParameter = 'Result' + UpdateDataCall.RemoteService = RemoteService + UpdateDataCall.MethodName = 'UpdateData' + UpdateDataCall.Params = < + item + Name = 'aDelta' + DataType = rtBinary + Flag = fIn + end + item + Name = 'Result' + DataType = rtBinary + Flag = fResult + end> + UpdateDataCall.Default = False + UpdateDataCall.OutgoingDeltaParameter = 'aDelta' + UpdateDataCall.IncomingDeltaParameter = 'Result' + GetScriptsCall.RemoteService = RemoteService + GetScriptsCall.Params = <> + GetScriptsCall.Default = False + RemoteService = RemoteService + DataStreamer = DataStreamer + Left = 422 + Top = 68 + end + object DataStreamer: TDABinDataStreamer + Left = 488 + Top = 68 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ClientMain.pas new file mode 100644 index 0000000..d7c27c7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ClientMain.pas @@ -0,0 +1,90 @@ +unit ReportBuilder_ClientMain; + +interface + +{ + IF YOU GET + + [Fatal Error] uClientForm.pas(17): File not found: 'ppModule.dcu' + + HERE: This sample requires ReportBuilder to be installed on your system. +} + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uDADataTable, uDACDSDataTable, uDABINAdapter, uRORemoteService, + uROWinInetHttpChannel, uROClient, + uROBINMessage, DB, Grids, DBGrids, StdCtrls, ppModule, + ppCtrls, ppVar, ppPrnabl, ppClass, ppBands, ppCache, ppDB, ppDBPipe, + ppComm, ppRelatv, ppProd, ppReport, ppArchiv, uROTypes, + ppParameter, uDAScriptingProvider, + uDARemoteDataAdapter, uDADataStreamer, ReportBuilderLibrary_Intf; + +type + TReportBuilderClientMainForm = class(TForm) + BINMessage: TROBINMessage; + WinInetHTTPChannel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + dtCustomers: TDACDSDataTable; + dsCustomers: TDADataSource; + Grid: TDBGrid; + OpenButton: TButton; + ReportButton: TButton; + ArchiveReader: TppArchiveReader; + Report: TppReport; + ppReport: TppDBPipeline; + dtReport: TDACDSDataTable; + dsReport: TDADataSource; + edtRN: TEdit; + Label1: TLabel; + ppHeaderBand1: TppHeaderBand; + ppDetailBand1: TppDetailBand; + ppFooterBand1: TppFooterBand; + RemoteDataAdapter: TDARemoteDataAdapter; + DataStreamer: TDABinDataStreamer; + procedure OpenButtonClick(Sender: TObject); + procedure ReportButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + { Private-Deklarationen } + FService: IDARBService; + public + { Public-Deklarationen } + end; + +var + ReportBuilderClientMainForm: TReportBuilderClientMainForm; + +implementation + +{$R *.dfm} + +procedure TReportBuilderClientMainForm.OpenButtonClick(Sender: TObject); +begin + dtCustomers.active := not dtCustomers.active; +end; + +procedure TReportBuilderClientMainForm.ReportButtonClick(Sender: TObject); +var + rb: TMemoryStream; +begin + rb := FService.DA_GenReport(edtRN.Text, 'Customers'); + if rb = nil then exit; + try + rb.SaveToFile(ExtractFilePath(Application.ExeName) + 'ClientArchive.raf'); + finally + rb.Free; + end; + ArchiveReader.ArchiveFileName := (ExtractFilePath(Application.ExeName) + 'ClientArchive.raf'); + ArchiveReader.DeviceType := 'dtScreen'; + ArchiveReader.Print; + ArchiveReader.ArchiveFileName := ''; //To unlock ClientArchive.raf file +end; + +procedure TReportBuilderClientMainForm.FormCreate(Sender: TObject); +begin + FService := (RemoteService as IDARBService); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ServerMain.dfm new file mode 100644 index 0000000..5c7f900 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ServerMain.dfm @@ -0,0 +1,72 @@ +object ReportBuilder_ServerMainForm: TReportBuilder_ServerMainForm + Left = 115 + Top = 134 + Width = 235 + Height = 100 + Caption = 'ReportBuilder Server' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Form1' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 14 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object ROMessage: TROBinMessage + Left = 56 + Top = 16 + end + object ROServer: TROIndyHTTPServer + Active = True + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'BIN' + end> + Port = 8099 + Left = 88 + Top = 16 + end + object DADriverManager1: TDADriverManager + DriverDirectory = '%SYSTEM%\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 120 + Top = 16 + end + object DAConnectionManager1: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DADriverManager1 + PoolingEnabled = True + Left = 152 + Top = 16 + end + object DAADODriver1: TDAADODriver + Left = 184 + Top = 16 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ServerMain.pas new file mode 100644 index 0000000..dc7ded5 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ReportBuilder_ServerMain.pas @@ -0,0 +1,42 @@ +unit ReportBuilder_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, uROClient, uROBINMessage, uROClientIntf, uROServer, uROIndyHTTPServer, + uROIndyTCPServer, uROPoweredByRemObjectsButton, + uDAEngine, uDAADODriver, uDAClasses, uDADriverManager; + +type + TReportBuilder_ServerMainForm = class(TForm) + ROMessage: TROBINMessage; + ROServer: TROIndyHTTPServer; + DADriverManager1: TDADriverManager; + DAConnectionManager1: TDAConnectionManager; + DAADODriver1: TDAADODriver; + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + procedure FormCreate(Sender: TObject); + private + fAppPath: string; + public + property AppPath: string read fAppPath write fAppPath; + end; + +var + ReportBuilder_ServerMainForm: TReportBuilder_ServerMainForm; + +implementation + +uses DARBService_Impl; + + +{$R *.dfm} + +procedure TReportBuilder_ServerMainForm.FormCreate(Sender: TObject); +begin + fAppPath := ExtractFilePath(Application.ExeName); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ServerArchive.raf b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ServerArchive.raf new file mode 100644 index 0000000..8cf3638 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Report Builder/ServerArchive.raf differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.Sample.html new file mode 100644 index 0000000..18a0ad9 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.Sample.html @@ -0,0 +1,36 @@ + + + + + + + + + +

+ SQL Access Sample +

+ + +

Purpose

+ +

+This example treats two different SQL queries as if they are the same one. +One takes data from the SHIPPERS table and the other from the CUSTOMERS table.
The field mappings used when building the where clause isolate the developer from the SQL details and so allow the building of fairly complex where clauses without the need to do string concatenations in code.
+This sample also illustrates the use of various macro processors (TDAMSSQLMacroProcessor, TDAIBMacroProcessor, TDAOracleMacroProcessor, TDADBISAMMacroProcessor). +

+ +

Examine the Code

+
    +
  • + See the two SQL statements associated with the Customers dataset for the two connections for more details.. +
  • +
+

Note

+ +

+IMPORTANT: Keep in mind that the dataset's SQL property will always contain the statement you define and the dynamic WHERE clause only gets merged into it when opening the dataset. +

+ + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.bdsproj new file mode 100644 index 0000000..12aa3e0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + SQLAccess.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.dpr new file mode 100644 index 0000000..81c2c0c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.dpr @@ -0,0 +1,14 @@ +program SQLAccess; + +uses + Forms, + SQLAccessMain in 'SQLAccessMain.pas' {SQLAccessMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'SQL Access'; + Application.CreateForm(TSQLAccessMainForm, SQLAccessMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.dproj new file mode 100644 index 0000000..baebb80 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.dproj @@ -0,0 +1,72 @@ + + + {f72ad2e5-c6f5-43f9-9fd6-9c34a1ccae26} + SQLAccess.dpr + Debug + AnyCPU + DCC32 + SQLAccess.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + SQLAccess.dpr + + + + + + + MainSource + + +
SQLAccessMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.res new file mode 100644 index 0000000..b946fbb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccess.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccessMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccessMain.dfm new file mode 100644 index 0000000..bf656e2 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccessMain.dfm @@ -0,0 +1,552 @@ +object SQLAccessMainForm: TSQLAccessMainForm + Left = 319 + Top = 116 + AutoScroll = False + BorderWidth = 5 + Caption = 'SQL Access' + ClientHeight = 444 + ClientWidth = 576 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object PageControl1: TPageControl + Left = 0 + Top = 0 + Width = 576 + Height = 444 + ActivePage = TabSheet1 + Align = alClient + TabIndex = 0 + TabOrder = 0 + object TabSheet1: TTabSheet + BorderWidth = 5 + Caption = 'Where' + object Label1: TLabel + Left = 0 + Top = 76 + Width = 34 + Height = 13 + Caption = 'ID Like' + end + object Label2: TLabel + Left = 0 + Top = 100 + Width = 143 + Height = 13 + Caption = 'CompanyName Different Than' + end + object Label3: TLabel + Left = 0 + Top = 124 + Width = 114 + Height = 13 + Caption = 'PhoneNumber Equal To' + end + object Label4: TLabel + Left = 0 + Top = 148 + Width = 44 + Height = 13 + Caption = 'Order By:' + end + object ExecuteButton: TButton + Left = 410 + Top = 143 + Width = 113 + Height = 22 + Caption = 'E&xecute' + TabOrder = 5 + OnClick = ExecuteButtonClick + end + object Memo: TMemo + Left = 0 + Top = 199 + Width = 558 + Height = 207 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + TabOrder = 6 + end + object rgConnections: TRadioGroup + Left = 0 + Top = 0 + Width = 558 + Height = 65 + Align = alTop + Caption = 'Connection' + TabOrder = 0 + end + object eID: TEdit + Left = 152 + Top = 72 + Width = 255 + Height = 21 + TabOrder = 1 + Text = 'A%' + end + object eCompanyName: TEdit + Left = 152 + Top = 96 + Width = 255 + Height = 21 + TabOrder = 2 + Text = 'Noname' + end + object ePhoneNumber: TEdit + Left = 152 + Top = 120 + Width = 255 + Height = 21 + TabOrder = 3 + Text = '13456789' + end + object cbOrderBy: TComboBox + Left = 152 + Top = 144 + Width = 255 + Height = 21 + ItemHeight = 13 + TabOrder = 4 + end + end + object TabSheet2: TTabSheet + BorderWidth = 5 + Caption = 'Macros' + ImageIndex = 1 + object ProcessSQLButton: TButton + Left = 325 + Top = 6 + Width = 75 + Height = 22 + Caption = 'ProcessSQL' + TabOrder = 1 + OnClick = ProcessSQLButtonClick + end + object Memo1: TMemo + Left = 0 + Top = 74 + Width = 558 + Height = 141 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + Lines.Strings = ( + 'SELECT * FROM Orders WHERE OrderDate>{DateTime()}' + 'SELECT * FROM Orders WHERE OrderDate>{Date()}' + 'SELECT * FROM Orders WHERE OrderDate>{AddTime(Date(), 2, day)}' + + 'SELECT * FROM Orders WHERE OrderDate>{FormatDateTime('#39'12/22/2003' + + ' 22:10:22.123'#39')}' + 'SELECT * FROM Orders WHERE OrderDate>{FormatDate('#39'12/22/2003'#39')}' + 'SELECT {Length(CustomerID)} FROM Orders' + 'SELECT {TrimLeft(CustomerID)} FROM Orders' + 'SELECT {TrimRight(CustomerID)} FROM Orders' + 'SELECT {UpperCase(CustomerID)} FROM Orders' + 'SELECT {Copy(CustomerID, 2, 3)} FROM Orders') + TabOrder = 2 + end + object Memo2: TMemo + Left = 0 + Top = 219 + Width = 558 + Height = 187 + Align = alBottom + TabOrder = 4 + end + object rgProcessors: TRadioGroup + Left = 0 + Top = 0 + Width = 322 + Height = 71 + Caption = 'Processor' + Columns = 2 + ItemIndex = 0 + Items.Strings = ( + 'TMSSQLMacroProcessor' + 'TIBMacroProcessor' + 'TOracleMacroProcessor' + 'TDBISAMMacroProcessor') + TabOrder = 0 + end + object Panel1: TPanel + Left = 0 + Top = 215 + Width = 558 + Height = 4 + Align = alBottom + BevelOuter = bvNone + TabOrder = 3 + end + end + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 24 + Top = 216 + end + object DAADODriver: TDAADODriver + Left = 54 + Top = 216 + end + object DAConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'NorthwindCustomers' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Description = 'Query that point to the Customers table' + Default = True + Tag = 0 + end + item + Name = 'NorthwindShippers' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Description = 'Query that point to the Shippers table' + Default = False + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = False + Left = 88 + Top = 216 + end + object DASchema: TDASchema + ConnectionManager = DAConnectionManager + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'NorthwindCustomers' + TargetTable = 'Customers' + SQL = 'SELECT CustomerID,CompanyName,Phone FROM Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'PhoneNumber' + TableField = 'Phone' + end> + end + item + Connection = 'NorthwindShippers' + TargetTable = 'Shippers' + SQL = 'SELECT ShipperID, CompanyName, Phone FROM Shippers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ID' + TableField = 'ShipperID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'PhoneNumber' + TableField = 'Phone' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'ID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PhoneNumber' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = <> + Statements = < + item + Connection = 'NorthwindShippers' + TargetTable = 'Orders' + SQL = + 'SELECT OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate,' + + #10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,'#10' ShipCit' + + 'y, ShipRegion, ShipPostalCode, ShipCountry'#10' FROM Orders' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 24 + Top = 248 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccessMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccessMain.pas new file mode 100644 index 0000000..df4b8e4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/SQL Access/SQLAccessMain.pas @@ -0,0 +1,169 @@ +unit SQLAccessMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uDADriverManager, uDAEngine, uDAADODriver, uDAClasses, StdCtrls, + DB, uDADataTable, uDACDSDataTable, uDAADODataTable, ExtCtrls, + ComCtrls, uDAScriptingProvider; + +type + TSQLAccessMainForm = class(TForm) + DriverManager: TDADriverManager; + DAADODriver: TDAADODriver; + PageControl1: TPageControl; + TabSheet1: TTabSheet; + TabSheet2: TTabSheet; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + ExecuteButton: TButton; + Memo: TMemo; + rgConnections: TRadioGroup; + eID: TEdit; + eCompanyName: TEdit; + ePhoneNumber: TEdit; + ProcessSQLButton: TButton; + Memo1: TMemo; + Memo2: TMemo; + rgProcessors: TRadioGroup; + cbOrderBy: TComboBox; + Label4: TLabel; + DAConnectionManager: TDAConnectionManager; + Panel1: TPanel; + DASchema: TDASchema; + procedure ExecuteButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure ProcessSQLButtonClick(Sender: TObject); + + private + { Private declarations } + public + { Public declarations } + end; + +var + SQLAccessMainForm: TSQLAccessMainForm; + +implementation + +uses uDAInterfaces, uDAMacroProcessors, uDAMacros; + +{$R *.dfm} + +procedure TSQLAccessMainForm.ExecuteButtonClick(Sender: TObject); +var + connname: string; + conn: IDAConnection; + ds: IDADataset; + i: integer; + orderby: integer; +begin + { In this example we are treating two different SQL queries like they were the same one. + One takes data from the SHIPPERS table when the other from the CUSTOMERS one. The field mappings + that are used when building the where clause isolate the developer from the SQL details and allow + you to build fairly complex where clauses without the need to do string concatenations in code. + + Examine the two sql statements associated with the Customers dataset for the two connections for + more details. The code below transparently works for both. + + IMPORTANT: Keep in mind the SQL property of a dataset will always and only reflect the statement you define + in the statement and the dynamic WHERE clause will only be merged to it when opening the dataset. + } + + Memo.Lines.Add('---------------'); + Memo.Lines.Add(''); + try + connname := Trim(Copy(rgConnections.Items[rgConnections.ItemIndex], 1, Pos('-', rgConnections.Items[rgConnections.ItemIndex]) - 1)); + conn := DAConnectionManager.NewConnection(connname, TRUE); + + ds := DASchema.NewDataset(conn, 'Customers'); + + { Note: we could have also created the dataset along with the field mappings and statements manually via code. + In some extremely dynamic situations that might be preferrable. } + + Memo.Lines.Add('Mappings'); + for i := 0 to ds.FieldCount - 1 do + Memo.Lines.Add(ds.fields[i].TableField + ' --> ' + ds.fields[i].Name); + Memo.Lines.Add(''); + + ds.Where.AddCondition('ID', cLike, eID.Text); + + if (eCompanyName.Text <> '') and (ds.Where.Clause <> '') then ds.Where.AddOperator(opAND); + + ds.Where.AddCondition('CompanyName', cDifferent, eCompanyName.Text); + + if (ePhoneNumber.Text <> '') and (ds.Where.Clause <> '') then ds.Where.AddOperator(opOR); + + ds.Where.AddCondition('PhoneNumber', cEqual, ePhoneNumber.Text); + + orderby := POS('order by', lowercase(ds.SQL)); + + if (orderby = 0) then begin + if (cbOrderBy.Text <> '') then ds.SQL := ds.SQL + ' ORDER BY ' + ds.Fieldbyname(cbOrderBy.Text).TableField; + end + else begin + if (cbOrderBy.Text = '') then ds.SQL := copy(ds.sql, 1, orderby - 1) + else + ds.SQL := copy(ds.sql, 1, orderby - 1) + ' ORDER BY ' + ds.Fieldbyname(cbOrderBy.Text).TableField; + end; + ds.Open; + finally + Memo.Lines.Add('SQL >>> ' + ds.SQL); + Memo.Lines.Add('WHERE >>> ' + ds.Where.Clause); + end; +end; + +procedure TSQLAccessMainForm.FormCreate(Sender: TObject); +var + i: integer; + conn: IDAConnection; + ds: IDADataset; +begin + with DAConnectionManager do + for i := 0 to (Connections.Count - 1) do begin + rgConnections.Items.Add(Connections[i].Name + ' - ' + Connections[i].Description); + end; + + rgConnections.ItemIndex := 0; + + conn := DAConnectionManager.NewConnection('NorthwindCustomers'); + ds := DASchema.NewDataset(conn, 'Customers'); + cbOrderBy.Items.Add(''); + for i := 0 to (ds.FieldCount - 1) do begin + cbOrderBy.Items.Add(ds.Fields[i].Name); + end; +end; + +procedure TSQLAccessMainForm.ProcessSQLButtonClick(Sender: TObject); +var + processor: TDASQLMacroProcessor; + savedShortDateFormat: string; + SavedDateSeparator, savedTimeSeparator: Char; +begin + case rgProcessors.ItemIndex of + 0: processor := TDAMSSQLMacroProcessor.Create; + 1: processor := TDAIBMacroProcessor.Create; + 2: processor := TDAOracleMacroProcessor.Create; + 3: processor := TDADBISAMMacroProcessor.Create; + else Exit; + end; + savedShortDateFormat := ShortDateFormat; + savedDateSeparator := DateSeparator; + savedTimeSeparator := TimeSeparator; + try + ShortDateFormat := 'MM/DD/YYYY'; + DateSeparator := '/'; + TimeSeparator := ':'; + Memo2.Lines.Text := processor.Eval(Memo1.Lines.Text) + finally + ShortDateFormat := savedShortDateFormat; + DateSeparator := savedDateSeparator; + TimeSeparator := savedTimeSeparator; + processor.Free; + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Samples.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Samples.html new file mode 100644 index 0000000..85e9711 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Samples.html @@ -0,0 +1,556 @@ + + + + + + + + + +

+ Data Abstract™ Samples for Delphi +

+ Please keep the following things in mind when working with the samples: +
    +
  • + ADO / Northwind Database. Most samples work on the Northwind database + that comes with Microsoft SQL Server 7.0 and 2003. For simplicity, the + samples + assume that MSSQL is running on the local machine and using an empty "sa" + password*. +
  • +
  • + If your setup differs, ensure that you adjust the samples accordingly before + trying to run them; locate and double-click the Schema component, select + the + ADO connection in Schema Modeler and change the connection string.
  • +
  • + *an empty "sa" password is NOT recommended on production systems.
  • +
  • + InterBase (or FireBird) / Employee Database. Those samples working with Borland + InterBase + will usually work against the EMPLOYEE.GDB database that is provided with + InterBase. + They will expect this database in the default location (c:\Program Files\Borland\InterBase\Examples). +
  • +
  • + If your setup differs,ensure that you adjust the samples accordingly before + trying to run them; locate and double-click the Schema component, select + the + IBX or DBX connection in Schema Modeler, and change the connection string.
  • + SDAC. Some of the sample applications provide the option to use + an SDAC based connection instead of ADO to talk to MSSQL. Please note that + to use + this option, you will need to drop a SDACDriver on the sample's form manually + and rebuild the sample; you will also need a valid license for SDAC from + Core + Lab for this.
  • + +
  • +

    + Report Builder Sample. This sample will require ReportBuilder 7 + from + Digital Metaphors. +

    +
  • +
+

+ + Getting Started

+

+ Most of the samples provide a project group containing + server and client projects. The standard procedure for testing these is as follows: + +

+
    +
  • Build or compile both projects.
  • +
  • Ensure that the server is the current project. Note: if there is + only one RemObjects SDK server contained within the project group, this step is + not needed because the next step will still work even if the lient is the current + project. 
  • +
  • Launch the server (IDE menu: RemObjects | Launch Server Executable).
  • +
  • Examine the server window. Some samples require that you activate one or more channels. +
  • +
  • Make the client the current project.
  • +
  • Run the client.
  • +
+

+ Having tested the sample, next examine the database schema and the services provided. Do this by examining + the Schema Modeler and Service Builder tools provided: +

+
    +
  • Schema Modeler +
      +
    • locate the server form or datamodule containing the TDASchema component
    • +
    • double click on the TDASchema
    • +
    +
  • +
  • Service Builder +
      +
    • Ensure that the server is the current project.
    • +
    • Open the Service Builder (IDE menu: RemObjects | Edit Service Library).
    • +
    +
  • +
+

+ Note: the Schema Modeler item available via the IDE's main menu + (RemObjects | Schema Modeler) will open a fresh instance, not the one already referenced + by the other components.

+

+

+

+ + Sample Categories

+
    +
  • Some samples are shown below in more than one category. 
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Category +

+
+

+ Samples +

+
+ Introduction + First Sample
+ Login Sample
+ Calculated Fields
+ Custom User Logon
+ MegaDemo
+ Local Schema
+ Quick Open
+ Intermediate + Briefcase
+ Business Processor
+ BusinessRulesScripts
+ Data Streamers
+ Dynamic Where
+ Fetch
+ Memory Data
+ Multi Level Detail
+ SQL Access
+ Stored Procedures
+ Strongly Typed
+ Architecture + Connection By User
+ Local Schema +
+ Service Methods
+ Strongly Typed
+ Advanced + Connection By User
+ Connection Pooling
+ Dynamic SQL
+ Exported DataTables
+ Regular Expressions
+ Service Methods
+ XSLT
+ Third Party + + QuantumGrid 4
+ Report Builder
+

+ Sample Descriptions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + Category + Description
+ Briefcase + Intermediate + This example shows how to create a briefcase model using a Data Abstract + Client.
+ Business Processor + Intermediate + This is a good example to show the advantages of a multi-tier architecture: systems + can be updated via a server re-deploy without the need to update any client. Also, + the sample shows advanced handling on the client of any errors returned from the + server.
+ BusinessRulesScripts + Intermediate +

+ This example demonstrates how client side scripts can be modified on the server + and then downloaded to the client via a simple call.
+ When you compile and launch the server, it displays a memo containing various client + side rules executed within event handlers such as BeforePost.

+
+ Calculated Fields + Introduction + This example shows how to handle calculated fields on the server side and client + side. +
+ Connection By User + Architecture
+ Advanced
+ Shows various methods how a standard application (i.e. not a RemObjects server or + client) can obtain a database connection at runtime. +
+ The application uses four Data Abstract components:  TDAADODriver, + TDADriverManager, TDAConnectionManager and + TROInMemorySessionManager.
+ Connection Pooling + Advanced + Shows how connections can be managed via a pool (ADO/Northwind & IBX/Employee + connections). +
+ Custom User Logon + Introduction +

+ A very simple example showing two methods of opening a connection at runtime:

+
    +
  • creates and opens the connection in a single call passing the UserID/Password values + supplied.
  • +
  • creates the connection and opens it afterwards.
  • +
+
+ Data Streamers + Intermediate +

+ This example shows how a dataset can be written to a stream and read from it using + the TDABinDataStreamer class.
+ When you compile and launch this example it displays two grids, the sources for + which are datasets dynamically read using TStream.

+
+ Dynamic SQL + Advanced +

+ This demo shows how to retrieve schema and/or data via SQL generated at runtime.
+ When you compile and run the server, you will see it contains a memo displaying + "SQL details generated for Update will be displayed here". The demo does + not actually attempt to update server data but merely displays the fields that would + be updated by processing the delta.

+
+ Dynamic Where + Intermediate + This example illustrates how work with the Dynamic Where.
+ Exported DataTables + Advanced + This example illustrates the functionality of Exported Datatables.This allows + you to receive and update data not declared within the Schema.
+ Fetch + Intermediate + This demo shows how to fetch paged orders and also master/detail via single server + call. +
+ First Sample + Introduction + This sample illustrates the basic functionality of Data Abstract. +
+ The application, which shows how to receive data from a remote database, was created + using the Data Abstract 4.0 Combo Server wizard.
+ Local Schema + Introduction
+ Architecture
+ A simple demo showing the use of several Data Abstract components to select/update + a range of Customer records.
+ Login Sample + Introduction +

+ This example shows how to provide a simple Login.
+ The login data is held in Northwind's Employees table, with the FirstName + and LastName fields used for UserName and Password respectively. +

+
+ MegaDemo + Introduction + The sample shows: +
    +
  • How we can work with several connections to different databases (Northwind - MS + SQL and Employee - Firebird).
  • +
  • How we can implement security and access rights in our application.
  • +
  • Master-detail relations between tables is implemented via a service that provides + a list of orders by user id.
  • +
+
+ Memory Data + Intermediate +

+ This example shows how to create and populate a virtual dataset dynamically.
+ The client displays two grids: +

+
    +
  • Top Grid: this displays the primary keys of one or more datasets from Northwind.  +
  • +
  • Bottom Grid: this displays the names and sizes of files contained in the + specified disk folder.
  • +
+
+ Multi Level Detail + Intermediate + This sample shows how to implement master/detail/detail updates as simply as possible.
+ QuantumGrid 4 + Third Party + This example demonstrates how to use the QuantumGrid4 (or QuantumGrid5) + product from Developer Express (contact www.devexpress.com. for licensing + information if you do not already have the product). +
+ Quick Open + Introduction + This example shows how to load TDACDSDataTable data using the TDABinDataStreamer.
+ Regular Expressions + Advanced + This sample illustrates the support provided for regular expressions.
+ Report Builder + Third Party + Requires ReportBuilder 7 from Digital Metaphors.
+ This example shows how to create the report on the server, stream it to the client + and then display to the client.
+ Service Methods + Architecture
+ Advanced
+  This example illustrates the methods of the IDataAbstractService base + service. It shows the options available to change the server's operations and also + shows the order in which server methods are invoked. +
+ SQL Access + Intermediate + This example treats two different SQL queries as if they are the same one. One takes + data from the SHIPPERS table and the other from the CUSTOMERS + table. +
+ The field mappings used when building the where clause isolate the developer from + the SQL details and so allow the building of fairly complex where clauses without + the need to do string concatenations in code.
+ This sample also illustrates the use of various macro processors (TMSSQLMacroProcessor, + TIBMacroProcessor, TOracleMacroProcessor, + TDBISAMMacroProcessor). +
+ Stored Procedures + Intermediate +  This example shows how to use the IDAConnection's GetStoredProcedureNames + method to retrieve a list of stored procedures for the connection. +
+ It also shows how to use IDAConnection's NewCommand to access the IDASQLCommand + interface
+ Strongly Typed + Architecture
+ Intermediate
+  This example shows usage of business rules. It enforces additional rules that + might change over time. This is a good example to show the advantages of a multi-tier + architecture: systems can be updated via a server re-deploy without the need to + update any client.
+ XSLT + Advanced + This example shows how to import dataset data into an .xml file by using the TDAXmlDataStreamer. + Exporting dataset changes to an .xml file is also shown.
+
+

+ Support

+ +

+ If you encounter any problems or have questions regarding the Samples, + please feel + free to ask on our newsgroup at + news://news.remobjects.com/remobjects.public.dataabstract.delphi. +

+

+ Thank you very much,
Your RemObjects Team
http://www.remobjects.com +

+

+   +

+ + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/RODLFILE.res new file mode 100644 index 0000000..c0b5ce3 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.Sample.html new file mode 100644 index 0000000..2868c91 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.Sample.html @@ -0,0 +1,27 @@ + + + + + + + + +

Service Methods

+
+

Purpose

+ +

This example illustrates the methods of the IDataAbstractService base service. + It shows the options available to change the server's operations and also shows the order in which server methods are invoked.
+ In this example, all server methods are called manually. Normally, this is not necessary, as the TDARemoteDataAdapter calls them all for you. +

+

Examine the Code

+

+ See how the + IDataAbstractService methods are called manually in + ServiceMethods_ClientMain.pas +

+ + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.bdsgroup new file mode 100644 index 0000000..8333b42 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + ServiceMethods_Server.bdsproj + ServiceMethods_Client.bdsproj + ServiceMethods_Server.exe ServiceMethods_Client.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.bpg new file mode 100644 index 0000000..fe9fcfa --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = ServiceMethods_Server.exe ServiceMethods_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +ServiceMethods_Client.exe: ServiceMethods_Client.dpr + $(DCC) + +ServiceMethods_Server.exe: ServiceMethods_Server.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.groupproj new file mode 100644 index 0000000..143ef56 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods.groupproj @@ -0,0 +1,40 @@ + + + {e6c919e3-5360-42fe-9531-375446f3300f} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethodsLibrary.rodl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethodsLibrary.rodl new file mode 100644 index 0000000..ae93bfa --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethodsLibrary.rodl @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethodsLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethodsLibrary_Intf.pas new file mode 100644 index 0000000..588654f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethodsLibrary_Intf.pas @@ -0,0 +1,77 @@ +unit ServiceMethodsLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{4E3F13F7-7BFC-4A77-AAB9-D9A3CF49CEB8}'; + TargetNamespace = ''; + + { Service Interface ID's } + IServiceMethods_Service_IID : TGUID = '{7FD71BB0-07C8-479C-B684-75CD9DEF3917}'; + + { Event ID's } + +type + { Forward declarations } + IServiceMethods_Service = interface; + + + { IServiceMethods_Service } + IServiceMethods_Service = interface(IDataAbstractService) + ['{7FD71BB0-07C8-479C-B684-75CD9DEF3917}'] + end; + + { CoServiceMethods_Service } + CoServiceMethods_Service = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IServiceMethods_Service; + end; + + { TServiceMethods_Service_Proxy } + TServiceMethods_Service_Proxy = class(TDataAbstractService_Proxy, IServiceMethods_Service) + protected + function __GetInterfaceName:string; override; + + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoServiceMethods_Service } + +class function CoServiceMethods_Service.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IServiceMethods_Service; +begin + result := TServiceMethods_Service_Proxy.Create(aMessage, aTransportChannel); +end; + +function TServiceMethods_Service_Proxy.__GetInterfaceName:string; +begin + result := 'ServiceMethods_Service'; +end; + +initialization + RegisterProxyClass(IServiceMethods_Service_IID, TServiceMethods_Service_Proxy); + + +finalization + UnregisterProxyClass(IServiceMethods_Service_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethodsLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethodsLibrary_Invk.pas new file mode 100644 index 0000000..4c2758a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethodsLibrary_Invk.pas @@ -0,0 +1,36 @@ +unit ServiceMethodsLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} ServiceMethodsLibrary_Intf; + +type + {$M+} + TServiceMethods_Service_Invoker = class(TDataAbstractService_Invoker) + private + protected + published + end; + {$M-} + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.bdsproj new file mode 100644 index 0000000..6e397d1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ServiceMethods_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.dpr new file mode 100644 index 0000000..c73ae67 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.dpr @@ -0,0 +1,13 @@ +program ServiceMethods_Client; + +uses + Forms, + ServiceMethods_ClientMain in 'ServiceMethods_ClientMain.pas' {ServiceMethods_ClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TServiceMethods_ClientMainForm, ServiceMethods_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.dproj new file mode 100644 index 0000000..b9baccc --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.dproj @@ -0,0 +1,72 @@ + + + {f5641855-869a-4e82-b3c8-167372a7b6d0} + ServiceMethods_Client.dpr + Debug + AnyCPU + DCC32 + ServiceMethods_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ServiceMethods_Client.dpr + + + + + + + MainSource + + +
ServiceMethods_ClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.res new file mode 100644 index 0000000..b946fbb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Client.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ClientMain.dfm new file mode 100644 index 0000000..ed646ae --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ClientMain.dfm @@ -0,0 +1,670 @@ +object ServiceMethods_ClientMainForm: TServiceMethods_ClientMainForm + Left = 328 + Top = 246 + AutoScroll = False + Caption = 'ServiceMethods Client' + ClientHeight = 445 + ClientWidth = 804 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + ShowHint = True + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object LogMessage: TLabel + Left = 150 + Top = 207 + Width = 647 + Height = 16 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + Caption = 'Please run GetSchema first!' + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -15 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object PageControl: TPageControl + Left = 0 + Top = 0 + Width = 804 + Height = 198 + ActivePage = tsGetData + Align = alTop + TabOrder = 0 + OnChange = PageControlChange + object tsGetSchema: TTabSheet + Caption = 'GetSchema' + object Label1: TLabel + Left = 0 + Top = 0 + Width = 796 + Height = 26 + Align = alTop + AutoSize = False + Caption = 'Requires that '#39'AllowSchemaAccess'#39' is enabled on the server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + WordWrap = True + end + end + object tsGetTableSchema: TTabSheet + Caption = 'GetTableSchema' + ImageIndex = 4 + object Label2: TLabel + Left = 9 + Top = 37 + Width = 40 + Height = 13 + Caption = 'Dataset:' + end + object Label8: TLabel + Left = 0 + Top = 0 + Width = 796 + Height = 26 + Align = alTop + AutoSize = False + Caption = 'Requires that '#39'AllowSchemaAccess'#39' is enabled on the server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + WordWrap = True + end + object cbGetTableSchema: TComboBox + Left = 126 + Top = 33 + Width = 145 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + end + end + object tsGetData: TTabSheet + Caption = 'GetData' + ImageIndex = 1 + object Label6: TLabel + Left = 9 + Top = 37 + Width = 40 + Height = 13 + Caption = 'Dataset:' + end + object Label7: TLabel + Left = 0 + Top = 0 + Width = 796 + Height = 26 + Align = alTop + AutoSize = False + Caption = + 'Requires that '#39'AllowDataAccess'#39', '#39'AcquireConnection'#39' and '#39'AllowW' + + 'hereSQL'#39' is enabled on the server. (AllowWhereSQL is needed for ' + + 'UserFilter)' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + WordWrap = True + end + object Label4: TLabel + Left = 9 + Top = 84 + Width = 58 + Height = 13 + Caption = 'MaxRecord:' + end + object Label19: TLabel + Left = 9 + Top = 108 + Width = 47 + Height = 13 + Caption = 'UserFilter:' + end + object cbGetData: TComboBox + Left = 126 + Top = 33 + Width = 145 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + OnChange = cbGetDataChange + end + object cbIncludeSchema: TCheckBox + Left = 9 + Top = 58 + Width = 130 + Height = 17 + Alignment = taLeftJustify + Caption = 'IncludeSchema' + Checked = True + State = cbChecked + TabOrder = 1 + end + object spMaxRecord: TSpinEdit + Left = 126 + Top = 79 + Width = 50 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 2 + Value = 10 + end + object vleGetData: TValueListEditor + Left = 610 + Top = 26 + Width = 186 + Height = 144 + Align = alRight + TabOrder = 3 + TitleCaptions.Strings = ( + 'Parameter' + 'Value') + ColWidths = ( + 86 + 94) + end + object GetDataUserFilter: TEdit + Left = 126 + Top = 103 + Width = 477 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 4 + end + end + object tsUpdateData: TTabSheet + Caption = 'UpdateData' + ImageIndex = 2 + object Label18: TLabel + Left = 0 + Top = 0 + Width = 796 + Height = 26 + Align = alTop + AutoSize = False + Caption = + 'Requires that '#39'AllowDataAccess'#39', '#39'ProcessDeltasWithoutUpdateRule' + + 's'#39' and '#39'AcquireConnection'#39' is enabled on the server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + WordWrap = True + end + object Panel1: TPanel + Left = 0 + Top = 26 + Width = 610 + Height = 144 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 610 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label15: TLabel + Left = 9 + Top = 6 + Width = 40 + Height = 13 + Caption = 'Dataset:' + end + object Label17: TLabel + Left = 360 + Top = 6 + Width = 58 + Height = 13 + Caption = 'MaxRecord:' + end + object RefreshButton: TBitBtn + Left = 208 + Top = 1 + Width = 77 + Height = 22 + Caption = 'Refresh' + TabOrder = 1 + OnClick = RefreshButtonClick + Glyph.Data = { + 36040000424D3604000000000000360000002800000010000000100000000100 + 2000000000000004000000000000000000000000000000000000FF00FF00A377 + 7400A3777400A3777400A3777400A3777400A3777400A3777400A3777400A377 + 7400A3777400A3777400A377740090605D00FF00FF00FF00FF00FF00FF00A67B + 7500F2E2D300F2E2D300FFE8D100EFDFBB00FFE3C500FFDEBD00FFDDBA00FFD8 + B200FFD6AE00FFD2A500FFD2A30093635F00FF00FF00FF00FF00FF00FF00AB7F + 7700F3E7DA00F3E7DA0000990000AFD8A00070C56F0040AA2F0080BB5D00EFD4 + A600FFD6AE00FFD2A300FFD2A30096666200FF00FF00FF00FF00FF00FF00B083 + 7900F4E9DD00F4E9DD00009900000099000000990000009900000099000040AA + 2E00FFD8B200FFD4A900FFD4A9009A696400FF00FF00FF00FF00FF00FF00B689 + 7C00F5EDE400F5EDE4000099000000990000109E0D00CFD6A300FFE4C80020A2 + 1900FFD8B200FFD7B000FFD7B0009E6C6600FF00FF00FF00FF00FF00FF00BC8E + 7E00F7EFE800F7EFE80000990000009900000099000000990000FFE4C800EFDE + BA00FFD8B200FFD7B000FFD9B400A26F6800FF00FF00FF00FF00FF00FF00C395 + 8100F8F3EF00F8F3EF00F8F3EF00FFF4E800FFF4E800FFF4E800EFE3C400EFE3 + C400FFE4C800FFDEBD00FFDDBB00A5736A00FF00FF00FF00FF00FF00FF00CA9B + 8400F9F5F200FBFBFB00FFF4E800FFF4E800FFF4E80000990000009900000099 + 0000FFE8D100FFE3C500FFE1C200A8766C00FF00FF00FF00FF00FF00FF00D2A1 + 8700F9F9F900FBFBFB00109F0F00AFD8A000FFF4E800AFD8A000009900000099 + 0000FFE8D100FFE4C800FFE3C600AC796E00FF00FF00FF00FF00FF00FF00D9A8 + 8A00FBFBFB00FFFFFF0070C56F00009900000099000000990000009900000099 + 0000FFE8D100FFE8D100FFE6CE00AE7B7100FF00FF00FF00FF00FF00FF00DFAE + 8C00FCFCFC00FFFFFF00FFFFFF0070C56F000099000000990000AFD8A0000099 + 0000FFE8D100FFC8C200FFB0B000B07D7200FF00FF00FF00FF00FF00FF00E5B3 + 8F00FDFDFD00FDFDFD00FFFFFF00FFFFFF00FFFFFE00FFFAF600FFF9F300FFF5 + EA00F4DECE00B27F7300B27F7300B27F7300FF00FF00FF00FF00FF00FF00EAB8 + 9100FEFEFE00FEFEFE00FFFFFF00FFFFFF00FFFFFF00FFFFFE00FFFAF600FFF9 + F300F5E1D200B27F7300EDA75400CB987F00FF00FF00FF00FF00FF00FF00EFBC + 9200FFFFFF00FFFFFF00FCFCFC00FAFAFA00F7F7F700F5F5F500F2F1F100F0ED + EA00E9DAD000B27F7300D4A18300D09D8100FF00FF00FF00FF00FF00FF00F2BF + 9400DCA98700DCA98700DCA98700DCA98700DCA98700DCA98700DCA98700DCA9 + 8700DCA98700B27F7300D8A58500FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00} + end + object cbUpdateData: TComboBox + Left = 57 + Top = 2 + Width = 145 + Height = 21 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnChange = cbUpdateDataChange + end + object updateDataMaxRecord: TSpinEdit + Left = 431 + Top = 1 + Width = 50 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 2 + Value = 10 + end + end + object DBGrid1: TDBGrid + Left = 0 + Top = 26 + Width = 610 + Height = 96 + Align = alClient + DataSource = DataSource + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object DBNavigator1: TDBNavigator + Left = 0 + Top = 122 + Width = 610 + Height = 22 + DataSource = DataSource + VisibleButtons = [nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel] + Align = alBottom + TabOrder = 2 + end + end + object ParamPanel: TPanel + Left = 610 + Top = 26 + Width = 186 + Height = 144 + Align = alRight + BevelOuter = bvNone + TabOrder = 1 + object vleUpdateData: TValueListEditor + Left = 0 + Top = 0 + Width = 186 + Height = 144 + Align = alClient + TabOrder = 0 + ColWidths = ( + 93 + 87) + end + end + end + object tsSQLGetData: TTabSheet + Caption = 'SQLGetData' + ImageIndex = 6 + object Label11: TLabel + Left = 9 + Top = 33 + Width = 24 + Height = 13 + Caption = 'SQL:' + end + object Label12: TLabel + Left = 9 + Top = 139 + Width = 58 + Height = 13 + Caption = 'MaxRecord:' + end + object Label13: TLabel + Left = 0 + Top = 0 + Width = 796 + Height = 26 + Align = alTop + AutoSize = False + Caption = + 'Requires that '#39'AllowDataAccess'#39', '#39'AllowExecuteSQL'#39' and '#39'AcquireC' + + 'onnection'#39' is enabled on the server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + WordWrap = True + end + object sqlIncludeSchema: TCheckBox + Left = 9 + Top = 113 + Width = 130 + Height = 17 + Alignment = taLeftJustify + Caption = 'IncludeSchema' + Checked = True + State = cbChecked + TabOrder = 1 + end + object sqlMaxRecords: TSpinEdit + Left = 126 + Top = 134 + Width = 50 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 2 + Value = 10 + end + object memoDQLGetData: TMemo + Left = 126 + Top = 33 + Width = 600 + Height = 75 + Lines.Strings = ( + 'select * from customers') + ScrollBars = ssVertical + TabOrder = 0 + end + end + object tsGetCommandSchema: TTabSheet + Caption = 'GetCommandSchema' + ImageIndex = 5 + object Label5: TLabel + Left = 9 + Top = 37 + Width = 50 + Height = 13 + Caption = 'Command:' + end + object Label3: TLabel + Left = 0 + Top = 0 + Width = 800 + Height = 26 + Align = alTop + AutoSize = False + Caption = 'Requires that '#39'AllowSchemaAccess'#39' is enabled on the server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + WordWrap = True + end + object cbGetCommandSchema: TComboBox + Left = 126 + Top = 33 + Width = 145 + Height = 24 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + end + end + object tsExecuteCommand: TTabSheet + Caption = 'ExecuteCommand' + ImageIndex = 3 + object Label9: TLabel + Left = 9 + Top = 37 + Width = 50 + Height = 13 + Caption = 'Command:' + end + object Label10: TLabel + Left = 0 + Top = 0 + Width = 800 + Height = 26 + Align = alTop + AutoSize = False + Caption = + 'Requires that '#39'AllowDataAccess'#39', '#39'AllowExecuteCommands'#39' and '#39'Acq' + + 'uireConnection'#39' is enabled on the server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + WordWrap = True + end + object cbExecuteCommand: TComboBox + Left = 126 + Top = 33 + Width = 145 + Height = 24 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnChange = cbExecuteCommandChange + end + object vleExecuteCommand: TValueListEditor + Left = 610 + Top = 26 + Width = 186 + Height = 144 + Align = alRight + KeyOptions = [keyUnique] + TabOrder = 1 + TitleCaptions.Strings = ( + 'Parameter' + 'Value') + ColWidths = ( + 81 + 141) + end + end + object tsExecuteCommandEx: TTabSheet + Caption = 'ExecuteCommandEx' + ImageIndex = 8 + object Label20: TLabel + Left = 0 + Top = 0 + Width = 800 + Height = 26 + Align = alTop + AutoSize = False + Caption = + 'Requires that '#39'AllowDataAccess'#39', '#39'AllowExecuteCommands'#39' and '#39'Acq' + + 'uireConnection'#39' is enabled on the server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + WordWrap = True + end + object Label21: TLabel + Left = 9 + Top = 37 + Width = 50 + Height = 13 + Caption = 'Command:' + end + object cbExecuteCommandEx: TComboBox + Left = 126 + Top = 33 + Width = 145 + Height = 24 + Style = csDropDownList + ItemHeight = 0 + TabOrder = 0 + OnChange = cbExecuteCommandExChange + end + object vleExecuteCommandEx: TValueListEditor + Left = 610 + Top = 26 + Width = 186 + Height = 144 + Align = alRight + KeyOptions = [keyUnique] + TabOrder = 1 + TitleCaptions.Strings = ( + 'Parameter' + 'Value') + ColWidths = ( + 81 + 141) + end + end + object tsSQLExecuteCommand: TTabSheet + Caption = 'SQLExecuteCommand' + ImageIndex = 7 + object Label14: TLabel + Left = 0 + Top = 0 + Width = 796 + Height = 26 + Align = alTop + AutoSize = False + Caption = + 'Requires that '#39'AllowDataAccess'#39', '#39'AllowExecuteSQL'#39' and '#39'AcquireC' + + 'onnection'#39' is enabled on the server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + WordWrap = True + end + object Label16: TLabel + Left = 9 + Top = 33 + Width = 24 + Height = 13 + Caption = 'SQL:' + end + object MemoSQLExecuteCommand: TMemo + Left = 126 + Top = 33 + Width = 600 + Height = 75 + Lines.Strings = ( + + 'update orders set CustomerID = '#39'AROUT'#39' where CustomerID = '#39'AROUT' + + #39) + ScrollBars = ssVertical + TabOrder = 0 + end + end + end + object RunButton: TButton + Left = 3 + Top = 204 + Width = 139 + Height = 22 + Caption = 'RunButton' + TabOrder = 1 + OnClick = RunButtonClick + end + object Memo: TMemo + Left = 1 + Top = 232 + Width = 804 + Height = 213 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ScrollBars = ssBoth + TabOrder = 2 + end + object ClearLogButton: TButton + Left = 724 + Top = 204 + Width = 75 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Clear log' + TabOrder = 3 + OnClick = ClearLogButtonClick + end + object Channel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 3 + Top = 234 + end + object BinMessage: TROBinMessage + Left = 30 + Top = 234 + end + object Service: TRORemoteService + Message = BinMessage + Channel = Channel + ServiceName = 'ServiceMethods_Service' + Left = 85 + Top = 234 + end + object Streamer: TDABinDataStreamer + Left = 58 + Top = 234 + end + object DataSource: TDADataSource + Left = 113 + Top = 234 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ClientMain.pas new file mode 100644 index 0000000..7a56832 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ClientMain.pas @@ -0,0 +1,688 @@ +unit ServiceMethods_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uRORemoteService, uROClient, uROBinMessage, + uROWinInetHttpChannel, uDAScriptingProvider, uDADataTable, + uDACDSDataTable, uDADataStreamer, uDABinAdapter, uDARemoteDataAdapter, + ComCtrls, StdCtrls, ServiceMethodsLibrary_Intf, uDAClasses, uDAInterfaces, + Spin, Grids, ValEdit, DB, DBCtrls, DBGrids, ExtCtrls, Buttons; + +type + TServiceMethods_ClientMainForm = class(TForm) + Channel: TROWinInetHTTPChannel; + BinMessage: TROBinMessage; + Service: TRORemoteService; + Streamer: TDABinDataStreamer; + PageControl: TPageControl; + tsGetSchema: TTabSheet; + tsGetData: TTabSheet; + tsUpdateData: TTabSheet; + tsExecuteCommand: TTabSheet; + tsGetTableSchema: TTabSheet; + tsGetCommandSchema: TTabSheet; + tsSQLGetData: TTabSheet; + tsSQLExecuteCommand: TTabSheet; + Label1: TLabel; + RunButton: TButton; + Memo: TMemo; + cbGetTableSchema: TComboBox; + Label2: TLabel; + Label5: TLabel; + cbGetCommandSchema: TComboBox; + Label6: TLabel; + cbGetData: TComboBox; + Label7: TLabel; + Label8: TLabel; + Label3: TLabel; + cbIncludeSchema: TCheckBox; + Label4: TLabel; + spMaxRecord: TSpinEdit; + cbExecuteCommand: TComboBox; + Label9: TLabel; + vleGetData: TValueListEditor; + vleExecuteCommand: TValueListEditor; + Label10: TLabel; + Label11: TLabel; + sqlIncludeSchema: TCheckBox; + Label12: TLabel; + sqlMaxRecords: TSpinEdit; + Label13: TLabel; + memoDQLGetData: TMemo; + Label14: TLabel; + MemoSQLExecuteCommand: TMemo; + Label16: TLabel; + LogMessage: TLabel; + Panel1: TPanel; + Panel2: TPanel; + Label15: TLabel; + cbUpdateData: TComboBox; + DBGrid1: TDBGrid; + DBNavigator1: TDBNavigator; + DataSource: TDADataSource; + ParamPanel: TPanel; + vleUpdateData: TValueListEditor; + Label17: TLabel; + updateDataMaxRecord: TSpinEdit; + RefreshButton: TBitBtn; + Label19: TLabel; + GetDataUserFilter: TEdit; + Label18: TLabel; + ClearLogButton: TButton; + tsExecuteCommandEx: TTabSheet; + Label20: TLabel; + Label21: TLabel; + cbExecuteCommandEx: TComboBox; + vleExecuteCommandEx: TValueListEditor; + procedure PageControlChange(Sender: TObject); + procedure RunButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure cbGetDataChange(Sender: TObject); + procedure cbExecuteCommandChange(Sender: TObject); + procedure cbUpdateDataChange(Sender: TObject); + procedure RefreshButtonClick(Sender: TObject); + procedure ClearLogButtonClick(Sender: TObject); + procedure cbExecuteCommandExChange(Sender: TObject); + private + { Private declarations } + FService: IServiceMethods_Service; + Schema: TDASchema; + procedure Log(Str: string); + procedure FillCB(ACombobox: Tcombobox; AItems: TDASQLCommandCollection); + function isNeedSchema: boolean; + procedure LogDataset(ADataset: TDACDSDataTable); + procedure FillUpdateDataDataset; + public + { Public declarations } + procedure GetSchema; + procedure GetData; + procedure UpdateData; + procedure ExecuteCommand; + procedure ExecuteCommandEx; + procedure GetTableSchema; + procedure GetCommandSchema; + procedure SQLGetData; + procedure SQLExecuteCommand; + end; + +var + ServiceMethods_ClientMainForm: TServiceMethods_ClientMainForm; + +implementation +uses + DataAbstract4_Intf, uDADelta, uROTypes, uROXMLIntf; +{$R *.dfm} + +procedure TServiceMethods_ClientMainForm.PageControlChange( + Sender: TObject); +begin + RunButton.Caption := PageControl.ActivePage.Caption; + isNeedSchema; + if PageControl.ActivePage = tsGetData then cbGetDataChange(cbGetData) + else if PageControl.ActivePage = tsExecuteCommand then cbExecuteCommandChange(cbExecuteCommand) + else if PageControl.ActivePage = tsExecuteCommandEx then cbExecuteCommandExChange(cbExecuteCommandEx) + else if PageControl.ActivePage = tsUpdateData then cbUpdateDataChange(cbUpdateData); + +end; + +procedure TServiceMethods_ClientMainForm.RunButtonClick(Sender: TObject); +begin + if PageControl.ActivePage = tsGetSchema then GetSchema + else if PageControl.ActivePage = tsGetData then GetData + else if PageControl.ActivePage = tsUpdateData then UpdateData + else if PageControl.ActivePage = tsExecuteCommand then ExecuteCommand + else if PageControl.ActivePage = tsExecuteCommandEx then ExecuteCommandEx + else if PageControl.ActivePage = tsGetTableSchema then GetTableSchema + else if PageControl.ActivePage = tsGetCommandSchema then GetCommandSchema + else if PageControl.ActivePage = tsSQLGetData then SQLGetData + else if PageControl.ActivePage = tsSQLExecuteCommand then SQLExecuteCommand + ; + Log(''); +end; + +procedure TServiceMethods_ClientMainForm.ExecuteCommand; +var + aRowsAffacted: integer; + dataparam: DataParameterArray; + i: integer; +begin + if isNeedSchema then Exit; + Log('***ExecuteCommand***'); + try + dataparam := DataParameterArray.Create; + try + for i := 0 to vleExecuteCommand.Strings.Count - 1 do begin + with dataparam.Add do begin + Name := AnsiToUtf8(vleExecuteCommand.Keys[i + 1]); + Value := vleExecuteCommand.Values[Name]; + end; + end; + aRowsAffacted := FService.ExecuteCommand(AnsiToUtf8(cbExecuteCommand.Text), dataparam); + finally + dataparam.Free; + end; + log('aRowsAffacted:'#9 + intToStr(aRowsAffacted)); + except + on e: Exception do Log(e.Message); + end; + Log('*******************'); +end; + +procedure TServiceMethods_ClientMainForm.GetCommandSchema; +var + str: string; + strArr: StringArray; + doc: IXMLDocument; + List: IXMLNodeList; + j, i: integer; + node, ParamsNode, ParamNode: IXMLNode; +begin + if isNeedSchema then Exit; + + Log('***GetCommandSchema***'); + StrArr := StringArray.Create; + try + strArr.Add(AnsiToUtf8(cbGetCommandSchema.Text)); + try + str := FService.GetCommandSchema(StrArr); + doc := NewROXmlDocument; + doc.New; + doc.XML :=Utf8ToAnsi(str); + List := doc.DocumentNode.GetNodesByName('SchemaCommand'); + for i := 0 to List.Count - 1 do begin + Node := List.Nodes[i]; + if Node = nil then continue; + Log('Command: ' + Node.GetNodeValue('Name', '')); + ParamsNode := Node.GetNodeByName('Params'); + if ParamsNode = nil then Continue; + for j := 0 to ParamsNode.GetAttributeValue('Count', 0) - 1 do begin + ParamNode := ParamsNode.GetNodeByName('Item' + IntToStr(j)); + if ParamNode = nil then Continue; + Log('Params[' + IntToStr(j) + ']: ' + ParamNode.GetNodeValue('Name', '')); + end; + end; + except + on E: Exception do Log(E.Message); + end; + finally + strArr.Free; + end; + Log('********************'); +end; + +procedure TServiceMethods_ClientMainForm.GetData; +var + Stream: TMemoryStream; + CDSDataTable: TDACDSDataTable; + aTableRequestInfoArray: TableRequestInfoArray; + aTableNameArray: StringArray; + i: integer; + aTableRequestInfo: TableRequestInfo; +begin + if isNeedSchema then exit; + Log('***GetData***'); + + aTableNameArray := StringArray.Create; + aTableRequestInfoArray := TableRequestInfoArray.Create; + try + aTableNameArray.Add(AnsiToUtf8(cbGetData.Text)); + aTableRequestInfo := aTableRequestInfoArray.Add; + with aTableRequestInfo do begin + IncludeSchema := cbIncludeSchema.checked; + MaxRecords := spMaxRecord.Value; + UserFilter := AnsiToUtf8(GetDataUserFilter.Text); + for i := 0 to vleGetData.Strings.Count - 1 do + with Parameters.Add do begin + Name := AnsiToUtf8(vleGetData.Keys[i + 1]); + Value := vleGetData.Values[Name]; + end; + end; + try + Stream := FService.GetData(aTableNameArray, aTableRequestInfoArray); + if Stream <> nil then try + CDSDataTable := TDACDSDataTable.Create(nil); + try + CDSDataTable.Name := 'TEST'; + CDSDataTable.LocalDataStreamer := Streamer; + CDSDataTable.RemoteFetchEnabled := False; + Streamer.ReadDataset(Stream, CDSDataTable, True); + log('RecordCount:'#9 + intToStr(CDSDataTable.RecordCount)); + Log('FieldCount:'#9 + intToStr(CDSDataTable.FieldCount)); + if (CDSDataTable.FieldCount <> 0) then LogDataset(CDSDataTable); + finally + CDSDataTable.Free; + end; + finally + Stream.Free; + end; + except + on e: Exception do Log(e.Message); + end; + finally + aTableRequestInfoArray.Free; + aTableNameArray.Free; + end; + Log('*************'); +end; + +procedure TServiceMethods_ClientMainForm.GetSchema; +var + i: integer; +begin + cbGetTableSchema.Clear; + cbGetCommandSchema.Clear; + cbGetData.Clear; + + Log('***GetSchema***'); + try + Schema.LoadFromXml(Utf8ToAnsi(FService.GetSchema(''))); + + Log('Datasets.Count:'#9 + IntToStr(Schema.Datasets.Count)); + for i := 0 to Schema.Datasets.Count - 1 do + Log('Datasets[' + IntTostr(i) + ']:'#9 + Schema.Datasets[i].Name); + FillCB(cbGetTableSchema, Schema.Datasets); + FillCB(cbGetData, Schema.Datasets); + FillCB(cbUpdateData, Schema.Datasets); + + Log('Commands.Count:'#9 + IntToStr(Schema.Commands.Count)); + for i := 0 to Schema.Commands.Count - 1 do + Log('Commands[' + IntTostr(i) + ']:'#9 + Schema.Commands[i].Name); + FillCB(cbGetCommandSchema, Schema.Commands); + FillCB(cbExecuteCommand, Schema.Commands); + FillCB(cbExecuteCommandEx, Schema.Commands); + except + on E: Exception do Log(E.Message); + end; + Log('***************'); +end; + +procedure TServiceMethods_ClientMainForm.GetTableSchema; +var + str: string; + strArr: StringArray; + doc: IXMLDocument; + List: IXMLNodeList; + j, i: integer; + node, FieldsNode, FieldNode: IXMLNode; +begin + if isNeedSchema then Exit; + Log('***GetTableSchema***'); + StrArr := StringArray.Create; + try + strArr.Add(AnsiToUtf8(cbGetTableSchema.Text)); + try + str := FService.GetTableSchema(StrArr); + doc := NewROXmlDocument; + doc.New; + doc.XML := Utf8ToAnsi(str); + List := doc.DocumentNode.GetNodesByName('SchemaDataTable'); + for i := 0 to List.Count - 1 do begin + Node := List.Nodes[i]; + if Node = nil then continue; + Log('table: ' + Node.GetNodeValue('Name', '')); + FieldsNode := Node.GetNodeByName('Fields'); + if FieldsNode = nil then Continue; + for j := 0 to FieldsNode.GetAttributeValue('Count', 0) - 1 do begin + FieldNode := FieldsNode.GetNodeByName('Item' + IntToStr(j)); + if FieldNode = nil then Continue; + Log('Fields[' + IntToStr(j) + ']: ' + FieldNode.GetNodeValue('Name', '')); + end; + end; + except + on E: Exception do Log(E.Message); + end; + finally + strArr.Free; + end; + Log('********************'); +end; + +procedure TServiceMethods_ClientMainForm.SQLExecuteCommand; +var + aRowsAffacted: integer; +begin + Log('***SQLExecuteCommand***'); + try + aRowsAffacted := FService.SQLExecuteCommand(AnsiToUtf8(MemoSQLExecuteCommand.Text)); + log('aRowsAffacted:'#9 + intToStr(aRowsAffacted)); + except + on e: Exception do Log(e.Message); + end; + Log('*********************'); +end; + +procedure TServiceMethods_ClientMainForm.SQLGetData; +var + Stream: TMemoryStream; + CDSDataTable: TDACDSDataTable; +begin + Log('***SQLGetData***'); + try + Stream := FService.SQLGetData(AnsiToUtf8(memoDQLGetData.Text), sqlIncludeSchema.Checked, sqlMaxRecords.Value); + if Stream <> nil then try + CDSDataTable := TDACDSDataTable.Create(nil); + try + CDSDataTable.Name := 'TEST'; + CDSDataTable.LocalDataStreamer := Streamer; + CDSDataTable.RemoteFetchEnabled := False; + Streamer.ReadDataset(Stream, CDSDataTable, True); + log('RecordCount:'#9 + intToStr(CDSDataTable.RecordCount)); + Log('FieldCount:'#9 + intToStr(CDSDataTable.FieldCount)); + if (CDSDataTable.FieldCount <> 0) then LogDataset(CDSDataTable); + finally + CDSDataTable.Free; + end; + finally + Stream.Free; + end; + except + on e: Exception do Log(e.Message); + end; +end; + +procedure TServiceMethods_ClientMainForm.UpdateData; +var + stream1, stream: Binary; + i, j: integer; + +begin + if isNeedSchema then Exit; + if DataSource.DataTable = nil then begin + ShowMessage('Please select dataset from combobox'); + Exit; + end; + Log('***UpdateData***'); + Log('Delta.Count:'#9 + intToStr(DataSource.DataTable.Delta.Count)); + + with DataSource.DataTable.Delta do + for i := 0 to Count - 1 do begin + Log('----- Delta ' + IntToStr(i) + '-----'); + with Changes[i] do + for j := 0 to (LoggedFieldCount - 1) do + Log(LoggedFieldNames[j] + ':'#9 + VarToStr(OldValueByName[LoggedFieldNames[j]]) + ' -> ' + VarToStr(NewValueByName[LoggedFieldNames[j]])); + end; + + stream := binary.Create; + try + Streamer.Initialize(stream, aiWrite); + DataSource.DataTable.WriteDeltaToStream(Streamer); + Streamer.Finalize; + try + stream1 := FService.UpdateData(Stream); + if Stream1 <> nil then try + DataSource.DataTable.Delta.Clear(); + Streamer.Initialize(stream1, aiRead); + DataSource.DataTable.ReadDeltaFromStream(Streamer); + Streamer.Finalize; + DataSource.DataTable.MergeDelta; + finally + Stream1.Free; + end; + except + on e: Exception do Log(e.Message); + end; + finally + Stream.Free; + end; + Log('***************'); +end; + +procedure TServiceMethods_ClientMainForm.Log(Str: string); +begin + Memo.Lines.Add(Str); +end; + +procedure TServiceMethods_ClientMainForm.FormCreate(Sender: TObject); +begin + FService := Service as IServiceMethods_Service; + Schema := TDASchema.Create(nil); +end; + +procedure TServiceMethods_ClientMainForm.FormDestroy(Sender: TObject); +begin + if DataSource.DataTable <> nil then DataSource.DataTable.Free; + Schema.Free; +end; + +procedure TServiceMethods_ClientMainForm.FormShow(Sender: TObject); +begin + PageControl.ActivePage := tsGetSchema; + PageControlChange(PageControl); +end; + +procedure TServiceMethods_ClientMainForm.FillCB(ACombobox: Tcombobox; AItems: TDASQLCommandCollection); +var + i: integer; +begin + ACombobox.Items.Clear; + for i := 0 to AItems.Count - 1 do + ACombobox.Items.Add(AItems[i].Name); + if ACombobox.Items.Count > 0 then ACombobox.ItemIndex := 0; +end; + +function TServiceMethods_ClientMainForm.isNeedSchema: Boolean; +begin + Result := (Schema.Datasets.Count = 0) or (Schema.Commands.Count = 0); + LogMessage.Visible := Result and + (PageControl.ActivePage <> tsGetSchema) and + (PageControl.ActivePage <> tsSQLGetData) and + (PageControl.ActivePage <> tsSQLExecuteCommand); + RunButton.Enabled := not LogMessage.Visible; +end; + +procedure TServiceMethods_ClientMainForm.LogDataset( + ADataset: TDACDSDataTable); +var + i: integer; + s: string; +begin + log(''); + s := ''; + for i := 0 to ADataset.FieldCount - 1 do + s := s + ADataset.Fields[i].Name + #9; + Log(s); + ADataset.first; + while not ADataset.Eof do begin + s := ''; + for i := 0 to ADataset.FieldCount - 1 do + s := s + ADataset.Fields[i].AsString + #9; + Log(s); + ADataset.next; + end; + Log(''); +end; + +procedure TServiceMethods_ClientMainForm.cbGetDataChange(Sender: TObject); +var + fDataset: TDADataset; + i: integer; +begin + vleGetData.Strings.Clear; + try + if cbGetData.text = '' then Exit; + fDataset := Schema.Datasets.DatasetByName(cbGetData.Text); + if fDataset = nil then Exit; + for i := 0 to fDataset.Params.Count - 1 do + if vleGetData.Strings.IndexOfName(fDataset.Params[i].Name) = -1 then + vleGetData.InsertRow(fDataset.Params[i].Name, '', True); + finally + vleGetData.Visible := vleGetData.Strings.Count > 0; + end; + Log('*************SQL**************'); + if fDataset.Statements.Count > 0 then + Log(fDataset.Statements[0].SQL) + else + Log('SQL statement is not found. Probably this table is ExportedDataTable.'); + Log('******************************'); + +end; + +procedure TServiceMethods_ClientMainForm.cbExecuteCommandChange( + Sender: TObject); +var + fcommand: TDASQLCommand; + i: integer; +begin + vleExecuteCommand.Strings.Clear; + try + if cbExecuteCommand.text = '' then Exit; + fcommand := Schema.Commands.SQLCommandByName(cbExecuteCommand.Text); + if fcommand = nil then Exit; + for i := 0 to fcommand.Params.Count - 1 do + if fcommand.Params[i].ParamType in [daptInput, daptInputOutput] then + if vleExecuteCommand.Strings.IndexOfName(fcommand.Params[i].Name) = -1 then + vleExecuteCommand.InsertRow(fcommand.Params[i].Name, '', True); + finally + vleExecuteCommand.Visible := vleExecuteCommand.Strings.Count > 0; + end; + + Log('*************SQL**************'); + Log(fcommand.Statements[0].SQL); + Log('******************************'); + +end; + +procedure TServiceMethods_ClientMainForm.cbUpdateDataChange(Sender: TObject); +var + CDSDataTable: TDACDSDataTable; +var + i: integer; +begin + vleUpdateData.Strings.Clear; + if cbUpdateData.text = '' then Exit; + if DataSource.DataTable = nil then DataSource.DataTable := TDACDSDataTable.Create(nil); + CDSDataTable := TDACDSDataTable(DataSource.DataTable); + Log('Try to get data (call GetData)'); + CDSDataTable.LogicalName := cbUpdateData.Text; + FillUpdateDataDataset; + try + for i := 0 to CDSDataTable.Params.Count - 1 do + if vleUpdateData.Strings.IndexOfName(CDSDataTable.Params[i].Name) = -1 then + vleUpdateData.InsertRow(CDSDataTable.Params[i].Name, '', True); + finally + ParamPanel.Visible := vleUpdateData.Strings.Count > 0; + end; +end; + +procedure TServiceMethods_ClientMainForm.FillUpdateDataDataset; +var + Stream: TMemoryStream; + aTableRequestInfoArray: TableRequestInfoArray; + aTableNameArray: StringArray; + i: integer; + aTableRequestInfo: TableRequestInfo; + CDSDataTable: TDACDSDataTable; +begin + CDSDataTable := TDACDSDataTable(DataSource.DataTable); + if CDSDataTable = nil then Exit; + CDSDataTable.Close; + aTableNameArray := StringArray.Create; + aTableRequestInfoArray := TableRequestInfoArray.Create; + try + aTableNameArray.Add(CDSDataTable.LogicalName); + aTableRequestInfo := aTableRequestInfoArray.Add; + with aTableRequestInfo do begin + IncludeSchema := true; + MaxRecords := updateDataMaxRecord.Value; + UserFilter := ''; + for i := 0 to vleUpdateData.Strings.Count - 1 do + with Parameters.Add do begin + Name := vleUpdateData.Keys[i + 1]; + Value := vleUpdateData.Values[Name]; + end; + end; + try + Stream := FService.GetData(aTableNameArray, aTableRequestInfoArray); + if Stream <> nil then try + CDSDataTable.Name := 'TEST'; + CDSDataTable.LocalDataStreamer := Streamer; + CDSDataTable.RemoteFetchEnabled := False; + Streamer.ReadDataset(Stream, CDSDataTable, True); + finally + Stream.Free; + end; + except + on e: Exception do Log(e.Message); + end; + finally + aTableRequestInfoArray.Free; + aTableNameArray.Free; + end; + CDSDataTable.Open; +end; + +procedure TServiceMethods_ClientMainForm.RefreshButtonClick( + Sender: TObject); +begin + FillUpdateDataDataset; +end; + +procedure TServiceMethods_ClientMainForm.ClearLogButtonClick( + Sender: TObject); +begin + Memo.Lines.Clear; +end; + +procedure TServiceMethods_ClientMainForm.ExecuteCommandEx; +var + aRowsAffacted: integer; + dataparam, outputdataparam: DataParameterArray; + i: integer; +begin + if isNeedSchema then Exit; + Log('***ExecuteCommandEx***'); + try + dataparam := DataParameterArray.Create; + try + for i := 0 to vleExecuteCommandEx.Strings.Count - 1 do begin + with dataparam.Add do begin + Name := vleExecuteCommandEx.Keys[i + 1]; + Value := vleExecuteCommandEx.Values[Name]; + end; + end; + aRowsAffacted := FService.ExecuteCommandEx(AnsiToUtf8(cbExecuteCommandEx.Text), dataparam, outputdataparam); + log('aRowsAffacted:'#9 + intToStr(aRowsAffacted)); + Log('Output parameters count:'#9 + IntToStr(outputdataparam.Count)); + for i := 0 to outputdataparam.Count - 1 do + Log(outputdataparam.Items[i].Name + ':'#9 + VarToStr(outputdataparam.Items[i].Value)); + + finally + outputdataparam.Free; + dataparam.Free; + end; + except + on e: Exception do Log(e.Message); + end; + Log('*******************'); +end; + +procedure TServiceMethods_ClientMainForm.cbExecuteCommandExChange( + Sender: TObject); +var + fcommand: TDASQLCommand; + i: integer; +begin + vleExecuteCommandEx.Strings.Clear; + try + if cbExecuteCommandEx.text = '' then Exit; + fcommand := Schema.Commands.SQLCommandByName(cbExecuteCommandEx.Text); + if fcommand = nil then Exit; + for i := 0 to fcommand.Params.Count - 1 do + if fcommand.Params[i].ParamType in [daptInput, daptInputOutput] then + if vleExecuteCommandEx.Strings.IndexOfName(fcommand.Params[i].Name) = -1 then + vleExecuteCommandEx.InsertRow(fcommand.Params[i].Name, '', True); + finally + vleExecuteCommandEx.Visible := vleExecuteCommandEx.Strings.Count > 0; + end; + + Log('*************SQL**************'); + Log(fcommand.Statements[0].SQL); + Log('******************************'); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.bdsproj new file mode 100644 index 0000000..6364664 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ServiceMethods_Server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.dpr new file mode 100644 index 0000000..5fd9d20 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.dpr @@ -0,0 +1,20 @@ +program ServiceMethods_Server; + +uses + uROCOMInit, + Forms, + ServiceMethods_ServerMain in 'ServiceMethods_ServerMain.pas' {ServiceMethods_ServerMainForm}, + ServiceMethodsLibrary_Intf in 'ServiceMethodsLibrary_Intf.pas', + ServiceMethodsLibrary_Invk in 'ServiceMethodsLibrary_Invk.pas', + ServiceMethods_Service_Impl in 'ServiceMethods_Service_Impl.pas' {ServiceMethods_Service: TDataAbstractService}; + +{#ROGEN:ServiceMethodsLibrary.rodl}// RemObjects: Careful, do not remove! +{$R RODLFILE.res} +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TServiceMethods_ServerMainForm, ServiceMethods_ServerMainForm); + Application.Run; +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.dproj new file mode 100644 index 0000000..9cc8b12 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.dproj @@ -0,0 +1,77 @@ + + + {e615b2bf-3d4f-42f0-a57b-40e742fbf754} + ServiceMethods_Server.dpr + Debug + AnyCPU + DCC32 + ServiceMethods_Server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ServiceMethods_Server.dpr + + + + + + + MainSource + + + + +
ServiceMethods_ServerMainForm
+
+ +
ServiceMethods_Service
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.res new file mode 100644 index 0000000..2435bfa Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Server.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ServerMain.dfm new file mode 100644 index 0000000..607988f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ServerMain.dfm @@ -0,0 +1,464 @@ +object ServiceMethods_ServerMainForm: TServiceMethods_ServerMainForm + Left = 270 + Top = 153 + AutoScroll = False + Caption = 'ServiceMethods Server' + ClientHeight = 435 + ClientWidth = 596 + Color = clBtnFace + Constraints.MinWidth = 604 + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Memo: TMemo + Left = 0 + Top = 250 + Width = 596 + Height = 129 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssVertical + TabOrder = 6 + end + object GroupBox1: TGroupBox + Left = 202 + Top = 2 + Width = 390 + Height = 220 + Caption = 'Log events:' + TabOrder = 1 + object cbAfterReleaseConnection: TCheckBox + Left = 198 + Top = 149 + Width = 187 + Height = 17 + Caption = 'AfterReleaseConnection' + Checked = True + State = cbChecked + TabOrder = 20 + end + object cbAfterProcessDeltas: TCheckBox + Left = 198 + Top = 66 + Width = 187 + Height = 17 + Caption = 'AfterProcessDeltas' + TabOrder = 15 + end + object cbAfterGetDatasetSchema: TCheckBox + Left = 198 + Top = 15 + Width = 187 + Height = 17 + Caption = 'AfterGetDatasetSchema' + Checked = True + State = cbChecked + TabOrder = 12 + end + object cbAfterGetDatasetData: TCheckBox + Left = 7 + Top = 200 + Width = 187 + Height = 17 + Caption = 'AfterGetDatasetData' + TabOrder = 11 + end + object cbAfterExecuteCommand: TCheckBox + Left = 198 + Top = 100 + Width = 187 + Height = 17 + Caption = 'AfterExecuteCommand' + TabOrder = 17 + end + object cbAfterAcquireConnection: TCheckBox + Left = 7 + Top = 66 + Width = 187 + Height = 17 + Caption = 'AfterAcquireConnection' + Checked = True + State = cbChecked + TabOrder = 3 + end + object cbBeforeReleaseConnection: TCheckBox + Left = 198 + Top = 132 + Width = 187 + Height = 17 + Caption = 'BeforeReleaseConnection' + Checked = True + State = cbChecked + TabOrder = 19 + end + object cbBeforeProcessDeltas: TCheckBox + Left = 198 + Top = 32 + Width = 187 + Height = 17 + Caption = 'BeforeProcessDeltas' + TabOrder = 13 + end + object cbBeforeGetDatasetSchema: TCheckBox + Left = 7 + Top = 166 + Width = 187 + Height = 17 + Caption = 'BeforeGetDatasetSchema' + Checked = True + State = cbChecked + TabOrder = 9 + end + object cbBeforeGetDatasetData: TCheckBox + Left = 7 + Top = 183 + Width = 187 + Height = 17 + Caption = 'BeforeGetDatasetData' + TabOrder = 10 + end + object cbBeforeExecuteCommand: TCheckBox + Left = 198 + Top = 83 + Width = 187 + Height = 17 + Caption = 'BeforeExecuteCommand' + TabOrder = 16 + end + object cbBeforeAcquireConnection: TCheckBox + Left = 7 + Top = 32 + Width = 187 + Height = 17 + Caption = 'BeforeAcquireConnection' + Checked = True + State = cbChecked + TabOrder = 1 + end + object cbValidateCommandExecution: TCheckBox + Left = 7 + Top = 100 + Width = 187 + Height = 17 + Caption = 'ValidateCommandExecution' + TabOrder = 5 + end + object cbUpdateDataRollBackTransaction: TCheckBox + Left = 7 + Top = 132 + Width = 187 + Height = 17 + Caption = 'UpdateDataRollBackTransaction' + TabOrder = 7 + end + object cbUpdateDataCommitTransaction: TCheckBox + Left = 198 + Top = 117 + Width = 187 + Height = 17 + Caption = 'UpdateDataCommitTransaction' + Checked = True + State = cbChecked + TabOrder = 18 + end + object cbUpdateDataBeginTransaction: TCheckBox + Left = 7 + Top = 149 + Width = 187 + Height = 17 + Caption = 'UpdateDataBeginTransaction' + Checked = True + State = cbChecked + TabOrder = 8 + end + object cbProcessDeltasError: TCheckBox + Left = 198 + Top = 49 + Width = 187 + Height = 17 + Caption = 'ProcessDeltasError' + TabOrder = 14 + end + object cbGetSchemaAsXMLEvent: TCheckBox + Left = 7 + Top = 15 + Width = 187 + Height = 17 + Caption = 'GetSchemaAsXMLEvent' + TabOrder = 0 + end + object cbValidateDatasetAccess: TCheckBox + Left = 7 + Top = 83 + Width = 187 + Height = 17 + Caption = 'ValidateDatasetAccess' + TabOrder = 4 + end + object cbValidateDirectSQLAccess: TCheckBox + Left = 7 + Top = 117 + Width = 187 + Height = 17 + Caption = 'ValidateDirectSQLAccess' + TabOrder = 6 + end + object cbAcquireConnectionFailure: TCheckBox + Left = 7 + Top = 49 + Width = 187 + Height = 17 + Caption = 'AcquireConnectionFailure' + TabOrder = 2 + end + object cbBusinessProcessorAutoCreated: TCheckBox + Left = 198 + Top = 166 + Width = 187 + Height = 17 + Caption = 'BusinessProcessorAutoCreated' + TabOrder = 21 + end + end + object GroupBox2: TGroupBox + Left = 2 + Top = 2 + Width = 197 + Height = 220 + Caption = 'Server options:' + TabOrder = 0 + DesignSize = ( + 197 + 220) + object cbProcessDeltasErrorRaise: TCheckBox + Left = 5 + Top = 134 + Width = 190 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'Raise ProcessDeltasError' + TabOrder = 7 + end + object cbProcessDeltasWithoutUpdateRules: TCheckBox + Left = 5 + Top = 117 + Width = 190 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'ProcessDeltasWithoutUpdateRules' + TabOrder = 6 + end + object cbAllowExecuteCommands: TCheckBox + Left = 5 + Top = 83 + Width = 190 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'AllowExecuteCommands' + TabOrder = 4 + end + object cbAllowWhereSQL: TCheckBox + Left = 5 + Top = 66 + Width = 190 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'AllowWhereSQL' + TabOrder = 3 + end + object cbAllowExecuteSQL: TCheckBox + Left = 5 + Top = 100 + Width = 190 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'AllowExecuteSQL' + TabOrder = 5 + end + object cbAllowSchemaAccess: TCheckBox + Left = 5 + Top = 15 + Width = 190 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'AllowSchemaAccess' + Checked = True + State = cbChecked + TabOrder = 0 + end + object cbAllowDataAccess: TCheckBox + Left = 5 + Top = 49 + Width = 190 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'AllowDataAccess' + Checked = True + State = cbChecked + TabOrder = 2 + end + object cbAcquireConnection: TCheckBox + Left = 5 + Top = 32 + Width = 190 + Height = 17 + Anchors = [akLeft, akTop, akRight] + Caption = 'AcquireConnection' + Checked = True + State = cbChecked + TabOrder = 1 + end + object cbAllowDynamicSelect: TCheckBox + Left = 5 + Top = 151 + Width = 190 + Height = 14 + Anchors = [akLeft, akTop, akRight] + Caption = 'AllowDynamicSelect' + Checked = True + State = cbChecked + TabOrder = 8 + end + object cbAllowDynamicWhere: TCheckBox + Left = 5 + Top = 168 + Width = 190 + Height = 14 + Anchors = [akLeft, akTop, akRight] + Caption = 'AllowDynamicWhere' + Checked = True + State = cbChecked + TabOrder = 9 + end + object cbAllowUpdates: TCheckBox + Left = 5 + Top = 185 + Width = 190 + Height = 14 + Anchors = [akLeft, akTop, akRight] + Caption = 'AllowUpdates' + Checked = True + State = cbChecked + TabOrder = 10 + end + object cbAutoCreateBusinessProcessors: TCheckBox + Left = 5 + Top = 202 + Width = 190 + Height = 14 + Anchors = [akLeft, akTop, akRight] + Caption = 'AutoCreateBusinessProcessors' + Checked = True + State = cbChecked + TabOrder = 11 + end + end + object CheckAllOptionsButton: TButton + Left = 21 + Top = 225 + Width = 75 + Height = 22 + Caption = 'Check all' + TabOrder = 2 + OnClick = CheckAllOptionsButtonClick + end + object CheckNoneOptionsButton: TButton + Left = 101 + Top = 225 + Width = 75 + Height = 22 + Caption = 'Check none' + TabOrder = 3 + OnClick = CheckNoneOptionsButtonClick + end + object CheckAllEventsButton: TButton + Left = 323 + Top = 225 + Width = 74 + Height = 22 + Caption = 'Check all' + TabOrder = 4 + OnClick = CheckAllEventsButtonClick + end + object CheckNoneEventsButton: TButton + Left = 402 + Top = 225 + Width = 76 + Height = 22 + Caption = 'Check none' + TabOrder = 5 + OnClick = CheckNoneEventsButtonClick + end + object Panel1: TPanel + Left = 0 + Top = 379 + Width = 596 + Height = 56 + Align = alBottom + BevelOuter = bvNone + TabOrder = 7 + DesignSize = ( + 596 + 56) + object DAPoweredByDataAbstractButton2: TDAPoweredByDataAbstractButton + Left = 212 + Top = 6 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object ClearLogButton: TButton + Left = 515 + Top = 3 + Width = 75 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Clear log' + TabOrder = 0 + OnClick = ClearLogButtonClick + end + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'Northwind' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 278 + Top = 395 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 305 + Top = 395 + end + object ADODriver: TDAADODriver + Left = 389 + Top = 395 + end + object Server: TROIndyHTTPServer + Dispatchers = < + item + Name = 'Message' + Message = Message + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 333 + Top = 395 + end + object Message: TROBinMessage + Left = 361 + Top = 395 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ServerMain.pas new file mode 100644 index 0000000..748b637 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_ServerMain.pas @@ -0,0 +1,186 @@ +unit ServiceMethods_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uROPoweredByRemObjectsButton, uDAPoweredByDataAbstractButton, + StdCtrls, SyncObjs, uDAEngine, uDAADODriver, uDADriverManager, uDAClasses, + uROClient, uROBinMessage, uROServer, uROIndyTCPServer, uROIndyHTTPServer, + ExtCtrls; + +type + TServiceMethods_ServerMainForm = class(TForm) + Memo: TMemo; + ConnectionManager: TDAConnectionManager; + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + Server: TROIndyHTTPServer; + Message: TROBinMessage; + GroupBox1: TGroupBox; + cbAfterReleaseConnection: TCheckBox; + cbAfterProcessDeltas: TCheckBox; + cbAfterGetDatasetSchema: TCheckBox; + cbAfterGetDatasetData: TCheckBox; + cbAfterExecuteCommand: TCheckBox; + cbAfterAcquireConnection: TCheckBox; + cbBeforeReleaseConnection: TCheckBox; + cbBeforeProcessDeltas: TCheckBox; + cbBeforeGetDatasetSchema: TCheckBox; + cbBeforeGetDatasetData: TCheckBox; + cbBeforeExecuteCommand: TCheckBox; + cbBeforeAcquireConnection: TCheckBox; + cbValidateCommandExecution: TCheckBox; + cbUpdateDataRollBackTransaction: TCheckBox; + cbUpdateDataCommitTransaction: TCheckBox; + cbUpdateDataBeginTransaction: TCheckBox; + cbProcessDeltasError: TCheckBox; + cbGetSchemaAsXMLEvent: TCheckBox; + cbValidateDatasetAccess: TCheckBox; + cbValidateDirectSQLAccess: TCheckBox; + cbAcquireConnectionFailure: TCheckBox; + GroupBox2: TGroupBox; + cbProcessDeltasErrorRaise: TCheckBox; + cbProcessDeltasWithoutUpdateRules: TCheckBox; + cbAllowExecuteCommands: TCheckBox; + cbAllowWhereSQL: TCheckBox; + cbAllowExecuteSQL: TCheckBox; + cbAllowSchemaAccess: TCheckBox; + cbAllowDataAccess: TCheckBox; + cbAcquireConnection: TCheckBox; + CheckAllOptionsButton: TButton; + CheckNoneOptionsButton: TButton; + CheckAllEventsButton: TButton; + CheckNoneEventsButton: TButton; + Panel1: TPanel; + DAPoweredByDataAbstractButton2: TDAPoweredByDataAbstractButton; + ClearLogButton: TButton; + cbAllowDynamicSelect: TCheckBox; + cbAllowDynamicWhere: TCheckBox; + cbAllowUpdates: TCheckBox; + cbAutoCreateBusinessProcessors: TCheckBox; + cbBusinessProcessorAutoCreated: TCheckBox; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure ClearLogButtonClick(Sender: TObject); + procedure CheckAllOptionsButtonClick(Sender: TObject); + procedure CheckNoneOptionsButtonClick(Sender: TObject); + procedure CheckAllEventsButtonClick(Sender: TObject); + procedure CheckNoneEventsButtonClick(Sender: TObject); + private + { Private declarations } + FcriticalSection: TCriticalSection; + procedure ChangeOptions(Mode: Boolean); + procedure ChangeEvent(Mode: Boolean); + public + { Public declarations } + procedure Log(Str: string); + end; + +var + ServiceMethods_ServerMainForm: TServiceMethods_ServerMainForm; + +implementation + +{$R *.dfm} + +{ TServiceMethods_ServerMainForm } + +procedure TServiceMethods_ServerMainForm.Log(Str: string); +begin + FcriticalSection.Enter; + try + Memo.Lines.Add(Str); + finally + FcriticalSection.Leave; + end; +end; + +procedure TServiceMethods_ServerMainForm.FormCreate(Sender: TObject); +begin + FcriticalSection := TCriticalSection.Create; + + Server.Active := True; +end; + +procedure TServiceMethods_ServerMainForm.FormDestroy(Sender: TObject); +begin + FcriticalSection.Free; +end; + +procedure TServiceMethods_ServerMainForm.ClearLogButtonClick( + Sender: TObject); +begin + FcriticalSection.Enter; + try + Memo.Lines.Clear; + finally + FcriticalSection.Leave; + end; +end; + +procedure TServiceMethods_ServerMainForm.CheckAllOptionsButtonClick(Sender: TObject); +begin + ChangeOptions(True); +end; + +procedure TServiceMethods_ServerMainForm.ChangeOptions(Mode: Boolean); +begin + cbAllowSchemaAccess.Checked := Mode; + cbAcquireConnection.Checked := Mode; + cbAllowDataAccess.Checked := Mode; + cbAllowWhereSQL.Checked := Mode; + cbAllowExecuteCommands.Checked := Mode; + cbAllowExecuteSQL.Checked := Mode; + cbProcessDeltasWithoutUpdateRules.Checked := Mode; + cbProcessDeltasErrorRaise.Checked := Mode; + cbAllowDynamicSelect.Checked := Mode; + cbAllowDynamicWhere.Checked := Mode; + cbAllowUpdates.Checked := Mode; + cbAutoCreateBusinessProcessors.Checked := Mode; +end; + +procedure TServiceMethods_ServerMainForm.CheckNoneOptionsButtonClick( + Sender: TObject); +begin + ChangeOptions(False); +end; + +procedure TServiceMethods_ServerMainForm.ChangeEvent(Mode: Boolean); +begin + cbAfterReleaseConnection.Checked := Mode; + cbAfterProcessDeltas.Checked := Mode; + cbAfterGetDatasetSchema.Checked := Mode; + cbAfterGetDatasetData.Checked := Mode; + cbAfterExecuteCommand.Checked := Mode; + cbAfterAcquireConnection.Checked := Mode; + cbBeforeReleaseConnection.Checked := Mode; + cbBeforeProcessDeltas.Checked := Mode; + cbBeforeGetDatasetSchema.Checked := Mode; + cbBeforeGetDatasetData.Checked := Mode; + cbBeforeExecuteCommand.Checked := Mode; + cbBeforeAcquireConnection.Checked := Mode; + cbValidateCommandExecution.Checked := Mode; + cbUpdateDataRollBackTransaction.Checked := Mode; + cbUpdateDataCommitTransaction.Checked := Mode; + cbUpdateDataBeginTransaction.Checked := Mode; + cbProcessDeltasError.Checked := Mode; + cbGetSchemaAsXMLEvent.Checked := Mode; + cbValidateDatasetAccess.Checked := Mode; + cbValidateDirectSQLAccess.Checked := Mode; + cbAcquireConnectionFailure.Checked := Mode; + cbBusinessProcessorAutoCreated.Checked := Mode; +end; + +procedure TServiceMethods_ServerMainForm.CheckAllEventsButtonClick(Sender: TObject); +begin + ChangeEvent(True); +end; + +procedure TServiceMethods_ServerMainForm.CheckNoneEventsButtonClick(Sender: TObject); +begin + ChangeEvent(False); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Service_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Service_Impl.dfm new file mode 100644 index 0000000..86b9676 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Service_Impl.dfm @@ -0,0 +1,356 @@ +object ServiceMethods_Service: TServiceMethods_Service + OldCreateOrder = True + OnCreate = DataAbstractServiceCreate + OnDestroy = DataAbstractServiceDestroy + OnActivate = DataAbstractServiceActivate + OnDeactivate = DataAbstractServiceDeactivate + AcquireConnection = False + ServiceSchema = DASchema + ServiceDataStreamer = BinDataStreamer + ExportedDataTables = <> + BeforeAcquireConnection = DataAbstractServiceBeforeAcquireConnection + AfterAcquireConnection = DataAbstractServiceAfterAcquireConnection + BeforeReleaseConnection = DataAbstractServiceBeforeReleaseConnection + AfterReleaseConnection = DataAbstractServiceAfterReleaseConnection + OnAcquireConnectionFailure = DataAbstractServiceAcquireConnectionFailure + BeforeProcessDeltas = DataAbstractServiceBeforeProcessDeltas + AfterProcessDeltas = DataAbstractServiceAfterProcessDeltas + OnProcessDeltasError = DataAbstractServiceProcessDeltasError + BeforeGetDatasetSchema = DataAbstractServiceBeforeGetDatasetSchema + BeforeGetDatasetData = DataAbstractServiceBeforeGetDatasetData + AfterGetDatasetSchema = DataAbstractServiceAfterGetDatasetSchema + AfterGetDatasetData = DataAbstractServiceAfterGetDatasetData + OnBusinessProcessorAutoCreated = DataAbstractServiceBusinessProcessorAutoCreated + BeforeExecuteCommand = DataAbstractServiceBeforeExecuteCommand + AfterExecuteCommand = DataAbstractServiceAfterExecuteCommand + OnGetSchemaAsXMLEvent = DataAbstractServiceGetSchemaAsXMLEvent + ValidateDatasetAccess = DataAbstractServiceValidateDatasetAccess + ValidateCommandExecution = DataAbstractServiceValidateCommandExecution + ValidateDirectSQLAccess = DataAbstractServiceValidateDirectSQLAccess + OnUpdateDataBeginTransaction = DataAbstractServiceUpdateDataBeginTransaction + OnUpdateDataCommitTransaction = DataAbstractServiceUpdateDataCommitTransaction + OnUpdateDataRollBackTransaction = DataAbstractServiceUpdateDataRollBackTransaction + Left = 576 + Top = 180 + Height = 300 + Width = 300 + object BinDataStreamer: TDABinDataStreamer + Left = 29 + Top = 10 + end + object DASchema: TDASchema + ConnectionManager = ServiceMethods_ServerMainForm.ConnectionManager + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + LogChanges = False + InPrimaryKey = True + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + end + item + Name = 'City' + DataType = datWideString + Size = 15 + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + end> + end + item + Params = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + ParamType = daptInput + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Orders' + SQL = + 'SELECT OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate,' + + ' ShippedDate, ShipVia, Freight, ShipName, ShipAddress, ShipCity,' + + ' ShipRegion, ShipPostalCode, ShipCountry FROM Orders Where Custo' + + 'merID = :CustomerID' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datInteger + LogChanges = False + InPrimaryKey = True + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + end + item + Name = 'EmployeeID' + DataType = datInteger + end + item + Name = 'OrderDate' + DataType = datDateTime + end + item + Name = 'RequiredDate' + DataType = datDateTime + end + item + Name = 'ShippedDate' + DataType = datDateTime + end + item + Name = 'ShipVia' + DataType = datInteger + end + item + Name = 'Freight' + DataType = datFloat + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + end> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = < + item + Params = < + item + Name = 'CUSTOMERS_CNT' + DataType = datInteger + ParamType = daptOutput + end> + Statements = < + item + Connection = 'Northwind' + SQL = 'SELECT :CUSTOMERS_CNT = count(*) from customers'#10 + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'CustomersCount' + end + item + Params = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + ParamType = daptInput + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + ParamType = daptInput + end> + Statements = < + item + Connection = 'Northwind' + TargetTable = 'Orders' + SQL = + 'update orders set CustomerID = :CustomerID where CustomerID = :C' + + 'ustomerID'#10 + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'UpdateOrders' + end> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 29 + Top = 55 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Service_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Service_Impl.pas new file mode 100644 index 0000000..a27d40d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Service Methods/ServiceMethods_Service_Impl.pas @@ -0,0 +1,490 @@ +unit ServiceMethods_Service_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} ServiceMethodsLibrary_Intf, uDADataStreamer, uDABinAdapter, + uDAInterfaces, uDABusinessProcessor, uDAClasses, uRORemoteDataModule; + +type + { TServiceMethods_Service } + TServiceMethods_Service = class(TDataAbstractService, IServiceMethods_Service) + BinDataStreamer: TDABinDataStreamer; + DASchema: TDASchema; + procedure DataAbstractServiceAfterAcquireConnection(aSender: TObject; + const aConnectionName: string; + const aAcquiredConnection: IDAConnection); + procedure DataAbstractServiceAfterExecuteCommand(aSender: TObject; + const aCommand: IDASQLCommand; aRowsAffacted: Integer); + procedure DataAbstractServiceAfterGetDatasetData(aSender: TObject; + const aDataset: IDADataset; const aIncludeSchema: Boolean; + const aMaxRecords: Integer); + procedure DataAbstractServiceAfterGetDatasetSchema(aSender: TObject; + const aDataset: IDADataset); + procedure DataAbstractServiceAfterProcessDeltas(aSender: TObject; + aDeltaStructs: TDADeltaStructList); + procedure DataAbstractServiceAfterReleaseConnection(aSender: TObject; + const aConnectionName: string); + procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; + var aConnectionName: string); + procedure DataAbstractServiceBeforeExecuteCommand(aSender: TObject; + const aCommand: IDASQLCommand); + procedure DataAbstractServiceBeforeGetDatasetData(aSender: TObject; + const aDataset: IDADataset; const aIncludeSchema: Boolean; + const aMaxRecords: Integer); + procedure DataAbstractServiceBeforeGetDatasetSchema(aSender: TObject; + const aDataset: IDADataset); + procedure DataAbstractServiceBeforeProcessDeltas(aSender: TObject; + aDeltaStructs: TDADeltaStructList); + procedure DataAbstractServiceBeforeReleaseConnection(aSender: TObject; + const aConnectionName: string; + const aAcquiredConnection: IDAConnection); + procedure DataAbstractServiceGetSchemaAsXMLEvent(aSender: TObject; + var aSchemaXML: UTF8string); + procedure DataAbstractServiceProcessDeltasError(aSender: TObject; + aDeltaStructs: TDADeltaStructList; aError: Exception; + var aDoRaise: Boolean); + procedure DataAbstractServiceUpdateDataBeginTransaction( + Sender: TObject; var aUseDefaultTransactionLogic: Boolean); + procedure DataAbstractServiceUpdateDataCommitTransaction( + Sender: TObject; var aUseDefaultTransactionLogic: Boolean); + procedure DataAbstractServiceUpdateDataRollBackTransaction( + Sender: TObject; var aUseDefaultTransactionLogic: Boolean); + procedure DataAbstractServiceValidateCommandExecution(Sender: TObject; + const aConnection: IDAConnection; const aDatasetName: string; + const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); + procedure DataAbstractServiceValidateDatasetAccess(Sender: TObject; + const aConnection: IDAConnection; const aDatasetName: string; + const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); + procedure DataAbstractServiceValidateDirectSQLAccess(Sender: TObject; + const aConnection: IDAConnection; const aSQLText: string; + const aParamNames: array of string; + const aParamValues: array of Variant; var Allowed: Boolean); + procedure DataAbstractServiceAcquireConnectionFailure(aSender: TObject; + const aConnectionName: string; aError: Exception); + procedure DataAbstractServiceCreate(Sender: TObject); + procedure DataAbstractServiceDestroy(Sender: TObject); + procedure DataAbstractServiceActivate(const aClientID: TGUID; + aSession: TROSession; const aMessage: IROMessage); + procedure DataAbstractServiceDeactivate(const aClientID: TGUID; + aSession: TROSession); + procedure DataAbstractServiceBusinessProcessorAutoCreated( + aSender: TRORemoteDataModule; + BusinessProcessor: TDABusinessProcessor); + private + procedure Log(Astr: string); + protected + { IServiceMethods_Service methods } + end; + +implementation + +{$R *.dfm} +uses + {Generated:} ServiceMethodsLibrary_Invk, + ServiceMethods_ServerMain, Variants; + +procedure Create_ServiceMethods_Service(out anInstance: IUnknown); +begin + anInstance := TServiceMethods_Service.Create(nil); +end; + +{ TServiceMethods_Service } + +procedure TServiceMethods_Service.Log(Astr: string); +begin + ServiceMethods_ServerMainForm.Log(Astr); +end; + +procedure TServiceMethods_Service.DataAbstractServiceAfterAcquireConnection( + aSender: TObject; const aConnectionName: string; + const aAcquiredConnection: IDAConnection); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbAfterAcquireConnection.Checked then Exit; + Log('***AfterAcquireConnection***'); + Log('ConnectionName:'#9 + aConnectionName); + Log('aAcquiredConnection.Name:'#9 + aAcquiredConnection.Name); + Log('aAcquiredConnection.ConnectionString:'#9 + aAcquiredConnection.ConnectionString); + Log('****************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceAfterExecuteCommand( + aSender: TObject; const aCommand: IDASQLCommand; aRowsAffacted: Integer); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbAfterExecuteCommand.Checked then Exit; + Log('***AfterExecuteCommand***'); + Log('aCommand.Name:'#9 + aCommand.Name); + Log('aCommand.SQL:'#9 + aCommand.SQL); + Log('aRowsAffacted:'#9 + IntToStr(aRowsAffacted)); + Log('*************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceAfterGetDatasetData( + aSender: TObject; const aDataset: IDADataset; + const aIncludeSchema: Boolean; const aMaxRecords: Integer); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbAfterGetDatasetData.Checked then Exit; + Log('***AfterGetDatasetData***'); + Log('aDataset.Name:'#9 + aDataset.Name); + Log('aDataset.SQL:'#9 + aDataset.SQL); + Log('aIncludeSchema:'#9 + BoolStr[aIncludeSchema]); + Log('aMaxRecords:'#9 + IntToStr(aMaxRecords)); + Log('*************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceAfterGetDatasetSchema( + aSender: TObject; const aDataset: IDADataset); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbAfterGetDatasetSchema.Checked then Exit; + Log('***AfterGetDatasetSchema***'); + Log('aDataset.Name:'#9 + aDataset.Name); + Log('aDataset.SQL:'#9 + aDataset.SQL); + Log('***************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceAfterProcessDeltas( + aSender: TObject; aDeltaStructs: TDADeltaStructList); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbAfterProcessDeltas.Checked then Exit; + Log('***AfterProcessDeltas***'); + Log('aDeltaStructs.Count:'#9 + IntToStr(aDeltaStructs.Count)); + Log('************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceAfterReleaseConnection( + aSender: TObject; const aConnectionName: string); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbAfterReleaseConnection.Checked then Exit; + Log('***AfterReleaseConnection***'); + Log('aConnectionName:'#9 + aConnectionName); + Log('****************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceBeforeAcquireConnection( + aSender: TObject; var aConnectionName: string); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbBeforeAcquireConnection.Checked then Exit; + + Log('***BeforeAcquireConnection***'); + Log('aConnectionName:'#9 + aConnectionName); + Log('************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceBeforeExecuteCommand( + aSender: TObject; const aCommand: IDASQLCommand); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbBeforeExecuteCommand.Checked then Exit; + Log('***BeforeExecuteCommand***'); + Log('aCommand.Name:'#9 + aCommand.Name); + Log('aCommand.SQL:'#9 + aCommand.SQL); + Log('************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceBeforeGetDatasetData( + aSender: TObject; const aDataset: IDADataset; + const aIncludeSchema: Boolean; const aMaxRecords: Integer); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbBeforeGetDatasetData.Checked then Exit; + + Log('***BeforeGetDatasetData***'); + Log('aDataset.Name:'#9 + aDataset.Name); + Log('aDataset.SQL:'#9 + aDataset.SQL); + Log('aIncludeSchema:'#9 + BoolStr[aIncludeSchema]); + Log('aMaxRecords:'#9 + IntToStr(aMaxRecords)); + Log('*************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceBeforeGetDatasetSchema( + aSender: TObject; const aDataset: IDADataset); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbBeforeGetDatasetSchema.Checked then Exit; + + Log('***BeforeGetDatasetSchema***'); + Log('aDataset.Name:'#9 + aDataset.Name); + Log('aDataset.SQL:'#9 + aDataset.SQL); + Log('****************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceBeforeProcessDeltas( + aSender: TObject; aDeltaStructs: TDADeltaStructList); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbBeforeProcessDeltas.Checked then Exit; + Log('***BeforeProcessDeltas***'); + Log('aDeltaStructs.Count:'#9 + IntToStr(aDeltaStructs.Count)); + Log('*************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceBeforeReleaseConnection( + aSender: TObject; const aConnectionName: string; + const aAcquiredConnection: IDAConnection); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbBeforeReleaseConnection.Checked then Exit; + + Log('***BeforeReleaseConnection***'); + Log('aConnectionName:'#9 + aConnectionName); + Log('aAcquiredConnection.Name:'#9 + aAcquiredConnection.Name); + Log('aAcquiredConnection.ConnectionString:'#9 + aAcquiredConnection.ConnectionString); + Log('*****************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceGetSchemaAsXMLEvent( + aSender: TObject; var aSchemaXML: UTF8string); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbGetSchemaAsXMLEvent.Checked then Exit; + + Log('***GetSchemaAsXMLEvent***'); + Log('Length(aSchemaXML):'#9 + intTostr(Length(aSchemaXML))); + Log('*************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceProcessDeltasError( + aSender: TObject; aDeltaStructs: TDADeltaStructList; aError: Exception; + var aDoRaise: Boolean); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbProcessDeltasError.Checked then Exit; + + aDoRaise := ServiceMethods_ServerMainForm.cbProcessDeltasErrorRaise.Checked; + Log('***ProcessDeltasError***'); + Log('aDeltaStructs.Count:'#9 + IntToStr(aDeltaStructs.Count)); + Log('aError.ClassName:'#9 + aError.ClassName); + Log('aError.Message:'#9 + aError.Message); + Log('aDoRaise:'#9 + BoolStr[aDoRaise]); + Log('*************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceUpdateDataBeginTransaction( + Sender: TObject; var aUseDefaultTransactionLogic: Boolean); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbUpdateDataBeginTransaction.Checked then Exit; + + Log('***UpdateDataBeginTransaction***'); + Log('aUseDefaultTransactionLogic:'#9 + BoolStr[aUseDefaultTransactionLogic]); + Log('********************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceUpdateDataCommitTransaction( + Sender: TObject; var aUseDefaultTransactionLogic: Boolean); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbUpdateDataCommitTransaction.Checked then Exit; + + Log('***UpdateDataCommitTransaction***'); + Log('aUseDefaultTransactionLogic:'#9 + BoolStr[aUseDefaultTransactionLogic]); + Log('*********************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceUpdateDataRollBackTransaction( + Sender: TObject; var aUseDefaultTransactionLogic: Boolean); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbUpdateDataRollBackTransaction.Checked then Exit; + Log('***UpdateDataRollBackTransaction***'); + Log('aUseDefaultTransactionLogic:'#9 + BoolStr[aUseDefaultTransactionLogic]); + Log('***********************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceValidateCommandExecution( + Sender: TObject; const aConnection: IDAConnection; + const aDatasetName: string; const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); +var + i: integer; + SQLCommand: TDASQLCommand; +begin + inherited; + if not ServiceMethods_ServerMainForm.cbValidateCommandExecution.Checked then Exit; + + Log('***ValidateCommandExecution***'); + Log('aConnection.Name:'#9 + aConnection.Name); + Log('aDatasetName:'#9 + aDatasetName); + SQLCommand := aSchema.Commands.SQLCommandByName(aDatasetName); + if (SQLCommand <> nil) and (SQLCommand.Statements.Count > 0) then + Log('Command SQL:'#9 + SQLCommand.Statements[0].SQL); + Log('ParamCount:'#9 + intToStr(1 + ord(High(aParamNames)) - ord(Low(aParamNames)))); + for i := Low(aParamNames) to High(aParamNames) do + Log(#9 + aParamNames[i] + ' = ' + VarToStr(aParamValues[i])); + Log('aSchema.Name:'#9 + aSchema.Name); + Log('Allowed:'#9 + BoolStr[Allowed]); + Log('******************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceValidateDatasetAccess( + Sender: TObject; const aConnection: IDAConnection; + const aDatasetName: string; const aParamNames: array of string; + const aParamValues: array of Variant; aSchema: TDASchema; + var Allowed: Boolean); +var + i: integer; +begin + inherited; + if not ServiceMethods_ServerMainForm.cbValidateDatasetAccess.Checked then Exit; + + Log('***ValidateDatasetAccess***'); + Log('aConnection.Name:'#9 + aConnection.Name); + Log('aDatasetName:'#9 + aDatasetName); + Log('ParamCount:'#9 + intToStr(1 + ord(High(aParamNames)) - ord(Low(aParamNames)))); + for i := Low(aParamNames) to High(aParamNames) do + Log(#9 + aParamNames[i] + ' = ' + VarToStr(aParamValues[i])); + Log('aSchema.Name:'#9 + aSchema.Name); + Log('Allowed:'#9 + BoolStr[Allowed]); + Log('***************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceValidateDirectSQLAccess( + Sender: TObject; const aConnection: IDAConnection; + const aSQLText: string; const aParamNames: array of string; + const aParamValues: array of Variant; var Allowed: Boolean); +var + i: integer; +begin + inherited; + if not ServiceMethods_ServerMainForm.cbValidateDirectSQLAccess.Checked then Exit; + + Log('***ValidateDirectSQLAccess***'); + Log('aConnection.Name:'#9 + aConnection.Name); + Log('aSQLText:'#9 + aSQLText); + Log('ParamCount:'#9 + intToStr(1 + ord(High(aParamNames)) - ord(Low(aParamNames)))); + for i := Low(aParamNames) to High(aParamNames) do + Log(#9 + aParamNames[i] + ' = ' + VarToStr(aParamValues[i])); + Log('Allowed:'#9 + BoolStr[Allowed]); + Log('***************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceAcquireConnectionFailure( + aSender: TObject; const aConnectionName: string; aError: Exception); +begin + inherited; + if not ServiceMethods_ServerMainForm.cbAcquireConnectionFailure.Checked then Exit; + + Log('***AcquireConnectionFailure***'); + Log('aConnectionName:'#9 + aConnectionName); + Log('aError.ClassName:'#9 + aError.ClassName); + Log('aError.Message:'#9 + aError.Message); + Log('******************************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceCreate( + Sender: TObject); +begin + inherited; + AllowSchemaAccess := ServiceMethods_ServerMainForm.cbAllowSchemaAccess.Checked; + AcquireConnection := ServiceMethods_ServerMainForm.cbAcquireConnection.Checked; + AllowDataAccess := ServiceMethods_ServerMainForm.cbAllowDataAccess.Checked; + AllowWhereSQL := ServiceMethods_ServerMainForm.cbAllowWhereSQL.Checked; + AllowExecuteCommands := ServiceMethods_ServerMainForm.cbAllowExecuteCommands.Checked; + AllowExecuteSQL := ServiceMethods_ServerMainForm.cbAllowExecuteSQL.Checked; + ProcessDeltasWithoutUpdateRules := ServiceMethods_ServerMainForm.cbProcessDeltasWithoutUpdateRules.Checked; + AllowDynamicSelect := ServiceMethods_ServerMainForm.cbAllowDynamicSelect.Checked; + AllowDynamicWhere := ServiceMethods_ServerMainForm.cbAllowDynamicWhere.Checked; + AllowUpdates := ServiceMethods_ServerMainForm.cbAllowUpdates.Checked; + AutoCreateBusinessProcessors := ServiceMethods_ServerMainForm.cbAutoCreateBusinessProcessors.Checked; + Exit; + + Log('***Create***'); + Log('************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceDestroy( + Sender: TObject); +begin + Exit; + + Log('***Destroy***'); + Log('*************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceActivate( + const aClientID: TGUID; aSession: TROSession; + const aMessage: IROMessage); +begin + Exit; + + Log('***Activate***'); + Log('aClientID:'#9 + GUIDToString(aClientID)); + // Log('aSession:'#9 + aSession.ClassName); + // Log('aError.Message:'#9 + aError.Message); + Log('**************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceDeactivate( + const aClientID: TGUID; aSession: TROSession); +begin + Exit; + + Log('***Deactivate***'); + Log('aClientID:'#9 + GUIDToString(aClientID)); + Log('****************'); + Log(''); +end; + +procedure TServiceMethods_Service.DataAbstractServiceBusinessProcessorAutoCreated( + aSender: TRORemoteDataModule; BusinessProcessor: TDABusinessProcessor); +begin + if not ServiceMethods_ServerMainForm.cbBusinessProcessorAutoCreated.Checked then Exit; + Log('***BusinessProcessorAutoCreated***'); + Log('****************'); + Log(''); +end; + +initialization + TROClassFactory.Create('ServiceMethods_Service', Create_ServiceMethods_Service, TServiceMethods_Service_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.Sample.html new file mode 100644 index 0000000..4252b3c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.Sample.html @@ -0,0 +1,36 @@ + + + + + + + + + +

+ Stored Procedures Sample +

+ + +

Purpose

+ +

+This example shows how to use the IDAConnection's GetStoredProcedureNames method to retrieve a list of stored procedures for the connection. +
+It also shows how to use IDAConnection's NewCommand to access the IDASQLCommand interface: +

+
    +
  • RefreshParams receives the parameters of this stored procedure.
  • +
  • Execute the stored procedure.
  • +
+ +

Examine the Code

+
    +
  • + See the simple code in StoredProceduresMain.pas. +
  • +
+ + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.bdsproj new file mode 100644 index 0000000..326beb1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + StoredProcedures.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.dpr new file mode 100644 index 0000000..13269b1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.dpr @@ -0,0 +1,13 @@ +program StoredProcedures; + +uses + Forms, + StoredProceduresMain in 'StoredProceduresMain.pas' {StoredProceduresMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TStoredProceduresMainForm, StoredProceduresMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.dproj new file mode 100644 index 0000000..1c4e47d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.dproj @@ -0,0 +1,72 @@ + + + {d57caf23-caa8-469d-81c2-3f5757a0f663} + StoredProcedures.dpr + Debug + AnyCPU + DCC32 + StoredProcedures.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + StoredProcedures.dpr + + + + + + + MainSource + + +
StoredProceduresMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.res new file mode 100644 index 0000000..b946fbb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProcedures.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProceduresMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProceduresMain.dfm new file mode 100644 index 0000000..89c4cdb --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProceduresMain.dfm @@ -0,0 +1,192 @@ +object StoredProceduresMainForm: TStoredProceduresMainForm + Left = 43 + Top = 144 + AutoScroll = False + Caption = 'Stored Procedure Demo' + ClientHeight = 340 + ClientWidth = 573 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 40 + Top = 16 + Width = 54 + Height = 13 + Caption = 'Connection' + end + object Label2: TLabel + Left = 8 + Top = 48 + Width = 86 + Height = 13 + Caption = 'Stored Procedure:' + end + object Label3: TLabel + Left = 408 + Top = 318 + Width = 28 + Height = 13 + Caption = 'Times' + end + object ExecuteButton: TButton + Left = 240 + Top = 312 + Width = 75 + Height = 25 + Caption = 'Execute' + TabOrder = 5 + OnClick = ExecuteButtonClick + end + object cbConnName: TComboBox + Left = 104 + Top = 12 + Width = 225 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 0 + end + object cbSPNames: TComboBox + Left = 104 + Top = 44 + Width = 225 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 2 + end + object ConnectButton: TButton + Left = 336 + Top = 10 + Width = 75 + Height = 25 + Caption = 'Connect' + TabOrder = 1 + OnClick = ConnectButtonClick + end + object ListParamsButton: TButton + Left = 336 + Top = 42 + Width = 75 + Height = 25 + Caption = 'List Params' + TabOrder = 3 + OnClick = ListParamsButtonClick + end + object StringGrid: TStringGrid + Left = 8 + Top = 80 + Width = 561 + Height = 217 + DefaultRowHeight = 16 + FixedCols = 4 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing] + TabOrder = 4 + ColWidths = ( + 129 + 67 + 65 + 65 + 201) + end + object SpinEdit: TSpinEdit + Left = 328 + Top = 313 + Width = 73 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 6 + Value = 1 + end + object DAConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Description = 'Borland ADOExpress Connection' + Default = True + Tag = 0 + end + item + Name = 'IBX' + ConnectionString = + 'IBX?Server=;UserID=sysdba;Password=masterkey;Database=C:\Program' + + ' Files\Borland\InterBase\examples\database\Employee.gdb' + Description = 'Borland IBExpress Connection' + Default = False + Tag = 0 + end> + DriverManager = DADriverManager + PoolingEnabled = True + Left = 416 + Top = 16 + end + object DADriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 384 + Top = 16 + end + object DASchema: TDASchema + ConnectionManager = DAConnectionManager + Datasets = <> + Commands = < + item + Params = <> + Statements = < + item + Connection = 'SDAC' + SQL = 'TestOutputParam' + StatementType = stStoredProcedure + ColumnMappings = <> + end + item + Connection = 'ADO' + SQL = 'TestOutputParam' + StatementType = stStoredProcedure + ColumnMappings = <> + end> + Name = 'Execute2' + end + item + Params = < + item + Name = 'InputText' + BlobType = dabtUnknown + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + SQL = + 'DECLARE @RC int'#10'DECLARE @InputText varchar(30)'#10'DECLARE @InputTex' + + 'tLength int'#10'DECLARE @SomethingElse varchar(200)'#10#10'SET @InputText ' + + '= :InputText'#10#10'EXEC @RC = TestOutputParam @InputText, @InputTextL' + + 'ength OUTPUT , @SomethingElse OUTPUT' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Execute1' + end> + RelationShips = <> + UpdateRules = <> + Left = 448 + Top = 16 + end + object DAADODriver1: TDAADODriver + Left = 480 + Top = 16 + end + object DAIBXDriver1: TDAIBXDriver + Left = 480 + Top = 48 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProceduresMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProceduresMain.pas new file mode 100644 index 0000000..1690f36 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Stored Procedures/StoredProceduresMain.pas @@ -0,0 +1,137 @@ +unit StoredProceduresMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uDADriverManager, uDAClasses, StdCtrls, uDAInterfaces, + uDAEngine, uDAADODriver, Grids, uDAIBXDriver, + Spin; + +type + TStoredProceduresMainForm = class(TForm) + DADriverManager: TDADriverManager; + ExecuteButton: TButton; + DAADODriver1: TDAADODriver; + Label1: TLabel; + cbConnName: TComboBox; + Label2: TLabel; + cbSPNames: TComboBox; + ConnectButton: TButton; + ListParamsButton: TButton; + StringGrid: TStringGrid; + DAIBXDriver1: TDAIBXDriver; + SpinEdit: TSpinEdit; + Label3: TLabel; + DAConnectionManager: TDAConnectionManager; + DASchema: TDASchema; + procedure ExecuteButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure ConnectButtonClick(Sender: TObject); + procedure ListParamsButtonClick(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + fConn : IDAConnection; + + procedure CheckConnection; + public + end; + +var + StoredProceduresMainForm: TStoredProceduresMainForm; + +implementation + +uses uROClasses, TypInfo; + +{$R *.dfm} + +procedure TStoredProceduresMainForm.CheckConnection; +begin + Check(fConn=NIL, 'Connect to a database first!'); +end; + +procedure TStoredProceduresMainForm.ExecuteButtonClick(Sender: TObject); +var cmd : IDASQLCommand; + x, i : integer; +begin + CheckConnection; + cmd := fConn.NewCommand(cbSPNames.Text, stStoredProcedure); + cmd.RefreshParams; + + for x := 1 to SpinEdit.Value do begin + for i := 0 to cmd.Params.Count-1 do + if (StringGrid.Cells[4, i+1]<>'') + then cmd.ParamByName(StringGrid.Cells[0, i+1]).AsString := StringGrid.Cells[4, i+1]; + + cmd.Execute; + + for i := 0 to cmd.Params.Count-1 do + StringGrid.Cells[4, i+1] := cmd.ParamByName(StringGrid.Cells[0, i+1]).AsString; + end; +end; + +procedure TStoredProceduresMainForm.FormCreate(Sender: TObject); +var i : integer; +begin + for i := 0 to DAConnectionManager.Connections.Count-1 do + cbConnName.Items.Add(DAConnectionManager.Connections[i].Name); + cbConnName.ItemIndex := 0; +end; + +procedure TStoredProceduresMainForm.ConnectButtonClick(Sender: TObject); +var i : integer; + names : IROStrings; +begin + fConn := DAConnectionManager.NewConnection(cbConnName.Text); + cbSPNames.Items.Clear; + + names := NewROStrings; + fConn.GetStoredProcedureNames(names); + for i := 0 to (names.Count-1) do + cbSPNames.Items.Add(names[i]); + + cbSPNames.ItemIndex := 0; + cbSPNames.DroppedDown := TRUE; + + ListParamsButton.Enabled := cbSPNames.Items.Count>0 +end; + +procedure TStoredProceduresMainForm.ListParamsButtonClick(Sender: TObject); +var i : integer; + cmd : IDASQLCommand; + par : TDAParam; +begin + CheckConnection; + + cmd := fConn.NewCommand(cbSPNames.Text, stStoredProcedure); + cmd.RefreshParams; + + StringGrid.RowCount := cmd.Params.Count+1; + if (StringGrid.RowCount>1) + then StringGrid.FixedRows := 1; + StringGrid.FixedCols := 4; + + StringGrid.Cells[0, 0] := 'Name'; + StringGrid.Cells[1, 0] := 'Type'; + StringGrid.Cells[2, 0] := 'Size'; + StringGrid.Cells[3, 0] := 'Direction'; + StringGrid.Cells[4, 0] := 'Value'; + + for i := 0 to (cmd.Params.Count-1) do begin + par := cmd.Params[i]; + + StringGrid.Cells[0, i+1] := par.Name; + StringGrid.Cells[1, i+1] := GetEnumName(TypeInfo(TDADataType), Ord(par.DataType)); + StringGrid.Cells[2, i+1] := IntToStr(par.Size); + StringGrid.Cells[3, i+1] := GetEnumName(TypeInfo(TDAParamType), Ord(par.ParamType)); + StringGrid.Cells[4, i+1] := ''; + end; +end; + +procedure TStoredProceduresMainForm.FormDestroy(Sender: TObject); +begin + fConn := nil; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/RODLFILE.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/RODLFILE.res new file mode 100644 index 0000000..6c379af Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/SampleSchemaClient_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/SampleSchemaClient_Intf.pas new file mode 100644 index 0000000..0d84abe --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/SampleSchemaClient_Intf.pas @@ -0,0 +1,981 @@ +unit SampleSchemaClient_Intf; + +interface + +uses + Classes, DB, SysUtils, uROClasses, uDADataTable; + +const + { Data table rules ids + Feel free to change them to something more human readable + but make sure they are unique in the context of your application } + RID_Customers = '{A97B58B8-3C56-413D-BA55-360BCD6ACBEA}'; + RID_Orders = '{63B9B897-D9BC-430C-9D81-C0466A5CD6AD}'; + + { Data table names } + nme_Customers = 'Customers'; + nme_Orders = 'Orders'; + + { Customers fields } + fld_CustomersCustomerID = 'CustomerID'; + fld_CustomersCompanyName = 'CompanyName'; + fld_CustomersContactName = 'ContactName'; + fld_CustomersContactTitle = 'ContactTitle'; + fld_CustomersAddress = 'Address'; + fld_CustomersCity = 'City'; + fld_CustomersRegion = 'Region'; + fld_CustomersPostalCode = 'PostalCode'; + fld_CustomersCountry = 'Country'; + fld_CustomersPhone = 'Phone'; + fld_CustomersFax = 'Fax'; + + { Customers field indexes } + idx_CustomersCustomerID = 0; + idx_CustomersCompanyName = 1; + idx_CustomersContactName = 2; + idx_CustomersContactTitle = 3; + idx_CustomersAddress = 4; + idx_CustomersCity = 5; + idx_CustomersRegion = 6; + idx_CustomersPostalCode = 7; + idx_CustomersCountry = 8; + idx_CustomersPhone = 9; + idx_CustomersFax = 10; + + { Orders fields } + fld_OrdersOrderID = 'OrderID'; + fld_OrdersCustomerID = 'CustomerID'; + fld_OrdersEmployeeID = 'EmployeeID'; + fld_OrdersOrderDate = 'OrderDate'; + fld_OrdersRequiredDate = 'RequiredDate'; + fld_OrdersShippedDate = 'ShippedDate'; + fld_OrdersShipVia = 'ShipVia'; + fld_OrdersFreight = 'Freight'; + fld_OrdersShipName = 'ShipName'; + fld_OrdersShipAddress = 'ShipAddress'; + fld_OrdersShipCity = 'ShipCity'; + fld_OrdersShipRegion = 'ShipRegion'; + fld_OrdersShipPostalCode = 'ShipPostalCode'; + fld_OrdersShipCountry = 'ShipCountry'; + + { Orders field indexes } + idx_OrdersOrderID = 0; + idx_OrdersCustomerID = 1; + idx_OrdersEmployeeID = 2; + idx_OrdersOrderDate = 3; + idx_OrdersRequiredDate = 4; + idx_OrdersShippedDate = 5; + idx_OrdersShipVia = 6; + idx_OrdersFreight = 7; + idx_OrdersShipName = 8; + idx_OrdersShipAddress = 9; + idx_OrdersShipCity = 10; + idx_OrdersShipRegion = 11; + idx_OrdersShipPostalCode = 12; + idx_OrdersShipCountry = 13; + +type + { ICustomers } + ICustomers = interface(IDAStronglyTypedDataTable) + ['{555F0253-7185-47B4-86D9-0CCCF239EBBE}'] + { Property getters and setters } + function GetCustomerIDValue: String; + procedure SetCustomerIDValue(const aValue: String); + function GetCustomerIDIsNull: Boolean; + procedure SetCustomerIDIsNull(const aValue: Boolean); + function GetCompanyNameValue: String; + procedure SetCompanyNameValue(const aValue: String); + function GetCompanyNameIsNull: Boolean; + procedure SetCompanyNameIsNull(const aValue: Boolean); + function GetContactNameValue: String; + procedure SetContactNameValue(const aValue: String); + function GetContactNameIsNull: Boolean; + procedure SetContactNameIsNull(const aValue: Boolean); + function GetContactTitleValue: String; + procedure SetContactTitleValue(const aValue: String); + function GetContactTitleIsNull: Boolean; + procedure SetContactTitleIsNull(const aValue: Boolean); + function GetAddressValue: String; + procedure SetAddressValue(const aValue: String); + function GetAddressIsNull: Boolean; + procedure SetAddressIsNull(const aValue: Boolean); + function GetCityValue: String; + procedure SetCityValue(const aValue: String); + function GetCityIsNull: Boolean; + procedure SetCityIsNull(const aValue: Boolean); + function GetRegionValue: String; + procedure SetRegionValue(const aValue: String); + function GetRegionIsNull: Boolean; + procedure SetRegionIsNull(const aValue: Boolean); + function GetPostalCodeValue: String; + procedure SetPostalCodeValue(const aValue: String); + function GetPostalCodeIsNull: Boolean; + procedure SetPostalCodeIsNull(const aValue: Boolean); + function GetCountryValue: String; + procedure SetCountryValue(const aValue: String); + function GetCountryIsNull: Boolean; + procedure SetCountryIsNull(const aValue: Boolean); + function GetPhoneValue: String; + procedure SetPhoneValue(const aValue: String); + function GetPhoneIsNull: Boolean; + procedure SetPhoneIsNull(const aValue: Boolean); + function GetFaxValue: String; + procedure SetFaxValue(const aValue: String); + function GetFaxIsNull: Boolean; + procedure SetFaxIsNull(const aValue: Boolean); + + + { Properties } + property CustomerID: String read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull: Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property CompanyName: String read GetCompanyNameValue write SetCompanyNameValue; + property CompanyNameIsNull: Boolean read GetCompanyNameIsNull write SetCompanyNameIsNull; + property ContactName: String read GetContactNameValue write SetContactNameValue; + property ContactNameIsNull: Boolean read GetContactNameIsNull write SetContactNameIsNull; + property ContactTitle: String read GetContactTitleValue write SetContactTitleValue; + property ContactTitleIsNull: Boolean read GetContactTitleIsNull write SetContactTitleIsNull; + property Address: String read GetAddressValue write SetAddressValue; + property AddressIsNull: Boolean read GetAddressIsNull write SetAddressIsNull; + property City: String read GetCityValue write SetCityValue; + property CityIsNull: Boolean read GetCityIsNull write SetCityIsNull; + property Region: String read GetRegionValue write SetRegionValue; + property RegionIsNull: Boolean read GetRegionIsNull write SetRegionIsNull; + property PostalCode: String read GetPostalCodeValue write SetPostalCodeValue; + property PostalCodeIsNull: Boolean read GetPostalCodeIsNull write SetPostalCodeIsNull; + property Country: String read GetCountryValue write SetCountryValue; + property CountryIsNull: Boolean read GetCountryIsNull write SetCountryIsNull; + property Phone: String read GetPhoneValue write SetPhoneValue; + property PhoneIsNull: Boolean read GetPhoneIsNull write SetPhoneIsNull; + property Fax: String read GetFaxValue write SetFaxValue; + property FaxIsNull: Boolean read GetFaxIsNull write SetFaxIsNull; + end; + + { TCustomersDataTableRules } + TCustomersDataTableRules = class(TDADataTableRules, ICustomers) + private + protected + { Property getters and setters } + function GetCustomerIDValue: String; virtual; + procedure SetCustomerIDValue(const aValue: String); virtual; + function GetCustomerIDIsNull: Boolean; virtual; + procedure SetCustomerIDIsNull(const aValue: Boolean); virtual; + function GetCompanyNameValue: String; virtual; + procedure SetCompanyNameValue(const aValue: String); virtual; + function GetCompanyNameIsNull: Boolean; virtual; + procedure SetCompanyNameIsNull(const aValue: Boolean); virtual; + function GetContactNameValue: String; virtual; + procedure SetContactNameValue(const aValue: String); virtual; + function GetContactNameIsNull: Boolean; virtual; + procedure SetContactNameIsNull(const aValue: Boolean); virtual; + function GetContactTitleValue: String; virtual; + procedure SetContactTitleValue(const aValue: String); virtual; + function GetContactTitleIsNull: Boolean; virtual; + procedure SetContactTitleIsNull(const aValue: Boolean); virtual; + function GetAddressValue: String; virtual; + procedure SetAddressValue(const aValue: String); virtual; + function GetAddressIsNull: Boolean; virtual; + procedure SetAddressIsNull(const aValue: Boolean); virtual; + function GetCityValue: String; virtual; + procedure SetCityValue(const aValue: String); virtual; + function GetCityIsNull: Boolean; virtual; + procedure SetCityIsNull(const aValue: Boolean); virtual; + function GetRegionValue: String; virtual; + procedure SetRegionValue(const aValue: String); virtual; + function GetRegionIsNull: Boolean; virtual; + procedure SetRegionIsNull(const aValue: Boolean); virtual; + function GetPostalCodeValue: String; virtual; + procedure SetPostalCodeValue(const aValue: String); virtual; + function GetPostalCodeIsNull: Boolean; virtual; + procedure SetPostalCodeIsNull(const aValue: Boolean); virtual; + function GetCountryValue: String; virtual; + procedure SetCountryValue(const aValue: String); virtual; + function GetCountryIsNull: Boolean; virtual; + procedure SetCountryIsNull(const aValue: Boolean); virtual; + function GetPhoneValue: String; virtual; + procedure SetPhoneValue(const aValue: String); virtual; + function GetPhoneIsNull: Boolean; virtual; + procedure SetPhoneIsNull(const aValue: Boolean); virtual; + function GetFaxValue: String; virtual; + procedure SetFaxValue(const aValue: String); virtual; + function GetFaxIsNull: Boolean; virtual; + procedure SetFaxIsNull(const aValue: Boolean); virtual; + + { Properties } + property CustomerID: String read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull: Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property CompanyName: String read GetCompanyNameValue write SetCompanyNameValue; + property CompanyNameIsNull: Boolean read GetCompanyNameIsNull write SetCompanyNameIsNull; + property ContactName: String read GetContactNameValue write SetContactNameValue; + property ContactNameIsNull: Boolean read GetContactNameIsNull write SetContactNameIsNull; + property ContactTitle: String read GetContactTitleValue write SetContactTitleValue; + property ContactTitleIsNull: Boolean read GetContactTitleIsNull write SetContactTitleIsNull; + property Address: String read GetAddressValue write SetAddressValue; + property AddressIsNull: Boolean read GetAddressIsNull write SetAddressIsNull; + property City: String read GetCityValue write SetCityValue; + property CityIsNull: Boolean read GetCityIsNull write SetCityIsNull; + property Region: String read GetRegionValue write SetRegionValue; + property RegionIsNull: Boolean read GetRegionIsNull write SetRegionIsNull; + property PostalCode: String read GetPostalCodeValue write SetPostalCodeValue; + property PostalCodeIsNull: Boolean read GetPostalCodeIsNull write SetPostalCodeIsNull; + property Country: String read GetCountryValue write SetCountryValue; + property CountryIsNull: Boolean read GetCountryIsNull write SetCountryIsNull; + property Phone: String read GetPhoneValue write SetPhoneValue; + property PhoneIsNull: Boolean read GetPhoneIsNull write SetPhoneIsNull; + property Fax: String read GetFaxValue write SetFaxValue; + property FaxIsNull: Boolean read GetFaxIsNull write SetFaxIsNull; + + public + constructor Create(aDataTable: TDADataTable); override; + destructor Destroy; override; + + end; + + { IOrders } + IOrders = interface(IDAStronglyTypedDataTable) + ['{50A479DE-60BA-4066-AAEB-B840FC045BBB}'] + { Property getters and setters } + function GetOrderIDValue: Integer; + procedure SetOrderIDValue(const aValue: Integer); + function GetOrderIDIsNull: Boolean; + procedure SetOrderIDIsNull(const aValue: Boolean); + function GetCustomerIDValue: String; + procedure SetCustomerIDValue(const aValue: String); + function GetCustomerIDIsNull: Boolean; + procedure SetCustomerIDIsNull(const aValue: Boolean); + function GetEmployeeIDValue: Integer; + procedure SetEmployeeIDValue(const aValue: Integer); + function GetEmployeeIDIsNull: Boolean; + procedure SetEmployeeIDIsNull(const aValue: Boolean); + function GetOrderDateValue: DateTime; + procedure SetOrderDateValue(const aValue: DateTime); + function GetOrderDateIsNull: Boolean; + procedure SetOrderDateIsNull(const aValue: Boolean); + function GetRequiredDateValue: DateTime; + procedure SetRequiredDateValue(const aValue: DateTime); + function GetRequiredDateIsNull: Boolean; + procedure SetRequiredDateIsNull(const aValue: Boolean); + function GetShippedDateValue: DateTime; + procedure SetShippedDateValue(const aValue: DateTime); + function GetShippedDateIsNull: Boolean; + procedure SetShippedDateIsNull(const aValue: Boolean); + function GetShipViaValue: Integer; + procedure SetShipViaValue(const aValue: Integer); + function GetShipViaIsNull: Boolean; + procedure SetShipViaIsNull(const aValue: Boolean); + function GetFreightValue: Float; + procedure SetFreightValue(const aValue: Float); + function GetFreightIsNull: Boolean; + procedure SetFreightIsNull(const aValue: Boolean); + function GetShipNameValue: String; + procedure SetShipNameValue(const aValue: String); + function GetShipNameIsNull: Boolean; + procedure SetShipNameIsNull(const aValue: Boolean); + function GetShipAddressValue: String; + procedure SetShipAddressValue(const aValue: String); + function GetShipAddressIsNull: Boolean; + procedure SetShipAddressIsNull(const aValue: Boolean); + function GetShipCityValue: String; + procedure SetShipCityValue(const aValue: String); + function GetShipCityIsNull: Boolean; + procedure SetShipCityIsNull(const aValue: Boolean); + function GetShipRegionValue: String; + procedure SetShipRegionValue(const aValue: String); + function GetShipRegionIsNull: Boolean; + procedure SetShipRegionIsNull(const aValue: Boolean); + function GetShipPostalCodeValue: String; + procedure SetShipPostalCodeValue(const aValue: String); + function GetShipPostalCodeIsNull: Boolean; + procedure SetShipPostalCodeIsNull(const aValue: Boolean); + function GetShipCountryValue: String; + procedure SetShipCountryValue(const aValue: String); + function GetShipCountryIsNull: Boolean; + procedure SetShipCountryIsNull(const aValue: Boolean); + + + { Properties } + property OrderID: Integer read GetOrderIDValue write SetOrderIDValue; + property OrderIDIsNull: Boolean read GetOrderIDIsNull write SetOrderIDIsNull; + property CustomerID: String read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull: Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property EmployeeID: Integer read GetEmployeeIDValue write SetEmployeeIDValue; + property EmployeeIDIsNull: Boolean read GetEmployeeIDIsNull write SetEmployeeIDIsNull; + property OrderDate: DateTime read GetOrderDateValue write SetOrderDateValue; + property OrderDateIsNull: Boolean read GetOrderDateIsNull write SetOrderDateIsNull; + property RequiredDate: DateTime read GetRequiredDateValue write SetRequiredDateValue; + property RequiredDateIsNull: Boolean read GetRequiredDateIsNull write SetRequiredDateIsNull; + property ShippedDate: DateTime read GetShippedDateValue write SetShippedDateValue; + property ShippedDateIsNull: Boolean read GetShippedDateIsNull write SetShippedDateIsNull; + property ShipVia: Integer read GetShipViaValue write SetShipViaValue; + property ShipViaIsNull: Boolean read GetShipViaIsNull write SetShipViaIsNull; + property Freight: Float read GetFreightValue write SetFreightValue; + property FreightIsNull: Boolean read GetFreightIsNull write SetFreightIsNull; + property ShipName: String read GetShipNameValue write SetShipNameValue; + property ShipNameIsNull: Boolean read GetShipNameIsNull write SetShipNameIsNull; + property ShipAddress: String read GetShipAddressValue write SetShipAddressValue; + property ShipAddressIsNull: Boolean read GetShipAddressIsNull write SetShipAddressIsNull; + property ShipCity: String read GetShipCityValue write SetShipCityValue; + property ShipCityIsNull: Boolean read GetShipCityIsNull write SetShipCityIsNull; + property ShipRegion: String read GetShipRegionValue write SetShipRegionValue; + property ShipRegionIsNull: Boolean read GetShipRegionIsNull write SetShipRegionIsNull; + property ShipPostalCode: String read GetShipPostalCodeValue write SetShipPostalCodeValue; + property ShipPostalCodeIsNull: Boolean read GetShipPostalCodeIsNull write SetShipPostalCodeIsNull; + property ShipCountry: String read GetShipCountryValue write SetShipCountryValue; + property ShipCountryIsNull: Boolean read GetShipCountryIsNull write SetShipCountryIsNull; + end; + + { TOrdersDataTableRules } + TOrdersDataTableRules = class(TDADataTableRules, IOrders) + private + protected + { Property getters and setters } + function GetOrderIDValue: Integer; virtual; + procedure SetOrderIDValue(const aValue: Integer); virtual; + function GetOrderIDIsNull: Boolean; virtual; + procedure SetOrderIDIsNull(const aValue: Boolean); virtual; + function GetCustomerIDValue: String; virtual; + procedure SetCustomerIDValue(const aValue: String); virtual; + function GetCustomerIDIsNull: Boolean; virtual; + procedure SetCustomerIDIsNull(const aValue: Boolean); virtual; + function GetEmployeeIDValue: Integer; virtual; + procedure SetEmployeeIDValue(const aValue: Integer); virtual; + function GetEmployeeIDIsNull: Boolean; virtual; + procedure SetEmployeeIDIsNull(const aValue: Boolean); virtual; + function GetOrderDateValue: DateTime; virtual; + procedure SetOrderDateValue(const aValue: DateTime); virtual; + function GetOrderDateIsNull: Boolean; virtual; + procedure SetOrderDateIsNull(const aValue: Boolean); virtual; + function GetRequiredDateValue: DateTime; virtual; + procedure SetRequiredDateValue(const aValue: DateTime); virtual; + function GetRequiredDateIsNull: Boolean; virtual; + procedure SetRequiredDateIsNull(const aValue: Boolean); virtual; + function GetShippedDateValue: DateTime; virtual; + procedure SetShippedDateValue(const aValue: DateTime); virtual; + function GetShippedDateIsNull: Boolean; virtual; + procedure SetShippedDateIsNull(const aValue: Boolean); virtual; + function GetShipViaValue: Integer; virtual; + procedure SetShipViaValue(const aValue: Integer); virtual; + function GetShipViaIsNull: Boolean; virtual; + procedure SetShipViaIsNull(const aValue: Boolean); virtual; + function GetFreightValue: Float; virtual; + procedure SetFreightValue(const aValue: Float); virtual; + function GetFreightIsNull: Boolean; virtual; + procedure SetFreightIsNull(const aValue: Boolean); virtual; + function GetShipNameValue: String; virtual; + procedure SetShipNameValue(const aValue: String); virtual; + function GetShipNameIsNull: Boolean; virtual; + procedure SetShipNameIsNull(const aValue: Boolean); virtual; + function GetShipAddressValue: String; virtual; + procedure SetShipAddressValue(const aValue: String); virtual; + function GetShipAddressIsNull: Boolean; virtual; + procedure SetShipAddressIsNull(const aValue: Boolean); virtual; + function GetShipCityValue: String; virtual; + procedure SetShipCityValue(const aValue: String); virtual; + function GetShipCityIsNull: Boolean; virtual; + procedure SetShipCityIsNull(const aValue: Boolean); virtual; + function GetShipRegionValue: String; virtual; + procedure SetShipRegionValue(const aValue: String); virtual; + function GetShipRegionIsNull: Boolean; virtual; + procedure SetShipRegionIsNull(const aValue: Boolean); virtual; + function GetShipPostalCodeValue: String; virtual; + procedure SetShipPostalCodeValue(const aValue: String); virtual; + function GetShipPostalCodeIsNull: Boolean; virtual; + procedure SetShipPostalCodeIsNull(const aValue: Boolean); virtual; + function GetShipCountryValue: String; virtual; + procedure SetShipCountryValue(const aValue: String); virtual; + function GetShipCountryIsNull: Boolean; virtual; + procedure SetShipCountryIsNull(const aValue: Boolean); virtual; + + { Properties } + property OrderID: Integer read GetOrderIDValue write SetOrderIDValue; + property OrderIDIsNull: Boolean read GetOrderIDIsNull write SetOrderIDIsNull; + property CustomerID: String read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull: Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property EmployeeID: Integer read GetEmployeeIDValue write SetEmployeeIDValue; + property EmployeeIDIsNull: Boolean read GetEmployeeIDIsNull write SetEmployeeIDIsNull; + property OrderDate: DateTime read GetOrderDateValue write SetOrderDateValue; + property OrderDateIsNull: Boolean read GetOrderDateIsNull write SetOrderDateIsNull; + property RequiredDate: DateTime read GetRequiredDateValue write SetRequiredDateValue; + property RequiredDateIsNull: Boolean read GetRequiredDateIsNull write SetRequiredDateIsNull; + property ShippedDate: DateTime read GetShippedDateValue write SetShippedDateValue; + property ShippedDateIsNull: Boolean read GetShippedDateIsNull write SetShippedDateIsNull; + property ShipVia: Integer read GetShipViaValue write SetShipViaValue; + property ShipViaIsNull: Boolean read GetShipViaIsNull write SetShipViaIsNull; + property Freight: Float read GetFreightValue write SetFreightValue; + property FreightIsNull: Boolean read GetFreightIsNull write SetFreightIsNull; + property ShipName: String read GetShipNameValue write SetShipNameValue; + property ShipNameIsNull: Boolean read GetShipNameIsNull write SetShipNameIsNull; + property ShipAddress: String read GetShipAddressValue write SetShipAddressValue; + property ShipAddressIsNull: Boolean read GetShipAddressIsNull write SetShipAddressIsNull; + property ShipCity: String read GetShipCityValue write SetShipCityValue; + property ShipCityIsNull: Boolean read GetShipCityIsNull write SetShipCityIsNull; + property ShipRegion: String read GetShipRegionValue write SetShipRegionValue; + property ShipRegionIsNull: Boolean read GetShipRegionIsNull write SetShipRegionIsNull; + property ShipPostalCode: String read GetShipPostalCodeValue write SetShipPostalCodeValue; + property ShipPostalCodeIsNull: Boolean read GetShipPostalCodeIsNull write SetShipPostalCodeIsNull; + property ShipCountry: String read GetShipCountryValue write SetShipCountryValue; + property ShipCountryIsNull: Boolean read GetShipCountryIsNull write SetShipCountryIsNull; + + public + constructor Create(aDataTable: TDADataTable); override; + destructor Destroy; override; + + end; + +implementation + +uses Variants; + +{ TCustomersDataTableRules } +constructor TCustomersDataTableRules.Create(aDataTable: TDADataTable); +begin + inherited; +end; + +destructor TCustomersDataTableRules.Destroy; +begin + inherited; +end; + +function TCustomersDataTableRules.GetCustomerIDValue: String; +begin + result := DataTable.Fields[idx_CustomersCustomerID].AsString; +end; + +procedure TCustomersDataTableRules.SetCustomerIDValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersCustomerID].AsString := aValue; +end; + +function TCustomersDataTableRules.GetCustomerIDIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersCustomerID].IsNull; +end; + +procedure TCustomersDataTableRules.SetCustomerIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersCustomerID].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetCompanyNameValue: String; +begin + result := DataTable.Fields[idx_CustomersCompanyName].AsString; +end; + +procedure TCustomersDataTableRules.SetCompanyNameValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersCompanyName].AsString := aValue; +end; + +function TCustomersDataTableRules.GetCompanyNameIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersCompanyName].IsNull; +end; + +procedure TCustomersDataTableRules.SetCompanyNameIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersCompanyName].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetContactNameValue: String; +begin + result := DataTable.Fields[idx_CustomersContactName].AsString; +end; + +procedure TCustomersDataTableRules.SetContactNameValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersContactName].AsString := aValue; +end; + +function TCustomersDataTableRules.GetContactNameIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersContactName].IsNull; +end; + +procedure TCustomersDataTableRules.SetContactNameIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersContactName].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetContactTitleValue: String; +begin + result := DataTable.Fields[idx_CustomersContactTitle].AsString; +end; + +procedure TCustomersDataTableRules.SetContactTitleValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersContactTitle].AsString := aValue; +end; + +function TCustomersDataTableRules.GetContactTitleIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersContactTitle].IsNull; +end; + +procedure TCustomersDataTableRules.SetContactTitleIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersContactTitle].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetAddressValue: String; +begin + result := DataTable.Fields[idx_CustomersAddress].AsString; +end; + +procedure TCustomersDataTableRules.SetAddressValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersAddress].AsString := aValue; +end; + +function TCustomersDataTableRules.GetAddressIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersAddress].IsNull; +end; + +procedure TCustomersDataTableRules.SetAddressIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersAddress].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetCityValue: String; +begin + result := DataTable.Fields[idx_CustomersCity].AsString; +end; + +procedure TCustomersDataTableRules.SetCityValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersCity].AsString := aValue; +end; + +function TCustomersDataTableRules.GetCityIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersCity].IsNull; +end; + +procedure TCustomersDataTableRules.SetCityIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersCity].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetRegionValue: String; +begin + result := DataTable.Fields[idx_CustomersRegion].AsString; +end; + +procedure TCustomersDataTableRules.SetRegionValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersRegion].AsString := aValue; +end; + +function TCustomersDataTableRules.GetRegionIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersRegion].IsNull; +end; + +procedure TCustomersDataTableRules.SetRegionIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersRegion].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetPostalCodeValue: String; +begin + result := DataTable.Fields[idx_CustomersPostalCode].AsString; +end; + +procedure TCustomersDataTableRules.SetPostalCodeValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersPostalCode].AsString := aValue; +end; + +function TCustomersDataTableRules.GetPostalCodeIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersPostalCode].IsNull; +end; + +procedure TCustomersDataTableRules.SetPostalCodeIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersPostalCode].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetCountryValue: String; +begin + result := DataTable.Fields[idx_CustomersCountry].AsString; +end; + +procedure TCustomersDataTableRules.SetCountryValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersCountry].AsString := aValue; +end; + +function TCustomersDataTableRules.GetCountryIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersCountry].IsNull; +end; + +procedure TCustomersDataTableRules.SetCountryIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersCountry].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetPhoneValue: String; +begin + result := DataTable.Fields[idx_CustomersPhone].AsString; +end; + +procedure TCustomersDataTableRules.SetPhoneValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersPhone].AsString := aValue; +end; + +function TCustomersDataTableRules.GetPhoneIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersPhone].IsNull; +end; + +procedure TCustomersDataTableRules.SetPhoneIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersPhone].AsVariant := Null; +end; + +function TCustomersDataTableRules.GetFaxValue: String; +begin + result := DataTable.Fields[idx_CustomersFax].AsString; +end; + +procedure TCustomersDataTableRules.SetFaxValue(const aValue: String); +begin + DataTable.Fields[idx_CustomersFax].AsString := aValue; +end; + +function TCustomersDataTableRules.GetFaxIsNull: boolean; +begin + result := DataTable.Fields[idx_CustomersFax].IsNull; +end; + +procedure TCustomersDataTableRules.SetFaxIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_CustomersFax].AsVariant := Null; +end; + + +{ TOrdersDataTableRules } +constructor TOrdersDataTableRules.Create(aDataTable: TDADataTable); +begin + inherited; +end; + +destructor TOrdersDataTableRules.Destroy; +begin + inherited; +end; + +function TOrdersDataTableRules.GetOrderIDValue: Integer; +begin + result := DataTable.Fields[idx_OrdersOrderID].AsInteger; +end; + +procedure TOrdersDataTableRules.SetOrderIDValue(const aValue: Integer); +begin + DataTable.Fields[idx_OrdersOrderID].AsInteger := aValue; +end; + +function TOrdersDataTableRules.GetOrderIDIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersOrderID].IsNull; +end; + +procedure TOrdersDataTableRules.SetOrderIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersOrderID].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetCustomerIDValue: String; +begin + result := DataTable.Fields[idx_OrdersCustomerID].AsString; +end; + +procedure TOrdersDataTableRules.SetCustomerIDValue(const aValue: String); +begin + DataTable.Fields[idx_OrdersCustomerID].AsString := aValue; +end; + +function TOrdersDataTableRules.GetCustomerIDIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersCustomerID].IsNull; +end; + +procedure TOrdersDataTableRules.SetCustomerIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersCustomerID].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetEmployeeIDValue: Integer; +begin + result := DataTable.Fields[idx_OrdersEmployeeID].AsInteger; +end; + +procedure TOrdersDataTableRules.SetEmployeeIDValue(const aValue: Integer); +begin + DataTable.Fields[idx_OrdersEmployeeID].AsInteger := aValue; +end; + +function TOrdersDataTableRules.GetEmployeeIDIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersEmployeeID].IsNull; +end; + +procedure TOrdersDataTableRules.SetEmployeeIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersEmployeeID].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetOrderDateValue: DateTime; +begin + result := DataTable.Fields[idx_OrdersOrderDate].AsDateTime; +end; + +procedure TOrdersDataTableRules.SetOrderDateValue(const aValue: DateTime); +begin + DataTable.Fields[idx_OrdersOrderDate].AsDateTime := aValue; +end; + +function TOrdersDataTableRules.GetOrderDateIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersOrderDate].IsNull; +end; + +procedure TOrdersDataTableRules.SetOrderDateIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersOrderDate].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetRequiredDateValue: DateTime; +begin + result := DataTable.Fields[idx_OrdersRequiredDate].AsDateTime; +end; + +procedure TOrdersDataTableRules.SetRequiredDateValue(const aValue: DateTime); +begin + DataTable.Fields[idx_OrdersRequiredDate].AsDateTime := aValue; +end; + +function TOrdersDataTableRules.GetRequiredDateIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersRequiredDate].IsNull; +end; + +procedure TOrdersDataTableRules.SetRequiredDateIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersRequiredDate].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShippedDateValue: DateTime; +begin + result := DataTable.Fields[idx_OrdersShippedDate].AsDateTime; +end; + +procedure TOrdersDataTableRules.SetShippedDateValue(const aValue: DateTime); +begin + DataTable.Fields[idx_OrdersShippedDate].AsDateTime := aValue; +end; + +function TOrdersDataTableRules.GetShippedDateIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShippedDate].IsNull; +end; + +procedure TOrdersDataTableRules.SetShippedDateIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShippedDate].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipViaValue: Integer; +begin + result := DataTable.Fields[idx_OrdersShipVia].AsInteger; +end; + +procedure TOrdersDataTableRules.SetShipViaValue(const aValue: Integer); +begin + DataTable.Fields[idx_OrdersShipVia].AsInteger := aValue; +end; + +function TOrdersDataTableRules.GetShipViaIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipVia].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipViaIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipVia].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetFreightValue: Float; +begin + result := DataTable.Fields[idx_OrdersFreight].AsFloat; +end; + +procedure TOrdersDataTableRules.SetFreightValue(const aValue: Float); +begin + DataTable.Fields[idx_OrdersFreight].AsFloat := aValue; +end; + +function TOrdersDataTableRules.GetFreightIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersFreight].IsNull; +end; + +procedure TOrdersDataTableRules.SetFreightIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersFreight].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipNameValue: String; +begin + result := DataTable.Fields[idx_OrdersShipName].AsString; +end; + +procedure TOrdersDataTableRules.SetShipNameValue(const aValue: String); +begin + DataTable.Fields[idx_OrdersShipName].AsString := aValue; +end; + +function TOrdersDataTableRules.GetShipNameIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipName].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipNameIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipName].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipAddressValue: String; +begin + result := DataTable.Fields[idx_OrdersShipAddress].AsString; +end; + +procedure TOrdersDataTableRules.SetShipAddressValue(const aValue: String); +begin + DataTable.Fields[idx_OrdersShipAddress].AsString := aValue; +end; + +function TOrdersDataTableRules.GetShipAddressIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipAddress].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipAddressIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipAddress].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipCityValue: String; +begin + result := DataTable.Fields[idx_OrdersShipCity].AsString; +end; + +procedure TOrdersDataTableRules.SetShipCityValue(const aValue: String); +begin + DataTable.Fields[idx_OrdersShipCity].AsString := aValue; +end; + +function TOrdersDataTableRules.GetShipCityIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipCity].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipCityIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipCity].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipRegionValue: String; +begin + result := DataTable.Fields[idx_OrdersShipRegion].AsString; +end; + +procedure TOrdersDataTableRules.SetShipRegionValue(const aValue: String); +begin + DataTable.Fields[idx_OrdersShipRegion].AsString := aValue; +end; + +function TOrdersDataTableRules.GetShipRegionIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipRegion].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipRegionIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipRegion].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipPostalCodeValue: String; +begin + result := DataTable.Fields[idx_OrdersShipPostalCode].AsString; +end; + +procedure TOrdersDataTableRules.SetShipPostalCodeValue(const aValue: String); +begin + DataTable.Fields[idx_OrdersShipPostalCode].AsString := aValue; +end; + +function TOrdersDataTableRules.GetShipPostalCodeIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipPostalCode].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipPostalCodeIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipPostalCode].AsVariant := Null; +end; + +function TOrdersDataTableRules.GetShipCountryValue: String; +begin + result := DataTable.Fields[idx_OrdersShipCountry].AsString; +end; + +procedure TOrdersDataTableRules.SetShipCountryValue(const aValue: String); +begin + DataTable.Fields[idx_OrdersShipCountry].AsString := aValue; +end; + +function TOrdersDataTableRules.GetShipCountryIsNull: boolean; +begin + result := DataTable.Fields[idx_OrdersShipCountry].IsNull; +end; + +procedure TOrdersDataTableRules.SetShipCountryIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_OrdersShipCountry].AsVariant := Null; +end; + + +initialization + RegisterDataTableRules(RID_Customers, TCustomersDataTableRules); + RegisterDataTableRules(RID_Orders, TOrdersDataTableRules); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/SampleSchemaServer_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/SampleSchemaServer_Intf.pas new file mode 100644 index 0000000..b75371d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/SampleSchemaServer_Intf.pas @@ -0,0 +1,1168 @@ +unit SampleSchemaServer_Intf; + +interface + +uses + Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, SampleSchemaClient_Intf; + +const + { Delta rules ids + Feel free to change them to something more human readable + but make sure they are unique in the context of your application } + RID_CustomersDelta = '{79206377-2D23-4B53-84A3-AA445FF02FA8}'; + RID_OrdersDelta = '{AD299B05-275D-495E-8036-3B383CDA5248}'; + +type + { ICustomersDelta } + ICustomersDelta = interface(ICustomers) + ['{79206377-2D23-4B53-84A3-AA445FF02FA8}'] + { Property getters and setters } + function GetOldCustomerIDValue : String; + function GetOldCompanyNameValue : String; + function GetOldContactNameValue : String; + function GetOldContactTitleValue : String; + function GetOldAddressValue : String; + function GetOldCityValue : String; + function GetOldRegionValue : String; + function GetOldPostalCodeValue : String; + function GetOldCountryValue : String; + function GetOldPhoneValue : String; + function GetOldFaxValue : String; + + { Properties } + property OldCustomerID : String read GetOldCustomerIDValue; + property OldCompanyName : String read GetOldCompanyNameValue; + property OldContactName : String read GetOldContactNameValue; + property OldContactTitle : String read GetOldContactTitleValue; + property OldAddress : String read GetOldAddressValue; + property OldCity : String read GetOldCityValue; + property OldRegion : String read GetOldRegionValue; + property OldPostalCode : String read GetOldPostalCodeValue; + property OldCountry : String read GetOldCountryValue; + property OldPhone : String read GetOldPhoneValue; + property OldFax : String read GetOldFaxValue; + end; + + { TCustomersBusinessProcessorRules } + TCustomersBusinessProcessorRules = class(TDABusinessProcessorRules, ICustomers, ICustomersDelta) + private + protected + { Property getters and setters } + function GetCustomerIDValue: String; virtual; + function GetCustomerIDIsNull: Boolean; virtual; + function GetOldCustomerIDValue: String; virtual; + function GetOldCustomerIDIsNull: Boolean; virtual; + procedure SetCustomerIDValue(const aValue: String); virtual; + procedure SetCustomerIDIsNull(const aValue: Boolean); virtual; + function GetCompanyNameValue: String; virtual; + function GetCompanyNameIsNull: Boolean; virtual; + function GetOldCompanyNameValue: String; virtual; + function GetOldCompanyNameIsNull: Boolean; virtual; + procedure SetCompanyNameValue(const aValue: String); virtual; + procedure SetCompanyNameIsNull(const aValue: Boolean); virtual; + function GetContactNameValue: String; virtual; + function GetContactNameIsNull: Boolean; virtual; + function GetOldContactNameValue: String; virtual; + function GetOldContactNameIsNull: Boolean; virtual; + procedure SetContactNameValue(const aValue: String); virtual; + procedure SetContactNameIsNull(const aValue: Boolean); virtual; + function GetContactTitleValue: String; virtual; + function GetContactTitleIsNull: Boolean; virtual; + function GetOldContactTitleValue: String; virtual; + function GetOldContactTitleIsNull: Boolean; virtual; + procedure SetContactTitleValue(const aValue: String); virtual; + procedure SetContactTitleIsNull(const aValue: Boolean); virtual; + function GetAddressValue: String; virtual; + function GetAddressIsNull: Boolean; virtual; + function GetOldAddressValue: String; virtual; + function GetOldAddressIsNull: Boolean; virtual; + procedure SetAddressValue(const aValue: String); virtual; + procedure SetAddressIsNull(const aValue: Boolean); virtual; + function GetCityValue: String; virtual; + function GetCityIsNull: Boolean; virtual; + function GetOldCityValue: String; virtual; + function GetOldCityIsNull: Boolean; virtual; + procedure SetCityValue(const aValue: String); virtual; + procedure SetCityIsNull(const aValue: Boolean); virtual; + function GetRegionValue: String; virtual; + function GetRegionIsNull: Boolean; virtual; + function GetOldRegionValue: String; virtual; + function GetOldRegionIsNull: Boolean; virtual; + procedure SetRegionValue(const aValue: String); virtual; + procedure SetRegionIsNull(const aValue: Boolean); virtual; + function GetPostalCodeValue: String; virtual; + function GetPostalCodeIsNull: Boolean; virtual; + function GetOldPostalCodeValue: String; virtual; + function GetOldPostalCodeIsNull: Boolean; virtual; + procedure SetPostalCodeValue(const aValue: String); virtual; + procedure SetPostalCodeIsNull(const aValue: Boolean); virtual; + function GetCountryValue: String; virtual; + function GetCountryIsNull: Boolean; virtual; + function GetOldCountryValue: String; virtual; + function GetOldCountryIsNull: Boolean; virtual; + procedure SetCountryValue(const aValue: String); virtual; + procedure SetCountryIsNull(const aValue: Boolean); virtual; + function GetPhoneValue: String; virtual; + function GetPhoneIsNull: Boolean; virtual; + function GetOldPhoneValue: String; virtual; + function GetOldPhoneIsNull: Boolean; virtual; + procedure SetPhoneValue(const aValue: String); virtual; + procedure SetPhoneIsNull(const aValue: Boolean); virtual; + function GetFaxValue: String; virtual; + function GetFaxIsNull: Boolean; virtual; + function GetOldFaxValue: String; virtual; + function GetOldFaxIsNull: Boolean; virtual; + procedure SetFaxValue(const aValue: String); virtual; + procedure SetFaxIsNull(const aValue: Boolean); virtual; + + { Properties } + property CustomerID : String read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull : Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property OldCustomerID : String read GetOldCustomerIDValue; + property OldCustomerIDIsNull : Boolean read GetOldCustomerIDIsNull; + property CompanyName : String read GetCompanyNameValue write SetCompanyNameValue; + property CompanyNameIsNull : Boolean read GetCompanyNameIsNull write SetCompanyNameIsNull; + property OldCompanyName : String read GetOldCompanyNameValue; + property OldCompanyNameIsNull : Boolean read GetOldCompanyNameIsNull; + property ContactName : String read GetContactNameValue write SetContactNameValue; + property ContactNameIsNull : Boolean read GetContactNameIsNull write SetContactNameIsNull; + property OldContactName : String read GetOldContactNameValue; + property OldContactNameIsNull : Boolean read GetOldContactNameIsNull; + property ContactTitle : String read GetContactTitleValue write SetContactTitleValue; + property ContactTitleIsNull : Boolean read GetContactTitleIsNull write SetContactTitleIsNull; + property OldContactTitle : String read GetOldContactTitleValue; + property OldContactTitleIsNull : Boolean read GetOldContactTitleIsNull; + property Address : String read GetAddressValue write SetAddressValue; + property AddressIsNull : Boolean read GetAddressIsNull write SetAddressIsNull; + property OldAddress : String read GetOldAddressValue; + property OldAddressIsNull : Boolean read GetOldAddressIsNull; + property City : String read GetCityValue write SetCityValue; + property CityIsNull : Boolean read GetCityIsNull write SetCityIsNull; + property OldCity : String read GetOldCityValue; + property OldCityIsNull : Boolean read GetOldCityIsNull; + property Region : String read GetRegionValue write SetRegionValue; + property RegionIsNull : Boolean read GetRegionIsNull write SetRegionIsNull; + property OldRegion : String read GetOldRegionValue; + property OldRegionIsNull : Boolean read GetOldRegionIsNull; + property PostalCode : String read GetPostalCodeValue write SetPostalCodeValue; + property PostalCodeIsNull : Boolean read GetPostalCodeIsNull write SetPostalCodeIsNull; + property OldPostalCode : String read GetOldPostalCodeValue; + property OldPostalCodeIsNull : Boolean read GetOldPostalCodeIsNull; + property Country : String read GetCountryValue write SetCountryValue; + property CountryIsNull : Boolean read GetCountryIsNull write SetCountryIsNull; + property OldCountry : String read GetOldCountryValue; + property OldCountryIsNull : Boolean read GetOldCountryIsNull; + property Phone : String read GetPhoneValue write SetPhoneValue; + property PhoneIsNull : Boolean read GetPhoneIsNull write SetPhoneIsNull; + property OldPhone : String read GetOldPhoneValue; + property OldPhoneIsNull : Boolean read GetOldPhoneIsNull; + property Fax : String read GetFaxValue write SetFaxValue; + property FaxIsNull : Boolean read GetFaxIsNull write SetFaxIsNull; + property OldFax : String read GetOldFaxValue; + property OldFaxIsNull : Boolean read GetOldFaxIsNull; + + public + constructor Create(aBusinessProcessor: TDABusinessProcessor); override; + destructor Destroy; override; + + end; + + { IOrdersDelta } + IOrdersDelta = interface(IOrders) + ['{AD299B05-275D-495E-8036-3B383CDA5248}'] + { Property getters and setters } + function GetOldOrderIDValue : Integer; + function GetOldCustomerIDValue : String; + function GetOldEmployeeIDValue : Integer; + function GetOldOrderDateValue : DateTime; + function GetOldRequiredDateValue : DateTime; + function GetOldShippedDateValue : DateTime; + function GetOldShipViaValue : Integer; + function GetOldFreightValue : Float; + function GetOldShipNameValue : String; + function GetOldShipAddressValue : String; + function GetOldShipCityValue : String; + function GetOldShipRegionValue : String; + function GetOldShipPostalCodeValue : String; + function GetOldShipCountryValue : String; + + { Properties } + property OldOrderID : Integer read GetOldOrderIDValue; + property OldCustomerID : String read GetOldCustomerIDValue; + property OldEmployeeID : Integer read GetOldEmployeeIDValue; + property OldOrderDate : DateTime read GetOldOrderDateValue; + property OldRequiredDate : DateTime read GetOldRequiredDateValue; + property OldShippedDate : DateTime read GetOldShippedDateValue; + property OldShipVia : Integer read GetOldShipViaValue; + property OldFreight : Float read GetOldFreightValue; + property OldShipName : String read GetOldShipNameValue; + property OldShipAddress : String read GetOldShipAddressValue; + property OldShipCity : String read GetOldShipCityValue; + property OldShipRegion : String read GetOldShipRegionValue; + property OldShipPostalCode : String read GetOldShipPostalCodeValue; + property OldShipCountry : String read GetOldShipCountryValue; + end; + + { TOrdersBusinessProcessorRules } + TOrdersBusinessProcessorRules = class(TDABusinessProcessorRules, IOrders, IOrdersDelta) + private + protected + { Property getters and setters } + function GetOrderIDValue: Integer; virtual; + function GetOrderIDIsNull: Boolean; virtual; + function GetOldOrderIDValue: Integer; virtual; + function GetOldOrderIDIsNull: Boolean; virtual; + procedure SetOrderIDValue(const aValue: Integer); virtual; + procedure SetOrderIDIsNull(const aValue: Boolean); virtual; + function GetCustomerIDValue: String; virtual; + function GetCustomerIDIsNull: Boolean; virtual; + function GetOldCustomerIDValue: String; virtual; + function GetOldCustomerIDIsNull: Boolean; virtual; + procedure SetCustomerIDValue(const aValue: String); virtual; + procedure SetCustomerIDIsNull(const aValue: Boolean); virtual; + function GetEmployeeIDValue: Integer; virtual; + function GetEmployeeIDIsNull: Boolean; virtual; + function GetOldEmployeeIDValue: Integer; virtual; + function GetOldEmployeeIDIsNull: Boolean; virtual; + procedure SetEmployeeIDValue(const aValue: Integer); virtual; + procedure SetEmployeeIDIsNull(const aValue: Boolean); virtual; + function GetOrderDateValue: DateTime; virtual; + function GetOrderDateIsNull: Boolean; virtual; + function GetOldOrderDateValue: DateTime; virtual; + function GetOldOrderDateIsNull: Boolean; virtual; + procedure SetOrderDateValue(const aValue: DateTime); virtual; + procedure SetOrderDateIsNull(const aValue: Boolean); virtual; + function GetRequiredDateValue: DateTime; virtual; + function GetRequiredDateIsNull: Boolean; virtual; + function GetOldRequiredDateValue: DateTime; virtual; + function GetOldRequiredDateIsNull: Boolean; virtual; + procedure SetRequiredDateValue(const aValue: DateTime); virtual; + procedure SetRequiredDateIsNull(const aValue: Boolean); virtual; + function GetShippedDateValue: DateTime; virtual; + function GetShippedDateIsNull: Boolean; virtual; + function GetOldShippedDateValue: DateTime; virtual; + function GetOldShippedDateIsNull: Boolean; virtual; + procedure SetShippedDateValue(const aValue: DateTime); virtual; + procedure SetShippedDateIsNull(const aValue: Boolean); virtual; + function GetShipViaValue: Integer; virtual; + function GetShipViaIsNull: Boolean; virtual; + function GetOldShipViaValue: Integer; virtual; + function GetOldShipViaIsNull: Boolean; virtual; + procedure SetShipViaValue(const aValue: Integer); virtual; + procedure SetShipViaIsNull(const aValue: Boolean); virtual; + function GetFreightValue: Float; virtual; + function GetFreightIsNull: Boolean; virtual; + function GetOldFreightValue: Float; virtual; + function GetOldFreightIsNull: Boolean; virtual; + procedure SetFreightValue(const aValue: Float); virtual; + procedure SetFreightIsNull(const aValue: Boolean); virtual; + function GetShipNameValue: String; virtual; + function GetShipNameIsNull: Boolean; virtual; + function GetOldShipNameValue: String; virtual; + function GetOldShipNameIsNull: Boolean; virtual; + procedure SetShipNameValue(const aValue: String); virtual; + procedure SetShipNameIsNull(const aValue: Boolean); virtual; + function GetShipAddressValue: String; virtual; + function GetShipAddressIsNull: Boolean; virtual; + function GetOldShipAddressValue: String; virtual; + function GetOldShipAddressIsNull: Boolean; virtual; + procedure SetShipAddressValue(const aValue: String); virtual; + procedure SetShipAddressIsNull(const aValue: Boolean); virtual; + function GetShipCityValue: String; virtual; + function GetShipCityIsNull: Boolean; virtual; + function GetOldShipCityValue: String; virtual; + function GetOldShipCityIsNull: Boolean; virtual; + procedure SetShipCityValue(const aValue: String); virtual; + procedure SetShipCityIsNull(const aValue: Boolean); virtual; + function GetShipRegionValue: String; virtual; + function GetShipRegionIsNull: Boolean; virtual; + function GetOldShipRegionValue: String; virtual; + function GetOldShipRegionIsNull: Boolean; virtual; + procedure SetShipRegionValue(const aValue: String); virtual; + procedure SetShipRegionIsNull(const aValue: Boolean); virtual; + function GetShipPostalCodeValue: String; virtual; + function GetShipPostalCodeIsNull: Boolean; virtual; + function GetOldShipPostalCodeValue: String; virtual; + function GetOldShipPostalCodeIsNull: Boolean; virtual; + procedure SetShipPostalCodeValue(const aValue: String); virtual; + procedure SetShipPostalCodeIsNull(const aValue: Boolean); virtual; + function GetShipCountryValue: String; virtual; + function GetShipCountryIsNull: Boolean; virtual; + function GetOldShipCountryValue: String; virtual; + function GetOldShipCountryIsNull: Boolean; virtual; + procedure SetShipCountryValue(const aValue: String); virtual; + procedure SetShipCountryIsNull(const aValue: Boolean); virtual; + + { Properties } + property OrderID : Integer read GetOrderIDValue write SetOrderIDValue; + property OrderIDIsNull : Boolean read GetOrderIDIsNull write SetOrderIDIsNull; + property OldOrderID : Integer read GetOldOrderIDValue; + property OldOrderIDIsNull : Boolean read GetOldOrderIDIsNull; + property CustomerID : String read GetCustomerIDValue write SetCustomerIDValue; + property CustomerIDIsNull : Boolean read GetCustomerIDIsNull write SetCustomerIDIsNull; + property OldCustomerID : String read GetOldCustomerIDValue; + property OldCustomerIDIsNull : Boolean read GetOldCustomerIDIsNull; + property EmployeeID : Integer read GetEmployeeIDValue write SetEmployeeIDValue; + property EmployeeIDIsNull : Boolean read GetEmployeeIDIsNull write SetEmployeeIDIsNull; + property OldEmployeeID : Integer read GetOldEmployeeIDValue; + property OldEmployeeIDIsNull : Boolean read GetOldEmployeeIDIsNull; + property OrderDate : DateTime read GetOrderDateValue write SetOrderDateValue; + property OrderDateIsNull : Boolean read GetOrderDateIsNull write SetOrderDateIsNull; + property OldOrderDate : DateTime read GetOldOrderDateValue; + property OldOrderDateIsNull : Boolean read GetOldOrderDateIsNull; + property RequiredDate : DateTime read GetRequiredDateValue write SetRequiredDateValue; + property RequiredDateIsNull : Boolean read GetRequiredDateIsNull write SetRequiredDateIsNull; + property OldRequiredDate : DateTime read GetOldRequiredDateValue; + property OldRequiredDateIsNull : Boolean read GetOldRequiredDateIsNull; + property ShippedDate : DateTime read GetShippedDateValue write SetShippedDateValue; + property ShippedDateIsNull : Boolean read GetShippedDateIsNull write SetShippedDateIsNull; + property OldShippedDate : DateTime read GetOldShippedDateValue; + property OldShippedDateIsNull : Boolean read GetOldShippedDateIsNull; + property ShipVia : Integer read GetShipViaValue write SetShipViaValue; + property ShipViaIsNull : Boolean read GetShipViaIsNull write SetShipViaIsNull; + property OldShipVia : Integer read GetOldShipViaValue; + property OldShipViaIsNull : Boolean read GetOldShipViaIsNull; + property Freight : Float read GetFreightValue write SetFreightValue; + property FreightIsNull : Boolean read GetFreightIsNull write SetFreightIsNull; + property OldFreight : Float read GetOldFreightValue; + property OldFreightIsNull : Boolean read GetOldFreightIsNull; + property ShipName : String read GetShipNameValue write SetShipNameValue; + property ShipNameIsNull : Boolean read GetShipNameIsNull write SetShipNameIsNull; + property OldShipName : String read GetOldShipNameValue; + property OldShipNameIsNull : Boolean read GetOldShipNameIsNull; + property ShipAddress : String read GetShipAddressValue write SetShipAddressValue; + property ShipAddressIsNull : Boolean read GetShipAddressIsNull write SetShipAddressIsNull; + property OldShipAddress : String read GetOldShipAddressValue; + property OldShipAddressIsNull : Boolean read GetOldShipAddressIsNull; + property ShipCity : String read GetShipCityValue write SetShipCityValue; + property ShipCityIsNull : Boolean read GetShipCityIsNull write SetShipCityIsNull; + property OldShipCity : String read GetOldShipCityValue; + property OldShipCityIsNull : Boolean read GetOldShipCityIsNull; + property ShipRegion : String read GetShipRegionValue write SetShipRegionValue; + property ShipRegionIsNull : Boolean read GetShipRegionIsNull write SetShipRegionIsNull; + property OldShipRegion : String read GetOldShipRegionValue; + property OldShipRegionIsNull : Boolean read GetOldShipRegionIsNull; + property ShipPostalCode : String read GetShipPostalCodeValue write SetShipPostalCodeValue; + property ShipPostalCodeIsNull : Boolean read GetShipPostalCodeIsNull write SetShipPostalCodeIsNull; + property OldShipPostalCode : String read GetOldShipPostalCodeValue; + property OldShipPostalCodeIsNull : Boolean read GetOldShipPostalCodeIsNull; + property ShipCountry : String read GetShipCountryValue write SetShipCountryValue; + property ShipCountryIsNull : Boolean read GetShipCountryIsNull write SetShipCountryIsNull; + property OldShipCountry : String read GetOldShipCountryValue; + property OldShipCountryIsNull : Boolean read GetOldShipCountryIsNull; + + public + constructor Create(aBusinessProcessor: TDABusinessProcessor); override; + destructor Destroy; override; + + end; + +implementation + +uses + Variants, uROBinaryHelpers; + +{ TCustomersBusinessProcessorRules } +constructor TCustomersBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); +begin + inherited; +end; + +destructor TCustomersBusinessProcessorRules.Destroy; +begin + inherited; +end; + +function TCustomersBusinessProcessorRules.GetCustomerIDValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCustomerID]; +end; + +function TCustomersBusinessProcessorRules.GetCustomerIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCustomerID]); +end; + +function TCustomersBusinessProcessorRules.GetOldCustomerIDValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCustomerID]; +end; + +function TCustomersBusinessProcessorRules.GetOldCustomerIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCustomerID]); +end; + +procedure TCustomersBusinessProcessorRules.SetCustomerIDValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCustomerID] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetCustomerIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCustomerID] := Null; +end; + +function TCustomersBusinessProcessorRules.GetCompanyNameValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCompanyName]; +end; + +function TCustomersBusinessProcessorRules.GetCompanyNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCompanyName]); +end; + +function TCustomersBusinessProcessorRules.GetOldCompanyNameValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCompanyName]; +end; + +function TCustomersBusinessProcessorRules.GetOldCompanyNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCompanyName]); +end; + +procedure TCustomersBusinessProcessorRules.SetCompanyNameValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCompanyName] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetCompanyNameIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCompanyName] := Null; +end; + +function TCustomersBusinessProcessorRules.GetContactNameValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactName]; +end; + +function TCustomersBusinessProcessorRules.GetContactNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactName]); +end; + +function TCustomersBusinessProcessorRules.GetOldContactNameValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersContactName]; +end; + +function TCustomersBusinessProcessorRules.GetOldContactNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersContactName]); +end; + +procedure TCustomersBusinessProcessorRules.SetContactNameValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactName] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetContactNameIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactName] := Null; +end; + +function TCustomersBusinessProcessorRules.GetContactTitleValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactTitle]; +end; + +function TCustomersBusinessProcessorRules.GetContactTitleIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactTitle]); +end; + +function TCustomersBusinessProcessorRules.GetOldContactTitleValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersContactTitle]; +end; + +function TCustomersBusinessProcessorRules.GetOldContactTitleIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersContactTitle]); +end; + +procedure TCustomersBusinessProcessorRules.SetContactTitleValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactTitle] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetContactTitleIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersContactTitle] := Null; +end; + +function TCustomersBusinessProcessorRules.GetAddressValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersAddress]; +end; + +function TCustomersBusinessProcessorRules.GetAddressIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersAddress]); +end; + +function TCustomersBusinessProcessorRules.GetOldAddressValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersAddress]; +end; + +function TCustomersBusinessProcessorRules.GetOldAddressIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersAddress]); +end; + +procedure TCustomersBusinessProcessorRules.SetAddressValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersAddress] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetAddressIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersAddress] := Null; +end; + +function TCustomersBusinessProcessorRules.GetCityValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCity]; +end; + +function TCustomersBusinessProcessorRules.GetCityIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCity]); +end; + +function TCustomersBusinessProcessorRules.GetOldCityValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCity]; +end; + +function TCustomersBusinessProcessorRules.GetOldCityIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCity]); +end; + +procedure TCustomersBusinessProcessorRules.SetCityValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCity] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetCityIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCity] := Null; +end; + +function TCustomersBusinessProcessorRules.GetRegionValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersRegion]; +end; + +function TCustomersBusinessProcessorRules.GetRegionIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersRegion]); +end; + +function TCustomersBusinessProcessorRules.GetOldRegionValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersRegion]; +end; + +function TCustomersBusinessProcessorRules.GetOldRegionIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersRegion]); +end; + +procedure TCustomersBusinessProcessorRules.SetRegionValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersRegion] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetRegionIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersRegion] := Null; +end; + +function TCustomersBusinessProcessorRules.GetPostalCodeValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPostalCode]; +end; + +function TCustomersBusinessProcessorRules.GetPostalCodeIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPostalCode]); +end; + +function TCustomersBusinessProcessorRules.GetOldPostalCodeValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersPostalCode]; +end; + +function TCustomersBusinessProcessorRules.GetOldPostalCodeIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersPostalCode]); +end; + +procedure TCustomersBusinessProcessorRules.SetPostalCodeValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPostalCode] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetPostalCodeIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPostalCode] := Null; +end; + +function TCustomersBusinessProcessorRules.GetCountryValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCountry]; +end; + +function TCustomersBusinessProcessorRules.GetCountryIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCountry]); +end; + +function TCustomersBusinessProcessorRules.GetOldCountryValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCountry]; +end; + +function TCustomersBusinessProcessorRules.GetOldCountryIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersCountry]); +end; + +procedure TCustomersBusinessProcessorRules.SetCountryValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCountry] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetCountryIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersCountry] := Null; +end; + +function TCustomersBusinessProcessorRules.GetPhoneValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPhone]; +end; + +function TCustomersBusinessProcessorRules.GetPhoneIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPhone]); +end; + +function TCustomersBusinessProcessorRules.GetOldPhoneValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersPhone]; +end; + +function TCustomersBusinessProcessorRules.GetOldPhoneIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersPhone]); +end; + +procedure TCustomersBusinessProcessorRules.SetPhoneValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPhone] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetPhoneIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersPhone] := Null; +end; + +function TCustomersBusinessProcessorRules.GetFaxValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersFax]; +end; + +function TCustomersBusinessProcessorRules.GetFaxIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersFax]); +end; + +function TCustomersBusinessProcessorRules.GetOldFaxValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersFax]; +end; + +function TCustomersBusinessProcessorRules.GetOldFaxIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_CustomersFax]); +end; + +procedure TCustomersBusinessProcessorRules.SetFaxValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersFax] := aValue; +end; + +procedure TCustomersBusinessProcessorRules.SetFaxIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_CustomersFax] := Null; +end; + + +{ TOrdersBusinessProcessorRules } +constructor TOrdersBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); +begin + inherited; +end; + +destructor TOrdersBusinessProcessorRules.Destroy; +begin + inherited; +end; + +function TOrdersBusinessProcessorRules.GetOrderIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderID]; +end; + +function TOrdersBusinessProcessorRules.GetOrderIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderID]); +end; + +function TOrdersBusinessProcessorRules.GetOldOrderIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersOrderID]; +end; + +function TOrdersBusinessProcessorRules.GetOldOrderIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersOrderID]); +end; + +procedure TOrdersBusinessProcessorRules.SetOrderIDValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderID] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetOrderIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderID] := Null; +end; + +function TOrdersBusinessProcessorRules.GetCustomerIDValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersCustomerID]; +end; + +function TOrdersBusinessProcessorRules.GetCustomerIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersCustomerID]); +end; + +function TOrdersBusinessProcessorRules.GetOldCustomerIDValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersCustomerID]; +end; + +function TOrdersBusinessProcessorRules.GetOldCustomerIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersCustomerID]); +end; + +procedure TOrdersBusinessProcessorRules.SetCustomerIDValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersCustomerID] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetCustomerIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersCustomerID] := Null; +end; + +function TOrdersBusinessProcessorRules.GetEmployeeIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersEmployeeID]; +end; + +function TOrdersBusinessProcessorRules.GetEmployeeIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersEmployeeID]); +end; + +function TOrdersBusinessProcessorRules.GetOldEmployeeIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersEmployeeID]; +end; + +function TOrdersBusinessProcessorRules.GetOldEmployeeIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersEmployeeID]); +end; + +procedure TOrdersBusinessProcessorRules.SetEmployeeIDValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersEmployeeID] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetEmployeeIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersEmployeeID] := Null; +end; + +function TOrdersBusinessProcessorRules.GetOrderDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderDate]; +end; + +function TOrdersBusinessProcessorRules.GetOrderDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderDate]); +end; + +function TOrdersBusinessProcessorRules.GetOldOrderDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersOrderDate]; +end; + +function TOrdersBusinessProcessorRules.GetOldOrderDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersOrderDate]); +end; + +procedure TOrdersBusinessProcessorRules.SetOrderDateValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderDate] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetOrderDateIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersOrderDate] := Null; +end; + +function TOrdersBusinessProcessorRules.GetRequiredDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersRequiredDate]; +end; + +function TOrdersBusinessProcessorRules.GetRequiredDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersRequiredDate]); +end; + +function TOrdersBusinessProcessorRules.GetOldRequiredDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersRequiredDate]; +end; + +function TOrdersBusinessProcessorRules.GetOldRequiredDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersRequiredDate]); +end; + +procedure TOrdersBusinessProcessorRules.SetRequiredDateValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersRequiredDate] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetRequiredDateIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersRequiredDate] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShippedDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShippedDate]; +end; + +function TOrdersBusinessProcessorRules.GetShippedDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShippedDate]); +end; + +function TOrdersBusinessProcessorRules.GetOldShippedDateValue: DateTime; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShippedDate]; +end; + +function TOrdersBusinessProcessorRules.GetOldShippedDateIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShippedDate]); +end; + +procedure TOrdersBusinessProcessorRules.SetShippedDateValue(const aValue: DateTime); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShippedDate] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShippedDateIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShippedDate] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipViaValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipVia]; +end; + +function TOrdersBusinessProcessorRules.GetShipViaIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipVia]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipViaValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipVia]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipViaIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipVia]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipViaValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipVia] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipViaIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipVia] := Null; +end; + +function TOrdersBusinessProcessorRules.GetFreightValue: Float; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersFreight]; +end; + +function TOrdersBusinessProcessorRules.GetFreightIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersFreight]); +end; + +function TOrdersBusinessProcessorRules.GetOldFreightValue: Float; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersFreight]; +end; + +function TOrdersBusinessProcessorRules.GetOldFreightIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersFreight]); +end; + +procedure TOrdersBusinessProcessorRules.SetFreightValue(const aValue: Float); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersFreight] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetFreightIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersFreight] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipNameValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipName]; +end; + +function TOrdersBusinessProcessorRules.GetShipNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipName]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipNameValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipName]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipNameIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipName]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipNameValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipName] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipNameIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipName] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipAddressValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipAddress]; +end; + +function TOrdersBusinessProcessorRules.GetShipAddressIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipAddress]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipAddressValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipAddress]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipAddressIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipAddress]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipAddressValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipAddress] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipAddressIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipAddress] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipCityValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCity]; +end; + +function TOrdersBusinessProcessorRules.GetShipCityIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCity]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipCityValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipCity]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipCityIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipCity]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipCityValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCity] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipCityIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCity] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipRegionValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipRegion]; +end; + +function TOrdersBusinessProcessorRules.GetShipRegionIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipRegion]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipRegionValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipRegion]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipRegionIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipRegion]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipRegionValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipRegion] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipRegionIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipRegion] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipPostalCodeValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipPostalCode]; +end; + +function TOrdersBusinessProcessorRules.GetShipPostalCodeIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipPostalCode]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipPostalCodeValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipPostalCode]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipPostalCodeIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipPostalCode]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipPostalCodeValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipPostalCode] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipPostalCodeIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipPostalCode] := Null; +end; + +function TOrdersBusinessProcessorRules.GetShipCountryValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCountry]; +end; + +function TOrdersBusinessProcessorRules.GetShipCountryIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCountry]); +end; + +function TOrdersBusinessProcessorRules.GetOldShipCountryValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipCountry]; +end; + +function TOrdersBusinessProcessorRules.GetOldShipCountryIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_OrdersShipCountry]); +end; + +procedure TOrdersBusinessProcessorRules.SetShipCountryValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCountry] := aValue; +end; + +procedure TOrdersBusinessProcessorRules.SetShipCountryIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_OrdersShipCountry] := Null; +end; + + +initialization + RegisterBusinessProcessorRules(RID_CustomersDelta, TCustomersBusinessProcessorRules); + RegisterBusinessProcessorRules(RID_OrdersDelta, TOrdersBusinessProcessorRules); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.Sample.html new file mode 100644 index 0000000..a223583 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.Sample.html @@ -0,0 +1,45 @@ + + + + + + + + + +

+ Strongly Typed Sample +

+ + +

Purpose

+ +

+This example shows usage of business rules. It enforces additional rules that might change over time. This is a good example to show the advantages of a multi-tier architecture: systems can be updated via a server re-deploy without the need to update any client. +

+ +

Examine the Code

+
    +
  • + uBizCustomersServer.pas: +this unit contains the business rules handlers for the server application. +It's important to note however that some business rules are shared among clients and servers. For example, customer validation is done by calling the ValidateCustomers function (uBizCustomersClient.pas). Validation is not a requirement but a highly recommended practice, expecially when your system is accessed by clients that were not developed by you (i.e. Java clients accessing your server through SOAP). +
  • +
  • + uBizCustomersClient.pas: +this unit contains the business rules handlers for the client application.
    + The simplest possible implementation just overrides the methods inherited from TDADataTableRules (i.e. AfterInsert, BeforePost). + More sophisticated implementations may add additional functionality and even make it accessible from outside units (i.e. a form or a data module hosting a TDADataTable).
    + TBizCustomersClientRules shows how to do both by overriding a few event handlers and by adding support for the IAdvancedCustomer interface. +
  • +
+ +

Note

+Adding interfaces like IAdvancedCustomer is not required to implement extra functionality that is only accessed in the context of a business rule class/unit. You can obviously add any method you want to classes like TBizCustomersClientRules and reference them from other methods in order to make them more "object oriented".
+However, when you need to access this functionality from the outside world you need to define an "access contract" via an interface. You can then treat TDADataTables as IAdvancedCustomer (or whatever other interface you decide to create) by simply using the Supports VCL function. + The bCheckBalanceClick method in fClientForm.pas is an example of this.

+

TDADataTable allows you to access the instance of TBizCustomersClientRules via the BusinessRules property. You could also type cast that property to TBizCustomersClientRules but, in general, the interface approach is cleaner and more elegant. + +

+ + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.bdsgroup b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.bdsgroup new file mode 100644 index 0000000..cd41e1a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + StronglyTypedServer.bdsproj + StronglyTypedClient.bdsproj + StronglyTypedServer.exe StronglyTypedClient.exe + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.bpg b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.bpg new file mode 100644 index 0000000..9eb9328 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = StronglyTypedServer.exe StronglyTypedClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +StronglyTypedServer.exe: StronglyTypedServer.dpr + $(DCC) + +StronglyTypedClient.exe: StronglyTypedClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.groupproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.groupproj new file mode 100644 index 0000000..ea9e40d --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTyped.groupproj @@ -0,0 +1,40 @@ + + + {4dcc5f31-7535-40c3-93a7-2ad992327e4b} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.bdsproj new file mode 100644 index 0000000..0357a18 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + StronglyTypedClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.dpr new file mode 100644 index 0000000..0f2d5e6 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.dpr @@ -0,0 +1,20 @@ +program StronglyTypedClient; + +uses + uROComInit, + Forms, + StronglyTypedClientMain in 'StronglyTypedClientMain.pas' {StronglyTypedClientMainForm}, + uBizCustomersClient in 'uBizCustomersClient.pas', + StronglyTypedClientData in 'StronglyTypedClientData.pas' {StronglyTypedClientDataModule: TDAClientDataModule}, + SampleSchemaClient_Intf in 'SampleSchemaClient_Intf.pas', + SampleSchemaServer_Intf in 'SampleSchemaServer_Intf.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'StronglyTyped Client'; + Application.CreateForm(TStronglyTypedClientDataModule, StronglyTypedClientDataModule); + Application.CreateForm(TStronglyTypedClientMainForm, StronglyTypedClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.dproj new file mode 100644 index 0000000..7ac1801 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.dproj @@ -0,0 +1,78 @@ + + + {e2da5b2a-47db-4d24-9a88-5aa94ec3dfca} + StronglyTypedClient.dpr + Debug + AnyCPU + DCC32 + StronglyTypedClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + StronglyTypedClient.dpr + + + + + + + MainSource + + + + +
StronglyTypedClientDataModule
+
+ +
StronglyTypedClientMainForm
+
+ +
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.res new file mode 100644 index 0000000..da01de5 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClient.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientData.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientData.dfm new file mode 100644 index 0000000..a1a69ad --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientData.dfm @@ -0,0 +1,466 @@ +object StronglyTypedClientDataModule: TStronglyTypedClientDataModule + OldCreateOrder = True + Height = 300 + Width = 224 + object ROChannel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/bin' + ServerLocators = <> + DispatchOptions = [] + Left = 40 + Top = 8 + end + object ROMessage: TROBinMessage + Left = 40 + Top = 52 + end + object RORemoteService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'StronglyTypedService' + Left = 40 + Top = 96 + end + object dtCustomers: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = <> + MasterMappingMode = mmDataRequest + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + BusinessRulesID = 'ClientRules.Customers' + Left = 112 + Top = 56 + end + object dsCustomers: TDADataSource + DataSet = dtCustomers.Dataset + DataTable = dtCustomers + Left = 128 + Top = 72 + end + object dtOrders: TDAMemDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'CustomerID' + DataType = datString + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptInput + end> + MasterParamsMappings.Strings = ( + 'CustomerID=CustomerID') + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteDataAdapter = RemoteDataAdapter + ReadOnly = False + MasterSource = dsCustomers + MasterFields = 'CustomerID' + DetailFields = 'CustomerID' + MasterRequestMappings.Strings = ( + 'CustomerID=CustomerID') + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Orders' + BusinessRulesID = 'ClientRules.Orders' + Left = 112 + Top = 128 + end + object dsOrders: TDADataSource + DataSet = dtOrders.Dataset + DataTable = dtOrders + Left = 128 + Top = 144 + end + object RemoteDataAdapter: TDARemoteDataAdapter + GetSchemaCall.RemoteService = RORemoteService + GetDataCall.RemoteService = RORemoteService + UpdateDataCall.RemoteService = RORemoteService + GetScriptsCall.RemoteService = RORemoteService + RemoteService = RORemoteService + DataStreamer = Streamer + FailureBehavior = fbBoth + Left = 40 + Top = 200 + end + object Streamer: TDABin2DataStreamer + BufferSize = 262144 + SendReducedDelta = False + Left = 40 + Top = 152 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientData.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientData.pas new file mode 100644 index 0000000..65922c7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientData.pas @@ -0,0 +1,37 @@ +unit StronglyTypedClientData; + +interface + +uses {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uDADataTable, uDABINAdapter, + uRORemoteService, uROClient, uROBINMessage, + uROWinInetHttpChannel, uDACDSDataTable, + uDAScriptingProvider, uDARemoteDataAdapter, uDADataStreamer, + uDABin2DataStreamer, uDAMemDataTable; + +type + TStronglyTypedClientDataModule = class(TDataModule) + ROChannel: TROWinInetHTTPChannel; + ROMessage: TROBinMessage; + RORemoteService: TRORemoteService; + dtCustomers: TDAMemDataTable; + dsCustomers: TDADataSource; + dtOrders: TDAMemDataTable; + dsOrders: TDADataSource; + RemoteDataAdapter: TDARemoteDataAdapter; + Streamer: TDABin2DataStreamer; + private + { Private declarations } + public + { Public declarations } + end; + +var + StronglyTypedClientDataModule: TStronglyTypedClientDataModule; + +implementation + +{$R *.DFM} + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientMain.dfm new file mode 100644 index 0000000..1795856 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientMain.dfm @@ -0,0 +1,135 @@ +object StronglyTypedClientMainForm: TStronglyTypedClientMainForm + Left = 287 + Top = 235 + BorderWidth = 5 + Caption = 'Strongly Typed Client' + ClientHeight = 299 + ClientWidth = 498 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object DBGrid1: TDBGrid + Left = 0 + Top = 21 + Width = 498 + Height = 100 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + DataSource = StronglyTypedClientDataModule.dsCustomers + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + OnTitleClick = DBGrid1TitleClick + end + object cbRemoteFetch: TCheckBox + Left = 0 + Top = 0 + Width = 136 + Height = 17 + Caption = 'Remote Fetch Enabled' + Checked = True + State = cbChecked + TabOrder = 0 + end + object DBGrid2: TDBGrid + Left = 0 + Top = 191 + Width = 498 + Height = 108 + Align = alBottom + DataSource = StronglyTypedClientDataModule.dsOrders + TabOrder = 3 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object Panel1: TPanel + Left = 0 + Top = 121 + Width = 498 + Height = 70 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object bCreateTestCustomer: TButton + Left = 1 + Top = 35 + Width = 145 + Height = 25 + Caption = 'Create Test Customer' + TabOrder = 0 + OnClick = bCreateTestCustomerClick + end + object DBNavigator1: TDBNavigator + Left = 0 + Top = 5 + Width = 240 + Height = 25 + DataSource = StronglyTypedClientDataModule.dsCustomers + TabOrder = 1 + end + object BitBtn1: TBitBtn + Left = 240 + Top = 5 + Width = 75 + Height = 25 + Caption = 'Open/Close' + TabOrder = 2 + OnClick = BitBtn1Click + end + object bCheckBalance: TButton + Left = 146 + Top = 35 + Width = 145 + Height = 25 + Caption = 'Check Customer Balance' + TabOrder = 3 + OnClick = bCheckBalanceClick + end + object Button1: TButton + Left = 291 + Top = 35 + Width = 185 + Height = 25 + Caption = 'Create Test Customer with Orders' + TabOrder = 4 + OnClick = Button1Click + end + object bApplyUpdates: TButton + Left = 315 + Top = 5 + Width = 97 + Height = 25 + Caption = 'Apply Updates' + TabOrder = 5 + OnClick = bApplyUpdatesClick + end + end + object ROMessage: TROBinMessage + Left = 148 + Top = 32 + end + object RORemoteService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'StronglyTypedService' + Left = 176 + Top = 32 + end + object ROChannel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 120 + Top = 32 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientMain.pas new file mode 100644 index 0000000..34839a3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedClientMain.pas @@ -0,0 +1,145 @@ +unit StronglyTypedClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROIndyHTTPChannel, + uROWinInetHttpChannel, DB, uDADataTable, + uDACDSDataTable, Buttons, ExtCtrls, DBCtrls, Grids, + DBGrids ; + +type + TStronglyTypedClientMainForm = class(TForm) + ROMessage: TROBinMessage; + RORemoteService: TRORemoteService; + ROChannel: TROWinInetHTTPChannel; + DBGrid1: TDBGrid; + cbRemoteFetch: TCheckBox; + DBGrid2: TDBGrid; + Panel1: TPanel; + bCreateTestCustomer: TButton; + DBNavigator1: TDBNavigator; + BitBtn1: TBitBtn; + bCheckBalance: TButton; + Button1: TButton; + bApplyUpdates: TButton; + procedure BitBtn1Click(Sender: TObject); + procedure bCheckBalanceClick(Sender: TObject); + procedure bApplyUpdatesClick(Sender: TObject); + procedure bCreateTestCustomerClick(Sender: TObject); + procedure dtCustomersBeforeOpen(DataTable: TDADataTable); + procedure Button1Click(Sender: TObject); + procedure DBGrid1TitleClick(Column: TColumn); + private + fCustomersCol: string; + fCustomersSort: TDASortDirection; + end; + +var + StronglyTypedClientMainForm: TStronglyTypedClientMainForm; + +implementation + +{ + The unit StronglyTypedLibrary_Intf.pas will be generated by the RemObjects preprocessor the first time you + compile your server application. Make sure to do that before trying to compile the client. + + To invoke your server simply typecast your server to the name of the service interface like this: + + (RORemoteService as IStronglyTypedService).Sum(1,2) +} + +uses StronglyTypedLibrary_Intf, SampleSchemaClient_Intf, uBizCustomersClient, + StronglyTypedClientData; + +{$R *.dfm} + +procedure TStronglyTypedClientMainForm.BitBtn1Click(Sender: TObject); +begin + with StronglyTypedClientDataModule do + dtCustomers.Active := not dtCustomers.Active; +end; + +procedure TStronglyTypedClientMainForm.bCheckBalanceClick(Sender: TObject); +var + balance: currency; +begin + with (StronglyTypedClientDataModule.dtCustomers as IAdvancedCustomer) do begin + balance := CheckBalance; // <-- Custom method! + + ShowMessage(CustomerID + ' has ' + FloatToStr(balance) + '$ in his account'); + end; +end; + +procedure TStronglyTypedClientMainForm.bApplyUpdatesClick(Sender: TObject); +begin + try + StronglyTypedClientDataModule.dtCustomers.ApplyUpdates(TRUE); + except + with StronglyTypedClientDataModule.dtCustomers do begin + Close; + Open; + end; + raise; + end; +end; + +procedure TStronglyTypedClientMainForm.bCreateTestCustomerClick(Sender: TObject); +begin + with (StronglyTypedClientDataModule.dtCustomers as ICustomers) do begin + Insert; + CustomerID := 'ID' + IntToStr(RecordCount); + CompanyName := 'RemObjects Software, Inc.'; + ContactName := 'Alex'; + + Post; + end; +end; + +procedure TStronglyTypedClientMainForm.dtCustomersBeforeOpen(DataTable: TDADataTable); +begin + StronglyTypedClientDataModule.dtCustomers.RemoteFetchEnabled := cbRemoteFetch.Checked; +end; + +procedure TStronglyTypedClientMainForm.Button1Click(Sender: TObject); +var + i: integer; +begin + with (StronglyTypedClientDataModule.dtCustomers as IAdvancedCustomer) do begin + Insert; + CustomerID := 'ID' + IntToStr(RecordCount); + CompanyName := 'RemObjects Software, Inc.'; + ContactName := 'Alex'; + Post; + + for i := 0 to Random(10) + 1 do begin + Orders.Insert; + Orders.EmployeeID := 1; + Orders.OrderDate := Now; + Orders.RequiredDate := Now + Random(4); + Orders.ShipVia := 1; + Orders.Post; + end; + end; +end; + +procedure TStronglyTypedClientMainForm.DBGrid1TitleClick(Column: TColumn); +var + dt: TDADataTable; +begin + dt := TDADataSource(Column.Grid.DataSource).DataTable; + + if not SameText(fCustomersCol, Column.FieldName) then begin + fCustomersCol := Column.FieldName; + fCustomersSort := sdAscending; + end + else begin + fCustomersSort := TDASortDirection(integer(fCustomersSort) xor 1); + end; + + dt.Sort([fCustomersCol], [fCustomersSort]); +end; + +end. + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedLibrary.RODL b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedLibrary.RODL new file mode 100644 index 0000000..664a6c4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedLibrary.RODL @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedLibrary_Intf.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedLibrary_Intf.pas new file mode 100644 index 0000000..1ca1f9a --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedLibrary_Intf.pas @@ -0,0 +1,121 @@ +unit StronglyTypedLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf, + {Used RODLs:} DataAbstract4_Intf; + +const + { Library ID } + LibraryUID = '{1BBB15C7-1CF5-4C37-B9C8-323AFAF87EB6}'; + TargetNamespace = ''; + + { Service Interface ID's } + IStronglyTypedService_IID : TGUID = '{E611C0CF-5A17-469F-B906-98AFF41C1D73}'; + + { Event ID's } + +type + { Forward declarations } + IStronglyTypedService = interface; + + + + + + { Enumerateds } + + { IStronglyTypedService } + IStronglyTypedService = interface(IDataAbstractService) + ['{E611C0CF-5A17-469F-B906-98AFF41C1D73}'] + function CheckBalance(const CustomerID: AnsiString): Currency; + function GetOrders(const CustomerID: AnsiString): Binary; + end; + + { CoStronglyTypedService } + CoStronglyTypedService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IStronglyTypedService; + end; + + { TStronglyTypedService_Proxy } + TStronglyTypedService_Proxy = class(TDataAbstractService_Proxy, IStronglyTypedService) + protected + function __GetInterfaceName:string; override; + + function CheckBalance(const CustomerID: AnsiString): Currency; + function GetOrders(const CustomerID: AnsiString): Binary; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoStronglyTypedService } + +class function CoStronglyTypedService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IStronglyTypedService; +begin + result := TStronglyTypedService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TStronglyTypedService_Proxy } + +function TStronglyTypedService_Proxy.__GetInterfaceName:string; +begin + result := 'StronglyTypedService'; +end; + +function TStronglyTypedService_Proxy.CheckBalance(const CustomerID: AnsiString): Currency; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'StronglyTypedLibrary', __InterfaceName, 'CheckBalance'); + __Message.Write('CustomerID', TypeInfo(AnsiString), CustomerID, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Currency), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TStronglyTypedService_Proxy.GetOrders(const CustomerID: AnsiString): Binary; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'StronglyTypedLibrary', __InterfaceName, 'GetOrders'); + __Message.Write('CustomerID', TypeInfo(AnsiString), CustomerID, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IStronglyTypedService_IID, TStronglyTypedService_Proxy); + + +finalization + UnregisterProxyClass(IStronglyTypedService_IID); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedLibrary_Invk.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedLibrary_Invk.pas new file mode 100644 index 0000000..ce292a7 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedLibrary_Invk.pas @@ -0,0 +1,95 @@ +unit StronglyTypedLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Used RODL Intf's:} DataAbstract4_Intf, + {Used RODL Invk's:} DataAbstract4_Invk, + {Generated:} StronglyTypedLibrary_Intf; + +type + TStronglyTypedService_Invoker = class(TDataAbstractService_Invoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_CheckBalance(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetOrders(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TStronglyTypedService_Invoker } + +constructor TStronglyTypedService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TStronglyTypedService_Invoker.Invoke_CheckBalance(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function CheckBalance(const CustomerID: AnsiString): Currency; } +var + CustomerID: AnsiString; + lResult: Currency; +begin + try + __Message.Read('CustomerID', TypeInfo(AnsiString), CustomerID, []); + + lResult := (__Instance as IStronglyTypedService).CheckBalance(CustomerID); + + __Message.InitializeResponseMessage(__Transport, 'StronglyTypedLibrary', 'StronglyTypedService', 'CheckBalanceResponse'); + __Message.Write('Result', TypeInfo(Currency), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TStronglyTypedService_Invoker.Invoke_GetOrders(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetOrders(const CustomerID: AnsiString): Binary; } +var + CustomerID: AnsiString; + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + __Message.Read('CustomerID', TypeInfo(AnsiString), CustomerID, []); + + lResult := (__Instance as IStronglyTypedService).GetOrders(CustomerID); + + __Message.InitializeResponseMessage(__Transport, 'StronglyTypedLibrary', 'StronglyTypedService', 'GetOrdersResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.bdsproj new file mode 100644 index 0000000..220fcb0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + StronglyTypedServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.dpr new file mode 100644 index 0000000..5e79582 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.dpr @@ -0,0 +1,25 @@ +program StronglyTypedServer; + +{#ROGEN:StronglyTypedLibrary.rodl} // RemObjects: Careful, do not remove! + + + +uses + uROComInit, + Forms, + StronglyTypedServerMain in 'StronglyTypedServerMain.pas' {StronglyTypedServerMainFoem}, + StronglyTypedLibrary_Intf in 'StronglyTypedLibrary_Intf.pas', + StronglyTypedLibrary_Invk in 'StronglyTypedLibrary_Invk.pas', + StronglyTypedService_Impl in 'StronglyTypedService_Impl.pas' {StronglyTypedService: TDARemoteService}, + SampleSchemaClient_Intf in 'SampleSchemaClient_Intf.pas', + SampleSchemaServer_Intf in 'SampleSchemaServer_Intf.pas', + uBizCustomersServer in 'uBizCustomersServer.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.CreateForm(TStronglyTypedServerMainFoem, StronglyTypedServerMainFoem); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.dproj new file mode 100644 index 0000000..1772ed3 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.dproj @@ -0,0 +1,80 @@ + + + {93d81d2c-638f-47b8-a46b-efb92ea95bcc} + StronglyTypedServer.dpr + Debug + AnyCPU + DCC32 + StronglyTypedServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + StronglyTypedServer.dpr + + + + + + + MainSource + + + + + + +
StronglyTypedServerMainFoem
+
+ +
StronglyTypedService
+
+ +
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.res new file mode 100644 index 0000000..7455d6e Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServer.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServerMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServerMain.dfm new file mode 100644 index 0000000..b79bd82 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServerMain.dfm @@ -0,0 +1,69 @@ +object StronglyTypedServerMainFoem: TStronglyTypedServerMainFoem + Left = 87 + Top = 224 + BorderStyle = bsDialog + Caption = 'StronglyTyped server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Form1' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 14 + object DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton + Left = 5 + Top = 5 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object ROMessage: TROBinMessage + Left = 36 + Top = 8 + end + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 8 + Top = 8 + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + AutoLoad = False + TraceActive = False + TraceFlags = [] + Left = 64 + Top = 8 + end + object ConnectionManager: TDAConnectionManager + MaxPoolSize = 10 + PoolTimeoutSeconds = 60 + PoolBehaviour = pbWait + WaitIntervalSeconds = 1 + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Description = 'Borland ADOExpress Connection' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 96 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServerMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServerMain.pas new file mode 100644 index 0000000..2f1c92f --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedServerMain.pas @@ -0,0 +1,39 @@ +unit StronglyTypedServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, uROIndyTCPServer, + uDAClasses, uDADriverManager, uDAEngine, uDAADODriver, + uDAPoweredByDataAbstractButton; + +type + TStronglyTypedServerMainFoem = class(TForm) + ROMessage: TROBinMessage; + ROServer: TROIndyHTTPServer; + DriverManager: TDADriverManager; + ConnectionManager: TDAConnectionManager; + DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton; + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + StronglyTypedServerMainFoem: TStronglyTypedServerMainFoem; + +implementation + + +{$R *.dfm} + +procedure TStronglyTypedServerMainFoem.FormCreate(Sender: TObject); +begin + ROServer.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedService_Impl.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedService_Impl.dfm new file mode 100644 index 0000000..3cf4972 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedService_Impl.dfm @@ -0,0 +1,1092 @@ +object StronglyTypedService: TStronglyTypedService + OldCreateOrder = True + ConnectionName = 'ADO' + ServiceSchema = SampleSchema + ServiceDataStreamer = Streamer + ExportedDataTables = <> + Height = 300 + Width = 300 + object SampleSchema: TDASchema + ConnectionManager = StronglyTypedServerMainFoem.ConnectionManager + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = < + item + Name = 'CustomerID' + DataType = datString + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10' FROM'#10' ' + + ' Orders'#10' WHERE CustomerID=:CustomerID' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = < + item + Params = < + item + Name = 'CustomerID' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'CompanyName' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'ContactName' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'ContactTitle' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'Address' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'City' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'Region' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'PostalCode' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'Country' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'Phone' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'Fax' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end + item + Name = 'TestNumeric' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'INSERT'#10' INTO Customers'#10' (CustomerID, CompanyName, ContactNam' + + 'e, ContactTitle, Address, City, Region, PostalCode, Country, Pho' + + 'ne, Fax, TestNumeric)'#10' VALUES'#10' (:CustomerID, :CompanyName, :' + + 'ContactName, :ContactTitle, :Address, :City, :Region, :PostalCod' + + 'e, :Country, :Phone, :Fax, :TestNumeric)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Insert_Customers' + end + item + Params = < + item + Name = 'OLD_CustomerID' + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptUnknown + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'DELETE '#10' FROM'#10' Customers'#10' WHERE'#10' (CustomerID = :OLD_Cust' + + 'omerID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Delete_Customers' + end + item + Params = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'CompanyName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ContactName' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ContactTitle' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'Address' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'City' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'Region' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'PostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'Country' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'Phone' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'Fax' + DataType = datString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'OLD_CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'UPDATE Customers'#10' SET'#10' CustomerID = :CustomerID,'#10' Company' + + 'Name = :CompanyName,'#10' ContactName = :ContactName,'#10' Contact' + + 'Title = :ContactTitle,'#10' Address = :Address,'#10' City = :City,' + + #10' Region = :Region,'#10' PostalCode = :PostalCode,'#10' Country' + + ' = :Country,'#10' Phone = :Phone,'#10' Fax = :Fax'#10' WHERE'#10' (Cus' + + 'tomerID = :OLD_CustomerID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Update_Customers' + end + item + Params = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Orders' + SQL = + 'INSERT'#10' INTO Orders'#10' (CustomerID, EmployeeID, OrderDate, Req' + + 'uiredDate, ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' ShipCity, ShipRegion, ShipPostalCode, ShipCountry)'#10' VALUES'#10' ' + + ' (:CustomerID, :EmployeeID, :OrderDate, :RequiredDate, :ShippedD' + + 'ate, :ShipVia, :Freight, :ShipName, :ShipAddress, :ShipCity, :Sh' + + 'ipRegion, :ShipPostalCode, :ShipCountry)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Insert_Orders' + end + item + Params = < + item + Name = 'OLD_OrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Orders' + SQL = 'DELETE '#10' FROM'#10' Orders'#10' WHERE'#10' (OrderID = :OLD_OrderID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Delete_Orders' + end + item + Params = < + item + Name = 'CustomerID' + DataType = datString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipName' + DataType = datString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipAddress' + DataType = datString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipCity' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipRegion' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipPostalCode' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'ShipCountry' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end + item + Name = 'OLD_OrderID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + ParamType = daptInput + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Orders' + SQL = + 'UPDATE Orders'#10' SET '#10' CustomerID = :CustomerID,'#10' EmployeeI' + + 'D = :EmployeeID, '#10' OrderDate = :OrderDate, '#10' RequiredDate ' + + '= :RequiredDate, '#10' ShippedDate = :ShippedDate, '#10' ShipVia =' + + ' :ShipVia, '#10' Freight = :Freight, '#10' ShipName = :ShipName, '#10 + + ' ShipAddress = :ShipAddress, '#10' ShipCity = :ShipCity, '#10' ' + + 'ShipRegion = :ShipRegion, '#10' ShipPostalCode = :ShipPostalCode,' + + ' '#10' ShipCountry = :ShipCountry'#10' WHERE'#10' (OrderID = :OLD_Ord' + + 'erID)' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'Update_Orders' + end> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 128 + Top = 58 + end + object CustomersProcessor: TDABusinessProcessor + Schema = SampleSchema + ReferencedDataset = 'Customers' + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete, poPrepareCommands] + UpdateMode = updWhereKeyOnly + BusinessRulesID = 'ServerRules.Customers' + Left = 42 + Top = 8 + end + object OrdersProcessor: TDABusinessProcessor + Schema = SampleSchema + ProcessorOptions = [poAutoGenerateInsert, poAutoGenerateUpdate, poAutoGenerateDelete, poPrepareCommands] + UpdateMode = updWhereKeyOnly + Left = 42 + Top = 58 + end + object Streamer: TDABin2DataStreamer + BufferSize = 262144 + SendReducedDelta = False + Left = 128 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedService_Impl.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedService_Impl.pas new file mode 100644 index 0000000..6842020 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/StronglyTypedService_Impl.pas @@ -0,0 +1,84 @@ +unit StronglyTypedService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} StronglyTypedLibrary_Intf, uDAScriptingProvider, + uDABusinessProcessor, uDADataStreamer,uDAClasses,uDAinterfaces,uDADelta, + uDABin2DataStreamer; + + +const + { Dataset names for SampleSchema } + ds_Customers = 'Customers'; + ds_Orders = 'Orders'; + + { Command names for SampleSchema } + cmd_Insert_Customers = 'Insert_Customers'; + cmd_Delete_Customers = 'Delete_Customers'; + cmd_Update_Customers = 'Update_Customers'; + cmd_Insert_Orders = 'Insert_Orders'; + cmd_Delete_Orders = 'Delete_Orders'; + cmd_Update_Orders = 'Update_Orders'; + +type + { TStronglyTypedService } + TStronglyTypedService = class(TDataAbstractService, IStronglyTypedService) + CustomersProcessor: TDABusinessProcessor; + OrdersProcessor: TDABusinessProcessor; + SampleSchema: TDASchema; + Streamer: TDABin2DataStreamer; + private + protected + { IStronglyTypedService methods } + function CheckBalance(const CustomerID: AnsiString): Currency; + function GetOrders(const CustomerID: AnsiString): Binary; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} StronglyTypedLibrary_Invk,StronglyTypedServerMain; + +procedure Create_StronglyTypedService(out anInstance : IUnknown); +begin + anInstance := TStronglyTypedService.Create(NIL); +end; + +{ TStronglyTypedService } + +function TStronglyTypedService.CheckBalance( + const CustomerID: AnsiString): Currency; +begin + if (CustomerID='ALFKI') then result := 100000 else result := 8000; +end; + +function TStronglyTypedService.GetOrders(const CustomerID: AnsiString): Binary; +var + orders: IDADataset; +begin + orders := SampleSchema.NewDataset(Connection, ds_Orders, ['CustomerID'], [CustomerID]); + Result:=Binary.Create; + Streamer.Initialize(result, aiWrite); + Streamer.WriteDataset(orders, [woRows], -1); + Streamer.Finalize; +end; + +initialization + TROClassFactory.Create('StronglyTypedService', Create_StronglyTypedService, TStronglyTypedService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/uBizCustomersClient.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/uBizCustomersClient.pas new file mode 100644 index 0000000..b342af1 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/uBizCustomersClient.pas @@ -0,0 +1,209 @@ +unit uBizCustomersClient; + +{ + This unit contains the business rules handlers for the client application. + + The simplest possible implementation just overrides the methods inherited + from TDADataTableRules (i.e. AfterInsert, BeforePost). + + More sophisticated ones instead add additional behaviour and even make it accessible + from outside units (i.e. a form or a data module hosting a TDADataTable). + + TBizCustomersClientRules shows an example of both possibilities by overriding a few event + handlers and adding support for the interface IAdvancedCustomer. + + Adding interfaces like IAdvancedCustomer is not required to implement extra functionality that is + only accessed in the context of a business rule class/unit. You obviously can add any method you want to + classes like TBizCustomersClientRules and reference them from other methods in order to make them + more "object oriented" (see DummTest below). + But when you need to access this functionality from the outside world you need to define an + "access contract" via an interface. You can then treat TDADataTables as IAdvancedCustomer (or + whatever other interface you decide to create) by simply using the VCL function Supports. + See an example of this in the unit fClientForm.pas, method bCheckBalanceClick + + Note: TDADataTable also allows you to access the instance of TBizCustomersClientRules via the + property BusinessRules. You could also type cast that property to TBizCustomersClientRules but + in general, the interface approach is cleaner and more elegant. +} + +interface + +uses + Classes, SysUtils, + uDADataTable, SampleSchemaClient_Intf, + uDAInterfaces, SampleSchemaServer_Intf, + StronglyTypedLibrary_Intf; // Not really required. Just for the IDefaultROIntfServer example below + +type + { IAdvancedCustomer } + IAdvancedCustomer = interface(ICustomers) + ['{BDB203DC-954B-4D78-A446-B1E2232BEF71}'] + function GetOrders : IOrders; + + function CheckBalance : currency; + procedure DisableAccount; + + property Orders : IOrders read GetOrders; + end; + + { TBizCustomersClientRules } + TBizCustomersClientRules = class(TCustomersDataTableRules, IAdvancedCustomer) + private + + protected + // Business events + procedure AfterInsert(Sender : TDADataTable); override; + procedure BeforeDelete(Sender : TDADataTable); override; + procedure BeforePost(Sender : TDADataTable); override; + + // IAdvancedCustomer + function CheckBalance : currency; + procedure DisableAccount; + function GetOrders : IOrders; + end; + + { TBizOrdersClientRules } + TBizOrdersClientRules = class(TOrdersDataTableRules) + protected + procedure OnNewRecord(Sender: TDADataTable); override; + procedure BeforePost(Sender : TDADataTable); override; + end; + + { TBizCustomerIDRules } + TBizCustomerIDRules = class(TDAFieldRules) + private + protected + procedure OnValidate(Sender: TDACustomField); override; + procedure OnChange(Sender: TDACustomField); override; + + end; + + +{ General validation routine shared by client and server } +procedure ValidateCustomer(const aCustomers : ICustomers); + +implementation +uses uDARemoteDataAdapter; +const + def_CompanyName = 'New Company'; + def_ContactName = ''; + +{ General validation routine shared by client and server } +procedure ValidateCustomer(const aCustomers : ICustomers); +var errors : string; +begin + errors := ''; + with aCustomers do begin + if (Trim(CustomerID)='') then errors := errors+'CustomerID cannot be empty'+#13; + if (Trim(CompanyName)='') then errors := errors+'CompanyName is required'+#13; + + if (errors<>'') + then raise EDABizValidationException.Create(errors); + end; +end; + +procedure ValidateOrder(const aOrder : IOrders); +var errors : string; +begin + errors := ''; + + with aOrder do begin + if (Trim(CustomerID)='') then errors := errors+'An order must have a CustomerID'+#13; + + if (EmployeeID<=0) // 0 also covers NULL in the conversion of AsInteger + then errors := errors+'Invalid or unspecified EmployeeID'+#13; + + if (errors<>'') + then raise EDABizValidationException.Create(errors); + end; +end; + +{ TBizCustomersClientRules } +procedure TBizCustomersClientRules.AfterInsert(Sender : TDADataTable); +begin + inherited; + + CustomerID := IntToStr(DataTable.RecordCount); + CompanyName := def_CompanyName; + ContactName := def_ContactName; +end; + +procedure TBizCustomersClientRules.BeforeDelete(Sender : TDADataTable); +begin + inherited; +end; + +procedure TBizCustomersClientRules.BeforePost(Sender : TDADataTable); +begin + inherited; + + ValidateCustomer(Self); +end; + +function TBizCustomersClientRules.CheckBalance: currency; +begin + { + A simple example of how to invoke remote service using the referenced RemoteService. + Nothing prevents you to add an interface which takes a TRORemoteService as parameter or even + an IxxxService interface. Possibilities are endless! + } + result := (TDARemoteDataAdapter(DataTable.RemoteDataAdapter).RemoteService as IStronglyTypedService).CheckBalance(CustomerID) +end; + +procedure TBizCustomersClientRules.DisableAccount; +begin + // This is just for demonstration purposes and completeness. + Beep; +end; + +function TBizCustomersClientRules.GetOrders: IOrders; +begin + { + Provides access to the detail datatable which points to Orders. + Detail access depends on the client module/form. Not all might support or require + the use of this property. An exception is raised at runtime by DetailByName + if the detail table was never actually linked. + } + + result := DetailByName(nme_Orders) as IOrders; +end; + +{ TBizOrdersClientRules } + +procedure TBizOrdersClientRules.BeforePost(Sender: TDADataTable); +begin + inherited; + ValidateOrder(Self); +end; + +procedure TBizOrdersClientRules.OnNewRecord(Sender: TDADataTable); +begin + with (DataTable.GetMasterDataTable as ICustomers) do begin + if (CustomerID='ALFKI') + then raise EDABizValidationException.Create('You cannot add orders to ALFKI'); + end; +end; + +{ TBizCustomerIDRules } + +procedure TBizCustomerIDRules.OnChange(Sender: TDACustomField); +var i : integer; + lCurrVal : string; +begin + lCurrVal := Sender.AsString; + for i := 1 to Length(lCurrVal) do + if not (lCurrVal[i] in ['a'..'z', 'A'..'Z', '0'..'9']) + then raise EDABizValidationException.Create('Invalid character'); +end; + +procedure TBizCustomerIDRules.OnValidate(Sender: TDACustomField); +begin + beep; +end; + +initialization + RegisterDataTableRules('ClientRules.Customers', TBizCustomersClientRules); + RegisterDataTableRules('ClientRules.Orders', TBizOrdersClientRules); + RegisterFieldRules('CustomerID', TBizCustomerIDRules); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/uBizCustomersServer.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/uBizCustomersServer.pas new file mode 100644 index 0000000..5f22864 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Strongly Typed/uBizCustomersServer.pas @@ -0,0 +1,60 @@ +unit uBizCustomersServer; + +{ + This unit contains the business rules handlers for the server application. + + It enforces additional rules that might change over time. This is a good example + to show the advantages of a multi-tier architecture: systems can be updated in a + matter of a server re-deploy without the need to update any client. + + It's important to notice how some business rules are shared among clients and servers. + In particular, Customer validation is done by calling the function ValidateCustomers + (from uBizCustomersClient.pas). This is not a requirement but a highly adviceable + practice, expecially when your system is accessed by clients that were not developed by + you (i.e. Java clients accessing your server through SOAP). + + For additional topics such as how to extend the business functionality adding custom + interfaces, refer to the comments in the unit uBizCustomersClient.pas +} + +interface + +uses + Classes, SysUtils, + uDADataTable,uDADelta, + uBizCustomersClient, uDAInterfaces, + uDABusinessProcessor, SampleSchemaServer_Intf; + +type + { TBizCustomerServerRules } + TBizCustomerServerRules = class(TCustomersBusinessProcessorRules) + protected + // Business events + procedure BeforeProcessChange(Sender : TDABusinessProcessor; aChangeType : TDAChangeType; + aChange : TDADeltaChange; var ProcessChange : boolean); override; + end; + +implementation + +{ TBizCustomerServerRules } + +procedure TBizCustomerServerRules.BeforeProcessChange( + Sender: TDABusinessProcessor; aChangeType: TDAChangeType; + aChange: TDADeltaChange; var ProcessChange: boolean); +begin + inherited; + if (aChangeType<>ctDelete) then ValidateCustomer(Self); + + // Sort of a strong rule but it's just to make a point that server side business + // rules might enforce stronger rules than clients. + + if (aChangeType=ctInsert) and not SameText(ContactName, 'Alex') + then raise Exception.Create('Cannot process an update without Alex as ContactName'); + + ContactTitle := TimeToStr(Now); +end; + +initialization + RegisterBusinessProcessorRules('ServerRules.Customers', TBizCustomerServerRules); + +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Styles.css b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Styles.css new file mode 100644 index 0000000..c8e0628 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/Styles.css @@ -0,0 +1,103 @@ +body +{ + background-color: #f7f7f7; + margin-top: 15px; + margin-bottom: 15px; + margin-left: 15px; + margin-right: 15px; + padding-top: 10px; + padding-bottom: 10px; + padding-left: 10px; + padding-right: 10px; + font-family: tahoma, verdana, sans-serif; + font-size: 10pt; + width: 700px; + color: #000000; +} +p +{ + padding-top: 0; + padding-bottom: 0; + padding-left: 0; + padding-right: 0.5em; +} +ul +{ + padding-top: 0; + padding-bottom: 0; + list-style-type: disc; +} +li +{ + padding-top: 0; + padding-bottom: 0; +} +img +{ + margin: 5px; + border-width: 0; +} +table +{ + background-color: #f7f7f7; + margin: 15px; + padding: 0px; + font-size: 10pt; +} +tr +{ + background-color: #f7f7f7; + margin: 15px; + padding: 0px; + font-size: 10pt; +} +td, th +{ + background-color: #f7f7f7; + margin: 0; + padding: 5px; + font-size: 10pt; +} +td ul +{ + padding-left: 2em; +} + +img:left { margin-left: 0; } +img:right { margin-right: 0; } +p.h1 +{ + margin-top: 1em; + margin-bottom: 0.5px; + padding-bottom:0px; + font-size:13pt; + font-weight:bold; +} +p.h2 +{ + margin-top: 1em; + margin-bottom: 0.5px; + padding-bottom:0px; + font-size:11pt; + font-weight:bold; +} +p.h3 +{ + margin-top: 1em; + margin-bottom: 0.5px; + padding-bottom:0px; + font-size:10pt; + font-weight:bold; +} +pre +{ + margin-top:0px; + margin-bottom:0px; + margin-left:0px; + margin-right:0px; +} +.spaced +{ + letter-spacing:1px; + color:#000060; +} diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/CustomersHTML.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/CustomersHTML.html new file mode 100644 index 0000000..cd41181 Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/CustomersHTML.html differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/CustomersToHTML.xsl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/CustomersToHTML.xsl new file mode 100644 index 0000000..8107a83 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/CustomersToHTML.xsl @@ -0,0 +1,35 @@ + + + + + + + +

+ + + + + + + +
+

+ Customer: , + , + , +

+

+ Address: , + City: , + , + , +

+

+ Phone: + Fax: +

+

+ + +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/CustomersToSimpleXML.xsl b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/CustomersToSimpleXML.xsl new file mode 100644 index 0000000..902b170 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/CustomersToSimpleXML.xsl @@ -0,0 +1,23 @@ + + + + + + + + () + , + , + + +
+ + , + + + +
+
+
+
+
diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/DALogo.png b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/DALogo.png new file mode 100644 index 0000000..54892ce Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/DALogo.png differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.Sample.html b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.Sample.html new file mode 100644 index 0000000..23bffb0 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.Sample.html @@ -0,0 +1,31 @@ + + + + + + + + + +

+ XSLT Sample +

+ + +

Purpose

+ +

+This example shows how to import dataset data into an .xml file by using the TDAXmlDataStreamer. +Exporting dataset changes to an .xml file is also shown.
+

+ +

Examine the Code

+
    +
  • + See the simple code in XSLTMain.pas. +
  • +
+ + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.bdsproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.bdsproj new file mode 100644 index 0000000..5f2c59c --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + XSLT.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.dpr b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.dpr new file mode 100644 index 0000000..672dbce --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.dpr @@ -0,0 +1,14 @@ +program XSLT; + +uses + Forms, + XSLTMain in 'XSLTMain.pas' {XSLTMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'XSLT Sample'; + Application.CreateForm(TXSLTMainForm, XSLTMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.dproj b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.dproj new file mode 100644 index 0000000..a22c322 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.dproj @@ -0,0 +1,72 @@ + + + {eb5321d8-fcb7-4e0d-a61b-0469d08bc4e3} + XSLT.dpr + Debug + AnyCPU + DCC32 + XSLT.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + XSLT.dpr + + + + + + + MainSource + + +
XSLTMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.res b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.res new file mode 100644 index 0000000..b946fbb Binary files /dev/null and b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLT.res differ diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLTMain.dfm b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLTMain.dfm new file mode 100644 index 0000000..9063f8e --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLTMain.dfm @@ -0,0 +1,1110 @@ +object XSLTMainForm: TXSLTMainForm + Left = 327 + Top = 205 + AutoScroll = False + BorderWidth = 5 + Caption = 'XSLT Sample' + ClientHeight = 402 + ClientWidth = 456 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object PageControl: TPageControl + Left = 0 + Top = 34 + Width = 456 + Height = 368 + ActivePage = tsXML + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + TabIndex = 0 + TabOrder = 4 + object tsXML: TTabSheet + Caption = 'XML' + object WebBrowser: TWebBrowser + Left = 0 + Top = 0 + Width = 448 + Height = 340 + Align = alClient + TabOrder = 0 + ControlData = { + 4C0000004D2E0000242300000000000000000000000000000000000000000000 + 000000004C000000000000000000000001000000E0D057007335CF11AE690800 + 2B2E126208000000000000004C0000000114020000000000C000000000000046 + 8000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000100000000000000000000000000000000000000} + end + end + object tsGrid: TTabSheet + Caption = 'Grid' + ImageIndex = 1 + object Splitter2: TSplitter + Left = 0 + Top = 152 + Width = 448 + Height = 3 + Cursor = crVSplit + Align = alBottom + end + object gCustomers: TDBGrid + Left = 0 + Top = 0 + Width = 448 + Height = 152 + Align = alClient + DataSource = dsCustomers + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + object gOrders: TDBGrid + Left = 0 + Top = 155 + Width = 448 + Height = 185 + Align = alBottom + DataSource = dsOrders + Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit] + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'MS Sans Serif' + TitleFont.Style = [] + end + end + end + object GetDataButton: TButton + Left = 2 + Top = 4 + Width = 75 + Height = 25 + Caption = 'Get Data' + TabOrder = 0 + OnClick = GetDataButtonClick + end + object GenerateDeltaButton: TButton + Left = 80 + Top = 4 + Width = 120 + Height = 25 + Caption = 'Generate Delta XML' + TabOrder = 1 + OnClick = GenerateDeltaButtonClick + end + object XSLTTransformationButton: TButton + Left = 202 + Top = 4 + Width = 131 + Height = 25 + Caption = 'XSLT Transformation' + TabOrder = 2 + OnClick = XSLTTransformationButtonClick + end + object GenerateHTMLButton: TButton + Left = 336 + Top = 4 + Width = 106 + Height = 25 + Caption = 'Generate HTML' + TabOrder = 3 + OnClick = XSLTTransformationButtonClick + end + object DriverManager: TDADriverManager + DriverDirectory = '%SYSTEM%\' + TraceActive = False + TraceFlags = [] + Left = 274 + Top = 176 + end + object ConnectionManager: TDAConnectionManager + Connections = < + item + Name = 'ADO' + ConnectionString = + 'ADO?AuxDriver=SQLOLEDB.1;Server=localhost;Database=Northwind;Integrated Security=SSPI;' + Default = True + Tag = 0 + end> + DriverManager = DriverManager + PoolingEnabled = True + Left = 304 + Top = 176 + end + object ADODriver: TDAADODriver + Left = 333 + Top = 176 + end + object Schema: TDASchema + ConnectionManager = ConnectionManager + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Customers' + SQL = + 'SELECT '#10' CustomerID, CompanyName, ContactName, ContactTitle, ' + + #10' Address, City, Region, PostalCode, Country, Phone, '#10' Fax' + + #10' FROM'#10' Customers'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'CompanyName' + TableField = 'CompanyName' + end + item + DatasetField = 'ContactName' + TableField = 'ContactName' + end + item + DatasetField = 'ContactTitle' + TableField = 'ContactTitle' + end + item + DatasetField = 'Address' + TableField = 'Address' + end + item + DatasetField = 'City' + TableField = 'City' + end + item + DatasetField = 'Region' + TableField = 'Region' + end + item + DatasetField = 'PostalCode' + TableField = 'PostalCode' + end + item + DatasetField = 'Country' + TableField = 'Country' + end + item + DatasetField = 'Phone' + TableField = 'Phone' + end + item + DatasetField = 'Fax' + TableField = 'Fax' + end> + end> + Name = 'Customers' + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end + item + Params = < + item + Name = 'customerid' + DataType = datWideString + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptUnknown + end> + Statements = < + item + Connection = 'ADO' + TargetTable = 'Orders' + SQL = + 'SELECT '#10' OrderID, CustomerID, EmployeeID, OrderDate, Required' + + 'Date, '#10' ShippedDate, ShipVia, Freight, ShipName, ShipAddress,' + + ' '#10' ShipCity, ShipRegion, ShipPostalCode, ShipCountry'#10' FROM'#10' ' + + ' Orders'#10' where'#10' customerid = :customerid'#10 + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'OrderID' + TableField = 'OrderID' + end + item + DatasetField = 'CustomerID' + TableField = 'CustomerID' + end + item + DatasetField = 'EmployeeID' + TableField = 'EmployeeID' + end + item + DatasetField = 'OrderDate' + TableField = 'OrderDate' + end + item + DatasetField = 'RequiredDate' + TableField = 'RequiredDate' + end + item + DatasetField = 'ShippedDate' + TableField = 'ShippedDate' + end + item + DatasetField = 'ShipVia' + TableField = 'ShipVia' + end + item + DatasetField = 'Freight' + TableField = 'Freight' + end + item + DatasetField = 'ShipName' + TableField = 'ShipName' + end + item + DatasetField = 'ShipAddress' + TableField = 'ShipAddress' + end + item + DatasetField = 'ShipCity' + TableField = 'ShipCity' + end + item + DatasetField = 'ShipRegion' + TableField = 'ShipRegion' + end + item + DatasetField = 'ShipPostalCode' + TableField = 'ShipPostalCode' + end + item + DatasetField = 'ShipCountry' + TableField = 'ShipCountry' + end> + end> + Name = 'Orders' + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = <> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 362 + Top = 177 + end + object XMLAdapter: TDAXmlDataStreamer + SchemaOptions = [soIncludeEmptyAttributes] + RowOptions = [] + Options = [xaoUseDatasetXSLTs, xaoUseDeltaXSLTs] + Left = 245 + Top = 176 + end + object dtCustomers: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CompanyName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactName' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ContactTitle' + DataType = datWideString + Size = 30 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Address' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'City' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Region' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Country' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Phone' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Fax' + DataType = datWideString + Size = 24 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = <> + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + LocalSchema = Schema + LocalDataStreamer = DAXmlDataStreamer + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Customers' + IndexDefs = <> + Left = 43 + Top = 115 + end + object dsCustomers: TDADataSource + DataSet = dtCustomers.Dataset + DataTable = dtCustomers + Left = 52 + Top = 128 + end + object dtOrders: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = < + item + Name = 'OrderID' + DataType = datAutoInc + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = True + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CustomerID' + DataType = datWideString + Size = 5 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EmployeeID' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'OrderDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RequiredDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShippedDate' + DataType = datDateTime + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipVia' + DataType = datInteger + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'Freight' + DataType = datFloat + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipName' + DataType = datWideString + Size = 40 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipAddress' + DataType = datWideString + Size = 60 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCity' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipRegion' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipPostalCode' + DataType = datWideString + Size = 10 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ShipCountry' + DataType = datWideString + Size = 15 + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + ServerCalculated = False + Lookup = False + LookupCache = False + end> + Params = < + item + Name = 'customerid' + DataType = datWideString + BlobType = dabtUnknown + DecimalPrecision = 0 + DecimalScale = 0 + Value = '' + ParamType = daptUnknown + end> + MasterParamsMappings.Strings = ( + 'customerid=CustomerID') + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + ReadOnly = False + LocalSchema = Schema + LocalDataStreamer = DAXmlDataStreamer + MasterSource = dsCustomers + MasterFields = 'CustomerID' + DetailFields = 'CustomerID' + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + LogicalName = 'Orders' + IndexDefs = <> + Left = 98 + Top = 115 + end + object dsOrders: TDADataSource + DataSet = dtOrders.Dataset + DataTable = dtOrders + Left = 106 + Top = 128 + end + object DAXmlDataStreamer: TDAXmlDataStreamer + SchemaOptions = [soIncludeEmptyAttributes] + RowOptions = [] + Options = [xaoUseDatasetXSLTs, xaoUseDeltaXSLTs] + Left = 76 + Top = 162 + end +end diff --git a/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLTMain.pas b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLTMain.pas new file mode 100644 index 0000000..ce4c8c4 --- /dev/null +++ b/internal/5.0.35.741/1/Data Abstract for Delphi/Samples/XSLT/XSLTMain.pas @@ -0,0 +1,187 @@ +unit XSLTMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, uDADataTable, uDAXMLAdapter, uDAClasses, + uDADriverManager, uDAEngine, uDAADODriver, Spin, Buttons, OleCtrls, + SHDocVw, ExtCtrls, ComCtrls, DB, uDAScriptingProvider, uDACDSDataTable, + Grids, DBGrids, uDABINAdapter, DBCtrls, uDADataStreamer, + uDARemoteDataAdapter, uDAInterfaces; + +type + TXSLTMainForm = class(TForm) + DriverManager: TDADriverManager; + ADODriver: TDAADODriver; + PageControl: TPageControl; + tsXML: TTabSheet; + tsGrid: TTabSheet; + WebBrowser: TWebBrowser; + gCustomers: TDBGrid; + ConnectionManager: TDAConnectionManager; + XMLAdapter: TDAXmlDataStreamer; + gOrders: TDBGrid; + Splitter2: TSplitter; + dtCustomers: TDACDSDataTable; + GetDataButton: TButton; + dsCustomers: TDADataSource; + dtOrders: TDACDSDataTable; + dsOrders: TDADataSource; + GenerateDeltaButton: TButton; + XSLTTransformationButton: TButton; + GenerateHTMLButton: TButton; + Schema: TDASchema; + DAXmlDataStreamer: TDAXmlDataStreamer; + procedure GetDataButtonClick(Sender: TObject); + procedure GenerateDeltaButtonClick(Sender: TObject); + procedure XSLTTransformationButtonClick(Sender: TObject); + private + fTempFileName, + fHTMLFileName, + fAppDir: string; + function CreateTestUpdates1: Boolean; + procedure RefreshXMLView(AfileName: string; aDelta: Boolean = False); + public + constructor Create(aOwner: TComponent); override; + property AppDir: string read fAppDir; + property TempFileName: string read fTempFileName; + property HTMLFileName: string read fHTMLFileName; + end; + +var + XSLTMainForm: TXSLTMainForm; + +implementation + +{$R *.dfm} + +uses + uROMSXMLImpl, uROMSXML2_TLB, uROXMLIntf, ShellAPI, uDADelta, StrUtils; + +constructor TXSLTMainForm.Create(aOwner: TComponent); +begin + inherited; + fAppDir := ExtractFilePath(Application.ExeName); + fTempFileName := fAppDir + 'Temp.xml'; + fHTMLFileName := fAppDir + 'CustomersHTML.html'; + PageControl.ActivePageIndex := 0; +end; + +procedure TXSLTMainForm.GetDataButtonClick(Sender: TObject); +begin + dtCustomers.Open; + dtOrders.Open; + if dtCustomers.DeltaInitialized then dtCustomers.CancelUpdates; + if dtOrders.DeltaInitialized then dtOrders.CancelUpdates; + XMLAdapter.WriteXSLT := nil; // In case there's one set + RefreshXMLView(TempFileName); +end; + +procedure TXSLTMainForm.RefreshXMLView(AfileName: string; aDelta: Boolean = False); +var + xmlstream: TMemoryStream; +begin + xmlstream := TMemoryStream.Create; + try + // Writes the data or Delta into the stream by using the XML Adapter + XMLAdapter.Initialize(xmlstream, aiWrite); + if aDelta then begin + XMLAdapter.WriteDelta(dtCustomers); + XMLAdapter.WriteDelta(dtOrders); + end + else begin + XMLAdapter.WriteDataset(dtCustomers, [woSchema, woRows]); + XMLAdapter.WriteDataset(dtOrders, [woSchema, woRows]); + end; + XMLAdapter.Finalize; + + // Saves the XML stream and displays it in the WebBrowser control + xmlstream.SaveToFile(aFileName); + WebBrowser.Navigate(aFileName); + finally + XMLStream.Free; + end; +end; + +procedure TXSLTMainForm.GenerateDeltaButtonClick(Sender: TObject); +begin + // Generates some test updates (ask confirmation first) + dtCustomers.Open; + dtOrders.Open; + if not CreateTestUpdates1 then Exit; + + // Erases the XSLT in case there's one set + XMLAdapter.WriteXSLT := nil; // In case there's one set + RefreshXMLView(TempFileName, True); +end; + +function TXSLTMainForm.CreateTestUpdates1: Boolean; +begin + Result := False; + if (MessageDlg('Do you want to create some updates?', mtConfirmation, [mbYes, mbNo], 0) <> mrYes) then Exit; + + dtCustomers.open; + dtOrders.open; + if dtCustomers.DeltaInitialized then dtCustomers.CancelUpdates; + if dtOrders.DeltaInitialized then dtOrders.CancelUpdates; + dtCustomers.Last; + + try + // Inserts a bunch of new ones + dtCustomers.AddRecord( + ['CustomerID', 'CompanyName', 'ContactName', 'ContactTitle', 'Address', 'City', 'Region', 'PostalCode', 'Country', 'Phone', 'Fax'], + ['JONSM', 'JohnSmith&Co', 'John Smith', 'Owner', '202 North Lake Drive', 'Barrington', 'IL', '60010', 'USA', '847 389 2112', '847 389 2115']); + + dtOrders.AddRecord( + ['OrderID', 'EmployeeID', 'OrderDate', 'RequiredDate', 'ShippedDate', 'ShipVia', 'Freight', 'ShipName', 'ShipAddress', 'ShipCity', 'ShipRegion', 'ShipPostalCode', 'ShipCountry'], + [60000, 5, Date, Date + 30, Date + 15, 1, 73.23, 'QUICK-Stop', 'Taucherstrabe 10', 'Rio de Janeiro', 'RJ', '50739', 'Brazil']); + + dtOrders.AddRecord( + ['OrderID', 'EmployeeID', 'OrderDate', 'RequiredDate', 'ShippedDate', 'ShipVia', 'Freight', 'ShipName', 'ShipAddress', 'ShipCity', 'ShipRegion', 'ShipPostalCode', 'ShipCountry'], + [60001, 2, Date + 15, Date + 30, Date + 25, 1, 22.45, 'LINO-Delicateses', '2743 Bering St.', 'Rio de Janeiro', 'RJ', '50700', 'Brazil']); + + dtCustomers.AddRecord( + ['CustomerID', 'CompanyName', 'ContactName', 'ContactTitle', 'Address', 'City', 'Region', 'PostalCode', 'Country', 'Phone', 'Fax'], + ['JACDO', 'JackDohrn Ltd', 'Jack Dohrn', 'Owner', '32 Manhattan Lane', 'Hoffman Estates', 'IL', '60074', 'USA', '847 221 3221', '842 221 3221']); + + dtOrders.AddRecord( + ['OrderID', 'EmployeeID', 'OrderDate', 'RequiredDate', 'ShippedDate', 'ShipVia', 'Freight', 'ShipName', 'ShipAddress', 'ShipCity', 'ShipRegion', 'ShipPostalCode', 'ShipCountry'], + [60002, 5, Date, Date + 20, Date + 10, 1, 45673.29, 'Save-a-lot Markets', 'Torikatu 38', 'Rio de Janeiro', 'RJ', '50759', 'Brazil']); + + dtOrders.AddRecord( + ['OrderID', 'EmployeeID', 'OrderDate', 'RequiredDate', 'ShippedDate', 'ShipVia', 'Freight', 'ShipName', 'ShipAddress', 'ShipCity', 'ShipRegion', 'ShipPostalCode', 'ShipCountry'], + [60003, 2, Date, Date + 10, Date + 2, 1, 722.23, 'Bottom-Dollar Markets', 'Fauntleroy Circus', 'Rio de Janeiro', 'RJ', '50730', 'Brazil']); + + Result := True; + except + Result := False; + if dtCustomers.Editing then dtCustomers.Cancel; + if dtOrders.Editing then dtOrders.Cancel; + end; +end; + +procedure TXSLTMainForm.XSLTTransformationButtonClick(Sender: TObject); +var + resfilename, xsltname: string; +begin + dtCustomers.open; + dtOrders.open; + + dtCustomers.First; + + // Loads the XSLT document + if (Sender = GenerateHTMLButton) then begin + xsltname := 'CustomersToHTML.xsl'; + resfilename := HTMLFileName; + end + else begin + xsltname := 'CustomersToSimpleXML.xsl'; + resfilename := TempFileName; + end; + XMLAdapter.WriteXSLT.LoadFromFile(xsltname); + RefreshXMLView(resfilename); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.Sample.html new file mode 100644 index 0000000..bcb1c5a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.Sample.html @@ -0,0 +1,25 @@ + + + + + + + + + +

+ Arrays Sample +

+ + +

Purpose

+

This sample shows how to use TROArray for presentating DB tables in a master/detail relationship.

+ +

Examine the Code

+

+ The GetTables method returns a struct containing two arrays. These arrays contain + data from the Customers and Orders tables and consist of structs matching the table + structures.

+ + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.bdsgroup new file mode 100644 index 0000000..f072d08 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + ArraysServer.bdsproj + ArraysClient.bdsproj + ArraysServer.exe ArraysClient.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.bpg new file mode 100644 index 0000000..d433fde --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = ArraysServer.exe ArraysClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +ArraysServer.exe: ArraysServer.dpr + $(DCC) + +ArraysClient.exe: ArraysClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.groupproj new file mode 100644 index 0000000..bbd9594 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/Arrays.groupproj @@ -0,0 +1,40 @@ + + + {e1bdacf8-8968-4f38-ad8d-e3172cdffd20} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.bdsproj new file mode 100644 index 0000000..d0de43f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ArraysClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.dpr new file mode 100644 index 0000000..b9661a6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.dpr @@ -0,0 +1,15 @@ +program ArraysClient; + +uses + uROComInit, + Forms, + ArraysClientMain in 'ArraysClientMain.pas' {ArraysClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Arrays Client'; + Application.CreateForm(TArraysClientMainForm, ArraysClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.dproj new file mode 100644 index 0000000..e2ff6a5 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.dproj @@ -0,0 +1,72 @@ + + + {1dfeec6a-3b4d-45fa-bc7e-294021928831} + ArraysClient.dpr + Debug + AnyCPU + DCC32 + ArraysClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ArraysClient.dpr + + + + + + + MainSource + + +
ArraysClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClientMain.dfm new file mode 100644 index 0000000..5557b07 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClientMain.dfm @@ -0,0 +1,91 @@ +object ArraysClientMainForm: TArraysClientMainForm + Left = 284 + Top = 179 + Caption = 'RemObjects Client' + ClientHeight = 326 + ClientWidth = 524 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Splitter1: TSplitter + Left = 0 + Top = 126 + Width = 524 + Height = 8 + Cursor = crVSplit + Align = alBottom + Beveled = True + end + object CustomersGrid: TStringGrid + Left = 0 + Top = 34 + Width = 524 + Height = 92 + Align = alClient + ColCount = 1 + DefaultRowHeight = 16 + FixedCols = 0 + RowCount = 1 + FixedRows = 0 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goDrawFocusSelected, goColSizing] + TabOrder = 0 + OnSelectCell = CustomersGridSelectCell + end + object OrdersGrid: TStringGrid + Left = 0 + Top = 134 + Width = 524 + Height = 192 + Align = alBottom + ColCount = 1 + DefaultRowHeight = 16 + FixedCols = 0 + RowCount = 1 + FixedRows = 0 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goDrawFocusSelected, goColSizing] + TabOrder = 1 + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 524 + Height = 34 + Align = alTop + BevelOuter = bvNone + TabOrder = 2 + object OpenButton: TButton + Left = 7 + Top = 5 + Width = 75 + Height = 25 + Caption = 'Open' + TabOrder = 0 + OnClick = OpenButtonClick + end + end + object ROMessage: TROBinMessage + Envelopes = <> + Left = 41 + Top = 79 + end + object ROChannel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 13 + Top = 79 + end + object RORemoteService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'ArraysService' + Left = 69 + Top = 79 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClientMain.pas new file mode 100644 index 0000000..214f731 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysClientMain.pas @@ -0,0 +1,188 @@ +unit ArraysClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROWinInetHttpChannel, + uROBinMessage, Grids, DBGrids, ComCtrls, ArraysLibrary_Intf, ExtCtrls; + +type + TArraysClientMainForm = class(TForm) + ROMessage: TROBinMessage; + ROChannel: TROWinInetHTTPChannel; + RORemoteService: TRORemoteService; + CustomersGrid: TStringGrid; + OrdersGrid: TStringGrid; + Splitter1: TSplitter; + OpenButton: TButton; + Panel1: TPanel; + procedure OpenButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure CustomersGridSelectCell(Sender: TObject; ACol, ARow: Integer; + var CanSelect: Boolean); + private + { Private declarations } + CustCol: CustomersCollection; + OrdCol: OrdersCollection; + FCustID: string; + procedure SetupGrid; + procedure SetupCustomers; + procedure SetupOrders(CustID: string); + procedure ClearGrid(Grid: TStringGrid); + public + { Public declarations } + end; + +var + ArraysClientMainForm: TArraysClientMainForm; + +implementation + +{$R *.dfm} + +procedure TArraysClientMainForm.OpenButtonClick(Sender: TObject); +var + tbl: Tables; +begin + tbl := (RORemoteService as IArraysService).GetTables; + try + CustCol.LoadFromArray(tbl.aCustomers); + OrdCol.LoadFromArray(tbl.aOrders); + finally + tbl.Free; + end; + SetupCustomers; + SetupOrders(CustomersGrid.Cells[0, 1]); +end; + +procedure TArraysClientMainForm.FormCreate(Sender: TObject); +begin + CustCol := CustomersCollection.Create; + OrdCol := OrdersCollection.Create; + SetupGrid; +end; + +procedure TArraysClientMainForm.FormDestroy(Sender: TObject); +begin + CustCol.Free; + OrdCol.Free; +end; + +procedure TArraysClientMainForm.SetupGrid; +begin + with CustomersGrid do begin + if RowCount < 2 then RowCount := 2; + ColCount:=11; + FixedRows := 1; + Cells[0, 0] := 'CustomerID'; + Cells[1, 0] := 'CompanyName'; + Cells[2, 0] := 'ContactName'; + Cells[3, 0] := 'ContactTitle'; + Cells[4, 0] := 'Address'; + Cells[5, 0] := 'City'; + Cells[6, 0] := 'Region'; + Cells[7, 0] := 'Postalcode'; + Cells[8, 0] := 'Country'; + Cells[9, 0] := 'Phone'; + Cells[10, 0] := 'Fax'; + end; + with OrdersGrid do begin + if RowCount < 2 then RowCount := 2; + ColCount:= 14; + FixedRows := 1; + Cells[0, 0] := 'OrderID'; + Cells[1, 0] := 'CustomerID'; + Cells[2, 0] := 'EmployeeID'; + Cells[3, 0] := 'OrderDate'; + Cells[4, 0] := 'RequiredDate'; + Cells[5, 0] := 'ShippedDate'; + Cells[6, 0] := 'ShipVia'; + Cells[7, 0] := 'Freight'; + Cells[8, 0] := 'ShipName'; + Cells[9, 0] := 'ShipAddress'; + Cells[10, 0] := 'ShipCity'; + Cells[11, 0] := 'ShipRegion'; + Cells[12, 0] := 'ShipPostalCode'; + Cells[13, 0] := 'ShipCountry'; + end; +end; + +procedure TArraysClientMainForm.SetupCustomers; +var + i: integer; + CustItem: Customers; +begin + ClearGrid(CustomersGrid); + with CustomersGrid do begin + RowCount := 1 + CustCol.Count; + for i := 0 to CustCol.Count - 1 do begin + CustItem := CustCol[i]; + Cells[0, i + 1] := CustItem.CustomerID; + Cells[1, i + 1] := CustItem.CompanyName; + Cells[2, i + 1] := CustItem.ContactName; + Cells[3, i + 1] := CustItem.ContactTitle; + Cells[4, i + 1] := CustItem.Address; + Cells[5, i + 1] := CustItem.City; + Cells[6, i + 1] := CustItem.Region; + Cells[7, i + 1] := CustItem.Postalcode; + Cells[8, i + 1] := CustItem.Country; + Cells[9, i + 1] := CustItem.Phone; + Cells[10, i + 1] := CustItem.Fax; + end; + end; +end; + +procedure TArraysClientMainForm.SetupOrders(CustID: string); +var + i: integer; + k: integer; + OrdersItem: Orders; +begin + if FCustID = CustID then Exit; + ClearGrid(OrdersGrid); + with OrdersGrid do begin + FCustID := CustID; + RowCount := 1 + OrdCol.Count; + k := 0; + for i := 0 to OrdCol.Count - 1 do begin + OrdersItem := OrdCol[i]; + if OrdersItem.CustomerID = CustID then begin + inc(k); + Cells[0, k] := IntToStr(OrdersItem.OrderID); + Cells[1, k] := OrdersItem.CustomerID; + Cells[2, k] := IntToStr(OrdersItem.EmployeeID); + Cells[3, k] := DateTimeToStr(OrdersItem.OrderDate); + Cells[4, k] := DateTimeToStr(OrdersItem.RequiredDate); + Cells[5, k] := DateTimeToStr(OrdersItem.ShippedDate); + Cells[6, k] := IntToStr(OrdersItem.ShipVia); + Cells[7, k] := CurrToStr(OrdersItem.Freight); + Cells[8, k] := OrdersItem.ShipName; + Cells[9, k] := OrdersItem.ShipAddress; + Cells[10, k] := OrdersItem.ShipCity; + Cells[11, k] := OrdersItem.ShipRegion; + Cells[12, k] := OrdersItem.ShipPostalCode; + Cells[13, k] := OrdersItem.ShipCountry; + end; + end; + if k > 0 then RowCount := k + 1 else ClearGrid(OrdersGrid); + end; +end; + +procedure TArraysClientMainForm.ClearGrid(Grid: TStringGrid); +begin + Grid.RowCount := 1; + Grid.RowCount := 2; + Grid.Rows[1].Clear; + Grid.FixedRows := 1; +end; + +procedure TArraysClientMainForm.CustomersGridSelectCell(Sender: TObject; ACol, + ARow: Integer; var CanSelect: Boolean); +begin + if ARow > 0 then SetupOrders(CustomersGrid.Cells[0, aRow]); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysLibrary.rodl new file mode 100644 index 0000000..cfd0a7c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysLibrary.rodl @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysLibrary_Intf.pas new file mode 100644 index 0000000..485d1d4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysLibrary_Intf.pas @@ -0,0 +1,1192 @@ +unit ArraysLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{7BFDF035-4BE8-4255-9337-E112A2F30DA0}'; + TargetNamespace = ''; + + { Service Interface ID's } + IArraysService_IID : TGUID = '{426D1A36-4EBF-4241-8E63-A26D303AA90E}'; + + { Event ID's } + +type + { Forward declarations } + IArraysService = interface; + + CustomersArray = class; + OrdersArray = class; + + Customers = class; + Orders = class; + Tables = class; + + + { Customers } + Customers = class(TROComplexType) + private + fCustomerID: WideString; + fCompanyName: WideString; + fContactName: WideString; + fContactTitle: WideString; + fAddress: WideString; + fCity: WideString; + fRegion: WideString; + fPostalcode: WideString; + fCountry: WideString; + fPhone: WideString; + fFax: WideString; + public + procedure Assign(iSource: TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + published + property CustomerID:WideString read fCustomerID write fCustomerID; + property CompanyName:WideString read fCompanyName write fCompanyName; + property ContactName:WideString read fContactName write fContactName; + property ContactTitle:WideString read fContactTitle write fContactTitle; + property Address:WideString read fAddress write fAddress; + property City:WideString read fCity write fCity; + property Region:WideString read fRegion write fRegion; + property Postalcode:WideString read fPostalcode write fPostalcode; + property Country:WideString read fCountry write fCountry; + property Phone:WideString read fPhone write fPhone; + property Fax:WideString read fFax write fFax; + end; + + { CustomersCollection } + CustomersCollection = class(TROCollection) + protected + constructor Create(aItemClass: TCollectionItemClass); overload; + function GetItems(aIndex: integer): Customers; + procedure SetItems(aIndex: integer; const Value: Customers); + public + constructor Create; overload; + function Add: Customers; reintroduce; + procedure SaveToArray(anArray: CustomersArray); + procedure LoadFromArray(anArray: CustomersArray); + property Items[Index: integer]:Customers read GetItems write SetItems; default; + end; + + { Orders } + Orders = class(TROComplexType) + private + fOrderID: Integer; + fCustomerID: WideString; + fEmployeeID: Integer; + fOrderDate: DateTime; + fRequiredDate: DateTime; + fShippedDate: DateTime; + fShipVia: Integer; + fFreight: Currency; + fShipName: WideString; + fShipAddress: WideString; + fShipCity: WideString; + fShipRegion: WideString; + fShipPostalCode: WideString; + fShipCountry: WideString; + public + procedure Assign(iSource: TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + published + property OrderID:Integer read fOrderID write fOrderID; + property CustomerID:WideString read fCustomerID write fCustomerID; + property EmployeeID:Integer read fEmployeeID write fEmployeeID; + property OrderDate:DateTime read fOrderDate write fOrderDate; + property RequiredDate:DateTime read fRequiredDate write fRequiredDate; + property ShippedDate:DateTime read fShippedDate write fShippedDate; + property ShipVia:Integer read fShipVia write fShipVia; + property Freight:Currency read fFreight write fFreight; + property ShipName:WideString read fShipName write fShipName; + property ShipAddress:WideString read fShipAddress write fShipAddress; + property ShipCity:WideString read fShipCity write fShipCity; + property ShipRegion:WideString read fShipRegion write fShipRegion; + property ShipPostalCode:WideString read fShipPostalCode write fShipPostalCode; + property ShipCountry:WideString read fShipCountry write fShipCountry; + end; + + { OrdersCollection } + OrdersCollection = class(TROCollection) + protected + constructor Create(aItemClass: TCollectionItemClass); overload; + function GetItems(aIndex: integer): Orders; + procedure SetItems(aIndex: integer; const Value: Orders); + public + constructor Create; overload; + function Add: Orders; reintroduce; + procedure SaveToArray(anArray: OrdersArray); + procedure LoadFromArray(anArray: OrdersArray); + property Items[Index: integer]:Orders read GetItems write SetItems; default; + end; + + { Tables } + Tables = class(TROComplexType) + private + faCustomers: CustomersArray; + faOrders: OrdersArray; + function GetaCustomers: CustomersArray; + function GetaOrders: OrdersArray; + public + procedure Assign(iSource: TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + published + property aCustomers:CustomersArray read GetaCustomers write faCustomers; + property aOrders:OrdersArray read GetaOrders write faOrders; + end; + + { TablesCollection } + TablesCollection = class(TROCollection) + protected + constructor Create(aItemClass: TCollectionItemClass); overload; + function GetItems(aIndex: integer): Tables; + procedure SetItems(aIndex: integer; const Value: Tables); + public + constructor Create; overload; + function Add: Tables; reintroduce; + property Items[Index: integer]:Tables read GetItems write SetItems; default; + end; + + { CustomersArray } + CustomersArray_Customers = array of Customers; + CustomersArray = class(TROArray) + private + fCount: Integer; + fItems : CustomersArray_Customers; + protected + procedure Grow; virtual; + function GetItems(aIndex: integer): Customers; + procedure SetItems(aIndex: integer; const Value: Customers); + function GetCount: integer; override; + public + class function GetItemType: PTypeInfo; override; + class function GetItemClass: TClass; override; + class function GetItemSize: integer; override; + + function GetItemRef(aIndex: integer): pointer; override; + procedure SetItemRef(aIndex: integer; Ref: pointer); override; + procedure Clear; override; + procedure Delete(aIndex: integer); override; + procedure Resize(ElementCount: integer); override; + + procedure Assign(iSource:TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + function Add: Customers; overload; + function Add(const Value: Customers):integer; overload; + + property Count : integer read GetCount; + property Items[Index: integer]:Customers read GetItems write SetItems; default; + property InnerArray: CustomersArray_Customers read fItems; + end; + + { OrdersArray } + OrdersArray_Orders = array of Orders; + OrdersArray = class(TROArray) + private + fCount: Integer; + fItems : OrdersArray_Orders; + protected + procedure Grow; virtual; + function GetItems(aIndex: integer): Orders; + procedure SetItems(aIndex: integer; const Value: Orders); + function GetCount: integer; override; + public + class function GetItemType: PTypeInfo; override; + class function GetItemClass: TClass; override; + class function GetItemSize: integer; override; + + function GetItemRef(aIndex: integer): pointer; override; + procedure SetItemRef(aIndex: integer; Ref: pointer); override; + procedure Clear; override; + procedure Delete(aIndex: integer); override; + procedure Resize(ElementCount: integer); override; + + procedure Assign(iSource:TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + function Add: Orders; overload; + function Add(const Value: Orders):integer; overload; + + property Count : integer read GetCount; + property Items[Index: integer]:Orders read GetItems write SetItems; default; + property InnerArray: OrdersArray_Orders read fItems; + end; + + { IArraysService } + IArraysService = interface + ['{426D1A36-4EBF-4241-8E63-A26D303AA90E}'] + function GetTables: Tables; + end; + + { CoArraysService } + CoArraysService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IArraysService; + end; + + { TArraysService_Proxy } + TArraysService_Proxy = class(TROProxy, IArraysService) + protected + function __GetInterfaceName:string; override; + + function GetTables: Tables; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CustomersArray } + +procedure CustomersArray.Assign(iSource: TPersistent); +var lSource:CustomersArray; + i:integer; +begin + if (iSource is CustomersArray) then begin + lSource := CustomersArray(iSource); + Clear(); + Resize(lSource.Count); + + for i := 0 to Count-1 do begin + if Assigned(lSource.Items[i]) then begin + Items[i].Assign(lSource.Items[i]); + end; + end; + end + else begin + inherited Assign(iSource); + end; +end; + +class function CustomersArray.GetItemType: PTypeInfo; +begin + result := TypeInfo(Customers); +end; + +class function CustomersArray.GetItemClass: TClass; +begin + result := Customers; +end; + +class function CustomersArray.GetItemSize: integer; +begin + result := SizeOf(Customers); +end; + +function CustomersArray.GetItems(aIndex: integer): Customers; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +function CustomersArray.GetItemRef(aIndex: integer): pointer; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +procedure CustomersArray.SetItemRef(aIndex: integer; Ref: pointer); +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + if Ref <> fItems[aIndex] then begin + if fItems[aIndex] <> nil then fItems[aIndex].Free; + fItems[aIndex] := Ref; + end; +end; + +procedure CustomersArray.Clear; +var i: integer; +begin + for i := 0 to (Count-1) do fItems[i].Free(); + SetLength(fItems, 0); + FCount := 0; +end; + +procedure CustomersArray.Delete(aIndex: integer); +var i: integer; +begin + if (aIndex>=Count) then RaiseError(err_InvalidIndex, [aIndex]); + + fItems[aIndex].Free(); + + if (aIndex= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + if fItems[aIndex] <> Value then begin + fItems[aIndex].Free; + fItems[aIndex] := Value; + end; +end; + +procedure CustomersArray.Resize(ElementCount: integer); +var i: Integer; +begin + if fCount = ElementCount then Exit; + for i := FCount -1 downto ElementCount do + FItems[i].Free; + SetLength(fItems, ElementCount); + for i := FCount to ElementCount -1 do + FItems[i] := Customers.Create; + FCount := ElementCount; +end; + +function CustomersArray.GetCount: integer; +begin + result := FCount; +end; + +procedure CustomersArray.Grow; +var + Delta, Capacity: Integer; +begin + Capacity := Length(fItems); + if Capacity > 64 then + Delta := Capacity div 4 + else + if Capacity > 8 then + Delta := 16 + else + Delta := 4; + SetLength(fItems, Capacity + Delta); +end; + +function CustomersArray.Add: Customers; +begin + result := Customers.Create; + Add(Result); +end; + +function CustomersArray.Add(const Value:Customers): integer; +begin + Result := Count; + if Length(fItems) = Result then + Grow; + fItems[result] := Value; + Inc(fCount); +end; + +procedure CustomersArray.ReadComplex(ASerializer: TObject); +var + lval: Customers; + i: integer; +begin + for i := 0 to Count-1 do begin + with TROSerializer(ASerializer) do + ReadStruct(GetArrayElementName(GetItemType, GetItemRef(i)), Customers, lval, i); + Items[i] := lval; + end; +end; + +procedure CustomersArray.WriteComplex(ASerializer: TObject); +var + i: integer; +begin + for i := 0 to Count-1 do + with TROSerializer(ASerializer) do + WriteStruct(GetArrayElementName(GetItemType, GetItemRef(i)), fItems[i], Customers, i); +end; + +{ OrdersArray } + +procedure OrdersArray.Assign(iSource: TPersistent); +var lSource:OrdersArray; + i:integer; +begin + if (iSource is OrdersArray) then begin + lSource := OrdersArray(iSource); + Clear(); + Resize(lSource.Count); + + for i := 0 to Count-1 do begin + if Assigned(lSource.Items[i]) then begin + Items[i].Assign(lSource.Items[i]); + end; + end; + end + else begin + inherited Assign(iSource); + end; +end; + +class function OrdersArray.GetItemType: PTypeInfo; +begin + result := TypeInfo(Orders); +end; + +class function OrdersArray.GetItemClass: TClass; +begin + result := Orders; +end; + +class function OrdersArray.GetItemSize: integer; +begin + result := SizeOf(Orders); +end; + +function OrdersArray.GetItems(aIndex: integer): Orders; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +function OrdersArray.GetItemRef(aIndex: integer): pointer; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +procedure OrdersArray.SetItemRef(aIndex: integer; Ref: pointer); +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + if Ref <> fItems[aIndex] then begin + if fItems[aIndex] <> nil then fItems[aIndex].Free; + fItems[aIndex] := Ref; + end; +end; + +procedure OrdersArray.Clear; +var i: integer; +begin + for i := 0 to (Count-1) do fItems[i].Free(); + SetLength(fItems, 0); + FCount := 0; +end; + +procedure OrdersArray.Delete(aIndex: integer); +var i: integer; +begin + if (aIndex>=Count) then RaiseError(err_InvalidIndex, [aIndex]); + + fItems[aIndex].Free(); + + if (aIndex= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + if fItems[aIndex] <> Value then begin + fItems[aIndex].Free; + fItems[aIndex] := Value; + end; +end; + +procedure OrdersArray.Resize(ElementCount: integer); +var i: Integer; +begin + if fCount = ElementCount then Exit; + for i := FCount -1 downto ElementCount do + FItems[i].Free; + SetLength(fItems, ElementCount); + for i := FCount to ElementCount -1 do + FItems[i] := Orders.Create; + FCount := ElementCount; +end; + +function OrdersArray.GetCount: integer; +begin + result := FCount; +end; + +procedure OrdersArray.Grow; +var + Delta, Capacity: Integer; +begin + Capacity := Length(fItems); + if Capacity > 64 then + Delta := Capacity div 4 + else + if Capacity > 8 then + Delta := 16 + else + Delta := 4; + SetLength(fItems, Capacity + Delta); +end; + +function OrdersArray.Add: Orders; +begin + result := Orders.Create; + Add(Result); +end; + +function OrdersArray.Add(const Value:Orders): integer; +begin + Result := Count; + if Length(fItems) = Result then + Grow; + fItems[result] := Value; + Inc(fCount); +end; + +procedure OrdersArray.ReadComplex(ASerializer: TObject); +var + lval: Orders; + i: integer; +begin + for i := 0 to Count-1 do begin + with TROSerializer(ASerializer) do + ReadStruct(GetArrayElementName(GetItemType, GetItemRef(i)), Orders, lval, i); + Items[i] := lval; + end; +end; + +procedure OrdersArray.WriteComplex(ASerializer: TObject); +var + i: integer; +begin + for i := 0 to Count-1 do + with TROSerializer(ASerializer) do + WriteStruct(GetArrayElementName(GetItemType, GetItemRef(i)), fItems[i], Orders, i); +end; + +{ Customers } + +procedure Customers.Assign(iSource: TPersistent); +var lSource: ArraysLibrary_Intf.Customers; +begin + inherited Assign(iSource); + if (iSource is ArraysLibrary_Intf.Customers) then begin + lSource := ArraysLibrary_Intf.Customers(iSource); + CustomerID := lSource.CustomerID; + CompanyName := lSource.CompanyName; + ContactName := lSource.ContactName; + ContactTitle := lSource.ContactTitle; + Address := lSource.Address; + City := lSource.City; + Region := lSource.Region; + Postalcode := lSource.Postalcode; + Country := lSource.Country; + Phone := lSource.Phone; + Fax := lSource.Fax; + end; +end; + +procedure Customers.ReadComplex(ASerializer: TObject); +var + l_Address: WideString; + l_City: WideString; + l_CompanyName: WideString; + l_ContactName: WideString; + l_ContactTitle: WideString; + l_Country: WideString; + l_CustomerID: WideString; + l_Fax: WideString; + l_Phone: WideString; + l_Postalcode: WideString; + l_Region: WideString; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + l_CustomerID := CustomerID; + TROSerializer(ASerializer).ReadWideString('CustomerID', l_CustomerID); + CustomerID := l_CustomerID; + l_CompanyName := CompanyName; + TROSerializer(ASerializer).ReadWideString('CompanyName', l_CompanyName); + CompanyName := l_CompanyName; + l_ContactName := ContactName; + TROSerializer(ASerializer).ReadWideString('ContactName', l_ContactName); + ContactName := l_ContactName; + l_ContactTitle := ContactTitle; + TROSerializer(ASerializer).ReadWideString('ContactTitle', l_ContactTitle); + ContactTitle := l_ContactTitle; + l_Address := Address; + TROSerializer(ASerializer).ReadWideString('Address', l_Address); + Address := l_Address; + l_City := City; + TROSerializer(ASerializer).ReadWideString('City', l_City); + City := l_City; + l_Region := Region; + TROSerializer(ASerializer).ReadWideString('Region', l_Region); + Region := l_Region; + l_Postalcode := Postalcode; + TROSerializer(ASerializer).ReadWideString('Postalcode', l_Postalcode); + Postalcode := l_Postalcode; + l_Country := Country; + TROSerializer(ASerializer).ReadWideString('Country', l_Country); + Country := l_Country; + l_Phone := Phone; + TROSerializer(ASerializer).ReadWideString('Phone', l_Phone); + Phone := l_Phone; + l_Fax := Fax; + TROSerializer(ASerializer).ReadWideString('Fax', l_Fax); + Fax := l_Fax; + end + else begin + l_Address := Address; + TROSerializer(ASerializer).ReadWideString('Address', l_Address); + Address := l_Address; + l_City := City; + TROSerializer(ASerializer).ReadWideString('City', l_City); + City := l_City; + l_CompanyName := CompanyName; + TROSerializer(ASerializer).ReadWideString('CompanyName', l_CompanyName); + CompanyName := l_CompanyName; + l_ContactName := ContactName; + TROSerializer(ASerializer).ReadWideString('ContactName', l_ContactName); + ContactName := l_ContactName; + l_ContactTitle := ContactTitle; + TROSerializer(ASerializer).ReadWideString('ContactTitle', l_ContactTitle); + ContactTitle := l_ContactTitle; + l_Country := Country; + TROSerializer(ASerializer).ReadWideString('Country', l_Country); + Country := l_Country; + l_CustomerID := CustomerID; + TROSerializer(ASerializer).ReadWideString('CustomerID', l_CustomerID); + CustomerID := l_CustomerID; + l_Fax := Fax; + TROSerializer(ASerializer).ReadWideString('Fax', l_Fax); + Fax := l_Fax; + l_Phone := Phone; + TROSerializer(ASerializer).ReadWideString('Phone', l_Phone); + Phone := l_Phone; + l_Postalcode := Postalcode; + TROSerializer(ASerializer).ReadWideString('Postalcode', l_Postalcode); + Postalcode := l_Postalcode; + l_Region := Region; + TROSerializer(ASerializer).ReadWideString('Region', l_Region); + Region := l_Region; + end; +end; + +procedure Customers.WriteComplex(ASerializer: TObject); +var + l_Address: WideString; + l_City: WideString; + l_CompanyName: WideString; + l_ContactName: WideString; + l_ContactTitle: WideString; + l_Country: WideString; + l_CustomerID: WideString; + l_Fax: WideString; + l_Phone: WideString; + l_Postalcode: WideString; + l_Region: WideString; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + TROSerializer(ASerializer).ChangeClass(Customers); + l_CustomerID := CustomerID; + TROSerializer(ASerializer).WriteWideString('CustomerID', l_CustomerID); + l_CompanyName := CompanyName; + TROSerializer(ASerializer).WriteWideString('CompanyName', l_CompanyName); + l_ContactName := ContactName; + TROSerializer(ASerializer).WriteWideString('ContactName', l_ContactName); + l_ContactTitle := ContactTitle; + TROSerializer(ASerializer).WriteWideString('ContactTitle', l_ContactTitle); + l_Address := Address; + TROSerializer(ASerializer).WriteWideString('Address', l_Address); + l_City := City; + TROSerializer(ASerializer).WriteWideString('City', l_City); + l_Region := Region; + TROSerializer(ASerializer).WriteWideString('Region', l_Region); + l_Postalcode := Postalcode; + TROSerializer(ASerializer).WriteWideString('Postalcode', l_Postalcode); + l_Country := Country; + TROSerializer(ASerializer).WriteWideString('Country', l_Country); + l_Phone := Phone; + TROSerializer(ASerializer).WriteWideString('Phone', l_Phone); + l_Fax := Fax; + TROSerializer(ASerializer).WriteWideString('Fax', l_Fax); + end + else begin + l_Address := Address; + TROSerializer(ASerializer).WriteWideString('Address', l_Address); + l_City := City; + TROSerializer(ASerializer).WriteWideString('City', l_City); + l_CompanyName := CompanyName; + TROSerializer(ASerializer).WriteWideString('CompanyName', l_CompanyName); + l_ContactName := ContactName; + TROSerializer(ASerializer).WriteWideString('ContactName', l_ContactName); + l_ContactTitle := ContactTitle; + TROSerializer(ASerializer).WriteWideString('ContactTitle', l_ContactTitle); + l_Country := Country; + TROSerializer(ASerializer).WriteWideString('Country', l_Country); + l_CustomerID := CustomerID; + TROSerializer(ASerializer).WriteWideString('CustomerID', l_CustomerID); + l_Fax := Fax; + TROSerializer(ASerializer).WriteWideString('Fax', l_Fax); + l_Phone := Phone; + TROSerializer(ASerializer).WriteWideString('Phone', l_Phone); + l_Postalcode := Postalcode; + TROSerializer(ASerializer).WriteWideString('Postalcode', l_Postalcode); + l_Region := Region; + TROSerializer(ASerializer).WriteWideString('Region', l_Region); + end; +end; + +{ CustomersCollection } +constructor CustomersCollection.Create; +begin + inherited Create(Customers); +end; + +constructor CustomersCollection.Create(aItemClass: TCollectionItemClass); +begin + inherited Create(aItemClass); +end; + +function CustomersCollection.Add: Customers; +begin + result := Customers(inherited Add); +end; + +function CustomersCollection.GetItems(aIndex: integer): Customers; +begin + result := Customers(inherited Items[aIndex]); +end; + +procedure CustomersCollection.LoadFromArray(anArray: CustomersArray); +var i : integer; +begin + Clear; + for i := 0 to (anArray.Count-1) do + Add.Assign(anArray[i]); +end; + +procedure CustomersCollection.SaveToArray(anArray: CustomersArray); +var i : integer; +begin + anArray.Clear; + anArray.Resize(Count); + for i := 0 to (Count-1) do begin + anArray[i] := Customers.Create; + anArray[i].Assign(Items[i]); + end; +end; + +procedure CustomersCollection.SetItems(aIndex: integer; const Value: Customers); +begin + Customers(inherited Items[aIndex]).Assign(Value); +end; + +{ Orders } + +procedure Orders.Assign(iSource: TPersistent); +var lSource: ArraysLibrary_Intf.Orders; +begin + inherited Assign(iSource); + if (iSource is ArraysLibrary_Intf.Orders) then begin + lSource := ArraysLibrary_Intf.Orders(iSource); + OrderID := lSource.OrderID; + CustomerID := lSource.CustomerID; + EmployeeID := lSource.EmployeeID; + OrderDate := lSource.OrderDate; + RequiredDate := lSource.RequiredDate; + ShippedDate := lSource.ShippedDate; + ShipVia := lSource.ShipVia; + Freight := lSource.Freight; + ShipName := lSource.ShipName; + ShipAddress := lSource.ShipAddress; + ShipCity := lSource.ShipCity; + ShipRegion := lSource.ShipRegion; + ShipPostalCode := lSource.ShipPostalCode; + ShipCountry := lSource.ShipCountry; + end; +end; + +procedure Orders.ReadComplex(ASerializer: TObject); +var + l_CustomerID: WideString; + l_EmployeeID: Integer; + l_Freight: Currency; + l_OrderDate: DateTime; + l_OrderID: Integer; + l_RequiredDate: DateTime; + l_ShipAddress: WideString; + l_ShipCity: WideString; + l_ShipCountry: WideString; + l_ShipName: WideString; + l_ShippedDate: DateTime; + l_ShipPostalCode: WideString; + l_ShipRegion: WideString; + l_ShipVia: Integer; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + l_OrderID := OrderID; + TROSerializer(ASerializer).ReadInteger('OrderID', otSLong, l_OrderID); + OrderID := l_OrderID; + l_CustomerID := CustomerID; + TROSerializer(ASerializer).ReadWideString('CustomerID', l_CustomerID); + CustomerID := l_CustomerID; + l_EmployeeID := EmployeeID; + TROSerializer(ASerializer).ReadInteger('EmployeeID', otSLong, l_EmployeeID); + EmployeeID := l_EmployeeID; + l_OrderDate := OrderDate; + TROSerializer(ASerializer).ReadDateTime('OrderDate', l_OrderDate); + OrderDate := l_OrderDate; + l_RequiredDate := RequiredDate; + TROSerializer(ASerializer).ReadDateTime('RequiredDate', l_RequiredDate); + RequiredDate := l_RequiredDate; + l_ShippedDate := ShippedDate; + TROSerializer(ASerializer).ReadDateTime('ShippedDate', l_ShippedDate); + ShippedDate := l_ShippedDate; + l_ShipVia := ShipVia; + TROSerializer(ASerializer).ReadInteger('ShipVia', otSLong, l_ShipVia); + ShipVia := l_ShipVia; + l_Freight := Freight; + TROSerializer(ASerializer).ReadDouble('Freight', ftCurr, l_Freight); + Freight := l_Freight; + l_ShipName := ShipName; + TROSerializer(ASerializer).ReadWideString('ShipName', l_ShipName); + ShipName := l_ShipName; + l_ShipAddress := ShipAddress; + TROSerializer(ASerializer).ReadWideString('ShipAddress', l_ShipAddress); + ShipAddress := l_ShipAddress; + l_ShipCity := ShipCity; + TROSerializer(ASerializer).ReadWideString('ShipCity', l_ShipCity); + ShipCity := l_ShipCity; + l_ShipRegion := ShipRegion; + TROSerializer(ASerializer).ReadWideString('ShipRegion', l_ShipRegion); + ShipRegion := l_ShipRegion; + l_ShipPostalCode := ShipPostalCode; + TROSerializer(ASerializer).ReadWideString('ShipPostalCode', l_ShipPostalCode); + ShipPostalCode := l_ShipPostalCode; + l_ShipCountry := ShipCountry; + TROSerializer(ASerializer).ReadWideString('ShipCountry', l_ShipCountry); + ShipCountry := l_ShipCountry; + end + else begin + l_CustomerID := CustomerID; + TROSerializer(ASerializer).ReadWideString('CustomerID', l_CustomerID); + CustomerID := l_CustomerID; + l_EmployeeID := EmployeeID; + TROSerializer(ASerializer).ReadInteger('EmployeeID', otSLong, l_EmployeeID); + EmployeeID := l_EmployeeID; + l_Freight := Freight; + TROSerializer(ASerializer).ReadDouble('Freight', ftCurr, l_Freight); + Freight := l_Freight; + l_OrderDate := OrderDate; + TROSerializer(ASerializer).ReadDateTime('OrderDate', l_OrderDate); + OrderDate := l_OrderDate; + l_OrderID := OrderID; + TROSerializer(ASerializer).ReadInteger('OrderID', otSLong, l_OrderID); + OrderID := l_OrderID; + l_RequiredDate := RequiredDate; + TROSerializer(ASerializer).ReadDateTime('RequiredDate', l_RequiredDate); + RequiredDate := l_RequiredDate; + l_ShipAddress := ShipAddress; + TROSerializer(ASerializer).ReadWideString('ShipAddress', l_ShipAddress); + ShipAddress := l_ShipAddress; + l_ShipCity := ShipCity; + TROSerializer(ASerializer).ReadWideString('ShipCity', l_ShipCity); + ShipCity := l_ShipCity; + l_ShipCountry := ShipCountry; + TROSerializer(ASerializer).ReadWideString('ShipCountry', l_ShipCountry); + ShipCountry := l_ShipCountry; + l_ShipName := ShipName; + TROSerializer(ASerializer).ReadWideString('ShipName', l_ShipName); + ShipName := l_ShipName; + l_ShippedDate := ShippedDate; + TROSerializer(ASerializer).ReadDateTime('ShippedDate', l_ShippedDate); + ShippedDate := l_ShippedDate; + l_ShipPostalCode := ShipPostalCode; + TROSerializer(ASerializer).ReadWideString('ShipPostalCode', l_ShipPostalCode); + ShipPostalCode := l_ShipPostalCode; + l_ShipRegion := ShipRegion; + TROSerializer(ASerializer).ReadWideString('ShipRegion', l_ShipRegion); + ShipRegion := l_ShipRegion; + l_ShipVia := ShipVia; + TROSerializer(ASerializer).ReadInteger('ShipVia', otSLong, l_ShipVia); + ShipVia := l_ShipVia; + end; +end; + +procedure Orders.WriteComplex(ASerializer: TObject); +var + l_CustomerID: WideString; + l_EmployeeID: Integer; + l_Freight: Currency; + l_OrderDate: DateTime; + l_OrderID: Integer; + l_RequiredDate: DateTime; + l_ShipAddress: WideString; + l_ShipCity: WideString; + l_ShipCountry: WideString; + l_ShipName: WideString; + l_ShippedDate: DateTime; + l_ShipPostalCode: WideString; + l_ShipRegion: WideString; + l_ShipVia: Integer; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + TROSerializer(ASerializer).ChangeClass(Orders); + l_OrderID := OrderID; + TROSerializer(ASerializer).WriteInteger('OrderID', otSLong, l_OrderID); + l_CustomerID := CustomerID; + TROSerializer(ASerializer).WriteWideString('CustomerID', l_CustomerID); + l_EmployeeID := EmployeeID; + TROSerializer(ASerializer).WriteInteger('EmployeeID', otSLong, l_EmployeeID); + l_OrderDate := OrderDate; + TROSerializer(ASerializer).WriteDateTime('OrderDate', l_OrderDate); + l_RequiredDate := RequiredDate; + TROSerializer(ASerializer).WriteDateTime('RequiredDate', l_RequiredDate); + l_ShippedDate := ShippedDate; + TROSerializer(ASerializer).WriteDateTime('ShippedDate', l_ShippedDate); + l_ShipVia := ShipVia; + TROSerializer(ASerializer).WriteInteger('ShipVia', otSLong, l_ShipVia); + l_Freight := Freight; + TROSerializer(ASerializer).WriteDouble('Freight', ftCurr, l_Freight); + l_ShipName := ShipName; + TROSerializer(ASerializer).WriteWideString('ShipName', l_ShipName); + l_ShipAddress := ShipAddress; + TROSerializer(ASerializer).WriteWideString('ShipAddress', l_ShipAddress); + l_ShipCity := ShipCity; + TROSerializer(ASerializer).WriteWideString('ShipCity', l_ShipCity); + l_ShipRegion := ShipRegion; + TROSerializer(ASerializer).WriteWideString('ShipRegion', l_ShipRegion); + l_ShipPostalCode := ShipPostalCode; + TROSerializer(ASerializer).WriteWideString('ShipPostalCode', l_ShipPostalCode); + l_ShipCountry := ShipCountry; + TROSerializer(ASerializer).WriteWideString('ShipCountry', l_ShipCountry); + end + else begin + l_CustomerID := CustomerID; + TROSerializer(ASerializer).WriteWideString('CustomerID', l_CustomerID); + l_EmployeeID := EmployeeID; + TROSerializer(ASerializer).WriteInteger('EmployeeID', otSLong, l_EmployeeID); + l_Freight := Freight; + TROSerializer(ASerializer).WriteDouble('Freight', ftCurr, l_Freight); + l_OrderDate := OrderDate; + TROSerializer(ASerializer).WriteDateTime('OrderDate', l_OrderDate); + l_OrderID := OrderID; + TROSerializer(ASerializer).WriteInteger('OrderID', otSLong, l_OrderID); + l_RequiredDate := RequiredDate; + TROSerializer(ASerializer).WriteDateTime('RequiredDate', l_RequiredDate); + l_ShipAddress := ShipAddress; + TROSerializer(ASerializer).WriteWideString('ShipAddress', l_ShipAddress); + l_ShipCity := ShipCity; + TROSerializer(ASerializer).WriteWideString('ShipCity', l_ShipCity); + l_ShipCountry := ShipCountry; + TROSerializer(ASerializer).WriteWideString('ShipCountry', l_ShipCountry); + l_ShipName := ShipName; + TROSerializer(ASerializer).WriteWideString('ShipName', l_ShipName); + l_ShippedDate := ShippedDate; + TROSerializer(ASerializer).WriteDateTime('ShippedDate', l_ShippedDate); + l_ShipPostalCode := ShipPostalCode; + TROSerializer(ASerializer).WriteWideString('ShipPostalCode', l_ShipPostalCode); + l_ShipRegion := ShipRegion; + TROSerializer(ASerializer).WriteWideString('ShipRegion', l_ShipRegion); + l_ShipVia := ShipVia; + TROSerializer(ASerializer).WriteInteger('ShipVia', otSLong, l_ShipVia); + end; +end; + +{ OrdersCollection } +constructor OrdersCollection.Create; +begin + inherited Create(Orders); +end; + +constructor OrdersCollection.Create(aItemClass: TCollectionItemClass); +begin + inherited Create(aItemClass); +end; + +function OrdersCollection.Add: Orders; +begin + result := Orders(inherited Add); +end; + +function OrdersCollection.GetItems(aIndex: integer): Orders; +begin + result := Orders(inherited Items[aIndex]); +end; + +procedure OrdersCollection.LoadFromArray(anArray: OrdersArray); +var i : integer; +begin + Clear; + for i := 0 to (anArray.Count-1) do + Add.Assign(anArray[i]); +end; + +procedure OrdersCollection.SaveToArray(anArray: OrdersArray); +var i : integer; +begin + anArray.Clear; + anArray.Resize(Count); + for i := 0 to (Count-1) do begin + anArray[i] := Orders.Create; + anArray[i].Assign(Items[i]); + end; +end; + +procedure OrdersCollection.SetItems(aIndex: integer; const Value: Orders); +begin + Orders(inherited Items[aIndex]).Assign(Value); +end; + +{ Tables } + +procedure Tables.Assign(iSource: TPersistent); +var lSource: ArraysLibrary_Intf.Tables; +begin + inherited Assign(iSource); + if (iSource is ArraysLibrary_Intf.Tables) then begin + lSource := ArraysLibrary_Intf.Tables(iSource); + aCustomers.Assign(lSource.aCustomers); + aOrders.Assign(lSource.aOrders); + end; +end; + +function Tables.GetaCustomers: CustomersArray; +begin + if (faCustomers = nil) then faCustomers := CustomersArray.Create(); + result := faCustomers; +end; + +function Tables.GetaOrders: OrdersArray; +begin + if (faOrders = nil) then faOrders := OrdersArray.Create(); + result := faOrders; +end; + +procedure Tables.ReadComplex(ASerializer: TObject); +var + l_aCustomers: CustomersArray; + l_aOrders: OrdersArray; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + l_aCustomers := aCustomers; + TROSerializer(ASerializer).ReadArray('aCustomers', CustomersArray, l_aCustomers); + if aCustomers <> l_aCustomers then aCustomers.Free; + aCustomers := l_aCustomers; + l_aOrders := aOrders; + TROSerializer(ASerializer).ReadArray('aOrders', OrdersArray, l_aOrders); + if aOrders <> l_aOrders then aOrders.Free; + aOrders := l_aOrders; + end + else begin + l_aCustomers := aCustomers; + TROSerializer(ASerializer).ReadArray('aCustomers', CustomersArray, l_aCustomers); + if aCustomers <> l_aCustomers then aCustomers.Free; + aCustomers := l_aCustomers; + l_aOrders := aOrders; + TROSerializer(ASerializer).ReadArray('aOrders', OrdersArray, l_aOrders); + if aOrders <> l_aOrders then aOrders.Free; + aOrders := l_aOrders; + end; +end; + +procedure Tables.WriteComplex(ASerializer: TObject); +var + l_aCustomers: CustomersArray; + l_aOrders: OrdersArray; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + TROSerializer(ASerializer).ChangeClass(Tables); + l_aCustomers := aCustomers; + TROSerializer(ASerializer).WriteArray('aCustomers', l_aCustomers, CustomersArray); + l_aOrders := aOrders; + TROSerializer(ASerializer).WriteArray('aOrders', l_aOrders, OrdersArray); + end + else begin + l_aCustomers := aCustomers; + TROSerializer(ASerializer).WriteArray('aCustomers', l_aCustomers, CustomersArray); + l_aOrders := aOrders; + TROSerializer(ASerializer).WriteArray('aOrders', l_aOrders, OrdersArray); + end; +end; + +{ TablesCollection } +constructor TablesCollection.Create; +begin + inherited Create(Tables); +end; + +constructor TablesCollection.Create(aItemClass: TCollectionItemClass); +begin + inherited Create(aItemClass); +end; + +function TablesCollection.Add: Tables; +begin + result := Tables(inherited Add); +end; + +function TablesCollection.GetItems(aIndex: integer): Tables; +begin + result := Tables(inherited Items[aIndex]); +end; + +procedure TablesCollection.SetItems(aIndex: integer; const Value: Tables); +begin + Tables(inherited Items[aIndex]).Assign(Value); +end; + +{ CoArraysService } + +class function CoArraysService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IArraysService; +begin + result := TArraysService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TArraysService_Proxy } + +function TArraysService_Proxy.__GetInterfaceName:string; +begin + result := 'ArraysService'; +end; + +function TArraysService_Proxy.GetTables: Tables; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'ArraysLibrary', __InterfaceName, 'GetTables'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(ArraysLibrary_Intf.Tables), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterROClass(Customers); + RegisterROClass(Orders); + RegisterROClass(Tables); + RegisterROClass(CustomersArray); + RegisterROClass(OrdersArray); + RegisterProxyClass(IArraysService_IID, TArraysService_Proxy); + + +finalization + UnregisterROClass(Customers); + UnregisterROClass(Orders); + UnregisterROClass(Tables); + UnregisterROClass(CustomersArray); + UnregisterROClass(OrdersArray); + UnregisterProxyClass(IArraysService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysLibrary_Invk.pas new file mode 100644 index 0000000..ac2d5c9 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysLibrary_Invk.pas @@ -0,0 +1,69 @@ +unit ArraysLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} ArraysLibrary_Intf; + +type + TArraysService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_GetTables(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TArraysService_Invoker } + +constructor TArraysService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TArraysService_Invoker.Invoke_GetTables(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetTables: Tables; } +var + lResult: ArraysLibrary_Intf.Tables; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + lResult := (__Instance as IArraysService).GetTables; + + __Message.InitializeResponseMessage(__Transport, 'ArraysLibrary', 'ArraysService', 'GetTablesResponse'); + __Message.Write('Result', TypeInfo(ArraysLibrary_Intf.Tables), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.bdsproj new file mode 100644 index 0000000..67735c1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ArraysServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.dpr new file mode 100644 index 0000000..4e84729 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.dpr @@ -0,0 +1,21 @@ +program ArraysServer; + +{#ROGEN:ArraysLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + ArraysServerMain in 'ArraysServerMain.pas' {ArraysServerMainForm}, + ArraysLibrary_Intf in 'ArraysLibrary_Intf.pas', + ArraysLibrary_Invk in 'ArraysLibrary_Invk.pas', + ArraysService_Impl in 'ArraysService_Impl.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'Arrays Server'; + Application.CreateForm(TArraysServerMainForm, ArraysServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.dproj new file mode 100644 index 0000000..dafc6c0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.dproj @@ -0,0 +1,75 @@ + + + {e808bbe4-3e46-43ec-9be9-ccc484c00237} + ArraysServer.dpr + Debug + AnyCPU + DCC32 + ArraysServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ArraysServer.dpr + + + + + + + MainSource + + + + +
ArraysServerMainForm
+
+ +
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.res new file mode 100644 index 0000000..95e15d9 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServerMain.dfm new file mode 100644 index 0000000..97749e0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServerMain.dfm @@ -0,0 +1,59 @@ +object ArraysServerMainForm: TArraysServerMainForm + Left = 69 + Top = 35 + AutoScroll = False + Caption = 'Arrays Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object ROMessage: TROBinMessage + Left = 36 + Top = 8 + end + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 8 + Top = 8 + end + object ADOConnection1: TADOConnection + ConnectionString = + 'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security In' + + 'fo=False;Initial Catalog=Northwind;Data Source=localhost' + LoginPrompt = False + Provider = 'SQLOLEDB.1' + Left = 64 + Top = 8 + end + object tblCustomers: TADOTable + Connection = ADOConnection1 + TableName = 'Customers' + Left = 92 + Top = 8 + end + object tblOrders: TADOTable + Connection = ADOConnection1 + TableName = 'Orders' + Left = 120 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServerMain.pas new file mode 100644 index 0000000..7ae6a01 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysServerMain.pas @@ -0,0 +1,38 @@ +unit ArraysServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROIndyTCPServer, uROIndyHTTPServer, uROBinMessage, DB, ADODB; + +type + TArraysServerMainForm = class(TForm) + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + ROMessage: TROBinMessage; + ROServer: TROIndyHTTPServer; + ADOConnection1: TADOConnection; + tblCustomers: TADOTable; + tblOrders: TADOTable; + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ArraysServerMainForm: TArraysServerMainForm; + +implementation + + +{$R *.dfm} + +procedure TArraysServerMainForm.FormCreate(Sender: TObject); +begin + ROServer.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysService_Impl.pas new file mode 100644 index 0000000..050f5df --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/ArraysService_Impl.pas @@ -0,0 +1,94 @@ +unit ArraysService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Generated:} ArraysLibrary_Intf; + +type + { TArraysService } + TArraysService = class(TRORemotable, IArraysService) + private + protected + { IArraysService methods } + function GetTables: Tables; + end; + +implementation + +uses + {Generated:} ArraysLibrary_Invk, ArraysServerMain; + +procedure Create_ArraysService(out anInstance: IUnknown); +begin + anInstance := TArraysService.Create; +end; + +{ ArraysService } + +function TArraysService.GetTables: Tables; +begin + Result := Tables.Create; + // Customers + ArraysServerMainForm.tblCustomers.Close; + ArraysServerMainForm.tblCustomers.Open; + ArraysServerMainForm.tblCustomers.First; + while not ArraysServerMainForm.tblCustomers.Eof do begin + with Result.aCustomers.Add do begin + CustomerID := ArraysServerMainForm.tblCustomers.FieldByName('CustomerID').AsString; + CompanyName := ArraysServerMainForm.tblCustomers.FieldByName('CompanyName').AsString; + ContactName := ArraysServerMainForm.tblCustomers.FieldByName('ContactName').AsString; + ContactTitle := ArraysServerMainForm.tblCustomers.FieldByName('ContactTitle').AsString; + Address := ArraysServerMainForm.tblCustomers.FieldByName('Address').AsString; + City := ArraysServerMainForm.tblCustomers.FieldByName('City').AsString; + Region := ArraysServerMainForm.tblCustomers.FieldByName('Region').AsString; + Postalcode := ArraysServerMainForm.tblCustomers.FieldByName('Postalcode').AsString; + Country := ArraysServerMainForm.tblCustomers.FieldByName('Country').AsString; + Phone := ArraysServerMainForm.tblCustomers.FieldByName('Phone').AsString; + Fax := ArraysServerMainForm.tblCustomers.FieldByName('Fax').AsString; + end; + ArraysServerMainForm.tblCustomers.Next; + end; + ArraysServerMainForm.tblCustomers.Close; + // orders + ArraysServerMainForm.tblOrders.Close; + ArraysServerMainForm.tblOrders.Open; + ArraysServerMainForm.tblOrders.First; + while not ArraysServerMainForm.tblOrders.Eof do begin + with Result.aOrders.Add do begin + OrderID := ArraysServerMainForm.tblOrders.FieldByName('OrderID').AsInteger; + CustomerID := ArraysServerMainForm.tblOrders.FieldByName('CustomerID').AsString; + EmployeeID := ArraysServerMainForm.tblOrders.FieldByName('EmployeeID').AsInteger; + OrderDate := ArraysServerMainForm.tblOrders.FieldByName('OrderDate').AsDateTime; + RequiredDate := ArraysServerMainForm.tblOrders.FieldByName('RequiredDate').AsDateTime; + ShippedDate := ArraysServerMainForm.tblOrders.FieldByName('ShippedDate').AsDateTime; + ShipVia := ArraysServerMainForm.tblOrders.FieldByName('ShipVia').AsInteger; + Freight := ArraysServerMainForm.tblOrders.FieldByName('Freight').AsCurrency; + ShipName := ArraysServerMainForm.tblOrders.FieldByName('ShipName').AsString; + ShipAddress := ArraysServerMainForm.tblOrders.FieldByName('ShipAddress').AsString; + ShipCity := ArraysServerMainForm.tblOrders.FieldByName('ShipCity').AsString; + ShipRegion := ArraysServerMainForm.tblOrders.FieldByName('ShipRegion').AsString; + ShipPostalCode := ArraysServerMainForm.tblOrders.FieldByName('ShipPostalCode').AsString; + ShipCountry := ArraysServerMainForm.tblOrders.FieldByName('ShipCountry').AsString; + end; + ArraysServerMainForm.tblOrders.Next; + end; + ArraysServerMainForm.tblOrders.Close; +end; + +initialization + TROClassFactory.Create('ArraysService', Create_ArraysService, TArraysService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/RODLFILE.res new file mode 100644 index 0000000..b99acfe Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Arrays/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.bdsproj new file mode 100644 index 0000000..69a9d3f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + AsyncClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.dpr new file mode 100644 index 0000000..1bd218c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.dpr @@ -0,0 +1,15 @@ +program AsyncClient; + +uses + Forms, + AsyncClientMain in 'AsyncClientMain.pas' {AsyncClientMainForm}, + async_EmailSettings in 'async_EmailSettings.pas' {async_EmailSettingsForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Async Client'; + Application.CreateForm(TAsyncClientMainForm, AsyncClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.dproj new file mode 100644 index 0000000..7c21b47 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.dproj @@ -0,0 +1,72 @@ + + + {8d3e5e25-35fa-4504-9b6f-2d5ac5d5b9f0} + AsyncClient.dpr + Debug + AnyCPU + DCC32 + AsyncClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + AsyncClient.dpr + + + + + + + MainSource + + +
AsyncClientMainForm
+
+
+ +
\ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.res new file mode 100644 index 0000000..0f940ed Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClientMain.dfm new file mode 100644 index 0000000..9a2f2e5 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClientMain.dfm @@ -0,0 +1,178 @@ +object AsyncClientMainForm: TAsyncClientMainForm + Left = 518 + Top = 137 + BorderStyle = bsDialog + Caption = 'Async Client' + ClientHeight = 326 + ClientWidth = 241 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 32 + Top = 11 + Width = 35 + Height = 13 + Caption = 'Value 1' + end + object Label2: TLabel + Left = 32 + Top = 35 + Width = 35 + Height = 13 + Caption = 'Value 2' + end + object Label3: TLabel + Left = 32 + Top = 59 + Width = 20 + Height = 13 + Caption = 'Sum' + end + object Label4: TLabel + Left = 32 + Top = 308 + Width = 35 + Height = 13 + Caption = 'Status:' + end + object lbl_Status: TLabel + Left = 72 + Top = 308 + Width = 3 + Height = 13 + end + object ed_Value1: TEdit + Left = 80 + Top = 8 + Width = 121 + Height = 21 + TabOrder = 0 + Text = '5' + end + object ed_Value2: TEdit + Left = 80 + Top = 32 + Width = 121 + Height = 21 + TabOrder = 1 + Text = '8' + end + object CalcLiveButton: TButton + Left = 32 + Top = 88 + Width = 169 + Height = 22 + Caption = 'Calc Live (This will take 10 secs!)' + TabOrder = 2 + OnClick = CalcLiveButtonClick + end + object CalcAsyncHttpButton: TButton + Left = 32 + Top = 128 + Width = 169 + Height = 22 + Caption = 'Calc Async (Http)' + TabOrder = 3 + OnClick = CalcAsyncHttpButtonClick + end + object GetResultButton: TButton + Left = 32 + Top = 271 + Width = 169 + Height = 22 + Caption = 'Retrieve Result' + Enabled = False + TabOrder = 4 + OnClick = GetResultButtonClick + end + object ed_Result: TEdit + Left = 80 + Top = 56 + Width = 121 + Height = 21 + ParentColor = True + ReadOnly = True + TabOrder = 5 + end + object CheckForAnswerBytton: TButton + Left = 32 + Top = 248 + Width = 169 + Height = 22 + Caption = 'Check if Answer is Available' + Enabled = False + TabOrder = 6 + OnClick = CheckForAnswerByttonClick + end + object CalcAsyncUdpButton: TButton + Left = 32 + Top = 150 + Width = 169 + Height = 22 + Caption = 'Calc Async (UDP)' + TabOrder = 7 + OnClick = CalcAsyncUdpButtonClick + end + object btn_CalcAsyncEmail: TButton + Left = 32 + Top = 172 + Width = 169 + Height = 22 + Caption = 'Calc Async (Email)' + TabOrder = 8 + OnClick = btn_CalcAsyncEmailClick + end + object bSetupEmailSettings: TButton + Left = 32 + Top = 197 + Width = 169 + Height = 22 + Caption = 'Setup of email settings...' + TabOrder = 9 + OnClick = bSetupEmailSettingsClick + end + object ROBINMessage1: TROBinMessage + Top = 296 + end + object ROWinInetHTTPChannel1: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/bin' + ServerLocators = <> + DispatchOptions = [] + Left = 32 + Top = 296 + end + object ROIndyUDPChannel1: TROIndyUDPChannel + AsyncTimeOut = 50000 + Retrys = 5 + IndyClient.Port = 8098 + Port = 8098 + ServerLocators = <> + DispatchOptions = [] + Left = 64 + Top = 296 + end + object ROEmailChannel: TROEmailChannel + Pop3ServerAddress = 'mail.elitedev.com' + SmtpServerAddress = 'mail.elitedev.com' + ServerEmail = 'testserver@remobjects.com' + ClientEmail = 'testclient@remobjects.com' + SmtpClient.Host = 'mail.elitedev.com' + Pop3Client.Host = 'mail.elitedev.com' + Pop3Client.Password = 'testclient' + Pop3Password = 'testclient' + ServerLocators = <> + DispatchOptions = [] + Left = 93 + Top = 295 + end + object ROPostMessage: TROPostMessage + Left = 122 + Top = 297 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClientMain.pas new file mode 100644 index 0000000..9304efb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncClientMain.pas @@ -0,0 +1,246 @@ +unit AsyncClientMain; + +interface +{$I RemObjects.inc} +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, uROWinInetHttpChannel, + uROClient, uROBINMessage, + AsyncLibrary_Async, ExtCtrls, uROIndyUDPChannel, uROPostMessage, + uROIndyEmailChannel; + +type + TAsyncClientMainForm = class(TForm) + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + lbl_Status: TLabel; + ed_Value1: TEdit; + ed_Value2: TEdit; + CalcLiveButton: TButton; + CalcAsyncHttpButton: TButton; + GetResultButton: TButton; + ed_Result: TEdit; + CheckForAnswerBytton: TButton; + CalcAsyncUdpButton: TButton; + ROBINMessage1: TROBinMessage; + ROWinInetHTTPChannel1: TROWinInetHTTPChannel; + ROIndyUDPChannel1: TROIndyUDPChannel; + btn_CalcAsyncEmail: TButton; + bSetupEmailSettings: TButton; + ROEmailChannel: TROEmailChannel; + ROPostMessage: TROPostMessage; + procedure CalcLiveButtonClick(Sender: TObject); + procedure CalcAsyncHttpButtonClick(Sender: TObject); + procedure GetResultButtonClick(Sender: TObject); + procedure CheckForAnswerByttonClick(Sender: TObject); + procedure CalcAsyncUdpButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure btn_CalcAsyncEmailClick(Sender: TObject); + procedure bSetupEmailSettingsClick(Sender: TObject); + protected + fAsyncService: IAsyncService_Async; + procedure AdjustButtons; + procedure SetupEmailClient; + public + { Public declarations } + end; + +var + AsyncClientMainForm: TAsyncClientMainForm; + +implementation +uses + AsyncLibrary_Intf, IdStack, async_Emailsettings, IdSMTP; + + +{$R *.dfm} + +procedure TAsyncClientMainForm.CalcLiveButtonClick(Sender: TObject); +begin + Screen.Cursor := crHourGlass; + try + with CoAsyncService.Create(ROBINMessage1, ROWinInetHTTPChannel1) do begin + ed_Result.Text := ''; + ed_Result.Repaint(); + ed_Result.Text := IntToStr(Sum(StrToInt(ed_Value1.Text), StrToInt(ed_Value2.Text))); + end; { with } + finally + Screen.Cursor := crDefault; + end; { try/finally } +end; + +procedure TAsyncClientMainForm.CalcAsyncHttpButtonClick(Sender: TObject); +begin + Screen.Cursor := crHourGlass; + try + + if not Assigned(fAsyncService) then + fAsyncService := CoAsyncService_Async.Create(ROBINMessage1, ROWinInetHTTPChannel1); + + ed_Result.Text := ''; + ed_Result.Repaint(); + + fAsyncService.Invoke_Sum(StrToInt(ed_Value1.Text), StrToInt(ed_Value2.Text)); + AdjustButtons(); + + finally + Screen.Cursor := crDefault; + end; + + ShowMessage('The request has been sent to the Server.'#13'Click "Retrieve Result" to check if an answer has been received yet.'); +end; + +procedure TAsyncClientMainForm.CalcAsyncUdpButtonClick(Sender: TObject); +begin + Screen.Cursor := crHourGlass; + try + + if not Assigned(fAsyncService) then + fAsyncService := CoAsyncService_Async.Create(ROBINMessage1, ROIndyUDPChannel1); + + ed_Result.Text := ''; + ed_Result.Repaint(); + + fAsyncService.Invoke_Sum(StrToInt(ed_Value1.Text), StrToInt(ed_Value2.Text)); + AdjustButtons(); + + finally + Screen.Cursor := crDefault; + end; + + ShowMessage('The request has been sent to the Server.'#13'Click "Retrieve Result" to check if an answer has been received yet.'); +end; + +procedure TAsyncClientMainForm.GetResultButtonClick(Sender: TObject); +begin + if not Assigned(fAsyncService) then exit; + + Screen.Cursor := crHourGlass; + try + + if fAsyncService.AnswerReceived then begin + ed_Result.Text := IntToStr(fAsyncService.Retrieve_Sum()); + fAsyncService := nil; + lbl_Status.Caption := 'Idle'; + end + else begin + ShowMessage('Sorry, no answer yet.'); + end; + AdjustButtons(); + + finally + Screen.Cursor := crDefault; + end; +end; + +procedure TAsyncClientMainForm.CheckForAnswerByttonClick(Sender: TObject); +begin + Screen.Cursor := crHourGlass; + try + + if Assigned(fAsyncService) then begin + if fAsyncService.AnswerReceived then begin + lbl_Status.Caption := 'Answer Received'; + ShowMessage('Answer received!'); + end + else if fAsyncService.Busy then begin + lbl_Status.Caption := 'Busy'; + ShowMessage('Sorry, no answer yet.'); + end + else begin + lbl_Status.Caption := 'Idle'; + ShowMessage('Sorry, no answer yet.'); + end; + end; + + finally + Screen.Cursor := crDefault; + end; +end; + +procedure TAsyncClientMainForm.AdjustButtons; +begin + CalcAsyncHttpButton.Enabled := not Assigned(fAsyncService); + CalcAsyncUdpButton.Enabled := not Assigned(fAsyncService); + GetResultButton.Enabled := Assigned(fAsyncService); + CheckForAnswerBytton.Enabled := Assigned(fAsyncService); + btn_CalcAsyncEmail.Enabled := not Assigned(fAsyncService); +end; + +procedure TAsyncClientMainForm.SetupEmailClient; +begin + ROEmailChannel.ServerEmail := ServerEmail; + ROEmailChannel.ClientEmail := ClientEmail; + {$IFDEF RemObjects_INDY8} + ROEmailChannel.Pop3Client.UserId := POP3UserName; + ROEmailChannel.SmtpClient.UserId := SMTPUserName; + {$ELSE} + ROEmailChannel.Pop3Client.Username := POP3UserName; + ROEmailChannel.SmtpClient.Username := SMTPUserName; + {$ENDIF} + {$IFDEF RemObjects_INDY10C} + if SMTPUserName <> '' then + ROEmailChannel.SmtpClient.AuthType := satDefault + else + ROEmailChannel.SmtpClient.AuthType := satNone; + {$ELSE} + {$IFDEF RemObjects_INDY10} + if SMTPUserName <> '' then + ROEmailChannel.SmtpClient.AuthType := atDefault + else + ROEmailChannel.SmtpClient.AuthType := atNone; + {$ELSE} + if SMTPUserName <> '' then + ROEmailChannel.SmtpClient.AuthenticationType := atLogin + else + ROEmailChannel.SmtpClient.AuthenticationType := atNone; + {$ENDIF} + {$ENDIF} + ROEmailChannel.Pop3Client.Password := Pop3Password; + ROEmailChannel.Pop3Client.Host := POP3host; + ROEmailChannel.Pop3Client.Port := POP3Port; + ROEmailChannel.SmtpClient.Password := SMTPPassword; + ROEmailChannel.SmtpClient.Host := SMTPhost; + ROEmailChannel.SmtpClient.Port := SMTPPort; +end; + +procedure TAsyncClientMainForm.FormCreate(Sender: TObject); +begin + async_Emailsettings.LoadEmailSettings; +end; + +procedure TAsyncClientMainForm.bSetupEmailSettingsClick(Sender: TObject); +begin + async_Emailsettings.SetupEmailSettings(True); + SetupEmailClient; +end; + +procedure TAsyncClientMainForm.btn_CalcAsyncEmailClick(Sender: TObject); +begin + if SMTPhost = 'smtphost' then async_Emailsettings.SetupEmailSettings(True); + SetupEmailClient; + + Screen.Cursor := crHourGlass; + try + + if not Assigned(fAsyncService) then + fAsyncService := CoAsyncService_Async.Create(ROPostMessage, ROEmailChannel); + + ed_Result.Text := ''; + ed_Result.Repaint(); + + fAsyncService.Invoke_Sum(StrToInt(ed_Value1.Text), StrToInt(ed_Value2.Text)); + lbl_Status.Caption := 'Busy'; + AdjustButtons(); + + finally + Screen.Cursor := crDefault; + end; + + ShowMessage('The request has been sent to the Server.'#13'Click "Retrieve Result" to check if an answer has been received yet.'); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.Sample.html new file mode 100644 index 0000000..70d7b54 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.Sample.html @@ -0,0 +1,31 @@ + + + + + + + + + +

+ Async Sample +

+ + +

Purpose

+

This sample shows how to call methods on a RemObjects SDK server asynchronously. There may be times where you want to submit a request for information and defer receiving the result until a bit later.

+ +

+ A very simple calculation (Sum) is performed, but this has a built in ten second delay so that it is possible to query the server before the calculation is completed.
+

+ +

Getting Started

+
    +
  • Compile and launch the server.
  • +
  • Compile and run the client.
  • +
  • Click on the Calc Live button to verify that the connection works.
  • +
  • Try one or both of the Calc Async buttons and then try checking and/or receiving the result before and after ten seconds have passed.
  • + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.bdsgroup new file mode 100644 index 0000000..f6ce983 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + AsyncServer.bdsproj + AsyncClient.bdsproj + AsyncServer.exe AsyncClient.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.bpg new file mode 100644 index 0000000..0dabf49 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = AsyncServer.exe AsyncClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +AsyncServer.exe: AsyncServer.dpr + $(DCC) + +AsyncClient.exe: AsyncClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.groupproj new file mode 100644 index 0000000..38cad47 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncGroup.groupproj @@ -0,0 +1,40 @@ + + + {cdfc88bc-0e18-4996-9f16-38b101e7bef5} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary.rodl new file mode 100644 index 0000000..de2a7b6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary.rodl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Async.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Async.pas new file mode 100644 index 0000000..6b03b78 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Async.pas @@ -0,0 +1,91 @@ +unit AsyncLibrary_Async; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROTypes, uROClientIntf, uROAsync, + {Project:} AsyncLibrary_Intf; + +type + IAsyncService_Async = interface; + CoAsyncService_Async = class; + TAsyncService_AsyncProxy = class; + { IAsyncService_Async } + IAsyncService_Async = interface(IROAsyncInterface) + ['{C9A9233F-C987-4EA6-A9AC-21B98FC33212}'] + procedure Invoke_Sum(const A: Integer; const B: Integer); + function Retrieve_Sum: Integer; + end; + + { CoAsyncService_Async } + CoAsyncService_Async = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IAsyncService_Async; + end; + + { TAsyncService_AsyncProxy } + TAsyncService_AsyncProxy = class(TROAsyncProxy, IAsyncService_Async) + private + protected + function __GetInterfaceName:string; override; + + procedure Invoke_Sum(const A: Integer; const B: Integer); + function Retrieve_Sum: Integer; + end; + +implementation + +uses + {vcl:} SysUtils; + +{ CoAsyncService } + +class function CoAsyncService_Async.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IAsyncService_Async; +begin + result := TAsyncService_AsyncProxy.Create(aMessage, aTransportChannel); +end; + +{ TAsyncService_AsyncProxy } + +function TAsyncService_AsyncProxy.__GetInterfaceName:string; +begin + result := 'AsyncService'; +end; + +procedure TAsyncService_AsyncProxy.Invoke_Sum(const A: Integer; const B: Integer); +var __request:TStream; +begin + __AssertProxyNotBusy('Sum'); + __request := TMemoryStream.Create; + + __Message.InitializeRequestMessage(__TransportChannel, 'AsyncLibrary', __InterfaceName, 'Sum'); + __Message.Write('A', TypeInfo(Integer), A, []); + __Message.Write('B', TypeInfo(Integer), B, []); + __Message.Finalize; + + __Message.WriteToStream(__request); + __DispatchAsyncRequest('Sum',__request); +end; + +function TAsyncService_AsyncProxy.Retrieve_Sum: Integer; +var __response:TStream; +begin + __response := __RetrieveAsyncResponse('Sum'); + __Message.ReadFromStream(__response); + + __Message.Read('Result', TypeInfo(Integer), Result, []); + + __response.Free(); +end; + + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Intf.pas new file mode 100644 index 0000000..4b451b1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Intf.pas @@ -0,0 +1,97 @@ +unit AsyncLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{D34B1991-1F3D-47A0-9984-50FE83013C35}'; + TargetNamespace = ''; + + { Service Interface ID's } + IAsyncService_IID : TGUID = '{D34B1991-1F3D-47A0-9984-50FE83013C35}'; + + { Event ID's } + +type + { Forward declarations } + IAsyncService = interface; + + + { IAsyncService } + IAsyncService = interface + ['{D34B1991-1F3D-47A0-9984-50FE83013C35}'] + function Sum(const A: Integer; const B: Integer): Integer; + end; + + { CoAsyncService } + CoAsyncService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IAsyncService; + end; + + { TAsyncService_Proxy } + TAsyncService_Proxy = class(TROProxy, IAsyncService) + protected + function __GetInterfaceName:string; override; + + function Sum(const A: Integer; const B: Integer): Integer; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoAsyncService } + +class function CoAsyncService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IAsyncService; +begin + result := TAsyncService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TAsyncService_Proxy } + +function TAsyncService_Proxy.__GetInterfaceName:string; +begin + result := 'AsyncService'; +end; + +function TAsyncService_Proxy.Sum(const A: Integer; const B: Integer): Integer; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'AsyncLibrary', __InterfaceName, 'Sum'); + __Message.Write('A', TypeInfo(Integer), A, []); + __Message.Write('B', TypeInfo(Integer), B, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Integer), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IAsyncService_IID, TAsyncService_Proxy); + + +finalization + UnregisterProxyClass(IAsyncService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Invk.pas new file mode 100644 index 0000000..bdf2aff --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncLibrary_Invk.pas @@ -0,0 +1,66 @@ +unit AsyncLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} AsyncLibrary_Intf; + +type + TAsyncService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TAsyncService_Invoker } + +constructor TAsyncService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TAsyncService_Invoker.Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Sum(const A: Integer; const B: Integer): Integer; } +var + A: Integer; + B: Integer; + lResult: Integer; +begin + try + __Message.Read('A', TypeInfo(Integer), A, []); + __Message.Read('B', TypeInfo(Integer), B, []); + + lResult := (__Instance as IAsyncService).Sum(A, B); + + __Message.InitializeResponseMessage(__Transport, 'AsyncLibrary', 'AsyncService', 'SumResponse'); + __Message.Write('Result', TypeInfo(Integer), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.bdsproj new file mode 100644 index 0000000..8dd85e0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + AsyncServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.dpr new file mode 100644 index 0000000..28fd934 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.dpr @@ -0,0 +1,21 @@ +program AsyncServer; + +{#ROGEN:AsyncLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + Forms, + AsyncServerMain in 'AsyncServerMain.pas' {AsyncServerMainForm}, + AsyncLibrary_Intf in 'AsyncLibrary_Intf.pas', + AsyncLibrary_Invk in 'AsyncLibrary_Invk.pas', + AsyncService_Impl in 'AsyncService_Impl.pas', + async_EmailSettings in 'async_EmailSettings.pas' {async_EmailSettingsForm}; + +{$R *.RES} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'Async Server'; + Application.CreateForm(TAsyncServerMainForm, AsyncServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.dproj new file mode 100644 index 0000000..e9f8250 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.dproj @@ -0,0 +1,75 @@ + + + {e99efd90-17b4-4f10-86db-c8fd2896599d} + AsyncServer.dpr + Debug + AnyCPU + DCC32 + AsyncServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + AsyncServer.dpr + + + + + + + MainSource + + + + +
    AsyncServerMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.res new file mode 100644 index 0000000..53aa370 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServerMain.dfm new file mode 100644 index 0000000..35eb1aa --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServerMain.dfm @@ -0,0 +1,84 @@ +object AsyncServerMainForm: TAsyncServerMainForm + Left = 644 + Top = 151 + BorderStyle = bsDialog + Caption = 'Async Server' + ClientHeight = 98 + ClientWidth = 227 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object bSetupEmailSettings: TButton + Left = 13 + Top = 69 + Width = 206 + Height = 25 + Caption = 'Setup of email settings...' + TabOrder = 0 + OnClick = bSetupEmailSettingsClick + end + object ROMessage: TROBinMessage + Left = 40 + Top = 8 + end + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'BIN' + end> + Port = 8099 + Left = 8 + Top = 8 + end + object ROIndyUDPServer1: TROIndyUDPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + end> + IndyUDPServer.Bindings = <> + IndyUDPServer.DefaultPort = 8098 + Port = 8098 + Left = 72 + Top = 8 + end + object ROEmailServer: TROEmailServer + Dispatchers = < + item + Name = 'PostMessage' + Message = PostMessage + Enabled = True + end> + Pop3ServerAddress = 'mail.remobjects.com' + SmtpServerAddress = 'mail.remobjects.com' + ServerEmail = 'testserver@remobjects.com' + SmtpClient.Host = 'mail.remobjects.com' + SmtpClient.Password = 'testserver' + Pop3Client.Host = 'mail.remobjects.com' + Pop3Client.Password = 'testserver' + Pop3Password = 'testserver' + OnException = ROEmailServerException + Left = 104 + Top = 8 + end + object PostMessage: TROPostMessage + Left = 135 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServerMain.pas new file mode 100644 index 0000000..3802dcd --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncServerMain.pas @@ -0,0 +1,108 @@ +unit AsyncServerMain; + +interface +{$I RemObjects.inc} +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, uROClient, uROBINMessage, uROClientIntf, uROServer, + uROPoweredByRemObjectsButton, + uROIndyUDPServer, uROPostMessage, uROIndyEmailServer, uROIndyTCPServer, + uROIndyHTTPServer; + +type + TAsyncServerMainForm = class(TForm) + ROMessage: TROBINMessage; + ROServer: TROIndyHTTPServer; + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + ROIndyUDPServer1: TROIndyUDPServer; + bSetupEmailSettings: TButton; + ROEmailServer: TROEmailServer; + PostMessage: TROPostMessage; + procedure FormCreate(Sender: TObject); + procedure bSetupEmailSettingsClick(Sender: TObject); + procedure ROEmailServerException(aSender: TObject; + aExceptionClass: TClass; const aExceptionMessage: String); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + private + procedure SetupEmailServer; + end; + +var + AsyncServerMainForm: TAsyncServerMainForm; + +implementation + +uses + async_EmailSettings, IdSMTP, + IdStack; + +{$R *.DFM} + +procedure TAsyncServerMainForm.FormCreate(Sender: TObject); +begin + async_EmailSettings.LoadEmailSettings; + if POP3host = 'pop3host' then async_EmailSettings.SetupEmailSettings(False); + SetupEmailServer; + ROServer.Active := True; + ROIndyUDPServer1.Active := True; + ROEmailServer.Active:=True; +end; + +procedure TAsyncServerMainForm.bSetupEmailSettingsClick(Sender: TObject); +begin + async_EmailSettings.SetupEmailSettings(False); + SetupEmailServer; +end; + +procedure TAsyncServerMainForm.ROEmailServerException(aSender: TObject; + aExceptionClass: TClass; const aExceptionMessage: String); +begin + ShowMessage('There was a problem in the Email Server Thread:'#13#13 + aExceptionClass.ClassName + ': ' + aExceptionMessage); +end; + +procedure TAsyncServerMainForm.SetupEmailServer; +begin + ROEmailServer.Active := False; + ROEmailServer.ServerEmail := ServerEmail; + {$IFDEF RemObjects_INDY8} + ROEmailServer.Pop3Client.UserId := POP3UserName; + ROEmailServer.SmtpClient.UserId := SMTPUserName; + {$ELSE} + ROEmailServer.Pop3Client.Username := POP3UserName; + ROEmailServer.SmtpClient.Username := SMTPUserName; + {$ENDIF} + ROEmailServer.Pop3Client.Password := Pop3Password; + ROEmailServer.Pop3Client.Host := POP3host; + ROEmailServer.Pop3Client.Port := POP3Port; + ROEmailServer.SmtpClient.Password := SMTPPassword; + ROEmailServer.SmtpClient.Host := SMTPhost; + ROEmailServer.SmtpClient.Port := SMTPPort; + {$IFDEF RemObjects_INDY10C} + if SMTPUserName <> '' then + ROEmailServer.SmtpClient.AuthType := satDefault + else + ROEmailServer.SmtpClient.AuthType := satNone; + {$ELSE} + {$IFDEF RemObjects_INDY10} + if SMTPUserName <> '' then + ROEmailServer.SmtpClient.AuthType := atDefault + else + ROEmailServer.SmtpClient.AuthType := atNone; + {$ELSE} + if SMTPUserName <> '' then + ROEmailServer.SmtpClient.AuthenticationType := atLogin + else + ROEmailServer.SmtpClient.AuthenticationType := atNone; + {$ENDIF} + {$ENDIF} + ROEmailServer.Active := True; +end; + +procedure TAsyncServerMainForm.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + ROEmailServer.Active := False; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncService_Impl.pas new file mode 100644 index 0000000..64cc650 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/AsyncService_Impl.pas @@ -0,0 +1,50 @@ +unit AsyncService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Generated:} AsyncLibrary_Intf; + +type + { TAsyncService } + TAsyncService = class(TRORemotable, IAsyncService) + private + protected + { IAsyncService methods } + function Sum(const A: Integer; const B: Integer): Integer; + end; + +implementation + +uses + {Generated:} AsyncLibrary_Invk; + +procedure Create_AsyncService(out anInstance: IUnknown); +begin + anInstance := TAsyncService.Create; +end; + +{ AsyncService } + +function TAsyncService.Sum(const A: Integer; const B: Integer): Integer; +begin + Result := A + B; + Sleep(10000); { Simulate that calculations actually took 10 seconds. } +end; + +initialization + TROClassFactory.Create('AsyncService', Create_AsyncService, TAsyncService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/RODLFILE.res new file mode 100644 index 0000000..4521a5d Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/async_EmailSettings.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/async_EmailSettings.dfm new file mode 100644 index 0000000..f855162 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/async_EmailSettings.dfm @@ -0,0 +1,225 @@ +object async_EmailSettingsForm: Tasync_EmailSettingsForm + Left = 388 + Top = 181 + BorderIcons = [biSystemMenu] + BorderStyle = bsDialog + Caption = 'Email Settings' + ClientHeight = 173 + ClientWidth = 492 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Label9: TLabel + Left = 12 + Top = 124 + Width = 61 + Height = 13 + Caption = 'Server email:' + end + object lClientEmail: TLabel + Left = 256 + Top = 124 + Width = 56 + Height = 13 + Caption = 'Client email:' + end + object GroupBox1: TGroupBox + Left = 3 + Top = 2 + Width = 240 + Height = 114 + Caption = 'POP3' + TabOrder = 0 + DesignSize = ( + 240 + 114) + object Label1: TLabel + Left = 9 + Top = 17 + Width = 25 + Height = 13 + Caption = 'Host:' + end + object Label2: TLabel + Left = 9 + Top = 41 + Width = 22 + Height = 13 + Caption = 'Port:' + end + object Label3: TLabel + Left = 9 + Top = 65 + Width = 51 + Height = 13 + Caption = 'Username:' + end + object Label4: TLabel + Left = 9 + Top = 89 + Width = 49 + Height = 13 + Caption = 'Password:' + end + object ePOP3Host: TEdit + Left = 85 + Top = 13 + Width = 150 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + object ePOP3Port: TMaskEdit + Left = 85 + Top = 37 + Width = 49 + Height = 21 + Anchors = [akLeft, akTop, akRight] + EditMask = '99990;1; ' + MaxLength = 5 + TabOrder = 1 + Text = ' ' + end + object ePOP3Usename: TEdit + Left = 85 + Top = 61 + Width = 150 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 2 + end + object ePOP3Password: TEdit + Left = 85 + Top = 85 + Width = 150 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 3 + end + end + object GroupBox2: TGroupBox + Left = 247 + Top = 2 + Width = 240 + Height = 114 + Caption = 'SMTP' + TabOrder = 1 + DesignSize = ( + 240 + 114) + object Label5: TLabel + Left = 9 + Top = 17 + Width = 25 + Height = 13 + Caption = 'Host:' + end + object Label6: TLabel + Left = 9 + Top = 41 + Width = 22 + Height = 13 + Caption = 'Port:' + end + object lSMTPUserName: TLabel + Left = 9 + Top = 65 + Width = 51 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Username:' + end + object lSMTPPassword: TLabel + Left = 9 + Top = 89 + Width = 49 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Password:' + end + object eSMTPHost: TEdit + Left = 85 + Top = 13 + Width = 150 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + object eSMTPPort: TMaskEdit + Left = 85 + Top = 37 + Width = 49 + Height = 21 + Anchors = [akLeft, akTop, akRight] + EditMask = '99990;1; ' + MaxLength = 5 + TabOrder = 1 + Text = ' ' + end + object eSMTPUserName: TEdit + Left = 85 + Top = 61 + Width = 150 + Height = 21 + Anchors = [akLeft, akRight, akBottom] + TabOrder = 2 + end + object eSMTPPassword: TEdit + Left = 85 + Top = 85 + Width = 150 + Height = 21 + Anchors = [akLeft, akRight, akBottom] + TabOrder = 3 + end + end + object eServerEmail: TEdit + Left = 88 + Top = 120 + Width = 150 + Height = 21 + TabOrder = 2 + end + object eClientEmail: TEdit + Left = 332 + Top = 120 + Width = 150 + Height = 21 + TabOrder = 3 + end + object OKButton: TButton + Left = 331 + Top = 146 + Width = 75 + Height = 22 + Anchors = [akRight, akBottom] + Caption = 'OK' + ModalResult = 1 + TabOrder = 4 + OnClick = OKButtonClick + end + object CancelButton: TButton + Left = 410 + Top = 146 + Width = 75 + Height = 22 + Anchors = [akRight, akBottom] + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 5 + end + object cbSMTPAuthentication: TCheckBox + Left = 11 + Top = 149 + Width = 249 + Height = 17 + Anchors = [akLeft, akBottom] + Caption = 'My SMTP server requires authentication' + TabOrder = 6 + OnClick = cbSMTPAuthenticationClick + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/async_EmailSettings.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/async_EmailSettings.pas new file mode 100644 index 0000000..238c2f4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Async/async_EmailSettings.pas @@ -0,0 +1,173 @@ +unit async_EmailSettings; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, Mask; + +type + Tasync_EmailSettingsForm = class(TForm) + GroupBox1: TGroupBox; + ePOP3Host: TEdit; + Label1: TLabel; + ePOP3Port: TMaskEdit; + Label2: TLabel; + Label3: TLabel; + ePOP3Usename: TEdit; + Label4: TLabel; + ePOP3Password: TEdit; + GroupBox2: TGroupBox; + Label5: TLabel; + Label6: TLabel; + lSMTPUserName: TLabel; + lSMTPPassword: TLabel; + eSMTPHost: TEdit; + eSMTPPort: TMaskEdit; + eSMTPUserName: TEdit; + eSMTPPassword: TEdit; + Label9: TLabel; + eServerEmail: TEdit; + lClientEmail: TLabel; + eClientEmail: TEdit; + OKButton: TButton; + CancelButton: TButton; + cbSMTPAuthentication: TCheckBox; + procedure FormShow(Sender: TObject); + procedure OKButtonClick(Sender: TObject); + procedure cbSMTPAuthenticationClick(Sender: TObject); + private + { Private declarations } + FClientSettings: Boolean; + public + { Public declarations } + end; + +var + ServerEmail: string; + ClientEmail: string; + // pop3 + POP3UserName: string; + Pop3Password: string; + POP3host: string; + POP3Port: integer; + // smtp + SMTPUserName: string; + SMTPPassword: string; + SMTPhost: string; + SMTPPort: integer; + SMTPAuthentication: boolean; + +procedure SetupEmailSettings(AClientSettings: Boolean); +procedure LoadEmailSettings; +procedure SaveEmailSettings; +implementation +uses + IniFiles; +{$R *.dfm} + +const + ini_Section = 'Global'; + +procedure SetupEmailSettings(AClientSettings: Boolean); +begin + with Tasync_EmailSettingsForm.Create(Application) do try + FClientSettings := AClientSettings; + ShowModal; + finally + Release; + end; +end; + +procedure LoadEmailSettings; +begin + with TIniFile.Create(ChangeFileExt(Application.ExeName, '.INI')) do begin + ServerEmail := ReadString(ini_Section, 'ServerEmail', 'server@email.com'); + ClientEmail := ReadString(ini_Section, 'ClientEmail', 'client@email.com'); + POP3UserName := ReadString(ini_Section, 'POP3UserName', 'username'); + Pop3Password := ReadString(ini_Section, 'Pop3Password', 'password'); + POP3host := ReadString(ini_Section, 'POP3host', 'pop3host'); + POP3Port := ReadInteger(ini_Section, 'POP3Port', 110); + SMTPAuthentication := ReadInteger(ini_Section, 'SMTPAuthentication', 0) <> 0; + if SMTPAuthentication then begin + SMTPUserName := ReadString(ini_Section, 'SMTPUserName', 'username'); + SMTPPassword := ReadString(ini_Section, 'SMTPPassword', 'password'); + end; + SMTPhost := ReadString(ini_Section, 'SMTPhost', 'smtphost'); + SMTPPort := ReadInteger(ini_Section, 'SMTPPort', 25); + end; +end; + +procedure SaveEmailSettings; +begin + with TIniFile.Create(ChangeFileExt(Application.ExeName, '.INI')) do begin + WriteString(ini_Section, 'ServerEmail', ServerEmail); + WriteString(ini_Section, 'ClientEmail', ClientEmail); + WriteString(ini_Section, 'POP3UserName', POP3UserName); + WriteString(ini_Section, 'Pop3Password', Pop3Password); + WriteString(ini_Section, 'POP3host', POP3host); + WriteInteger(ini_Section, 'POP3Port', POP3Port); + WriteInteger(ini_Section, 'SMTPAuthentication', ord(SMTPAuthentication)); + if SMTPAuthentication then begin + WriteString(ini_Section, 'SMTPUserName', SMTPUserName); + WriteString(ini_Section, 'SMTPPassword', SMTPPassword); + end; + WriteString(ini_Section, 'SMTPhost', SMTPhost); + WriteInteger(ini_Section, 'SMTPPort', SMTPPort); + end; +end; + +procedure Tasync_EmailSettingsForm.FormShow(Sender: TObject); +begin + eClientEmail.Visible := FClientSettings; + lClientEmail.Visible := FClientSettings; + eServerEmail.Text := ServerEmail; + eClientEmail.Text := ClientEmail; + ePOP3Host.Text := POP3host; + ePOP3Port.Text := IntToStr(POP3Port); + ePOP3Usename.Text := POP3UserName; + ePOP3Password.Text := Pop3Password; + eSMTPHost.Text := SMTPhost; + eSMTPPort.Text := IntToStr(SMTPPort); + cbSMTPAuthentication.Checked := SMTPAuthentication; + cbSMTPAuthenticationClick(cbSMTPAuthentication); + if cbSMTPAuthentication.Checked then begin + eSMTPUsername.Text := SMTPUserName; + eSMTPPassword.Text := SMTPPassword; + end + else begin + eSMTPUsername.Text := ''; + eSMTPPassword.Text := ''; + end; +end; + +procedure Tasync_EmailSettingsForm.OKButtonClick(Sender: TObject); +begin + ServerEmail := eServerEmail.Text; + ClientEmail := eClientEmail.Text; + POP3host := ePOP3Host.Text; + POP3Port := StrToInt(Trim(ePOP3Port.Text)); + POP3UserName := ePOP3Usename.Text; + Pop3Password := ePOP3Password.Text; + SMTPhost := eSMTPHost.Text; + SMTPPort := StrToInt(Trim(eSMTPPort.Text)); + SMTPAuthentication := cbSMTPAuthentication.Checked; + if SMTPAuthentication then begin + SMTPUserName := eSMTPUsername.Text; + SMTPPassword := eSMTPPassword.Text; + end; + SaveEmailSettings; +end; + +procedure Tasync_EmailSettingsForm.cbSMTPAuthenticationClick(Sender: TObject); +begin + with cbSMTPAuthentication do begin + eSMTPUserName.Enabled := Checked; + eSMTPPassword.Enabled := Checked; + lSMTPUserName.Enabled := Checked; + lSMTPPassword.Enabled := Checked; + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.bdsproj new file mode 100644 index 0000000..444ca0e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + AutoServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.dpr new file mode 100644 index 0000000..cdfeb34 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.dpr @@ -0,0 +1,21 @@ +program AutoServer; + +{#ROGEN:AutoServer.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + AutoServer_ServerMain in 'AutoServer_ServerMain.pas' {AutoServer_ServerMainForm}, + AutoServerLibrary_Intf in 'AutoServerLibrary_Intf.pas', + AutoServerLibrary_Invk in 'AutoServerLibrary_Invk.pas', + AutoServerService_Impl in 'AutoServerService_Impl.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'AutoServer - Server'; + Application.CreateForm(TAutoServer_ServerMainForm, AutoServer_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.dproj new file mode 100644 index 0000000..0d177d8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.dproj @@ -0,0 +1,75 @@ + + + {6794d47d-6c7b-4270-b1b7-31860654e4e9} + AutoServer.dpr + Debug + AnyCPU + DCC32 + AutoServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + AutoServer.dpr + + + + + + + MainSource + + + + + +
    AutoServer_ServerMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.res new file mode 100644 index 0000000..3eab0f7 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.rodl new file mode 100644 index 0000000..f3f779f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer.rodl @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.Sample.html new file mode 100644 index 0000000..bdb2db6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.Sample.html @@ -0,0 +1,17 @@ + + + + + + + + + +

    AutoServer example

    + +

    Purpose

    This sample shows how a client can control its server when they are both running locally. This is useful if you want to provide a simple standard alone solution which is easily upgraded to multi-tier (or you might want to provide both options).

    To try this sample, compile or build both projects and then run the client. On start up, the client will look for an existing server window and start the server if necessary.

    The server supplies a GetEnvironment method which returns the value of an environment variable.

    + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.bdsgroup new file mode 100644 index 0000000..e0d455c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + AutoServer.bdsproj + AutoServer_Client.bdsproj + AutoServer.exe AutoServer_Client.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.bpg new file mode 100644 index 0000000..e8874db --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = AutoServer.exe AutoServer_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +AutoServer_Client.exe: AutoServer_Client.dpr + $(DCC) + +AutoServer.exe: AutoServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.groupproj new file mode 100644 index 0000000..03d7b15 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerGroup.groupproj @@ -0,0 +1,40 @@ + + + {0a3399f8-920b-4d34-a340-d1364c5a4d1f} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerLibrary_Intf.pas new file mode 100644 index 0000000..1e7cdb7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerLibrary_Intf.pas @@ -0,0 +1,113 @@ +unit AutoServerLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{E9FFBC72-4E93-4399-9AEE-E12D20E5CF13}'; + TargetNamespace = ''; + + { Service Interface ID's } + IAutoServerService_IID : TGUID = '{03EF69F8-5396-4CD6-BD4E-FC172489F603}'; + + { Event ID's } + +type + { Forward declarations } + IAutoServerService = interface; + + + { IAutoServerService } + IAutoServerService = interface + ['{03EF69F8-5396-4CD6-BD4E-FC172489F603}'] + function GetServerTime: DateTime; + function GetEnvironment(const Environment: Widestring): Widestring; + end; + + { CoAutoServerService } + CoAutoServerService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IAutoServerService; + end; + + { TAutoServerService_Proxy } + TAutoServerService_Proxy = class(TROProxy, IAutoServerService) + protected + function __GetInterfaceName:string; override; + + function GetServerTime: DateTime; + function GetEnvironment(const Environment: Widestring): Widestring; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoAutoServerService } + +class function CoAutoServerService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IAutoServerService; +begin + result := TAutoServerService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TAutoServerService_Proxy } + +function TAutoServerService_Proxy.__GetInterfaceName:string; +begin + result := 'AutoServerService'; +end; + +function TAutoServerService_Proxy.GetServerTime: DateTime; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'AutoServerLibrary', __InterfaceName, 'GetServerTime'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DateTime), result, [paIsDateTime]); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TAutoServerService_Proxy.GetEnvironment(const Environment: Widestring): Widestring; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'AutoServerLibrary', __InterfaceName, 'GetEnvironment'); + __Message.Write('Environment', TypeInfo(Widestring), Environment, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Widestring), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IAutoServerService_IID, TAutoServerService_Proxy); + + +finalization + UnregisterProxyClass(IAutoServerService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerLibrary_Invk.pas new file mode 100644 index 0000000..2cf5b45 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerLibrary_Invk.pas @@ -0,0 +1,82 @@ +unit AutoServerLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} AutoServerLibrary_Intf; + +type + TAutoServerService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetEnvironment(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TAutoServerService_Invoker } + +constructor TAutoServerService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TAutoServerService_Invoker.Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetServerTime: DateTime; } +var + lResult: DateTime; +begin + try + lResult := (__Instance as IAutoServerService).GetServerTime; + + __Message.InitializeResponseMessage(__Transport, 'AutoServerLibrary', 'AutoServerService', 'GetServerTimeResponse'); + __Message.Write('Result', TypeInfo(DateTime), lResult, [paIsDateTime]); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TAutoServerService_Invoker.Invoke_GetEnvironment(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetEnvironment(const Environment: Widestring): Widestring; } +var + Environment: Widestring; + lResult: Widestring; +begin + try + __Message.Read('Environment', TypeInfo(Widestring), Environment, []); + + lResult := (__Instance as IAutoServerService).GetEnvironment(Environment); + + __Message.InitializeResponseMessage(__Transport, 'AutoServerLibrary', 'AutoServerService', 'GetEnvironmentResponse'); + __Message.Write('Result', TypeInfo(Widestring), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerService_Impl.pas new file mode 100644 index 0000000..13807d8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServerService_Impl.pas @@ -0,0 +1,55 @@ +unit AutoServerService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Generated:} AutoServerLibrary_Intf; + +type + { TAutoServerService } + TAutoServerService = class(TRORemotable, IAutoServerService) + private + protected + { IAutoServerService methods } + function GetServerTime: DateTime; + function GetEnvironment(const Environment: Widestring): Widestring; + end; + +implementation + +uses + {Generated:} AutoServerLibrary_Invk; + +procedure Create_AutoServerService(out anInstance: IUnknown); +begin + anInstance := TAutoServerService.Create; +end; + +{ AutoServerService } + +function TAutoServerService.GetServerTime: DateTime; +begin + Result := Now; +end; + +function TAutoServerService.GetEnvironment(const Environment: Widestring): Widestring; +begin + Result := GetEnvironmentVariable(Environment); +end; + +initialization + TROClassFactory.Create('AutoServerService', Create_AutoServerService, TAutoServerService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.bdsproj new file mode 100644 index 0000000..093bda9 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + AutoServer_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.dpr new file mode 100644 index 0000000..20d539a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.dpr @@ -0,0 +1,15 @@ +program AutoServer_Client; + +uses + uROComInit, + Forms, + AutoServer_ClientMain in 'AutoServer_ClientMain.pas' {AutoServer_ClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'AutoServer Client'; + Application.CreateForm(TAutoServer_ClientMainForm, AutoServer_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.dproj new file mode 100644 index 0000000..a38f210 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.dproj @@ -0,0 +1,72 @@ + + + {9502af4b-ac11-42b4-a13f-8b7529127667} + AutoServer_Client.dpr + Debug + AnyCPU + DCC32 + AutoServer_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + AutoServer_Client.dpr + + + + + + + MainSource + + +

    AutoServer_ClientMainForm
    + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.res new file mode 100644 index 0000000..ac22e55 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_Client.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ClientMain.dfm new file mode 100644 index 0000000..b4e86e8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ClientMain.dfm @@ -0,0 +1,81 @@ +object AutoServer_ClientMainForm: TAutoServer_ClientMainForm + Left = 62 + Top = 102 + AutoScroll = False + Caption = 'AutoServer - Client' + ClientHeight = 278 + ClientWidth = 448 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 7 + Top = 7 + Width = 64 + Height = 13 + Caption = 'Environment:' + end + object cbShutdown: TCheckBox + Left = 7 + Top = 49 + Width = 145 + Height = 17 + Caption = 'Shutdown server on close' + TabOrder = 0 + end + object Memo: TMemo + Left = 0 + Top = 70 + Width = 448 + Height = 208 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssVertical + TabOrder = 1 + end + object cbEnvironment: TComboBox + Left = 7 + Top = 23 + Width = 334 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 2 + end + object GetEnvironmentButton: TButton + Left = 347 + Top = 21 + Width = 94 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Get environment' + TabOrder = 3 + OnClick = GetEnvironmentButtonClick + end + object ROMessage: TROBinMessage + Left = 36 + Top = 88 + end + object ROChannel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 8 + Top = 88 + end + object RORemoteService: TRORemoteService + ServiceName = 'AutoServerService' + Message = ROMessage + Channel = ROChannel + Left = 64 + Top = 88 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ClientMain.pas new file mode 100644 index 0000000..56b9cd6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ClientMain.pas @@ -0,0 +1,152 @@ +unit AutoServer_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + ComCtrls, uROPoweredByRemObjectsButton, AutoServerLibrary_Intf; + +type + TAutoServer_ClientMainForm = class(TForm) + ROMessage: TROBinMessage; + ROChannel: TROWinInetHTTPChannel; + RORemoteService: TRORemoteService; + cbShutdown: TCheckBox; + Memo: TMemo; + cbEnvironment: TComboBox; + GetEnvironmentButton: TButton; + Label1: TLabel; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure GetEnvironmentButtonClick(Sender: TObject); + private + fServerHandle: cardinal; + FAutoServerService: IAutoServerService; + function GetAutoShutDownServer: boolean; + procedure SetAutoShutDownServer(const Value: boolean); + procedure FillEnvironment; + procedure Log(AStr: string); + public + property AutoShutDownServer: boolean read GetAutoShutDownServer write SetAutoShutDownServer; + end; + +var + AutoServer_ClientMainForm: TAutoServer_ClientMainForm; + +implementation + +uses ShellAPI; + +{$R *.dfm} + +procedure TAutoServer_ClientMainForm.FillEnvironment; +var + p, buf: Pchar; + List: TStringList; + i: integer; +begin + cbEnvironment.Clear; + List := TStringList.Create; + try + buf := GetEnvironmentStrings; + try + p := buf; + while p^ <> #0 do begin + List.Add(p); + inc(p, StrLen(p) + 1); + end; + finally + FreeEnvironmentStrings(buf); + end; + for i := 0 to List.Count - 1 do + if List.Names[i] <> '' then + cbEnvironment.Items.Add(List.Names[i]); + if cbEnvironment.Items.Count <> 0 then + cbEnvironment.ItemIndex := 0; + finally + List.Free; + end; +end; + +procedure TAutoServer_ClientMainForm.FormCreate(Sender: TObject); +var + serverfilename: string; + res: integer; +begin + fAutoServerService := (RORemoteService as IAutoServerService); + // Locates the server window + Log('Searching for server process ...'); + fServerHandle := FindWindow(nil, 'AutoServer - Server'); + + if (fServerHandle = 0) then begin + Log('No server found.'); + AutoShutDownServer := TRUE; + + // Starts it + serverfilename := ExtractFilePath(Application.ExeName) + 'AutoServer.exe'; + Log('Attempting to start a server ''' + serverfilename + ''''); + Res := ShellExecute(0, 'open', PChar(serverfilename), nil, nil, SW_NORMAL); + if res < 33 then begin + Log(SysErrorMessage(Res)); + exit; + end + else + Log('Waiting for the server to start ...'); + // Waits half a second. Not the best implementation but it's just to give an idea + Sleep(500); + + Log('Searching for a server ...'); + fServerHandle := FindWindow(nil, 'AutoServer - Server'); + if (fServerHandle = 0) then + Log('The server could not be started!') + else + Log('The server has been started successfully'); + end + else begin + Log('The server is up and running already'); + AutoShutDownServer := FALSE; + end; +end; + +procedure TAutoServer_ClientMainForm.FormDestroy(Sender: TObject); +begin + if AutoShutDownServer then PostMessage(fServerHandle, WM_CLOSE, 0, 0); +end; + +function TAutoServer_ClientMainForm.GetAutoShutDownServer: boolean; +begin + result := cbShutdown.Checked; +end; + +procedure TAutoServer_ClientMainForm.SetAutoShutDownServer(const Value: boolean); +begin + cbShutdown.Checked := Value; +end; + +procedure TAutoServer_ClientMainForm.FormShow(Sender: TObject); +begin + FillEnvironment; +end; + +procedure TAutoServer_ClientMainForm.Log(AStr: string); +begin + Memo.Lines.Add(AStr); +end; + +procedure TAutoServer_ClientMainForm.GetEnvironmentButtonClick( + Sender: TObject); +var + res: string; +begin + Log(''); + Log('GetEnvironment'); + Log('--------------'); + Log('Sending:'#9#9 + cbEnvironment.Text); + Res := FAutoServerService.GetEnvironment(cbEnvironment.Text); + Log('Receiving:'#9 + Res); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ServerMain.dfm new file mode 100644 index 0000000..2de50f9 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ServerMain.dfm @@ -0,0 +1,36 @@ +object AutoServer_ServerMainForm: TAutoServer_ServerMainForm + Left = 13 + Top = 4 + BorderStyle = bsDialog + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object ROMessage: TROBinMessage + Left = 36 + Top = 8 + end + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 8 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ServerMain.pas new file mode 100644 index 0000000..3195ae8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/AutoServer_ServerMain.pas @@ -0,0 +1,36 @@ +unit AutoServer_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, uROIndyTCPServer; + +type + TAutoServer_ServerMainForm = class(TForm) + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + ROMessage: TROBinMessage; + ROServer: TROIndyHTTPServer; + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + AutoServer_ServerMainForm: TAutoServer_ServerMainForm; + +implementation + +{$R *.dfm} + +procedure TAutoServer_ServerMainForm.FormCreate(Sender: TObject); +begin + caption := 'AutoServer - Server'; + ROServer.Active := true; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/RODLFILE.res new file mode 100644 index 0000000..b2e8f6b Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Auto Server/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.Sample.html new file mode 100644 index 0000000..cb9bfd5 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.Sample.html @@ -0,0 +1,24 @@ + + + + + + + + + +

    + Broadcast Chat Sample +

    + + +

    Purpose

    + +

    This example shows how to use the TROBroadcastServer and TROBroadcastChannel channels to write an UDP broadcasting chat program.

    + +

    + In order to test this sample, you will need to make the compiled exe available on two or more computers.
    Note: if you are running a trial version of the RemObjects SDK, each machine + used will need to be running the Delphi IDE. Registered users can create on one computer and just copy the exe to other(s). +

    + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.bdsproj new file mode 100644 index 0000000..486a30e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + BroadcastChat.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.dpr new file mode 100644 index 0000000..fad0006 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.dpr @@ -0,0 +1,20 @@ +program BroadcastChat; + +uses + Forms, + BroadcastChatMain in 'BroadcastChatMain.pas' {BroadcastChatMainForm}, + BroadcastChatLibrary_Intf in 'BroadcastChatLibrary_Intf.pas', + BroadcastChatLibrary_Invk in 'BroadcastChatLibrary_Invk.pas', + BroadcastChatService_Impl in 'BroadcastChatService_Impl.pas'; + +{#ROGEN:BroadcastChatLibrary.rodl} // RemObjects: Careful, do not remove! +{$R RODLFile.res} +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Broadcast Chat'; + Application.CreateForm(TBroadcastChatMainForm, BroadcastChatMainForm); + Application.Run; +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.dproj new file mode 100644 index 0000000..7af0116 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.dproj @@ -0,0 +1,75 @@ + + + {f49233b6-a9eb-4b51-a683-21534d447151} + BroadcastChat.dpr + Debug + AnyCPU + DCC32 + BroadcastChat.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + BroadcastChat.dpr + + + + + + + MainSource + + + + +
    BroadcastChatMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.res new file mode 100644 index 0000000..9092728 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChat.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary.rodl new file mode 100644 index 0000000..3e6cba9 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary.rodl @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary_Async.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary_Async.pas new file mode 100644 index 0000000..5731ce7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary_Async.pas @@ -0,0 +1,97 @@ +unit BroadcastChatLibrary_Async; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROTypes, uROClientIntf, uROAsync, + {Project:} BroadcastChatLibrary_Intf; + +type + { IBroadcastChatService_Async } + IBroadcastChatService_Async = interface(IROAsyncInterface) + ['{ED47ECBE-2464-41C0-8FA3-FD42573E881E}'] + procedure Invoke_SendMessage(const iDate: DateTime; const iFrom: Widestring; const iMessage: Widestring); + procedure Invoke_GetInfo; + function Retrieve_GetInfo: Widestring; + end; + + { CoBroadcastChatService_Async } + CoBroadcastChatService_Async = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IBroadcastChatService_Async; + end; + + { TBroadcastChatService_AsyncProxy } + TBroadcastChatService_AsyncProxy = class(TROAsyncProxy, IBroadcastChatService_Async) + private + protected + function __GetInterfaceName:string; override; + + procedure Invoke_SendMessage(const iDate: DateTime; const iFrom: Widestring; const iMessage: Widestring); + procedure Invoke_GetInfo; + function Retrieve_GetInfo: Widestring; + end; + +implementation + +uses + {vcl:} SysUtils; + +{ CoBroadcastChatService } + +class function CoBroadcastChatService_Async.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IBroadcastChatService_Async; +begin + result := TBroadcastChatService_AsyncProxy.Create(aMessage, aTransportChannel); +end; + +{ TBroadcastChatService_AsyncProxy } + +function TBroadcastChatService_AsyncProxy.__GetInterfaceName:string; +begin + result := 'BroadcastChatService'; +end; + +procedure TBroadcastChatService_AsyncProxy.Invoke_SendMessage(const iDate: DateTime; const iFrom: Widestring; const iMessage: Widestring); +begin + __AssertProxyNotBusy('SendMessage'); + + __Message.InitializeRequestMessage(__TransportChannel, 'BroadcastChatLibrary', __InterfaceName, 'SendMessage'); + __Message.Write('iDate', TypeInfo(DateTime), iDate, [paIsDateTime]); + __Message.Write('iFrom', TypeInfo(Widestring), iFrom, []); + __Message.Write('iMessage', TypeInfo(Widestring), iMessage, []); + __DispatchAsyncRequest('SendMessage',__Message, false); + __Message.UnsetAttributes(__TransportChannel); +end; + +procedure TBroadcastChatService_AsyncProxy.Invoke_GetInfo; +begin + __AssertProxyNotBusy('GetInfo'); + + __Message.InitializeRequestMessage(__TransportChannel, 'BroadcastChatLibrary', __InterfaceName, 'GetInfo'); + __DispatchAsyncRequest('GetInfo',__Message); +end; + +function TBroadcastChatService_AsyncProxy.Retrieve_GetInfo: Widestring; +var __response:TStream; +begin + __response := __RetrieveAsyncResponse('GetInfo'); + __Message.ReadFromStream(__response); + + __Message.Read('Result', TypeInfo(Widestring), Result, []); + + __response.Free(); +end; + + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary_Intf.pas new file mode 100644 index 0000000..e6a7a94 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary_Intf.pas @@ -0,0 +1,114 @@ +unit BroadcastChatLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{046A7B5C-4E0B-43A9-8EF9-401F5705E52B}'; + TargetNamespace = ''; + + { Service Interface ID's } + IBroadcastChatService_IID : TGUID = '{0BD653EA-D4B0-46BE-9856-2FD482115A77}'; + + { Event ID's } + +type + { Forward declarations } + IBroadcastChatService = interface; + + + { IBroadcastChatService } + IBroadcastChatService = interface + ['{0BD653EA-D4B0-46BE-9856-2FD482115A77}'] + procedure SendMessage(const iDate: DateTime; const iFrom: Widestring; const iMessage: Widestring); + function GetInfo: Widestring; + end; + + { CoBroadcastChatService } + CoBroadcastChatService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IBroadcastChatService; + end; + + { TBroadcastChatService_Proxy } + TBroadcastChatService_Proxy = class(TROProxy, IBroadcastChatService) + protected + function __GetInterfaceName:string; override; + + procedure SendMessage(const iDate: DateTime; const iFrom: Widestring; const iMessage: Widestring); + function GetInfo: Widestring; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoBroadcastChatService } + +class function CoBroadcastChatService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IBroadcastChatService; +begin + result := TBroadcastChatService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TBroadcastChatService_Proxy } + +function TBroadcastChatService_Proxy.__GetInterfaceName:string; +begin + result := 'BroadcastChatService'; +end; + +procedure TBroadcastChatService_Proxy.SendMessage(const iDate: DateTime; const iFrom: Widestring; const iMessage: Widestring); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'BroadcastChatLibrary', __InterfaceName, 'SendMessage'); + __Message.Write('iDate', TypeInfo(DateTime), iDate, [paIsDateTime]); + __Message.Write('iFrom', TypeInfo(Widestring), iFrom, []); + __Message.Write('iMessage', TypeInfo(Widestring), iMessage, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TBroadcastChatService_Proxy.GetInfo: Widestring; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'BroadcastChatLibrary', __InterfaceName, 'GetInfo'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Widestring), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IBroadcastChatService_IID, TBroadcastChatService_Proxy); + + +finalization + UnregisterProxyClass(IBroadcastChatService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary_Invk.pas new file mode 100644 index 0000000..83d0106 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatLibrary_Invk.pas @@ -0,0 +1,86 @@ +unit BroadcastChatLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} BroadcastChatLibrary_Intf; + +type + TBroadcastChatService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_SendMessage(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetInfo(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TBroadcastChatService_Invoker } + +constructor TBroadcastChatService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TBroadcastChatService_Invoker.Invoke_SendMessage(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure SendMessage(const iDate: DateTime; const iFrom: Widestring; const iMessage: Widestring); } +var + iDate: DateTime; + iFrom: Widestring; + iMessage: Widestring; +begin + try + __Message.Read('iDate', TypeInfo(DateTime), iDate, [paIsDateTime]); + __Message.Read('iFrom', TypeInfo(Widestring), iFrom, []); + __Message.Read('iMessage', TypeInfo(Widestring), iMessage, []); + + (__Instance as IBroadcastChatService).SendMessage(iDate, iFrom, iMessage); + + __Message.InitializeResponseMessage(__Transport, 'BroadcastChatLibrary', 'BroadcastChatService', 'SendMessageResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +procedure TBroadcastChatService_Invoker.Invoke_GetInfo(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetInfo: Widestring; } +var + lResult: Widestring; +begin + try + lResult := (__Instance as IBroadcastChatService).GetInfo; + + __Message.InitializeResponseMessage(__Transport, 'BroadcastChatLibrary', 'BroadcastChatService', 'GetInfoResponse'); + __Message.Write('Result', TypeInfo(Widestring), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatMain.dfm new file mode 100644 index 0000000..1f8e5a2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatMain.dfm @@ -0,0 +1,319 @@ +object BroadcastChatMainForm: TBroadcastChatMainForm + Left = 52 + Top = 80 + ActiveControl = ed_Message + AutoScroll = False + BorderWidth = 5 + Caption = 'RemObjects SDK Broadcast Channel LAN Chat Client' + ClientHeight = 239 + ClientWidth = 449 + Color = clBtnFace + Constraints.MinHeight = 250 + Constraints.MinWidth = 416 + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 449 + Height = 26 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + DesignSize = ( + 449 + 26) + object Label1: TLabel + Left = 0 + Top = 2 + Width = 53 + Height = 13 + Caption = 'Nick Name:' + end + object Panel8: TPanel + Left = 60 + Top = 0 + Width = 389 + Height = 21 + Anchors = [akLeft, akTop, akRight] + BevelInner = bvLowered + BevelOuter = bvNone + TabOrder = 0 + object Panel9: TPanel + Left = 1 + Top = 1 + Width = 387 + Height = 19 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + TabOrder = 0 + DesignSize = ( + 387 + 19) + object ed_NickName: TEdit + Left = 1 + Top = 1 + Width = 386 + Height = 17 + Anchors = [akLeft, akTop, akRight] + BorderStyle = bsNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + TabOrder = 0 + end + end + end + end + object Panel2: TPanel + Left = 0 + Top = 26 + Width = 449 + Height = 133 + Align = alClient + BevelInner = bvLowered + BevelOuter = bvNone + TabOrder = 1 + object Panel4: TPanel + Left = 1 + Top = 1 + Width = 447 + Height = 131 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + TabOrder = 0 + object ed_Chat: TMemo + Left = 1 + Top = 1 + Width = 445 + Height = 129 + Align = alClient + BorderStyle = bsNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 0 + end + end + end + object Panel3: TPanel + Left = 0 + Top = 159 + Width = 449 + Height = 80 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + DesignSize = ( + 449 + 80) + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 0 + Top = 32 + Width = 212 + Height = 48 + Cursor = crHandPoint + ApplicationType = atClient + end + object Panel5: TPanel + Left = 0 + Top = 5 + Width = 449 + Height = 21 + Align = alTop + BevelInner = bvLowered + BevelOuter = bvNone + TabOrder = 0 + object Panel6: TPanel + Left = 1 + Top = 1 + Width = 447 + Height = 19 + Align = alClient + BevelOuter = bvNone + BorderWidth = 1 + TabOrder = 0 + DesignSize = ( + 447 + 19) + object ed_Message: TEdit + Left = 1 + Top = 1 + Width = 445 + Height = 17 + Anchors = [akLeft, akTop, akRight] + BorderStyle = bsNone + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + TabOrder = 0 + end + end + end + object Panel7: TPanel + Left = 0 + Top = 0 + Width = 449 + Height = 5 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + end + object btn_Send: TBitBtn + Left = 335 + Top = 32 + Width = 114 + Height = 25 + Action = ac_SendMessage + Anchors = [akTop, akRight] + Caption = '&Send Message' + TabOrder = 2 + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 18000000000000060000220B0000220B00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FF0170ACFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF9B9B9BFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF0275B00E88C00275B0096EA10174AFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF9D9D9DAAAAAA9D + 9D9D9E9E9E9C9C9CFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF0275B0279FDA1379B05FE3FF70EFFC5DD4E50C699A0275B00275 + B0FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF9D9D9DBDBDBDA8A8A8DC + DCDCE0E0E0D4D4D49E9E9E9D9D9D9D9D9DFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF0275B03FC7FF147FBA1682BB52D7FF6CEBFE7FFEFF86FFFF8AFFFF5FD7 + E60275B00275B00473ADFF00FFFF00FFFF00FF9D9D9DD0D0D0ABABABACACACD7 + D7D7E0E0E0E6E6E6E8E8E8EAEAEAD5D5D59D9D9D9D9D9D9E9E9EFF00FFFF00FF + 0275B03EC4FC3BC2FF117DB63FC4F847CCFB63E3FC7BF8FF7FFBFF80FEFF7EFB + FC1D84AF2DA5D90679B4FF00FFFF00FF9D9D9DCFCFCFCFCFCFA9A9A9CECECED2 + D2D2DCDCDCE5E5E5E6E6E6E6E6E6E5E5E5ACACACBFBFBFA1A1A1FF00FF0275B0 + 56D9FF48CCFB42C5F8128BC53FC4F83FC4F85ADCFB77F4FF82FFFF73EDF31D84 + AF32B1ED0174AFFF00FFFF00FF9D9D9DD9D9D9D2D2D2D0D0D0ADADADCECECECE + CECED9D9D9E3E3E3E7E7E7DFDFDFACACACC6C6C69C9C9CFF00FF0275B076F4FF + 64E5FE5DDEFB5FD7E60377B13BC1FE3ABFFA51D4FB72F2FF64DCEA1D84AF35B7 + F338BDFB0174AFFF00FF9D9D9DE3E3E3DDDDDDDADADAD5D5D59E9E9ECECECECD + CDCDD6D6D6E2E2E2D7D7D7ACACACC9C9C9CDCDCD9C9C9CFF00FF0275B08BFFFF + 77F3FE5FD7E60375B01C8EC7C738382EACE648C9F448BFDE2B9AC751D4FA4FD3 + FE0174AFFF00FFFF00FF9D9D9DEAEAEAE3E3E3D5D5D59E9E9EB3B3B3818181C3 + C3C3D1D1D1CBCBCBB9B9B9D5D5D5D6D6D69C9C9CFF00FFFF00FF0275B08EFFFF + 5FD7E60070AD0172AC006BA4C738380183BD0C8CC25AD5E775F6FFC73838C738 + 380D87BCFF00FFFF00FF9D9D9DEAEAEAD5D5D59B9B9B9C9C9C989898818181A1 + A1A1A9A9A9D4D4D4E3E3E3818181818181A8A8A8FF00FFFF00FF0275B05FD7E6 + 006FAC0377B10378B2006CA7C73838CC474707A7E06DEBF484FFFFC73838CF4F + 4FC73838FF00FFFF00FF9D9D9DD5D5D59A9A9A9E9E9E9F9F9F9999998181818E + 8E8EAFAFAFDEDEDEE7E7E7818181959595818181FF00FFFF00FF0376B00275B0 + 0377B10378B20472AA03669EC73838CE4B4BC73838C73838C73838C73838E290 + 90D35C5CC73838FF00FF9E9E9E9D9D9D9E9E9E9E9E9E9E9E9E99999981818190 + 9090818181818181818181818181C4C4C49E9E9E818181FF00FFFF00FFFF00FF + FF00FFFF00FF0378B20379B40279B4C73838D15656D05454D46262D96F6FDE83 + 83E39797D76A6AC73838FF00FFFF00FFFF00FFFF00FF9F9F9F9F9F9F9E9E9E81 + 81819A9A9A999999A3A3A3ADADADBBBBBBC9C9C9A9A9A9818181FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFC73838CC4747D05353D56464DA75 + 75E18A8AD96F6FC73838FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FF8181818E8E8E979797A4A4A4B1B1B1C0C0C0ACACAC818181FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFC73838C73838C73838D769 + 69D15656C73838FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FF818181818181818181A8A8A89A9A9A818181FF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFC73838CA3F + 3FC73838FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF818181878787818181FF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFC73838C738 + 38FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF818181818181FF00FFFF00FFFF00FF} + NumGlyphs = 2 + end + object BitBtn1: TBitBtn + Left = 215 + Top = 32 + Width = 114 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'List Users' + TabOrder = 3 + OnClick = BitBtn1Click + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000220B0000220B00000000000000000000FF00FF314B62 + AC7D7EFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FF5084B20F6FE1325F8CB87E7AFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF32A0FE37A1FF + 106FE2325F8BB67D79FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FF37A4FE379FFF0E6DDE355F89BB7F79FF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + 37A4FE359EFF0F6FDE35608BA67B7FFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF38A5FE329DFF156DCE444F5BFF + 00FF925D5AB48C80C9A391C28F88FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF3BABFFA1CAE78C7775A38372EBE0B8FEFCCFFEFCCEFCFBCCE3CF + B1C0998CFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFBDA4A4CEA58FFF + EDB2FFFCCAFFFFCFFFFFCFFFFFD5FFFFEAF3EBE5A0746FFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFB67F76F4D9A1F6D095FCF4C2FFFFCFFFFFD8FFFFEEFFFF + FAFFFFFFD5C2ACFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFD0A792FBDC9AEE + B87FFBF0BDFFFFD0FFFFDCFFFFF7FFFFFAFFFFE6EEEAC2B7847EFF00FFFF00FF + FF00FFFF00FFFF00FFDCB79AFAD796EAA76CF7DAA3FFFFCEFFFFD4FFFFE1FFFF + E3FFFFD7F8F6CBB69782FF00FFFF00FFFF00FFFF00FFFF00FFD5AF96FEE2A1EA + A96AEFBD80FAE9B4FFFFD0FFFFD3FFFFD1FFFFD1F3EEC5B88B80FF00FFFF00FF + FF00FFFF00FFFF00FFBB8980FCEBB1F8E2B5F0C690F0C286F7DCA5FEF3C1FEF8 + C6FFFFCFDDCEA9FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFD3B499FF + FFFFFFF4E2EFBD80EBAB6FF0C086FBDEA3FCF3B8AC8676FF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFC6ADA7F3EBD1FFEEAFFCDE9DFEE2A1F0D4 + A4C29886FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFBB987EC19983D3AD93D1A592FF00FFFF00FFFF00FFFF00FF} + end + end + object ROBINMessage: TROBinMessage + Left = 49 + Top = 43 + end + object ROBroadcastServer: TROBroadcastServer + Active = True + Dispatchers = < + item + Name = 'ROBINMessage' + Message = ROBINMessage + Enabled = True + end> + IndyUDPServer.BroadcastEnabled = True + IndyUDPServer.Bindings = <> + IndyUDPServer.DefaultPort = 8090 + Left = 49 + Top = 139 + end + object ROBroadcastChannel: TROBroadcastChannel + ServerLocators = <> + DispatchOptions = [] + AsyncTimeOut = 100 + Retrys = 5 + IndyClient.BroadcastEnabled = True + IndyClient.Port = 8090 + Port = 8090 + OnBroadCastResponseReceived = ROBroadcastChannelBroadCastResponseReceived + Left = 49 + Top = 91 + end + object ActionList1: TActionList + OnUpdate = ActionList1Update + Left = 137 + Top = 43 + object ac_SendMessage: TAction + Caption = '&Send Message' + ShortCut = 13 + OnExecute = ac_SendMessageExecute + end + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatMain.pas new file mode 100644 index 0000000..812cd91 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatMain.pas @@ -0,0 +1,132 @@ +unit BroadcastChatMain; + +{$I RemObjects.inc} + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, Buttons, uROPoweredByRemObjectsButton, + uROServer, uROIndyUDPServer, uROBroadcastServer, + uROIndyUDPChannel, uROBroadcastChannel, uROClient, + uROBINMessage, BroadcastChatLibrary_Async, ActnList; + +type + TBroadcastChatMainForm = class(TForm) + Panel1: TPanel; + Panel2: TPanel; + Panel3: TPanel; + Panel4: TPanel; + ed_Chat: TMemo; + Panel5: TPanel; + Panel6: TPanel; + Panel7: TPanel; + ed_Message: TEdit; + Panel8: TPanel; + Panel9: TPanel; + ed_NickName: TEdit; + Label1: TLabel; + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + btn_Send: TBitBtn; + ROBINMessage: TROBINMessage; + ROBroadcastServer: TROBroadcastServer; + ROBroadcastChannel: TROBroadcastChannel; + ActionList1: TActionList; + ac_SendMessage: TAction; + BitBtn1: TBitBtn; + procedure FormCreate(Sender: TObject); + procedure ac_SendMessageExecute(Sender: TObject); + procedure ActionList1Update(Action: TBasicAction; + var Handled: Boolean); + procedure BitBtn1Click(Sender: TObject); + // procedure tim_CheckInfoTimer(Sender: TObject); + procedure ROBroadcastChannelBroadCastResponseReceived(aServerIP, aResponseUID: string); + procedure FormDestroy(Sender: TObject); + private + fChatProxy: IBroadcastChatService_Async; + public +{$IFDEF VER140} + procedure WMUser(var Msg: TMessage); message WM_USER; +{$ENDIF} + procedure MessageReceived(iDate: TDateTime; const iFrom, iMessage: Widestring); + end; + +var + BroadcastChatMainForm: TBroadcastChatMainForm; + +implementation + +uses + IdStack, IdGlobal, BroadcastChatService_Impl; + +{$R *.dfm} + +{$IFDEF RemObjects_INDY8} + +function IndyGetHostName: string; +var + i: LongWord; +begin + SetLength(Result, MAX_COMPUTERNAME_LENGTH + 1); + i := Length(Result); + if GetComputerName(@Result[1], i) then begin + SetLength(Result, i); + end; +end; +{$ENDIF} + +procedure TBroadcastChatMainForm.FormCreate(Sender: TObject); +begin + fChatProxy := CoBroadcastChatService_Async.Create(ROBINMessage, ROBroadcastChannel); +{$IFDEF RemObjects_INDY10} + ed_NickName.Text := GStack.HostName; +{$ELSE} + ed_NickName.Text := IndyGetHostName; +{$ENDIF} +end; + +procedure TBroadcastChatMainForm.MessageReceived(iDate: TDateTime; const iFrom, iMessage: Widestring); +begin + ed_Chat.Lines.Add(Format('[%s] <%s> %s', [TimeToStr(iDate), iFrom, iMessage])); +end; + +procedure TBroadcastChatMainForm.ac_SendMessageExecute(Sender: TObject); +begin + if ed_Message.Text <> '' then begin + fChatProxy.Invoke_SendMessage(Now, ed_NickName.Text, ed_Message.Text); + ed_Message.Text := ''; + ActiveControl := ed_Message; + end; +end; + +procedure TBroadcastChatMainForm.ActionList1Update(Action: TBasicAction; var Handled: Boolean); +begin + ac_SendMessage.Enabled := ed_Message.Text <> ''; +end; + +procedure TBroadcastChatMainForm.BitBtn1Click(Sender: TObject); +begin + fChatProxy.Invoke_GetInfo(); +end; + +procedure TBroadcastChatMainForm.ROBroadcastChannelBroadCastResponseReceived(aServerIP, aResponseUID: string); +var + lName: string; +begin + lName := fChatProxy.Retrieve_GetInfo(); + ed_Chat.Lines.Add(Format('[%s] chat user: %s (at %s)', [TimeToStr(Now), lName, aServerIP])); +end; + +procedure TBroadcastChatMainForm.FormDestroy(Sender: TObject); +begin + fChatProxy := nil; +end; + +{$IFDEF VER140} +procedure TBroadcastChatMainForm.WMUser(var Msg: TMessage); +begin + TBroadcastChatService(Msg.WParam).MessageReceived; +end; +{$ENDIF} +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatService_Impl.pas new file mode 100644 index 0000000..a353902 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatService_Impl.pas @@ -0,0 +1,72 @@ +unit BroadcastChatService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Generated:} BroadcastChatLibrary_Intf; + +type + { TBroadcastChatService } + TBroadcastChatService = class(TRORemotable, IBroadcastChatService) + private + fSync_Date: TDateTime; + fSync_From, fSync_Message: Widestring; + protected + { IBroadcastChatService methods } + procedure SendMessage(const iDate: DateTime; const iFrom: Widestring; const iMessage: Widestring); + function GetInfo: Widestring; + public + procedure MessageReceived; + end; + +implementation + +uses + {Generated:} BroadcastChatLibrary_Invk, BroadcastChatMain{$IFDEF VER140}, Windows, Messages{$ENDIF}; + +procedure Create_BroadcastChatService(out anInstance: IUnknown); +begin + anInstance := TBroadcastChatService.Create; +end; + +{ BroadcastChatService } + +procedure TBroadcastChatService.SendMessage(const iDate: DateTime; const iFrom: Widestring; const iMessage: Widestring); +begin + fSync_Date := iDate; + fSync_From := iFrom; + fSync_Message := iMessage; +{$IFDEF VER140} + Windows.SendMessage(BroadcastChatMainForm.Handle, WM_USER, Longint(Self), 0); // workaround for d6 +{$ELSE} + Synchronize(MessageReceived); +{$ENDIF} +end; + +function TBroadcastChatService.GetInfo: Widestring; +begin + { we'll just assume that this operation is trivial enough to be threadsafe ;-} + result := BroadcastChatMainForm.ed_NickName.Text; +end; + +procedure TBroadcastChatService.MessageReceived; +begin + BroadcastChatMainForm.MessageReceived(fSync_Date, fSync_From, fSync_Message); +end; + +initialization + TROClassFactory.Create('BroadcastChatService', Create_BroadcastChatService, TBroadcastChatService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/RODLFILE.res new file mode 100644 index 0000000..d734764 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.Sample.html new file mode 100644 index 0000000..8a3cb15 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.Sample.html @@ -0,0 +1,39 @@ + + + + + + + + + +

    + COM Sample +

    + + +

    Purpose

    + +

    This sample shows how to call an existing RO server using COM.

    + +

    Getting Started

    +
      +
    • Build or compile both projects.
    • +
    • Launch the MegaDemoServer.exe (via the menu option: RemObjects | + Launch Server Executable) and activate the HTTP server
    • . +
    • Ensure that COMClient is the selected project and run it.
    • +
    • Check that the client buttons work as expected.
    • +
    +

    Examine the Code

    +
      +
    • + See the simple code needed to invoke the methods in COM_Main.pas. +
    • +
    + +

    Note

    +

    + The sample also shows how to call server methods from *.asp, *.vbs, *.xls. +

    + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.bdsgroup new file mode 100644 index 0000000..0384124 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + COMClient.bdsproj + ..\MegaDemo\MegaDemoServer.bdsproj + COMClient.exe MegaDemoServer.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.bpg new file mode 100644 index 0000000..3ec5cee --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = COMClient.exe MegaDemoServer.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +COMClient.exe: COMClient.dpr + $(DCC) + +MegaDemoServer.exe: ..\MegaDemo\MegaDemoServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.groupproj new file mode 100644 index 0000000..0a2dc42 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM.groupproj @@ -0,0 +1,40 @@ + + + {b969aecf-2818-493a-a1fe-bf1d8ea44a88} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.bdsproj new file mode 100644 index 0000000..04f4f0c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + COMClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.dpr new file mode 100644 index 0000000..fbc0e5a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.dpr @@ -0,0 +1,15 @@ +program COMClient; + +uses + Forms, + COM_Main in 'COM_Main.pas' {COM_MainForm}, + ROCOM_TLB in 'ROCOM_TLB.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'COM Test Client'; + Application.CreateForm(TCOM_MainForm, COM_MainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.dproj new file mode 100644 index 0000000..39271f5 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.dproj @@ -0,0 +1,73 @@ + + + {9c951f2c-b529-4e19-b099-06fda13e4bd6} + COMClient.dpr + Debug + AnyCPU + DCC32 + COMClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + COMClient.dpr + + + + + + + MainSource + + +
    COM_MainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COMClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM_Main.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM_Main.dfm new file mode 100644 index 0000000..9384062 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM_Main.dfm @@ -0,0 +1,48 @@ +object COM_MainForm: TCOM_MainForm + Left = 494 + Top = 271 + Width = 248 + Height = 191 + Caption = 'COM Test' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 11 + Top = 104 + Width = 212 + Height = 48 + Cursor = crHandPoint + ApplicationType = atClient + end + object SumButton: TButton + Left = 80 + Top = 8 + Width = 75 + Height = 25 + Caption = 'Sum' + TabOrder = 0 + OnClick = SumButtonClick + end + object TPersonButton: TButton + Left = 80 + Top = 40 + Width = 75 + Height = 25 + Caption = 'TPerson' + TabOrder = 1 + OnClick = TPersonButtonClick + end + object MultipleCallButton: TButton + Left = 80 + Top = 72 + Width = 75 + Height = 25 + Caption = 'Multiple calls' + Default = True + TabOrder = 2 + OnClick = MultipleCallButtonClick + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM_Main.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM_Main.pas new file mode 100644 index 0000000..bd0292e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/COM_Main.pas @@ -0,0 +1,93 @@ +unit COM_Main; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, uROPoweredByRemObjectsButton; + +type + TCOM_MainForm = class(TForm) + SumButton: TButton; + TPersonButton: TButton; + MultipleCallButton: TButton; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + procedure SumButtonClick(Sender: TObject); + procedure TPersonButtonClick(Sender: TObject); + procedure MultipleCallButtonClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + COM_MainForm: TCOM_MainForm; + +implementation + +uses ComObj, ROCOM_TLB; + +{$R *.dfm} + +procedure TCOM_MainForm.SumButtonClick(Sender: TObject); +var + roserver, + megademoservice: OleVariant; +begin + roserver := CreateOleObject('RemObjects.SDK.COMServer'); + + roserver.MessageType := 'BinMessage'; + roserver.ChannelType := 'HTTP'; + roserver.SetChannelProperty('TargetURL', 'http://localhost:8099/bin'); + + megademoservice := roserver.CreateService('MegaDemoService'); + + ShowMessage('The result is ' + VarToStr(megademoservice.Sum(1, 2))); +end; + +procedure TCOM_MainForm.TPersonButtonClick(Sender: TObject); +var + roserver, + megademoservice: OleVariant; + person: OleVariant; +begin + roserver := CreateOleObject('RemObjects.SDK.COMServer'); + + roserver.MessageType := 'BinMessage'; + roserver.ChannelType := 'HTTP'; + roserver.SetChannelProperty('TargetURL', 'http://localhost:8099/bin'); + + person := roserver.CreateComplexType('TPerson'); + person.FirstName := 'Peter'; + person.LastName := 'Miller'; + person.Age := 28; + + ShowMessage(person.FirstName + ' ' + person.LastName + ' ' + VarToStr(person.Age)); +end; + +procedure TCOM_MainForm.MultipleCallButtonClick(Sender: TObject); +var + roserver: IROCOMServer; + newservice: OleVariant; + person: OleVariant; +begin + roserver := CoROCOMServer.Create; + + roserver.MessageType := 'BinMessage'; + roserver.ChannelType := 'HTTP'; + roserver.SetChannelProperty('TargetURL', 'http://localhost:8099/bin'); + + person := roserver.CreateComplexType('TPerson'); + person.FirstName := 'Peter'; + person.LastName := 'Baker'; + ShowMessage(person.FirstName + ' ' + person.LastName); + + newservice := roserver.CreateService('MegaDemoService'); + + ShowMessage('The result is ' + IntToStr(newservice.Sum(101, 202))); + ShowMessage('The time on the server is ' + DateTimeToStr(newservice.GetServerTime)); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ExcelDemo.xls b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ExcelDemo.xls new file mode 100644 index 0000000..9488cf5 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ExcelDemo.xls differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ROASPDemo.asp b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ROASPDemo.asp new file mode 100644 index 0000000..56b9880 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ROASPDemo.asp @@ -0,0 +1,27 @@ + +<% +Dim result + +Set ROServer = Server.CreateObject("RemObjects.SDK.COMServer") +ROServer.MessageType = "TROBINMessage" +ROServer.ChannelType = "TROWinInetHTTPChannel" +ROServer.SetChannelProperty "TargetURL", "http://localhost:8099/BIN" + +Set MegaDemoService = ROServer.CreateService("MegaDemoService") + +Response.Write "This is an ASP page that invokes methods of the RemObjects MegaDemo
    " + +result = MegaDemoService.Sum(100, 200) +Response.Write "The result of 100+200 is " & result & "
    " + +result = MegaDemoService.GetServerTime +Response.Write "The time on the server is " & result + +Set MegaDemoService = nothing +Set ROServer = nothing + +%> \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ROCOM_TLB.dcr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ROCOM_TLB.dcr new file mode 100644 index 0000000..36f26e2 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ROCOM_TLB.dcr differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ROCOM_TLB.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ROCOM_TLB.pas new file mode 100644 index 0000000..aaba674 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/ROCOM_TLB.pas @@ -0,0 +1,238 @@ +unit ROCOM_TLB; + +// ************************************************************************ // +// WARNING +// ------- +// The types declared in this file were generated from data read from a +// Type Library. If this type library is explicitly or indirectly (via +// another type library referring to this type library) re-imported, or the +// 'Refresh' command of the Type Library Editor activated while editing the +// Type Library, the contents of this file will be regenerated and all +// manual modifications will be lost. +// ************************************************************************ // + +// PASTLWTR : $Revision:1.0$ +// File generated on 3/4/2004 1:47:40 AM from Type Library described below. + +// ************************************************************************ // +// Type Lib: C:\Dev\ROSDK3\Bin\ROCOM.dll (1) +// LIBID: {FC2EC537-E5F2-4C65-82EA-AF94C4AA742B} +// LCID: 0 +// Helpfile: +// DepndLst: +// (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb) +// (2) v4.0 StdVCL, (C:\WINDOWS\system32\stdvcl40.dll) +// ************************************************************************ // +{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. +{$WARN SYMBOL_PLATFORM OFF} +{$WRITEABLECONST ON} +{$VARPROPSETTER ON} +interface + +uses Windows, ActiveX, Classes, Graphics, OleServer, StdVCL, Variants; + + +// *********************************************************************// +// GUIDS declared in the TypeLibrary. Following prefixes are used: +// Type Libraries : LIBID_xxxx +// CoClasses : CLASS_xxxx +// DISPInterfaces : DIID_xxxx +// Non-DISP interfaces: IID_xxxx +// *********************************************************************// +const + // TypeLibrary Major and minor versions + ROCOMMajorVersion = 1; + ROCOMMinorVersion = 0; + + LIBID_ROCOM: TGUID = '{FC2EC537-E5F2-4C65-82EA-AF94C4AA742B}'; + + IID_IROCOMServer: TGUID = '{B59C6504-BAEC-41D3-8740-B8EF6BC8630F}'; + CLASS_ROCOMServer: TGUID = '{886FF65A-00E0-4D12-8FB3-0129F03842C0}'; + IID_IROCOMArray: TGUID = '{52F2EA1A-ABDB-4124-9BDE-6B49105A92E9}'; + IID_IROCOMBinary: TGUID = '{C2B18A45-04B9-45D8-A84F-DACD2FBABAF8}'; + CLASS_ROCOMBinaryTypeWrapper: TGUID = '{3B24E151-81FC-4EA6-BD91-C602499963F7}'; + CLASS_ROCOMArrayTypeWrapper: TGUID = '{CFF986AA-6C4A-417F-B688-84CCF32FE0F0}'; +type + +// *********************************************************************// +// Forward declaration of types defined in TypeLibrary +// *********************************************************************// + IROCOMServer = interface; + IROCOMServerDisp = dispinterface; + IROCOMArray = interface; + IROCOMArrayDisp = dispinterface; + IROCOMBinary = interface; + IROCOMBinaryDisp = dispinterface; + +// *********************************************************************// +// Declaration of CoClasses defined in Type Library +// (NOTE: Here we map each CoClass to its Default Interface) +// *********************************************************************// + ROCOMServer = IROCOMServer; + ROCOMBinaryTypeWrapper = IROCOMBinary; + ROCOMArrayTypeWrapper = IROCOMArray; + + +// *********************************************************************// +// Interface: IROCOMServer +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {B59C6504-BAEC-41D3-8740-B8EF6BC8630F} +// *********************************************************************// + IROCOMServer = interface(IDispatch) + ['{B59C6504-BAEC-41D3-8740-B8EF6BC8630F}'] + function CreateService(const ServiceName: WideString): OleVariant; safecall; + function CreateComplexType(const ComplexTypeName: WideString): OleVariant; safecall; + function CreateArrayType(const aArrayTypeName: WideString): OleVariant; safecall; + function CreateBinaryType: OleVariant; safecall; + function Get_ChannelType: WideString; safecall; + procedure Set_ChannelType(const Value: WideString); safecall; + function Get_MessageType: WideString; safecall; + procedure Set_MessageType(const Value: WideString); safecall; + procedure SetChannelProperty(const Name: WideString; Value: OleVariant); safecall; + procedure SetMessageProperty(const Name: WideString; Value: OleVariant); safecall; + function GetChannelProperty(const Name: WideString): OleVariant; safecall; + function GetMessageProperty(const Name: WideString): OleVariant; safecall; + property ChannelType: WideString read Get_ChannelType write Set_ChannelType; + property MessageType: WideString read Get_MessageType write Set_MessageType; + end; + +// *********************************************************************// +// DispIntf: IROCOMServerDisp +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {B59C6504-BAEC-41D3-8740-B8EF6BC8630F} +// *********************************************************************// + IROCOMServerDisp = dispinterface + ['{B59C6504-BAEC-41D3-8740-B8EF6BC8630F}'] + function CreateService(const ServiceName: WideString): OleVariant; dispid 1; + function CreateComplexType(const ComplexTypeName: WideString): OleVariant; dispid 2; + function CreateArrayType(const aArrayTypeName: WideString): OleVariant; dispid 147; + function CreateBinaryType: OleVariant; dispid 4; + property ChannelType: WideString dispid 8; + property MessageType: WideString dispid 9; + procedure SetChannelProperty(const Name: WideString; Value: OleVariant); dispid 10; + procedure SetMessageProperty(const Name: WideString; Value: OleVariant); dispid 11; + function GetChannelProperty(const Name: WideString): OleVariant; dispid 12; + function GetMessageProperty(const Name: WideString): OleVariant; dispid 13; + end; + +// *********************************************************************// +// Interface: IROCOMArray +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {52F2EA1A-ABDB-4124-9BDE-6B49105A92E9} +// *********************************************************************// + IROCOMArray = interface(IDispatch) + ['{52F2EA1A-ABDB-4124-9BDE-6B49105A92E9}'] + function Get_Count: Integer; safecall; + procedure Set_Count(Value: Integer); safecall; + procedure SetValue(aIndex: Integer; aValue: OleVariant); safecall; + function GetValue(aIndex: Integer): OleVariant; safecall; + property Count: Integer read Get_Count write Set_Count; + end; + +// *********************************************************************// +// DispIntf: IROCOMArrayDisp +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {52F2EA1A-ABDB-4124-9BDE-6B49105A92E9} +// *********************************************************************// + IROCOMArrayDisp = dispinterface + ['{52F2EA1A-ABDB-4124-9BDE-6B49105A92E9}'] + property Count: Integer dispid 1; + procedure SetValue(aIndex: Integer; aValue: OleVariant); dispid 2; + function GetValue(aIndex: Integer): OleVariant; dispid 3; + end; + +// *********************************************************************// +// Interface: IROCOMBinary +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {C2B18A45-04B9-45D8-A84F-DACD2FBABAF8} +// *********************************************************************// + IROCOMBinary = interface(IDispatch) + ['{C2B18A45-04B9-45D8-A84F-DACD2FBABAF8}'] + procedure LoadFromFile(const aFilename: WideString); safecall; + procedure SaveToFile(const aFilename: WideString); safecall; + function ToString: WideString; safecall; + end; + +// *********************************************************************// +// DispIntf: IROCOMBinaryDisp +// Flags: (4416) Dual OleAutomation Dispatchable +// GUID: {C2B18A45-04B9-45D8-A84F-DACD2FBABAF8} +// *********************************************************************// + IROCOMBinaryDisp = dispinterface + ['{C2B18A45-04B9-45D8-A84F-DACD2FBABAF8}'] + procedure LoadFromFile(const aFilename: WideString); dispid 1; + procedure SaveToFile(const aFilename: WideString); dispid 2; + function ToString: WideString; dispid 201; + end; + +// *********************************************************************// +// The Class CoROCOMServer provides a Create and CreateRemote method to +// create instances of the default interface IROCOMServer exposed by +// the CoClass ROCOMServer. The functions are intended to be used by +// clients wishing to automate the CoClass objects exposed by the +// server of this typelibrary. +// *********************************************************************// + CoROCOMServer = class + class function Create: IROCOMServer; + class function CreateRemote(const MachineName: string): IROCOMServer; + end; + +// *********************************************************************// +// The Class CoROCOMBinaryTypeWrapper provides a Create and CreateRemote method to +// create instances of the default interface IROCOMBinary exposed by +// the CoClass ROCOMBinaryTypeWrapper. The functions are intended to be used by +// clients wishing to automate the CoClass objects exposed by the +// server of this typelibrary. +// *********************************************************************// + CoROCOMBinaryTypeWrapper = class + class function Create: IROCOMBinary; + class function CreateRemote(const MachineName: string): IROCOMBinary; + end; + +// *********************************************************************// +// The Class CoROCOMArrayTypeWrapper provides a Create and CreateRemote method to +// create instances of the default interface IROCOMArray exposed by +// the CoClass ROCOMArrayTypeWrapper. The functions are intended to be used by +// clients wishing to automate the CoClass objects exposed by the +// server of this typelibrary. +// *********************************************************************// + CoROCOMArrayTypeWrapper = class + class function Create: IROCOMArray; + class function CreateRemote(const MachineName: string): IROCOMArray; + end; + +implementation + +uses ComObj; + +class function CoROCOMServer.Create: IROCOMServer; +begin + Result := CreateComObject(CLASS_ROCOMServer) as IROCOMServer; +end; + +class function CoROCOMServer.CreateRemote(const MachineName: string): IROCOMServer; +begin + Result := CreateRemoteComObject(MachineName, CLASS_ROCOMServer) as IROCOMServer; +end; + +class function CoROCOMBinaryTypeWrapper.Create: IROCOMBinary; +begin + Result := CreateComObject(CLASS_ROCOMBinaryTypeWrapper) as IROCOMBinary; +end; + +class function CoROCOMBinaryTypeWrapper.CreateRemote(const MachineName: string): IROCOMBinary; +begin + Result := CreateRemoteComObject(MachineName, CLASS_ROCOMBinaryTypeWrapper) as IROCOMBinary; +end; + +class function CoROCOMArrayTypeWrapper.Create: IROCOMArray; +begin + Result := CreateComObject(CLASS_ROCOMArrayTypeWrapper) as IROCOMArray; +end; + +class function CoROCOMArrayTypeWrapper.CreateRemote(const MachineName: string): IROCOMArray; +begin + Result := CreateRemoteComObject(MachineName, CLASS_ROCOMArrayTypeWrapper) as IROCOMArray; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/Test.vbs b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/Test.vbs new file mode 100644 index 0000000..e624596 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/COM/Test.vbs @@ -0,0 +1,19 @@ +Dim result + +MsgBox "Please run \Samples\MegaDemo\MegaDemoServer.exe and activate HTTP server" + +Set ROServer = CreateObject("RemObjects.SDK.COMServer") +ROServer.MessageType = "TROBINMessage" +ROServer.ChannelType = "TROWinInetHTTPChannel" +ROServer.SetChannelProperty "TargetURL", "http://localhost:8099/BIN" + +Set MegaDemoService = ROServer.CreateService("MegaDemoService") + +result = MegaDemoService.Sum(100, 200) +MsgBox "The result was [" & result & "]" + +result = MegaDemoService.GetServerTime +MsgBox "The result was [" & result & "]" + +Set MegaDemoService = nothing +Set ROServer = nothing \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.Sample.html new file mode 100644 index 0000000..48ee2ce --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.Sample.html @@ -0,0 +1,41 @@ + + + + + + + + + +

    + Class Factories +

    + +

    Purpose

    This example shows how to use a Class Factory to generate three types of +server:

    +
      +
    • Singleton: all clients access a single server object.
    • +
    • Single Call: server instances are created on demand and destroyed after processing the method call.
    • +
    • Pooled: multiple server instances are accessible by clients. This + factory works exactly the same as Singleton, unless the first server instance is + busy.
    +

    + Note: to test this sample properly, you need to run at least two clients. +

    +

    +

    +

    + Examine the Code

    +
      +
    • See how the three services were defined by editing the service library. Do this by making the server +the selected project and by using the menu option: RemObjects | Edit Service Library. +
      + Note: if you don't see this menu option but see 'Service Builder' instead, +you still have the client set as the current project.
    • +
    • The implementation of the three server types is held in three Impl.pas files: SingletonService_Impl, +SingleCallService_Impl and PooledService_Impl.
    • +
    • Examine the simple code needed to invoke the methods in ClassFactoryClientMain.pas.
    • +
    + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.bdsgroup new file mode 100644 index 0000000..e719d18 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + ClassFactoryServer.bdsproj + ClassFactoryClient.bdsproj + ClassFactoryServer.exe ClassFactoryClient.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.bpg new file mode 100644 index 0000000..fb0e659 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = ClassFactoryServer.exe ClassFactoryClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +ClassFactoryClient.exe: ClassFactoryClient.dpr + $(DCC) + +ClassFactoryServer.exe: ClassFactoryServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.groupproj new file mode 100644 index 0000000..e7a1a2a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactories.groupproj @@ -0,0 +1,40 @@ + + + {0fdd2da8-7771-46ec-80ff-8029ed719481} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.bdsproj new file mode 100644 index 0000000..115a19e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ClassFactoryClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.dpr new file mode 100644 index 0000000..e737c09 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.dpr @@ -0,0 +1,14 @@ +program ClassFactoryClient; + +uses + Forms, + ClassFactoryClientMain in 'ClassFactoryClientMain.pas' {ClassFactoryClientMainForm}, + ClassFactoryLibrary_Intf in 'ClassFactoryLibrary_Intf.pas'; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TClassFactoryClientMainForm, ClassFactoryClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.dproj new file mode 100644 index 0000000..f66fcd7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.dproj @@ -0,0 +1,73 @@ + + + {88e5029b-cc75-4d02-aca4-f516bd0f5012} + ClassFactoryClient.dpr + Debug + AnyCPU + DCC32 + ClassFactoryClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ClassFactoryClient.dpr + + + + + + + MainSource + + +
    ClassFactoryClientMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClientMain.dfm new file mode 100644 index 0000000..6e746c1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClientMain.dfm @@ -0,0 +1,159 @@ +object ClassFactoryClientMainForm: TClassFactoryClientMainForm + Left = 89 + Top = 114 + AutoScroll = False + Caption = 'Class Factory Client' + ClientHeight = 338 + ClientWidth = 445 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object GroupBox1: TGroupBox + Left = 8 + Top = 8 + Width = 433 + Height = 105 + Caption = 'Singleton Class Factory' + TabOrder = 0 + object Label1: TLabel + Left = 187 + Top = 33 + Width = 233 + Height = 39 + Caption = + 'Singleton: this server side object is created only once. If you ' + + 'Set a value all clients connected will Get the same.' + WordWrap = True + end + object seSingleton: TSpinEdit + Left = 27 + Top = 32 + Width = 121 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 0 + end + object SingletonGetButton: TButton + Left = 11 + Top = 64 + Width = 75 + Height = 25 + Caption = 'Get' + TabOrder = 1 + OnClick = SingletonGetButtonClick + end + object SingletonSetButton: TButton + Left = 91 + Top = 64 + Width = 75 + Height = 25 + Caption = 'Set' + TabOrder = 2 + OnClick = SingletonSetButtonClick + end + end + object GroupBox2: TGroupBox + Left = 8 + Top = 120 + Width = 433 + Height = 105 + Caption = 'Single-Call Class Factory' + TabOrder = 1 + object Label2: TLabel + Left = 188 + Top = 27 + Width = 233 + Height = 52 + Caption = + 'Single-Call (base class factory): all instances are created on d' + + 'emand and destroyed at the end of the method call. This is the p' + + 'referred class factory if you need high scalability and fail-ove' + + 'r.' + WordWrap = True + end + object seSingleCall: TSpinEdit + Left = 27 + Top = 32 + Width = 121 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 0 + end + object SingleCallSetButton: TButton + Left = 50 + Top = 61 + Width = 75 + Height = 25 + Caption = 'Set' + TabOrder = 1 + OnClick = SingleCallSetButtonClick + end + end + object GroupBox3: TGroupBox + Left = 8 + Top = 232 + Width = 433 + Height = 105 + Caption = 'Pooled Class Factory' + TabOrder = 2 + object Label3: TLabel + Left = 188 + Top = 20 + Width = 233 + Height = 65 + Caption = + 'Pooled Class Factory: two instances of the server side object ar' + + 'e being pooled. See how you access a different object by setting' + + ' two different values (i.e. 1 and 2 ) and then clicking on the G' + + 'et button multiple times from different clients.' + WordWrap = True + end + object spPooled: TSpinEdit + Left = 27 + Top = 32 + Width = 121 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 0 + end + object PooledGetButton: TButton + Left = 11 + Top = 64 + Width = 75 + Height = 25 + Caption = 'Get' + TabOrder = 1 + OnClick = PooledGetButtonClick + end + object PooledSetButton: TButton + Left = 91 + Top = 64 + Width = 75 + Height = 25 + Caption = 'Set' + TabOrder = 2 + OnClick = PooledSetButtonClick + end + end + object ROBINMessage: TROBinMessage + Left = 64 + Top = 16 + end + object ROIndyTCPChannel: TROIndyTCPChannel + ServerLocators = <> + DispatchOptions = [] + Port = 8090 + Host = '127.0.0.1' + Left = 104 + Top = 16 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClientMain.pas new file mode 100644 index 0000000..40fdfaf --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryClientMain.pas @@ -0,0 +1,85 @@ +unit ClassFactoryClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + uROWinMessageChannel, StdCtrls, Spin, + uROClient, uROBINMessage, uROIndyTCPChannel; + +type + TClassFactoryClientMainForm = class(TForm) + GroupBox1: TGroupBox; + seSingleton: TSpinEdit; + SingletonGetButton: TButton; + SingletonSetButton: TButton; + ROBINMessage: TROBINMessage; + GroupBox2: TGroupBox; + seSingleCall: TSpinEdit; + SingleCallSetButton: TButton; + GroupBox3: TGroupBox; + spPooled: TSpinEdit; + PooledGetButton: TButton; + PooledSetButton: TButton; + Label1: TLabel; + Label2: TLabel; + Label3: TLabel; + ROIndyTCPChannel: TROIndyTCPChannel; + procedure SingletonGetButtonClick(Sender: TObject); + procedure SingleCallGetButtonClick(Sender: TObject); + procedure SingletonSetButtonClick(Sender: TObject); + procedure SingleCallSetButtonClick(Sender: TObject); + procedure PooledGetButtonClick(Sender: TObject); + procedure PooledSetButtonClick(Sender: TObject); + private + + public + + end; + +var + ClassFactoryClientMainForm: TClassFactoryClientMainForm; + +implementation + +uses ClassFactoryLibrary_Intf; + +{$R *.DFM} + +procedure TClassFactoryClientMainForm.SingletonGetButtonClick(Sender: TObject); +begin + with CoSingletonService.Create(ROBINMessage, ROIndyTCPChannel) do + ShowMessage(IntToStr(GetValue)); +end; + +procedure TClassFactoryClientMainForm.SingletonSetButtonClick(Sender: TObject); +begin + with CoSingletonService.Create(ROBINMessage, ROIndyTCPChannel) do + SetValue(seSingleton.Value); +end; + +procedure TClassFactoryClientMainForm.SingleCallGetButtonClick(Sender: TObject); +begin + with CoSingleCallService.Create(ROBINMessage, ROIndyTCPChannel) do + ShowMessage(IntToStr(GetValue)); +end; + +procedure TClassFactoryClientMainForm.SingleCallSetButtonClick(Sender: TObject); +begin + with CoSingleCallService.Create(ROBINMessage, ROIndyTCPChannel) do + SetValue(seSingleton.Value); +end; + +procedure TClassFactoryClientMainForm.PooledGetButtonClick(Sender: TObject); +begin + with CoPooledService.Create(ROBINMessage, ROIndyTCPChannel) do + ShowMessage(IntToStr(GetValue)); +end; + +procedure TClassFactoryClientMainForm.PooledSetButtonClick(Sender: TObject); +begin + with CoPooledService.Create(ROBINMessage, ROIndyTCPChannel) do + SetValue(spPooled.Value); +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryLibrary.RODL b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryLibrary.RODL new file mode 100644 index 0000000..54e4037 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryLibrary.RODL @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryLibrary_Intf.pas new file mode 100644 index 0000000..5d5dd80 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryLibrary_Intf.pas @@ -0,0 +1,241 @@ +unit ClassFactoryLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{52396EB8-14AA-4307-84B1-3608886221E7}'; + + { Service Interface ID's } + ISingletonService_IID : TGUID = '{52396EB8-14AA-4307-84B1-3608886221E7}'; + ISingleCallService_IID : TGUID = '{00000000-0000-0000-0000-000000000000}'; + IPooledService_IID : TGUID = '{D0A3AE95-EDE8-4B0B-B832-11894E941F8E}'; + + { Event ID's } + +type + { Forward declarations } + ISingletonService = interface; + ISingleCallService = interface; + IPooledService = interface; + + + { ISingletonService } + ISingletonService = interface + ['{52396EB8-14AA-4307-84B1-3608886221E7}'] + function GetValue: Integer; + procedure SetValue(const aValue: Integer); + end; + + { CoSingletonService } + CoSingletonService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ISingletonService; + end; + + { TSingletonService_Proxy } + TSingletonService_Proxy = class(TROProxy, ISingletonService) + protected + function __GetInterfaceName:string; override; + + function GetValue: Integer; + procedure SetValue(const aValue: Integer); + end; + + { ISingleCallService } + ISingleCallService = interface + ['{00000000-0000-0000-0000-000000000000}'] + function GetValue: Integer; + procedure SetValue(const aValue: Integer); + end; + + { CoSingleCallService } + CoSingleCallService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ISingleCallService; + end; + + { TSingleCallService_Proxy } + TSingleCallService_Proxy = class(TROProxy, ISingleCallService) + protected + function __GetInterfaceName:string; override; + + function GetValue: Integer; + procedure SetValue(const aValue: Integer); + end; + + { IPooledService } + IPooledService = interface + ['{D0A3AE95-EDE8-4B0B-B832-11894E941F8E}'] + function GetValue: Integer; + procedure SetValue(const aValue: Integer); + end; + + { CoPooledService } + CoPooledService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IPooledService; + end; + + { TPooledService_Proxy } + TPooledService_Proxy = class(TROProxy, IPooledService) + protected + function __GetInterfaceName:string; override; + + function GetValue: Integer; + procedure SetValue(const aValue: Integer); + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoSingletonService } + +class function CoSingletonService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ISingletonService; +begin + result := TSingletonService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TSingletonService_Proxy } + +function TSingletonService_Proxy.__GetInterfaceName:string; +begin + result := 'SingletonService'; +end; + +function TSingletonService_Proxy.GetValue: Integer; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ClassFactoryLibrary', __InterfaceName, 'GetValue'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Integer), result, []); + finally + __Message.FreeStream; + end +end; + +procedure TSingletonService_Proxy.SetValue(const aValue: Integer); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ClassFactoryLibrary', __InterfaceName, 'SetValue'); + __Message.Write('aValue', TypeInfo(Integer), aValue, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.FreeStream; + end +end; + +{ CoSingleCallService } + +class function CoSingleCallService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ISingleCallService; +begin + result := TSingleCallService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TSingleCallService_Proxy } + +function TSingleCallService_Proxy.__GetInterfaceName:string; +begin + result := 'SingleCallService'; +end; + +function TSingleCallService_Proxy.GetValue: Integer; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ClassFactoryLibrary', __InterfaceName, 'GetValue'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Integer), result, []); + finally + __Message.FreeStream; + end +end; + +procedure TSingleCallService_Proxy.SetValue(const aValue: Integer); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ClassFactoryLibrary', __InterfaceName, 'SetValue'); + __Message.Write('aValue', TypeInfo(Integer), aValue, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.FreeStream; + end +end; + +{ CoPooledService } + +class function CoPooledService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IPooledService; +begin + result := TPooledService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TPooledService_Proxy } + +function TPooledService_Proxy.__GetInterfaceName:string; +begin + result := 'PooledService'; +end; + +function TPooledService_Proxy.GetValue: Integer; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ClassFactoryLibrary', __InterfaceName, 'GetValue'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Integer), result, []); + finally + __Message.FreeStream; + end +end; + +procedure TPooledService_Proxy.SetValue(const aValue: Integer); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ClassFactoryLibrary', __InterfaceName, 'SetValue'); + __Message.Write('aValue', TypeInfo(Integer), aValue, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(ISingletonService_IID, TSingletonService_Proxy); + RegisterProxyClass(ISingleCallService_IID, TSingleCallService_Proxy); + RegisterProxyClass(IPooledService_IID, TPooledService_Proxy); + + +finalization + UnregisterProxyClass(ISingletonService_IID); + UnregisterProxyClass(ISingleCallService_IID); + UnregisterProxyClass(IPooledService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryLibrary_Invk.pas new file mode 100644 index 0000000..60fa260 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryLibrary_Invk.pas @@ -0,0 +1,159 @@ +unit ClassFactoryLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} ClassFactoryLibrary_Intf; + +type + TSingletonService_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_GetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_SetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + + TSingleCallService_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_GetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_SetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + + TPooledService_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_GetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_SetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TSingletonService_Invoker } + +procedure TSingletonService_Invoker.Invoke_GetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetValue: Integer; } +var + lResult: Integer; +begin + try + lResult := (__Instance as ISingletonService).GetValue; + + __Message.InitializeResponseMessage(__Transport, 'ClassFactoryLibrary', 'SingletonService', 'GetValueResponse'); + __Message.Write('Result', TypeInfo(Integer), lResult, []); + __Message.Finalize; + + finally + end; +end; + +procedure TSingletonService_Invoker.Invoke_SetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure SetValue(const aValue: Integer); } +var + aValue: Integer; +begin + try + __Message.Read('aValue', TypeInfo(Integer), aValue, []); + + (__Instance as ISingletonService).SetValue(aValue); + + __Message.InitializeResponseMessage(__Transport, 'ClassFactoryLibrary', 'SingletonService', 'SetValueResponse'); + __Message.Finalize; + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +{ TSingleCallService_Invoker } + +procedure TSingleCallService_Invoker.Invoke_GetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetValue: Integer; } +var + lResult: Integer; +begin + try + lResult := (__Instance as ISingleCallService).GetValue; + + __Message.InitializeResponseMessage(__Transport, 'ClassFactoryLibrary', 'SingleCallService', 'GetValueResponse'); + __Message.Write('Result', TypeInfo(Integer), lResult, []); + __Message.Finalize; + + finally + end; +end; + +procedure TSingleCallService_Invoker.Invoke_SetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure SetValue(const aValue: Integer); } +var + aValue: Integer; +begin + try + __Message.Read('aValue', TypeInfo(Integer), aValue, []); + + (__Instance as ISingleCallService).SetValue(aValue); + + __Message.InitializeResponseMessage(__Transport, 'ClassFactoryLibrary', 'SingleCallService', 'SetValueResponse'); + __Message.Finalize; + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +{ TPooledService_Invoker } + +procedure TPooledService_Invoker.Invoke_GetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetValue: Integer; } +var + lResult: Integer; +begin + try + lResult := (__Instance as IPooledService).GetValue; + + __Message.InitializeResponseMessage(__Transport, 'ClassFactoryLibrary', 'PooledService', 'GetValueResponse'); + __Message.Write('Result', TypeInfo(Integer), lResult, []); + __Message.Finalize; + + finally + end; +end; + +procedure TPooledService_Invoker.Invoke_SetValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure SetValue(const aValue: Integer); } +var + aValue: Integer; +begin + try + __Message.Read('aValue', TypeInfo(Integer), aValue, []); + + (__Instance as IPooledService).SetValue(aValue); + + __Message.InitializeResponseMessage(__Transport, 'ClassFactoryLibrary', 'PooledService', 'SetValueResponse'); + __Message.Finalize; + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.bdsproj new file mode 100644 index 0000000..347e889 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ClassFactoryServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.dpr new file mode 100644 index 0000000..7d920c1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.dpr @@ -0,0 +1,22 @@ +program ClassFactoryServer; + +{#ROGEN:ClassFactoryLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + Forms, + ClassFactoryServerMain in 'ClassFactoryServerMain.pas' {ClassFactoryServerMainForm}, + ClassFactoryLibrary_Intf in 'ClassFactoryLibrary_Intf.pas', + ClassFactoryLibrary_Invk in 'ClassFactoryLibrary_Invk.pas', + SingletonService_Impl in 'SingletonService_Impl.pas', + SingleCallService_Impl in 'SingleCallService_Impl.pas', + PooledService_Impl in 'PooledService_Impl.pas'; + +{$R *.RES} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'Class Factories Server'; + Application.CreateForm(TClassFactoryServerMainForm, ClassFactoryServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.dproj new file mode 100644 index 0000000..5eeddf2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.dproj @@ -0,0 +1,77 @@ + + + {f93039eb-3d72-4834-a1b2-ff8e267d9a0c} + ClassFactoryServer.dpr + Debug + AnyCPU + DCC32 + ClassFactoryServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ClassFactoryServer.dpr + + + + + + + MainSource + + + + +
    ClassFactoryServerMainForm
    +
    + + + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.res new file mode 100644 index 0000000..1cabf6e Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServerMain.dfm new file mode 100644 index 0000000..40b5f7a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServerMain.dfm @@ -0,0 +1,44 @@ +object ClassFactoryServerMainForm: TClassFactoryServerMainForm + Left = 382 + Top = 238 + AutoScroll = False + Caption = 'Class Factory Server' + ClientHeight = 101 + ClientWidth = 254 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 14 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 21 + Top = 10 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Button1: TButton + Left = 85 + Top = 66 + Width = 75 + Height = 25 + Caption = 'Activate' + TabOrder = 0 + OnClick = Button1Click + end + object ROMessage: TROBinMessage + Left = 104 + Top = 16 + end + object ROServer: TROIndyTCPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + end> + Port = 8090 + Left = 136 + Top = 16 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServerMain.pas new file mode 100644 index 0000000..15cc8a5 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/ClassFactoryServerMain.pas @@ -0,0 +1,41 @@ +unit ClassFactoryServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StrUtils, + StdCtrls, uROClient, uROBINMessage, uROClientIntf, uROServer, uROWinMessageServer, + uROIndyTCPServer, uROPoweredByRemObjectsButton; + +type + TClassFactoryServerMainForm = class(TForm) + ROMessage: TROBINMessage; + Button1: TButton; + ROServer: TROIndyTCPServer; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + procedure Button1Click(Sender: TObject); + private + + protected + + public + + end; + +var + ClassFactoryServerMainForm: TClassFactoryServerMainForm; + +implementation + + +{$R *.DFM} + +procedure TClassFactoryServerMainForm.Button1Click(Sender: TObject); +begin + ROServer.Active := ROServer.Active XOR TRUE; + + Button1.Caption := IfThen(ROServer.Active,'Deactivate','Activate'); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/PooledService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/PooledService_Impl.pas new file mode 100644 index 0000000..f49872d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/PooledService_Impl.pas @@ -0,0 +1,52 @@ +unit PooledService_Impl; + +interface + +uses Classes, uROClientIntf, uROServer, uROServerIntf, ClassFactoryLibrary_Intf; + +type + TPooledService = class(TRORemotable, IPooledService) + private + fValue: integer; + + protected + function GetValue: Integer; + procedure SetValue(const aValue: Integer); + public + constructor Create; override; + end; + +implementation + +uses uROClassFactories, ClassFactoryLibrary_Invk, Dialogs; + +procedure Create_PooledService(out anInstance: IUnknown); +begin + anInstance := TPooledService.Create; +end; + +constructor TPooledService.Create; +begin + inherited; + FValue := 0; +end; + +function TPooledService.GetValue: Integer; +begin + MessageDlg('GetValue executing...', mtWarning, [mbOK], 0); + result := fValue; +end; + +procedure TPooledService.SetValue(const aValue: Integer); +begin + MessageDlg('SetValue executing...', mtWarning, [mbOK], 0); + fValue := aValue; +end; + +initialization + TROPooledClassFactory.Create('PooledService', Create_PooledService, TPooledService_Invoker, 2); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/RODLFile.RES b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/RODLFile.RES new file mode 100644 index 0000000..a73bc69 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/RODLFile.RES differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/SingleCallService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/SingleCallService_Impl.pas new file mode 100644 index 0000000..476dc5e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/SingleCallService_Impl.pas @@ -0,0 +1,51 @@ +unit SingleCallService_Impl; + +interface + +uses Classes, uROClientIntf, uROServer, uROServerIntf, ClassFactoryLibrary_Intf; + +type + TSingleCallService = class(TRORemotable, ISingleCallService) + private + fValue : integer; + + protected + function GetValue: Integer; + procedure SetValue(const aValue: Integer); + + public + constructor Create; override; + + end; + +implementation + +uses ClassFactoryLibrary_Invk; + +procedure Create_SingleCallService(out anInstance : IUnknown); +begin + anInstance := TSingleCallService.Create; +end; + +constructor TSingleCallService.Create; +begin + inherited; + fValue := 0; +end; + +function TSingleCallService.GetValue: Integer; +begin + result := fValue; +end; + +procedure TSingleCallService.SetValue(const aValue: Integer); +begin + fValue := aValue; +end; + +initialization + TROClassFactory.Create('SingleCallService', Create_SingleCallService, TSingleCallService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/SingletonService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/SingletonService_Impl.pas new file mode 100644 index 0000000..816c004 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Class Factories/SingletonService_Impl.pas @@ -0,0 +1,54 @@ +unit SingletonService_Impl; + +interface + +uses Classes, uROClientIntf, uROServer, uROServerIntf, ClassFactoryLibrary_Intf; + +type + TSingletonService = class(TRORemotable, ISingletonService) + private + fValue : integer; + + protected + procedure SetValue(const aValue: Integer); + function GetValue: Integer; + + public + constructor Create; override; + + end; + +implementation + +uses uROClassFactories, ClassFactoryLibrary_Invk; + +procedure Create_SingletonService(out anInstance : IUnknown); +begin + anInstance := TSingletonService.Create; +end; + +{ TSingletonService } + +constructor TSingletonService.Create; +begin + inherited; + + fValue := 0; +end; + +function TSingletonService.GetValue: Integer; +begin + result := fValue +end; + +procedure TSingletonService.SetValue(const aValue: Integer); +begin + fValue := aValue +end; + +initialization + TROSingletonClassFactory.Create('SingletonService', Create_SingletonService, TSingletonService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.Sample.html new file mode 100644 index 0000000..06e1a3d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.Sample.html @@ -0,0 +1,29 @@ + + + + + + + + + +

    + DataSnap Sample +

    + + +

    Purpose

    + +

    This example illustrates the use of different the TRODataSnapModule simultaneously in the server application and use of the +TRODataSnapConnection in the client application.

    + +

    Examine the Code

    +
      +
    • Look at DataSnapServerInterfaces.pas where are declared new interfaces, descendants from IAppServer.
    • +
    • Look at DataSnapServerData.pas, DataSnapServerData2.pas and examine how we use above declared interfaces.
    • +
    • Look at DataSnapClientMain.pas an examine how we use these interfaces in TRODataSnapConnection.
    • +
    + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.bdsgroup new file mode 100644 index 0000000..42f0844 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.bdsgroup @@ -0,0 +1,21 @@ + + + + + + + + + + + + + DataSnapServer.bdsproj + DataSnapClient.bdsproj + DataSnapIsapiServer.bdsproj + DataSnapServer.exe DataSnapClient.exe DataSnapIsapiServer.dll + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.bpg new file mode 100644 index 0000000..cc8f7c1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.bpg @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = DataSnapServer.exe DataSnapClient.exe DataSnapIsapiServer.dll +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +DataSnapServer.exe: DataSnapServer.dpr + $(DCC) + +DataSnapClient.exe: DataSnapClient.dpr + $(DCC) + +DataSnapIsapiServer.dll: DataSnapIsapiServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.groupproj new file mode 100644 index 0000000..6d7a092 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnap.groupproj @@ -0,0 +1,49 @@ + + + {9e762aad-5388-4744-8d43-255109c69ecb} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.bdsproj new file mode 100644 index 0000000..9c6dce3 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DataSnapClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.dpr new file mode 100644 index 0000000..55f8e67 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.dpr @@ -0,0 +1,14 @@ +program DataSnapClient; + +uses + Forms, + DataSnapClientMain in 'DataSnapClientMain.pas' {DataSnapClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'DataSnap Client'; + Application.CreateForm(TDataSnapClientMainForm, DataSnapClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.dproj new file mode 100644 index 0000000..bf3e708 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.dproj @@ -0,0 +1,72 @@ + + + {2a59077b-565f-4079-9526-6a78fa7543c5} + DataSnapClient.dpr + Debug + AnyCPU + DCC32 + DataSnapClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + DataSnapClient.dpr + + + + + + + MainSource + + +
    DataSnapClientMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClientMain.dfm new file mode 100644 index 0000000..58dc891 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClientMain.dfm @@ -0,0 +1,265 @@ +object DataSnapClientMainForm: TDataSnapClientMainForm + Left = 394 + Top = 217 + Width = 518 + Height = 361 + Caption = 'RemObjects DataSnap Client' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object ConnectButton: TBitBtn + Left = 8 + Top = 8 + Width = 113 + Height = 25 + Caption = 'Connect' + TabOrder = 0 + OnClick = ConnectButtonClick + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000120B0000120B00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FF811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00 + 811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00811E00811E00FF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF811E0095440F811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00A7632F811E0081 + 1E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF811E00BF8B62CCA17E811E00811E00FF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00D8 + B69CE6D1BFE7D3C4811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FF811E00F0E2D9FCF7F2FAF0E6811E00811E + 00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00D8AF96F4E2CFF0D7BDD8A784811E00811E00FF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FF811E00F3DECAEFD4B8EBC9A7DAA67D811E00FF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00E7BB92E3B081E0A672D5925A811E00FF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00DA995ED78F50D38441CF7B + 35811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FF811E00811E00811E00811E00811E00811E00FF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + end + object DisconnectButton: TBitBtn + Left = 8 + Top = 8 + Width = 113 + Height = 25 + Caption = 'Disconnect' + TabOrder = 1 + Visible = False + OnClick = DisconnectButtonClick + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000120B0000120B00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00006E00006EFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00006E0000 + 6EFF00FFFF00FFFF00FFFF00FFFF00FF00006E001DE80010DC00006EFF00FFFF + 00FFFF00FFFF00FF00006E0004E20008E700006EFF00FFFF00FFFF00FFFF00FF + 00006E001AE2001FEB0010D900006EFF00FFFF00FF00006E0005DF0009EB0003 + DB00006EFF00FFFF00FFFF00FFFF00FFFF00FF00006E001ADF0020EB0013DC00 + 006E00006E0005E2000BEB0004DA00006EFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00006E001BDF0022EB0012E60008EA0009EB0004DF00006EFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00006E001BE300 + 16EB0011EB000ADF00006EFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00006E0021E7001EEB001AEB0017DF00006EFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00006E062DE30430EB00 + 20E2001EE20027EB0019DF00006EFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00006E0C35E40E3CEB052BDC00006E00006E001FDC002AEB001CDF0000 + 6EFF00FFFF00FFFF00FFFF00FFFF00FF00006E1442E41645EB092ED900006EFF + 00FFFF00FF00006E0020D9012CEB001FE200006EFF00FFFF00FFFF00FFFF00FF + 00006E1C4BE71037DB00006EFF00FFFF00FFFF00FFFF00FF00006E0022DC0027 + E400006EFF00FFFF00FFFF00FFFF00FFFF00FF00006E00006EFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF00006E00006EFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + end + object ApplyUpdatesButton: TBitBtn + Left = 8 + Top = 40 + Width = 113 + Height = 25 + Caption = 'Apply Updates' + Enabled = False + TabOrder = 2 + OnClick = ApplyUpdatesButtonClick + Glyph.Data = { + 36060000424D3606000000000000360400002800000020000000100000000100 + 08000000000000020000130B0000130B0000000100000000000000000000FFFF + FF00F4F3F700E3E2E50095939600A09EA100B8B2BA00908B9100B5ADB600B4AD + B500FF00FF00726C7200D3CBD300D3CCD300BDB7BD00B5AFB500D9D3D900CFC9 + CF0088848800CBC6CB00D8D3D800C1BDC1008482840082808200DCDADC007675 + 76008F8E8F00C5BDC400E1DAE000F4EFF300807777007A7979008E5D59008050 + 4B0095645B00A0675B009362530091756C00D1926D00C7916F00D1987000C699 + 7700DCA37600E2873100E6974300FFE7CC00FFD9AC00FFDEB700FFE2C000FFE5 + C500FFEAD100FFEBD400FFF4E700FFD99E00FFDDA600FFDEA900FFE5B600FFE7 + BA00FFEAC200FFDE9900FFF2D000FBFAF700FFFCEE00FFFEE700FFFFE000DDE0 + D900416560004C4F4F00575959009FA1A1008E9090007E808000FCFEFE00C5C7 + C700787979006D6E6E00393B3C00484A4B0047494A004E5051005C5E5F005456 + 57006A6C6D0063656600606263002187E300248BEA00A9B7C4001676D9001770 + CA001F8AF300134E87003477BC00393A3B001581F6001684FC001166C4001260 + B600165FB0001C4B80002F6BAC005481B200566A7F004F5A6600C4D4E6000A6E + EA000B5EC4000A52A9001069CF00165EB6002B5E9A0021456E002A4A6F003050 + 7500D9E3EF000A6EEB0009428C000C4186000E4B99000C4184000F4488000F43 + 87001D4A83001D4373000555C5000548A60041567600494A4C004D4E5000F3F4 + F600797A7D0082838600939396007070720068686A009F9FA0008B8B8B008484 + 8400787878006A6A6A00B8020000000000000000000000000000107212008C72 + 1200240000008333F4002192E400B8020000347212003C721200080000000E00 + 0000A4741200000000000001000008000000FC71120000010000248512008333 + F4002192E400B80200008333F4002192E400B802000078721200807212000800 + 00000E000000A474120000FFFF0001000000B802000000010000000000000000 + 000000000000000100000000000000000000000000000000000000010000B7C8 + 0300B802000000FFFF000000000001000000653B0100B802000000FFFF000100 + 0000FFE1FF00A474120000FFFF000100000064CA1200988D290030851200F048 + BD00010000003B00000000000000424D68000000000000006600000028000000 + 100000001000000001000800000000000000000012000000120000008C000000 + 8C00000000000000FF00FF00F400F700E300E50095009600A000A100B8000400 + 00009100B500B600B40000000000FF0072007200D300B838FA00D300BD002000 + 0000B50000000000C700547112008800CB0024851200345AF4007095F800FFFF + FF00F373F40026BBBB000000C700000000001400000064CA1200140000002FCA + 030058991600A0C701005899160064CA1200988D2900C86DD1000A0A0A0A0A0A + 0A0A20202020202020200A0A0A0A0A0A0A0A88888888888888880A0A0A7F8043 + 0A0A20403A3837353B210A0A0A4686860A0A88180D11491515470A0A4D51860B + 4E5D223E32312F2E36210A0A1A0416128A864603140D114949470A4D166F7E42 + 5B60586C64492D3039210A1A06881917191A0446040D1D0D11474D071B757D6B + 5A56625C6D7657333C211A0E18888A4745451287881F491414474D0C0F78695E + 5563254872656E343F211A030D8804454553040314091A1C1C474D110979735F + 597027010101683D41211A1C0D8804450453091D1D1D130311474D0D08777C6A + 61741E010101012323241A030D8816121250041D1D1D1D0404884D10067B7A71 + 66672901010101232C2B1A0314881F4789190F1D1D1D1D0445044D1C0E51834B + 898B2A2626262623280A1A031404871287890E0F0F0F0F040F0A4D1D13518285 + 881F8A4C0A0A0A0A0A0A1A811C0409090E0F151A0A0A0A0A0A0A4D1804514544 + 50191A4E0A0A0A0A0A0A1A03150449878709151A0A0A0A0A0A0A4D8718844A47 + 4653544D0A0A0A0A0A0A1A490315090F1545871A0A0A0A0A0A0A4D0181031505 + 1217174F0A0A0A0A0A0A1A48021D1849060F0F040A0A0A0A0A0A524D01010214 + 054D4D0A0A0A0A0A0A0A451A48480203491A1A0A0A0A0A0A0A0A0A0A4D4D4D4D + 4D0A0A0A0A0A0A0A0A0A0A0A1A1A1A1A1A0A0A0A0A0A0A0A0A0A} + NumGlyphs = 2 + end + object Panel1: TPanel + Left = 127 + Top = 0 + Width = 375 + Height = 325 + Align = alRight + Anchors = [akLeft, akTop, akRight, akBottom] + BevelOuter = bvNone + TabOrder = 3 + object Splitter1: TSplitter + Left = 0 + Top = 140 + Width = 375 + Height = 8 + Cursor = crVSplit + Align = alTop + Beveled = True + end + object gProducts: TDBGrid + Left = 0 + Top = 148 + Width = 375 + Height = 177 + Align = alClient + DataSource = dsCategories + TabOrder = 0 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'Tahoma' + TitleFont.Style = [] + end + object gCustomers: TDBGrid + Left = 0 + Top = 0 + Width = 375 + Height = 140 + Align = alTop + DataSource = dsCustomers + TabOrder = 1 + TitleFont.Charset = DEFAULT_CHARSET + TitleFont.Color = clWindowText + TitleFont.Height = -11 + TitleFont.Name = 'Tahoma' + TitleFont.Style = [] + end + end + object RODataSnapConnection1: TRODataSnapConnection + Message = ROBinMessage + Channel = HTTPChannel + ServerName = 'IAppServer1' + Left = 256 + Top = 32 + end + object HTTPChannel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:81/bin' + ServerLocators = <> + DispatchOptions = [] + Left = 8 + Top = 160 + end + object ROBinMessage: TROBinMessage + Envelopes = <> + UseCompression = False + Left = 8 + Top = 224 + end + object cdsCustomers: TClientDataSet + Aggregates = <> + Params = <> + ProviderName = 'Customers' + RemoteServer = RODataSnapConnection1 + AfterEdit = OnEnableApplyUpdates + AfterPost = OnEnableApplyUpdates + AfterCancel = OnEnableApplyUpdates + AfterDelete = OnEnableApplyUpdates + BeforeApplyUpdates = cdsCustomersBeforeApplyUpdates + BeforeGetRecords = cdsCustomersBeforeGetRecords + BeforeRowRequest = cdsCustomersBeforeRowRequest + BeforeGetParams = cdsCustomersBeforeGetParams + Left = 288 + Top = 32 + end + object dsCustomers: TDataSource + DataSet = cdsCustomers + Left = 320 + Top = 32 + end + object cdsCategories: TClientDataSet + Aggregates = <> + Params = <> + ProviderName = 'prv_categories' + RemoteServer = RODataSnapConnection2 + AfterEdit = OnEnableApplyUpdates + AfterPost = OnEnableApplyUpdates + AfterCancel = OnEnableApplyUpdates + AfterDelete = OnEnableApplyUpdates + BeforeApplyUpdates = cdsCustomersBeforeApplyUpdates + BeforeGetRecords = cdsCustomersBeforeGetRecords + BeforeRowRequest = cdsCustomersBeforeRowRequest + BeforeGetParams = cdsCustomersBeforeGetParams + Left = 288 + Top = 225 + end + object dsCategories: TDataSource + DataSet = cdsCategories + Left = 320 + Top = 224 + end + object RODataSnapConnection2: TRODataSnapConnection + Message = ROBinMessage + Channel = HTTPChannel + ServerName = 'IAppServer2' + Left = 256 + Top = 224 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClientMain.pas new file mode 100644 index 0000000..622ab4f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapClientMain.pas @@ -0,0 +1,112 @@ +unit DataSnapClientMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uROClient, uROBINMessage, uROSOAPMessage, DB, + DBClient, uROWinInetHttpChannel, + uRODataSnapConnection, StdCtrls, Buttons, Grids, DBGrids, ExtCtrls; + +type + TDataSnapClientMainForm = class(TForm) + RODataSnapConnection1: TRODataSnapConnection; + HTTPChannel: TROWinInetHTTPChannel; + ROBinMessage: TROBinMessage; + cdsCustomers: TClientDataSet; + dsCustomers: TDataSource; + cdsCategories: TClientDataSet; + dsCategories: TDataSource; + ConnectButton: TBitBtn; + DisconnectButton: TBitBtn; + ApplyUpdatesButton: TBitBtn; + Panel1: TPanel; + gProducts: TDBGrid; + gCustomers: TDBGrid; + Splitter1: TSplitter; + RODataSnapConnection2: TRODataSnapConnection; + procedure ConnectButtonClick(Sender: TObject); + procedure DisconnectButtonClick(Sender: TObject); + procedure cdsCustomersBeforeApplyUpdates(Sender: TObject; + var OwnerData: OleVariant); + procedure ApplyUpdatesButtonClick(Sender: TObject); + procedure cdsCustomersBeforeGetParams(Sender: TObject; + var OwnerData: OleVariant); + procedure cdsCustomersBeforeGetRecords(Sender: TObject; + var OwnerData: OleVariant); + procedure cdsCustomersBeforeRowRequest(Sender: TObject; + var OwnerData: OleVariant); + procedure OnEnableApplyUpdates(DataSet: TDataSet); + private + { Private declarations } + public + { Public declarations } + end; + +var + DataSnapClientMainForm: TDataSnapClientMainForm; + +implementation + +{$R *.dfm} + +procedure TDataSnapClientMainForm.ConnectButtonClick(Sender: TObject); +begin + HTTPChannel.TargetURL := 'http://localhost:81/bin'; + //HTTPChannel.TargetURL := 'http://localhost/isapi/DataSNapIsapiServer.dll/bin'; + + cdsCustomers.Active := true; + cdsCategories.Active := true; + + DisconnectButton.Visible := true; + ConnectButton.Visible := false; +end; + +procedure TDataSnapClientMainForm.DisconnectButtonClick(Sender: TObject); +begin + cdsCustomers.Active := false; + cdsCategories.Active := false; + + DisconnectButton.Visible := false; + ConnectButton.Visible := true; + ApplyUpdatesButton.Enabled := false; +end; + +procedure TDataSnapClientMainForm.ApplyUpdatesButtonClick(Sender: TObject); +begin + cdsCustomers.ApplyUpdates(-1); + cdsCategories.ApplyUpdates(-1); + ApplyUpdatesButton.Enabled := false; +end; + +procedure TDataSnapClientMainForm.cdsCustomersBeforeApplyUpdates(Sender: TObject; + var OwnerData: OleVariant); +begin + OwnerData := 'BeforeApplyUpdates'; +end; + +procedure TDataSnapClientMainForm.cdsCustomersBeforeGetParams(Sender: TObject; + var OwnerData: OleVariant); +begin + OwnerData := 'BeforeGetParams'; +end; + +procedure TDataSnapClientMainForm.cdsCustomersBeforeGetRecords(Sender: TObject; + var OwnerData: OleVariant); +begin + OwnerData := 'BeforeGetRecords'; +end; + +procedure TDataSnapClientMainForm.cdsCustomersBeforeRowRequest(Sender: TObject; + var OwnerData: OleVariant); +begin + OwnerData := 'BeforeRowRequest'; +end; + +procedure TDataSnapClientMainForm.OnEnableApplyUpdates(DataSet: TDataSet); +begin + ApplyUpdatesButton.Enabled := (cdsCustomers.ChangeCount > 0) or (cdsCategories.ChangeCount > 0); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapISAPIServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapISAPIServerMain.dfm new file mode 100644 index 0000000..462461a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapISAPIServerMain.dfm @@ -0,0 +1,35 @@ +object DataSnapISAPIServerMainForm: TDataSnapISAPIServerMainForm + OldCreateOrder = False + Actions = <> + Left = 78 + Top = 52 + Height = 127 + Width = 301 + object msg_BIN: TROBinMessage + Left = 108 + Top = 16 + end + object mgs_SOAP: TROSOAPMessage + SerializationOptions = [xsoWriteMultiRefArray, xsoWriteMultiRefObject] + Left = 146 + Top = 18 + end + object ROWebBrokerServer: TROWebBrokerServer + Active = True + Dispatchers = < + item + Name = 'msg_BIN' + Message = msg_BIN + Enabled = True + PathInfo = 'BIN' + end + item + Name = 'mgs_SOAP' + Message = mgs_SOAP + Enabled = True + PathInfo = 'SOAP' + end> + Left = 64 + Top = 16 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapISAPIServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapISAPIServerMain.pas new file mode 100644 index 0000000..8f8f9d1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapISAPIServerMain.pas @@ -0,0 +1,27 @@ +unit DataSnapISAPIServerMain; + +interface + +uses + SysUtils, Classes, HTTPApp, uROServer, + uROWebBrokerServer, uROSOAPMessage, uROClient, uROBINMessage; + +type + TDataSnapISAPIServerMainForm = class(TWebModule) + msg_BIN: TROBINMessage; + mgs_SOAP: TROSOAPMessage; + ROWebBrokerServer: TROWebBrokerServer; + private + { Private declarations } + public + { Public declarations } + end; + +var + DataSnapISAPIServerMainForm: TDataSnapISAPIServerMainForm; + +implementation + +{$R *.dfm} + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.bdsproj new file mode 100644 index 0000000..4c1df4a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DataSnapIsapiServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.dpr new file mode 100644 index 0000000..fefeae4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.dpr @@ -0,0 +1,24 @@ +library DataSnapIsapiServer; + +uses + ActiveX, + ComObj, + WebBroker, + ISAPIThreadPool, + ISAPIApp, + DataSnapISAPIServerMain in 'DataSnapISAPIServerMain.pas' {DataSnapISAPIServerMainForm: TWebModule}, + DataSnapServerData in 'DataSnapServerData.pas' {DataSnapServerDataForm: TRODataSnapModule}; + +{$R *.res} + +exports + GetExtensionVersion, + HttpExtensionProc, + TerminateExtension; + +begin + CoInitFlags := COINIT_MULTITHREADED; + Application.Initialize; + Application.CreateForm(TDataSnapISAPIServerMainForm, DataSnapISAPIServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.dproj new file mode 100644 index 0000000..087a530 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.dproj @@ -0,0 +1,75 @@ + + + {9e41110c-2697-4451-b2a0-5aa579edf466} + DataSnapIsapiServer.dpr + Debug + AnyCPU + DCC32 + DataSnapIsapiServer.dll + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + DataSnapIsapiServer.dpr + + + + + + + MainSource + + +
    DataSnapISAPIServerMainForm
    +
    + +
    DataSnapServerDataForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.res new file mode 100644 index 0000000..3adc036 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapIsapiServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.bdsproj new file mode 100644 index 0000000..ad14240 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DataSnapServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.dpr new file mode 100644 index 0000000..fd8d04b --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.dpr @@ -0,0 +1,18 @@ +program DataSnapServer; + +uses + uROComInit, + Forms, + DataSnapServerMain in 'DataSnapServerMain.pas' {DataSnapServerMainForm}, + DataSnapServerData in 'DataSnapServerData.pas' {DataSnapServerDataForm: TRODataSnapModule}, + DataSnapServerData2 in 'DataSnapServerData2.pas' {TDataSnapServerDataForm2: TRODataSnapModule}, + DataSnapServerInterfaces in 'DataSnapServerInterfaces.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'DataSnap Server'; + Application.CreateForm(TDataSnapServerMainForm, DataSnapServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.dproj new file mode 100644 index 0000000..2236cf3 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.dproj @@ -0,0 +1,75 @@ + + + {d001ebc3-1f7d-4e8f-8d6a-6791d661a387} + DataSnapServer.dpr + Debug + AnyCPU + DCC32 + DataSnapServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + DataSnapServer.dpr + + + + + + + MainSource + + +
    DataSnapServerDataForm
    +
    + +
    DataSnapServerMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.res new file mode 100644 index 0000000..aa9db5a Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData.dfm new file mode 100644 index 0000000..eaf7ceb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData.dfm @@ -0,0 +1,82 @@ +object DataSnapServerDataForm: TDataSnapServerDataForm + OldCreateOrder = True + Providers = < + item + Name = 'Products' + end + item + Provider = prv_customers + Name = 'Customers' + end> + UseProviders = True + Height = 140 + Width = 214 + object con_SqlServer: TADOConnection + ConnectionString = + 'Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=Nor' + + 'thwind;Data Source=localhost;' + LoginPrompt = False + Provider = 'SQLOLEDB.1' + Left = 24 + Top = 8 + end + object qry_customers: TADOQuery + Connection = con_SqlServer + CursorType = ctStatic + Parameters = <> + SQL.Strings = ( + 'SELECT * FROM CUSTOMERS') + Left = 57 + Top = 8 + object qry_customersCustomerID: TWideStringField + FieldName = 'CustomerID' + FixedChar = True + Size = 5 + end + object qry_customersCompanyName: TWideStringField + FieldName = 'CompanyName' + Size = 40 + end + object qry_customersContactName: TWideStringField + FieldName = 'ContactName' + Size = 30 + end + object qry_customersContactTitle: TWideStringField + FieldName = 'ContactTitle' + Size = 30 + end + object qry_customersAddress: TWideStringField + FieldName = 'Address' + Size = 60 + end + object qry_customersCity: TWideStringField + FieldName = 'City' + Size = 15 + end + object qry_customersRegion: TWideStringField + FieldName = 'Region' + Size = 15 + end + object qry_customersPostalCode: TWideStringField + FieldName = 'PostalCode' + Size = 10 + end + object qry_customersCountry: TWideStringField + FieldName = 'Country' + Size = 15 + end + object qry_customersPhone: TWideStringField + FieldName = 'Phone' + Size = 24 + end + object qry_customersFax: TWideStringField + FieldName = 'Fax' + Size = 24 + end + end + object prv_customers: TDataSetProvider + DataSet = qry_customers + Left = 57 + Top = 38 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData.pas new file mode 100644 index 0000000..b918c6a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData.pas @@ -0,0 +1,46 @@ +unit DataSnapServerData; + +interface + +uses {vcl:} SysUtils, Classes, DB, DBClient, DataSnapServerInterfaces, + {RemObjects:} uRODataSnapModule, Provider, ADODB; + +type + TDataSnapServerDataForm = class(TRODataSnapModule,IAppServer1) + con_SqlServer: TADOConnection; + qry_customers: TADOQuery; + prv_customers: TDataSetProvider; + qry_customersCustomerID: TWideStringField; + qry_customersCompanyName: TWideStringField; + qry_customersContactName: TWideStringField; + qry_customersContactTitle: TWideStringField; + qry_customersAddress: TWideStringField; + qry_customersCity: TWideStringField; + qry_customersRegion: TWideStringField; + qry_customersPostalCode: TWideStringField; + qry_customersCountry: TWideStringField; + qry_customersPhone: TWideStringField; + qry_customersFax: TWideStringField; + private + { Private declarations } + public + { Public declarations } + end; + +var + DataSnapServerDataForm: TDataSnapServerDataForm; + +implementation + +uses {RemObjects:} uROServer, uRODataSnap_Invk, uROClassFactories; + +{$R *.DFM} + +procedure Create_DataSnapModule(out oInstance:IUnknown); +begin + oInstance := TDataSnapServerDataForm.Create(nil); +end; + +initialization + TROClassFactory.Create('IAppServer1', Create_DataSnapModule, TAppServer_Invoker); +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData2.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData2.dfm new file mode 100644 index 0000000..fa5abdc --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData2.dfm @@ -0,0 +1,50 @@ +object TDataSnapServerDataForm2: TTDataSnapServerDataForm2 + OldCreateOrder = True + Providers = < + item + Provider = prv_categories + Name = 'cat' + end> + Left = 636 + Top = 238 + Height = 300 + Width = 300 + object qry_categories: TADOQuery + Connection = con_SqlServer + CursorType = ctStatic + Parameters = <> + SQL.Strings = ( + 'SELECT * FROM categories') + Left = 57 + Top = 8 + object qry_categoriesCategoryID: TAutoIncField + FieldName = 'CategoryID' + ReadOnly = True + end + object qry_categoriesCategoryName: TWideStringField + FieldName = 'CategoryName' + Size = 15 + end + object qry_categoriesDescription: TMemoField + FieldName = 'Description' + BlobType = ftMemo + end + object qry_categoriesPicture: TBlobField + FieldName = 'Picture' + end + end + object con_SqlServer: TADOConnection + ConnectionString = + 'Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=Nor' + + 'thwind;Data Source=localhost;' + LoginPrompt = False + Provider = 'SQLOLEDB.1' + Left = 24 + Top = 8 + end + object prv_categories: TDataSetProvider + DataSet = qry_categories + Left = 57 + Top = 38 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData2.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData2.pas new file mode 100644 index 0000000..cb0881b --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerData2.pas @@ -0,0 +1,47 @@ +unit DataSnapServerData2; + +interface + +uses {vcl:} SysUtils, Classes, DB, DBClient, + {RemObjects:} uRODataSnapModule, Provider, ADODB, DataSnapServerInterfaces; + +type + TTDataSnapServerDataForm2 = class(TRODataSnapModule,IAppServer2) + qry_categories: TADOQuery; + con_SqlServer: TADOConnection; + prv_categories: TDataSetProvider; + qry_categoriesCategoryID: TAutoIncField; + qry_categoriesCategoryName: TWideStringField; + qry_categoriesDescription: TMemoField; + qry_categoriesPicture: TBlobField; + private + { Private declarations } + public + { Public declarations } + end; + +var + TDataSnapServerDataForm2: TTDataSnapServerDataForm2; + +implementation + +uses {RemObjects:} uROServer, uRODataSnap_Invk; + +{$R *.DFM} + +procedure Create_DataSnapModule(out oInstance:IUnknown); +begin + oInstance := TTDataSnapServerDataForm2.Create(nil); +end; + +initialization + { To adjust scalability of the DataSnapModule and avoid recreation of + instances for each roundtrip, you might want to choose a different + ClassFactory type. + + Make sure to check the following url for more information: + http://www.remobjects.com?ro16 } + + //TROPooledClassFactory.Create('IAppServer', Create_DataSnapModule, TAppServer_Invoker, 25); + TROClassFactory.Create('IAppServer2', Create_DataSnapModule, TAppServer_Invoker); +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerInterfaces.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerInterfaces.pas new file mode 100644 index 0000000..4469093 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerInterfaces.pas @@ -0,0 +1,17 @@ +unit DataSnapServerInterfaces; + +interface +uses + uRODataSnap_Intf; + +type + IAppServer1 = interface(IAppServer) + end; + + IAppServer2 = interface(IAppServer) + end; + +implementation + +end. + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerMain.dfm new file mode 100644 index 0000000..53622b4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerMain.dfm @@ -0,0 +1,752 @@ +object DataSnapServerMainForm: TDataSnapServerMainForm + Left = 160 + Top = 125 + Caption = 'DataSnap Server' + ClientHeight = 72 + ClientWidth = 230 + Color = clBtnFace + ParentFont = True + Icon.Data = { + 0000010006003030000001000800A80E0000660000002020000001000800A808 + 00000E0F0000101000000100080068050000B61700003030000001002000A825 + 00001E1D00002020000001002000A8100000C642000010100000010020006804 + 00006E5300002800000030000000600000000100080000000000000900000000 + 00000000000000010000000100000000000006060600090909000D0D0D001111 + 11001515150010101900191919001E1E1E001B1C26000C0C310013163F001D21 + 3F00232323002B2B2B0025273200282A360021243A002F313D00333333003939 + 39003D3D3D003A403A003475340009094C00161A4300090956000A0C5B000D11 + 5800181E5400151B5B001F234C0022224400282847002D2C4B00393C49002B2C + 520034375100353B54000E1466001016630010196F0019246F001A2673001927 + 79001B2B7E0023306D002C386A00323C610022337E00333F7000364064003841 + 65003C4568003A467400414141004545450040434E00494949004D4D4D00474A + 56004D4A520041475E004C4E58005353530051535E005B5B5B0066595E004F68 + 4F005C655C00454B610040496B005B5C640052586B0045517B00525A7B005E61 + 6A005D62740057607B005D657F006161610066616600656565006A6365006365 + 6C00696969006C6B6B0069686C006D6A6D006D6D6D0072676D00736B6E00796B + 6F00607960006F6D70006E6E7800706F7700737273007A76770074747A007F77 + 7A0076787E007C7B7C00817C7D00318331005E8B5E005AA55B000C0C83000709 + 8C0009128500111F80000304930000029D000E1C9000172886001A308900172C + 920020348C002C3F8800213B9D000004A300020AA5000007A9000009AD000412 + A600000BB2000519B300081DB1000011BB00061EB8001431AD001A37A9001737 + B5001132BD00223EAB002E4189002D4395002E4AAF00354EA5003E56A8002645 + B9003251BC004D59800047568800535F84005E6781005D688A00747580007778 + 8100797A8000445CAA00405DBF004860AC00566AA7004E68B900536DBA00031B + C100021DC800001ED7000926C1000B31C5000E33CB00183BC200173DCF000021 + DD00062CD800032BE200022EEC00103DE700002DF400002FF8000231F5000B3A + F3000234FD000739FF000B3DFF00103FF3001740DB002042C400284AC600254A + D100254DDD003054D3001642E7001645F3001344FF001A4BFF001F50FF002E58 + E9002354FF002C5CFF003D69F4003362FF003867FF003C6BFF004260C0004D6D + CD00446AE0004C72E1004B73EB00436FF5004974F5004271FF00837E80008180 + 810087838400858585008A8386008D8488008B8A8B00918C8F00938F9100988C + 9100939292009B959600969598009B9598009C9A9B00A19B9D00A59FA100A3A2 + A200AAA3A600AFA6AA00ABAAAA00B0ABAC00A4A6B900B6ADB100B8AFB200B5B2 + B300BBB5B700BCB6B900BCB8B900C0B7BB00C0BBBD00B4B6C700C5BFC100C3C1 + C200CAC4C600CBC5C900CCC9CA00D1CCCF00D2CED000D6D4D400D8D4D500DAD6 + D800DDDADC00E0DDDD00E3E2E200E9E6E600EAE7E900EDEAEC00F2EFF000F4F3 + F300F8F6F700F8F7F800FDFCFC00000000000000000000000000000000000000 + 00593B0404040404003B50000000000000000000000000000000000000000000 + 00000000000000000000000000CC1407070407040404040400040004000D5900 + D1D10000000000000000000000000000000000000000000000000059070D0707 + 0707070404040404040004000404041414143B5061CCD9000000000000000000 + 000000000000000000CC0E0D0D0D0D0D0707070707040404040404040407405A + 5D6A171437143B5061CC0000000000000000000000000000140E0D0E0D0D0D07 + 0D090B1C1B1B1B1A180A03040953645B4569684459595014143740D100000000 + 000000000000000E0E0E0E0D0E0D0D0D0709277B7B7878706F6F6B20615B6461 + 4350515050505059595014660000000000000000006613130E130E0E0D0D0D0D + 0D0D197D7B7B78706F6B21D2E3DACD6150525159505950505059146200000000 + 00000000CC131313130E0E0E0E0E0D0D0D0D1E7D7D7B7A786C22DBE8E3DDCD64 + 505055505550595059503761000000000000000014141313130E130E0E0E0E0E + 0D0D29807D7D7B7924D9EDE6E6E0D2CC43525055505052505050376100000000 + 000000141414141313130E130E0E0E0D0D0D1D80807D7D7948DBEDEBEBE3D3CD + 5050555059505950595037610000000000003B14141414141313130E130E0E0E + 0E0D0D1E807C6D2852F4EEEEEEE6D6D050505250555050555050376100000000 + 00D1373737141414141313130E130E0E0E0E0D0E0D0D090859F5F1F1F1E9D9D1 + 50505550555550555055146100000000003737373714141414141313130E130E + 0E0E0E0D0D0D080D59F7F3F3F3EDDAD350505055505550555055375900000000 + 613A3737373737141414141313130E130E0E0E0D0E0D0D0D59FAF5F5F5EFDCD3 + 505055505550555055501437000000003B373B3737373714141414141313130E + 130E0E0E0D0D0D0C60FBF7F7F7F1DFD350505550555055505550370D000000D9 + 3B3A373A373737373384A185311313130E130E0E0E0E117E63FDFAF8F8F1DFD9 + 50505055505550555055140D500000503B3B3B373B373787AEADADADAA821313 + 130E130E0E0E0F9C63FFFAFAFAF5E0D950505550555055505550370D0E00003B + 3B3B3B3A373A39B0AFAFADADADAA311313130E130E0E0E7E63FFFCFCFBF5E4D9 + 45595052505550555050370D040000403B3B3B3B3B3736B9AFAFAEADADAD8514 + 1313130E130E0E2A95FFFDFCFCF7E4DC5050615E555555505550140E0400D140 + 403B3B3B3B3B36B9B9AFAFAEADADA114141313130E130E0E66FFFFFFFDF7E4DC + 424850505550595E5555370D0450614040403B3B3B3A47B9B9B9AFAFAEAD8314 + 14141313130E130E66FFFFFFFEF7E7DC50595950505050505050370E07375040 + 4040403B3B3B3BB4B9B9B9AFAFAC26141414141313130E1366FFFFFFFFF7E4E0 + 5050505E5E5255525550370E04044050404040403B3B3B3CB4B9B9B9AC323714 + 141414141313131366FFFFFFFFF7E7DF42505050525250596145370E07045040 + 40504040403B3B3B3B473636373737373714141414132E7495FFFFFFFCF7DF65 + CE524550455050505052370E040450504040404040403B3B3B3B373B37373737 + 371414141414A5A694FFFCFCFCFA5561F7F6ECD9CC5950505050370E07045040 + 504050404040403B3B3B3B3B3A3A3737373737141475A9A665FFFCFCF7CCCCE9 + DCD9E6EFF2F7ECDCCE5537080704505050504050404040403B3B3B3A3A3A3A37 + 37373714142FADA663FFFAD3CCF4F5F1F1E9DDD8CD64D9E9F2EC0E0704046650 + 5040504040504040403B3B3B3A3A3A373A373737141485AB63FED1CCFAFAF8F5 + F1ECE3DED8D05C43140D0907073BD345505040504040404040403B3B3B3A3B3A + 37373737373726AB93E1D9FEFFFCFAF7F3EEE9DEDAD4530E0D07080707500050 + 50505050504050404040403B3B3B3A3A3A473937371433AD4BEAFCFFFFFFFDF8 + F4EFE9E2DA3D1F0D0D0D0707070000505050505040504050404040403B3B3B46 + B3B9B8883734ACADA0733950CCE9F1F7F6F3EDD62571710D0D070D0707000066 + 505050505050404B968E423F403B3B8ABBBBB9B9B7B0AFAF7723141413131313 + 3F60422B819C6E0D0D0D0808140000DF5950505050504BBFC1C0974040403B8D + BBBBBBB9B9B9AFA31415141414141313139FA4A49E9D0F0E0D0D0D08CC000000 + 595059505048C8C2C2C0C049404040B6BBBBBBB9B9B9B9B93715371414141313 + 13122D722C100E0E0D0D0D0D00000000D15950505099CACAC2C2C2C340418FBC + BBBBBBBBBBB9B9B9B1837726141414141313130E0E0E0E0E0E0D0D5500000000 + 005959595057C6CACAC2C2C2C0C0BEBEBEBBBBBBBBB9B9B9B9B9B9A237141414 + 14131313130E0E0E0E0E0D000000000000DC5059555091C9CACAC2C2C2C0C0C0 + BEBEBDBBBBBBBBB9B9B9AEA8371414141414131313130E0E0E0E610000000000 + 0000615955555091C9CACAC2C2C2C0C0BEBEBEBDBBBBBBB9B9B9B98737373714 + 1414141313130E0E0E14000000000000000000595555595292C9CACAC2C2C0C0 + C0C0BEBEBDBBBBBBBBB9B03737372326141414141313140E1300000000000000 + 00000000595552555291C7CACAC2C2C2C0C0BEBEBEBDBBBBBBBBB98C3987ACAF + 7714141414131313000000000000000000000000DC5959525550559BCACAC2C2 + C2C0C0C0BEBEBDBBBBBBB9BBB0B9B9AE77371414141413CC0000000000000000 + 0000000000DC59595255525091C4CAC2C2C0C0C0BEBEBEBDBBBBBBB9BBB9B234 + 373714141414CC00000000000000000000000000000000595952555250504D9A + C5C2C2C0C0C0BEBEBBBBBBB589263B3737373737140000000000000000000000 + 00000000000000006159525552505050504890989696968B964A3F3B3B3B3A37 + 3737373B000000000000000000000000000000000000000000DC595259505050 + 505050504050404040403B3B3B3A3A3B373AD100000000000000000000000000 + 0000000000000000000000D15955505050455040504040424040403B3B3B3A3A + 6100000000000000000000000000000000000000000000000000000000DF6155 + 5050505050504050404040403B50D90000000000000000000000000000000000 + 0000000000000000000000000000000000D39543425040405061D10000000000 + 0000000000000000000000000000FFFFE007FFFF0000FFFE00004FFF0000FFF8 + 0000007F0000FFE00000000F0000FFC0000000030000FF80000000030000FE00 + 000000030000FC00000000030000FC00000000030000F800000000030000F000 + 000000030000E000000000030000E000000000030000C000000000030000C000 + 0000000300008000000000010000800000000001000080000000000100008000 + 0000000100000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000080000000000100008000 + 00000001000080000000000100008000000000010000C000000000030000C000 + 000000030000E000000000070000E000000000070000F0000000000F0000F800 + 0000001F0000FC000000003F0000FC000000003F0000FE000000007F0000FF80 + 000001FF0000FFC0000003FF0000FFE0000007FF0000FFF800001FFF0000FFFE + 00007FFF0000FFFFE007FFFF0000280000002000000040000000010008000000 + 00000004000000000000000000000001000000010000000000000A0A0A000D0D + 0D001111110014131400161616001A1919001E1E1E0021212100252525002A2A + 2A002D2D2D003131310035353500393939003D3D3D003F453F00171B45001015 + 5D00151B5C001A195F001D21410031374F00393C48003C3F4B002B3359003339 + 52001C1D6B0029356800323B6100343E6300283776003E445B003A4675003D49 + 7700414141004545450048494A004A4C4D004E4E4E00424551004D4F5000484B + 57004E5051005151520055555600595959005B5C5D005D5D5D00434C6D005B5E + 67004C4C7E00606060006364640066666600696969006B6B6C006D6D6D006F6E + 72006167780063637D0070707000757575007A7375007B7B7B007E7E7E000A9C + 12003B8B410000009A0000029F000005A5000308A4000009AB00000CB100000F + B8000213B4001131BB00374A8D002A4094002D439500344A99002D46A3003C42 + A6003851A7003C54A8002443B8002F4DBC00485A950055669C0060688200566A + A7001538C200183BC300062FDE00123EE7000332F0000A3AF2000E3DF2000032 + FC000336FE00073AFF000C3EFF00224ADD00385FDF003C62DF001442F3001847 + F3001042FE001547FF001A4BFF001E4FFF00204AE8002853E9003559E3002354 + FF002758FF002C5CFF003A63EA003E67EA003C68F4003161FF003565FF003A69 + FF003F6EFF004A67C200496EE1004C72E1004570F5004974F5004372FF007F80 + 8100868686008A8A8A008C8C8C00929292009395960099919700979598009C9A + 9C009E9D9E00A0989E00A39AA100A6A6A600AAA3A900ADA7AD00A9AAAA00B0AA + B000B0B0B200B8B2BA00BDB7BD00BFBBBF00BDBDBF00C0BAC000C2BCC200C4BD + C200C4BCC400C6C0C600CAC5CA00CBC7CC00CECACE00CFCFCF00CECDD000D1CD + D100D0D1D100D3D3D400D4D0D400D8D5D900DDD9DD00DDDCE000E3E0E200E2E1 + E500E5E3E700E7E6E700E7E6EA00E9E7EA00E9E9EA00EAEAED00EDEBED00EDED + EE00EEEDF000F0F0F200F2F2F400F6F5F600F8F8FA00FBFBFC00FEFEFE000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00002C0903030202092C0000251025250000000000000000000000000000002E + 0707070303030302020203258D25404025252500000000000000000000380909 + 0907070707030303020625368F2540404040402525250000000000000F0A0A09 + 0907071246464644142595259225404040404040862500000000000D0A0D0A0A + 090909114948461B2595952595254042423333408625000000000F0D0D0A0A0A + 0A09091349495225959595259625404043403C408625000000240F0D0D0D0D0A + 0A0A09154B4A2595959595259C25404040404040862500003D0F0F0F0D0D0D0D + 0A0A0A0915132595959595259F254040404040408625000024240F0F0F0D0D0D + 0D0A0A0A0909259895959525A5254040404040408625003D2524240F0F0F0D0D + 0D0D0A0A0A09259898959525A625404040404040862500252524240F1D5B5F4C + 190D0A0D0A0A259C98989625A825404040404040862500272525242861646363 + 5D0D0D0A0D0A259F9C989825AB254040404040408625402C272525216B656463 + 631C0D0D0A0D259F9D9C9825AD254040404040408625362C2C2725226B6B6564 + 63160E0D0D0A25A59F9D9D25B02583838386404086252C2E2C2C2725666D6B65 + 5B0F0F0D0D0D25A6A59F9D25B0254040403883838E252E2E2E2C2C272A50514F + 240F0F0F0D0D25A7A6AE9F25B42585858640404085252E2E2E2E2C2C27252524 + 24230F0F0F1625ABB08AA525B0252D36388585858E25362E2E2E2E2C2C272525 + 2424230F0F1F25AB868AA625A3A383362B2A2E38862538362E2E2E2E2C2C2725 + 252424240F0F25B086ABB9932C2C4091A597832E2525853634342E2E2E2C2C27 + 27252820240F25B4B0B9B0ABA797893A2E2B3787A5250036362E342E2E2E2C2C + 27316F6B554F25B4B9B3B4B0ABA69F959088883F2500003636362E327779572C + 2C536E6D6B6B25B9B0B9B9B4B0A8A197928C2525080000853636367D7B7A762D + 2D536E6E6D6C712525ADB9B4B3A8A598252509092E0000003836367E817B7A68 + 6874746E6E6D6C6B61252525252525250A0A0A09000000008538363C80817A7A + 797974746E6E6D6C6B5E230F0F0D0D0D0D0A0A3400000000003D383759808181 + 7A797974746E6E6D6C4F2417170F0D0D0D0D0F000000000000003836363B7E81 + 7A7A797974746E6E6D6A4F61611D0F0D0D0C000000000000000000383836365A + 7F7B7A797974746E6E6D6C694E0F0F0F0D00000000000000000000003D383636 + 36587C767979747470564D2424240F2400000000000000000000000000863836 + 3634342E2E2E2C2C2C2725252424380000000000000000000000000000000085 + 363636342E2E2E2E2C2C27253F00000000000000000000000000000000000000 + 00008538362E2E2E3640000000000000000000000000FFF00C3FFF800007FE00 + 0000FC000000F8000000F0000000E0000000C0000000C0000000800000008000 + 0000800000000000000000000000000000000000000000000000000000000000 + 000000000000800000018000000180000001C0000003C0000003E0000007F000 + 000FF800001FFC00003FFE00007FFF8001FFFFF00FFF28000000100000002000 + 0000010008000000000000010000000000000000000000010000000100000000 + 00000D0D0D001212120018181800191A2A000F0F34001D1F3400212121002626 + 260024252B002A2A2A002A2A2C0030303000343434003939390039393D003E3E + 3E00080955000A0E5D00282E4A003E3E4000353948003B3E4A0028325F00363D + 5A000E187B0016206B002B2E6900343C76004343430043434400424348004445 + 4E00484848004D4D4D004548560044485B005252520054505100575757005053 + 5F005A535B00585858005C5C5C004E614E00474E66005C5D60005F636E006262 + 62006565650066676A00696869006D6C6D006573640071717100757575007978 + 78007C7C7C00060B97002B3C8200273C9000000BB1001935A5003E4F8B002E48 + A9003047A4003A47A4003E56A9003D57B200495D9F005161950057689C007173 + 87007F7A9100455DAB00536BB400183BC100133AD1000732E1000739FE001E42 + C9001B42D5001A42D9002945C4001742E5001B4AF7001041FF00194AFF002253 + FF002B5BFF003564FF003F6CF9003E6DFF004260C1004E6FD000858585008E8E + 8E009191910095949500A49D9F00AFA7AA00ACA9AA00B5B0B200B6B4B500BBB8 + B900C4C1C300C4C4C800CBC6C800D2CFD000D7D3D400DAD9DA00E2DFE000ECEA + EB00F3F1F100FBFAFB00FDFCFC00000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000340D0201083460000000000000003708080412110526352C272E000000 + 27080808063D3A49633430302E0000390F0F0D080B191B6B663430332700001D + 0F0F0D0D08080F6F693730302A005F211D4C4E170D081C716C37303327343025 + 23564F3E0D0D20726E3834302E0D2E26214050180F0D24726E38303027032E27 + 2721211D0F155370676865623702372A2A272121200F416A716D6429080D6130 + 2E45282D55504D162E48421A07340030475C5D445857543C0F0D130808000062 + 345E5C5A595857520F0F0D0D3700000039324B5C5A595855513B0F2700000000 + 00623032464A433F231D39000000000000000060372E27305F0000000000F80F + 0000E0010000C001000080010000800100000000000000000000000000000000 + 000000000000000000008001000080010000C0030000E0070000F81F00002800 + 0000300000006000000001002000000000008025000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000001919192F1717176F1616169F141414BF121212FF1010 + 10FF0F0F0FFF0D0D0DFF0B0B0BFF0A0A0AFF080808BF0707079F0505056F0505 + 0530343434053434340F343434203434342E343434353434342C3434341F3434 + 34143434340D3434340834343405343434023434340100000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000002020 + 201F1E1E1E8F1C1C1CDF1A1A1AFF191919FF171717FF151515FF141414FF1212 + 12FF101010FF0F0F0FFF0D0D0DFF0B0B0BFF0A0A0AFF080808FF060606FF0606 + 06FF070707E1101010A22B2B2B6F34343491343434923434347F343434643434 + 344A3434343A3434342D34343420343434143434340C34343408343434043434 + 3402000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000002424242F232323AF2121 + 21FF1F1F1FFF1E1E1EFF1C1C1CFF1A1A1AFF191919FF171717FF151515FF1414 + 14FF121212FF101010FF0F0F0FFF0D0D0DFF0B0B0BFF0A0A0AFF090909FF0909 + 09FF0E0E0EFF1A1A1AFF363335FF353635FA303030EE2F2E2FDC303030C43434 + 34AE3434349734343480343434643434344B3434343A34343428343434183434 + 340B343434030000000000000000000000000000000000000000000000000000 + 00000000000000000000000000002A2A2A0F2828288F262626FF242424FF2323 + 23FF212121FF1F1F1FFF1E1E1EFF1C1C1CFF1A1A1AFF191919FF171717FF1515 + 15FF141414FF121212FF101010FF0F0F0FFF0D0D0DFF0C0C0CFF0D0D0DFF1111 + 11FF1D1D1DFF555052FF72676DFF607960FF5AA55BFF347534FF393F39FD3938 + 39F8313131EF2F2F2FDD303030C42F2F2FAE3434349734343477343434473434 + 341E343434060000000000000000000000000000000000000000000000000000 + 000000000000000000002D2D2D3F2B2B2BEF292929FF282828FF262626FF2424 + 24FF232323FF212121FF1F1F1FFF1E1E1EFF1A1B25FF13163FFF0D1158FF0B0E + 5EFF0A0C5BFF090A58FF090956FF09094CFF0C0C31FF101019FF141414FF2121 + 21FF686264FF81797BFF746B6FFF5C655CFF5E8B5EFF318331FF4F684FFF6D6A + 6DFF666666FF5B5B5BFE3F3F3FFD383838F8313131EE2E2E2ED03434348D3434 + 34313434340A0000000000000000000000000000000000000000000000000000 + 0000000000003030306F2E2E2EFF2D2D2DFF2B2B2BFF292929FF282828FF2626 + 26FF242424FF232323FF212121FF1F1F1FFF1C1D27FF0E1466FF0009ADFF0007 + A9FF0005A5FF0003A1FF00019BFF010197FF050590FF0C0C83FF222244FF7770 + 74FF726B6DFF837D80FF777073FF5D5C5DFF676067FF666266FF646564FF6565 + 65FF666666FF666666FF696969FF6A6A6AFF646464FF3A3A3AFC343434A93434 + 34413434340D0000000000000000000000000000000000000000000000000000 + 00003333339F323232FF303030FF2E2E2EFF2D2D2DFF2B2B2BFF292929FF2828 + 28FF262626FF242424FF232323FF212121FF1F1F1FFF161A43FF000BB1FF0009 + ADFF0007A9FF0005A5FF01049FFF050693FF0C0C83FF282847FF928B8FFFB8AF + B2FFA0999CFF847F81FF7A7677FF5D5D5DFF656565FF666566FF666566FF6565 + 65FF656565FF656565FF656565FF666666FF646464FF3E3E3EFD343434AE3434 + 34463434340F0000000000000000000000000000000000000000000000003737 + 379F353535FF333333FF323232FF303030FF2E2E2EFF2D2D2DFF2B2B2BFF2929 + 29FF282828FF262626FF242424FF232323FF212121FF141959FF000DB5FF000B + B1FF0009ADFF0007A9FF0206A1FF07098CFF2D2C4BFFA69FA3FFC0B7BBFFB7B0 + B2FFAAA3A6FF8A8487FF7F7A7DFF5D5D5DFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFD343434AE3434 + 34463434340F00000000000000000000000000000000000000003A3A3A6F3838 + 38FF373737FF353535FF333333FF323232FF303030FF2E2E2EFF2D2D2DFF2B2B + 2BFF292929FF282828FF262626FF242424FF232323FF10196FFF0010B9FF000D + B5FF000BB1FF0009ADFF0209A4FF2B2C52FF9F999CFFC9C2C5FFBDB6BAFFBDB7 + BAFFB1AAACFF8F8A8BFF837F81FF5D5D5DFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFD343434AE3434 + 34463434340F000000000000000000000000000000003D3D3D3F3B3B3BFF3A3A + 3AFF383838FF373737FF353535FF333333FF323232FF303030FF2E2E2EFF2D2D + 2DFF2B2B2BFF292929FF282828FF262626FF242424FF181E54FF0012BEFF0010 + B9FF000DB5FF000BB1FF030BA6FF5C5A62FFA5A0A1FFCBC4C6FFC5BFC1FFC5BF + C1FFB6B0B2FF938F91FF878384FF5C5D5DFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFD343434AE3434 + 34463434340F0000000000000000000000004141410F3F3F3FEF3D3D3DFF3B3B + 3BFF3A3A3AFF383838FF373737FF353535FF333333FF323232FF303030FF2E2E + 2EFF2D2D2DFF2B2B2BFF292929FF282828FF262626FF242424FF161D5EFF0012 + BEFF0412A6FF091285FF101663FF66656CFFD9D4D5FFCBC5C9FFCBC5C9FFCBC5 + C9FFBCB6B8FF989596FF8B8789FF5C5C5CFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFD343434AE3434 + 34463434340F0000000000000000000000004242429F404040FF3F3F3FFF3D3D + 3DFF3B3B3BFF3A3A3AFF383838FF373737FF353535FF333333FF323232FF3030 + 30FF2E2E2EFF2D2D2DFF2B2B2BFF292929FF282828FF262626FF242424FF2323 + 23FF212121FF1F1F1FFF1F1F1FFF69686CFFE0DCDDFFD1CECFFFD1CCCFFFD1CC + CFFFC2BDBFFF9D999AFF8F8B8EFF5C5C5CFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFE343434AE3434 + 34463434340F00000000000000004545452F444444FF424242FF404040FF3F3F + 3FFF3D3D3DFF3B3B3BFF3A3A3AFF383838FF373737FF353535FF333333FF3232 + 32FF303030FF2E2E2EFF2D2D2DFF2B2B2BFF292929FF282828FF262626FF2424 + 24FF232323FF212121FF202020FF6C6B6BFFE6E1E3FFD8D4D5FFD8D4D5FFD8D4 + D5FFC7C4C5FFA19E9FFF939091FF5C5C5CFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFF313131B83434 + 34463434340F0000000000000000474747BF454545FF444444FF424242FF4040 + 40FF3F3F3FFF3D3D3DFF3B3B3BFF3A3A3AFF383838FF373737FF353535FF3333 + 33FF323232FF303030FF2E2E2EFF2D2D2DFF2B2B2BFF292929FF282828FF2626 + 26FF242424FF232323FF222222FF6F6D70FFEDE9EBFFDEDADDFFDEDADCFFDEDA + DCFFCCCACAFFA5A1A3FF969393FF5C5C5CFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFF282828E13434 + 34463434340F000000004A4A4A1F494949FF474747FF454545FF444444FF4242 + 42FF404040FF3F3F3FFF3D3D3DFF3B3B3BFF3A3A3AFF383838FF373737FF3535 + 35FF333333FF323232FF303030FF2E2E2EFF2D2D2DFF2B2B2BFF292929FF2828 + 28FF262626FF242424FF1D213FFF706F77FFF3F0F0FFE5E1E2FFE3E1E2FFE3E1 + E2FFD1CFD0FFA9A6A7FF999798FF5C5C5CFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFF242424FF2828 + 285C3434340F000000004C4C4C8F4A4A4AFF494949FF474747FF454545FF4444 + 44FF424242FF404040FF3F3F3FFF323C61FF1737B5FF0E33CBFF1132BCFF2233 + 7EFF353535FF333333FF323232FF303030FF2E2E2EFF2D2D2DFF2B2B2BFF2929 + 29FF282828FF21243AFF0519B3FF72727AFFFAF6F7FFEAE7E9FFE9E7E7FFE9E6 + E7FFD7D4D4FFACAAAAFF9C999AFF5C5C5CFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFF242424FF1616 + 16AE3434340F000000004E4E4EDF4C4C4CFF4A4A4AFF494949FF474747FF4545 + 45FF444444FF424242FF2C3F88FF0739FFFF0436FFFF0134FEFF0031FCFF002F + F8FF1431ADFF353535FF333333FF323232FF303030FF2E2E2EFF2D2D2DFF2B2B + 2BFF292929FF252732FF031AC1FF74747BFFFFFCFEFFEFEDEEFFEEEBEDFFEEEB + EDFFDAD8D9FFB0ADADFF9E9D9DFF5C5C5CFF656565FF656565FF656565FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFF252525FF1212 + 12E83434340F5151512F4F4F4FFF4E4E4EFF4C4C4CFF4A4A4AFF494949FF4747 + 47FF454545FF40444FFF103FF3FF0A3CFFFF0739FFFF0436FFFF0134FEFF0031 + FCFF002FF8FF22337EFF353535FF333333FF323232FF303030FF2E2E2EFF2D2D + 2DFF2B2B2BFF292929FF081DB1FF76777EFFFFFFFFFFF3F2F2FFF2F0F0FFF2EF + F0FFDDDCDDFFB2B0B1FFA09E9FFF5E5E5EFF6A6A6AFF646464FF646464FF6565 + 65FF656565FF656565FF656565FF656565FF646464FF3D3D3DFF252525FF1212 + 12FF1010103B5252526F515151FF4F4F4FFF4E4E4EFF4C4C4CFF4A4A4AFF4949 + 49FF474747FF394574FF1042FFFF0D3FFFFF0A3CFFFF0739FFFF0436FFFF0134 + FEFF0031FCFF1132BCFF373737FF353535FF333333FF323232FF303030FF2E2E + 2EFF2D2D2DFF2B2B2BFF19246FFF77787FFFFFFFFFFFF7F6F7FFF6F4F6FFF4F4 + F4FFE1E0E1FFB5B2B4FFA3A1A1FF5D5D5DFF646464FF707070FF6F6F6FFF6666 + 66FF6A6A6AFF656565FF646464FF666666FF636363FF3D3D3DFF262626FF1313 + 13FF0B0B0B77545454AF535353FF515151FF4F4F4FFF4E4E4EFF4C4C4CFF4A4A + 4AFF494949FF3B4775FF1345FFFF1042FFFF0D3FFFFF0A3CFFFF0739FFFF0436 + FFFF0134FEFF0E33CBFF383838FF373737FF353535FF333333FF323232FF3030 + 30FF2E2E2EFF2D2D2DFF2C2C2CFF7A7A7AFFFFFFFFFFFBFAFBFFF8F8F8FFF8F7 + F8FFE3E2E2FFB6B4B5FFA4A1A3FF595959FF606060FF636363FF636363FF6767 + 67FF626262FF6D6D6DFF6E6E6EFF666666FF686868FF3D3D3DFF272727FF1414 + 14FF0B0B0BA5565656CF545454FF535353FF515151FF4F4F4FFF4E4E4EFF4C4C + 4CFF4A4A4AFF40496BFF1647FFFF1345FFFF1042FFFF0D3FFFFF0A3CFFFF0739 + FFFF0436FFFF1A37A9FF3A3A3AFF383838FF373737FF353535FF333333FF3232 + 32FF303030FF2E2E2EFF2D2D2DFF7C7C7CFFFFFFFFFFFEFEFEFFFBFBFBFFFAFA + FAFFE5E5E5FFB7B5B5FFA6A5A5FF646464FF676767FF6A6A6AFF656565FF6363 + 63FF5F5F5FFF606060FF626262FF666666FF636363FF414141FF272727FF1616 + 16FF0B0B0BC3585858FF565656FF545454FF535353FF515151FF4F4F4FFF4E4E + 4EFF4C4C4CFF4A4A4AFF254AD1FF1647FFFF1345FFFF1042FFFF0D3FFFFF0A3C + FFFF0A39F3FF363C55FF3B3B3BFF3A3A3AFF383838FF373737FF353535FF3333 + 33FF323232FF303030FF2E2E2EFF7C7C7CFFFFFFFFFFFEFEFEFFFCFBFBFFFBFA + FAFFE6E5E5FFB6B5B5FFADABACFF5E5E5EFF666666FF636363FF6E6E6EFF7070 + 70FF666666FF6A6A6AFF666666FF646464FF5A5A5AFF434343FF282828FF1616 + 16FF0C0C0CFF595959FF585858FF565656FF545454FF535353FF515151FF4F4F + 4FFF4E4E4EFF4C4C4CFF474A56FF254AD1FF1647FFFF1345FFFF1042FFFF103F + F3FF333F70FF3F3F3FFF3D3D3DFF3B3B3BFF3A3A3AFF383838FF373737FF3535 + 35FF333333FF323232FF303030FF7C7C7CFFFFFFFFFFFEFCFEFFFBFBFBFFFAFA + FAFFE3E3E3FFB6B5B5FFACABACFF585858FF636363FF5F5F5FFF636363FF6262 + 62FF666666FF606060FF6C6C6CFF757575FF606060FF434343FF282828FF1818 + 18FF0D0D0DFF5B5B5BFF595959FF585858FF565656FF545454FF535353FF5151 + 51FF4F4F4FFF4E4E4EFF4C4C4CFF4A4A4AFF40496BFF3B4775FF394574FF4444 + 44FF424242FF404040FF3F3F3FFF3D3D3DFF3B3B3BFF3A3A3AFF383838FF3737 + 37FF353535FF23306DFF172C92FF797A80FFFFFFFFFFFBFAFBFFFAF8F8FFF8F7 + F7FFE5E3E5FFA9A9A9FF7C7B7BFF888888FF656565FF5C5C5CFF5B5B5BFF6262 + 62FF636363FF5F5F5FFF626262FF636363FF666666FF444444FF282828FF1919 + 19FF0F0F0FFF5D5D5DFF5B5B5BFF595959FF585858FF565656FF545454FF5353 + 53FF515151FF4F4F4FFF4E4E4EFF4C4C4CFF4A4A4AFF494949FF474747FF4545 + 45FF444444FF424242FF404040FF3F3F3FFF3D3D3DFF3B3B3BFF3A3A3AFF3838 + 38FF373737FF062CD8FF032AE0FF777881FFFFFFFFFFF7F6F7FFF6F4F4FFF3F2 + F3FFECE9EBFF6A6969FF717070FFE2E2E2FFDEDEDEFFC1C1C1FF9E9E9EFF8484 + 84FF6B6B6BFF5E5E5EFF5B5B5BFF626262FF5A5A5AFF434343FF272727FF1818 + 18FF101010FF5E5E5EFF5D5D5DFF5B5B5BFF595959FF585858FF565656FF5454 + 54FF535353FF515151FF4F4F4FFF4E4E4EFF4C4C4CFF4A4A4AFF494949FF4747 + 47FF454545FF444444FF424242FF404040FF3F3F3FFF3D3D3DFF3B3B3BFF3A3A + 3AFF20348CFF002DF4FF032CE4FF76787DFFFFFFFFFFF3F2F2FFF2F0F0FFE4E3 + E3FF817F7FFF818080FFC0BBBDFFA49FA0FF9D999CFFBCB8BAFFCAC9CAFFD5D5 + D5FFE0E1E0FFC2C2C2FFA3A4A3FF898989FF6B6B6BFF444444FF212121FF1717 + 17FF111111FF606060FF5E5E5EFF5D5D5DFF5B5B5BFF595959FF585858FF5656 + 56FF545454FF535353FF515151FF4F4F4FFF4E4E4EFF4C4C4CFF4A4A4AFF4949 + 49FF474747FF454545FF444444FF424242FF404040FF3F3F3FFF3D3D3DFF3B3B + 3BFF2C386AFF002FF8FF032DE9FF757578FFFEFCFEFFEEEBEDFF908E8FFF8381 + 82FFD9D6D8FFDEDADCFFD7D3D4FFCFC9CBFFC2BBBDFFAAA1A5FF9D9597FF8B82 + 86FF7F777AFFA09D9EFFC0BCBDFFD8D5D7FFC1C1C1FF2B2B2BFF1A1A1AFF1616 + 16FF131313FF626262CF606060FF5E5E5EFF5D5D5DFF5B5B5BFF595959FF5858 + 58FF565656FF545454FF535353FF515151FF4F4F4FFF4E4E4EFF4C4C4CFF4A4A + 4AFF494949FF474747FF454545FF444444FF424242FF404040FF3F3F3FFF3D3D + 3DFF3B3B3BFF1234BFFF022FEFFF74747BFFF7F6F6FF8F8E8EFF858484FFE9E8 + E8FFEEEBEDFFE9E6E6FFDEDCDCFFD3CED0FFC7C1C4FFBBB5B7FFABA4A6FF9E93 + 98FF8F8288FF796B6FFF66595EFF3B3839FF232323FF1D1D1DFF191919FF1616 + 16FF141414BF636363AF626262FF606060FF5E5E5EFF5D5D5DFF5B5B5BFF5959 + 59FF585858FF565656FF545454FF535353FF515151FF4F4F4FFF4E4E4EFF4C4C + 4CFF4A4A4AFF494949FF474747FF454545FF444444FF424242FF404040FF3F3F + 3FFF3D3D3DFF343A54FF0231F5FF747580FFA4A6B9FF969598FFF7F7F7FFFAFA + FAFFF6F4F4FFEEEDEDFFE5E2E2FFD9D4D7FFCBC6C7FFBFB8BAFFAFA6AAFFA198 + 9CFF988C91FF6D6467FF2C2B2CFF212121FF1F1F1FFF1B1B1BFF191919FF1717 + 17FF161616AF6565656F636363FF626262FF606060FF5E5E5EFF5D5D5DFF5B5B + 5BFF595959FF585858FF565656FF545454FF535353FF515151FF4F4F4FFF4E4E + 4EFF4C4C4CFF4A4A4AFF494949FF474747FF3C4568FF41444FFF424242FF4040 + 40FF3F3F3FFF323C61FF0234F9FF51587EFFB4B6C7FFF8F7F7FFFFFFFFFFFFFF + FFFFFFFFFFFFF6F4F6FFEAE6E7FFDCD7D8FFCCC7C9FFC0B8BCFFB6ADB1FFA69C + 9FFF4D4A52FF1F234CFF242424FF212121FF1F1F1FFF1C1C1CFF1A1A1AFF1919 + 19FF1717176F6666662F656565FF636363FF626262FF606060FF5E5E5EFF5D5D + 5DFF5B5B5BFF595959FF585858FF565656FF545454FF535353FF515151FF4F4F + 4FFF4E4E4EFF4C4C4CFF454B61FF284AC6FF1647FFFF1645F3FF2D4395FF4242 + 42FF364064FF0A39F3FF0536FDFF0B31C5FF1A3089FF40434EFF5F5F5FFF8484 + 84FFB9B9B9FFD5D4D5FFE1DDDEFFE1DEDEFFD9D4D7FFCBC4C6FF9C9597FF3437 + 51FF0E1D90FF0E1C90FF242424FF212121FF1F1F1FFF1E1E1EFF1C1C1CFF1A1A + 1AFF1919192F00000000676767DF656565FF636363FF626262FF606060FF5E5E + 5EFF5D5D5DFF5B5B5BFF535C78FF465EABFF4D5980FF52555FFF535353FF5151 + 51FF4F4F4FFF4E4E4EFF354EA5FF1C4DFFFF194AFFFF1647FFFF1345FFFF1642 + E7FF103FF3FF0A3CFFFF0739FFFF203A9DFF383B48FF3A3A3AFF373737FF3535 + 35FF313131FF2E2E2EFF363636FF4D4E58FF6E6E78FF51505EFF1A2673FF061E + B8FF041CC2FF111F80FF242424FF232323FF212121FF1F1F1FFF1E1E1EFF1C1C + 1CDF00000000000000006868688F676767FF656565FF636363FF626262FF6060 + 60FF5E5E5EFF57607BFF3D69F4FF3867FFFF3564FFFF405DBFFF545454FF5353 + 53FF515151FF4F4F4FFF3251BCFF1F50FFFF1C4DFFFF194AFFFF1647FFFF1345 + FFFF1042FFFF0D3FFFFF173DCFFF3F3F3FFF3D3D3DFF3B3B3BFF3A3A3AFF3838 + 38FF373737FF353535FF333333FF323232FF0926C1FF0022DFFF0020DBFF001E + D7FF021DC8FF252732FF262626FF242424FF232323FF212121FF1F1F1FFF1E1E + 1E8F00000000000000006969691F686868FF676767FF656565FF636363FF6262 + 62FF5E616AFF436FF5FF3E6DFFFF3B6AFFFF3867FFFF3564FFFF52586BFF5454 + 54FF535353FF515151FF3054D3FF2253FFFF1F50FFFF1C4DFFFF194AFFFF1647 + FFFF1345FFFF1042FFFF0D3FFFFF404040FF3F3F3FFF3D3D3DFF3B3B3BFF3A3A + 3AFF383838FF373737FF353535FF333333FF2F313DFF1B2B7EFF172886FF1927 + 79FF282A36FF292929FF282828FF262626FF242424FF232323FF212121FF2020 + 201F0000000000000000000000006A6A6ABF686868FF676767FF656565FF6363 + 63FF566AA7FF4473FFFF4170FFFF3E6DFFFF3B6AFFFF3867FFFF4260C0FF5656 + 56FF52555FFF475688FF2E58E9FF2556FFFF2253FFFF1F50FFFF1C4DFFFF194A + FFFF1647FFFF1345FFFF1042FFFF1740DBFF223EABFF233C9EFF363C55FF3B3B + 3BFF3A3A3AFF383838FF373737FF353535FF333333FF323232FF303030FF2E2E + 2EFF2D2D2DFF2B2B2BFF292929FF282828FF262626FF242424FF232323AF0000 + 00000000000000000000000000006B6B6B3F6A6A6AFF686868FF676767FF6565 + 65FF62656DFF4C72E1FF4473FFFF4170FFFF3E6DFFFF3B6AFFFF3867FFFF3564 + FFFF3261FFFF2F5FFFFF2C5CFFFF2959FFFF2556FFFF2253FFFF1F50FFFF1C4D + FFFF194AFFFF1647FFFF1345FFFF1042FFFF0D3FFFFF0A3CFFFF183BC2FF3D3D + 3DFF3B3B3BFF3A3A3AFF383838FF373737FF353535FF333333FF323232FF3030 + 30FF2E2E2EFF2D2D2DFF2B2B2BFF292929FF282828FF262626FF2424242F0000 + 0000000000000000000000000000000000006B6B6B9F6A6A6AFF686868FF6767 + 67FF656565FF5E6781FF4974F5FF4473FFFF4170FFFF3E6DFFFF3B6AFFFF3867 + FFFF3564FFFF3261FFFF2F5FFFFF2C5CFFFF2959FFFF2556FFFF2253FFFF1F50 + FFFF1C4DFFFF194AFFFF1647FFFF1345FFFF1042FFFF0D3FFFFF103DE7FF3F3F + 3FFF3D3D3DFF3B3B3BFF3A3A3AFF383838FF373737FF353535FF333333FF3232 + 32FF303030FF2E2E2EFF2D2D2DFF2B2B2BFF292929FF2828289F000000000000 + 0000000000000000000000000000000000006B6B6B0F6B6B6BEF6A6A6AFF6868 + 68FF676767FF656565FF5E6781FF4776FFFF4473FFFF4170FFFF3E6DFFFF3B6A + FFFF3867FFFF3564FFFF3261FFFF2F5FFFFF2C5CFFFF2959FFFF2556FFFF2253 + FFFF1F50FFFF1C4DFFFF194AFFFF1647FFFF1345FFFF1042FFFF2E4189FF4040 + 40FF3F3F3FFF3D3D3DFF3B3B3BFF3A3A3AFF383838FF373737FF353535FF3333 + 33FF323232FF303030FF2E2E2EFF2D2D2DFF2B2B2BEF2A2A2A0F000000000000 + 000000000000000000000000000000000000000000006B6B6B3F6B6B6BFF6A6A + 6AFF686868FF676767FF656565FF5D688AFF4974F5FF4473FFFF4170FFFF3E6D + FFFF3B6AFFFF3867FFFF3564FFFF3261FFFF2F5FFFFF2C5CFFFF2959FFFF2556 + FFFF2253FFFF1F50FFFF1C4DFFFF194AFFFF1647FFFF1645F3FF444444FF4242 + 42FF404040FF3B3E4BFF363C55FF3B3B3BFF3A3A3AFF383838FF373737FF3535 + 35FF333333FF323232FF303030FF2E2E2EFF2D2D2D3F00000000000000000000 + 00000000000000000000000000000000000000000000000000006B6B6B7F6B6B + 6BFF6A6A6AFF686868FF676767FF656565FF5E6781FF4B73EBFF4473FFFF4170 + FFFF3E6DFFFF3B6AFFFF3867FFFF3564FFFF3261FFFF2F5FFFFF2C5CFFFF2959 + FFFF2556FFFF2253FFFF1F50FFFF1C4DFFFF194AFFFF1647FFFF2645B9FF4144 + 4FFF2E4189FF0D3CF3FF0739FFFF213A9DFF3B3B3BFF3A3A3AFF383838FF3737 + 37FF353535FF333333FF323232FF3030306F0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000006B6B + 6B9F6B6B6BFF6A6A6AFF686868FF676767FF656565FF62656DFF536DBAFF4473 + FFFF4170FFFF3E6DFFFF3B6AFFFF3867FFFF3564FFFF3261FFFF2F5FFFFF2C5C + FFFF2959FFFF2556FFFF2253FFFF1F50FFFF1C4DFFFF194AFFFF1647FFFF1645 + F3FF1042FFFF0D3FFFFF0A3CFFFF233C9FFF3D3D3DFF3B3B3BFF3A3A3AFF3838 + 38FF373737FF353535FF3333339F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00006B6B6B9F6B6B6BFF6A6A6AFF686868FF676767FF656565FF636363FF5D65 + 7FFF4D6DCDFF4170FFFF3E6DFFFF3B6AFFFF3867FFFF3564FFFF3261FFFF2F5F + FFFF2C5CFFFF2959FFFF2556FFFF2253FFFF1F50FFFF1C4DFFFF194AFFFF1647 + FFFF1345FFFF2042C4FF384165FF404040FF3F3F3FFF3D3D3DFF3B3B3BFF3A3A + 3AFF383838FF3737379F00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000006B6B6B7F6B6B6BFF6A6A6AFF686868FF676767FF656565FF6363 + 63FF626262FF5D6274FF4E68B9FF446AE0FF3B6AFFFF3867FFFF3564FFFF3261 + FFFF2F5FFFFF2C5CFFFF2959FFFF2556FFFF2253FFFF1F50FFFF254DDDFF2E4A + AFFF41475EFF454545FF444444FF424242FF404040FF3F3F3FFF3D3D3DFF3B3B + 3BFF3A3A3A6F0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000006B6B6B4F6B6B6BEF6A6A6AFF686868FF676767FF6565 + 65FF636363FF626262FF606060FF5E5E5EFF5B5E67FF535F84FF4860ACFF465E + ABFF445CABFF4159AAFF3F57A9FF3D55A8FF45517BFF4B4E59FF4C4C4CFF4A4A + 4AFF494949FF474747FF454545FF444444FF424242FF404040FF3F3F3FEF3D3D + 3D3F000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000006B6B6B0F6B6B6B9F6A6A6AFF686868FF6767 + 67FF656565FF636363FF626262FF606060FF5E5E5EFF5D5D5DFF5B5B5BFF5959 + 59FF585858FF565656FF545454FF535353FF515151FF4F4F4FFF4E4E4EFF4C4C + 4CFF4A4A4AFF494949FF474747FF454545FF444444FF4242429F4141410F0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000006B6B6B3F6A6A6ABF6868 + 68FF676767FF656565FF636363FF626262FF606060FF5E5E5EFF5D5D5DFF5B5B + 5BFF595959FF585858FF565656FF545454FF535353FF515151FF4F4F4FFF4E4E + 4EFF4C4C4CFF4A4A4AFF494949FF474747BF4545453F00000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000006969 + 691F6868688F676767EF656565FF636363FF626262FF606060FF5E5E5EFF5D5D + 5DFF5B5B5BFF595959FF585858FF565656FF545454FF535353FF515151FF4F4F + 4FFF4E4E4EDF4C4C4C8F4A4A4A1F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000006666662F6565657F636363AF626262CF606060FF5E5E + 5EFF5D5D5DFF5B5B5BFF595959FF585858FF565656CF545454AF5252527F5151 + 512F000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF8000000F0000FFFC000000010000FFF0000000000000FFC0 + 000000000000FF80000000000000FF00000000000000FE00000000000000FC00 + 000000000000F800000000000000F000000000000000E000000000000000E000 + 000000000000C000000000000000C00000000000000080000000000000008000 + 0000000000008000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000008000 + 00000001000080000000000100008000000000010000C000000000030000C000 + 000000030000E000000000070000E000000000070000F0000000000F0000F800 + 0000001F0000FC000000003F0000FE000000007F0000FF00000000FF0000FF80 + 000001FF0000FFC0000003FF0000FFF000000FFF0000FFFC00003FFF0000FFFF + 8001FFFF00002800000020000000400000000100200000000000801000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000001C1C1C1F1A1A1A6F1717 + 17BF151515EF121212FF101010FF0D0D0DFF0B0B0BFF080808DF060606AF0404 + 046F21202171484A4BFF3F453FFF484A4BFF484A4BFF1D1D1D11000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000002424243F212121BF1F1F1FFF1C1C1CFF1A1A + 1AFF171717FF151515FF121212FF101010FF0D0D0DFF0B0B0BFF080808FF1413 + 14FF484A4BFFA39AA1FF484A4BFF7B7B7BFF7B7B7BFF484A4BFF484A4BFF484A + 4BFF222222341E1E1E0D8E8E8E01000000000000000000000000000000000000 + 0000000000002B2B2B0F292929AF262626FF242424FF212121FF1F1F1FFF1C1C + 1CFF1A1A1AFF171717FF151515FF121212FF101010FF0D0D0DFF1A1919FF484A + 4BFF676467FFAAA3A9FF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B + 7BFF484A4BFF484A4BFF484A4BFF000000000000000000000000000000000000 + 00003030303F2E2E2EEF2B2B2BFF292929FF262626FF242424FF212121FF1F1F + 1FFF10155DFF0009ABFF0005A5FF00029FFF00009AFF1A195FFF484A4BFFBDB7 + BDFF484A4BFFB1ABB1FF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B + 7BFF7B7B7BFF939393FF494949FF000000000000000000000000000000003535 + 355F333333FF303030FF2E2E2EFF2B2B2BFF292929FF262626FF242424FF2121 + 21FF171B45FF000CB1FF0009ABFF0308A4FF1C1D6BFF484A4BFFBDB7BDFFBDB7 + BDFF484A4BFFB8B2BAFF484A4BFF7B7B7BFF0A9C12FF0A9C12FF4C4C7EFF4C4C + 7EFF7B7B7BFF939393FF494949FF0000000000000000000000003A3A3A3F3838 + 38FF353535FF333333FF303030FF2E2E2EFF2B2B2BFF292929FF262626FF2424 + 24FF151B5CFF000FB8FF000CB1FF3C42A6FF484A4BFFBDB7BDFFBDB7BDFFBDB7 + BDFF484A4BFFC0BBC0FF484A4BFF7B7B7BFF7B7B7BFF3B8B41FF7B7B7BFF6363 + 7DFF7B7B7BFF939393FF494949FF00000000000000003F3F3F1F3C3C3CEF3A3A + 3AFF383838FF353535FF333333FF303030FF2E2E2EFF2B2B2BFF292929FF2626 + 26FF1D2141FF0213B4FF000FB8FF484A4BFFBDB7BDFFBDB7BDFFBDB7BDFFBDB7 + BDFF484A4BFFC6C2C7FF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B + 7BFF7B7B7BFF939393FF494949FF0000000000000000414141BF3F3F3FFF3C3C + 3CFF3A3A3AFF383838FF353535FF333333FF303030FF2E2E2EFF2B2B2BFF2929 + 29FF262626FF1D2141FF151B5CFF484A4BFFBDB7BDFFBDB7BDFFBDB7BDFFBDB7 + BDFF484A4BFFCECACEFF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B + 7BFF7B7B7BFF939393FF494949FF000000004646463F444444FF414141FF3F3F + 3FFF3C3C3CFF3A3A3AFF383838FF353535FF333333FF303030FF2E2E2EFF2B2B + 2BFF292929FF262626FF242424FF484A4BFFC0BAC0FFBDB7BDFFBDB7BDFFBDB7 + BDFF484A4BFFD4D0D4FF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B + 7BFF7B7B7BFF939393FF494949FF00000000494949BF464646FF444444FF4141 + 41FF3F3F3FFF3C3C3CFF3A3A3AFF383838FF353535FF333333FF303030FF2E2E + 2EFF2B2B2BFF292929FF262626FF484A4BFFC4BDC2FFC0BAC0FFBDB7BDFFBDB7 + BDFF484A4BFFD9D7DAFF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B + 7BFF7B7B7BFF939393FF494949FF4E4E4E1F4B4B4BFF494949FF464646FF4444 + 44FF414141FF343E63FF1538C2FF0332F0FF1131BBFF2B3359FF333333FF3030 + 30FF2E2E2EFF2B2B2BFF292929FF484A4BFFC6C1C6FFC2BDC2FFC0BAC0FFBDB7 + BDFF484A4BFFDEDDE1FF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B + 7BFF7B7B7BFF939393FF484A4BFF5050506F4E4E4EFF4B4B4BFF494949FF4646 + 46FF414450FF0F3EF3FF073AFFFF0336FEFF0032FCFF062FDEFF353535FF3333 + 33FF303030FF2E2E2EFF2B2B2BFF484A4BFFCBC5CBFFC6C0C6FFC2BCC2FFC0BA + C0FF484A4BFFE3E2E6FF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B + 7BFF7B7B7BFF939393FF484A4BFF535353BF515151FF4E4E4EFF4B4B4BFF4949 + 49FF3A4675FF1042FFFF0C3EFFFF073AFFFF0336FEFF0032FCFF293568FF3535 + 35FF333333FF303030FF2E2E2EFF484A4BFFCECACEFFCAC5CAFFC6C1C6FFC4BC + C4FF484A4BFFE7E6EAFF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B7BFF7B7B + 7BFF7B7B7BFF939393FF484A4BFF565656EF535353FF515151FF4E4E4EFF4B4B + 4BFF3D4977FF1547FFFF1042FFFF0C3EFFFF073AFFFF0336FEFF333952FF3838 + 38FF353535FF333333FF303030FF484A4BFFD4D0D4FFCFCACFFFCBC5CAFFC6C0 + C6FF484A4BFFEBEAEDFF484A4BFF868686FF868686FF868686FF929292FF7B7B + 7BFF7B7B7BFF939393FF484A4BFF585858FF565656FF535353FF515151FF4E4E + 4EFF4B4B4BFF224ADDFF1547FFFF1042FFFF0C3EFFFF183BC3FF3C3C3CFF3A3A + 3AFF383838FF353535FF333333FF484A4BFFD9D5D8FFD4D0D4FFCFCACFFFCBC5 + CAFF484A4BFFEDEDEFFF484A4BFF7B7B7BFF7B7B7BFF7B7B7BFF6F6F6FFF8686 + 86FF868686FFA7A7A7FF484A4BFF5B5B5BFF585858FF565656FF535353FF5151 + 51FF4E4E4EFF484B57FF344A99FF2D46A3FF2D4396FF414141FF3F3F3FFF3C3C + 3CFF3A3A3AFF383838FF353535FF484A4BFFDEDADDFFD9D5D9FFE9E7EAFFCFCA + CFFF484A4BFFEEEDF0FF484A4BFF8C8C8CFF8C8C8CFF929292FF7B7B7BFF7B7B + 7BFF7B7B7BFF8F8F8FFF484A4BFF5D5D5DFF5B5B5BFF585858FF565656FF5353 + 53FF515151FF4E4E4EFF4B4B4BFF494949FF464646FF444444FF414141FF3F3F + 3FFF3C3C3CFF3A3A3AFF31374FFF484A4BFFE3E0E3FFEEEDEEFF9C9A9CFFD3CF + D3FF484A4BFFEDEDEFFF484A4BFF545657FF636464FF6E6E6EFF8C8C8CFF8C8C + 8CFF8C8C8CFFA6A6A6FF484A4BFF606060FF5D5D5DFF5B5B5BFF585858FF5656 + 56FF535353FF515151FF4E4E4EFF4B4B4BFF494949FF464646FF444444FF4141 + 41FF3F3F3FFF3C3C3CFF283776FF484A4BFFE7E6E7FF909092FF9E9D9EFFD8D4 + D8FF484A4BFFCECFD0FFCFCFCFFF868787FF636565FF4E5051FF4D4F50FF5C5D + 5DFF6B6B6CFF929292FF484A4BFF626262EF606060FF5D5D5DFF5B5B5BFF5858 + 58FF565656FF535353FF515151FF4E4E4EFF4B4B4BFF494949FF464646FF4444 + 44FF414141FF3F3F3FFF3C3C3CFF484A4BFFEDEBEDFF929293FFE3E0E2FFFFFF + FFFFB0B0B2FF515253FF555657FF757677FFA9AAAAFFD3D3D4FFBDBDBFFF7F80 + 81FF5B5C5DFF4A4C4DFF484A4BFF646464BF626262FF606060FF5D5D5DFF5B5B + 5BFF585858FF565656FF535353FF515151FF4E4E4EFF4B4B4BFF494949FF4346 + 52FF3E445BFF414141FF3F3F3FFF484A4BFFF0F0F2FFEDEBEDFFFFFFFFFFE9E9 + EBFFE2E1E5FFDCD9DDFFBFBBBFFF979598FF6F6E72FF58595AFF4E5051FF6869 + 6AFF939596FFD0D1D1FF484A4BFF6666666F656565FF626262FF606060FF5D5D + 5DFF5B5B5BFF585858FF565656FF535353FF515151FF4E4E4EFF434C6DFF204A + E8FF1547FFFF2443B8FF2A4094FF484A4BFFF6F6F6FFFFFFFFFFEEEEF0FFF2F2 + F4FFEEEDEFFFE5E3E7FFD9D7DAFFCBC7CCFFBDB7BDFFADA7ADFF999197FF9991 + 97FF7A7375FF484A4BFF1A1A1A6F6868681F676767FF656565FF626262FF6060 + 60FF5B5E67FF3C68F4FF3565FFFF485A95FF535353FF515151FF3851A7FF1E4F + FFFF1A4BFFFF1547FFFF1042FFFF484A4BFFFFFFFFFFEDEDEFFFF8F8FAFFFBFB + FCFFF6F4F7FFEAEAEDFFDDDCE0FFCFCCD0FFC0BBC1FFB0AAB0FFA0989EFF484A + 4BFF484A4BFF1F1F1FFF1C1C1C1F00000000696969BF676767FF656565FF6262 + 62FF496EE1FF3F6EFFFF3A69FFFF3A63EAFF565656FF535353FF3C54A8FF2354 + FFFF1E4FFFFF1A4BFFFF1547FFFF3559E3FF484A4BFF484A4BFFE9E9EAFFFCFC + FCFFF6F6F7FFEBEAEEFFDEDCE0FFD0CCD0FFC1BBC1FF484A4BFF484A4BFF2626 + 26FF242424FF212121BF00000000000000006B6B6B3F696969FF676767FF6565 + 65FF4C72E1FF4372FFFF3F6EFFFF3A69FFFF3C62DFFF385FDFFF2C5CFFFF2758 + FFFF2354FFFF1E4FFFFF1A4BFFFF1547FFFF1042FEFF0D3CF0FF484A4BFF484A + 4BFF484A4BFF484A4BFF484A4BFF484A4BFF484A4BFF2C2C2CFF2B2B2BFF2929 + 29FF262626FF2424243F0000000000000000000000006B6B6BBF696969FF6767 + 67FF616778FF4974F5FF4372FFFF3F6EFFFF3A69FFFF3565FFFF3161FFFF2C5C + FFFF2758FFFF2354FFFF1E4FFFFF1A4BFFFF1547FFFF1042FFFF123EE7FF3F3F + 3FFF3C3C3CFF3A3A3AFF383838FF353535FF333333FF303030FF2E2E2EFF2B2B + 2BFF292929BF000000000000000000000000000000006B6B6B1F6B6B6BEF6969 + 69FF676767FF606882FF4974F5FF4372FFFF3F6EFFFF3A69FFFF3565FFFF3161 + FFFF2C5CFFFF2758FFFF2354FFFF1E4FFFFF1A4BFFFF1547FFFF2E4395FF4141 + 41FF3C3F4BFF393C48FF3A3A3AFF383838FF353535FF333333FF303030FF2E2E + 2EEF2B2B2B1F00000000000000000000000000000000000000006B6B6B3F6B6B + 6BFF696969FF676767FF616778FF4C72E1FF4372FFFF3F6EFFFF3A69FFFF3565 + FFFF3161FFFF2C5CFFFF2758FFFF2354FFFF1E4FFFFF1A4BFFFF1847F3FF2E43 + 95FF0F3EF3FF0A3AF2FF323B61FF3A3A3AFF383838FF353535FF333333FF3030 + 303F000000000000000000000000000000000000000000000000000000006B6B + 6B5F6B6B6BFF696969FF676767FF656565FF566AA7FF4570F5FF3F6EFFFF3A69 + FFFF3565FFFF3161FFFF2C5CFFFF2758FFFF2354FFFF1E4FFFFF1A4BFFFF1547 + FFFF1442F3FF2A4094FF3F3F3FFF3C3C3CFF3A3A3AFF383838FF3535355F0000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00006B6B6B3F6B6B6BEF696969FF676767FF656565FF626262FF55669CFF4A67 + C2FF3E67EAFF3565FFFF3161FFFF2C5CFFFF2758FFFF2853E9FF2F4DBCFF374A + 8DFF464646FF444444FF414141FF3F3F3FFF3C3C3CEF3A3A3A3F000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000006B6B6B1F6B6B6BBF696969FF676767FF656565FF626262FF6060 + 60FF5D5D5DFF5B5B5BFF585858FF565656FF535353FF515151FF4E4E4EFF4B4B + 4BFF494949FF464646FF444444FF414141BF3F3F3F1F00000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000006B6B6B3F696969BF676767FF656565FF6262 + 62FF606060FF5D5D5DFF5B5B5BFF585858FF565656FF535353FF515151FF4E4E + 4EFF4B4B4BFF494949BF4646463F000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000006868681F6666666F6464 + 64BF626262EF606060FF5D5D5DFF5B5B5BFF585858FF565656EF535353BF5050 + 506F4E4E4E1F0000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000FFC0001FFF000000FC000000F8000000F000 + 0000E0000000C0000000C0000000800000008000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000008000000180000001C0000003C0000003E0000007F000000FF800 + 001FFC00003FFF0000FFFFC003FF280000001000000020000000010020000000 + 0000400400000000000000000000000000000000000000000000000000000000 + 0000000000000F0F0F381616169F171717DD121212FF0D0D0DFF080808DD1414 + 14A33232328D3332336D3434343C2E2E2E181C1C1C0400000000000000000505 + 050C262626A4262626FF212121FF191A2AFF0A0E5DFF080955FF0F0F34FF5450 + 51FF657364FF4E614EFE4E4E4EF23E3E3ED33434343D000000000606060C2F2F + 2FCD303030FF2B2B2BFF262626FF1D1F34FF000BB1FF060B97FF7F7A91FFA49D + 9FFF6A696AFF656565FF656565FF575757FE3434345600000000373737A63939 + 39FF353535FF303030FF2B2B2BFF24252BFF0E187BFF2B2E69FFCBC6C8FFB5B0 + B2FF6E6D6EFF656565FF656565FF575757FE343434561F1F1F3A434343FF3E3E + 3EFF393939FF353535FF303030FF2B2B2BFF262626FF3A3A3FFFE2DFE0FFC4C1 + C3FF727171FF656565FF656565FF575757FF2F2F2F683C3C3C9F484848FF4343 + 44FF183BC1FF0732E1FF28325FFF303030FF2B2B2BFF343C76FFF3F1F1FFD2CF + D0FF757575FF646464FF656565FF575757FF202020A8525252E04D4D4DFF4548 + 56FF1041FFFF0739FEFF1935A5FF353535FF303030FF44454EFFFBFAFBFFDAD9 + DAFF777676FF676767FF656565FF585858FF171717DF575757FF525252FF4D4D + 4DFF2E48A9FF1E42CAFF363D5AFF393939FF353535FF44485BFFFDFCFCFFDAD9 + DAFF797878FF636363FF646464FF595959FF191919FF5C5C5CFF575757FF5252 + 52FF4D4D4DFF484848FF434343FF3E3E3EFF353948FF2945C4FFECEAEBFFB6B4 + B5FFBBB8B9FFACA9AAFF969495FF717071FF181818FF616161E05C5C5CFF5757 + 57FF525252FF4D4D4DFF484848FF424348FF3E3E3EFF3047A4FFC4C4C8FFF3F2 + F2FFD7D3D4FFAFA7AAFF5A535BFF222121FF171717DF4F4F4F9F616161FF5C5D + 60FF495D9FFF50535FFF474E66FF1B4AF7FF1F42C9FF133AD1FF3B3E4AFF5D5D + 5DFF717387FF3A47A4FF16206BFF212121FF1616169F2E2E2E3C666666FF5768 + 9CFF3E6DFFFF4260C1FF3D57B2FF2253FFFF194AFFFF1742E5FF273C90FF3939 + 39FF343436FF282E4AFF2A2A2CFF262626FF0F0F0F38000000005E5E5EA66667 + 6AFF4E6FD0FF3E6DFFFF3564FFFF2B5BFFFF2253FFFF194AFFFF1A42D9FF3E3E + 40FF39393CFF353535FF303030FF262626A600000000000000000B0B0B0E5E5E + 5ECD66676AFF536BB4FF3F6CF9FF3564FFFF2B5BFFFF2253FFFF1B4AF7FF1B42 + D5FF2B3C82FF393939FF2F2F2FCD0505050C0000000000000000000000000B0B + 0B0E5E5E5EA8666666FF5F636EFF516195FF455DABFF3E56A9FF3E4F8BFF4548 + 56FF434343FF373737A60606060C000000000000000000000000000000000000 + 0000000000002E2E2E3C4F4F4FA1616161E25C5C5CFF575757FF525252E23C3C + 3C9F1F1F1F3C00000000000000000000000000000000F0000000C00000008000 + 0000800000000000000000000000000000000000000000000000000000000000 + 0000000000008001000080010000C0030000F00F0000} + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object btn_RemObjects: TROPoweredByRemObjectsButton + Left = 9 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object HTTPServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'mgs_SOAP' + Message = mgs_SOAP + Enabled = True + PathInfo = '/SOAP' + end + item + Name = 'msg_BIN' + Message = msg_BIN + Enabled = True + PathInfo = '/BIN' + end> + Port = 81 + Left = 7 + Top = 27 + end + object msg_BIN: TROBinMessage + Left = 39 + Top = 27 + end + object mgs_SOAP: TROSOAPMessage + SerializationOptions = [xsoWriteMultiRefArray, xsoWriteMultiRefObject] + Left = 71 + Top = 27 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerMain.pas new file mode 100644 index 0000000..61b9198 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/DataSnap/DataSnapServerMain.pas @@ -0,0 +1,35 @@ +unit DataSnapServerMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uROPoweredByRemObjectsButton, uROSOAPMessage, uROClient, + uROBinMessage, uROServer, uROIndyTCPServer, uROIndyHTTPServer; + +type + TDataSnapServerMainForm = class(TForm) + HTTPServer: TROIndyHTTPServer; + msg_BIN: TROBINMessage; + mgs_SOAP: TROSOAPMessage; + btn_RemObjects: TRoPoweredByRemObjectsButton; + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + DataSnapServerMainForm: TDataSnapServerMainForm; + +implementation + +{$R *.dfm} + +procedure TDataSnapServerMainForm.FormCreate(Sender: TObject); +begin + HTTPServer.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.Sample.html new file mode 100644 index 0000000..5b0c280 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.Sample.html @@ -0,0 +1,40 @@ + + + + + + + + + +

    + Dispatch notifier +

    + +

    Purpose

    +

    This example shows how to customize the invocation.

    + +

    + IRODispatchNotifier is a special interface that TROInvoker classes recognize. + If your server side object implements it, the IRODispatchNotifier.GetDispatchInfo method + will be called before the target method is invoked. +

    + +

    See TROInvoker.CustomHandleMessage in uROServer.pas.

    + +

    The TMyInvoker class shows how to enhance the interception mechanism by providing support +for a custom interface called ITestInterface.

    + +

    Notice how the TROClassFactory.Create has been changed to use TMyInvoker.

    + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.bdsgroup new file mode 100644 index 0000000..ee1dd5c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + DispatchNotifierClient.bdsproj + DispatchNotifierServer.bdsproj + DispatchNotifierClient.exe DispatchNotifierServer.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.bpg new file mode 100644 index 0000000..ad3af78 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = DispatchNotifierClient.exe DispatchNotifierServer.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +DispatchNotifierClient.exe: DispatchNotifierClient.dpr + $(DCC) + +DispatchNotifierServer.exe: DispatchNotifierServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.groupproj new file mode 100644 index 0000000..3332c08 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifier.groupproj @@ -0,0 +1,40 @@ + + + {4a1795b5-591a-42aa-b5ea-2b501669c026} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.bdsproj new file mode 100644 index 0000000..a9c9a49 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DispatchNotifierClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.dpr new file mode 100644 index 0000000..1a4aa62 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.dpr @@ -0,0 +1,13 @@ +program DispatchNotifierClient; + +uses + Forms, + DispatchNotifierClientMain in 'DispatchNotifierClientMain.pas' {DispatchNotifierClientMainForm}; + +{$R *.RES} + +begin + Application.Initialize; + Application.CreateForm(TDispatchNotifierClientMainForm, DispatchNotifierClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.dproj new file mode 100644 index 0000000..ae68453 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.dproj @@ -0,0 +1,72 @@ + + + {af143428-fbfc-499b-a031-5813f2fa859b} + DispatchNotifierClient.dpr + Debug + AnyCPU + DCC32 + DispatchNotifierClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + DispatchNotifierClient.dpr + + + + + + + MainSource + + +
    DispatchNotifierClientMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.res new file mode 100644 index 0000000..852a6c3 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClientMain.dfm new file mode 100644 index 0000000..6c80ac7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClientMain.dfm @@ -0,0 +1,78 @@ +object DispatchNotifierClientMainForm: TDispatchNotifierClientMainForm + Left = 10 + Top = 8 + AutoScroll = False + Caption = 'Dispatch Notifier Client' + ClientHeight = 151 + ClientWidth = 344 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 8 + Top = 64 + Width = 46 + Height = 13 + Caption = 'Message:' + end + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 59 + Top = 96 + Width = 212 + Height = 48 + Cursor = crHandPoint + ApplicationType = atClient + end + object eSimpleMessage: TEdit + Left = 64 + Top = 60 + Width = 193 + Height = 25 + TabOrder = 1 + Text = 'A simple text message...' + end + object SendButton: TButton + Left = 264 + Top = 58 + Width = 75 + Height = 25 + Caption = 'Send' + TabOrder = 2 + OnClick = SendButtonClick + end + object rgChannel: TRadioGroup + Left = 104 + Top = 8 + Width = 137 + Height = 41 + Caption = 'Channel' + Columns = 2 + ItemIndex = 0 + Items.Strings = ( + 'TCP' + 'HTTP') + TabOrder = 0 + end + object IndyTCPChannel: TROIndyTCPChannel + ServerLocators = <> + DispatchOptions = [] + Port = 8099 + Host = '127.0.0.1' + Left = 24 + Top = 16 + end + object BINMessage: TROBinMessage + Left = 72 + Top = 88 + end + object IndyHTTPChannel: TROIndyHTTPChannel + ServerLocators = <> + DispatchOptions = [] + TargetURL = 'http://localhost:8090/BIN' + Left = 24 + Top = 88 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClientMain.pas new file mode 100644 index 0000000..68d320e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierClientMain.pas @@ -0,0 +1,50 @@ +unit DispatchNotifierClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, uROClient, uROBINMessage, uROIndyTCPChannel, + ExtCtrls, uROIndyHTTPChannel, + uROPoweredByRemObjectsButton; + +type + TDispatchNotifierClientMainForm = class(TForm) + Label1: TLabel; + eSimpleMessage: TEdit; + SendButton: TButton; + IndyTCPChannel: TROIndyTCPChannel; + BINMessage: TROBINMessage; + IndyHTTPChannel: TROIndyHTTPChannel; + rgChannel: TRadioGroup; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + procedure SendButtonClick(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + DispatchNotifierClientMainForm : TDispatchNotifierClientMainForm; + +implementation + +uses DispatchNotifierLibrary_Intf, uROClientIntf; + +{$R *.DFM} + +procedure TDispatchNotifierClientMainForm.SendButtonClick(Sender: TObject); +var + channel : TROTransportChannel; +begin + if (rgChannel.ItemIndex = 0) then + channel := IndyTCPChannel + else + channel := IndyHTTPChannel; + + CoDispatchNotifierService.Create(BINMessage, channel).SendMessage(eSimpleMessage.Text); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierLibrary.rodl new file mode 100644 index 0000000..6194855 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierLibrary.rodl @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierLibrary_Intf.pas new file mode 100644 index 0000000..2117cbc --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierLibrary_Intf.pas @@ -0,0 +1,95 @@ +unit DispatchNotifierLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{6DA40FCA-5FC2-40CF-8FC6-7601B1CBFDDC}'; + TargetNamespace = ''; + + { Service Interface ID's } + IDispatchNotifierService_IID : TGUID = '{6DA40FCA-5FC2-40CF-8FC6-7601B1CBFDDC}'; + + { Event ID's } + +type + { Forward declarations } + IDispatchNotifierService = interface; + + + { IDispatchNotifierService } + IDispatchNotifierService = interface + ['{6DA40FCA-5FC2-40CF-8FC6-7601B1CBFDDC}'] + procedure SendMessage(const aMessage: Widestring); + end; + + { CoDispatchNotifierService } + CoDispatchNotifierService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDispatchNotifierService; + end; + + { TDispatchNotifierService_Proxy } + TDispatchNotifierService_Proxy = class(TROProxy, IDispatchNotifierService) + protected + function __GetInterfaceName:string; override; + + procedure SendMessage(const aMessage: Widestring); + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoDispatchNotifierService } + +class function CoDispatchNotifierService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDispatchNotifierService; +begin + result := TDispatchNotifierService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TDispatchNotifierService_Proxy } + +function TDispatchNotifierService_Proxy.__GetInterfaceName:string; +begin + result := 'DispatchNotifierService'; +end; + +procedure TDispatchNotifierService_Proxy.SendMessage(const aMessage: Widestring); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'DispatchNotifierLibrary', __InterfaceName, 'SendMessage'); + __Message.Write('aMessage', TypeInfo(Widestring), aMessage, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IDispatchNotifierService_IID, TDispatchNotifierService_Proxy); + + +finalization + UnregisterProxyClass(IDispatchNotifierService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierLibrary_Invk.pas new file mode 100644 index 0000000..cec647d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierLibrary_Invk.pas @@ -0,0 +1,64 @@ +unit DispatchNotifierLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} DispatchNotifierLibrary_Intf; + +type + TDispatchNotifierService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_SendMessage(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TDispatchNotifierService_Invoker } + +constructor TDispatchNotifierService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TDispatchNotifierService_Invoker.Invoke_SendMessage(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure SendMessage(const aMessage: Widestring); } +var + aMessage: Widestring; +begin + try + __Message.Read('aMessage', TypeInfo(Widestring), aMessage, []); + + (__Instance as IDispatchNotifierService).SendMessage(aMessage); + + __Message.InitializeResponseMessage(__Transport, 'DispatchNotifierLibrary', 'DispatchNotifierService', 'SendMessageResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.bdsproj new file mode 100644 index 0000000..8fa0de6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DispatchNotifierServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.dpr new file mode 100644 index 0000000..156fe35 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.dpr @@ -0,0 +1,19 @@ +program DispatchNotifierServer; + +{#ROGEN:DispatchNotifierLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + Forms, + DispatchNotifierServerMain in 'DispatchNotifierServerMain.pas' {DispatchNotifierServerMainForm}, + DispatchNotifierLibrary_Intf in 'DispatchNotifierLibrary_Intf.pas', + DispatchNotifierLibrary_Invk in 'DispatchNotifierLibrary_Invk.pas', + DispatchNotifierService_Impl in 'DispatchNotifierService_Impl.pas'; + +{$R *.RES} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.CreateForm(TDispatchNotifierServerMainForm, DispatchNotifierServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.dproj new file mode 100644 index 0000000..bcf9c37 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.dproj @@ -0,0 +1,75 @@ + + + {5a41f262-8005-4c7d-bafd-92414f12f09e} + DispatchNotifierServer.dpr + Debug + AnyCPU + DCC32 + DispatchNotifierServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + DispatchNotifierServer.dpr + + + + + + + MainSource + + + + +
    DispatchNotifierServerMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.res new file mode 100644 index 0000000..b72ce48 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServerMain.dfm new file mode 100644 index 0000000..d2e27e4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServerMain.dfm @@ -0,0 +1,60 @@ +object DispatchNotifierServerMainForm: TDispatchNotifierServerMainForm + Left = 28 + Top = 84 + AutoScroll = False + Caption = 'Dispatch Notifier Server' + ClientHeight = 298 + ClientWidth = 474 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 135 + Top = 5 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Memo: TMemo + Left = 8 + Top = 58 + Width = 458 + Height = 233 + ReadOnly = True + ScrollBars = ssBoth + TabOrder = 0 + end + object ROMessage: TROBinMessage + Left = 128 + Top = 72 + end + object ROIndyTCPServer: TROIndyTCPServer + Active = True + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + end> + Port = 8099 + Left = 192 + Top = 72 + end + object ROIndyHTTPServer: TROIndyHTTPServer + Active = True + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = '/BIN' + end> + Port = 8090 + Left = 160 + Top = 72 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServerMain.pas new file mode 100644 index 0000000..1fa004c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierServerMain.pas @@ -0,0 +1,53 @@ +unit DispatchNotifierServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, uROClient, uROBINMessage, uROClientIntf, uROServer, uROIndyHTTPServer, + uROIndyTCPServer, SyncObjs, uROPoweredByRemObjectsButton; + +type + TDispatchNotifierServerMainForm = class(TForm) + ROMessage: TROBINMessage; + ROIndyTCPServer: TROIndyTCPServer; + Memo: TMemo; + ROIndyHTTPServer: TROIndyHTTPServer; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + CriticalSection: tCriticalSection; + public + procedure Log(const someText: Widestring); + end; + +var + DispatchNotifierServerMainForm: TDispatchNotifierServerMainForm; + +implementation + +{$R *.DFM} + +procedure TDispatchNotifierServerMainForm.Log(const someText: Widestring); +begin + CriticalSection.Enter; + try + Memo.Lines.Add(someText); + finally + CriticalSection.Leave; + end; +end; + +procedure TDispatchNotifierServerMainForm.FormCreate(Sender: TObject); +begin + CriticalSection := TCriticalSection.Create; +end; + +procedure TDispatchNotifierServerMainForm.FormDestroy(Sender: TObject); +begin + CriticalSection.Free; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierService_Impl.pas new file mode 100644 index 0000000..59de994 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/DispatchNotifierService_Impl.pas @@ -0,0 +1,154 @@ +unit DispatchNotifierService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Generated:} DispatchNotifierLibrary_Intf; + +{ + This example shows how to customize message dispatching. + IRODispatchNotifier is a special interface that TROInvoker classes know and look for. + If your server side object implements it, the IRODispatchNotifier.GetDispatchInfo + method will be called before the target method is invoked. + + See TROInvoker.CustomHandleMessage in uROServer.pas + + The TMyInvoker class shows how to enhance the interception mechanism by providing + support to a custom interface called ITestInterface. + + Note how TROClassFactory.Create has been changed to use TMyInvoker. +} + +type + { ITestInvokeInterface } + ITestInvokeInterface = interface + ['{CE51FFEF-D552-4712-B86D-166CEC29B737}'] + procedure DoThis; + procedure DoThat; + end; + + { TDispatchNotifierService } + TDispatchNotifierService = class(TRORemotable, IDispatchNotifierService, IRODispatchNotifier, ITestInvokeInterface) + private + protected + { IRODispatchNotifier } + procedure GetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage); + + { ITestInvokeInterface } + procedure DoThis; + procedure DoThat; + + { IDispatchNotifierService methods } + procedure SendMessage(const aMessage: Widestring); + end; + +implementation +uses + {Generated:} DispatchNotifierLibrary_Invk, DispatchNotifierServerMain; + +procedure Create_DispatchNotifierService(out anInstance: IUnknown); +begin + anInstance := TDispatchNotifierService.Create; +end; + +type + TMyInvoker = class(TDispatchNotifierService_Invoker) + protected + procedure BeforeInvoke(aMethodPtr: TMessageInvokeMethod; + const anInstance: IInterface; + const aFactory: IROClassFactory; + const aMessage: IROMessage; + const aTransport: IROTransport); override; + + procedure AfterInvoke(aMethodPtr: TMessageInvokeMethod; + const anInstance: IInterface; + const aFactory: IROClassFactory; + const aMessage: IROMessage; + const aTransport: IROTransport; + anException: Exception); override; + end; + + { TMyInvoker } + +procedure TMyInvoker.AfterInvoke(aMethodPtr: TMessageInvokeMethod; + const anInstance: IInterface; const aFactory: IROClassFactory; + const aMessage: IROMessage; const aTransport: IROTransport; + anException: Exception); +var + itestintf: ITestInvokeInterface; +begin + inherited; + + if Supports(anInstance, ITestInvokeInterface, itestintf) then itestintf.DoThis; +end; + +procedure TMyInvoker.BeforeInvoke(aMethodPtr: TMessageInvokeMethod; + const anInstance: IInterface; const aFactory: IROClassFactory; + const aMessage: IROMessage; const aTransport: IROTransport); +var + itestintf: ITestInvokeInterface; +begin + inherited; + + if Supports(anInstance, ITestInvokeInterface, itestintf) then itestintf.DoThat; +end; + +{ DispatchNotifierService } + +procedure TDispatchNotifierService.DoThat; +begin + DispatchNotifierServerMainForm.Log('Do that...'); +end; + +procedure TDispatchNotifierService.DoThis; +begin + DispatchNotifierServerMainForm.Log('Do this...'); +end; + +procedure TDispatchNotifierService.GetDispatchInfo( + const aTransport: IROTransport; const aMessage: IROMessage); +var + tcpinfo: IROTCPTransport; + textmessage: Widestring; + streamaccess: IROStreamAccess; +begin + if Supports(aTransport, IROTCPtransport, tcpinfo) then DispatchNotifierServerMainForm.Log('Client ' + tcpinfo.GetClientAddress + ' connected!'); + + with aTransport do + DispatchNotifierServerMainForm.Log('Got a reference to a ' + GetTransportObject.ClassName); + + with aMessage do begin + DispatchNotifierServerMainForm.Log('About to invoke ' + InterfaceName + '.' + MessageName); + + if (MessageName = 'SendMessage') then begin + aMessage.Read('aMessage', TypeInfo(WideString), textmessage, []); + DispatchNotifierServerMainForm.Log('The text message was "' + textmessage + '"'); + + { New RemObjects 4.0: now you can reset the position of the message stream } + if Supports(aMessage, IROStreamAccess, streamaccess) then streamaccess.Stream.Position := 0; + end; + end; + + DispatchNotifierServerMainForm.Log(''); +end; + +procedure TDispatchNotifierService.SendMessage(const aMessage: Widestring); +begin + DispatchNotifierServerMainForm.Log('Received message "' + aMessage + '"'); +end; + +initialization + TROClassFactory.Create('DispatchNotifierService', Create_DispatchNotifierService, TMyInvoker); +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/RODLFile.RES b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/RODLFile.RES new file mode 100644 index 0000000..e39e24c Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dispatch Notifier/RODLFile.RES differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.Sample.html new file mode 100644 index 0000000..f7f7bdb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.Sample.html @@ -0,0 +1,28 @@ + + + + + + + + + +

    Dynamic Request Sample

    + +

    Purpose

    +

    This example shows how to use the TRODynamicRequest component to execute server methods.

    + +

    Examine the Code

    +
      +
    • See how the three methods were defined by editing the service library. + Do this by making the server the selected project + and by using the menu option: RemObjects | Edit Service Library. + Note: if you don't see this menu option but see 'Service Builder' instead, + you still have the client set as the current project. + Examine the methods added to DynamicRequestService.
    • +
    • Check how the server methods were implemented in DynamicRequestService_Impl.pas.
    • +
    • See the simple code needed to invoke the methods in DynamicRequestClientMain.pas.
    • +
    + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.bdsgroup new file mode 100644 index 0000000..86bcc2d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + DynamicRequestClient.bdsproj + DynamicRequestServer.bdsproj + DynamicRequestClient.exe DynamicRequestServer.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.bpg new file mode 100644 index 0000000..6bb4490 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = DynamicRequestClient.exe DynamicRequestServer.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +DynamicRequestClient.exe: DynamicRequestClient.dpr + $(DCC) + +DynamicRequestServer.exe: DynamicRequestServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.groupproj new file mode 100644 index 0000000..a73080f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequest.groupproj @@ -0,0 +1,40 @@ + + + {c6294125-5ef4-4e86-a9e4-372c2755e652} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.bdsproj new file mode 100644 index 0000000..a9cb02c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DynamicRequestClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.dpr new file mode 100644 index 0000000..5bad030 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.dpr @@ -0,0 +1,14 @@ +program DynamicRequestClient; + +uses + Forms, + DynamicRequestClientMain in 'DynamicRequestClientMain.pas' {DynamicRequestClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Dynamic Request Client'; + Application.CreateForm(TDynamicRequestClientMainForm, DynamicRequestClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.dproj new file mode 100644 index 0000000..d3328f3 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.dproj @@ -0,0 +1,72 @@ + + + {4be59863-64da-4c35-b5a2-7d126f6ad7d1} + DynamicRequestClient.dpr + Debug + AnyCPU + DCC32 + DynamicRequestClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + DynamicRequestClient.dpr + + + + + + + MainSource + + +
    DynamicRequestClientMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClientMain.dfm new file mode 100644 index 0000000..842d6b4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClientMain.dfm @@ -0,0 +1,124 @@ +object DynamicRequestClientMainForm: TDynamicRequestClientMainForm + Left = 311 + Top = 174 + AutoScroll = False + Caption = 'Dynamic Request Client' + ClientHeight = 344 + ClientWidth = 335 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 50 + Top = 279 + Width = 212 + Height = 48 + Cursor = crHandPoint + Anchors = [akLeft, akBottom] + ApplicationType = atClient + end + object bSum: TButton + Left = 8 + Top = 5 + Width = 75 + Height = 25 + Caption = 'Sum' + TabOrder = 0 + OnClick = bSumClick + end + object bGetServerTime: TButton + Left = 96 + Top = 5 + Width = 105 + Height = 25 + Caption = 'GetServerTime' + TabOrder = 1 + OnClick = bGetServerTimeClick + end + object bEchoPerson: TButton + Left = 208 + Top = 5 + Width = 121 + Height = 25 + Caption = 'EchoPerson' + TabOrder = 2 + OnClick = bEchoPersonClick + end + object Memo: TMemo + Left = 8 + Top = 39 + Width = 321 + Height = 229 + ScrollBars = ssVertical + TabOrder = 3 + end + object DynamicRequestSum: TRODynamicRequest + RemoteService = RemoteService + MethodName = 'Sum' + Params = < + item + Name = 'A' + DataType = rtInteger + Flag = fIn + end + item + Name = 'B' + DataType = rtInteger + Flag = fIn + end + item + Name = 'Result' + DataType = rtInteger + Flag = fResult + end> + Left = 49 + Top = 3 + end + object EmptyDynamicRequest: TRODynamicRequest + RemoteService = RemoteService + MethodName = 'GetServerTime' + Params = <> + Left = 168 + Top = 3 + end + object DynamicRequestEchoPerson: TRODynamicRequest + RemoteService = RemoteService + MethodName = 'EchoPerson' + Params = < + item + Name = 'aPerson' + DataType = rtUserDefined + Flag = fIn + TypeName = 'TPerson' + end + item + Name = 'anotherPerson' + DataType = rtUserDefined + Flag = fOut + TypeName = 'TPerson' + end> + Left = 290 + Top = 3 + end + object ROWinInetHTTPChannel1: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 252 + Top = 129 + end + object ROBinMessage1: TROBinMessage + Left = 220 + Top = 129 + end + object RemoteService: TRORemoteService + Message = ROBinMessage1 + Channel = ROWinInetHTTPChannel1 + ServiceName = 'DynamicRequestService' + Left = 284 + Top = 129 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClientMain.pas new file mode 100644 index 0000000..09b2cf0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestClientMain.pas @@ -0,0 +1,107 @@ +unit DynamicRequestClientMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uRODynamicRequest, + uROWinInetHttpChannel, uROClient, uROBINMessage, StdCtrls, + uROPoweredByRemObjectsButton, uRORemoteService; + +type + TDynamicRequestClientMainForm = class(TForm) + DynamicRequestSum: TRODynamicRequest; + bSum: TButton; + bGetServerTime: TButton; + EmptyDynamicRequest: TRODynamicRequest; + bEchoPerson: TButton; + DynamicRequestEchoPerson: TRODynamicRequest; + ROWinInetHTTPChannel1: TROWinInetHTTPChannel; + ROBinMessage1: TROBinMessage; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + RemoteService: TRORemoteService; + Memo: TMemo; + procedure bSumClick(Sender: TObject); + procedure bGetServerTimeClick(Sender: TObject); + procedure bEchoPersonClick(Sender: TObject); + private + { Private declarations } + procedure Log(str: string); + public + { Public declarations } + end; + +var + DynamicRequestClientMainForm: TDynamicRequestClientMainForm; + +implementation + +uses DynamicRequestLibrary_Intf; + +{$R *.dfm} + +procedure TDynamicRequestClientMainForm.bSumClick(Sender: TObject); +begin + with DynamicRequestSum do begin + ParamByName('A').AsInteger := 1; + ParamByName('B').AsInteger := 2; + Log('Sum'); + Log('--------'); + Log('sending:' + #9 + ParamByName('A').AsString + ' ' + ParamByName('B').AsString); + Execute; + Log('received:' + #9 + ParamByName('result').AsString); + Log(''); + end; +end; + +procedure TDynamicRequestClientMainForm.bGetServerTimeClick(Sender: TObject); +begin + with EmptyDynamicRequest do begin + MethodName := 'GetServerTime'; + Params.Refresh; + + Execute; + Log('GetServerTime'); + Log('------------------------'); + Log('received:' + #9 + ParamByName('result').AsString); + Log(''); + end; +end; + +procedure TDynamicRequestClientMainForm.bEchoPersonClick(Sender: TObject); +var + aperson, anotherperson: TPerson; +begin + aperson := TPerson.Create; + with DynamicRequestEchoPerson do try + aperson.FirstName := 'John'; + aperson.LastName := 'Smith'; + + Log('EchoPerson'); + Log('-------------------'); + + with aperson do + Log('sending:' + #9 + Firstname + ' ' + LastName); + + ParamByName('aPerson').AsComplexType := aperson; + Execute; + anotherperson := ParamByName('anotherPerson').AsComplexType as TPerson; + if Assigned(anotherperson) then try + Log('received:' + #9 + anotherperson.Firstname + ' ' + anotherperson.LastName); + finally + FreeAndNIL(anotherperson); + end; + ParamByName('anotherPerson').AsComplexType := nil; + Log(''); + finally + FreeAndNIL(aperson); + end; +end; + +procedure TDynamicRequestClientMainForm.Log(str: string); +begin + Memo.Lines.Add(str); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestLibrary.rodl new file mode 100644 index 0000000..a4294c8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestLibrary.rodl @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestLibrary_Intf.pas new file mode 100644 index 0000000..d28dc35 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestLibrary_Intf.pas @@ -0,0 +1,203 @@ +unit DynamicRequestLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{D9821C1A-A084-4120-93F3-BCE6CF2AE0F4}'; + + { Service Interface ID's } + IDynamicRequestService_IID : TGUID = '{D9821C1A-A084-4120-93F3-BCE6CF2AE0F4}'; + + { Event ID's } + +type + { Forward declarations } + IDynamicRequestService = interface; + + TPerson = class; + + + { Enumerateds } + TSex = (sxMale,sxFemale); + + { TPerson } + TPerson = class(TROComplexType) + private + fFirstName: String; + fLastName: String; + fAge: Integer; + fSex: TSex; + public + procedure Assign(iSource: TPersistent); override; + published + property FirstName:String read fFirstName write fFirstName; + property LastName:String read fLastName write fLastName; + property Age:Integer read fAge write fAge; + property Sex:TSex read fSex write fSex; + end; + + { TPersonCollection } + TPersonCollection = class(TROCollection) + protected + constructor Create(aItemClass: TCollectionItemClass); overload; + function GetItems(Index: integer): TPerson; + procedure SetItems(Index: integer; const Value: TPerson); + public + constructor Create; overload; + function Add: TPerson; reintroduce; + property Items[Index: integer]:TPerson read GetItems write SetItems; default; + end; + + { IDynamicRequestService } + IDynamicRequestService = interface + ['{D9821C1A-A084-4120-93F3-BCE6CF2AE0F4}'] + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + procedure EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); + end; + + { CoDynamicRequestService } + CoDynamicRequestService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDynamicRequestService; + end; + + { TDynamicRequestService_Proxy } + TDynamicRequestService_Proxy = class(TROProxy, IDynamicRequestService) + protected + function __GetInterfaceName:string; override; + + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + procedure EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ TPerson } + +procedure TPerson.Assign(iSource: TPersistent); +var lSource:TPerson; +begin + inherited Assign(iSource); + if (iSource is TPerson) then begin + lSource := TPerson(iSource); + FirstName := lSource.FirstName; + LastName := lSource.LastName; + Age := lSource.Age; + Sex := lSource.Sex; + end; +end; + +{ TPersonCollection } +constructor TPersonCollection.Create; +begin + inherited Create(TPerson); +end; + +constructor TPersonCollection.Create(aItemClass: TCollectionItemClass); +begin + inherited Create(aItemClass); +end; + +function TPersonCollection.Add: TPerson; +begin + result := TPerson(inherited Add); +end; + +function TPersonCollection.GetItems(Index: integer): TPerson; +begin + result := TPerson(inherited Items[Index]); +end; + +procedure TPersonCollection.SetItems(Index: integer; const Value: TPerson); +begin + TPerson(inherited Items[Index]).Assign(Value); +end; + +{ CoDynamicRequestService } + +class function CoDynamicRequestService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IDynamicRequestService; +begin + result := TDynamicRequestService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TDynamicRequestService_Proxy } + +function TDynamicRequestService_Proxy.__GetInterfaceName:string; +begin + result := 'DynamicRequestService'; +end; + +function TDynamicRequestService_Proxy.Sum(const A: Integer; const B: Integer): Integer; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'DynamicRequestLibrary', __InterfaceName, 'Sum'); + __Message.Write('A', TypeInfo(Integer), A, []); + __Message.Write('B', TypeInfo(Integer), B, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Integer), result, []); + finally + __Message.FreeStream; + end +end; + +function TDynamicRequestService_Proxy.GetServerTime: DateTime; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'DynamicRequestLibrary', __InterfaceName, 'GetServerTime'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DateTime), result, [paIsDateTime]); + finally + __Message.FreeStream; + end +end; + +procedure TDynamicRequestService_Proxy.EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); +begin + try + anotherPerson := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'DynamicRequestLibrary', __InterfaceName, 'EchoPerson'); + __Message.Write('aPerson', TypeInfo(DynamicRequestLibrary_Intf.TPerson), aPerson, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('anotherPerson', TypeInfo(DynamicRequestLibrary_Intf.TPerson), anotherPerson, []); + finally + __Message.FreeStream; + end +end; + +initialization + RegisterROClass(TPerson); + RegisterProxyClass(IDynamicRequestService_IID, TDynamicRequestService_Proxy); + + +finalization + UnregisterROClass(TPerson); + UnregisterProxyClass(IDynamicRequestService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestLibrary_Invk.pas new file mode 100644 index 0000000..57a60be --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestLibrary_Invk.pas @@ -0,0 +1,101 @@ +unit DynamicRequestLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} DynamicRequestLibrary_Intf; + +type + TDynamicRequestService_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_EchoPerson(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TDynamicRequestService_Invoker } + +procedure TDynamicRequestService_Invoker.Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Sum(const A: Integer; const B: Integer): Integer; } +var + A: Integer; + B: Integer; + lResult: Integer; +begin + try + __Message.Read('A', TypeInfo(Integer), A, []); + __Message.Read('B', TypeInfo(Integer), B, []); + + lResult := (__Instance as IDynamicRequestService).Sum(A, B); + + __Message.InitializeResponseMessage(__Transport, 'DynamicRequestLibrary', 'DynamicRequestService', 'SumResponse'); + __Message.Write('Result', TypeInfo(Integer), lResult, []); + __Message.Finalize; + + finally + end; +end; + +procedure TDynamicRequestService_Invoker.Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetServerTime: DateTime; } +var + lResult: DateTime; +begin + try + lResult := (__Instance as IDynamicRequestService).GetServerTime; + + __Message.InitializeResponseMessage(__Transport, 'DynamicRequestLibrary', 'DynamicRequestService', 'GetServerTimeResponse'); + __Message.Write('Result', TypeInfo(DateTime), lResult, [paIsDateTime]); + __Message.Finalize; + + finally + end; +end; + +procedure TDynamicRequestService_Invoker.Invoke_EchoPerson(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); } +var + aPerson: DynamicRequestLibrary_Intf.TPerson; + anotherPerson: DynamicRequestLibrary_Intf.TPerson; + __lObjectDisposer: TROObjectDisposer; +begin + aPerson := nil; + anotherPerson := nil; + try + __Message.Read('aPerson', TypeInfo(DynamicRequestLibrary_Intf.TPerson), aPerson, []); + + (__Instance as IDynamicRequestService).EchoPerson(aPerson, anotherPerson); + + __Message.InitializeResponseMessage(__Transport, 'DynamicRequestLibrary', 'DynamicRequestService', 'EchoPersonResponse'); + __Message.Write('anotherPerson', TypeInfo(DynamicRequestLibrary_Intf.TPerson), anotherPerson, []); + __Message.Finalize; + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(aPerson); + __lObjectDisposer.Add(anotherPerson); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.bdsproj new file mode 100644 index 0000000..84ae1ea --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + DynamicRequestServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.dpr new file mode 100644 index 0000000..9fda2fa --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.dpr @@ -0,0 +1,20 @@ +program DynamicRequestServer; + +{#ROGEN:DynamicRequestLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + Forms, + DynamicRequestServerMain in 'DynamicRequestServerMain.pas' {DynamicRequestServerMainForm}, + DynamicRequestLibrary_Intf in 'DynamicRequestLibrary_Intf.pas', + DynamicRequestLibrary_Invk in 'DynamicRequestLibrary_Invk.pas', + DynamicRequestService_Impl in 'DynamicRequestService_Impl.pas'; + +{$R *.RES} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'Dynamic Request Server'; + Application.CreateForm(TDynamicRequestServerMainForm, DynamicRequestServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.dproj new file mode 100644 index 0000000..3105dc6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.dproj @@ -0,0 +1,75 @@ + + + {d016a1fd-5969-4cfb-8c2e-5286b5514461} + DynamicRequestServer.dpr + Debug + AnyCPU + DCC32 + DynamicRequestServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + DynamicRequestServer.dpr + + + + + + + MainSource + + + + +
    DynamicRequestServerMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.res new file mode 100644 index 0000000..aa9db5a Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServerMain.dfm new file mode 100644 index 0000000..e64a502 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServerMain.dfm @@ -0,0 +1,36 @@ +object DynamicRequestServerMainForm: TDynamicRequestServerMainForm + Left = 65 + Top = 31 + BorderStyle = bsDialog + Caption = 'Dynamic Request Server' + ClientHeight = 61 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 9 + Top = 4 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object BINMessage: TROBinMessage + Left = 40 + end + object IndyHttpServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'BINMessage' + Message = BINMessage + Enabled = True + PathInfo = '/BIN' + end> + Port = 8099 + Left = 80 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServerMain.pas new file mode 100644 index 0000000..82460e0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestServerMain.pas @@ -0,0 +1,36 @@ +unit DynamicRequestServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Forms, Graphics, uROClient, uROServer, + uROIndyTCPServer, uROIndyHTTPServer, uROBinMessage, Controls, + uROPoweredByRemObjectsButton; + +type + TDynamicRequestServerMainForm = class(TForm) + BINMessage: TROBINMessage; + IndyHttpServer: TROIndyHTTPServer; + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + procedure FormCreate(Sender: TObject); + private + protected + public + end; + +var + DynamicRequestServerMainForm : TDynamicRequestServerMainForm; + +implementation + +uses DynamicRequestLibrary_Intf; + +{$R *.DFM} + +procedure TDynamicRequestServerMainForm.FormCreate(Sender: TObject); +begin + IndyHttpServer.Active := True; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestService_Impl.pas new file mode 100644 index 0000000..b149578 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/DynamicRequestService_Impl.pas @@ -0,0 +1,66 @@ +unit DynamicRequestService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Generated:} DynamicRequestLibrary_Intf; + +type + { TDynamicRequestService } + TDynamicRequestService = class(TRORemotable, IDynamicRequestService) + private + protected + { IDynamicRequestService methods } + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + procedure EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); + end; + +implementation + +uses + {Generated:} DynamicRequestLibrary_Invk; + +procedure Create_DynamicRequestService(out anInstance: IUnknown); +begin + anInstance := TDynamicRequestService.Create; +end; + +{ DynamicRequestService } + +function TDynamicRequestService.Sum(const A: Integer; const B: Integer): Integer; +begin + result := A + B; +end; + +function TDynamicRequestService.GetServerTime: DateTime; +begin + result := Now; +end; + +procedure TDynamicRequestService.EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); +begin + anotherPerson := TPerson.Create; + + anotherPerson.FirstName := aPerson.FirstName; + anotherPerson.LastName := aPerson.LastName; + anotherPerson.Age := aPerson.Age; + anotherPerson.Sex := aPerson.Sex; +end; + +initialization + TROClassFactory.Create('DynamicRequestService', Create_DynamicRequestService, TDynamicRequestService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/RODLFile.RES b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/RODLFile.RES new file mode 100644 index 0000000..2a83e13 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Dynamic Request/RODLFile.RES differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/DownloadFiles/create.dir b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/DownloadFiles/create.dir new file mode 100644 index 0000000..e69de29 diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.Sample.html new file mode 100644 index 0000000..14ed3a2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.Sample.html @@ -0,0 +1,34 @@ + + + + + + + + + +

    + Extended File Transfer  +

    + + +

    Purpose

    + +

    This example shows how to transfer files to and from a RemObjects SDK Server in chunks and how to monitor new files via server events.

    + +

    + Running the Sample

    +
      +
    • Build or Compile both projects.
    • +
    • Launch the server (note that you can modify the upload folder if you wish).
    • +
    • Open at least two clients.
    • +
    +

    + To see exactly what is happening, it is best to change the Download folders so that + each client has its own. +
    + When a file (or files) are uploaded via one client, they are then downloaded to + the other clients.
    +

    + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.bdsgroup new file mode 100644 index 0000000..d517af0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + ExtendedFileTransferServer.bdsproj + ExtendedFileTransferClient.bdsproj + ExtendedFileTransferServer.exe ExtendedFileTransferClient.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.bpg new file mode 100644 index 0000000..31aeef2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = ExtendedFileTransferServer.exe ExtendedFileTransferClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +ExtendedFileTransferServer.exe: ExtendedFileTransferServer.dpr + $(DCC) + +ExtendedFileTransferClient.exe: ExtendedFileTransferClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.groupproj new file mode 100644 index 0000000..c588feb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransfer.groupproj @@ -0,0 +1,40 @@ + + + {93abbe12-86eb-458d-b59c-b049b9510415} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.bdsproj new file mode 100644 index 0000000..01fbbff --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ExtendedFileTransferClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.dpr new file mode 100644 index 0000000..2450d0f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.dpr @@ -0,0 +1,17 @@ +program ExtendedFileTransferClient; + +uses +// uROComInit, + Forms, + ExtendedFileTransferClientMain in 'ExtendedFileTransferClientMain.pas' {ExtendedFileTransferClientMainForm}, + ExtendedFileTransferClientUploadThread in 'ExtendedFileTransferClientUploadThread.pas', + ExtendedFileTransferClientDownloadThread in 'ExtendedFileTransferClientDownloadThread.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Extended File Transfer Client'; + Application.CreateForm(TExtendedFileTransferClientMainForm, ExtendedFileTransferClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.dproj new file mode 100644 index 0000000..26ef57a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.dproj @@ -0,0 +1,74 @@ + + + {9c87266b-b313-4bbb-b6cf-6e7371bfc3cc} + ExtendedFileTransferClient.dpr + Debug + AnyCPU + DCC32 + ExtendedFileTransferClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ExtendedFileTransferClient.dpr + + + + + + + MainSource + + + +
    ExtendedFileTransferClientMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientDownloadThread.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientDownloadThread.pas new file mode 100644 index 0000000..c8c8e79 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientDownloadThread.pas @@ -0,0 +1,199 @@ +unit ExtendedFileTransferClientDownloadThread; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, + uROIndyTCPChannel, uROIndyHTTPChannel, + ExtendedFileTransferLibrary_Intf, uROTypes; + +type + + { TROThread } + TDownloadThread = class(TThread) + private + fROMessage: TROBinMessage; + fROChannel: TROIndyHTTPChannel; + fRORemoteService: TRORemoteService; + fOnAbort: TNotifyEvent; + fOnFinished: TNotifyEvent; + fOnProgress: TNotifyEvent; + fOnStartDownload: TNotifyEvent; + fOnError: TNotifyEvent; + fDownloadOK: Boolean; + fCurrentBytePos: Int64; + fTimeStarted: TDateTime; + fDownloadDir: string; + fFileService: IExtendedFileTransferService; + fErrortext: string; + fFileName: string; + fFileSize: Int64; + fInfoStr: string; + fMaxConnectionErrors, fChannelErrorscount: Integer; + + procedure RunDownload; + procedure ROIndyChannelFailure(Sender: TROTransportChannel; + anException: Exception; var Retry: Boolean); + procedure Run; + + protected + public + property DownloadOK: Boolean read fDownloadOK; + property FileName: string read fFileName; + property FileSize: Int64 read fFileSize; + property InfoStr: string read fInfoStr; + property ErrorText: string read fErrortext; + property CurrentBytePos: Int64 read fCurrentBytePos; + property TimeStarted: TDateTime read fTimeStarted; + constructor Create(aDownloadDir, aFilename: string; aFileSize: Int64; + aOnStartDownload, aOnProgress, aOnFinished, aOnAbort, aOnError: + TNotifyEvent); + destructor Destroy; override; + + procedure Execute; override; + end; + +implementation +uses ExtendedFileTransferClientMain; + +{ TROThread } + +constructor TDownloadThread.Create(aDownloadDir, aFilename: string; aFileSize: + Int64; aOnStartDownload, aOnProgress, aOnFinished, aOnAbort, aOnError: + TNotifyEvent); +begin + inherited Create(TRUE); + fDownloadDir := aDownloadDir; + fFilename := aFilename; + fFileSize := aFileSize; + fmaxconnectionerrors := 5; //try 5 times on channel-error + + fROMessage := TROBinMessage.Create(nil); + + fROChannel := TROIndyHTTPChannel.Create(nil); + fROChannel.OnFailure := ROIndyChannelFailure; + fROChannel.TargetURL := ExtendedFileTransferClientMainForm.ROChannel.TargetURL; + fRORemoteService := TRORemoteService.Create(nil); + + fRORemoteService.Channel := fROChannel; + fRORemoteService.Message := fROMessage; + fRORemoteService.ServiceName := 'ExtendedFileTransferService'; + fFileService := fRORemoteService as IExtendedFileTransferService; + + if assigned(aOnAbort) then fOnAbort := aOnAbort; + if assigned(aOnFinished) then fOnFinished := aOnFinished; + if assigned(aOnProgress) then fOnProgress := aOnProgress; + if assigned(aOnStartDownload) then fOnStartDownload := aOnStartDownload; + if assigned(aOnError) then fOnError := aOnError; + FreeOnTerminate:=True; + Resume; +end; + +destructor TDownloadThread.Destroy; +begin + fFileService := nil; + FreeAndNil(fROMessage); + FreeAndNil(fROChannel); + FreeAndNil(fRORemoteService); + inherited; +end; + +procedure TDownloadThread.Execute; +begin + Run; +end; + +procedure TDownloadThread.Run; +begin + try + RunDownload; + finally + if assigned(fOnFinished) then fOnFinished(Self); + end; +end; + +procedure TDownloadThread.RunDownload; +var + NewFile: TMemoryStream; + Chunk: Binary; + Sequence: Integer; +begin + fDownloadOK := false; + Chunk := nil; + try + if Terminated then begin + if assigned(fOnAbort) then fOnAbort(Self); + exit; + end; + + NewFile := TMemoryStream.Create; + try + fCurrentBytePos := 0; + Sequence := 1; + fTimeStarted := Now; + + fFileService.downloadsequence(fFilename, Sequence, chunk, fFileSize); + + fInfoStr := DateTimetoStr(fTimeStarted) + ' ' + + ExtractFileName(fFilename) + ' ' + + FloatToStrF(fFilesize / 1024, fffixed, 15, 1) + ' KB'; + + if assigned(fOnStartDownload) then + fOnStartDownload(Self); + while (chunk <> nil) and (Chunk.Size > 0) do begin + if Terminated then begin + FreeAndNil(Chunk); + if assigned(fOnAbort) then fOnAbort(Self); + exit; + end; + + NewFile.Seek(0, soFromEnd); + NewFile.CopyFrom(Chunk, Chunk.Size); + Inc(fCurrentBytePos, Chunk.Size); + + FreeAndNil(Chunk); + + if assigned(fOnProgress) then + fOnProgress(Self); + Inc(Sequence); + fFileService.downloadsequence(fFilename, Sequence, chunk, fFileSize); + end; + + fDownloadOK := (NewFile.Size = 0) or (fFileSize = CurrentBytePos); + + if fDownloadOK then begin + NewFile.SaveToFile(IncludeTrailingPathDelimiter(fDownloadDir) + fFilename); + fDownloadOK := Fileexists(IncludeTrailingPathDelimiter(fDownloadDir) + fFilename); + end; + + finally + FreeAndNil(Chunk); + NewFile.Free; + end; + + except + on e: Exception do begin + fErrorText := e.Message; + fDownloadOK := false; + if assigned(fOnError) then fOnError(Self); + end; + end; +end; + +procedure TDownloadThread.ROIndyChannelFailure(Sender: TROTransportChannel; + anException: Exception; var Retry: Boolean); +begin + if fChannelErrorscount > fMaxConnectionerrors then begin + fErrorText := anException.Message; + Self.terminate; + end + else begin + inc(fChannelErrorscount); + sleep(1000); + Retry := true; + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientMain.dfm new file mode 100644 index 0000000..b158dcd --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientMain.dfm @@ -0,0 +1,91 @@ +object ExtendedFileTransferClientMainForm: TExtendedFileTransferClientMainForm + Left = 451 + Top = 393 + ActiveControl = UploadButton + AutoScroll = False + Caption = 'Extended File Transfer Client' + ClientHeight = 369 + ClientWidth = 615 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Label4: TLabel + Left = 7 + Top = 9 + Width = 80 + Height = 13 + Caption = 'Download folder:' + end + object UploadButton: TButton + Left = 222 + Top = 343 + Width = 171 + Height = 22 + Anchors = [akLeft, akBottom] + Caption = 'Upload to other client(s)' + TabOrder = 3 + OnClick = UploadButtonClick + end + object eFolder: TEdit + Left = 91 + Top = 5 + Width = 486 + Height = 21 + Anchors = [akLeft, akTop, akRight] + Color = clBtnFace + ReadOnly = True + TabOrder = 0 + end + object bSelectFolder: TButton + Left = 583 + Top = 4 + Width = 22 + Height = 22 + Anchors = [akTop, akRight] + Caption = '...' + TabOrder = 1 + OnClick = bSelectFolderClick + end + object Memo: TMemo + Left = 0 + Top = 29 + Width = 615 + Height = 310 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssBoth + TabOrder = 2 + end + object ROMessage: TROBinMessage + Left = 95 + Top = 120 + end + object ROChannel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 67 + Top = 120 + end + object RORemoteService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'ExtendedFileTransferService' + Left = 123 + Top = 120 + end + object EventReceiver: TROEventReceiver + Interval = 1200 + Message = ROMessage + Channel = ROChannel + ServiceName = 'ExtendedFileTransferService' + Left = 152 + Top = 121 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientMain.pas new file mode 100644 index 0000000..6ca4b51 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientMain.pas @@ -0,0 +1,239 @@ +{ Extented FileTransfer-Example by Joe Blocher (www.myticket.at) + based on + Remobjects: Filetransfer-Example, Threads-Example + Eric Hill (TeamRO): Block-Transfer + + * Simultanous uploading files using threads (Multiselect in OpenDialog) + * All other clients will start download automatically +} + +unit ExtendedFileTransferClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + Buttons, SyncObjs, ExtendedFileTransferLibrary_Intf, + uROEventRepository; + +type + TExtendedFileTransferClientMainForm = class(TForm, IFileEvents) + ROMessage: TROBinMessage; + ROChannel: TROWinInetHTTPChannel; + RORemoteService: TRORemoteService; + UploadButton: TButton; + EventReceiver: TROEventReceiver; + Label4: TLabel; + eFolder: TEdit; + bSelectFolder: TButton; + Memo: TMemo; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure UploadButtonClick(Sender: TObject); + procedure bSelectFolderClick(Sender: TObject); + private + { Private declarations } + fCritical: TCriticalSection; + fFileService: IExtendedFileTransferService; + procedure Log(Mes: Widestring); + procedure OnDownloadAborted(Sender: TObject); + procedure OnDownloadError(Sender: TObject); + procedure OnDownloadFinished(Sender: TObject); + procedure OnDownloadProgress(Sender: TObject); + procedure OnDownloadStarted(Sender: TObject); + procedure OnUploadAborted(Sender: TObject); + procedure OnUploadError(Sender: TObject); + procedure OnUploadFinished(Sender: TObject); + procedure OnUploadProgress(Sender: TObject); + procedure OnUploadStarted(Sender: TObject); + {IFileEvents} + procedure OnNewFileAvailable(const filename: Widestring; const filesize: Int64); + public + { Public declarations } + end; + +var + ExtendedFileTransferClientMainForm: TExtendedFileTransferClientMainForm; + +implementation +uses + FileCtrl, + ExtendedFileTransferClientUploadThread, + ExtendedFileTransferClientDownloadThread; + +{$R *.dfm} + +procedure TExtendedFileTransferClientMainForm.FormCreate(Sender: TObject); +begin + fCritical := TCriticalSection.create; + eFolder.Text := ExtractFilePath(Paramstr(0)) + 'DownloadFiles\'; + ForceDirectories(eFolder.Text); + fFileService := RORemoteService as IExtendedFileTransferService; + EventReceiver.RegisterEventHandlers([EID_FileEvents], [Self]); + EventReceiver.Active := True; +end; + +procedure TExtendedFileTransferClientMainForm.FormDestroy(Sender: TObject); +begin + try + EventReceiver.Active := False; + EventReceiver.UnregisterEventHandlers([EID_FileEvents]); + finally + fFileService := nil; + fCritical.Free; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnDownloadAborted(Sender: TObject); +begin + fCritical.Enter; + with Sender as TDownloadThread do try + // Do something + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnDownloadError(Sender: TObject); + +begin + fCritical.Enter; + with Sender as TDownloadThread do try + Log('Download ' + Filename + ': ' + Errortext); + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnDownloadStarted(Sender: TObject); +begin + fCritical.Enter; + with Sender as TDownloadThread do try + Log(InfoStr + ': Download started'); + //Do something other: create new Progressbar (Max = FileSize .... ) + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnDownloadProgress(Sender: TObject); +begin + fCritical.Enter; + try + //Update Progressbar .... Use CurrentBytePos + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnDownloadFinished(Sender: TObject); +begin + fCritical.Enter; + with Sender as TDownloadThread do try + if DownloadOK then begin + Log(InfoStr + ': Download finished'); + end; + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnUploadAborted(Sender: TObject); +begin + fCritical.Enter; + with Sender as TUploadThread do try + // Do something -> Add Serviceoperation: Delete File .... + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnUploadError(Sender: TObject); + +begin + fCritical.Enter; + with Sender as TUploadThread do try + Log('Upload ' + Filename + ': ' + Errortext); + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnUploadStarted(Sender: TObject); +begin + fCritical.Enter; + with Sender as TUploadThread do try + Log(InfoStr + ': Upload started'); + //Do something other: create Progressbar (Max = FileSize .... ) + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnUploadProgress(Sender: TObject); +begin + fCritical.Enter; + try + //Update Progressbar .... Use CurrentBytePos + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnUploadFinished(Sender: TObject); +begin + fCritical.Enter; + with Sender as TUploadThread do try + if UploadOK then begin + Log(InfoStr + ': Upload finished'); + fFileService.uploadfinished(Filename, FileSize); + end; + finally + fCritical.Leave; + end; +end; + +procedure TExtendedFileTransferClientMainForm.UploadButtonClick(Sender: TObject); +var + i: Integer; +begin + with TOpendialog.Create(nil) do try + InitialDir := 'c:\'; + Filename := '*.*'; + Filter := 'All Files (*.*)|*.*'; + Filterindex := 1; + options := options + [ofAllowMultiSelect]; + if Execute then + for i := 0 to Files.count - 1 do + TUploadThread.Create(Files[i], OnUploadStarted, OnUploadProgress, OnUploadFinished, OnUploadAborted, OnUploadError); + finally + free; + end; +end; + +procedure TExtendedFileTransferClientMainForm.OnNewFileAvailable(const filename: Widestring; const filesize: + Int64); +begin + TDownloadThread.Create(eFolder.Text, filename, filesize, + OnDownloadStarted, OnDownloadProgress, OnDownloadFinished, + OnDownloadAborted, OnDownloadError); +end; + +procedure TExtendedFileTransferClientMainForm.bSelectFolderClick( + Sender: TObject); +var + ffolder: string; +begin + ffolder := eFolder.Text; + SelectDirectory(ffolder, [sdAllowCreate, sdPerformCreate, sdPrompt], 0); + eFolder.Text := IncludeTrailingPathDelimiter(ffolder); +end; + +procedure TExtendedFileTransferClientMainForm.Log(Mes: Widestring); +begin + Memo.Lines.Add(Mes); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientUploadThread.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientUploadThread.pas new file mode 100644 index 0000000..297f6db --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferClientUploadThread.pas @@ -0,0 +1,215 @@ +unit ExtendedFileTransferClientUploadThread; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, + uROIndyTCPChannel, uROIndyHTTPChannel, + ExtendedFileTransferLibrary_Intf, uROTypes; + +type + + { TROThread } + TUploadThread = class(TThread) + private + fROMessage: TROBinMessage; + fROChannel: TROIndyHTTPChannel; + fRORemoteService: TRORemoteService; + fOnAbort: TNotifyEvent; + fOnFinished: TNotifyEvent; + fOnProgress: TNotifyEvent; + fOnStartUpload: TNotifyEvent; + fOnError: TNotifyEvent; + fFileName: string; + fUploadOK: Boolean; + fFileSize: Int64; + fCurrentBytePos: Int64; + fTimeStarted: TDateTime; + fFileService: IExtendedFileTransferService; + fErrorText: string; + fInfoStr: string; + fMaxConnectionErrors, fChannelErrorscount: Integer; + procedure Runupload; + function GetUploadChunk(FileMemStream: TMemoryStream; aSize: Int64; + const Sequence: Integer): Binary; + procedure ROIndyChannelFailure(Sender: TROTransportChannel; + anException: Exception; var Retry: Boolean); + procedure Run; + + protected + public + property UploadOK: Boolean read fUploadOK; + property FileSize: Int64 read fFileSize; + property CurrentBytePos: Int64 read fCurrentBytePos; + property TimeStarted: TDateTime read fTimeStarted; + property ErrorText: string read fErrortext; + property Filename: string read fFilename; + property InfoStr: string read fInfoStr; + constructor Create(aFileName: string; aOnStartUpload, aOnProgress, + aOnFinished, aOnAbort, aOnError: TNotifyEvent); + destructor Destroy; override; + + procedure Execute; override; + end; + +implementation +uses ExtendedFileTransferClientMain; + +{ TROThread } + +constructor TUploadThread.Create(aFileName: string; aOnStartUpload, aOnProgress, + aOnFinished, aOnAbort, aOnError: TNotifyEvent); +begin + inherited Create(TRUE); + fFilename := aFilename; + fmaxconnectionerrors := 5; //try 5 times on channel-error + + fROMessage := TROBinMessage.Create(nil); + fROChannel := TROIndyHTTPChannel.Create(nil); + fROChannel.OnFailure := ROIndyChannelFailure; + fROChannel.TargetURL :=ExtendedFileTransferClientMainForm.ROChannel.TargetURL; + + fRORemoteService := TRORemoteService.Create(nil); + fRORemoteService.Channel := fROChannel; + fRORemoteService.Message := fROMessage; + fRORemoteService.ServiceName := 'ExtendedFileTransferService'; + fFileService := fRORemoteService as IExtendedFileTransferService; + + if assigned(aOnAbort) then fOnAbort := aOnAbort; + if assigned(aOnFinished) then fOnFinished := aOnFinished; + if assigned(aOnProgress) then fOnProgress := aOnProgress; + if assigned(aOnStartUpload) then fOnStartUpload := aOnStartUpload; + if assigned(aOnError) then fOnError := aOnError; + FreeOnTerminate:=True; + Resume; +end; + +destructor TUploadThread.Destroy; +begin + fFileService := nil; + FreeAndNil(fROMessage); + FreeAndNil(fROChannel); + FreeAndNil(fRORemoteService); + inherited; +end; + +procedure TUploadThread.Run; +begin + try + RunUpload; + finally + if assigned(fOnFinished) then fOnFinished(Self); + end; +end; + +procedure TUploadThread.Execute; +begin + Run; +end; + +function TUploadThread.GetUploadChunk(FileMemStream: TMemoryStream; aSize: + Int64; const Sequence: Integer): Binary; +const + Block: Integer = 65536; +var + Position: Int64; +begin + Result := Binary.Create; + Position := Block * (Sequence - 1); + if Position <= aSize then begin + FileMemStream.Position := Position; + if Position + Block > aSize then + Result.CopyFrom(FileMemStream, aSize - Position) + else + Result.CopyFrom(FileMemStream, Block); + end; +end; + +procedure TUploadThread.Runupload; +var + FileMemStream: TMemoryStream; + Chunk: Binary; + Sequence: Int64; + isfirst: Boolean; +begin + fErrorText := ''; + fUploadOK := false; + fChannelErrorscount := 0; + fCurrentBytePos := 0; + Sequence := 1; + fTimeStarted := Now; + FileMemStream := nil; + isfirst := true; + try + + if FileExists(fFilename) then try + FileMemStream := TMemoryStream.Create; + + FileMemStream.LoadFromFile(fFileName); + fFileName := ExtractFileName(fFileName); + + fFileSize := FileMemStream.Size; + + fInfoStr := DateTimetoStr(fTimeStarted) + ' ' + + fFileName + ' ' + + FloatToStrF(Filesize / 1024, fffixed, 15, 1) + ' KB'; + + if assigned(fOnStartUpload) then fOnStartUpload(Self); + Chunk := GetUploadChunk(FileMemStream, fFileSize, Sequence); + Inc(fCurrentBytePos, Chunk.Size); + Inc(Sequence); + try + fFileService.uploadChunk(isfirst, fFileName, Chunk); + FreeAndNil(Chunk); + isfirst := false; + Chunk := GetUploadChunk(FileMemStream, fFileSize, Sequence); + while Chunk.Size > 0 do begin + + if Terminated then begin + if assigned(fOnAbort) then fOnAbort(Self); + exit; + end; + + fFileService.uploadChunk(isfirst, fFileName, Chunk); + + Inc(fCurrentBytePos, Chunk.Size); + FreeAndNil(Chunk); + + Inc(Sequence); + if assigned(fOnProgress) then fOnProgress(Self); + Chunk := GetUploadChunk(FileMemStream, fFileSize, Sequence); + end; + + fUploadOK := (FileSize = 0) or (FileSize = CurrentBytePos); + finally + FreeAndNil(Chunk); + end; + finally + FileMemStream.Free; + end; + + except + on e: Exception do begin + fErrorText := e.Message; + if assigned(fOnError) then fOnError(Self); + end; + end; +end; + +procedure TUploadThread.ROIndyChannelFailure(Sender: TROTransportChannel; + anException: Exception; var Retry: Boolean); +begin + if fChannelErrorscount > fMaxConnectionerrors then begin + fErrorText := anException.Message; + Self.terminate; + end + else begin + inc(fChannelErrorscount); + sleep(1000); + Retry := true; + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferLibrary.rodl new file mode 100644 index 0000000..60b0c91 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferLibrary.rodl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferLibrary_Intf.pas new file mode 100644 index 0000000..554200f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferLibrary_Intf.pas @@ -0,0 +1,209 @@ +unit ExtendedFileTransferLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{915A4222-6FA3-43A2-AE8B-C517E0F844BB}'; + TargetNamespace = ''; + + { Service Interface ID's } + IExtendedFileTransferService_IID : TGUID = '{2A7AFE06-0600-46ED-9B7A-C694A1191311}'; + + { Event ID's } + EID_FileEvents = 'FileEvents'; + +type + { Forward declarations } + IExtendedFileTransferService = interface; + + IFileEvents = interface; + + + { IExtendedFileTransferService } + IExtendedFileTransferService = interface + ['{2A7AFE06-0600-46ED-9B7A-C694A1191311}'] + procedure downloadsequence(const filename: Widestring; const sequence: Integer; out filedata: Binary; out filesize: Int64); + procedure uploadchunk(const isfirst: Boolean; const filename: Widestring; const filedata: Binary); + procedure uploadfinished(const filename: Widestring; const filesize: Int64); + end; + + { CoExtendedFileTransferService } + CoExtendedFileTransferService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IExtendedFileTransferService; + end; + + { TExtendedFileTransferService_Proxy } + TExtendedFileTransferService_Proxy = class(TROProxy, IExtendedFileTransferService) + protected + function __GetInterfaceName:string; override; + + procedure downloadsequence(const filename: Widestring; const sequence: Integer; out filedata: Binary; out filesize: Int64); + procedure uploadchunk(const isfirst: Boolean; const filename: Widestring; const filedata: Binary); + procedure uploadfinished(const filename: Widestring; const filesize: Int64); + end; + + { IFileEvents } + IFileEvents = interface + ['{E03490F1-99B5-4310-B3E8-F4C96BEAD1A5}'] + procedure OnNewFileAvailable(const filename: Widestring; const filesize: Int64); + end; + + { IFileEvents_Writer } + IFileEvents_Writer = interface(IROEventWriter) + ['{E03490F1-99B5-4310-B3E8-F4C96BEAD1A5}'] + procedure OnNewFileAvailable(const __Sender : TGUID; const filename: Widestring; const filesize: Int64); + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoExtendedFileTransferService } + +class function CoExtendedFileTransferService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IExtendedFileTransferService; +begin + result := TExtendedFileTransferService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TExtendedFileTransferService_Proxy } + +function TExtendedFileTransferService_Proxy.__GetInterfaceName:string; +begin + result := 'ExtendedFileTransferService'; +end; + +procedure TExtendedFileTransferService_Proxy.downloadsequence(const filename: Widestring; const sequence: Integer; out filedata: Binary; out filesize: Int64); +begin + try + filedata := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'ExtendedFileTransferLibrary', __InterfaceName, 'downloadsequence'); + __Message.Write('filename', TypeInfo(Widestring), filename, []); + __Message.Write('sequence', TypeInfo(Integer), sequence, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('filedata', TypeInfo(Binary), filedata, []); + __Message.Read('filesize', TypeInfo(Int64), filesize, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TExtendedFileTransferService_Proxy.uploadchunk(const isfirst: Boolean; const filename: Widestring; const filedata: Binary); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ExtendedFileTransferLibrary', __InterfaceName, 'uploadchunk'); + __Message.Write('isfirst', TypeInfo(Boolean), isfirst, []); + __Message.Write('filename', TypeInfo(Widestring), filename, []); + __Message.Write('filedata', TypeInfo(Binary), filedata, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TExtendedFileTransferService_Proxy.uploadfinished(const filename: Widestring; const filesize: Int64); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ExtendedFileTransferLibrary', __InterfaceName, 'uploadfinished'); + __Message.Write('filename', TypeInfo(Widestring), filename, []); + __Message.Write('filesize', TypeInfo(Int64), filesize, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +type + { TFileEvents_Writer } + TFileEvents_Writer = class(TROEventWriter, IFileEvents_Writer) + protected + procedure OnNewFileAvailable(const __Sender : TGUID; const filename: Widestring; const filesize: Int64); + end; + +procedure TFileEvents_Writer.OnNewFileAvailable(const __Sender : TGUID; const filename: Widestring; const filesize: Int64); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'ExtendedFileTransferLibrary', EID_FileEvents, 'OnNewFileAvailable'); + __Message.Write('filename', TypeInfo(Widestring), filename, []); + __Message.Write('filesize', TypeInfo(Int64), filesize, []); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +type + { TFileEvents_Invoker } + TFileEvents_Invoker = class(TROEventInvoker) + published + procedure Invoke_OnNewFileAvailable(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + end; + +procedure TFileEvents_Invoker.Invoke_OnNewFileAvailable(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; + filename: Widestring; + filesize: Int64; +begin + + try + __Message.Read('filename', TypeInfo(Widestring), filename, []); + __Message.Read('filesize', TypeInfo(Int64), filesize, []); + + (__Target as IFileEvents).OnNewFileAvailable(filename, filesize); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + finally + __lObjectDisposer.Free(); + end + end +end; + +initialization + RegisterProxyClass(IExtendedFileTransferService_IID, TExtendedFileTransferService_Proxy); + + RegisterEventWriterClass(IFileEvents_Writer, TFileEvents_Writer); + RegisterEventInvokerClass(EID_FileEvents, TFileEvents_Invoker); + +finalization + UnregisterProxyClass(IExtendedFileTransferService_IID); + + UnregisterEventWriterClass(IFileEvents_Writer); + UnregisterEventInvokerClass(EID_FileEvents); +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferLibrary_Invk.pas new file mode 100644 index 0000000..752830d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferLibrary_Invk.pas @@ -0,0 +1,132 @@ +unit ExtendedFileTransferLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} ExtendedFileTransferLibrary_Intf; + +type + TExtendedFileTransferService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_downloadsequence(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_uploadchunk(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_uploadfinished(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TExtendedFileTransferService_Invoker } + +constructor TExtendedFileTransferService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TExtendedFileTransferService_Invoker.Invoke_downloadsequence(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure downloadsequence(const filename: Widestring; const sequence: Integer; out filedata: Binary; out filesize: Int64); } +var + filename: Widestring; + sequence: Integer; + filedata: Binary; + filesize: Int64; + __lObjectDisposer: TROObjectDisposer; +begin + filedata := nil; + try + __Message.Read('filename', TypeInfo(Widestring), filename, []); + __Message.Read('sequence', TypeInfo(Integer), sequence, []); + + (__Instance as IExtendedFileTransferService).downloadsequence(filename, sequence, filedata, filesize); + + __Message.InitializeResponseMessage(__Transport, 'ExtendedFileTransferLibrary', 'ExtendedFileTransferService', 'downloadsequenceResponse'); + __Message.Write('filedata', TypeInfo(Binary), filedata, []); + __Message.Write('filesize', TypeInfo(Int64), filesize, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(filedata); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TExtendedFileTransferService_Invoker.Invoke_uploadchunk(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure uploadchunk(const isfirst: Boolean; const filename: Widestring; const filedata: Binary); } +var + isfirst: Boolean; + filename: Widestring; + filedata: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + filedata := nil; + try + __Message.Read('isfirst', TypeInfo(Boolean), isfirst, []); + __Message.Read('filename', TypeInfo(Widestring), filename, []); + __Message.Read('filedata', TypeInfo(Binary), filedata, []); + + (__Instance as IExtendedFileTransferService).uploadchunk(isfirst, filename, filedata); + + __Message.InitializeResponseMessage(__Transport, 'ExtendedFileTransferLibrary', 'ExtendedFileTransferService', 'uploadchunkResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + __oResponseOptions := [roNoResponse]; + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(filedata); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TExtendedFileTransferService_Invoker.Invoke_uploadfinished(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure uploadfinished(const filename: Widestring; const filesize: Int64); } +var + filename: Widestring; + filesize: Int64; +begin + try + __Message.Read('filename', TypeInfo(Widestring), filename, []); + __Message.Read('filesize', TypeInfo(Int64), filesize, []); + + (__Instance as IExtendedFileTransferService).uploadfinished(filename, filesize); + + __Message.InitializeResponseMessage(__Transport, 'ExtendedFileTransferLibrary', 'ExtendedFileTransferService', 'uploadfinishedResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.bdsproj new file mode 100644 index 0000000..111d4dc --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ExtendedFileTransferServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.dpr new file mode 100644 index 0000000..99d529b --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.dpr @@ -0,0 +1,30 @@ +program ExtendedFileTransferServer; + +{#ROGEN:ExtendedFileTransferLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + ExtendedFileTransferServerData in 'ExtendedFileTransferServerData.pas' {ExtendedFileTransferServerDataForm: TDataModule}, + ExtendedFileTransferServerMain in 'ExtendedFileTransferServerMain.pas' {ExtendedFileTransferServerMainForm}, + ExtendedFileTransferLibrary_Intf in 'ExtendedFileTransferLibrary_Intf.pas', + ExtendedFileTransferLibrary_Invk in 'ExtendedFileTransferLibrary_Invk.pas', + ExtendedFileTransferService_Impl in 'ExtendedFileTransferService_Impl.pas' {ExtendedFileTransferService: TRORemoteDataModule}; + +{$R *.res} +{$R RODLFile.res} + +begin + if ROStartService('FileTransferEx', 'FileTransferEx') then begin + ROService.CreateForm(TExtendedFileTransferServerDataForm, ExtendedFileTransferServerDataForm); + ROService.Run; + Exit; + end; + + Application.Initialize; + Application.Title := 'Extended File Transfer Server'; + Application.CreateForm(TExtendedFileTransferServerDataForm, ExtendedFileTransferServerDataForm); + Application.CreateForm(TExtendedFileTransferServerMainForm, ExtendedFileTransferServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.dproj new file mode 100644 index 0000000..55479c0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.dproj @@ -0,0 +1,80 @@ + + + {91fd316e-e998-4bae-842e-a815181a9ef0} + ExtendedFileTransferServer.dpr + Debug + AnyCPU + DCC32 + ExtendedFileTransferServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ExtendedFileTransferServer.dpr + + + + + + + MainSource + + + + +
    ExtendedFileTransferServerDataForm
    +
    + +
    ExtendedFileTransferServerMainForm
    +
    + +
    ExtendedFileTransferService
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.res new file mode 100644 index 0000000..95e15d9 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerData.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerData.dfm new file mode 100644 index 0000000..4054d3b --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerData.dfm @@ -0,0 +1,35 @@ +object ExtendedFileTransferServerDataForm: TExtendedFileTransferServerDataForm + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 276 + Top = 104 + Height = 192 + Width = 242 + object ROMessage: TROBinMessage + Left = 42 + Top = 24 + end + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 90 + Top = 10 + end + object ROInMemoryEventRepository: TROInMemoryEventRepository + Message = ROMessage + SessionManager = ROInMemorySessionManager + Left = 41 + Top = 105 + end + object ROInMemorySessionManager: TROInMemorySessionManager + SessionDuration = 1 + Left = 40 + Top = 62 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerData.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerData.pas new file mode 100644 index 0000000..f9c0c08 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerData.pas @@ -0,0 +1,37 @@ +unit ExtendedFileTransferServerData; + +interface + +uses + SysUtils, Classes, uROClient, uROServer, uROIndyTCPServer, + uROPoweredByRemObjectsButton, uROClientIntf, uROClasses, + uROBinMessage, uROIndyHTTPServer, uROSessions, uROEventRepository; + +type + TExtendedFileTransferServerDataForm = class(TDataModule) + ROMessage: TROBinMessage; + ROServer: TROIndyHTTPServer; + ROInMemoryEventRepository: TROInMemoryEventRepository; + ROInMemorySessionManager: TROInMemorySessionManager; + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ExtendedFileTransferServerDataForm: TExtendedFileTransferServerDataForm; + uploadFolder: string; + +implementation + +{$R *.dfm} + +procedure TExtendedFileTransferServerDataForm.DataModuleCreate(Sender: TObject); +begin + ROServer.Active := TRUE; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerMain.dfm new file mode 100644 index 0000000..ac624f8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerMain.dfm @@ -0,0 +1,65 @@ +object ExtendedFileTransferServerMainForm: TExtendedFileTransferServerMainForm + Left = 373 + Top = 250 + ActiveControl = bSelectFolder + BorderStyle = bsDialog + Caption = 'Extended File Transfer Server' + ClientHeight = 176 + ClientWidth = 435 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 111 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Label1: TLabel + Left = 8 + Top = 58 + Width = 66 + Height = 13 + Caption = 'Upload folder:' + end + object eFolder: TEdit + Left = 8 + Top = 72 + Width = 389 + Height = 21 + Anchors = [akLeft, akTop, akRight] + Color = clBtnFace + ReadOnly = True + TabOrder = 0 + end + object bSelectFolder: TButton + Left = 405 + Top = 71 + Width = 22 + Height = 22 + Anchors = [akTop, akRight] + Caption = '...' + TabOrder = 1 + OnClick = bSelectFolderClick + end + object Memo1: TMemo + Left = 8 + Top = 104 + Width = 393 + Height = 57 + BorderStyle = bsNone + Color = cl3DLight + Lines.Strings = ( + 'When a client uploads a file:' + '1) it is transferred to the Upload folder specified above' + + '2) it is then downloaded into the Download folder of other clien' + + 'ts') + TabOrder = 2 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerMain.pas new file mode 100644 index 0000000..cfcb7f8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferServerMain.pas @@ -0,0 +1,50 @@ +unit ExtendedFileTransferServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, uROClasses; + +type + TExtendedFileTransferServerMainForm = class(TForm) + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + Label1: TLabel; + eFolder: TEdit; + bSelectFolder: TButton; + Memo1: TMemo; + procedure bSelectFolderClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ExtendedFileTransferServerMainForm: TExtendedFileTransferServerMainForm; + +implementation +uses + FileCtrl, + ExtendedFileTransferServerData; +{$R *.dfm} + +procedure TExtendedFileTransferServerMainForm.bSelectFolderClick( + Sender: TObject); +begin + SelectDirectory(ExtendedFileTransferServerData.uploadFolder, [sdAllowCreate, sdPerformCreate, sdPrompt], 0); + ExtendedFileTransferServerData.uploadFolder := IncludeTrailingPathDelimiter(ExtendedFileTransferServerData.uploadFolder); + eFolder.Text := ExtendedFileTransferServerData.uploadFolder; + ForceDirectories(eFolder.Text); +end; + +procedure TExtendedFileTransferServerMainForm.FormCreate(Sender: TObject); +begin + eFolder.Text := ExtractFilePath(ParamStr(0)) + 'ServerFiles\'; + ForceDirectories(eFolder.Text); + ExtendedFileTransferServerData.uploadFolder := eFolder.Text; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferService_Impl.dfm new file mode 100644 index 0000000..f272f5a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferService_Impl.dfm @@ -0,0 +1,9 @@ +object ExtendedFileTransferService: TExtendedFileTransferService + OldCreateOrder = True + SessionManager = ExtendedFileTransferServerDataForm.ROInMemorySessionManager + EventRepository = ExtendedFileTransferServerDataForm.ROInMemoryEventRepository + Left = 200 + Top = 200 + Height = 139 + Width = 218 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferService_Impl.pas new file mode 100644 index 0000000..9398ca0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ExtendedFileTransferService_Impl.pas @@ -0,0 +1,104 @@ +unit ExtendedFileTransferService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, uRORemoteDataModule, + {Generated:} ExtendedFileTransferLibrary_Intf, + ExtendedFileTransferServerData; + +type + { TExtendedFileTransferService } + TExtendedFileTransferService = class(TRORemoteDataModule, IExtendedFileTransferService) + private + function getFileDirectory: Widestring; + protected + { IExtendedFileTransferService methods } + procedure downloadsequence(const filename: Widestring; const sequence: Integer; out filedata: Binary; out filesize: Int64); + procedure uploadchunk(const isfirst: Boolean; const filename: Widestring; const filedata: Binary); + procedure uploadfinished(const filename: Widestring; const filesize: Int64); + end; + +implementation +{$R *.dfm} +uses + {Generated:} ExtendedFileTransferLibrary_Invk; + +procedure Create_ExtendedFileTransferService(out anInstance: IUnknown); +begin + anInstance := TExtendedFileTransferService.Create(nil); +end; + +{ ExtendedFileTransferService } + +procedure TExtendedFileTransferService.downloadsequence(const filename: Widestring; const sequence: Integer; out filedata: Binary; out filesize: Int64); +const + Block: Integer = 65536; +var + Position: Int64; + MemStream: TFileStream; + localfilename: Widestring; +begin + fileData := Binary.Create; + localfilename := getFileDirectory + filename; + if not FileExists(localfilename) then exit; + MemStream := TFileStream.Create(localfilename, fmopenRead); + try + FileSize := MemStream.Size; + Position := Block * (Sequence - 1); + if Position <= FileSize then begin + MemStream.Position := Position; + if Position + Block > FileSize then + fileData.CopyFrom(MemStream, FileSize - Position) + else + fileData.CopyFrom(MemStream, Block); + end; + finally + MemStream.Free; + end; +end; + +function TExtendedFileTransferService.getFileDirectory: Widestring; +begin + result := ExtendedFileTransferServerData.uploadFolder; +end; + +procedure TExtendedFileTransferService.uploadchunk(const isfirst: Boolean; const filename: Widestring; const filedata: Binary); +var + NewFile: TFileStream; + localfilename: Widestring; +begin + localfilename := getFileDirectory + filename; + if isfirst and Fileexists(localfilename) then DeleteFile(localfilename); + if FileExists(localfilename) then + NewFile := TFileStream.Create(localfilename, fmOpenReadWrite) + else + NewFile := TFileStream.Create(localfilename, fmCreate); + try + NewFile.Seek(0, soFromEnd); + filedata.SaveToStream(NewFile); + finally + NewFile.Free; + end; +end; + +procedure TExtendedFileTransferService.uploadfinished(const filename: Widestring; const filesize: Int64); +begin + (EventRepository as IFileEvents_Writer).OnNewFileAvailable(Session.SessionID, filename, filesize); +end; + +initialization + TROClassFactory.Create('ExtendedFileTransferService', Create_ExtendedFileTransferService, TExtendedFileTransferService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/RODLFILE.res new file mode 100644 index 0000000..4e99fdd Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ServerFiles/create.dir b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Extended File Transfer/ServerFiles/create.dir new file mode 100644 index 0000000..e69de29 diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.Sample.html new file mode 100644 index 0000000..3bddd34 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.Sample.html @@ -0,0 +1,48 @@ + + + + + + + + + +

    + FirstSample +

    + + +

    Purpose

    + +

    This sample provides an introduction to using the Delphi edition of the RemObjects SDK product. The example shows how to define/implement methods on the server and how to access them from the client. The data consists of name information and four simple methods are provided by the service: Nicknames, VerifyName, CheckName and FullNames.

    + +

    Getting Started

    +
      +
    • Build or compile both projects.
    • +
    • Launch the server (via the menu option: RemObjects | Launch Server Executable).
    • +
    • Ensure that FirstSampleClient is the selected project and run it.
    • +
    • Check that the client buttons work as expected.
    • +
    • Modify the server names list and retry client actions.
    • +
    +

    Examine the Code

    +
      +
    • + See how the four methods were defined by editing the service library. + Do this by making the server the selected project and + by using the menu option: RemObjects | Edit Service Library. + Note: if you don't see this menu option but see 'Service Builder' instead, + you still have the client set as the current project. + Examine the methods added to FirstSampleService. +
    • +
    • + Check how the server methods were implemented in + FirstSampleService_Impl.pas. +
    • +
    • + Examine the simple code needed to invoke the methods in + FirstSampleClientMain.pas. +
    • +
    + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.bdsgroup new file mode 100644 index 0000000..ca7b4af --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + FirstSampleServer.bdsproj + FirstSampleClient.bdsproj + FirstSampleServer.exe FirstSampleClient.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.bpg new file mode 100644 index 0000000..1de9e53 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = FirstSampleServer.exe FirstSampleClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +FirstSampleServer.exe: FirstSampleServer.dpr + $(DCC) + +FirstSampleClient.exe: FirstSampleClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.groupproj new file mode 100644 index 0000000..c7cf1ad --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.groupproj @@ -0,0 +1,40 @@ + + + {2eda1776-3224-4223-aefc-d172f74514f9} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.rodl new file mode 100644 index 0000000..3c02c59 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample.rodl @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.bdsproj new file mode 100644 index 0000000..52080c7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + FirstSampleClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.dpr new file mode 100644 index 0000000..a0470c2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.dpr @@ -0,0 +1,14 @@ +program FirstSampleClient; + +uses + Forms, + FirstSample_Intf in 'FirstSample_Intf.pas', + FirstSampleClientMain in 'FirstSampleClientMain.pas' {FirstSampleClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TFirstSampleClientMainForm, FirstSampleClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.dproj new file mode 100644 index 0000000..4554f7a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.dproj @@ -0,0 +1,73 @@ + + + {e57c53cf-fbec-4c7d-9e68-1fabdf6c87ab} + FirstSampleClient.dpr + Debug + AnyCPU + DCC32 + FirstSampleClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + FirstSampleClient.dpr + + + + + + + MainSource + + +
    FirstSampleClientMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.res new file mode 100644 index 0000000..6560ede Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClientMain.dfm new file mode 100644 index 0000000..534a24e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClientMain.dfm @@ -0,0 +1,138 @@ +object FirstSampleClientMainForm: TFirstSampleClientMainForm + Left = 226 + Top = 109 + BorderIcons = [biSystemMenu] + BorderStyle = bsSingle + Caption = 'FirstSample Client' + ClientHeight = 517 + ClientWidth = 318 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + PixelsPerInch = 120 + TextHeight = 16 + object GroupBox1: TGroupBox + Left = 11 + Top = 10 + Width = 297 + Height = 277 + Caption = 'Get Nickname(s) by Full Name' + TabOrder = 0 + object eFullname: TEdit + Left = 10 + Top = 26 + Width = 160 + Height = 21 + TabOrder = 0 + Text = 'Carla Simon' + end + object NamesBox: TListBox + Left = 10 + Top = 59 + Width = 160 + Height = 201 + ItemHeight = 16 + TabOrder = 1 + end + object GetButton: TButton + Left = 177 + Top = 23 + Width = 96 + Height = 31 + Caption = 'Get' + TabOrder = 2 + OnClick = GetButtonClick + end + end + object GroupBox2: TGroupBox + Left = 11 + Top = 295 + Width = 297 + Height = 62 + Caption = 'Check if Nickname exists' + TabOrder = 1 + object eNickname: TEdit + Left = 10 + Top = 25 + Width = 160 + Height = 21 + TabOrder = 0 + Text = 'Maria' + end + object CheckButton: TButton + Left = 183 + Top = 20 + Width = 93 + Height = 30 + Caption = 'Check' + TabOrder = 1 + OnClick = CheckButtonClick + end + end + object GroupBox3: TGroupBox + Left = 11 + Top = 364 + Width = 297 + Height = 139 + Caption = 'Check that nickname and Full Name match' + TabOrder = 2 + object Label1: TLabel + Left = 10 + Top = 71 + Width = 64 + Height = 16 + Caption = 'Full Name:' + end + object Label3: TLabel + Left = 10 + Top = 20 + Width = 64 + Height = 16 + Caption = 'Nickname:' + end + object eFullname2: TEdit + Left = 10 + Top = 95 + Width = 160 + Height = 21 + TabOrder = 1 + Text = 'Maria Anders' + end + object eNickname2: TEdit + Left = 10 + Top = 41 + Width = 160 + Height = 21 + TabOrder = 0 + Text = 'Maria' + end + object VerifyButton: TButton + Left = 187 + Top = 58 + Width = 92 + Height = 31 + Caption = 'Verify' + TabOrder = 2 + OnClick = VerifyButtonClick + end + end + object ROBinMessage: TROBinMessage + Left = 184 + Top = 64 + end + object ROWinInetHTTPChannel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 184 + Top = 96 + end + object RORemoteService: TRORemoteService + ServiceName = 'FirstSampleService' + Message = ROBinMessage + Channel = ROWinInetHTTPChannel + Left = 184 + Top = 128 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClientMain.pas new file mode 100644 index 0000000..b51e15e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleClientMain.pas @@ -0,0 +1,77 @@ +unit FirstSampleClientMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uRORemoteService, uROClient, + uROWinInetHttpChannel, uROBinMessage, StdCtrls, FirstSample_Intf; + +type + TFirstSampleClientMainForm = class(TForm) + ROBinMessage: TROBinMessage; + ROWinInetHTTPChannel: TROWinInetHTTPChannel; + RORemoteService: TRORemoteService; + eNickname: TEdit; + CheckButton: TButton; + GroupBox1: TGroupBox; + eFullname: TEdit; + eFullname2: TEdit; + eNickname2: TEdit; + NamesBox: TListBox; + GetButton: TButton; + GroupBox2: TGroupBox; + GroupBox3: TGroupBox; + Label1: TLabel; + Label3: TLabel; + VerifyButton: TButton; + procedure GetButtonClick(Sender: TObject); + procedure CheckButtonClick(Sender: TObject); + procedure VerifyButtonClick(Sender: TObject); + private + fFirstService: IFirstSampleService; + public + constructor Create(aOwner: TComponent); override; + end; + +var + FirstSampleClientMainForm: TFirstSampleClientMainForm; + +implementation + +uses Math, StrUtils; + +{$R *.dfm} + +constructor TFirstSampleClientMainForm.Create(aOwner: TComponent); +begin + inherited; + + fFirstService := (RORemoteService as IFirstSampleService); +end; + +procedure TFirstSampleClientMainForm.GetButtonClick(Sender: TObject); +begin + NamesBox.Items.CommaText := fFirstService.Nicknames(eFullname.Text); +end; + +procedure TFirstSampleClientMainForm.CheckButtonClick(Sender: TObject); +var + isFound: Boolean; + fullname: Widestring; +begin + isFound := fFirstService.CheckName(eNickname.Text); + fullname := IfThen(isFound,''''+fFirstService.FullNames(eNickname.Text)+'''','not found!'); + ShowMessage(Format('''%s'' is %s',[eNickname.Text,fullname])); +end; + +procedure TFirstSampleClientMainForm.VerifyButtonClick(Sender: TObject); +var + isFound: Boolean; +begin + isFound := fFirstService.VerifyName(eNickname2.Text, eFullname2.Text); + ShowMessage(IfThen(isFound, 'Verified!', 'Not verified!')); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.bdsproj new file mode 100644 index 0000000..f89940a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + FirstSampleServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.dpr new file mode 100644 index 0000000..7bbdf4e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.dpr @@ -0,0 +1,19 @@ +program FirstSampleServer; + +{#ROGEN:FirstSample.rodl} // RemObjects: Careful, do not remove! + +uses + Forms, + FirstSample_Intf in 'FirstSample_Intf.pas', + FirstSample_Invk in 'FirstSample_Invk.pas', + FirstSampleService_Impl in 'FirstSampleService_Impl.pas' {FirstSampleService: TRORemoteDataModule}, + FirstSampleServerMain in 'FirstSampleServerMain.pas' {FirstSampleServerMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TFirstSampleService, FirstSampleService); + Application.CreateForm(TFirstSampleServerMainForm, FirstSampleServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.dproj new file mode 100644 index 0000000..432d218 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.dproj @@ -0,0 +1,77 @@ + + + {9c04a9b4-5f94-42d6-94f6-41c3c6de8226} + FirstSampleServer.dpr + Debug + AnyCPU + DCC32 + FirstSampleServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + FirstSampleServer.dpr + + + + + + + MainSource + + +
    FirstSampleServerMainForm
    +
    + +
    FirstSampleService
    +
    + + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.res new file mode 100644 index 0000000..6560ede Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServerMain.dfm new file mode 100644 index 0000000..9f5458b --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServerMain.dfm @@ -0,0 +1,113 @@ +object FirstSampleServerMainForm: TFirstSampleServerMainForm + Left = 290 + Top = 103 + AutoScroll = False + BorderIcons = [biSystemMenu] + Caption = 'FirstSample Server' + ClientHeight = 470 + ClientWidth = 245 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton: TROPoweredByRemObjectsButton + Left = 16 + Top = 0 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object ValueListEditor: TValueListEditor + Left = 0 + Top = 47 + Width = 241 + Height = 316 + Align = alCustom + DisplayOptions = [doColumnTitles, doAutoColResize] + KeyOptions = [keyEdit, keyAdd, keyDelete, keyUnique] + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goDrawFocusSelected, goColSizing, goEditing, goAlwaysShowEditor, goThumbTracking] + Strings.Strings = ( + 'Fred=Fred Smith' + 'Tom=Tom Jones' + 'Carla=Carla Simon' + 'singer=Carla Simon' + 'Maria=Maria Anders' + 'Antonio=Antonio Moreno' + 'Hanna=Hanna Moos' + 'Victoria=Victoria Ashworth' + 'Yang=Yang Wang' + 'Pedro=Pedro Afonso' + 'Sven=Sven Ottlieb' + 'TJ=Tom Jones' + 'cs=Carla Simon') + TabOrder = 0 + TitleCaptions.Strings = ( + 'Nickname' + 'Full Name') + OnStringsChange = ValueListEditorStringsChange + OnValidate = ValueListEditorValidate + ColWidths = ( + 145 + 146) + end + object Memo1: TMemo + Left = 0 + Top = 395 + Width = 245 + Height = 75 + Align = alBottom + Font.Charset = ANSI_CHARSET + Font.Color = clNavy + Font.Height = -15 + Font.Name = 'Arial' + Font.Style = [fsItalic] + Lines.Strings = ( + 'Note: for the sake of simplicity, any ' + 'changes made to the list above are ' + 'not saved but, of course, adding ' + 'persistence is very easy.') + ParentColor = True + ParentFont = False + ReadOnly = True + TabOrder = 1 + end + object AddButton: TButton + Left = 32 + Top = 369 + Width = 75 + Height = 22 + Anchors = [akLeft, akBottom] + Caption = 'Add' + TabOrder = 2 + OnClick = AddButtonClick + end + object DeleteButton: TButton + Left = 128 + Top = 369 + Width = 75 + Height = 22 + Anchors = [akLeft, akBottom] + Caption = 'Delete' + TabOrder = 3 + OnClick = DeleteButtonClick + end + object ROServer: TROIndyHTTPServer + Active = True + Dispatchers = < + item + Name = 'BinMessage' + Message = BinMessage + Enabled = True + PathInfo = '/BIN' + end> + Port = 8099 + Top = 304 + end + object BinMessage: TROBinMessage + Left = 40 + Top = 304 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServerMain.pas new file mode 100644 index 0000000..7b7c0a4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleServerMain.pas @@ -0,0 +1,120 @@ +unit FirstSampleServerMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uROPoweredByRemObjectsButton, + Grids, ValEdit, uROClient, uROBinMessage, uROServer, uROIndyTCPServer, + uROIndyHTTPServer, StdCtrls; + +type + TFirstSampleServerMainForm = class(TForm) + ValueListEditor: TValueListEditor; + ROServer: TROIndyHTTPServer; + BinMessage: TROBinMessage; + Memo1: TMemo; + AddButton: TButton; + DeleteButton: TButton; + ROPoweredByRemObjectsButton: TROPoweredByRemObjectsButton; + procedure FormCreate(Sender: TObject); + procedure DeleteButtonClick(Sender: TObject); + procedure AddButtonClick(Sender: TObject); + procedure ValueListEditorValidate(Sender: TObject; ACol, ARow: Integer; + const KeyName, KeyValue: string); + procedure FormDestroy(Sender: TObject); + procedure ValueListEditorStringsChange(Sender: TObject); + private + StrList: TStringList; + { Private declarations } + public + { Public declarations } + MultiReadSingleWriter: TMultiReadExclusiveWriteSynchronizer; + + end; + +var + FirstSampleServerMainForm: TFirstSampleServerMainForm; + +implementation + +{$R *.dfm} + +procedure TFirstSampleServerMainForm.FormCreate(Sender: TObject); +begin + ROServer.Active := true; + StrList := TStringList.Create; + StrList.Assign(ValueListEditor.Strings); + MultiReadSingleWriter := TMultiReadExclusiveWriteSynchronizer.Create; +end; + +procedure TFirstSampleServerMainForm.DeleteButtonClick(Sender: TObject); +var + fRect: TGridRect; +begin + ValueListEditor.RestoreCurrentRow; + fRect := ValueListEditor.Selection; + if ValueListEditor.Keys[fRect.Top] = '' then Exit; + ValueListEditor.DeleteRow(Frect.Top); + ActiveControl := ValueListEditor; +end; + +procedure TFirstSampleServerMainForm.AddButtonClick(Sender: TObject); +var + i: integer; + fRect: TGridRect; +begin + ActiveControl := ValueListEditor; + i := ValueListEditor.InsertRow('', '', True); + fRect.Left := 0; + fRect.Top := i; + fRect.Right := 0; + fRect.Bottom := i; + ValueListEditor.Selection := fRect; + ValueListEditor.EditorMode := True; +end; + +procedure TFirstSampleServerMainForm.ValueListEditorValidate(Sender: TObject; ACol, + ARow: Integer; const KeyName, KeyValue: string); +var + s: string; +begin + while ValueListEditor.Cells[0, ARow] = '' do + if InputQuery('Enter nickname', 'Enter nickname for ''' + ValueListEditor.Cells[1, ARow] + ''':', s) then begin + ValueListEditor.Cells[0, ARow] := s; + end + else begin + ValueListEditor.RestoreCurrentRow; + ValueListEditor.DeleteRow(ARow); + Exit; + end; + while ValueListEditor.Cells[1, ARow] = '' do + if InputQuery('Enter Full Name', 'Enter Full Name for ''' + ValueListEditor.Cells[0, ARow] + ''':', s) then begin + ValueListEditor.Cells[1, ARow] := s; + end + else begin + ValueListEditor.RestoreCurrentRow; + ValueListEditor.DeleteRow(ARow); + Exit; + end; +end; + +procedure TFirstSampleServerMainForm.FormDestroy(Sender: TObject); +begin + StrList.Free; + MultiReadSingleWriter.Free; +end; + +procedure TFirstSampleServerMainForm.ValueListEditorStringsChange( + Sender: TObject); +begin + MultiReadSingleWriter.BeginWrite; + try + StrList.Assign(ValueListEditor.Strings); + finally + MultiReadSingleWriter.EndWrite; + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleService_Impl.dfm new file mode 100644 index 0000000..1d89770 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleService_Impl.dfm @@ -0,0 +1,7 @@ +object FirstSampleService: TFirstSampleService + OldCreateOrder = True + Left = 396 + Top = 219 + Height = 157 + Width = 244 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleService_Impl.pas new file mode 100644 index 0000000..7c32430 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSampleService_Impl.pas @@ -0,0 +1,111 @@ +unit FirstSampleService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Generated:} FirstSample_Intf; + +type + { TFirstSampleService } + TFirstSampleService = class(TRORemoteDataModule, IFirstSampleService) + private + protected + { IFirstSampleService methods } + function Nicknames(const FullName: Widestring): Widestring; + function FullNames(const Nickname: Widestring): Widestring; + function VerifyName(const NickName: Widestring; const FullName: Widestring): Boolean; + function CheckName(const NickName: Widestring): Boolean; + end; + +var + FirstSampleService: TFirstSampleService; + +implementation + +{$R *.dfm} +uses + {Generated:} FirstSample_Invk, FirstSampleServerMain; + +procedure Create_FirstSampleService(out anInstance: IUnknown); +begin + anInstance := TFirstSampleService.Create(nil); +end; + +{ FirstSampleService } + +function TFirstSampleService.Nicknames(const FullName: Widestring): Widestring; +var + i: integer; +begin + Result := ''; + with FirstSampleServerMainForm do begin + MultiReadSingleWriter.BeginRead; + try + with ValueListEditor.Strings do + for i := 0 to Count - 1 do + if (Fullname = '') or (CompareText(Values[Names[i]], FullName) = 0) then + Result := Result + ',' + Names[i]; + finally + MultiReadSingleWriter.EndRead; + end; + end; + if Result <> '' then Delete(Result, 1, 1); +end; + +function TFirstSampleService.VerifyName(const NickName: Widestring; const FullName: Widestring): Boolean; +begin + with FirstSampleServerMainForm do begin + MultiReadSingleWriter.BeginRead; + try + with ValueListEditor.Strings do + Result := (IndexOfName(NickName) <> -1) and (CompareText(Values[NickName], FullName) = 0); + finally + MultiReadSingleWriter.EndRead; + end; + end; +end; + +function TFirstSampleService.CheckName(const NickName: Widestring): Boolean; +begin + with FirstSampleServerMainForm do begin + MultiReadSingleWriter.BeginRead; + try + Result := ValueListEditor.Strings.IndexOfName(NickName) <> -1; + finally + MultiReadSingleWriter.EndRead; + end; + end; +end; + +function TFirstSampleService.FullNames(const Nickname: Widestring): Widestring; +begin + Result := ''; + with FirstSampleServerMainForm do begin + MultiReadSingleWriter.BeginRead; + try + with ValueListEditor.Strings do + if IndexOfName(NickName) <> -1 then + Result := Values[NickName]; + finally + MultiReadSingleWriter.EndRead; + end; + end; +end; + +initialization + TROClassFactory.Create('FirstSampleService', Create_FirstSampleService, TFirstSampleService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample_Intf.pas new file mode 100644 index 0000000..3b0cca3 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample_Intf.pas @@ -0,0 +1,151 @@ +unit FirstSample_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{37D864AA-068E-457B-81C3-828305C09F88}'; + TargetNamespace = ''; + + { Service Interface ID's } + IFirstSampleService_IID : TGUID = '{BC25168D-B5BF-47F3-AE9D-0E457528F16E}'; + + { Event ID's } + +type + { Forward declarations } + IFirstSampleService = interface; + + + { IFirstSampleService } + IFirstSampleService = interface + ['{BC25168D-B5BF-47F3-AE9D-0E457528F16E}'] + function Nicknames(const FullName: Widestring): Widestring; + function FullNames(const Nickname: Widestring): Widestring; + function VerifyName(const NickName: Widestring; const FullName: Widestring): Boolean; + function CheckName(const NickName: Widestring): Boolean; + end; + + { CoFirstSampleService } + CoFirstSampleService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IFirstSampleService; + end; + + { TFirstSampleService_Proxy } + TFirstSampleService_Proxy = class(TROProxy, IFirstSampleService) + protected + function __GetInterfaceName:string; override; + + function Nicknames(const FullName: Widestring): Widestring; + function FullNames(const Nickname: Widestring): Widestring; + function VerifyName(const NickName: Widestring; const FullName: Widestring): Boolean; + function CheckName(const NickName: Widestring): Boolean; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoFirstSampleService } + +class function CoFirstSampleService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IFirstSampleService; +begin + result := TFirstSampleService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TFirstSampleService_Proxy } + +function TFirstSampleService_Proxy.__GetInterfaceName:string; +begin + result := 'FirstSampleService'; +end; + +function TFirstSampleService_Proxy.Nicknames(const FullName: Widestring): Widestring; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'FirstSample', __InterfaceName, 'Nicknames'); + __Message.Write('FullName', TypeInfo(Widestring), FullName, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Widestring), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TFirstSampleService_Proxy.FullNames(const Nickname: Widestring): Widestring; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'FirstSample', __InterfaceName, 'FullNames'); + __Message.Write('Nickname', TypeInfo(Widestring), Nickname, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Widestring), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TFirstSampleService_Proxy.VerifyName(const NickName: Widestring; const FullName: Widestring): Boolean; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'FirstSample', __InterfaceName, 'VerifyName'); + __Message.Write('NickName', TypeInfo(Widestring), NickName, []); + __Message.Write('FullName', TypeInfo(Widestring), FullName, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Boolean), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TFirstSampleService_Proxy.CheckName(const NickName: Widestring): Boolean; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'FirstSample', __InterfaceName, 'CheckName'); + __Message.Write('NickName', TypeInfo(Widestring), NickName, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Boolean), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IFirstSampleService_IID, TFirstSampleService_Proxy); + + +finalization + UnregisterProxyClass(IFirstSampleService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample_Invk.pas new file mode 100644 index 0000000..5f7a8aa --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/FirstSample_Invk.pas @@ -0,0 +1,129 @@ +unit FirstSample_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} FirstSample_Intf; + +type + TFirstSampleService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_Nicknames(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_FullNames(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_VerifyName(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_CheckName(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TFirstSampleService_Invoker } + +constructor TFirstSampleService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TFirstSampleService_Invoker.Invoke_Nicknames(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Nicknames(const FullName: Widestring): Widestring; } +var + FullName: Widestring; + lResult: Widestring; +begin + try + __Message.Read('FullName', TypeInfo(Widestring), FullName, []); + + lResult := (__Instance as IFirstSampleService).Nicknames(FullName); + + __Message.InitializeResponseMessage(__Transport, 'FirstSample', 'FirstSampleService', 'NicknamesResponse'); + __Message.Write('Result', TypeInfo(Widestring), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TFirstSampleService_Invoker.Invoke_FullNames(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function FullNames(const Nickname: Widestring): Widestring; } +var + Nickname: Widestring; + lResult: Widestring; +begin + try + __Message.Read('Nickname', TypeInfo(Widestring), Nickname, []); + + lResult := (__Instance as IFirstSampleService).FullNames(Nickname); + + __Message.InitializeResponseMessage(__Transport, 'FirstSample', 'FirstSampleService', 'FullNamesResponse'); + __Message.Write('Result', TypeInfo(Widestring), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TFirstSampleService_Invoker.Invoke_VerifyName(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function VerifyName(const NickName: Widestring; const FullName: Widestring): Boolean; } +var + NickName: Widestring; + FullName: Widestring; + lResult: Boolean; +begin + try + __Message.Read('NickName', TypeInfo(Widestring), NickName, []); + __Message.Read('FullName', TypeInfo(Widestring), FullName, []); + + lResult := (__Instance as IFirstSampleService).VerifyName(NickName, FullName); + + __Message.InitializeResponseMessage(__Transport, 'FirstSample', 'FirstSampleService', 'VerifyNameResponse'); + __Message.Write('Result', TypeInfo(Boolean), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TFirstSampleService_Invoker.Invoke_CheckName(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function CheckName(const NickName: Widestring): Boolean; } +var + NickName: Widestring; + lResult: Boolean; +begin + try + __Message.Read('NickName', TypeInfo(Widestring), NickName, []); + + lResult := (__Instance as IFirstSampleService).CheckName(NickName); + + __Message.InitializeResponseMessage(__Transport, 'FirstSample', 'FirstSampleService', 'CheckNameResponse'); + __Message.Write('Result', TypeInfo(Boolean), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/RODLFILE.res new file mode 100644 index 0000000..6d04c42 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/First Sample/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.Sample.html new file mode 100644 index 0000000..1dadccb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.Sample.html @@ -0,0 +1,34 @@ + + + + + + + + + +

    + HTTP Chat Sample +

    + + +

    Purpose

    + +

    The Http Chat sample shows how to use polled events to create an HTTP based chat program. +
    +The clients poll every few seconds for new messages and the server distributes the messages to the appropriate client(s).

    + +

    + Testing

    +

    + To test this sample properly, you need to run at least three clients:

    +
      +
    • send a message to all clients
    • +
    • send a message to selected clients
    • +
    • close a client via the server
    • +
    • logout a user and see the effect on the server and other clients
    • +
    • issue shutdown warning from server
    • +
    • deactivate server and try to send messages
    • +
    + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.bdsgroup new file mode 100644 index 0000000..a37961f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + HTTPChatServer.bdsproj + HTTPChatClient.bdsproj + HTTPChatServer.exe HTTPChatClient.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.bpg new file mode 100644 index 0000000..26dd181 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = HTTPChatServer.exe HTTPChatClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +HTTPChatClient.exe: HTTPChatClient.dpr + $(DCC) + +HTTPChatServer.exe: HTTPChatServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.groupproj new file mode 100644 index 0000000..b2f65b5 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChat.groupproj @@ -0,0 +1,40 @@ + + + {c97fac85-2668-4287-ac6c-28cc66870612} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.bdsproj new file mode 100644 index 0000000..7d580ba --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + HTTPChatClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.dpr new file mode 100644 index 0000000..140a50e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.dpr @@ -0,0 +1,15 @@ +program HTTPChatClient; + +uses + uROComInit, + Forms, + HTTPChatClientMain in 'HTTPChatClientMain.pas' {HTTPChatClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'HTTP Chat Client'; + Application.CreateForm(THTTPChatClientMainForm, HTTPChatClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.dproj new file mode 100644 index 0000000..22e493f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.dproj @@ -0,0 +1,72 @@ + + + {a02fd936-8bc1-497d-b99c-4c2c791df598} + HTTPChatClient.dpr + Debug + AnyCPU + DCC32 + HTTPChatClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + HTTPChatClient.dpr + + + + + + + MainSource + + +
    HTTPChatClientMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClientMain.dfm new file mode 100644 index 0000000..4739588 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClientMain.dfm @@ -0,0 +1,187 @@ +object HTTPChatClientMainForm: THTTPChatClientMainForm + Left = 398 + Top = 191 + BorderStyle = bsDialog + Caption = 'HTTP Chat Client' + ClientHeight = 449 + ClientWidth = 368 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnClose = FormClose + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 3 + Top = 33 + Width = 40 + Height = 13 + Caption = 'User ID:' + end + object Label2: TLabel + Left = 3 + Top = 8 + Width = 36 + Height = 13 + Caption = 'Server:' + end + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 78 + Top = 378 + Width = 212 + Height = 48 + Cursor = crHandPoint + Anchors = [akLeft, akBottom] + ApplicationType = atClient + end + object Label3: TLabel + Left = 3 + Top = 56 + Width = 79 + Height = 13 + Caption = 'Message History' + end + object Label4: TLabel + Left = 216 + Top = 56 + Width = 69 + Height = 13 + Caption = 'Logged Users:' + end + object Memo: TMemo + Left = 3 + Top = 72 + Width = 207 + Height = 258 + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 5 + end + object eUserID: TEdit + Left = 45 + Top = 29 + Width = 180 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + Text = 'JOHN' + end + object LoginButton: TBitBtn + Left = 229 + Top = 27 + Width = 67 + Height = 25 + Anchors = [akTop, akRight] + Caption = '&Login' + Default = True + TabOrder = 2 + OnClick = LoginButtonClick + end + object LogoutButton: TBitBtn + Left = 299 + Top = 27 + Width = 67 + Height = 25 + Anchors = [akTop, akRight] + Caption = 'Log&out' + TabOrder = 3 + OnClick = LogoutButtonClick + end + object eMessage: TEdit + Left = 3 + Top = 335 + Width = 298 + Height = 21 + Anchors = [akLeft, akRight, akBottom] + TabOrder = 7 + OnChange = eMessageChange + end + object SendButton: TBitBtn + Left = 305 + Top = 333 + Width = 61 + Height = 25 + Anchors = [akRight, akBottom] + Caption = '&Send' + Default = True + TabOrder = 8 + OnClick = SendButtonClick + end + object cbServer: TComboBox + Left = 45 + Top = 4 + Width = 322 + Height = 21 + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + ItemIndex = 0 + TabOrder = 0 + Text = 'http://localhost:8099/BIN' + Items.Strings = ( + 'http://localhost:8099/BIN' + 'http://localhost:8101/BIN') + end + object lvLoggedUsers: TListView + Left = 216 + Top = 72 + Width = 148 + Height = 258 + Anchors = [akTop, akRight, akBottom] + Checkboxes = True + Columns = <> + TabOrder = 6 + ViewStyle = vsList + end + object cbPrivateMessage: TCheckBox + Left = 3 + Top = 359 + Width = 158 + Height = 17 + Caption = 'Send Only to Selected Users' + TabOrder = 9 + end + object StatusBar: TStatusBar + Left = 0 + Top = 430 + Width = 368 + Height = 19 + Panels = <> + SimplePanel = True + end + object RefreshButton: TButton + Left = 299 + Top = 55 + Width = 67 + Height = 16 + Caption = 'Refresh' + TabOrder = 4 + OnClick = RefreshButtonClick + end + object ROMessage: TROBinMessage + Left = 127 + Top = 147 + end + object ROChannel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 99 + Top = 147 + end + object svcChatService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'HTTPChatService' + Left = 155 + Top = 147 + end + object EventReceiver: TROEventReceiver + Interval = 1000 + Message = ROMessage + Channel = ROChannel + ServiceName = 'HTTPChatService' + Left = 74 + Top = 147 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClientMain.pas new file mode 100644 index 0000000..dce3656 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatClientMain.pas @@ -0,0 +1,293 @@ +unit HTTPChatClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + Buttons, HTTPChatLibrary_Intf, + uRODynamicRequest, uROEventRepository, + uROPoweredByRemObjectsButton, uROClient, ComCtrls; + +type + TMessageType = (mtMessage, mtSystem); + +type + THTTPChatClientMainForm = class(TForm, IHTTPChatEvents, IHTTPChatServerEvents) + ROMessage: TROBinMessage; + ROChannel: TROWinInetHTTPChannel; + svcChatService: TRORemoteService; + Memo: TMemo; + Label1: TLabel; + eUserID: TEdit; + LoginButton: TBitBtn; + LogoutButton: TBitBtn; + eMessage: TEdit; + SendButton: TBitBtn; + EventReceiver: TROEventReceiver; + Label2: TLabel; + cbServer: TComboBox; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + lvLoggedUsers: TListView; + Label3: TLabel; + Label4: TLabel; + cbPrivateMessage: TCheckBox; + StatusBar: TStatusBar; + RefreshButton: TButton; + procedure LoginButtonClick(Sender: TObject); + procedure LogoutButtonClick(Sender: TObject); + procedure SendButtonClick(Sender: TObject); + procedure eMessageChange(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure RefreshButtonClick(Sender: TObject); + private + fChatService: IHTTPChatService; + fLoggedIn: boolean; + fUsers: TUserInfoArray; + + function GetUserID: Widestring; + procedure ToggleControls; + + procedure WriteMessage(aMessageType: TMessageType; const aSender, aMessage: widestring; IsPrivate: boolean = FALSE); + + { IChatEvents } + procedure OnLogin(const aUserInfo: TUserInfo); + procedure OnLogout(const aUserID: widestring); + procedure OnSendMessage(const aSenderUserID: widestring; const aMessage: widestring; const aIsPrivateMessage: Boolean); + + { IChatServerEvents } + procedure OnSystemShutdown(const aShutdownDelay: Integer; const aReason: Widestring); + procedure OnMandatoryClose(const aClientID: Widestring; const aReason: Widestring); + procedure RefreshLoggedUserList; + + public + constructor Create(aOwner: TComponent); override; + destructor Destroy; override; + + property LoggedIn: boolean read fLoggedIn; + property UserID: Widestring read GetUserID; + + end; + +var + HTTPChatClientMainForm: THTTPChatClientMainForm; + +implementation + +uses StdConvs; + +{$R *.dfm} + +constructor THTTPChatClientMainForm.Create(aOwner: TComponent); +begin + inherited; + + fChatService := (svcChatService as IHTTPChatService); + + eUserID.Text := eUserID.Text + FormatDateTime('HHMMSS', Now); + ToggleControls; +end; + +destructor THTTPChatClientMainForm.Destroy; +begin + FreeAndNIL(fUsers); + + inherited; +end; + +function THTTPChatClientMainForm.GetUserID: Widestring; +begin + result := Trim(eUserID.Text); +end; + +procedure THTTPChatClientMainForm.ToggleControls; +begin + eUserID.Enabled := not LoggedIn; + LoginButton.Enabled := not LoggedIn; + LogoutButton.Enabled := LoggedIn; + Memo.Enabled := LoggedIn; + SendButton.Enabled := LoggedIn; +end; + +procedure THTTPChatClientMainForm.SendButtonClick(Sender: TObject); +var + destination: widestring; + i: integer; + userinfo: TUserInfo; +begin + { If this is a private message, then builds the list of receivers } + destination := ''; + if cbPrivateMessage.Checked then begin + for i := 0 to (lvLoggedUsers.Items.Count - 1) do begin + if lvLoggedUsers.Items[i].Checked then begin + userinfo := lvLoggedUsers.Items[i].Data; + destination := destination + userinfo.SessionID + ','; + end; + end; + + if (destination = '') then begin + Beep; + MessageDlg('Select one or more recipients for your private message first', mtError, [mbOK], 0); + Exit; + end; + end; + + { Sends the message } + fChatService.SendMessage(eMessage.Text, Copy(destination, 1, Length(destination) - 1)); + eMessage.Text := ''; + eMessage.SetFocus; +end; + +procedure THTTPChatClientMainForm.WriteMessage(aMessageType: TMessageType; + const aSender, aMessage: widestring; + IsPrivate: boolean = FALSE); +var + line: Widestring; +begin + case aMessageType of + mtSystem: line := 'SYS>' + aMessage; + mtMessage: line := aSender + '>' + aMessage; + end; + + if IsPrivate then line := '[PRIVATE] ' + line; + Memo.Lines.Add(line); +end; + +procedure THTTPChatClientMainForm.LoginButtonClick(Sender: TObject); +begin + try + ROChannel.TargetURL := cbServer.Text; + + { Calls the remote login method } + ROMessage.ClientID := StringToGUID(fChatService.Login(UserID)); + StatusBar.SimpleText := GUIDToString(ROMessage.ClientID); + + fUsers := fChatService.GetLoggedUsers; + RefreshLoggedUserList; + + { Register the event handlers } + EventReceiver.RegisterEventHandlers([EID_HTTPChatEvents, EID_HTTPChatServerEvents], [Self, Self]); + + { Starts polling } + EventReceiver.Active := TRUE; + + fLoggedIn := TRUE; + finally + ToggleControls; + end; +end; + +procedure THTTPChatClientMainForm.LogoutButtonClick(Sender: TObject); +begin + try + EventReceiver.Active := FALSE; // Stops polling for messages + EventReceiver.UnregisterEventHandlers([EID_HTTPChatEvents, EID_HTTPChatServerEvents]); // Unregisters the event handlers + + fChatService.Logout; + + FreeAndNIL(fUsers); + + fLoggedIn := FALSE; + finally + RefreshLoggedUserList; + ToggleControls; + end; +end; + +procedure THTTPChatClientMainForm.RefreshLoggedUserList; +var + i: integer; +begin + lvLoggedUsers.Items.BeginUpdate; + lvLoggedUsers.Items.Clear; + try + if (fUsers = nil) then Exit; // After Logout + + for i := 0 to (fUsers.Count - 1) do begin + if fUsers[i].UserID = UserID then Continue; // Skips itself + + with lvLoggedUsers.Items.Add do begin + Caption := fUsers[i].UserID; + Data := fUsers[i]; + end; + end; + finally + lvLoggedUsers.Items.EndUpdate; + end; +end; + +// ChatEvents implementation + +procedure THTTPChatClientMainForm.OnLogin(const aUserInfo: TUserInfo); +begin + WriteMessage(mtSystem, '', 'User ' + aUserInfo.UserID + ' just logged in'); + + fUsers.Add(aUserInfo); + EventReceiver.RetainObject(aUserInfo); + + RefreshLoggedUserList; +end; + +procedure THTTPChatClientMainForm.OnLogout(const aUserID: Widestring); +var + idx: integer; +begin + WriteMessage(mtSystem, '', 'User ' + aUserID + ' logged out'); + + idx := fUsers.GetIndex('UserID', aUserID); + if (idx >= 0) then begin + fUsers.Delete(idx); + RefreshLoggedUserList; + end; +end; + +procedure THTTPChatClientMainForm.OnSendMessage(const aSenderUserID: Widestring; const aMessage: Widestring; const aIsPrivateMessage: Boolean); +begin + WriteMessage(mtMessage, aSenderUserID, aMessage, aIsPrivateMessage); +end; + +procedure THTTPChatClientMainForm.eMessageChange(Sender: TObject); +begin + SendButton.Enabled := (eMessage.Text <> '') and LoggedIn +end; + +procedure THTTPChatClientMainForm.FormClose(Sender: TObject; var Action: TCloseAction); +begin + try + if LogoutButton.Enabled then + LogoutButton.Click; + except + end; +end; + +procedure THTTPChatClientMainForm.OnMandatoryClose(const aClientID: Widestring; const aReason: Widestring); +var + thisclientid: Widestring; +begin + thisclientid := GUIDToString(EventReceiver.ClientID); + if (aClientID = thisclientid) then begin + + LogoutButton.Click; + + Beep; + MessageDlg('You''ve been disconnected from the server.'#13'Reason: ' + aReason, mtWarning, [mbOK], 0); + + Close; + end; +end; + +procedure THTTPChatClientMainForm.OnSystemShutdown(const aShutdownDelay: Integer; + const aReason: Widestring); +begin + Beep; + MessageDlg(Format('The server will be shut down in %d minutes.'#13'Reason: %s', [aShutdownDelay, aReason]), mtWarning, [mbOK], 0); +end; + +procedure THTTPChatClientMainForm.RefreshButtonClick(Sender: TObject); +begin + fUsers:= fChatService.GetLoggedUsers; + RefreshLoggedUserList; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatLibrary.rodl new file mode 100644 index 0000000..6f66bf7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatLibrary.rodl @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatLibrary_Intf.pas new file mode 100644 index 0000000..c9fb3cc --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatLibrary_Intf.pas @@ -0,0 +1,750 @@ +unit HTTPChatLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{FAC89BC0-FECD-410B-8A96-D03A60C8301B}'; + TargetNamespace = ''; + + { Service Interface ID's } + IHTTPChatService_IID : TGUID = '{6893042C-3354-4AE6-B5FA-E7A637475C30}'; + + { Event ID's } + EID_HTTPChatEvents = 'HTTPChatEvents'; + EID_HTTPChatServerEvents = 'HTTPChatServerEvents'; + +type + { Forward declarations } + IHTTPChatService = interface; + + TUserInfoArray = class; + + TUserInfo = class; + + IHTTPChatEvents = interface; + IHTTPChatServerEvents = interface; + + + { TUserInfo } + TUserInfo = class(TROComplexType) + private + fUserID: Widestring; + fSessionID: Widestring; + public + procedure Assign(iSource: TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + published + property UserID:Widestring read fUserID write fUserID; + property SessionID:Widestring read fSessionID write fSessionID; + end; + + { TUserInfoCollection } + TUserInfoCollection = class(TROCollection) + protected + constructor Create(aItemClass: TCollectionItemClass); overload; + function GetItems(aIndex: integer): TUserInfo; + procedure SetItems(aIndex: integer; const Value: TUserInfo); + public + constructor Create; overload; + function Add: TUserInfo; reintroduce; + procedure SaveToArray(anArray: TUserInfoArray); + procedure LoadFromArray(anArray: TUserInfoArray); + property Items[Index: integer]:TUserInfo read GetItems write SetItems; default; + end; + + { TUserInfoArray } + TUserInfoArray_TUserInfo = array of TUserInfo; + TUserInfoArray = class(TROArray) + private + fCount: Integer; + fItems : TUserInfoArray_TUserInfo; + protected + procedure Grow; virtual; + function GetItems(aIndex: integer): TUserInfo; + procedure SetItems(aIndex: integer; const Value: TUserInfo); + function GetCount: integer; override; + public + class function GetItemType: PTypeInfo; override; + class function GetItemClass: TClass; override; + class function GetItemSize: integer; override; + + function GetItemRef(aIndex: integer): pointer; override; + procedure SetItemRef(aIndex: integer; Ref: pointer); override; + procedure Clear; override; + procedure Delete(aIndex: integer); override; + procedure Resize(ElementCount: integer); override; + + procedure Assign(iSource:TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + function Add: TUserInfo; overload; + function Add(const Value: TUserInfo):integer; overload; + + property Count : integer read GetCount; + property Items[Index: integer]:TUserInfo read GetItems write SetItems; default; + property InnerArray: TUserInfoArray_TUserInfo read fItems; + end; + + { IHTTPChatService } + IHTTPChatService = interface + ['{6893042C-3354-4AE6-B5FA-E7A637475C30}'] + function Login(const aUserID: Widestring): Widestring; + procedure Logout; + procedure SendMessage(const aMessageText: Widestring; const aDestination: Widestring); + function GetLoggedUsers: TUserInfoArray; + end; + + { CoHTTPChatService } + CoHTTPChatService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IHTTPChatService; + end; + + { THTTPChatService_Proxy } + THTTPChatService_Proxy = class(TROProxy, IHTTPChatService) + protected + function __GetInterfaceName:string; override; + + function Login(const aUserID: Widestring): Widestring; + procedure Logout; + procedure SendMessage(const aMessageText: Widestring; const aDestination: Widestring); + function GetLoggedUsers: TUserInfoArray; + end; + + { IHTTPChatEvents } + IHTTPChatEvents = interface + ['{75F9A466-518A-4B09-9DC4-9272B1EEFD95}'] + procedure OnLogin(const aUserInfo: TUserInfo); + procedure OnLogout(const aUserID: Widestring); + procedure OnSendMessage(const aSenderUserID: Widestring; const aMessage: Widestring; const aIsPrivateMessage: Boolean); + end; + + { IHTTPChatEvents_Writer } + IHTTPChatEvents_Writer = interface(IROEventWriter) + ['{75F9A466-518A-4B09-9DC4-9272B1EEFD95}'] + procedure OnLogin(const __Sender : TGUID; const aUserInfo: TUserInfo); + procedure OnLogout(const __Sender : TGUID; const aUserID: Widestring); + procedure OnSendMessage(const __Sender : TGUID; const aSenderUserID: Widestring; const aMessage: Widestring; const aIsPrivateMessage: Boolean); + end; + + { IHTTPChatServerEvents } + IHTTPChatServerEvents = interface + ['{E80B0A2E-96ED-4F38-A6AC-E4E0B59F27F3}'] + procedure OnSystemShutdown(const aShutdownDelay: Integer; const aReason: Widestring); + procedure OnMandatoryClose(const aClientID: Widestring; const aReason: Widestring); + end; + + { IHTTPChatServerEvents_Writer } + IHTTPChatServerEvents_Writer = interface(IROEventWriter) + ['{E80B0A2E-96ED-4F38-A6AC-E4E0B59F27F3}'] + procedure OnSystemShutdown(const __Sender : TGUID; const aShutdownDelay: Integer; const aReason: Widestring); + procedure OnMandatoryClose(const __Sender : TGUID; const aClientID: Widestring; const aReason: Widestring); + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ TUserInfoArray } + +procedure TUserInfoArray.Assign(iSource: TPersistent); +var lSource:TUserInfoArray; + i:integer; +begin + if (iSource is TUserInfoArray) then begin + lSource := TUserInfoArray(iSource); + Clear(); + Resize(lSource.Count); + + for i := 0 to Count-1 do begin + if Assigned(lSource.Items[i]) then begin + Items[i].Assign(lSource.Items[i]); + end; + end; + end + else begin + inherited Assign(iSource); + end; +end; + +class function TUserInfoArray.GetItemType: PTypeInfo; +begin + result := TypeInfo(TUserInfo); +end; + +class function TUserInfoArray.GetItemClass: TClass; +begin + result := TUserInfo; +end; + +class function TUserInfoArray.GetItemSize: integer; +begin + result := SizeOf(TUserInfo); +end; + +function TUserInfoArray.GetItems(aIndex: integer): TUserInfo; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +function TUserInfoArray.GetItemRef(aIndex: integer): pointer; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +procedure TUserInfoArray.SetItemRef(aIndex: integer; Ref: pointer); +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + if Ref <> fItems[aIndex] then begin + if fItems[aIndex] <> nil then fItems[aIndex].Free; + fItems[aIndex] := Ref; + end; +end; + +procedure TUserInfoArray.Clear; +var i: integer; +begin + for i := 0 to (Count-1) do fItems[i].Free(); + SetLength(fItems, 0); + FCount := 0; +end; + +procedure TUserInfoArray.Delete(aIndex: integer); +var i: integer; +begin + if (aIndex>=Count) then RaiseError(err_InvalidIndex, [aIndex]); + + fItems[aIndex].Free(); + + if (aIndex= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + if fItems[aIndex] <> Value then begin + fItems[aIndex].Free; + fItems[aIndex] := Value; + end; +end; + +procedure TUserInfoArray.Resize(ElementCount: integer); +var i: Integer; +begin + if fCount = ElementCount then Exit; + for i := FCount -1 downto ElementCount do + FItems[i].Free; + SetLength(fItems, ElementCount); + for i := FCount to ElementCount -1 do + FItems[i] := TUserInfo.Create; + FCount := ElementCount; +end; + +function TUserInfoArray.GetCount: integer; +begin + result := FCount; +end; + +procedure TUserInfoArray.Grow; +var + Delta, Capacity: Integer; +begin + Capacity := Length(fItems); + if Capacity > 64 then + Delta := Capacity div 4 + else + if Capacity > 8 then + Delta := 16 + else + Delta := 4; + SetLength(fItems, Capacity + Delta); +end; + +function TUserInfoArray.Add: TUserInfo; +begin + result := TUserInfo.Create; + Add(Result); +end; + +function TUserInfoArray.Add(const Value:TUserInfo): integer; +begin + Result := Count; + if Length(fItems) = Result then + Grow; + fItems[result] := Value; + Inc(fCount); +end; + +procedure TUserInfoArray.ReadComplex(ASerializer: TObject); +var + lval: TUserInfo; + i: integer; +begin + for i := 0 to Count-1 do begin + with TROSerializer(ASerializer) do + ReadStruct(GetArrayElementName(GetItemType, GetItemRef(i)), TUserInfo, lval, i); + Items[i] := lval; + end; +end; + +procedure TUserInfoArray.WriteComplex(ASerializer: TObject); +var + i: integer; +begin + for i := 0 to Count-1 do + with TROSerializer(ASerializer) do + WriteStruct(GetArrayElementName(GetItemType, GetItemRef(i)), fItems[i], TUserInfo, i); +end; + +{ TUserInfo } + +procedure TUserInfo.Assign(iSource: TPersistent); +var lSource: HTTPChatLibrary_Intf.TUserInfo; +begin + inherited Assign(iSource); + if (iSource is HTTPChatLibrary_Intf.TUserInfo) then begin + lSource := HTTPChatLibrary_Intf.TUserInfo(iSource); + UserID := lSource.UserID; + SessionID := lSource.SessionID; + end; +end; + +procedure TUserInfo.ReadComplex(ASerializer: TObject); +var + l_SessionID: Widestring; + l_UserID: Widestring; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + l_UserID := UserID; + TROSerializer(ASerializer).ReadWideString('UserID', l_UserID); + UserID := l_UserID; + l_SessionID := SessionID; + TROSerializer(ASerializer).ReadWideString('SessionID', l_SessionID); + SessionID := l_SessionID; + end + else begin + l_SessionID := SessionID; + TROSerializer(ASerializer).ReadWideString('SessionID', l_SessionID); + SessionID := l_SessionID; + l_UserID := UserID; + TROSerializer(ASerializer).ReadWideString('UserID', l_UserID); + UserID := l_UserID; + end; +end; + +procedure TUserInfo.WriteComplex(ASerializer: TObject); +var + l_SessionID: Widestring; + l_UserID: Widestring; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + TROSerializer(ASerializer).ChangeClass(TUserInfo); + l_UserID := UserID; + TROSerializer(ASerializer).WriteWideString('UserID', l_UserID); + l_SessionID := SessionID; + TROSerializer(ASerializer).WriteWideString('SessionID', l_SessionID); + end + else begin + l_SessionID := SessionID; + TROSerializer(ASerializer).WriteWideString('SessionID', l_SessionID); + l_UserID := UserID; + TROSerializer(ASerializer).WriteWideString('UserID', l_UserID); + end; +end; + +{ TUserInfoCollection } +constructor TUserInfoCollection.Create; +begin + inherited Create(TUserInfo); +end; + +constructor TUserInfoCollection.Create(aItemClass: TCollectionItemClass); +begin + inherited Create(aItemClass); +end; + +function TUserInfoCollection.Add: TUserInfo; +begin + result := TUserInfo(inherited Add); +end; + +function TUserInfoCollection.GetItems(aIndex: integer): TUserInfo; +begin + result := TUserInfo(inherited Items[aIndex]); +end; + +procedure TUserInfoCollection.LoadFromArray(anArray: TUserInfoArray); +var i : integer; +begin + Clear; + for i := 0 to (anArray.Count-1) do + Add.Assign(anArray[i]); +end; + +procedure TUserInfoCollection.SaveToArray(anArray: TUserInfoArray); +var i : integer; +begin + anArray.Clear; + anArray.Resize(Count); + for i := 0 to (Count-1) do begin + anArray[i] := TUserInfo.Create; + anArray[i].Assign(Items[i]); + end; +end; + +procedure TUserInfoCollection.SetItems(aIndex: integer; const Value: TUserInfo); +begin + TUserInfo(inherited Items[aIndex]).Assign(Value); +end; + +{ CoHTTPChatService } + +class function CoHTTPChatService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IHTTPChatService; +begin + result := THTTPChatService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ THTTPChatService_Proxy } + +function THTTPChatService_Proxy.__GetInterfaceName:string; +begin + result := 'HTTPChatService'; +end; + +function THTTPChatService_Proxy.Login(const aUserID: Widestring): Widestring; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'HTTPChatLibrary', __InterfaceName, 'Login'); + __Message.Write('aUserID', TypeInfo(Widestring), aUserID, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Widestring), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure THTTPChatService_Proxy.Logout; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'HTTPChatLibrary', __InterfaceName, 'Logout'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.FreeStream; + end +end; + +procedure THTTPChatService_Proxy.SendMessage(const aMessageText: Widestring; const aDestination: Widestring); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'HTTPChatLibrary', __InterfaceName, 'SendMessage'); + __Message.Write('aMessageText', TypeInfo(Widestring), aMessageText, []); + __Message.Write('aDestination', TypeInfo(Widestring), aDestination, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function THTTPChatService_Proxy.GetLoggedUsers: TUserInfoArray; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'HTTPChatLibrary', __InterfaceName, 'GetLoggedUsers'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(HTTPChatLibrary_Intf.TUserInfoArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +type + { THTTPChatEvents_Writer } + THTTPChatEvents_Writer = class(TROEventWriter, IHTTPChatEvents_Writer) + protected + procedure OnLogin(const __Sender : TGUID; const aUserInfo: TUserInfo); + procedure OnLogout(const __Sender : TGUID; const aUserID: Widestring); + procedure OnSendMessage(const __Sender : TGUID; const aSenderUserID: Widestring; const aMessage: Widestring; const aIsPrivateMessage: Boolean); + end; + +procedure THTTPChatEvents_Writer.OnLogin(const __Sender : TGUID; const aUserInfo: TUserInfo); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'HTTPChatLibrary', EID_HTTPChatEvents, 'OnLogin'); + __Message.Write('aUserInfo', TypeInfo(TUserInfo), aUserInfo, []); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +procedure THTTPChatEvents_Writer.OnLogout(const __Sender : TGUID; const aUserID: Widestring); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'HTTPChatLibrary', EID_HTTPChatEvents, 'OnLogout'); + __Message.Write('aUserID', TypeInfo(Widestring), aUserID, []); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +procedure THTTPChatEvents_Writer.OnSendMessage(const __Sender : TGUID; const aSenderUserID: Widestring; const aMessage: Widestring; const aIsPrivateMessage: Boolean); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'HTTPChatLibrary', EID_HTTPChatEvents, 'OnSendMessage'); + __Message.Write('aSenderUserID', TypeInfo(Widestring), aSenderUserID, []); + __Message.Write('aMessage', TypeInfo(Widestring), aMessage, []); + __Message.Write('aIsPrivateMessage', TypeInfo(Boolean), aIsPrivateMessage, []); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +type + { THTTPChatEvents_Invoker } + THTTPChatEvents_Invoker = class(TROEventInvoker) + published + procedure Invoke_OnLogin(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + procedure Invoke_OnLogout(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + procedure Invoke_OnSendMessage(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + end; + +procedure THTTPChatEvents_Invoker.Invoke_OnLogin(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; + aUserInfo: TUserInfo; +begin + aUserInfo := NIL; + + try + __Message.Read('aUserInfo', TypeInfo(TUserInfo), aUserInfo, []); + + (__Target as IHTTPChatEvents).OnLogin(aUserInfo); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + __lObjectDisposer.Add(aUserInfo); + finally + __lObjectDisposer.Free(); + end + end +end; + +procedure THTTPChatEvents_Invoker.Invoke_OnLogout(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; + aUserID: Widestring; +begin + + try + __Message.Read('aUserID', TypeInfo(Widestring), aUserID, []); + + (__Target as IHTTPChatEvents).OnLogout(aUserID); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + finally + __lObjectDisposer.Free(); + end + end +end; + +procedure THTTPChatEvents_Invoker.Invoke_OnSendMessage(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; + aSenderUserID: Widestring; + aMessage: Widestring; + aIsPrivateMessage: Boolean; +begin + + try + __Message.Read('aSenderUserID', TypeInfo(Widestring), aSenderUserID, []); + __Message.Read('aMessage', TypeInfo(Widestring), aMessage, []); + __Message.Read('aIsPrivateMessage', TypeInfo(Boolean), aIsPrivateMessage, []); + + (__Target as IHTTPChatEvents).OnSendMessage(aSenderUserID, aMessage, aIsPrivateMessage); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + finally + __lObjectDisposer.Free(); + end + end +end; + +type + { THTTPChatServerEvents_Writer } + THTTPChatServerEvents_Writer = class(TROEventWriter, IHTTPChatServerEvents_Writer) + protected + procedure OnSystemShutdown(const __Sender : TGUID; const aShutdownDelay: Integer; const aReason: Widestring); + procedure OnMandatoryClose(const __Sender : TGUID; const aClientID: Widestring; const aReason: Widestring); + end; + +procedure THTTPChatServerEvents_Writer.OnSystemShutdown(const __Sender : TGUID; const aShutdownDelay: Integer; const aReason: Widestring); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'HTTPChatLibrary', EID_HTTPChatServerEvents, 'OnSystemShutdown'); + __Message.Write('aShutdownDelay', TypeInfo(Integer), aShutdownDelay, []); + __Message.Write('aReason', TypeInfo(Widestring), aReason, []); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +procedure THTTPChatServerEvents_Writer.OnMandatoryClose(const __Sender : TGUID; const aClientID: Widestring; const aReason: Widestring); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'HTTPChatLibrary', EID_HTTPChatServerEvents, 'OnMandatoryClose'); + __Message.Write('aClientID', TypeInfo(Widestring), aClientID, []); + __Message.Write('aReason', TypeInfo(Widestring), aReason, []); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +type + { THTTPChatServerEvents_Invoker } + THTTPChatServerEvents_Invoker = class(TROEventInvoker) + published + procedure Invoke_OnSystemShutdown(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + procedure Invoke_OnMandatoryClose(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + end; + +procedure THTTPChatServerEvents_Invoker.Invoke_OnSystemShutdown(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; + aShutdownDelay: Integer; + aReason: Widestring; +begin + + try + __Message.Read('aShutdownDelay', TypeInfo(Integer), aShutdownDelay, []); + __Message.Read('aReason', TypeInfo(Widestring), aReason, []); + + (__Target as IHTTPChatServerEvents).OnSystemShutdown(aShutdownDelay, aReason); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + finally + __lObjectDisposer.Free(); + end + end +end; + +procedure THTTPChatServerEvents_Invoker.Invoke_OnMandatoryClose(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; + aClientID: Widestring; + aReason: Widestring; +begin + + try + __Message.Read('aClientID', TypeInfo(Widestring), aClientID, []); + __Message.Read('aReason', TypeInfo(Widestring), aReason, []); + + (__Target as IHTTPChatServerEvents).OnMandatoryClose(aClientID, aReason); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + finally + __lObjectDisposer.Free(); + end + end +end; + +initialization + RegisterROClass(TUserInfo); + RegisterROClass(TUserInfoArray); + RegisterProxyClass(IHTTPChatService_IID, THTTPChatService_Proxy); + + RegisterEventWriterClass(IHTTPChatEvents_Writer, THTTPChatEvents_Writer); + RegisterEventInvokerClass(EID_HTTPChatEvents, THTTPChatEvents_Invoker); + RegisterEventWriterClass(IHTTPChatServerEvents_Writer, THTTPChatServerEvents_Writer); + RegisterEventInvokerClass(EID_HTTPChatServerEvents, THTTPChatServerEvents_Invoker); + +finalization + UnregisterROClass(TUserInfo); + UnregisterROClass(TUserInfoArray); + UnregisterProxyClass(IHTTPChatService_IID); + + UnregisterEventWriterClass(IHTTPChatEvents_Writer); + UnregisterEventInvokerClass(EID_HTTPChatEvents); + UnregisterEventWriterClass(IHTTPChatServerEvents_Writer); + UnregisterEventInvokerClass(EID_HTTPChatServerEvents); +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatLibrary_Invk.pas new file mode 100644 index 0000000..c93927c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatLibrary_Invk.pas @@ -0,0 +1,125 @@ +unit HTTPChatLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} HTTPChatLibrary_Intf; + +type + THTTPChatService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_SendMessage(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetLoggedUsers(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ THTTPChatService_Invoker } + +constructor THTTPChatService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure THTTPChatService_Invoker.Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Login(const aUserID: Widestring): Widestring; } +var + aUserID: Widestring; + lResult: Widestring; +begin + try + __Message.Read('aUserID', TypeInfo(Widestring), aUserID, []); + + lResult := (__Instance as IHTTPChatService).Login(aUserID); + + __Message.InitializeResponseMessage(__Transport, 'HTTPChatLibrary', 'HTTPChatService', 'LoginResponse'); + __Message.Write('Result', TypeInfo(Widestring), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure THTTPChatService_Invoker.Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure Logout; } +begin + try + (__Instance as IHTTPChatService).Logout; + + __Message.InitializeResponseMessage(__Transport, 'HTTPChatLibrary', 'HTTPChatService', 'LogoutResponse'); + __Message.Finalize; + + finally + end; +end; + +procedure THTTPChatService_Invoker.Invoke_SendMessage(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure SendMessage(const aMessageText: Widestring; const aDestination: Widestring); } +var + aMessageText: Widestring; + aDestination: Widestring; +begin + try + __Message.Read('aMessageText', TypeInfo(Widestring), aMessageText, []); + __Message.Read('aDestination', TypeInfo(Widestring), aDestination, []); + + (__Instance as IHTTPChatService).SendMessage(aMessageText, aDestination); + + __Message.InitializeResponseMessage(__Transport, 'HTTPChatLibrary', 'HTTPChatService', 'SendMessageResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure THTTPChatService_Invoker.Invoke_GetLoggedUsers(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetLoggedUsers: TUserInfoArray; } +var + lResult: HTTPChatLibrary_Intf.TUserInfoArray; + __lObjectDisposer: TROObjectDisposer; +begin + lResult := nil; + try + lResult := (__Instance as IHTTPChatService).GetLoggedUsers; + + __Message.InitializeResponseMessage(__Transport, 'HTTPChatLibrary', 'HTTPChatService', 'GetLoggedUsersResponse'); + __Message.Write('Result', TypeInfo(HTTPChatLibrary_Intf.TUserInfoArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.bdsproj new file mode 100644 index 0000000..ca5815e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + HTTPChatServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.dpr new file mode 100644 index 0000000..ccb0548 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.dpr @@ -0,0 +1,21 @@ +program HTTPChatServer; + +{#ROGEN:HTTPChatLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + HTTPChatServerMain in 'HTTPChatServerMain.pas' {HTTPChatServerMainForm}, + HTTPChatLibrary_Intf in 'HTTPChatLibrary_Intf.pas', + HTTPChatLibrary_Invk in 'HTTPChatLibrary_Invk.pas', + HTTPChatService_Impl in 'HTTPChatService_Impl.pas' {HTTPChatService: TDARemoteService}; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'HTTP Chat Server'; + Application.CreateForm(THTTPChatServerMainForm, HTTPChatServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.dproj new file mode 100644 index 0000000..ba239d0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.dproj @@ -0,0 +1,77 @@ + + + {582fb95d-63e7-4f83-948c-cf190b1c9a77} + HTTPChatServer.dpr + Debug + AnyCPU + DCC32 + HTTPChatServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + HTTPChatServer.dpr + + + + + + + MainSource + + + + +
    HTTPChatServerMainForm
    +
    + +
    HTTPChatService
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.res new file mode 100644 index 0000000..3eab0f7 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServerMain.dfm new file mode 100644 index 0000000..c6336ae --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServerMain.dfm @@ -0,0 +1,151 @@ +object HTTPChatServerMainForm: THTTPChatServerMainForm + Left = 294 + Top = 19 + BorderIcons = [biSystemMenu] + BorderStyle = bsSingle + Caption = 'HTTP Chat Server' + ClientHeight = 371 + ClientWidth = 425 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Label1: TLabel + Left = 8 + Top = 68 + Width = 87 + Height = 13 + Caption = 'Event Repository:' + end + object Label2: TLabel + Left = 8 + Top = 96 + Width = 80 + Height = 13 + Caption = 'Known Sessions:' + end + object Label3: TLabel + Left = 240 + Top = 8 + Width = 70 + Height = 13 + Caption = 'Listen on Port:' + end + object lbSessions: TListBox + Left = 8 + Top = 112 + Width = 409 + Height = 225 + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 13 + TabOrder = 3 + end + object bbCloseClient: TBitBtn + Left = 25 + Top = 343 + Width = 169 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Close Client' + Enabled = False + TabOrder = 4 + OnClick = bbCloseClientClick + end + object bbWarnShutdown: TBitBtn + Left = 230 + Top = 343 + Width = 169 + Height = 25 + Anchors = [akLeft, akBottom] + Caption = 'Warn 5 Minutes Shutdown' + Enabled = False + TabOrder = 5 + OnClick = bbWarnShutdownClick + end + object cbRepositoryType: TComboBox + Left = 97 + Top = 64 + Width = 320 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 2 + end + object ActivateButton: TBitBtn + Left = 240 + Top = 31 + Width = 161 + Height = 25 + Caption = 'Activate/Deactivate Server' + TabOrder = 1 + OnClick = ActivateButtonClick + end + object sePort: TSpinEdit + Left = 312 + Top = 3 + Width = 91 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 0 + end + object BINMessage: TROBinMessage + UseCompression = False + Left = 84 + Top = 248 + end + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'BINMessage' + Message = BINMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 56 + Top = 248 + end + object InMemorySessionManager: TROInMemorySessionManager + SessionDuration = 1 + OnSessionDeleted = InMemorySessionManagerSessionDeleted + Left = 152 + Top = 296 + end + object ROIndyTCPChannel1: TROIndyTCPChannel + ServerLocators = <> + DispatchOptions = [] + Port = 8090 + Host = '127.0.0.1' + Left = 232 + Top = 256 + end + object InMemoryEventRepository: TROInMemoryEventRepository + Message = BINMessage + SessionManager = InMemorySessionManager + OnAfterAddSession = InMemoryEventRepositoryAfterAddSession + OnAfterRemoveSession = InMemoryEventRepositoryAfterRemoveSession + Left = 192 + Top = 296 + end + object MasterServerEventRepository: TROMasterServerEventRepository + Message = BINMessage + SessionManager = InMemorySessionManager + OnAfterAddSession = InMemoryEventRepositoryAfterAddSession + OnAfterRemoveSession = InMemoryEventRepositoryAfterRemoveSession + Channel = ROIndyTCPChannel1 + Left = 192 + Top = 256 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServerMain.pas new file mode 100644 index 0000000..d36820e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatServerMain.pas @@ -0,0 +1,143 @@ +unit HTTPChatServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROIndyHTTPServer, uROIndyTCPServer, HTTPChatLibrary_Intf, + uROSessions, uROEventRepository, + uROBinMessage, uROSOAPMessage, Buttons, uROIndyTCPChannel, + uROMasterServerEventRepository, Spin; + +type + THTTPChatServerMainForm = class(TForm) + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + BINMessage: TROBinMessage; + ROServer: TROIndyHTTPServer; + InMemorySessionManager: TROInMemorySessionManager; + lbSessions: TListBox; + bbCloseClient: TBitBtn; + bbWarnShutdown: TBitBtn; + ROIndyTCPChannel1: TROIndyTCPChannel; + cbRepositoryType: TComboBox; + Label1: TLabel; + InMemoryEventRepository: TROInMemoryEventRepository; + Label2: TLabel; + ActivateButton: TBitBtn; + MasterServerEventRepository: TROMasterServerEventRepository; + Label3: TLabel; + sePort: TSpinEdit; + procedure FormCreate(Sender: TObject); + procedure bbWarnShutdownClick(Sender: TObject); + procedure bbCloseClientClick(Sender: TObject); + procedure ActivateButtonClick(Sender: TObject); + procedure InMemoryEventRepositoryAfterAddSession( + Sender: TROEventRepository; const SessionID: TGUID); + procedure InMemoryEventRepositoryAfterRemoveSession( + Sender: TROEventRepository; const SessionID: TGUID); + procedure InMemorySessionManagerSessionDeleted(const aSessionID: TGUID; + IsExpired: Boolean); + private + function GetEventRepository: TROEventRepository; + protected + + public + property EventRepository : TROEventRepository read GetEventRepository; + end; + +var + HTTPChatServerMainForm: THTTPChatServerMainForm; + +implementation + +uses uROClasses, uROAsync, Variants; + +{$R *.dfm} + +procedure THTTPChatServerMainForm.FormCreate(Sender: TObject); +var i : integer; +begin + sePort.Value := ROServer.Port; + + for i := 0 to (ComponentCount-1) do + if (Components[i] is TROEventRepository) then + cbRepositoryType.Items.AddObject(Components[i].Name, Components[i]); + + cbRepositoryType.ItemIndex := 0; +end; + +procedure THTTPChatServerMainForm.bbWarnShutdownClick(Sender: TObject); +var reason : string; +begin + reason := 'The system administrator will reboot the server in 5 minutes.'#13#13+ + 'Please close your applications and save your work.'; + + if InputQuery('Shutdown Reason', 'Reason', reason) + then (EventRepository as IHTTPChatServerEvents_Writer).OnSystemShutdown(EmptyGUID, 5, reason); +end; + +procedure THTTPChatServerMainForm.bbCloseClientClick(Sender: TObject); +var reason : string; + clientid : TGUID; +begin + if lbSessions.ItemIndex<0 then begin + Beep; + MessageDlg('Select a session first', mtError, [mbOK], 0); + Exit; + end; + + clientid := StringToGUID(lbSessions.Items[lbSessions.ItemIndex]); + + reason := 'You''ve been terminated. Good bye!'; + if InputQuery('Close Reason', 'Reason', reason) + then (EventRepository as IHTTPChatServerEvents_Writer).OnMandatoryClose(EmptyGUID, GUIDToString(clientid), reason); +end; + +function THTTPChatServerMainForm.GetEventRepository: TROEventRepository; +begin + result := TROEventRepository(cbRepositoryType.Items.Objects[cbRepositoryType.ItemIndex]); +end; + +procedure THTTPChatServerMainForm.ActivateButtonClick(Sender: TObject); +begin + if not ROServer.Active then begin + ROServer.Port := sePort.Value; + end; + + ROServer.Active := ROServer.Active XOR TRUE; + + cbRepositoryType.Enabled := not ROServer.Active; + bbCloseClient.Enabled := ROServer.Active; + bbWarnShutdown.Enabled := ROServer.Active; +end; + +procedure THTTPChatServerMainForm.InMemoryEventRepositoryAfterAddSession( + Sender: TROEventRepository; const SessionID: TGUID); +begin + lbSessions.Items.Add(GUIDToString(SessionID)); +end; + +procedure THTTPChatServerMainForm.InMemoryEventRepositoryAfterRemoveSession( + Sender: TROEventRepository; const SessionID: TGUID); +var idx : integer; +begin + if (csDestroying in ComponentState) then Exit; + + idx := lbSessions.Items.IndexOf(GUIDToString(SessionID)); + if (idx>=0) + then lbSessions.Items.Delete(idx); +end; + +procedure THTTPChatServerMainForm.InMemorySessionManagerSessionDeleted( + const aSessionID: TGUID; IsExpired: Boolean); +var idx : integer; +begin + if (csDestroying in ComponentState) then Exit; + + idx := lbSessions.Items.IndexOf(GUIDToString(aSessionID)); + if (idx>=0) + then lbSessions.Items.Delete(idx); +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatService_Impl.dfm new file mode 100644 index 0000000..10de306 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatService_Impl.dfm @@ -0,0 +1,10 @@ +object HTTPChatService: THTTPChatService + OldCreateOrder = True + SessionManager = HTTPChatServerMainForm.InMemorySessionManager + EventRepository = HTTPChatServerMainForm.InMemoryEventRepository + OnActivate = RORemoteDataModuleActivate + Left = 200 + Top = 200 + Height = 300 + Width = 300 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatService_Impl.pas new file mode 100644 index 0000000..1ff180c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/HTTP Chat/HTTPChatService_Impl.pas @@ -0,0 +1,158 @@ +unit HTTPChatService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, SyncObjs, + {Generated:} HTTPChatLibrary_Intf; + +type + { THTTPChatService } + THTTPChatService = class(TRORemoteDataModule, IHTTPChatService) + procedure RORemoteDataModuleActivate(const aClientID: TGUID; + aSession: TROSession; const aMessage: IROMessage); + private + protected + { IHTTPChatService methods } + function Login(const aUserID: Widestring): Widestring; + procedure Logout; + procedure SendMessage(const aMessageText: Widestring; const aDestination: Widestring); + function GetLoggedUsers: TUserInfoArray; + public + end; + +var + fCs: TCriticalSection; + fUsers: TUserInfoArray; + +implementation + +{$R *.dfm} +uses + {Generated:} HTTPChatLibrary_Invk, HTTPChatServerMain, Variants; + +procedure Create_HTTPChatService(out anInstance: IUnknown); +begin + anInstance := THTTPChatService.Create(nil); +end; + +{ HTTPChatService } + +function THTTPChatService.Login(const aUserID: Widestring): Widestring; +var + newuser: TUserInfo; + ev: IHTTPChatEvents_Writer; +begin + fcs.Enter; + try + { Checks if the user is already logged in } + if (fUsers.Search('UserID', aUserID) <> nil) then raise Exception.CreateFmt('User %s is already logged in', [aUserID]); + + { Adds the user to the internal list of logged users } + newuser := fUsers.Add; + newuser.UserID := aUserID; + newuser.SessionID := GUIDToString(Session.SessionID); + + { Stores the UserID of the user in the session. + This will be used in the OnLogout and OnSendMessage methods } + Session.Values['UserID'] := aUserID; + result := newuser.SessionID; + + ev := (EventRepository as IHTTPChatEvents_Writer); + ev.ExcludeSender := false; // make sure to send it back to sender too + + { Generates the OnLogin event } + ev.OnLogin(Session.SessionID, newuser); + finally + fcs.Release; + end; +end; + +procedure THTTPChatService.Logout; +var + userid: Widestring; + useridx: integer; + ev: IHTTPChatEvents_Writer; +begin + { Finds the user in the fUser array and removes it } + userid := VarToStr(Session.Values['UserID']); + fcs.Enter; + try + useridx := fUsers.GetIndex('UserID', UserID); + + if (useridx >= 0) then fUsers.Delete(useridx); + + { Eliminates this user's session } + DestroySession; + + ev := (EventRepository as IHTTPChatEvents_Writer); + + { Generates the OnLogout event } + ev.OnLogout(Session.SessionID, UserID); + finally + fcs.Release; + end; +end; + +procedure THTTPChatService.SendMessage(const aMessageText: Widestring; const aDestination: Widestring); +var + thisuserid: Widestring; + chateventswriter: IHTTPChatEvents_Writer; +begin + { Extracts the name of the current user by reading the session information } + thisuserid := VarToStr(Session.Values['UserID']); + + { Filters the receivers of this event if necessary } + chateventswriter := (EventRepository as IHTTPChatEvents_Writer); + if (aDestination <> '') then begin + chateventswriter.SessionList.CommaText := aDestination; + + { Only broadcasts to the session listed in SessionList } + chateventswriter.ExcludeSessionList := FALSE; + end; + chateventswriter.ExcludeSender := false; + + { Generates the OnSendMessage event } + chateventswriter.OnSendMessage(Session.SessionID, thisuserid, aMessageText, aDestination <> ''); +end; + +function THTTPChatService.GetLoggedUsers: TUserInfoArray; +begin + result := TUserInfoArray.Create; + fcs.Enter; + try + result.Assign(fUsers); + finally + fcs.Release; + end; +end; + +procedure THTTPChatService.RORemoteDataModuleActivate( + const aClientID: TGUID; aSession: TROSession; + const aMessage: IROMessage); +begin + { We manually assign this because the user might decide to change it at runtime, + by using the combo box on the main form } + + EventRepository := HTTPChatServerMainForm.EventRepository; +end; + +initialization + fCs := TCriticalSection.Create; + fUsers := TUserInfoArray.Create; + TROClassFactory.Create('HTTPChatService', Create_HTTPChatService, THTTPChatService_Invoker); + +finalization + FreeAndNil(fUsers); + fCs.Free; +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancing.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancing.dpr new file mode 100644 index 0000000..fde2fe2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancing.dpr @@ -0,0 +1,29 @@ +program LoadBalancing; + +{#ROGEN:LoadBalancingLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + uROComboService, + Forms, + fServerDataModule in 'fServerDataModule.pas' {ServerDataModule: TDataModule}, + fServerForm in 'fServerForm.pas' {ServerForm}, + LoadBalancingLibrary_Intf in 'LoadBalancingLibrary_Intf.pas', + LoadBalancingLibrary_Invk in 'LoadBalancingLibrary_Invk.pas', + LoadBalancingService_Impl in 'LoadBalancingService_Impl.pas' {LoadBalancingService: TRORemoteDataModule}; + +{$R *.res} +{$R RODLFile.res} + +begin + if ROStartService('LoadBalancing', 'LoadBalancing') then begin + ROService.CreateForm(TServerDataModule, ServerDataModule); + ROService.Run; + Exit; + end; + + Application.Initialize; + Application.CreateForm(TServerDataModule, ServerDataModule); + Application.CreateForm(TServerForm, ServerForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancing.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancing.res new file mode 100644 index 0000000..78dee1f Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancing.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingClient.dpr new file mode 100644 index 0000000..65b3ba1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingClient.dpr @@ -0,0 +1,14 @@ +program LoadBalancingClient; + +uses + uROComInit, + Forms, + fClientForm in 'fClientForm.pas' {ClientForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TClientForm, ClientForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingClient.res new file mode 100644 index 0000000..0f940ed Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingGroup.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingGroup.Sample.html new file mode 100644 index 0000000..16fefb8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingGroup.Sample.html @@ -0,0 +1,36 @@ + + + + + + + + + +

    + LoadBalancing Sample +

    + +

    Purpose

    + +

    sample demonstrates usage the Load Balancing and Fault Tolerance features.

    + +

    Getting Started

    +
      +
    • Build or compile both projects.
    • +
    • Launch the four servers (via the menu option: RemObjects | Launch Server Executable) + and activate different servers, e.g. Alfa Server for 1st server, Beta Server for 2nd server, etc.
    • +
    • Ensure that LoadBalancingClient is the selected project and run it.
    • +
    • Check that the client works as expected.
    • +
        +
      • Fault tolerance. Deactivate some servers and check that client use anothe active server to perfom calculation.
      • +
      • Load balance. Check that next service call will be performed by another active server.
      • +
      • Server probing. Toggle server activity and perform server probing to include/exclude server from using by client.
      • +
      +
    +

    Examine the Code

    +
      +
    • Look for examples of using properties  of the channel coresponding to Load Balancing and Fault Tolerance : DispatchOptions, ProbeServers, ProbeFrequency and especially ServerLocators.
    • +
    + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingGroup.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingGroup.bpg new file mode 100644 index 0000000..9ed6c86 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingGroup.bpg @@ -0,0 +1,21 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = LoadBalancing.exe LoadBalancingClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +LoadBalancing.exe: LoadBalancing.dpr + $(DCC) + +LoadBalancingClient.exe: LoadBalancingClient.dpr + $(DCC) diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingLibrary.rodl new file mode 100644 index 0000000..8620013 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingLibrary.rodl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingLibrary_Intf.pas new file mode 100644 index 0000000..1428b26 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingLibrary_Intf.pas @@ -0,0 +1,114 @@ +unit LoadBalancingLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{090EB224-CE46-4FEE-98CB-1DF8B2CD2CFC}'; + TargetNamespace = ''; + + { Service Interface ID's } + ILoadBalancingService_IID : TGUID = '{5F3AABEC-E71F-47AC-9981-9E88F1387B0D}'; + + { Event ID's } + +type + { Forward declarations } + ILoadBalancingService = interface; + + + { ILoadBalancingService } + ILoadBalancingService = interface + ['{5F3AABEC-E71F-47AC-9981-9E88F1387B0D}'] + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + end; + + { CoLoadBalancingService } + CoLoadBalancingService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoadBalancingService; + end; + + { TLoadBalancingService_Proxy } + TLoadBalancingService_Proxy = class(TROProxy, ILoadBalancingService) + protected + function __GetInterfaceName:string; override; + + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoLoadBalancingService } + +class function CoLoadBalancingService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoadBalancingService; +begin + result := TLoadBalancingService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TLoadBalancingService_Proxy } + +function TLoadBalancingService_Proxy.__GetInterfaceName:string; +begin + result := 'LoadBalancingService'; +end; + +function TLoadBalancingService_Proxy.Sum(const A: Integer; const B: Integer): Integer; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'LoadBalancingLibrary', __InterfaceName, 'Sum'); + __Message.Write('A', TypeInfo(Integer), A, []); + __Message.Write('B', TypeInfo(Integer), B, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Integer), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TLoadBalancingService_Proxy.GetServerTime: DateTime; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'LoadBalancingLibrary', __InterfaceName, 'GetServerTime'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DateTime), result, [paIsDateTime]); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(ILoadBalancingService_IID, TLoadBalancingService_Proxy); + + +finalization + UnregisterProxyClass(ILoadBalancingService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingLibrary_Invk.pas new file mode 100644 index 0000000..e30b775 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingLibrary_Invk.pas @@ -0,0 +1,84 @@ +unit LoadBalancingLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} LoadBalancingLibrary_Intf; + +type + TLoadBalancingService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TLoadBalancingService_Invoker } + +constructor TLoadBalancingService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TLoadBalancingService_Invoker.Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Sum(const A: Integer; const B: Integer): Integer; } +var + A: Integer; + B: Integer; + lResult: Integer; +begin + try + __Message.Read('A', TypeInfo(Integer), A, []); + __Message.Read('B', TypeInfo(Integer), B, []); + + lResult := (__Instance as ILoadBalancingService).Sum(A, B); + + __Message.InitializeResponseMessage(__Transport, 'LoadBalancingLibrary', 'LoadBalancingService', 'SumResponse'); + __Message.Write('Result', TypeInfo(Integer), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TLoadBalancingService_Invoker.Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetServerTime: DateTime; } +var + lResult: DateTime; +begin + try + lResult := (__Instance as ILoadBalancingService).GetServerTime; + + __Message.InitializeResponseMessage(__Transport, 'LoadBalancingLibrary', 'LoadBalancingService', 'GetServerTimeResponse'); + __Message.Write('Result', TypeInfo(DateTime), lResult, [paIsDateTime]); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingService_Impl.dfm new file mode 100644 index 0000000..ae72858 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingService_Impl.dfm @@ -0,0 +1,7 @@ +object LoadBalancingService: TLoadBalancingService + OldCreateOrder = True + Left = 200 + Top = 200 + Height = 300 + Width = 300 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingService_Impl.pas new file mode 100644 index 0000000..491519d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/LoadBalancingService_Impl.pas @@ -0,0 +1,57 @@ +unit LoadBalancingService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Generated:} LoadBalancingLibrary_Intf; + +type + { TLoadBalancingService } + TLoadBalancingService = class(TRORemoteDataModule, ILoadBalancingService) + private + protected + { ILoadBalancingService methods } + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} LoadBalancingLibrary_Invk; + +procedure Create_LoadBalancingService(out anInstance : IUnknown); +begin + anInstance := TLoadBalancingService.Create(nil); +end; + +{ LoadBalancingService } +function TLoadBalancingService.Sum(const A: Integer; const B: Integer): Integer; +begin + result := A + B; +end; + +function TLoadBalancingService.GetServerTime: DateTime; +begin + result := Now; +end; + +initialization + TROClassFactory.Create('LoadBalancingService', Create_LoadBalancingService, TLoadBalancingService_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/RODLFILE.res new file mode 100644 index 0000000..f465d2e Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fClientForm.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fClientForm.dfm new file mode 100644 index 0000000..4d79aaa --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fClientForm.dfm @@ -0,0 +1,478 @@ +object ClientForm: TClientForm + Left = 588 + Top = 165 + Width = 543 + Height = 558 + Caption = 'RemObjects Client' + Color = clBtnFace + Constraints.MinHeight = 550 + Constraints.MinWidth = 543 + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object gbSum: TGroupBox + Left = 8 + Top = 8 + Width = 521 + Height = 57 + Anchors = [akLeft, akTop, akRight] + Caption = 'Sum Method' + TabOrder = 0 + object lblA: TLabel + Left = 8 + Top = 28 + Width = 10 + Height = 13 + Caption = '&A:' + end + object lblB: TLabel + Left = 80 + Top = 28 + Width = 10 + Height = 13 + Caption = '&B:' + end + object edA: TEdit + Left = 24 + Top = 23 + Width = 33 + Height = 21 + TabOrder = 0 + Text = '3' + end + object edB: TEdit + Left = 96 + Top = 23 + Width = 41 + Height = 21 + TabOrder = 1 + Text = '5' + end + object udA: TUpDown + Left = 57 + Top = 23 + Width = 16 + Height = 21 + Associate = edA + Position = 3 + TabOrder = 2 + end + object udB: TUpDown + Left = 137 + Top = 23 + Width = 16 + Height = 21 + Associate = edB + Position = 5 + TabOrder = 3 + end + object btnSum: TButton + Left = 160 + Top = 19 + Width = 89 + Height = 25 + Caption = 'Call method' + TabOrder = 4 + OnClick = btnSumClick + end + object CheckBox1: TCheckBox + Left = 264 + Top = 25 + Width = 225 + Height = 17 + Caption = 'Send request each second automatically' + TabOrder = 5 + OnClick = CheckBox1Click + end + end + object GroupBox1: TGroupBox + Left = 8 + Top = 272 + Width = 522 + Height = 241 + Anchors = [akLeft, akTop, akRight, akBottom] + Caption = 'Log' + TabOrder = 1 + DesignSize = ( + 522 + 241) + object memLog: TMemo + Left = 8 + Top = 16 + Width = 506 + Height = 217 + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssBoth + TabOrder = 0 + end + end + object gbChannelOptions: TGroupBox + Left = 8 + Top = 64 + Width = 522 + Height = 209 + Anchors = [akLeft, akTop, akRight] + Caption = 'Channel Options' + TabOrder = 2 + DesignSize = ( + 522 + 209) + object Label2: TLabel + Left = 8 + Top = 72 + Width = 78 + Height = 13 + Caption = 'Server Locators:' + end + object chkFaultTolerance: TCheckBox + Left = 8 + Top = 24 + Width = 97 + Height = 17 + Caption = 'Fault Tolerance' + Checked = True + State = cbChecked + TabOrder = 0 + OnClick = chkFaultToleranceClick + end + object chkLoadBalancing: TCheckBox + Left = 8 + Top = 48 + Width = 97 + Height = 17 + Caption = 'Load Balancing' + Checked = True + State = cbChecked + TabOrder = 1 + OnClick = chkLoadBalancingClick + end + object lvLocators: TListView + Left = 8 + Top = 88 + Width = 506 + Height = 113 + Anchors = [akLeft, akTop, akRight] + Columns = < + item + Caption = 'Locator Name' + Width = 150 + end + item + Caption = 'Host' + Width = 150 + end + item + Caption = 'Port' + Width = 100 + end + item + Caption = 'State' + Width = 100 + end> + HideSelection = False + ReadOnly = True + RowSelect = True + SmallImages = il + TabOrder = 2 + ViewStyle = vsReport + end + object GroupBox2: TGroupBox + Left = 152 + Top = 8 + Width = 193 + Height = 73 + Caption = 'Auto-Probing' + TabOrder = 3 + object Label1: TLabel + Left = 9 + Top = 48 + Width = 81 + Height = 13 + Caption = 'Probe Frequency' + end + object Label3: TLabel + Left = 165 + Top = 48 + Width = 17 + Height = 13 + Caption = 'sec' + end + object chkProbeServers: TCheckBox + Left = 8 + Top = 24 + Width = 105 + Height = 17 + Alignment = taLeftJustify + Caption = 'ProbeServers' + Checked = True + State = cbChecked + TabOrder = 0 + OnClick = chkProbeServersClick + end + object edProbeFreequency: TEdit + Left = 99 + Top = 44 + Width = 47 + Height = 21 + TabOrder = 1 + Text = '60' + end + object udProbeFreequency: TUpDown + Left = 145 + Top = 44 + Width = 16 + Height = 21 + Associate = edProbeFreequency + Position = 60 + TabOrder = 2 + OnChangingEx = udProbeFreequencyChangingEx + end + end + object GroupBox3: TGroupBox + Left = 352 + Top = 8 + Width = 161 + Height = 73 + Caption = 'Manual' + TabOrder = 4 + object btnProbeAll: TButton + Left = 6 + Top = 16 + Width = 147 + Height = 25 + Caption = 'Probe All' + TabOrder = 0 + OnClick = btnProbeAllClick + end + object btnProbeSelected: TButton + Left = 6 + Top = 40 + Width = 147 + Height = 25 + Caption = 'Probe selected' + TabOrder = 1 + OnClick = btnProbeSelectedClick + end + end + end + object ROMessage: TROBinMessage + Envelopes = <> + Left = 28 + Top = 184 + end + object ROChannel: TROIndyTCPChannel + OnFailure = ROChannelException + OnException = ROChannelException + ServerLocators = < + item + Name = 'ServerAlfa' + Enabled = True + Host = 'localhost' + Port = 8091 + DisableOnFailure = True + LoadBalancingServer = True + ProbingOptions = [poProbeWhenEnabled, poProbeWhenDisabled, poEnableIfProbeSucceeded, poDisableIfProbeFailed] + OnEnabledChanged = LogLocatorState + end + item + Name = 'ServerBeta' + Enabled = True + Host = 'localhost' + Port = 8092 + DisableOnFailure = True + LoadBalancingServer = True + ProbingOptions = [poProbeWhenEnabled, poProbeWhenDisabled, poEnableIfProbeSucceeded, poDisableIfProbeFailed] + OnEnabledChanged = LogLocatorState + end + item + Name = 'ServerGamma' + Enabled = True + Host = 'localhost' + Port = 8093 + DisableOnFailure = True + LoadBalancingServer = True + ProbingOptions = [poProbeWhenEnabled, poProbeWhenDisabled, poEnableIfProbeSucceeded, poDisableIfProbeFailed] + OnEnabledChanged = LogLocatorState + end + item + Name = 'ServerDelta' + Enabled = True + Host = 'localhost' + Port = 8094 + DisableOnFailure = True + LoadBalancingServer = True + ProbingOptions = [poProbeWhenEnabled, poProbeWhenDisabled, poEnableIfProbeSucceeded, poDisableIfProbeFailed] + OnEnabledChanged = LogLocatorState + end> + DispatchOptions = [doFaultTolerant, doLoadBalanced] + OnServerLocatorAssignment = ROChannelServerLocatorAssignment + ProbeServers = True + OnBeforeProbingServers = ROChannelBeforeProbingServers + OnAfterProbingServers = ROChannelAfterProbingServers + OnBeforeProbingServer = ROChannelBeforeProbingServer + OnAfterProbingServer = ROChannelAfterProbingServer + Port = 8090 + Host = '127.0.0.1' + Left = 88 + Top = 184 + end + object RORemoteService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'LoadBalancingService' + Left = 56 + Top = 184 + end + object il: TImageList + Left = 240 + Top = 208 + Bitmap = { + 494C010103000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FF000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000BFBFBF00BFBFBF007F7F7F007F7F7F007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000BFBFBF00BFBFBF007F7F7F007F7F7F007F7F7F00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000FF000000FF000000FF0000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000BFBF + BF00BFBFBF007F7F7F000000000000000000000000007F7F7F007F7F7F007F7F + 7F0000000000000000000000000000000000000000000000000000000000BFBF + BF00BFBFBF007F7F7F000000000000000000000000007F7F7F007F7F7F007F7F + 7F00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000FF000000FF000000FF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000BFBFBF00BFBF + BF0000000000FFFFFF0000FF0000FFFFFF0000FF0000FFFFFF00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000BFBFBF00BFBF + BF0000000000FFFFFF000000FF00FFFFFF000000FF00FFFFFF00000000007F7F + 7F007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000000000000000FF + 000000FF000000FF000000FF000000FF00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000BFBFBF000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 00007F7F7F000000000000000000000000000000000000000000BFBFBF000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 00007F7F7F000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000FF000000FF + 000000FF000000FF000000FF000000FF00000000000000000000000000000000 + 00000000000000000000000000000000000000000000BFBFBF007F7F7F00FFFF + FF00000000000000000000FF000000800000008000000000000000000000FFFF + FF007F7F7F007F7F7F00000000000000000000000000BFBFBF007F7F7F00FFFF + FF0000000000000000000000FF0000008000000080000000000000000000FFFF + FF007F7F7F007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000007F7F7F0000FF000000FF + 0000000000000000000000FF000000FF000000FF000000000000000000000000 + 00000000000000000000000000000000000000000000BFBFBF000000000000FF + 00000000000000FF00000080000000FF000000800000008000000000000000FF + 0000000000007F7F7F00000000000000000000000000BFBFBF00000000000000 + FF00000000000000FF00000080000000FF000000800000008000000000000000 + FF00000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000007F7F7F0000FF0000000000000000 + 000000000000000000000000000000FF000000FF000000000000000000000000 + 00000000000000000000000000000000000000000000FFFFFF0000000000FFFF + FF000000000000FF000000FF000000FF000000FF00000080000000000000FFFF + FF00000000007F7F7F00000000000000000000000000FFFFFF0000000000FFFF + FF00000000000000FF000000FF000000FF000000FF000000800000000000FFFF + FF00000000007F7F7F0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000FF000000FF000000FF0000000000000000 + 00000000000000000000000000000000000000000000FFFFFF000000000000FF + 000000000000FFFFFF0000FF000000FF00000080000000FF00000000000000FF + 000000000000BFBFBF00000000000000000000000000FFFFFF00000000000000 + FF0000000000FFFFFF000000FF000000FF00000080000000FF00000000000000 + FF0000000000BFBFBF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FF000000FF0000000000000000 + 00000000000000000000000000000000000000000000FFFFFF007F7F7F00FFFF + FF000000000000000000FFFFFF00FFFFFF0000FF00000000000000000000FFFF + FF007F7F7F00BFBFBF00000000000000000000000000FFFFFF007F7F7F00FFFF + FF000000000000000000FFFFFF00FFFFFF000000FF000000000000000000FFFF + FF007F7F7F00BFBFBF0000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000FF000000FF00000000 + 0000000000000000000000000000000000000000000000000000BFBFBF000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000BFBFBF000000000000000000000000000000000000000000BFBFBF000000 + 0000FFFFFF000000000000000000000000000000000000000000FFFFFF000000 + 0000BFBFBF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000007F7F7F0000FF + 0000000000000000000000000000000000000000000000000000FFFFFF00BFBF + BF0000000000FFFFFF0000FF0000FFFFFF0000FF0000FFFFFF0000000000BFBF + BF00BFBFBF000000000000000000000000000000000000000000FFFFFF00BFBF + BF0000000000FFFFFF000000FF00FFFFFF000000FF00FFFFFF0000000000BFBF + BF00BFBFBF000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000007F7F + 7F0000FF0000000000000000000000000000000000000000000000000000FFFF + FF00BFBFBF007F7F7F000000000000000000000000007F7F7F00BFBFBF00BFBF + BF0000000000000000000000000000000000000000000000000000000000FFFF + FF00BFBFBF007F7F7F000000000000000000000000007F7F7F00BFBFBF00BFBF + BF00000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FF000000FF0000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00BFBFBF00BFBFBF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00BFBFBF00BFBFBF00000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FFFFFFFFFFFF0000FFFFF83FF83F0000 + F9FFE00FE00F0000F0FFC007C0070000F0FF800380030000E07F800380030000 + C07F000100010000843F0001000100001E3F000100010000FE1F000100010000 + FF1F000100010000FF8F800380030000FFC7800380030000FFE3C007C0070000 + FFF8E00FE00F0000FFFFF83FF83F000000000000000000000000000000000000 + 000000000000} + end + object t: TTimer + Enabled = False + OnTimer = tTimer + Left = 488 + Top = 24 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fClientForm.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fClientForm.pas new file mode 100644 index 0000000..e55f518 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fClientForm.pas @@ -0,0 +1,334 @@ +unit fClientForm; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROIndyTCPChannel, + ComCtrls, ImgList, ExtCtrls; + +type + TClientForm = class(TForm) + ROMessage: TROBinMessage; + ROChannel: TROIndyTCPChannel; + RORemoteService: TRORemoteService; + gbSum: TGroupBox; + edA: TEdit; + edB: TEdit; + udA: TUpDown; + udB: TUpDown; + lblA: TLabel; + lblB: TLabel; + btnSum: TButton; + GroupBox1: TGroupBox; + memLog: TMemo; + gbChannelOptions: TGroupBox; + chkFaultTolerance: TCheckBox; + chkLoadBalancing: TCheckBox; + Label2: TLabel; + lvLocators: TListView; + GroupBox2: TGroupBox; + Label1: TLabel; + chkProbeServers: TCheckBox; + edProbeFreequency: TEdit; + GroupBox3: TGroupBox; + btnProbeAll: TButton; + btnProbeSelected: TButton; + il: TImageList; + udProbeFreequency: TUpDown; + CheckBox1: TCheckBox; + t: TTimer; + Label3: TLabel; + procedure FormCreate(Sender: TObject); + procedure chkFaultToleranceClick(Sender: TObject); + procedure chkLoadBalancingClick(Sender: TObject); + procedure chkProbeServersClick(Sender: TObject); + procedure udProbeFreequencyChangingEx(Sender: TObject; + var AllowChange: Boolean; NewValue: Smallint; + Direction: TUpDownDirection); + procedure btnProbeAllClick(Sender: TObject); + procedure btnProbeSelectedClick(Sender: TObject); + procedure btnSumClick(Sender: TObject); + procedure btnGetServerTimeClick(Sender: TObject); + procedure LogLocatorState(Sender: TROServerLocator); + procedure ROChannelBeforeProbingServer(Sender: TROTransportChannel; + aServerLocator: TROServerLocator); + procedure ROChannelAfterProbingServer(Sender: TROTransportChannel; + aServerLocator: TROServerLocator; Failed: Boolean); + procedure ROChannelBeforeProbingServers(Sender: TROTransportChannel); + procedure ROChannelAfterProbingServers(Sender: TROTransportChannel; + ProbedCount, EnabledCount, DisabledCount: Integer); + procedure ROChannelServerLocatorAssignment(Sender: TROTransportChannel; + aLocator: TROServerLocator; aException: Exception); + procedure tTimer(Sender: TObject); + procedure CheckBox1Click(Sender: TObject); + procedure ROChannelException(Sender: TROTransportChannel; + anException: Exception; var aRetry: Boolean); + + private + { Private declarations } + procedure Log(aMessage: String); + procedure FillLocators(aChannel: TROTransportChannel); + procedure UpdateLocator(aLocator: TROServerLocator); + procedure ReEnableIfAllDisabled; + public + { Public declarations } + end; + +var + ClientForm: TClientForm; + +implementation + +{ + The unit LoadBalancingLibrary_Intf.pas will be generated by the RemObjects preprocessor the first time you + compile your server application. Make sure to do that before trying to compile the client. + + To invoke your server simply typecast your server to the name of the service interface like this: + + (RORemoteService as ILoadBalancingService).Sum(1,2) +} + +uses LoadBalancingLibrary_Intf; + +{$R *.dfm} +procedure TClientForm.Log(aMessage: String); +begin + memLog.Lines.Add(aMessage); +end; + + +procedure TClientForm.FillLocators(aChannel: TROTransportChannel); +var + i: Integer; + lLocator: TROServerLocator; + lCurrentLocator: TROServerLocator; + lItem: TListItem; +begin + lvLocators.Items.BeginUpdate(); + lvLocators.Items.Clear(); + try + lCurrentLocator := aChannel.CurrentLocator; + for i := 0 to aChannel.ServerLocators.Count - 1 do begin + lLocator := aChannel.ServerLocators[i]; + lItem := lvLocators.Items.Add(); + lItem.Data := lLocator; + lItem.Caption := lLocator.Name; + lItem.SubItems.Add(lLocator.Host); + lItem.SubItems.Add(IntToStr(lLocator.Port)); + if lLocator.Enabled then begin + lItem.SubItems.Add('Enabled'); + lItem.ImageIndex := 1; + end else begin + lItem.SubItems.Add('Disabled'); + lItem.ImageIndex := 2; + end; + if lLocator = lCurrentLocator then + lItem.ImageIndex := 0; + end; + finally + lvLocators.Items.EndUpdate(); + end; +end; + +procedure TClientForm.UpdateLocator(aLocator: TROServerLocator); +var i: Integer; + lLocator: TROServerLocator; + lListItem: TListItem; +begin + for i := 0 to lvLocators.Items.Count -1 do begin + lListItem := lvLocators.Items[i]; + lLocator := TROServerLocator(lListItem.Data); + if lLocator = aLocator then begin + if lLocator.Enabled then begin + lListItem.SubItems[2] := 'Enabled'; + lListItem.ImageIndex := 1; + end else begin + lListItem.SubItems[2] := 'Disabled'; + lListItem.ImageIndex := 2; + end; + if lLocator = ROChannel.ServerLocators[ROChannel.LoadBalancerLocatorIdx] then + lListItem.ImageIndex := 0; + exit; + end; + end; +end; + +procedure TClientForm.FormCreate(Sender: TObject); +begin + FillLocators(ROChannel); +end; + +procedure TClientForm.chkFaultToleranceClick(Sender: TObject); +begin + if chkFaultTolerance.Checked then + ROChannel.DispatchOptions := + ROChannel.DispatchOptions + [doFaultTolerant] + else + ROChannel.DispatchOptions := + ROChannel.DispatchOptions - [doFaultTolerant]; +end; + +procedure TClientForm.chkLoadBalancingClick(Sender: TObject); +begin + if chkLoadBalancing.Checked then + ROChannel.DispatchOptions := + ROChannel.DispatchOptions + [doLoadBalanced] + else + ROChannel.DispatchOptions := + ROChannel.DispatchOptions - [doLoadBalanced]; + +end; + +procedure TClientForm.chkProbeServersClick(Sender: TObject); +begin + ROChannel.ProbeServers := chkProbeServers.Checked; +end; + +procedure TClientForm.udProbeFreequencyChangingEx(Sender: TObject; + var AllowChange: Boolean; NewValue: Smallint; + Direction: TUpDownDirection); +begin + ROChannel.ProbeFrequency := NewValue * 1000; +end; + +procedure TClientForm.btnProbeAllClick(Sender: TObject); +begin + Log('Probe all servers manully...'); + (ROChannel as IROTransportChannel).ProbeAll(); + Log('Done'); +end; + +procedure TClientForm.btnProbeSelectedClick(Sender: TObject); +begin + if (Assigned(lvLocators.Selected) and + Assigned(lvLocators.Selected.Data) and + Assigned(TROServerLocator(lvLocators.Selected.Data))) then begin + (ROChannel as IROTransportChannel).Probe(TROServerLocator(lvLocators.Selected.Data)); + FillLocators(ROChannel); + end; +end; + +procedure TClientForm.btnSumClick(Sender: TObject); +var a, b, r: Integer; +begin + a := udA.Position; + b := udB.Position; + Log('Calling Sum function ...'); + r := (RORemoteService as ILoadBalancingService).Sum(a, b); + Log(Format('%d + %d = %d', [a, b, r])); + Log('Sum function executed.'); + + FillLocators(ROChannel); +end; + +procedure TClientForm.btnGetServerTimeClick(Sender: TObject); +var d: TDateTime; +begin + Log('Calling Get Server Time function ...'); + d := (RORemoteService as ILoadBalancingService).GetServerTime(); + Log(Format('Server time is: %s', [DateTimeToStr(d)])); + Log('Get Server Time function executed.'); + + FillLocators(ROChannel); +end; + + + +procedure TClientForm.LogLocatorState(Sender: TROServerLocator); +var l: String; +begin + if (Sender.Enabled) then + l := 'enabled' + else + l:= 'disabled'; + Log(Format('Locator "%s" has been %s.', [Sender.Name, l])); +end; + +procedure TClientForm.ROChannelBeforeProbingServer( + Sender: TROTransportChannel; aServerLocator: TROServerLocator); +var l: String; +begin + if aServerLocator.Enabled then + l := 'enabled' + else + l:='disabled'; + + Log(Format('Starting probing server "%s". Current state is "%s"', [aServerLocator.Name, l])); +end; + +procedure TClientForm.ROChannelAfterProbingServer( + Sender: TROTransportChannel; aServerLocator: TROServerLocator; + Failed: Boolean); +var l, s: String; +begin + if Failed then + s:='failed' + else + s:='was successful'; + + if aServerLocator.Enabled then + l := 'enabled' + else + l:='disabled'; + + Log(Format('Probing server "%s" %s. State is "%s".', [aServerLocator.Name, s, l])); + //UpdateLocator(aServerLocator); + FillLocators(Sender); +end; + +procedure TClientForm.ROChannelBeforeProbingServers( + Sender: TROTransportChannel); +begin + Log('Starting probing available servers...'); +end; + +procedure TClientForm.ROChannelAfterProbingServers( + Sender: TROTransportChannel; ProbedCount, EnabledCount, + DisabledCount: Integer); +begin + Log('Probing available servers completed.'); + Log(Format('Probed %d servers, %d enabled and %d disabled.', [ProbedCount, EnabledCount, DisabledCount])); +end; + +procedure TClientForm.ROChannelServerLocatorAssignment( + Sender: TROTransportChannel; aLocator: TROServerLocator; + aException: Exception); +begin + if Assigned(aException) then + Log(Format('Exception: %s.', [aException.Message])); + Log(Format('Locator %s (Host=%s; Port=%d) has been assigned.', [aLocator.Name, aLocator.Host, aLocator.Port])); + //UpdateLocator(aLocator); + FillLocators(Sender); +end; + +procedure TClientForm.tTimer(Sender: TObject); +begin + btnSum.Click(); +end; + +procedure TClientForm.CheckBox1Click(Sender: TObject); +begin + t.Enabled := CheckBox1.Checked; +end; + +procedure TClientForm.ReEnableIfAllDisabled; +var + i: integer; +begin + for i := 0 to ROChannel.ServerLocators.Count -1 do + if ROChannel.ServerLocators[i].Enabled then Exit; + Log('All locators are disabled. re-enabling all locators.'); + for i := 0 to ROChannel.ServerLocators.Count -1 do + ROChannel.ServerLocators[i].Enabled := True; +end; + +procedure TClientForm.ROChannelException(Sender: TROTransportChannel; + anException: Exception; var aRetry: Boolean); +begin + Log(anException.Message); + ReEnableIfAllDisabled; + aRetry := True; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerDataModule.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerDataModule.dfm new file mode 100644 index 0000000..be97343 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerDataModule.dfm @@ -0,0 +1,23 @@ +object ServerDataModule: TServerDataModule + OldCreateOrder = False + OnCreate = DataModuleCreate + Left = 475 + Top = 159 + Height = 189 + Width = 292 + object ROMessage: TROBinMessage + Left = 40 + Top = 8 + end + object ROServer: TROIndyTCPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + end> + Port = 8090 + Left = 90 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerDataModule.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerDataModule.pas new file mode 100644 index 0000000..c0f83b9 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerDataModule.pas @@ -0,0 +1,33 @@ +unit fServerDataModule; + +interface + +uses + SysUtils, Classes, uROClient, uROServer, uROIndyTCPServer, + uROPoweredByRemObjectsButton, uROClientIntf, uROClasses, + uROBinMessage{, uROIndyTCPServer}; + +type + TServerDataModule = class(TDataModule) + ROMessage: TROBinMessage; + ROServer: TROIndyTCPServer; + procedure DataModuleCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ServerDataModule: TServerDataModule; + +implementation + +{$R *.dfm} + +procedure TServerDataModule.DataModuleCreate(Sender: TObject); +begin + //ROServer.Active := TRUE; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerForm.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerForm.dfm new file mode 100644 index 0000000..cdd859f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerForm.dfm @@ -0,0 +1,95 @@ +object ServerForm: TServerForm + Left = 498 + Top = 262 + BorderStyle = bsDialog + Caption = 'RemObjects Server' + ClientHeight = 217 + ClientWidth = 237 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object lblServerName: TLabel + Left = 8 + Top = 152 + Width = 217 + Height = 17 + Alignment = taCenter + AutoSize = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end + object btnActivateServer: TButton + Left = 8 + Top = 176 + Width = 217 + Height = 33 + Caption = 'Activate Server' + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 0 + OnClick = btnActivateServerClick + end + object gbPredefinedConfigurations: TGroupBox + Left = 8 + Top = 64 + Width = 217 + Height = 81 + Caption = 'Predefined Configurations' + TabOrder = 1 + object sbAlfa: TSpeedButton + Left = 8 + Top = 16 + Width = 97 + Height = 25 + GroupIndex = 1 + Caption = 'Server "Alfa"' + OnClick = ApplyConfig + end + object sbBeta: TSpeedButton + Left = 8 + Top = 48 + Width = 97 + Height = 25 + GroupIndex = 1 + Caption = 'Server "Beta"' + OnClick = ApplyConfig + end + object sbGamma: TSpeedButton + Left = 112 + Top = 16 + Width = 97 + Height = 25 + GroupIndex = 1 + Caption = 'Server "Gamma"' + OnClick = ApplyConfig + end + object sbDelta: TSpeedButton + Left = 112 + Top = 48 + Width = 97 + Height = 25 + GroupIndex = 1 + Caption = 'Server "Delta"' + OnClick = ApplyConfig + end + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerForm.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerForm.pas new file mode 100644 index 0000000..1d1d8d0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Load Balancing/fServerForm.pas @@ -0,0 +1,80 @@ +unit fServerForm; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, uROClasses, + ExtCtrls, Buttons; + +type + TServerForm = class(TForm) + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + btnActivateServer: TButton; + lblServerName: TLabel; + gbPredefinedConfigurations: TGroupBox; + sbAlfa: TSpeedButton; + sbBeta: TSpeedButton; + sbGamma: TSpeedButton; + sbDelta: TSpeedButton; + procedure ApplyConfig(Sender: TObject); + procedure btnActivateServerClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + ServerForm: TServerForm; + +implementation + +uses fServerDataModule; + + +{$R *.dfm} + +procedure TServerForm.ApplyConfig(Sender: TObject); +var lServerName: String; +begin + if (Sender as TComponent).Name = 'sbAlfa' then begin + lServerName := 'Alfa'; + ServerDataModule.ROServer.Port := 8091; + end else + if (Sender as TComponent).Name = 'sbBeta' then begin + lServerName := 'Beta'; + ServerDataModule.ROServer.Port := 8092; + end else + if (Sender as TComponent).Name = 'sbGamma' then begin + lServerName := 'Gamma'; + ServerDataModule.ROServer.Port := 8093; + end else + if (Sender as TComponent).Name = 'sbDelta' then begin + lServerName := 'Delta'; + ServerDataModule.ROServer.Port := 8094; + end; + lblServerName.Caption := Format('Server "%s" on port %d', [lServerName, ServerDataModule.ROServer.Port]); +end; + +procedure TServerForm.btnActivateServerClick(Sender: TObject); +begin + ServerDataModule.ROServer.Active := not ServerDataModule.ROServer.Active; + + if ServerDataModule.ROServer.Active then begin + btnActivateServer.Caption := 'Deactivate server'; + lblServerName.Font.Color := clGreen; + end else begin + btnActivateServer.Caption := 'Activate server'; + lblServerName.Font.Color := clRed; + end; +end; + +procedure TServerForm.FormCreate(Sender: TObject); +begin + sbAlfa.Click; + sbAlfa.Down := true; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.Sample.html new file mode 100644 index 0000000..5dd02c7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.Sample.html @@ -0,0 +1,61 @@ + + + + + + + + + +

    + MegaDemo Sample +

    + +

    Purpose

    + +

    This comprehensive example illustrates many of the features of theRemObjects SDK by providing benchmark facilities for the various protocols and channels supported.

    + +

    The following are included: +

      +
    • message types
    • +
        +
      • TROBINMessage
      • +
      • TROSOAPMessage
      • +
      • TROPostMessage
      • +
      • TROServerMultiMessage
      • +
      +
    • transport channels
    • +
        +
      • TROWinMessageChannel
      • +
      • TROWinInetHTTPChannel
      • +
      • TROIndyHTTPChannel
      • +
      • TROIndyTCPChannel
      • +
      +
    • message encrypting and compression
    • +
    +

    +The tests you can perform are very comprehensive. In particular, try the Stress Test which runs all the tests once or many times. +

    . + +

    You can also specify how much information is displayed about the test results by using Write Test Info,Verbose and Enable Log.

    + +

    Examine the Code

    +
      +
    • See how the Twelve methods were defined by editing the service library. + Do this by making the server the selected project and + by using the menu option: RemObjects | Edit Service Library. + Note: if you don't see this menu option but see 'Service Builder' instead, + you still have the client set as the current project. + Examine the methods added to MegaDemoService.
    • +
    • + Check how the server methods were implemented in + MegaDemoService_Impl.pas. +
    • +
    • + Examine the simple code needed to invoke the methods in + MegaDemoClientMain.pas. +
    • +
    + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.bdsgroup new file mode 100644 index 0000000..6721b5e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.bdsgroup @@ -0,0 +1,21 @@ + + + + + + + + + + + + + MegaDemoServer.bdsproj + MegaDemoClient.bdsproj + MegaDemoISAPI.bdsproj + MegaDemoServer.exe MegaDemoClient.exe MegaDemoISAPI.dll + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.bpg new file mode 100644 index 0000000..d41db19 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.bpg @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = MegaDemoServer.exe MegaDemoClient.exe MegaDemoISAPI.dll +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +MegaDemoServer.exe: MegaDemoServer.dpr + $(DCC) + +MegaDemoClient.exe: MegaDemoClient.dpr + $(DCC) + +MegaDemoISAPI.dll: MegaDemoISAPI.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.groupproj new file mode 100644 index 0000000..95c606a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemo.groupproj @@ -0,0 +1,49 @@ + + + {ef074fbb-1501-498f-9a4b-0f5d4c51bf53} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.bdsproj new file mode 100644 index 0000000..fd3dcfd --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MegaDemoClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.dpr new file mode 100644 index 0000000..ce9b228 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.dpr @@ -0,0 +1,15 @@ +program MegaDemoClient; + +uses + Forms, + MegaDemoClientMain in 'MegaDemoClientMain.pas' {MegaDemoClientMainForm}, + MegaDemoCustomClass in 'MegaDemoCustomClass.pas'; + +{$R *.RES} + +begin + Application.Initialize; + Application.Title := 'RemObjects MegaDemo Client'; + Application.CreateForm(TMegaDemoClientMainForm, MegaDemoClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.dproj new file mode 100644 index 0000000..7311de1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.dproj @@ -0,0 +1,73 @@ + + + {3492e535-a0ea-4598-93c9-cec490cccd99} + MegaDemoClient.dpr + Debug + AnyCPU + DCC32 + MegaDemoClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MegaDemoClient.dpr + + + + + + + MainSource + + +
    MegaDemoClientMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClientMain.dfm new file mode 100644 index 0000000..ed3b9f1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClientMain.dfm @@ -0,0 +1,1083 @@ +object MegaDemoClientMainForm: TMegaDemoClientMainForm + Left = 434 + Top = 193 + Width = 702 + Height = 470 + Caption = 'RemObjects SDK 4.0 for Delphi - Mega Demo Client' + Color = clBtnFace + Constraints.MinHeight = 444 + Constraints.MinWidth = 675 + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + ShowHint = True + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel3: TPanel + Left = 0 + Top = 0 + Width = 686 + Height = 434 + Align = alClient + BevelOuter = bvNone + BorderWidth = 5 + TabOrder = 0 + object Panel4: TPanel + Left = 5 + Top = 150 + Width = 676 + Height = 140 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object Label15: TLabel + Left = 617 + Top = 61 + Width = 25 + Height = 13 + Caption = 'times' + end + object Label14: TLabel + Left = 619 + Top = 85 + Width = 37 + Height = 13 + Caption = 'threads' + end + object clbTests: TCheckListBox + Left = 0 + Top = 0 + Width = 112 + Height = 108 + Hint = 'Select test' + OnClickCheck = clbTestsClickCheck + Align = alLeft + ItemHeight = 13 + Items.Strings = ( + 'Stress Test' + 'Sum' + 'EchoPerson' + 'TestArrays' + 'EchoBinary' + 'GetServerTime' + 'CustomClass' + 'RaiseError') + TabOrder = 0 + OnClick = clbTestsClick + end + object Panel5: TPanel + Left = 0 + Top = 108 + Width = 676 + Height = 32 + Align = alBottom + BevelOuter = bvNone + TabOrder = 5 + object cbEnableLog: TCheckBox + Left = 183 + Top = 8 + Width = 82 + Height = 17 + Hint = 'Allows to show the report on performance of tests' + Caption = 'Enable Log' + TabOrder = 2 + end + object cbVerbose: TCheckBox + Left = 111 + Top = 8 + Width = 66 + Height = 17 + Hint = + 'Allows to show progress of transfer / reception of data for BIN ' + + 'Message' + Caption = 'Verbose' + TabOrder = 1 + end + object cbWriteTestInfo: TCheckBox + Left = 7 + Top = 8 + Width = 97 + Height = 17 + Hint = 'Shows the information on the test ' + Caption = 'Write Test Info' + TabOrder = 0 + end + object bClearLog: TButton + Left = 592 + Top = 7 + Width = 80 + Height = 25 + Caption = 'Clear Log' + TabOrder = 3 + OnClick = bClearLogClick + end + end + object RunTestOnceButton: TButton + Left = 572 + Top = 1 + Width = 100 + Height = 25 + Caption = 'Run Test Once' + TabOrder = 1 + OnClick = RunTestOnceButtonClick + end + object RunTestButton: TButton + Left = 572 + Top = 28 + Width = 100 + Height = 25 + Caption = 'Run Multiple Tests' + TabOrder = 2 + OnClick = RunTestButtonClick + end + object seRepetitions: TSpinEdit + Left = 575 + Top = 56 + Width = 40 + Height = 22 + Hint = 'Set times for Stress test and multiple tests' + MaxValue = 0 + MinValue = 0 + TabOrder = 3 + Value = 10 + end + object seThreads: TSpinEdit + Left = 575 + Top = 80 + Width = 40 + Height = 22 + Hint = 'Set threads for Stress test and multiple tests' + MaxValue = 0 + MinValue = 0 + TabOrder = 4 + Value = 5 + end + object pPage: TPanel + Left = 112 + Top = 1 + Width = 456 + Height = 108 + Align = alCustom + Anchors = [akLeft, akTop, akBottom] + BevelOuter = bvNone + TabOrder = 6 + object pagecontrol2: TPageControl + Left = 0 + Top = 0 + Width = 456 + Height = 108 + ActivePage = tsStress + Align = alClient + TabOrder = 0 + object tsStress: TTabSheet + Caption = 'Stress' + object pStress: TPanel + Left = 0 + Top = 0 + Width = 448 + Height = 80 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + DesignSize = ( + 448 + 80) + object Label17: TLabel + Left = 7 + Top = 0 + Width = 434 + Height = 79 + Anchors = [akLeft, akTop, akRight, akBottom] + AutoSize = False + Caption = + 'This test allows you to run one or more of the individual tests,' + + ' depending on which are checked.'#13#10#13#10'IMPORTANT: before running an' + + 'y test, you must activate the server'#39's transport that matches th' + + 'e channel selected on this client (default is HTTP Channel).' + WordWrap = True + end + end + end + object tsSum: TTabSheet + Caption = 'Sum' + ImageIndex = 1 + object pSum: TPanel + Left = 0 + Top = 0 + Width = 448 + Height = 80 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Label18: TLabel + Left = 7 + Top = 60 + Width = 435 + Height = 19 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + AutoSize = False + Caption = 'This method fulfils the sum of argument A and argument B' + WordWrap = True + end + object Label16: TLabel + Left = 7 + Top = 28 + Width = 60 + Height = 13 + Caption = 'Argument B:' + end + object Label11: TLabel + Left = 7 + Top = 5 + Width = 61 + Height = 13 + Caption = 'Argument A:' + end + object seB: TSpinEdit + Left = 75 + Top = 23 + Width = 81 + Height = 22 + Hint = 'Set argument B for Sum test' + MaxValue = 0 + MinValue = 0 + TabOrder = 1 + Value = 2 + end + object seA: TSpinEdit + Left = 75 + Top = 0 + Width = 81 + Height = 22 + Hint = 'Set argument A for Sum test' + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 1 + end + end + end + object tsEchoPerson: TTabSheet + Caption = 'EchoPerson' + ImageIndex = 2 + object pEchoPerson: TPanel + Left = 0 + Top = 0 + Width = 448 + Height = 80 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Label19: TLabel + Left = 7 + Top = 60 + Width = 433 + Height = 19 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + AutoSize = False + Caption = + 'This method created object TPerson and send it to server and r' + + 'eturns a copy of this object from a server' + WordWrap = True + end + object Label2: TLabel + Left = 7 + Top = 4 + Width = 55 + Height = 13 + Caption = 'First Name:' + end + object Label3: TLabel + Left = 215 + Top = 5 + Width = 54 + Height = 13 + Caption = 'Last Name:' + end + object Label4: TLabel + Left = 38 + Top = 27 + Width = 23 + Height = 13 + Caption = 'Age:' + end + object Label5: TLabel + Left = 120 + Top = 27 + Width = 22 + Height = 13 + Caption = 'Sex:' + end + object eLastName: TEdit + Left = 284 + Top = 1 + Width = 124 + Height = 21 + Hint = 'Set Last Name for EchoPerson test' + TabOrder = 1 + Text = 'Smith' + end + object cbSex: TComboBox + Left = 143 + Top = 23 + Width = 109 + Height = 21 + Hint = 'Set Sex for EchoPerson test' + Style = csDropDownList + ItemHeight = 13 + TabOrder = 3 + end + object eFirstName: TEdit + Left = 75 + Top = 0 + Width = 124 + Height = 21 + Hint = 'Set First Name for EchoPerson test' + TabOrder = 0 + Text = 'John' + end + object seAge: TSpinEdit + Left = 75 + Top = 22 + Width = 42 + Height = 22 + Hint = 'Set Age for EchoPerson test' + MaxValue = 0 + MinValue = 0 + TabOrder = 2 + Value = 33 + end + end + end + object tsTestArrays: TTabSheet + Caption = 'TestArrays' + ImageIndex = 4 + object pTestArrays: TPanel + Left = 0 + Top = 0 + Width = 448 + Height = 80 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Label6: TLabel + Left = 7 + Top = 5 + Width = 33 + Height = 13 + Caption = 'Count:' + end + object Label20: TLabel + Left = 7 + Top = 60 + Width = 437 + Height = 19 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + AutoSize = False + Caption = + 'This method sends the array on a server and returns a copy of th' + + 'is array from a server' + WordWrap = True + end + object rbInteger: TRadioButton + Left = 7 + Top = 22 + Width = 85 + Height = 17 + Hint = 'Use integer array for TestArrays test' + Caption = 'Integer array' + Checked = True + TabOrder = 1 + TabStop = True + end + object seArrayCount: TSpinEdit + Left = 75 + Top = 0 + Width = 81 + Height = 22 + Hint = 'Set array size for TestArrays test' + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 10 + end + object rbTPerson: TRadioButton + Left = 175 + Top = 22 + Width = 89 + Height = 17 + Hint = 'Use TPerson array for TestArrays test' + Caption = 'TPerson array' + TabOrder = 3 + end + object rbString: TRadioButton + Left = 91 + Top = 22 + Width = 77 + Height = 17 + Hint = 'Use string array for TestArrays test' + Caption = 'String array' + TabOrder = 2 + end + end + end + object tsEchoBinary: TTabSheet + Caption = 'EchoBinary' + ImageIndex = 5 + object pEchoBinary: TPanel + Left = 0 + Top = 0 + Width = 448 + Height = 80 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Label7: TLabel + Left = 7 + Top = 5 + Width = 23 + Height = 13 + Caption = 'Size:' + end + object Label21: TLabel + Left = 7 + Top = 60 + Width = 438 + Height = 17 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + AutoSize = False + Caption = + 'This method creates the buffer with the set size and dispatches ' + + 'it on a server. The server returns a copy of this buffer' + WordWrap = True + end + object seBinSize: TSpinEdit + Left = 75 + Top = 0 + Width = 49 + Height = 22 + Hint = 'Set buffer size for EchoBinary test' + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 5000 + end + end + end + object tsGetServerTime: TTabSheet + Caption = 'GetServerTime' + ImageIndex = 6 + object pGetServerTime: TPanel + Left = 0 + Top = 0 + Width = 448 + Height = 80 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Label22: TLabel + Left = 7 + Top = 0 + Width = 437 + Height = 75 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + AutoSize = False + Caption = 'This method returns current time of a server' + WordWrap = True + end + end + end + object tsCustomClass: TTabSheet + Caption = 'CustomClass' + ImageIndex = 7 + object pCustomClass: TPanel + Left = 0 + Top = 0 + Width = 448 + Height = 80 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Label23: TLabel + Left = 7 + Top = 60 + Width = 437 + Height = 17 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + AutoSize = False + Caption = 'This method returns from a server the object as XML or a stream' + WordWrap = True + end + object rbStream: TRadioButton + Left = 7 + Top = 0 + Width = 63 + Height = 17 + Hint = 'To receive TCustomClass as TStreamtomClass' + Caption = 'Stream' + Checked = True + TabOrder = 0 + TabStop = True + end + object rbXML: TRadioButton + Left = 7 + Top = 17 + Width = 63 + Height = 17 + Hint = 'To receive TCustomClass as XML string' + Caption = 'XML' + TabOrder = 1 + end + end + end + object tsRaiseError: TTabSheet + Caption = 'RaiseError' + ImageIndex = 3 + object pRaiseError: TPanel + Left = 0 + Top = 0 + Width = 448 + Height = 80 + Align = alClient + BevelOuter = bvNone + TabOrder = 0 + object Label24: TLabel + Left = 7 + Top = 60 + Width = 440 + Height = 52 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + AutoSize = False + Caption = + 'If you run this test within the IDE, you will want to disable br' + + 'eak on exceptions. '#13#10#13#10'This test is not suitable for the Stress ' + + 'Test.' + WordWrap = True + end + object cbCustomException: TCheckBox + Left = 7 + Top = 0 + Width = 59 + Height = 17 + Hint = 'Set custom error for RaiseError test' + Caption = 'Custom' + Checked = True + State = cbChecked + TabOrder = 0 + end + end + end + end + end + end + object Panel1: TPanel + Left = 5 + Top = 5 + Width = 676 + Height = 145 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 46 + Top = 4 + Width = 212 + Height = 48 + Cursor = crHandPoint + ApplicationType = atClient + end + object GroupBox5: TGroupBox + Left = 0 + Top = 55 + Width = 112 + Height = 86 + Caption = ' Message Type ' + TabOrder = 0 + object rbBinary: TRadioButton + Left = 5 + Top = 15 + Width = 41 + Height = 17 + Hint = 'Use TROBINMessage' + Caption = 'Bin' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = rbBinaryClick + end + object rbSOAP: TRadioButton + Left = 5 + Top = 32 + Width = 49 + Height = 17 + Hint = 'Use TROSOAPMessage' + Caption = 'SOAP' + TabOrder = 1 + OnClick = rbSOAPClick + end + object rbPost: TRadioButton + Left = 5 + Top = 49 + Width = 49 + Height = 17 + Hint = 'Use TROPOSTMessage' + Caption = 'Post' + TabOrder = 2 + OnClick = rbPostClick + end + object rbXmlRpc: TRadioButton + Left = 5 + Top = 66 + Width = 61 + Height = 17 + Caption = 'XmlRpc' + TabOrder = 3 + OnClick = rbXmlRpcClick + end + end + object pgChannels: TPageControl + Left = 315 + Top = 1 + Width = 359 + Height = 145 + ActivePage = tsHttp + MultiLine = True + RaggedRight = True + Style = tsFlatButtons + TabOrder = 5 + OnChange = pgChannelsChange + object tsHttp: TTabSheet + Caption = 'HTTP' + ImageIndex = 1 + object Label1: TLabel + Left = 7 + Top = 11 + Width = 23 + Height = 13 + Caption = 'URL:' + end + object cbHTTPURL: TComboBox + Left = 65 + Top = 7 + Width = 250 + Height = 21 + Hint = 'Set url for http channel' + ItemHeight = 13 + TabOrder = 0 + Text = 'http://127.0.0.1:8099/bin' + OnChange = cbHTTPURLChange + Items.Strings = ( + 'http://localhost:8099/soap' + 'http://localhost:8099/bin' + 'http://localhost/MegaRO/soap' + 'http://localhost/MegaRO/bin') + end + object rbIndyHttp: TRadioButton + Left = 7 + Top = 47 + Width = 80 + Height = 17 + Hint = 'Usage TROIndyHttpChannel' + Caption = 'Indy' + TabOrder = 2 + OnClick = rbIndyHttpClick + end + object rbWinInetHttp: TRadioButton + Left = 7 + Top = 31 + Width = 80 + Height = 17 + Hint = 'Usage TROWininetHttpChannel' + Caption = 'WinInet' + Checked = True + TabOrder = 1 + TabStop = True + OnClick = rbIndyHttpClick + end + object rbSynapseHttp: TRadioButton + Left = 7 + Top = 63 + Width = 80 + Height = 17 + Hint = 'Usage TROSynapseHTTPChannel' + Caption = 'Synapse' + TabOrder = 3 + OnClick = rbIndyHttpClick + end + object cbKeepConnection: TCheckBox + Left = 7 + Top = 80 + Width = 79 + Height = 15 + Hint = 'Enables Keep Connection' + Caption = 'Keep-Alive' + Checked = True + State = cbChecked + TabOrder = 4 + end + end + object tsTCP: TTabSheet + Caption = 'TCP' + ImageIndex = 2 + object Label9: TLabel + Left = 7 + Top = 11 + Width = 43 + Height = 13 + Caption = 'Address:' + end + object Label10: TLabel + Left = 195 + Top = 9 + Width = 24 + Height = 13 + Caption = 'Port:' + end + object cbTCPIP: TComboBox + Left = 65 + Top = 7 + Width = 120 + Height = 21 + Hint = 'Set IP for tcp channel' + ItemHeight = 13 + TabOrder = 0 + Text = '127.0.0.1' + end + object cbTCPPort: TComboBox + Left = 245 + Top = 5 + Width = 60 + Height = 21 + Hint = 'Set port for tcp channel' + ItemHeight = 13 + TabOrder = 1 + Text = '8090' + end + object RbIndyTcp: TRadioButton + Left = 7 + Top = 31 + Width = 88 + Height = 17 + Hint = 'Usage TROIndyTcpChannel' + Caption = 'Indy' + Checked = True + TabOrder = 2 + TabStop = True + end + object cbDisableNagle: TCheckBox + Left = 7 + Top = 80 + Width = 162 + Height = 17 + Hint = 'Disable Nagle' + Caption = 'Disable &Nagle' + TabOrder = 3 + OnClick = cbDisableNagleClick + end + end + object tsSuperHTTP: TTabSheet + Caption = 'SuperHTTP' + ImageIndex = 4 + object Label25: TLabel + Left = 7 + Top = 11 + Width = 23 + Height = 13 + Caption = 'URL:' + end + object cbSuperHTTPURL: TComboBox + Left = 65 + Top = 7 + Width = 250 + Height = 21 + Hint = 'Set url for super http channel' + ItemHeight = 13 + TabOrder = 0 + Text = 'http://127.0.0.1:8099/bin' + OnChange = cbSuperHTTPURLChange + Items.Strings = ( + 'http://localhost:8099/soap' + 'http://localhost:8099/bin' + 'http://localhost/MegaRO/soap' + 'http://localhost/MegaRO/bin') + end + object rbIndySuperHttp: TRadioButton + Left = 7 + Top = 31 + Width = 80 + Height = 17 + Hint = 'Usage TROIndySuperHttpChannel' + Caption = 'Indy' + Checked = True + TabOrder = 1 + TabStop = True + end + object rbSynapseSuperHttp: TRadioButton + Left = 7 + Top = 47 + Width = 80 + Height = 17 + Hint = 'Usage TROSynapseSuperHttpChannel' + Caption = 'Synapse' + TabOrder = 2 + end + end + object tsSuperTCP: TTabSheet + Caption = 'SuperTCP' + ImageIndex = 3 + object Label12: TLabel + Left = 7 + Top = 11 + Width = 43 + Height = 13 + Caption = 'Address:' + end + object Label13: TLabel + Left = 195 + Top = 11 + Width = 24 + Height = 13 + Caption = 'Port:' + end + object cbSuperTCPPort: TComboBox + Left = 245 + Top = 7 + Width = 60 + Height = 21 + Hint = 'Set port for super tcp channel' + ItemHeight = 13 + TabOrder = 0 + Text = '8090' + end + object cbSuperTCPIP: TComboBox + Left = 65 + Top = 7 + Width = 120 + Height = 21 + Hint = 'Set IP for super tcp channel' + ItemHeight = 13 + TabOrder = 1 + Text = '127.0.0.1' + end + object rbIndySuperTCP: TRadioButton + Left = 7 + Top = 31 + Width = 80 + Height = 17 + Hint = 'Usage TROSuperTcpChannel' + Caption = 'Indy' + Checked = True + TabOrder = 2 + TabStop = True + end + object rbSynapseSuperTCP: TRadioButton + Left = 7 + Top = 47 + Width = 80 + Height = 17 + Hint = 'Usage TROSynapseSuperTcpChannel' + Caption = 'Synapse' + TabOrder = 3 + end + end + object tsWindowsMessage: TTabSheet + Caption = 'Windows Message' + ImageIndex = 5 + object Label8: TLabel + Left = 7 + Top = 11 + Width = 50 + Height = 13 + Caption = 'Server ID:' + end + object eServerID: TEdit + Left = 65 + Top = 7 + Width = 240 + Height = 21 + Hint = 'Set Server ID' + TabOrder = 0 + Text = '{E46A5995-2260-44EA-AC60-121ADB4CC2D0}' + end + end + end + object cbUseCompression: TCheckBox + Left = 118 + Top = 60 + Width = 106 + Height = 17 + Hint = 'Allows to use a compression at data transmission' + Caption = 'Use &Compression' + Checked = True + State = cbChecked + TabOrder = 1 + end + object cbEncrypt: TCheckBox + Left = 118 + Top = 77 + Width = 137 + Height = 17 + Hint = 'Allows to cipher data by transfer' + Caption = 'Encrypt Communication' + TabOrder = 2 + OnClick = cbEncryptClick + end + object cbAutoDetect: TCheckBox + Left = 118 + Top = 94 + Width = 198 + Height = 17 + Caption = 'Autodetect messagetype (on server)' + TabOrder = 3 + OnClick = cbAutoDetectClick + end + object cb_UseEnvelopes: TCheckBox + Left = 118 + Top = 111 + Width = 149 + Height = 17 + Caption = 'Use message envelopes' + TabOrder = 4 + OnClick = cb_UseEnvelopesClick + end + end + object PageControl1: TPageControl + Left = 5 + Top = 290 + Width = 676 + Height = 139 + ActivePage = tsLog + Align = alClient + TabOrder = 2 + object tsLog: TTabSheet + Caption = 'Log' + ImageIndex = 1 + object Memo: TMemo + Left = 0 + Top = 0 + Width = 668 + Height = 111 + Align = alClient + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Courier New' + Font.Style = [] + ParentFont = False + ScrollBars = ssVertical + TabOrder = 0 + end + end + object tsSoap: TTabSheet + Caption = 'Output' + object Splitter1: TSplitter + Left = 337 + Top = 0 + Height = 111 + end + object Memo1: TMemo + Left = 0 + Top = 0 + Width = 337 + Height = 111 + Align = alLeft + ScrollBars = ssVertical + TabOrder = 0 + end + object Memo2: TMemo + Left = 340 + Top = 0 + Width = 328 + Height = 111 + Align = alClient + ScrollBars = ssVertical + TabOrder = 1 + end + end + end + end + object BINMessage: TROBinMessage + OnInitializeMessage = BINMessageInitializeMessage + OnFinalizeMessage = BINMessageFinalizeMessage + OnWriteMessageParameter = BINMessageWriteMessageParameter + OnReadMessageParameter = BINMessageReadMessageParameter + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + UseCompression = False + Left = 14 + Top = 5 + end + object SOAPMessage: TROSOAPMessage + OnWriteToStream = SOAPMessageWriteToStream + OnReadFromStream = SOAPMessageReadFromStream + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + ServerTargetNamespace = 'http://tempuri.org/' + SerializationOptions = [xsoWriteMultiRefArray, xsoWriteMultiRefObject] + OnEnvelopeComplete = SOAPMessageEnvelopeComplete + Left = 42 + Top = 5 + end + object WinMessageChannel: TROWinMessageChannel + Encryption.EncryptionSendKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + Encryption.EncryptionRecvKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + Delay = 150 + ServerLocators = <> + DispatchOptions = [] + Left = 449 + Top = 344 + end + object WininetHttpChannel: TROWinInetHTTPChannel + Encryption.EncryptionSendKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + Encryption.EncryptionRecvKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + UserAgent = 'RemObjects SDK' + KeepConnection = True + ServerLocators = <> + DispatchOptions = [] + Left = 380 + Top = 344 + end + object RemoteService: TRORemoteService + ServiceName = 'NewService' + Left = 609 + Top = 339 + end + object PostMessage: TROPostMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + Left = 70 + Top = 6 + end + object XmlRpcMessage: TROXmlRpcMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + Left = 98 + Top = 6 + end + object ROAESEncryptionEnvelope: TROAESEncryptionEnvelope + EnvelopeMarker = 'AES' + BeforeEnvelopeProcessed = ROAESEncryptionEnvelopeBeforeEnvelopeProcessed + Password = 'All work and no play makes Jack a dull boy.' + Left = 128 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClientMain.pas new file mode 100644 index 0000000..f2d592e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoClientMain.pas @@ -0,0 +1,1800 @@ +unit MegaDemoClientMain; + +{ Activate this define if you are using the demo without having Indy installed. + + Simply click "Ignore" when opening the form to have the Indy components + remove, set the define and rebuild the demo. } + +{.$DEFINE NO_INDY} +{.$DEFINE NO_SYNAPSE} +{$I RemObjects.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Spin, ExtCtrls, ComCtrls, SyncObjs, uROClientIntf, TypInfo, + +{$IFNDEF NO_INDY} + uROIndyTCPChannel, uROIndyHTTPChannel, uROSuperTCPChannel,uROIndySuperHttpChannel, +{$ENDIF NO_INDY} +{$IFNDEF NO_SYNAPSE} + uROSynapseHttpChannel,uROSynapseSuperTCPChannel, uROSynapseSuperHttpChannel, +{$ENDIF} + uROClient, uROBINMessage, uROWinMessageChannel, uROSOAPMessage, + uROWinInetHttpChannel, uROXMLIntf, MegaDemoLibrary_Intf, uROTypes, + uRORemoteService, uROPoweredByRemObjectsButton, uROXmlRpcMessage, + ImgList, Buttons, uRODynamicRequest, uROPostMessage, CheckLst, + uROEncryptionEnvelope; + +const + msgWarningPorts = + 'Issuing many requests in a short period of time can cause the client PC to run out of ip-port combinations.' + sLineBreak + + 'Once an ip-port combination has been used, it takes some time (1 to 4 min on Windows) before that combination can be re-used' + sLineBreak + '' + sLineBreak + + 'Run netstat from command prompt to see how many connections are in TIME_WAIT state.' + sLineBreak + '' + sLineBreak + + 'If you have long loops (i.e 50 cycles or 5 threads running 10) allow your PC to restore some ports by not' + sLineBreak + + 'doing anything for a minute or so once the test has completed.' + sLineBreak + '' + sLineBreak + + 'Do you want to continue?'; + +type + TArrayType = (atInteger, atString, atTPerson); + + TStressMethod = function(aService: IMegaDemoService): integer of object; + + TMegaDemoClientMainForm = class(TForm) + BINMessage: TROBINMessage; + SOAPMessage: TROSOAPMessage; + WinMessageChannel: TROWinMessageChannel; + PageControl1: TPageControl; + tsSoap: TTabSheet; + tsLog: TTabSheet; + Memo: TMemo; + Memo1: TMemo; + Memo2: TMemo; + Splitter1: TSplitter; + WininetHttpChannel: TROWinInetHTTPChannel; + RemoteService: TRORemoteService; + Panel3: TPanel; + PostMessage: TROPostMessage; + Panel4: TPanel; + clbTests: TCheckListBox; + pagecontrol2: TPageControl; + tsStress: TTabSheet; + tsSum: TTabSheet; + tsEchoPerson: TTabSheet; + tsRaiseError: TTabSheet; + seA: TSpinEdit; + seB: TSpinEdit; + Label4: TLabel; + seAge: TSpinEdit; + cbSex: TComboBox; + eLastName: TEdit; + eFirstName: TEdit; + Label3: TLabel; + Label2: TLabel; + cbCustomException: TCheckBox; + Label5: TLabel; + tsTestArrays: TTabSheet; + tsEchoBinary: TTabSheet; + tsGetServerTime: TTabSheet; + tsCustomClass: TTabSheet; + Label6: TLabel; + seArrayCount: TSpinEdit; + rbInteger: TRadioButton; + rbString: TRadioButton; + rbTPerson: TRadioButton; + seBinSize: TSpinEdit; + Label7: TLabel; + rbStream: TRadioButton; + rbXML: TRadioButton; + Panel5: TPanel; + Panel1: TPanel; + GroupBox5: TGroupBox; + rbBinary: TRadioButton; + rbSOAP: TRadioButton; + rbPost: TRadioButton; + RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + cbEnableLog: TCheckBox; + cbVerbose: TCheckBox; + cbWriteTestInfo: TCheckBox; + Label11: TLabel; + Label16: TLabel; + Label17: TLabel; + Label18: TLabel; + Label19: TLabel; + Label20: TLabel; + Label21: TLabel; + Label22: TLabel; + Label23: TLabel; + Label24: TLabel; + RunTestOnceButton: TButton; + RunTestButton: TButton; + seRepetitions: TSpinEdit; + Label15: TLabel; + seThreads: TSpinEdit; + Label14: TLabel; + pStress: TPanel; + pSum: TPanel; + pTestArrays: TPanel; + pEchoBinary: TPanel; + pGetServerTime: TPanel; + pCustomClass: TPanel; + pRaiseError: TPanel; + pPage: TPanel; + pEchoPerson: TPanel; + rbXmlRpc: TRadioButton; + XmlRpcMessage: TROXmlRpcMessage; + pgChannels: TPageControl; + tsWindowsMessage: TTabSheet; + tsHttp: TTabSheet; + tsTCP: TTabSheet; + tsSuperTCP: TTabSheet; + tsSuperHTTP: TTabSheet; + Label8: TLabel; + eServerID: TEdit; + Label1: TLabel; + cbHTTPURL: TComboBox; + cbTCPIP: TComboBox; + Label9: TLabel; + Label10: TLabel; + cbTCPPort: TComboBox; + rbIndyHttp: TRadioButton; + rbWinInetHttp: TRadioButton; + rbSynapseHttp: TRadioButton; + cbKeepConnection: TCheckBox; + RbIndyTcp: TRadioButton; + cbDisableNagle: TCheckBox; + Label12: TLabel; + Label13: TLabel; + cbSuperTCPPort: TComboBox; + cbSuperTCPIP: TComboBox; + Label25: TLabel; + cbSuperHTTPURL: TComboBox; + rbIndySuperTCP: TRadioButton; + rbSynapseSuperTCP: TRadioButton; + rbIndySuperHttp: TRadioButton; + rbSynapseSuperHttp: TRadioButton; + cbUseCompression: TCheckBox; + cbEncrypt: TCheckBox; + cbAutoDetect: TCheckBox; + ROAESEncryptionEnvelope: TROAESEncryptionEnvelope; + cb_UseEnvelopes: TCheckBox; + bClearLog: TButton; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure bTestEchoBinaryClick(Sender: TObject); + procedure Image1Click(Sender: TObject); + procedure cbEncryptClick(Sender: TObject); + procedure rbBinaryClick(Sender: TObject); + procedure rbSOAPClick(Sender: TObject); + procedure cbDisableNagleClick(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure bbStressCustomClassClick(Sender: TObject); + procedure rbPostClick(Sender: TObject); + procedure cbHTTPURLChange(Sender: TObject); + procedure SOAPMessageWriteToStream(aStream: TStream); + procedure SOAPMessageEnvelopeComplete(Sender: TROSOAPMessage); + procedure SOAPMessageReadFromStream(aStream: TStream); + procedure BINMessageFinalizeMessage(Sender: TROMessage); + procedure BINMessageReadMessageParameter(Sender: TROMessage; + const aName: string; aTypeInfo: PTypeInfo; const DataRef: Pointer; + Attributes: TParamAttributes); + procedure BINMessageWriteMessageParameter(Sender: TROMessage; + const aName: string; aTypeInfo: PTypeInfo; const DataRef: Pointer; + Attributes: TParamAttributes); + procedure BINMessageInitializeMessage(Sender: TROMessage; + const aTransport: IROTransport; const anInterfaceName, + aMessageName: string); + procedure clbTestsClick(Sender: TObject); + procedure RunTestOnceButtonClick(Sender: TObject); + procedure RunTestButtonClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure clbTestsClickCheck(Sender: TObject); + procedure rbIndyHttpClick(Sender: TObject); + procedure rbXmlRpcClick(Sender: TObject); + procedure cbAutoDetectClick(Sender: TObject); + procedure cbSuperHTTPURLChange(Sender: TObject); + procedure pgChannelsChange(Sender: TObject); + procedure cb_UseEnvelopesClick(Sender: TObject); + procedure ROAESEncryptionEnvelopeBeforeEnvelopeProcessed( + AMessageEnvelope: TROMessageEnvelope; AStream: TStream; + aMode: TROMessageEnvelopeMode; AMessage: IROMessage); + procedure bClearLogClick(Sender: TObject); + private + {$IFNDEF NO_INDY} + ROIndyHTTPChannel : TROIndyHTTPChannel; + ROIndyTCPChannel : TROIndyTCPChannel; + ROIndySuperHttpChannel : TROIndySuperHttpChannel; + ROIndySuperTCPChannel : TROSuperTcpChannel; + {$ENDIF} + {$IFNDEF NO_SYNAPSE} + ROSynapseHttpchannel: TROSynapseHTTPChannel; + ROSynapseSuperHttpChannel : TROSynapseSuperHttpChannel; + ROSynapseSuperTCPChannel : TROSynapseSuperTcpChannel; + {$ENDIF} + fCritical: TCriticalSection; + fThreads: TList; + fTerminateTest: boolean; + fMessage: TROMessage; + fChannel: TROTransportChannel; + fMegaTestStart: cardinal; + fLogEnabledStatus: boolean; + + function CreateService: IMegaDemoService; + procedure ChangeUrl(iTo: string); + procedure Log(const aMessage: string; Force: boolean = FALSE); + + procedure NotifyThreadTermination(aThread: TThread); + function GetMegaTestRunning: boolean; + + // Methods to invoke the remote service. These are also used by the stress threads later. + // They return the time it took to execute + function InvokeCustomClass(const aService: IMegaDemoService; UseBinaryStream: boolean): integer; + {} function InvokeEchoBinary(const aService: IMegaDemoService; aSize: integer): integer; + {} function InvokeEchoPerson(const aService: IMegaDemoService; const aFirstName, aLastName: string; anAge: integer; aSex: TSex): integer; + {} function InvokeRaiseError(const aService: IMegaDemoService): integer; + {} function InvokeSum(const aService: IMegaDemoService; A, B: integer): integer; + {} function InvokeTestArray(const aService: IMegaDemoService; anArrayType: TArrayType; aCount: integer): integer; + {} function InvokeGetServerTime(const aService: IMegaDemoService): integer; + + // Logs + procedure WriteSequentialStressEnd(TotalTime, Errors: integer); + + procedure WriteSequentialStressStart(TestName: string; const ExtraInfo: string = ''); + + procedure WriteTestInfo(ARunOnce: Boolean); + function GetRequestsPerSecond(TotalTimeMS: integer): double; + procedure Check_ListBoxClick(isAllDemo: Boolean); + + procedure Stress(AMethod: TStressMethod); + function RunSum(aService: IMegaDemoService): integer; + function RunEchoPerson(aService: IMegaDemoService): integer; + function RunRaiseError(aService: IMegaDemoService): integer; + function RunTestArrays(aService: IMegaDemoService): integer; + function int_RunTestArrays(aService: IMegaDemoService; anArrayType: TArrayType): integer; + function RunEchoBinary(aService: IMegaDemoService): integer; + function RunServerTime(aService: IMegaDemoService): integer; + function RunCustomClass(aService: IMegaDemoService): integer; + + procedure RunAllDemo; + procedure StopAllDemo; + + procedure LoadFromIni; + procedure SaveToIni; + + public + constructor Create(aOwner: TComponent); override; + destructor Destroy; override; + + property UserChannel: TROTransportChannel read fChannel; + property UserMessage: TROMessage read fMessage; + property MegaTestRunning: boolean read GetMegaTestRunning; + end; + +var + MegaDemoClientMainForm: TMegaDemoClientMainForm; + +implementation + +uses INIFiles, MegaDemoCustomClass, uROXMLSerializer, uROStreamSerializer, + ShellAPI, uROEncryption, ActiveX; + +{$R *.DFM} + +type + { TStressThread } + TStressThread = class(TThread) + private + fMessage: TROMessage; + fChannel: TROTransportChannel; + fErrors, + fSumTime, + fEchoPersonTime, + fRaiseErrorTime, + fArrayTime, + fEchoBinaryTime, + fGetServerTimeTime, + fCustomClassTime, + fTotalTime: integer; + Fidx: integer; + procedure BeforeDestroyThread; + procedure Run; + public + + constructor Create; + destructor Destroy; override; + + procedure Execute; override; + + property Errors: integer read fErrors; + property EchoPersonTime: integer read fEchoPersonTime; + property RaiseErrorTime: integer read fRaiseErrorTime; + property ArrayTime: integer read fArrayTime; + property EchoBinaryTime: integer read fEchoBinaryTime; + property GetServerTimeTime: integer read fGetServerTimeTime; + property CustomClassTime: integer read fCustomClassTime; + property TotalTime: integer read fTotalTime; + property idx: integer read Fidx write Fidx; + end; + +procedure TMegaDemoClientMainForm.FormCreate(Sender: TObject); +var + sx: TSex; +begin + Caption := Application.Title; + +{$IFDEF NO_INDY} + rbIndyHttp.Enabled := false; + rbIndyTcp.Enabled := false; + rbIndySuperTCP.Enabled := false; + rbIndySuperHttp.Enabled := false; +{$ELSE} + ROIndyHTTPChannel := TROIndyHTTPChannel.Create(Self); + ROIndyHTTPChannel.Encryption.Assign(WininetHttpChannel.Encryption); + + ROIndyTCPChannel := TROIndyTCPChannel.Create(Self); + ROIndyTCPChannel.Encryption.Assign(WininetHttpChannel.Encryption); + + ROIndySuperHttpChannel:= TROIndySuperHttpChannel.Create(Self); + ROIndySuperHttpChannel.Encryption.Assign(WininetHttpChannel.Encryption); + + ROIndySuperTCPChannel := TROSuperTcpChannel.Create(Self); + ROIndySuperTCPChannel.Encryption.Assign(WininetHttpChannel.Encryption); +{$ENDIF NO_INDY} + +{$IFDEF NO_SYNAPSE} + rbSynapseHttp.Enabled := false; + rbSynapseSuperTCP.Enabled := false; + rbSynapseSuperHttp.Enabled := false; +{$ELSE} + ROSynapseHttpchannel := TROSynapseHTTPChannel.Create(self); + ROSynapseHttpchannel.Encryption.Assign(WininetHttpChannel.Encryption); + + ROSynapseSuperHttpChannel := TROSynapseSuperHttpChannel.Create(self); + ROSynapseSuperHttpChannel.Encryption.Assign(WininetHttpChannel.Encryption); + + ROSynapseSuperTCPChannel := TROSynapseSuperTcpChannel.Create(self); + ROSynapseSuperTCPChannel.Encryption.Assign(WininetHttpChannel.Encryption); +{$ENDIF} + LoadFromIni; + + for sx := Low(TSex) to High(TSex) do + cbSex.Items.Add(GetEnumName(TypeInfo(TSex), Ord(sx))); + cbSex.ItemIndex := 0; +end; + +procedure TMegaDemoClientMainForm.FormDestroy(Sender: TObject); +begin + SaveToIni; +end; + +function TMegaDemoClientMainForm.CreateService: IMegaDemoService; +begin + // Adds the entry if new + with cbTCPIP do + if (Items.IndexOf(Text) < 0) and (Text <> '') then + Items.Add(Text); + + with cbHTTPURL do + if (Items.IndexOf(Text) < 0) and (Text <> '') then + Items.Add(Text); + + with cbTCPPort do + if (Items.IndexOf(Text) < 0) and (Text <> '') then + Items.Add(Text); + + with cbSuperHTTPURL do + if (Items.IndexOf(Text) < 0) and (Text <> '') then + Items.Add(Text); + + with cbSuperTCPIP do + if (Items.IndexOf(Text) < 0) and (Text <> '') then + Items.Add(Text); + + with cbSuperTCPPort do + if (Items.IndexOf(Text) < 0) and (Text <> '') then + Items.Add(Text); + + + { Set up BIN message } + BINMessage.UseCompression := cbUseCompression.Checked; + + { Set up Http Channels } +{$IFNDEF NO_INDY} + ROIndyHTTPChannel.TargetURL := cbHTTPURL.Text; + ROIndyHTTPChannel.KeepAlive := cbKeepConnection.Checked; + ROIndySuperHttpChannel.TargetURL := cbSuperHTTPURL.Text; + + ROIndyTCPChannel.Host := cbTCPIP.Text; + ROIndyTCPChannel.Port := StrToInt(cbTCPPort.Text); + + ROIndySuperTCPChannel.Port:= StrToInt(cbSuperTCPPort.Text); + ROIndySuperTCPChannel.Host:= cbSuperTCPIP.Text; +{$ENDIF NO_INDY} + +{$IFNDEF NO_SYNAPSE} + ROSynapseHttpchannel.TargetURL := cbHTTPURL.Text; + ROSynapseHttpchannel.KeepAlive := cbKeepConnection.Checked; + + ROSynapseSuperHttpChannel.TargetURL := cbSuperHTTPURL.Text; + ROSynapseSuperTCPChannel.Port:= StrToInt(cbSuperTCPPort.Text); + ROSynapseSuperTCPChannel.Host:= cbSuperTCPIP.Text; +{$ENDIF NO_SYNAPSE} + + WininetHttpChannel.TargetURL := cbHTTPURL.Text; + WininetHttpChannel.KeepConnection := cbKeepConnection.Checked; + + { Set up WM Channel } + WinMessageChannel.ServerID := LibraryUID; + + { Select message class based on radio button selection } + if rbBinary.Checked then + fMessage := BINMessage + else if rbPost.Checked then + fMessage := PostMessage + else if rbXMLRpc.Checked then + fMessage := XmlRpcMessage + else + fMessage := SOAPMessage; + fChannel := nil; + if pgChannels.ActivePage = tsHttp then begin + {$IFNDEF NO_INDY} + if rbIndyHttp.Checked then + fChannel := ROIndyHttpChannel + else + {$ENDIF NO_INDY} + {$IFNDEF NO_SYNAPSE} + if rbSynapseHttp.Checked then + fChannel := ROSynapseHttpchannel + else + {$ENDIF NO_INDY} + fChannel := WininetHttpChannel; + end + else if pgChannels.ActivePage = tsTCP then begin + {$IFNDEF NO_INDY} + fChannel := ROIndyTCPChannel; + {$ENDIF NO_INDY} + end + else if pgChannels.ActivePage = tsSuperHTTP then begin + {$IFDEF NO_SYNAPSE} + rbIndySuperHttp.Checked:= True; + {$ENDIF} + {$IFNDEF NO_INDY} + if rbIndySuperHttp.Checked then fChannel := ROIndySuperHttpChannel ; + {$ELSE} + rbSynapseSuperHttp.Checked := True; + {$ENDIF NO_INDY} + {$IFNDEF NO_SYNAPSE} + if rbSynapseSuperHttp.Checked then fChannel := ROSynapseSuperHttpChannel + {$ENDIF NO_INDY} + end + else if pgChannels.ActivePage = tsSuperTCP then begin + {$IFDEF NO_SYNAPSE} + rbIndySuperTcp.Checked:= True; + {$ENDIF} + {$IFNDEF NO_INDY} + if rbIndySuperTCP.Checked then fChannel := ROIndySuperTCPChannel; + {$ELSE} + rbSynapseSuperTCP.Checked := True; + {$ENDIF NO_INDY} + {$IFNDEF NO_SYNAPSE} + if rbSynapseSuperTCP.Checked then fChannel := ROSynapseSuperTCPChannel; + {$ENDIF NO_INDY} + end + else if pgChannels.ActivePage = tsWindowsMessage then begin + fChannel := WinMessageChannel; + end; + + // Sets up the main components + RemoteService.Channel := fChannel; + RemoteService.Message := fMessage; + + result := RemoteService as IMegaDemoService; +end; + +function TMegaDemoClientMainForm.InvokeSum(const aService: IMegaDemoService; A, B: integer): + integer; +var + res: integer; + start: cardinal; +begin + start := GetTickCount; + res := aService.Sum(seA.Value, seB.Value); + result := GetTickCount - start; + Log('Sum'); + Log('---'); + Log(Format('outgoing:'#9'A=%d B=%d', [seA.Value, seB.Value])); + Log(Format('incoming:'#9'Result=%d', [res])); + Log(''); +end; + +function TMegaDemoClientMainForm.InvokeEchoPerson(const aService: IMegaDemoService; + const aFirstName, aLastName: string; anAge: integer; aSex: TSex): integer; +var + outgoing, incoming: TPerson; + start: cardinal; +begin + outgoing := TPerson.Create; + outgoing.FirstName := eFirstName.Text; + outgoing.LastName := eLastName.Text; + outgoing.Age := seAge.Value; + outgoing.Sex := TSex(cbSex.ItemIndex); + + try + start := GetTickCount; + aService.EchoPerson(outgoing, incoming); + result := GetTickCount - start; + + Log('EchoPerson'); + Log('----------'); + with outgoing do + Log(Format('%s:'#9'%s, %s, %s, %s', ['outgoing', FirstName, LastName, IntToStr(Age), GetEnumName(TypeInfo(TSex), Ord(Sex))])); + with incoming do + Log(Format('%s:'#9'%s, %s, %s, %s', ['incoming', FirstName, LastName, IntToStr(Age), GetEnumName(TypeInfo(TSex), Ord(Sex))])); + + Log(''); + + finally + incoming.Free; + outgoing.Free; + end; +end; + +function TMegaDemoClientMainForm.InvokeRaiseError(const aService: IMegaDemoService): integer; +var + start: cardinal; +begin + Result := 0; + start := GetTickCount; + Log('RaiseError'); + Log('----------'); + try + try + if not cbCustomException.Checked then + aService.RaiseError() + else + aService.RaiseTestException; + finally + result := GetTickCount - start; + end; + except + on E: ETestException do + if rbXmlRpc.Checked then + Log(Format( + 'ETestException' + sLineBreak + + 'Message:'#9'%s', + [E.Message]), true) + else + Log(Format( + 'ETestException' + sLineBreak + + 'Message:'#9'%s' + sLineBreak + + 'ErrorCode:'#9'%d' + sLineBreak + + 'AdditionalInfo:'#9'%s', + [E.Message, E.ErrorCode, E.AdditionalInfo]), true); + on E: Exception do + Log( + 'Generic exception:'#9 + E.ClassName + sLineBreak + + 'Message:'#9#9 + E.Message, true); + end; + Log(''); +end; + +function TMegaDemoClientMainForm.InvokeTestArray(const aService: IMegaDemoService; + anArrayType: TArrayType; aCount: integer): integer; +var + i: integer; + iarr, iarr2: TIntegerArray; + sarr, sarr2: TStringArray; + parr, parr2: TPersonArray; + s, s1: string; + err: boolean; + start: cardinal; +begin + Result := 0; + s := ''; + err := FALSE; + + iarr := nil; + iarr2 := nil; + sarr := nil; + sarr2 := nil; + parr := nil; + parr2 := nil; + + try + case anArrayType of + atInteger: try + s1 := rbInteger.Caption; + Randomize; + iarr := TIntegerArray.Create; + iarr.Resize(seArrayCount.Value); + for i := 0 to (seArrayCount.Value - 1) do + iarr[i] := Random(100); + + start := GetTickCount; + iarr2 := aService.TestIntegerArray(iarr); + result := GetTickCount - start; + + for i := 0 to (seArrayCount.Value - 1) do begin + s := s + Format('%d:'#9'%d - %d', [i, iarr[i], iarr2[i]]) + sLineBreak; + if (iarr2[i] <> iarr[i]) then begin + err := TRUE; + Exit; + end; + end; + finally + iarr.Free; + iarr2.Free; + end; + + atString: try + s1 := rbString.Caption; + Randomize; + sarr := TStringArray.Create; + sarr.Resize(seArrayCount.Value); + + for i := 0 to (seArrayCount.Value - 1) do begin + sarr[i] := 'Value is ' + IntToStr(Random(1000) + 1000); + end; + + start := GetTickCount; + sarr2 := aService.TestStringArray(sarr); + result := GetTickCount - start; + + for i := 0 to (seArrayCount.Value - 1) do begin + s := s + Format('%d:'#9'"%s" - "%s"', [i, sarr[i], sarr2[i]]) + sLineBreak; + if (sarr2[i] <> sarr[i]) then begin + err := TRUE; + Exit; + end; + end; + finally + sarr.Free; + sarr2.Free; + end; + + atTPerson: try + s1 := rbTPerson.Caption; + parr := TPersonArray.Create; + parr.Resize(seArrayCount.Value); + + for i := 0 to (seArrayCount.Value - 1) do begin + parr[i] := TPerson.Create; + with parr[i] do begin + FirstName := eFirstName.Text; + LastName := eLastName.Text; + Age := seAge.Value; + Sex := TSex(cbSex.ItemIndex); + end; + end; + + start := GetTickCount; + parr2 := aService.TestPersonArray(parr); + result := GetTickCount - start; + + for i := 0 to (seArrayCount.Value - 1) do begin + s := s + Format('%d:'#9'%s %s %d %d - %s %s %d %d', [ + i, + parr[i].FirstName, parr[i].LastName, parr[i].Age, + Ord(parr[i].Sex), + parr2[i].FirstName, parr2[i].LastName, parr2[i].Age, + Ord(parr2[i].Sex)]) + sLineBreak; + + if (parr2[i].FirstName <> parr[i].FirstName) or + (parr2[i].LastName <> parr[i].LastName) or + (parr2[i].Age <> parr[i].Age) or + (parr2[i].Sex <> parr[i].Sex) then begin + err := TRUE; + Exit; + end; + end; + finally + parr.Free; + parr2.Free; + end; + end; + finally + if err then + s := 'Arrays are DIFFERENT!' + sLineBreak + s + else + s := sLineBreak + 'Arrays equal!' + sLineBreak + s; + Log('TestArray'); + Log('---------'); + Log('Mode:'#9 + s1); + Log(s); + end; +end; + +function TMegaDemoClientMainForm.InvokeEchoBinary(const aService: IMegaDemoService; aSize: + integer): integer; +var + binin, binout: Binary; + i: integer; + b: byte; + start: cardinal; +begin + Randomize; + binin := Binary.Create; + binout := nil; + + try + binin.SetSize(seBinSize.Value); + binin.Position := 0; + for i := 1 to seBinSize.Value do begin + b := Random($FF); + binin.Write(b, SizeOf(b)); + end; + + binin.Position := 0; + + start := GetTickCount; + aService.EchoBinary(binin, binout); + result := GetTickCount - start; + + Log('EchoBinary'); + Log('-------------'); + + Log('outgoing:'#9 + IntToStr(binin.Size) + ' bytes'); + Log('incoming:'#9 + IntToStr(binout.Size) + ' bytes'); + + if (binin.Size = binout.Size) then begin + if CompareMem(binin.Memory, binout.Memory, binout.Size) then + Log('Data is equivalent!') + else + Log('Data is different!'); + end + else begin + Log('Different size!'); + end; + Log(''); + finally + binin.Free; + binout.Free; + end; +end; + +function TMegaDemoClientMainForm.InvokeCustomClass(const aService: IMegaDemoService; + UseBinaryStream: boolean): integer; +var + cls: TCustomClass; + stream: Binary; + xml: string; + start: cardinal; +begin + stream := nil; + cls := nil; + try + if not UseBinaryStream then begin + start := GetTickCount; + xml := aService.CustomObjectAsString; + result := GetTickCount - start; + cls := XMLToObject(xml) as TCustomClass; + end + else begin + start := GetTickCount; + stream := aService.CustomObjectAsStream; + result := GetTickCount - start; + cls := StreamToObject(stream) as TCustomClass; + end; + Log('CustomClass'); + Log('-----------'); + Log('incoming:'); + // incoming data + with cls do begin + Log('Random integer:'#9#9 + intToStr(RandomInt)); + Log('Random double:'#9#9 + FloatToStr(RandomDouble)); + Log('Random string:'#9#9 + RandomStr); + Log('Random widestring:'#9 + RandomWideStr); + end; + finally + stream.Free; + cls.Free; + end; +end; + +function TMegaDemoClientMainForm.InvokeGetServerTime(const aService: IMegaDemoService): integer; +var + start: cardinal; + restime: TDateTime; +begin + start := GetTickCount; + restime := aService.GetServerTime; + result := GetTickCount - start; + Log('GetServerTime'); + Log('------------------'); + Log('incoming:'#9 + DateTimeToStr(restime)); + Log(''); +end; + +procedure TMegaDemoClientMainForm.bTestEchoBinaryClick(Sender: TObject); +begin + InvokeEchoBinary(CreateService, seBinSize.Value); +end; + +procedure TMegaDemoClientMainForm.Image1Click(Sender: TObject); +begin + ShellExecute(Handle, 'open', 'http://www.remobjects.com', nil, nil, SW_SHOWNORMAL); +end; + +procedure TMegaDemoClientMainForm.cbEncryptClick(Sender: TObject); +var + lEncryption: TROEncryptionMethod; +begin + if cbEncrypt.Checked then + lEncryption := tetDES + else + lEncryption := tetNone; + + WininetHttpChannel.Encryption.EncryptionMethod := lEncryption; + +{$IFNDEF NO_INDY} + ROIndyHttpChannel.Encryption.Assign(WininetHttpChannel.Encryption); + ROIndyTcpChannel.Encryption.Assign(WininetHttpChannel.Encryption); + ROIndySuperHttpChannel.Encryption.Assign(WininetHttpChannel.Encryption); + ROIndySuperTCPChannel.Encryption.Assign(WininetHttpChannel.Encryption); + +{$ENDIF NO_INDY} +{$IFNDEF NO_SYNAPSE} + ROSynapseHttpchannel.Encryption.Assign(WininetHttpChannel.Encryption); + ROSynapseSuperHttpChannel.Encryption.Assign(WininetHttpChannel.Encryption); + ROSynapseSuperTCPChannel.Encryption.Assign(WininetHttpChannel.Encryption); + +{$ENDIF} + + WinMessageChannel.Encryption.EncryptionMethod := lEncryption; +end; + +procedure TMegaDemoClientMainForm.ChangeUrl(iTo: string); +begin + { lame, but works } + if cbAutoDetect.Checked then iTo:=''; + cbHTTPURL.Text := StringReplace(cbHTTPURL.Text, '/bin', '/' + iTo, [rfReplaceAll, rfIgnoreCase]); + cbHTTPURL.Text := StringReplace(cbHTTPURL.Text, '/soap', '/' + iTo, [rfReplaceAll, rfIgnoreCase]); + cbHTTPURL.Text := StringReplace(cbHTTPURL.Text, '/post', '/' + iTo, [rfReplaceAll, rfIgnoreCase]); + cbHTTPURL.Text := StringReplace(cbHTTPURL.Text, '/xmlrpc', '/' + iTo, [rfReplaceAll, rfIgnoreCase]); + + if not cbAutoDetect.Checked and (Pos(iTo, cbHTTPURL.Text) = 0) then + cbHTTPURL.Text:=cbHTTPURL.Text+iTo; + + cbSuperHTTPUrl.Text := StringReplace(cbSuperHTTPUrl.Text, '/bin', '/' + iTo, [rfReplaceAll, rfIgnoreCase]); + cbSuperHTTPUrl.Text := StringReplace(cbSuperHTTPUrl.Text, '/soap', '/' + iTo, [rfReplaceAll, rfIgnoreCase]); + cbSuperHTTPUrl.Text := StringReplace(cbSuperHTTPUrl.Text, '/post', '/' + iTo, [rfReplaceAll, rfIgnoreCase]); + cbSuperHTTPUrl.Text := StringReplace(cbSuperHTTPUrl.Text, '/xmlrpc', '/' + iTo, [rfReplaceAll, rfIgnoreCase]); + + if not cbAutoDetect.Checked and (Pos(iTo, cbSuperHTTPUrl.Text) = 0) then + cbSuperHTTPUrl.Text:=cbSuperHTTPUrl.Text+iTo; + + + cbUseCompression.Enabled := rbBinary.Checked; + cbVerbose.Enabled := rbBinary.Checked; + + tsSoap.TabVisible := rbSOAP.Checked; + if not tsSoap.TabVisible then tsLog.PageControl.ActivePage := tsLog; +end; + +procedure TMegaDemoClientMainForm.rbBinaryClick(Sender: TObject); +begin + ChangeUrl('bin'); +end; + +procedure TMegaDemoClientMainForm.rbSOAPClick(Sender: TObject); +begin + ChangeUrl('soap'); +end; + +procedure TMegaDemoClientMainForm.rbPostClick(Sender: TObject); +begin + ChangeUrl('post'); +end; + +procedure TMegaDemoClientMainForm.cbDisableNagleClick(Sender: TObject); +begin +{$IFNDEF NO_INDY} + ROIndyTCPChannel.DisableNagle := cbDisableNagle.Checked; +{$ENDIF} +end; + +function TMegaDemoClientMainForm.GetRequestsPerSecond(TotalTimeMS: integer): double; +begin + if TotalTimeMS > 0 then + result := (seRepetitions.Value) / (TotalTimeMS / 1000) + else + result := seRepetitions.Value; +end; + +procedure TMegaDemoClientMainForm.NotifyThreadTermination(aThread: TThread); +var + totaltimemega, idx: integer; + overallrsec: double; +begin + fCritical.Enter; + try + idx := TStressThread(aThread).idx; + + Log(Format('Thread %d has terminated. %dms. %f Req/Sec. %d Errors', [idx, TStressThread(aThread).TotalTime, GetRequestsPerSecond(TStressThread(aThread).TotalTime), TStressThread(aThread).Errors]), TRUE); + + fThreads.Remove(aThread); + + if fThreads.Count = 0 then begin + Screen.Cursor := crDefault; + + totaltimemega := GetTickCount - fMegaTestStart; + overallrsec := (seThreads.Value * seRepetitions.Value) / (totaltimemega / 1000); + + Log(Format('The test was completed in %dms. %f Total req/second', [totaltimemega, overallrsec]), TRUE); + Caption := Application.Title; + end + else begin + Caption := Application.Title + Format(' (%d threads running)', [fThreads.Count]); + end; + + Application.ProcessMessages; + finally + fCritical.Leave; + end; +end; + +constructor TMegaDemoClientMainForm.Create(aOwner: TComponent); +begin + inherited; + fCritical := TCriticalSection.Create; + fThreads := TList.Create; +end; + +destructor TMegaDemoClientMainForm.Destroy; +begin + fCritical.Free; + fThreads.Free; + inherited; +end; + +procedure TMegaDemoClientMainForm.FormCloseQuery(Sender: TObject; + var CanClose: Boolean); +begin + CanClose := not MegaTestRunning; + + if not CanClose then begin + if (MessageDlg('Do you want to stop the mega test?', mtWarning, [mbYes, mbNo], 0) = mrYes) then + StopAllDemo + else + Exit; + + while MegaTestRunning do + Application.ProcessMessages; + + CanClose := TRUE; + end; +end; + +function TMegaDemoClientMainForm.GetMegaTestRunning: boolean; +begin + result := fThreads.Count > 0 +end; + +procedure TMegaDemoClientMainForm.WriteTestInfo(ARunOnce: Boolean); +begin + if not cbWriteTestInfo.Checked then Exit; + + Log('', TRUE); + Log('------------------ Test Parameters ------------------', TRUE); + Log('Channel:'#9 + UserChannel.ClassName, True); + if pgChannels.ActivePage = tsHttp then begin + Log('URL:'#9#9 + cbHTTPURL.Text, True); + Log('KeepConnection:'#9 + BoolToStr(cbKeepConnection.Checked, TRUE), True); + end + else if pgChannels.ActivePage = tsSuperHTTP then begin + Log('URL:'#9#9 + cbSuperHTTPURL.Text, True); + end + else if pgChannels.ActivePage = tsTCP then begin + Log('IP, port:'#9 + cbTCPIP.Text + ':' + cbTCPPort.Text, True); + LOG('DisableNagle:'#9 + BoolToStr(cbDisableNagle.Checked, TRUE), True); + end + else if pgChannels.ActivePage = tsSuperTCP then begin + Log('IP, port:'#9 + cbSuperTCPIP.Text + ':' + cbSuperTCPPort.Text, True); + end + else if pgChannels.ActivePage = tsWindowsMessage then begin + Log('Server ID:'#9 + eServerID.Text, True); + end; + + Log('Message:'#9 + UserMessage.ClassName, True); + Log('Encrypt:'#9 + BoolToStr(cbEncrypt.Checked, TRUE), True); + if rbBinary.Checked then begin + Log('Compression:'#9 + BoolToStr(cbUseCompression.Checked, TRUE), True); + end; + if not ARunOnce then begin + Log(Format('Threads:'#9'%d', [seThreads.Value]), TRUE); + Log(Format('Repetitions:'#9'%d', [seRepetitions.Value]), TRUE); + Log(format('Total Requests:'#9'%d', [seThreads.Value * seRepetitions.Value]), TRUE); + end; + Log('-----------------------------------------------------', TRUE); + Log('', TRUE); +end; + +procedure TMegaDemoClientMainForm.WriteSequentialStressStart(TestName: string; const ExtraInfo: string); +begin + WriteTestInfo(False); + Log(Format('Starting %s test. %d repetitions %s', [testname, seRepetitions.Value, ExtraInfo]), TRUE); + fLogEnabledStatus := cbEnableLog.Checked; + cbEnableLog.Checked := FALSE; +end; + +procedure TMegaDemoClientMainForm.WriteSequentialStressEnd(TotalTime, Errors: integer); +var + reqsecond: double; +begin + reqsecond := GetRequestsPerSecond(TotalTime); + Log(Format('Test complete. %dms. %f Req/Second. %d Errors', [TotalTime, reqsecond, Errors]), TRUE); + cbEnableLog.Checked := fLogEnabledStatus; +end; + +procedure TMegaDemoClientMainForm.bbStressCustomClassClick(Sender: TObject); +begin + +end; + +{ TStressThread } + +procedure TStressThread.BeforeDestroyThread; +begin + MegaDemoClientMainForm.NotifyThreadTermination(Self); +end; + +constructor TStressThread.Create; +begin + inherited Create(TRUE); + FreeOnTerminate := TRUE; +end; + +destructor TStressThread.Destroy; +begin +// Synchronize(BeforeDestroyThread); + inherited; +end; + +procedure TStressThread.Execute; +begin + Synchronize(Run); +end; + +procedure TStressThread.Run; +var + svc: IMegaDemoService; + maxcount: integer; + i: integer; +begin + + // Makes internal copies of the channel and the message + fMessage := CloneObject(MegaDemoClientMainForm.UserMessage) as TROMessage; + fChannel := CloneObject(MegaDemoClientMainForm.UserChannel) as TROTransportChannel; + try + svc := CoMegaDemoService.Create(fMessage, fChannel); + maxcount := MegaDemoClientMainForm.seRepetitions.Value - 1; + fTotalTime := 0; + + with MegaDemoClientMainForm do try + if clbTests.Checked[1] then begin + for i := 0 to (maxcount - 1) do try + Inc(fSumTime, RunSum(svc)); + except + Inc(fErrors); + end; + if Terminated then Exit; + end; + + if clbTests.Checked[2] then begin + for i := 0 to (maxcount - 1) do try + Inc(fEchoPersonTime, RunEchoPerson(svc)); + except + Inc(fErrors); + end; + + if Terminated then Exit; + end; + + if clbTests.Checked[3] then begin + for i := 0 to (maxcount - 1) do try + Inc(fArrayTime, int_RunTestArrays(svc, atInteger)) + except + Inc(fErrors); + end; + if Terminated then Exit; + + for i := 0 to (maxcount - 1) do try + Inc(fArrayTime, int_RunTestArrays(svc, atString)) + except + Inc(fErrors); + end; + if Terminated then + Exit; + + for i := 0 to (maxcount - 1) do try + Inc(fArrayTime, int_RunTestArrays(svc, atTPerson)) + except + Inc(fErrors); + end; + if Terminated then Exit; + end; + + if clbTests.Checked[4] then begin + for i := 0 to (maxcount - 1) do try + Inc(fEchoBinaryTime, RunEchoBinary(svc)); + except + Inc(fErrors); + end; + if Terminated then Exit; + end; + + if clbTests.Checked[5] then begin + for i := 0 to (maxcount - 1) do try + Inc(fGetServerTimeTime, RunServerTime(svc)); + except + Inc(fErrors); + end; + if Terminated then Exit; + end; + + if clbTests.Checked[6] then begin + for i := 0 to (maxcount - 1) do try + Inc(fCustomClassTime, RunCustomClass(svc)); + except + Inc(fErrors); + end; + + if Terminated then Exit; + end; + { + if clbTests.Checked[7] then begin + for i := 0 to (maxcount - 1) do try + Inc(fRaiseErrorTime, RunRaiseError(svc)); + except + //Inc(fErrors); + end; + if Terminated then Exit; + end; + } + + finally + fTotalTime := fSumTime + + fEchoPersonTime + + fArrayTime + + fEchoBinaryTime + + fGetServerTimeTime + + fCustomClassTime + // + fRaiseErrorTime + + ; + Terminate; + end; + finally + fChannel.Free; + fMessage.Free; + BeforeDestroyThread; + + end; +end; + +procedure TMegaDemoClientMainForm.cbHTTPURLChange(Sender: TObject); +var + s: string; +begin + s:= cbHTTPURL.Text; + if Pos('/bin', s) > 0 then + rbBinary.Checked := true + else if Pos('/soap', s) > 0 then + rbSoap.Checked := true + else if Pos('/post', s) > 0 then + rbPost.Checked := true + else if Pos('/xmlrpc', s) > 0 then + rbXmlRpc.Checked := true; + cbUseCompression.Enabled := rbBinary.Checked; +end; + +procedure TMegaDemoClientMainForm.SOAPMessageWriteToStream(aStream: TStream); +begin + // memo1.Lines.LoadFromStream(aStream); +end; + +procedure TMegaDemoClientMainForm.SOAPMessageEnvelopeComplete(Sender: TROSOAPMessage); +begin + sender.HeaderNode.Add('Test').Value := '1234'; + if cbEnableLog.Checked then + memo1.Lines.Text := Sender.EnvelopeNode.XML; +end; + +procedure TMegaDemoClientMainForm.SOAPMessageReadFromStream(aStream: TStream); +begin + if cbEnableLog.Checked then Memo2.Lines.LoadFromStream(aStream); +end; + +procedure TMegaDemoClientMainForm.BINMessageFinalizeMessage(Sender: TROMessage); +begin + if cbVerbose.Checked then Log(Sender.Name + ' is finalized'); +end; + +procedure TMegaDemoClientMainForm.BINMessageReadMessageParameter(Sender: TROMessage; + const aName: string; aTypeInfo: PTypeInfo; const DataRef: Pointer; + Attributes: TParamAttributes); +begin + if cbVerbose.Checked then begin + Log(Sender.Name + ' is reading ' + aName); + Log(''); + end; +end; + +procedure TMegaDemoClientMainForm.BINMessageWriteMessageParameter(Sender: TROMessage; + const aName: string; aTypeInfo: PTypeInfo; const DataRef: Pointer; + Attributes: TParamAttributes); +begin + if cbVerbose.Checked then Log(Sender.Name + ' is writing ' + aName); +end; + +procedure TMegaDemoClientMainForm.BINMessageInitializeMessage(Sender: TROMessage; + const aTransport: IROTransport; const anInterfaceName, + aMessageName: string); +begin + if cbVerbose.Checked then Log(Sender.Name + ' is initialized'); +end; + +function TMegaDemoClientMainForm.RunSum(aService: IMegaDemoService): integer; +begin + Result := InvokeSum(aService, seA.Value, seB.Value); +end; + +function TMegaDemoClientMainForm.RunEchoPerson(aService: IMegaDemoService): integer; +begin + Result := InvokeEchoPerson( + aService, + eFirstName.Text, + eLastName.Text, + seAge.Value, + TSex(cbSex.ItemIndex)); +end; + +function TMegaDemoClientMainForm.RunRaiseError(aService: IMegaDemoService): integer; +begin + Result := InvokeRaiseError(aService); +end; + +procedure TMegaDemoClientMainForm.Stress(AMethod: TStressMethod); +var + tot, errors, i: integer; + svc: IMegaDemoService; +begin + tot := 0; + errors := 0; + svc := CreateService; + WriteSequentialStressStart(clbTests.Items[clbTests.ItemIndex]); + for i := 1 to (seRepetitions.Value) do try + Inc(tot, AMethod(svc)); + if (i mod 10 = 0) then Application.ProcessMessages; + if fTerminateTest then Break; + except + Inc(errors); + end; + WriteSequentialStressEnd(tot, errors); +end; + +function TMegaDemoClientMainForm.RunTestArrays(aService: IMegaDemoService): integer; +begin + Result := 0; + if rbInteger.Checked then + Result := int_RunTestArrays(aService, atInteger) + else if rbString.Checked then + Result := int_RunTestArrays(aService, atString) + else if rbTPerson.Checked then + Result := int_RunTestArrays(aService, atTPerson); +end; + +function TMegaDemoClientMainForm.RunEchoBinary(aService: IMegaDemoService): integer; +begin + Result := InvokeEchoBinary(aService, seBinSize.Value); +end; + +function TMegaDemoClientMainForm.RunServerTime(aService: IMegaDemoService): integer; +begin + Result := InvokeGetServerTime(aService); +end; + +function TMegaDemoClientMainForm.RunCustomClass(aService: IMegaDemoService): integer; +begin + Result := InvokeCustomClass(aService, rbStream.Checked); +end; + +procedure TMegaDemoClientMainForm.clbTestsClick(Sender: TObject); + + procedure HidePanels; + begin + pStress.Visible := False; + pSum.Visible := False; + pEchoPerson.Visible := False; + pTestArrays.Visible := False; + pEchoBinary.Visible := False; + pGetServerTime.Visible := False; + pCustomClass.Visible := False; + pRaiseError.Visible := False; + end; + +var + t_panel: TPanel; +begin + HidePanels; + case clbTests.ItemIndex of + 1: t_panel := pSum; + 2: t_panel := pEchoPerson; + 3: t_panel := pTestArrays; + 4: t_panel := pEchoBinary; + 5: t_panel := pGetServerTime; + 6: t_panel := pCustomClass; + 7: t_panel := pRaiseError; + else + t_panel := pStress; + end; + t_panel.Parent := pPage; + t_panel.Visible := True; + + if clbTests.ItemIndex = 0 then begin + RunTestOnceButton.Caption := 'Run Stress Test'; + RunTestButton.Caption := 'Stop Stress Test'; + RunTestOnceButton.Hint := 'Run Stress Test'; + RunTestButton.Hint := 'Stop Stress Test'; + end + else begin + RunTestOnceButton.Caption := 'Run Test once'; + RunTestButton.Caption := 'Run Test'; + RunTestOnceButton.Hint := 'Starts the chosen test once'; + RunTestButton.Hint := 'Starts the chosen test some times'; + end; +end; + +procedure TMegaDemoClientMainForm.RunTestOnceButtonClick(Sender: TObject); +var + serv: IMegaDemoService; + s: string; +begin + s := ''; + if clbTests.ItemIndex > 0 then begin + clbTests.Checked[clbTests.ItemIndex] := True; + serv := CreateService; + WriteTestInfo(True); + Screen.Cursor := crHourGlass; + end; + try + try + case clbTests.ItemIndex of + 0: RunAllDemo; + 1: begin + RunSum(serv); + s := 'Sum'; + end; + 2: begin + RunEchoPerson(serv); + s := 'EchoPerson'; + end; + 3: begin + RunTestArrays(serv); + s := 'TestArrays'; + end; + 4: begin + RunEchoBinary(serv); + s := 'EchoBinary'; + end; + 5: begin + RunServerTime(serv); + s := 'ServerTime'; + end; + 6: begin + RunCustomClass(serv); + s := 'CustomClass'; + end; + 7: begin + RunRaiseError(serv); + S := 'RaiseError'; + end; + end; + finally + {$IFNDEF NO_INDY} + if fChannel = ROIndySuperHttpChannel then ROIndySuperHttpChannel.Active:=False; + if fChannel = ROIndySuperTCPChannel then ROIndySuperTCPChannel.Active:=False; + {$ENDIF} + {$IFNDEF NO_SYNAPSE} + if fChannel = ROSynapseSuperHttpChannel then ROSynapseSuperHttpChannel.Active:=False; + if fChannel = ROSynapseSuperTCPChannel then ROSynapseSuperTCPChannel.Active:=False; + {$ENDIF} + end; + finally + if clbTests.ItemIndex > 0 then Screen.Cursor := crDefault; + end; + if (s <> '') and not cbEnableLog.Checked then Log(s + ':'#9'Done', True); +end; + +procedure TMegaDemoClientMainForm.RunAllDemo; +var + i: integer; + trd: TStressThread; +begin + Beep; + if ( + (seRepetitions.Value > 10) and + (MessageDlg(msgWarningPorts, mtWarning, [mbOK, mbCancel], 0) <> mrOK) + ) then + Exit; + + Screen.Cursor := crHourGlass; + cbEnableLog.Checked := FALSE; + fTerminateTest := FALSE; + MegaDemoClientMainForm.CreateService; + // Makes sure UserChannel and UserMessage are set. The threads will reference them in their constructor + WriteTestInfo(False); + try + Log(Format('Sum test:'#9#9 + '%s', [BoolToStr(clbTests.Checked[1], TRUE)]), TRUE); + Log(Format('EchoPerson test:'#9 + '%s', [BoolToStr(clbTests.Checked[2], TRUE)]), TRUE); + // Log('RaiseError test:'#9+'%s', [BoolToStr(clbTests.Checked[3], TRUE)], -1, TRUE); + Log(Format('Array test:'#9#9 + '%s (%d items)', [BoolToStr(clbTests.Checked[4], TRUE), seArrayCount.Value]), TRUE); + Log(Format('EchoBinary test:'#9 + '%s (%d bytes)', [BoolToStr(clbTests.Checked[5], TRUE), seBinSize.Value]), TRUE); + Log(Format('GetServerTime test:'#9 + '%s', [BoolToStr(clbTests.Checked[6], TRUE)]), TRUE); + Log(Format('CustomClass test:'#9 + '%s (Use XML=%s)', [BoolToStr(clbTests.Checked[7], TRUE), BoolToStr(rbXML.Checked, TRUE)]), TRUE); + + Log('', TRUE); + Log('Starting mega test'); + Log('', TRUE); + + for i := 1 to seThreads.Value do begin + trd := TStressThread.Create; + trd.idx := fThreads.Add(trd); + end; + + Caption := Application.Title + Format(' (%d threads running)', [fThreads.Count]); + + fMegaTestStart := GetTickCount; + for i := 0 to seThreads.Value - 1 do + TStressThread(fThreads[i]).Resume; + + finally + // Screen.Cursor := crDefault; + end; +end; + +procedure TMegaDemoClientMainForm.StopAllDemo; +var + i: integer; +begin + fCritical.Enter; + try + for i := 0 to (fThreads.Count - 1) do + TThread(fThreads[i]).Terminate; + finally + fCritical.Leave; + end; +end; + +procedure TMegaDemoClientMainForm.RunTestButtonClick(Sender: TObject); +begin + Screen.Cursor := crHourGlass; + try + if clbTests.ItemIndex > 0 then + clbTests.Checked[clbTests.ItemIndex] := True; + case clbTests.ItemIndex of + 0: StopAllDemo; + 1: Stress(RunSum); + 2: Stress(RunEchoPerson); + 3: Stress(RunTestArrays); + 4: Stress(RunEchoBinary); + 5: Stress(RunServerTime); + 6: Stress(RunCustomClass); + 7: Stress(RunRaiseError); + end; + finally + Screen.Cursor := crDefault; + end; +end; + +procedure TMegaDemoClientMainForm.FormShow(Sender: TObject); +begin + pagecontrol2.Visible := False; + clbTests.ItemIndex := 1; + clbTests.OnClick(clbTests); + cbHTTPURLChange(cbHTTPURL); +end; + +procedure TMegaDemoClientMainForm.clbTestsClickCheck(Sender: TObject); +begin + Check_ListBoxClick(clbTests.ItemIndex = 0); +end; + +procedure TMegaDemoClientMainForm.Check_ListBoxClick(isAllDemo: Boolean); + + procedure SetMode(AMode: Boolean); + var + i: integer; + begin + for i := 1 to clbTests.Items.Count - 2 do + clbTests.Checked[i] := AMode; + end; + +var + i: integer; + iChecked, iUnChecked: byte; +begin + if not isAllDemo then begin + iChecked := 0; + iUnChecked := 0; + for i := 1 to clbTests.Items.Count - 2 do begin + if clbTests.Checked[i] then + inc(iChecked) + else + inc(iUnChecked); + end; + if iChecked = 0 then + clbTests.State[0] := cbUnchecked + else if iUnChecked = 0 then + clbTests.State[0] := cbChecked + else + clbTests.State[0] := cbGrayed; + end + else begin + case clbTests.State[0] of + cbUnchecked: SetMode(False); + cbChecked: SetMode(True); + end; + end; +end; + +function TMegaDemoClientMainForm.int_RunTestArrays(aService: IMegaDemoService; + anArrayType: TArrayType): integer; +begin + Result := InvokeTestArray(aService, anArrayType, seArrayCount.Value); +end; + +procedure TMegaDemoClientMainForm.Log(const aMessage: string; + Force: boolean); +begin + if cbEnableLog.Checked or Force then Memo.Lines.Add(AMessage); +end; + +procedure TMegaDemoClientMainForm.LoadFromIni; +var + i: integer; +begin + with TINIFile.Create(ChangeFileExt(Application.EXEName, '.ini')) do try + + with cbTCPIP do begin + ReadSectionValues('IPs', Items); + for i := 0 to (Items.Count - 1) do + Items[i] := Items.Values[Items.Names[i]]; + end; + + with cbHTTPURL do begin + ReadSectionValues('HTTP Urls', Items); + for i := 0 to (Items.Count - 1) do + Items[i] := Items.Values[Items.Names[i]]; + end; + + with cbTCPPort do begin + ReadSectionValues('Ports', Items); + for i := 0 to (Items.Count - 1) do + Items[i] := Items.Values[Items.Names[i]]; + end; + + with cbSuperTCPIP do begin + ReadSectionValues('Super IPs', Items); + for i := 0 to (Items.Count - 1) do + Items[i] := Items.Values[Items.Names[i]]; + end; + + with cbSuperHTTPURL do begin + ReadSectionValues('Super HTTP Urls', Items); + for i := 0 to (Items.Count - 1) do + Items[i] := Items.Values[Items.Names[i]]; + end; + + with cbSuperTCPPort do begin + ReadSectionValues('Super Ports', Items); + for i := 0 to (Items.Count - 1) do + Items[i] := Items.Values[Items.Names[i]]; + end; + + + cbHTTPURL.Text := ReadString('Misc', 'HTTP URL', 'http://localhost:8099/bin'); + cbHTTPURLChange(nil); + + cbSuperHTTPURL.Text := ReadString('Misc', 'Super HTTP URL', 'http://localhost:8098/bin'); + cbSuperHTTPURLChange(nil); + + eServerID.Text := ReadString('Misc', 'Server ID', '{E46A5995-2260-44EA-AC60-121ADB4CC2D0}'); + + cbTCPIP.Text := ReadString('Misc', 'TCP Address', '127.0.0.1'); + cbTCPPort.Text := ReadString('Misc', 'TCP Port', '8090'); + + cbSuperTCPIP.Text := ReadString('Misc', 'Super TCP Address', '127.0.0.1'); + cbSuperTCPPort.Text := ReadString('Misc', 'Super TCP Port', '8095'); + + rbWinInetHttp.Checked := ReadBool('Misc', 'WinINet HTTP', TRUE); + rbIndyHttp.Checked := ReadBool('Misc', 'Indy HTTP', FALSE); + rbSynapseHttp.Checked := ReadBool('Misc', 'Synapse HTTP', False); + + rbIndySuperTCP.Checked := ReadBool('Misc', 'IndySuperTCP', TRUE); + rbSynapseSuperTCP.Checked := ReadBool('Misc', 'SynapseSuperTCP', TRUE); + + rbIndySuperHTTP.Checked := ReadBool('Misc', 'IndySuperHTTP', TRUE); + rbSynapseSuperHTTP.Checked := ReadBool('Misc', 'SynapseSuperHTTP', TRUE); + + cbKeepConnection.Checked := ReadBool('Misc', 'Keep Connection', FALSE); + cbDisableNagle.Checked := ReadBool('Misc', 'Disable Nagle', FALSE); + cbEncrypt.Checked := ReadBool('Misc', 'Encryption Communication', FALSE); + cbEncryptClick(cbEncrypt); + cb_UseEnvelopes.Checked := ReadBool('Misc', 'Use Message Envelopes', FALSE); + cb_UseEnvelopesClick(cb_UseEnvelopes); + seThreads.Value := ReadInteger('Misc', 'Threads', 5); + seRepetitions.Value := ReadInteger('Misc', 'Repetitions', 10); + + cbWriteTestInfo.Checked := ReadBool('Misc', 'Write Test Info', True); + rbXML.Checked := ReadBool('Misc', 'CustomClass as XML', FALSE); + rbStream.Checked := not rbXML.Checked; + cbEnableLog.Checked := ReadBool('Misc', 'Enable Log', TRUE); + cbVerbose.Checked := ReadBool('Misc', 'Verbose', True); + clbTests.Checked[1] := ReadBool('Misc', 'Test Sum', TRUE); + clbTests.Checked[2] := ReadBool('Misc', 'Test EchoPerson', TRUE); + clbTests.Checked[3] := ReadBool('Misc', 'Test TestArrays', TRUE); + clbTests.Checked[4] := ReadBool('Misc', 'Test EchoBinary', TRUE); + clbTests.Checked[5] := ReadBool('Misc', 'Test GetServerTime', TRUE); + clbTests.Checked[6] := ReadBool('Misc', 'Test CustomClass', TRUE); + clbTests.Checked[7] := ReadBool('Misc', 'Test RaiseError', TRUE); + Check_ListBoxClick(False); + finally + Free; + end; +end; + +procedure TMegaDemoClientMainForm.SaveToIni; +var + i: integer; +begin + with TINIFile.Create(ChangeFileExt(Application.EXEName, '.ini')) do try + + with cbTCPIP do begin + for i := 0 to (Items.Count - 1) do + WriteString('IPs', IntToStr(i), Items[i]); + end; + + with cbHTTPURL do + for i := 0 to (Items.Count - 1) do + WriteString('HTTP Urls', IntToStr(i), Items[i]); + + with cbTCPPort do + for i := 0 to (Items.Count - 1) do + WriteString('Ports', IntToStr(i), Items[i]); + + with cbSuperTCPIP do begin + for i := 0 to (Items.Count - 1) do + WriteString('Super IPs', IntToStr(i), Items[i]); + end; + + with cbSuperHTTPURL do + for i := 0 to (Items.Count - 1) do + WriteString('Super HTTP Urls', IntToStr(i), Items[i]); + + with cbSuperTCPPort do + for i := 0 to (Items.Count - 1) do + WriteString('Super Ports', IntToStr(i), Items[i]); + + WriteString('Misc', 'HTTP URL', cbHTTPURL.Text); + WriteString('Misc', 'Super HTTP URL', cbSuperHTTPURL.Text); + WriteString('Misc', 'Server ID', eServerID.Text); + WriteString('Misc', 'TCP Address', cbTCPIP.Text); + WriteString('Misc', 'TCP Port', cbTCPPort.Text); + WriteString('Misc', 'Super TCP Address', cbSuperTCPIP.Text); + WriteString('Misc', 'Super TCP Port', cbSuperTCPPort.Text); + + WriteBool('Misc', 'Indy HTTP', rbIndyHttp.Checked); + WriteBool('Misc', 'WinINet HTTP', rbWinInetHttp.Checked); + WriteBool('Misc', 'Synapse HTTP', rbSynapseHttp.Checked); + + WriteBool('Misc', 'IndySuperTCP', rbIndySuperTCP.Checked); + WriteBool('Misc', 'SynapseSuperTCP', rbSynapseSuperTCP.Checked); + + WriteBool('Misc', 'IndySuperHTTP', rbIndySuperHttp.Checked); + WriteBool('Misc', 'SynapseSuperHTTP', rbSynapseSuperHttp.Checked); + + + WriteBool('Misc', 'Keep Connection', cbKeepConnection.Checked); + WriteBool('Misc', 'Disable Nagle', cbDisableNagle.Checked); + WriteBool('Misc', 'Encryption Communication', cbEncrypt.Checked); + WriteBool('Misc', 'Use Message Envelopes', cb_UseEnvelopes.Checked); + + WriteInteger('Misc', 'Threads', seThreads.Value); + WriteInteger('Misc', 'Repetitions', seRepetitions.Value); + + WriteBool('Misc', 'Write Test Info', cbWriteTestInfo.Checked); + WriteBool('Misc', 'CustomClass as XML', rbXML.Checked); + WriteBool('Misc', 'Enable Log', cbEnableLog.Checked); + WriteBool('Misc', 'Verbose', cbVerbose.Checked); + WriteBool('Misc', 'Test Sum', clbTests.Checked[1]); + WriteBool('Misc', 'Test EchoPerson', clbTests.Checked[2]); + WriteBool('Misc', 'Test TestArrays', clbTests.Checked[3]); + WriteBool('Misc', 'Test EchoBinary', clbTests.Checked[4]); + WriteBool('Misc', 'Test GetServerTime', clbTests.Checked[5]); + WriteBool('Misc', 'Test CustomClass', clbTests.Checked[6]); + WriteBool('Misc', 'Test RaiseError', clbTests.Checked[7]); + finally + Free; + end; +end; + +procedure TMegaDemoClientMainForm.rbIndyHttpClick(Sender: TObject); +begin + cbKeepConnection.Enabled := rbWinInetHttp.Checked; + cbKeepConnection.Checked := rbWinInetHttp.Checked; +end; + +procedure TMegaDemoClientMainForm.rbXmlRpcClick(Sender: TObject); +begin + ChangeUrl('xmlrpc'); +end; + +procedure TMegaDemoClientMainForm.cbAutoDetectClick(Sender: TObject); +begin + if rbBinary.Checked then rbBinaryClick(rbBinary) + else if rbPost.Checked then rbPostClick(rbPost) + else if rbXMLRpc.Checked then rbXmlRpcClick(rbXMLRpc) + else rbSOAPClick(rbSOAP); +end; + +procedure TMegaDemoClientMainForm.cbSuperHTTPURLChange(Sender: TObject); +var + s: string; +begin + s:= cbSuperHTTPURL.Text; + if Pos('/bin', s) > 0 then + rbBinary.Checked := true + else if Pos('/soap', s) > 0 then + rbSoap.Checked := true + else if Pos('/post', s) > 0 then + rbPost.Checked := true + else if Pos('/xmlrpc', s) > 0 then + rbXmlRpc.Checked := true; + cbUseCompression.Enabled := rbBinary.Checked; +end; + +procedure TMegaDemoClientMainForm.pgChannelsChange(Sender: TObject); +begin + cbAutoDetect.Enabled := (pgChannels.ActivePage = tsHttp) or (pgChannels.ActivePage = tsSuperHTTP); +end; + +procedure TMegaDemoClientMainForm.cb_UseEnvelopesClick(Sender: TObject); + + procedure SetupMessage(AMessage: TROMessage); + var + i: integer; + begin + with AMessage.Envelopes do + for i:=0 to Count -1 do + Items[i].Enabled := cb_UseEnvelopes.Checked; + end; + +begin + SetupMessage(BINMessage); + SetupMessage(SOAPMessage); + SetupMessage(PostMessage); + SetupMessage(XmlRpcMessage); +end; + +procedure TMegaDemoClientMainForm.ROAESEncryptionEnvelopeBeforeEnvelopeProcessed( + AMessageEnvelope: TROMessageEnvelope; AStream: TStream; + aMode: TROMessageEnvelopeMode; AMessage: IROMessage); +begin + case aMode of + memIncoming: Log(AMessageEnvelope.Name+' : processing incoming message'); + memOutgoing: Log(AMessageEnvelope.Name+' : processing outgoing message'); + end; +end; + +procedure TMegaDemoClientMainForm.bClearLogClick(Sender: TObject); +begin + Memo.Clear; +end; + +initialization + CoInitializeEx(nil, COINIT_MULTITHREADED); +finalization + CoUninitialize; +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoCustomClass.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoCustomClass.pas new file mode 100644 index 0000000..b39b87c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoCustomClass.pas @@ -0,0 +1,60 @@ +unit MegaDemoCustomClass; + +interface + +uses uROTypes; + +type + TCustomClass = class(TROComplexType) + private + FRandomInt: integer; + fRandomDouble: double; + FRandomStr: Ansistring; + FRandomWideStr: widestring; + public + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + published + property RandomInt: integer read FRandomInt write FRandomInt; + property RandomDouble: double read FRandomDouble write FRandomDouble; + property RandomStr: Ansistring read FRandomStr write FRandomStr; + property RandomWideStr: Widestring read FRandomWideStr write FRandomWideStr; + end; + +function NewCustomClass: TCustomClass; + +implementation +uses SysUtils, uROSerializer, typInfo; + +function NewCustomClass: TCustomClass; +begin + result := TCustomClass.Create; + Result.RandomInt := Random(1000); + Result.RandomDouble := Random * 1000; + Result.RandomStr := IntToStr(Random(1000)) + '(ansistring)'; + Result.RandomWideStr := IntToStr(Random(1000)) + '(widestring)'; +end; + +{ TCustomClass } + +procedure TCustomClass.ReadComplex(ASerializer: TObject); +begin + TROSerializer(ASerializer).ReadInteger('RandomInt',otULong,FRandomInt); + TROSerializer(ASerializer).ReadDouble('RandomDouble',ftDouble,FRandomDouble); + TROSerializer(ASerializer).ReadUTF8String('RandomStr',FRandomStr); + TROSerializer(ASerializer).ReadWideString('RandomWideStr',FRandomWideStr); +end; + +procedure TCustomClass.WriteComplex(ASerializer: TObject); +begin + TROSerializer(ASerializer).WriteInteger('RandomInt',otULong,FRandomInt); + TROSerializer(ASerializer).WriteDouble('RandomDouble',ftDouble,FRandomDouble); + TROSerializer(ASerializer).WriteUTF8String('RandomStr',FRandomStr); + TROSerializer(ASerializer).WriteWideString('RandomWideStr',FRandomWideStr); +end; + +initialization + RegisterROClass(TCustomClass); + Randomize; +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.bdsproj new file mode 100644 index 0000000..2b99f74 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MegaDemoISAPI.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.dpr new file mode 100644 index 0000000..9bad5d7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.dpr @@ -0,0 +1,32 @@ +library MegaDemoISAPI; + +{#ROGEN:MegaDemoLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + ActiveX, + ComObj, + WebBroker, + ISAPIApp, + MegaDemoISAPIMain in 'MegaDemoISAPIMain.pas' {MegaDemoISAPIMainForm: TROWebModule}, + MegaDemoLibrary_Intf in 'MegaDemoLibrary_Intf.pas', + MegaDemoLibrary_Invk in 'MegaDemoLibrary_Invk.pas', + MegaDemoService_Impl in 'MegaDemoService_Impl.pas' {MegaService: TDARemoteService}; + +{$R *.RES} +{$R RODLFile.RES} // RemObjects: Careful, do not remove! + +{ + Important note: if you have Delphi 6 you should add the unit ISAPIThreadPool to the above list +} + +exports + GetExtensionVersion, + HttpExtensionProc, + TerminateExtension; + +begin + CoInitFlags := COINIT_MULTITHREADED; + Application.Initialize; + Application.CreateForm(TMegaDemoISAPIMainForm, MegaDemoISAPIMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.dproj new file mode 100644 index 0000000..b9ac7aa --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.dproj @@ -0,0 +1,77 @@ + + + {b81cfbe2-60d0-4759-8f98-a2be7944b6f0} + MegaDemoISAPI.dpr + Debug + AnyCPU + DCC32 + MegaDemoISAPI.dll + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MegaDemoISAPI.dpr + + + + + + + MainSource + + +
    MegaDemoISAPIMainForm
    +
    + + + +
    MegaService
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.res new file mode 100644 index 0000000..55f8742 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPI.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPIMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPIMain.dfm new file mode 100644 index 0000000..6c42bf7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPIMain.dfm @@ -0,0 +1,104 @@ +object MegaDemoISAPIMainForm: TMegaDemoISAPIMainForm + OldCreateOrder = False + Actions = <> + Left = 38 + Top = 65533 + Height = 305 + Width = 271 + object WebBrokerServer: TROWebBrokerServer + Active = True + Dispatchers = < + item + Name = 'ROSOAPMessage' + Message = ROSOAPMessage + Enabled = True + PathInfo = '/SOAP' + end + item + Name = 'ROBINMessage' + Message = ROBINMessage + Enabled = True + PathInfo = '/BIN' + end + item + Name = 'ROPostMessage' + Message = ROPostMessage + Enabled = True + PathInfo = '/POST' + end + item + Name = 'ROXmlRpcMessage' + Message = ROXmlRpcMessage + Enabled = True + PathInfo = '/XMLRPC' + end + item + Name = 'ROServerMultiMessage' + Message = ROServerMultiMessage + Enabled = True + PathInfo = '/' + end> + Left = 48 + Top = 8 + end + object ROAESEncryptionEnvelope: TROAESEncryptionEnvelope + EnvelopeMarker = 'AES' + Password = 'All work and no play makes Jack a dull boy.' + Left = 40 + Top = 120 + end + object ROServerMultiMessage: TROServerMultiMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + SupportedMessages = < + item + Message = ROBINMessage + end + item + Message = ROSOAPMessage + end + item + Message = ROPostMessage + end + item + Message = ROXmlRpcMessage + end> + Left = 43 + Top = 73 + end + object ROPostMessage: TROPostMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + Left = 71 + Top = 73 + end + object ROBINMessage: TROBinMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + Left = 99 + Top = 73 + end + object ROSOAPMessage: TROSOAPMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + SerializationOptions = [xsoWriteMultiRefArray, xsoWriteMultiRefObject] + Left = 128 + Top = 73 + end + object ROXmlRpcMessage: TROXmlRpcMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + Left = 157 + Top = 73 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPIMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPIMain.pas new file mode 100644 index 0000000..f448a7a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoISAPIMain.pas @@ -0,0 +1,32 @@ +unit MegaDemoISAPIMain; + +interface + +uses + SysUtils, Classes, HTTPApp, uROClient, uROClientIntf, uROBINMessage, + uROSOAPMessage, uROServer, uROWebBrokerServer, uROPostMessage, + uROXmlRpcMessage, uROEncryptionEnvelope, uROServerMultiMessage; + +type + TMegaDemoISAPIMainForm = class(TWebModule) + WebBrokerServer: TROWebBrokerServer; + ROAESEncryptionEnvelope: TROAESEncryptionEnvelope; + ROServerMultiMessage: TROServerMultiMessage; + ROPostMessage: TROPostMessage; + ROBINMessage: TROBinMessage; + ROSOAPMessage: TROSOAPMessage; + ROXmlRpcMessage: TROXmlRpcMessage; + private + + public + + end; + +var + MegaDemoISAPIMainForm: TMegaDemoISAPIMainForm; + +implementation + +{$R *.DFM} + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoLibrary.rodl new file mode 100644 index 0000000..a4ef8cb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoLibrary.rodl @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoLibrary_Intf.pas new file mode 100644 index 0000000..7822d7a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoLibrary_Intf.pas @@ -0,0 +1,1096 @@ +unit MegaDemoLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{D9821C1A-A084-4120-93F3-BCE6CF2AE0F4}'; + TargetNamespace = ''; + + { Service Interface ID's } + IMegaDemoService_IID : TGUID = '{D9821C1A-A084-4120-93F3-BCE6CF2AE0F4}'; + + { Event ID's } + +type + { Forward declarations } + IMegaDemoService = interface; + + TPersonArray = class; + TIntegerArray = class; + TStringArray = class; + + TPerson = class; + + ETestException = class; + + + { Enumerateds } + TSex = (TSex_sxMale,TSex_sxFemale); + + { TPerson } + TPerson = class(TROComplexType) + private + fFirstName: AnsiString; + fLastName: AnsiString; + fAge: Integer; + fSex: TSex; + public + procedure Assign(iSource: TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + published + property FirstName:AnsiString read fFirstName write fFirstName; + property LastName:AnsiString read fLastName write fLastName; + property Age:Integer read fAge write fAge; + property Sex:TSex read fSex write fSex; + end; + + { TPersonCollection } + TPersonCollection = class(TROCollection) + protected + constructor Create(aItemClass: TCollectionItemClass); overload; + function GetItems(aIndex: integer): TPerson; + procedure SetItems(aIndex: integer; const Value: TPerson); + public + constructor Create; overload; + function Add: TPerson; reintroduce; + procedure SaveToArray(anArray: TPersonArray); + procedure LoadFromArray(anArray: TPersonArray); + property Items[Index: integer]:TPerson read GetItems write SetItems; default; + end; + + { TPersonArray } + TPersonArray_TPerson = array of TPerson; + TPersonArray = class(TROArray) + private + fCount: Integer; + fItems : TPersonArray_TPerson; + protected + procedure Grow; virtual; + function GetItems(aIndex: integer): TPerson; + procedure SetItems(aIndex: integer; const Value: TPerson); + function GetCount: integer; override; + public + class function GetItemType: PTypeInfo; override; + class function GetItemClass: TClass; override; + class function GetItemSize: integer; override; + + function GetItemRef(aIndex: integer): pointer; override; + procedure SetItemRef(aIndex: integer; Ref: pointer); override; + procedure Clear; override; + procedure Delete(aIndex: integer); override; + procedure Resize(ElementCount: integer); override; + + procedure Assign(iSource:TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + function Add: TPerson; overload; + function Add(const Value: TPerson):integer; overload; + + property Count : integer read GetCount; + property Items[Index: integer]:TPerson read GetItems write SetItems; default; + property InnerArray: TPersonArray_TPerson read fItems; + end; + + { TIntegerArray } + TIntegerArray_Integer = array of Integer; + TIntegerArray = class(TROArray) + private + fCount: Integer; + fItems : TIntegerArray_Integer; + protected + procedure Grow; virtual; + function GetItems(aIndex: integer): Integer; + procedure SetItems(aIndex: integer; const Value: Integer); + function GetCount: integer; override; + public + class function GetItemType: PTypeInfo; override; + class function GetItemSize: integer; override; + + function GetItemRef(aIndex: integer): pointer; override; + procedure Clear; override; + procedure Delete(aIndex: integer); override; + procedure Resize(ElementCount: integer); override; + + procedure Assign(iSource:TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + function Add(const Value:Integer): integer; + function GetIndex(const aPropertyName : string; + const aPropertyValue : Variant; + StartFrom : integer = 0; + Options : TROSearchOptions = [soIgnoreCase]) : integer; override; + + property Count : integer read GetCount; + property Items[Index: integer]:Integer read GetItems write SetItems; default; + property InnerArray: TIntegerArray_Integer read fItems; + end; + + { TStringArray } + TStringArray_AnsiString = array of AnsiString; + TStringArray = class(TROArray) + private + fCount: Integer; + fItems : TStringArray_AnsiString; + protected + procedure Grow; virtual; + function GetItems(aIndex: integer): AnsiString; + procedure SetItems(aIndex: integer; const Value: AnsiString); + function GetCount: integer; override; + public + class function GetItemType: PTypeInfo; override; + class function GetItemSize: integer; override; + + function GetItemRef(aIndex: integer): pointer; override; + procedure Clear; override; + procedure Delete(aIndex: integer); override; + procedure Resize(ElementCount: integer); override; + + procedure Assign(iSource:TPersistent); override; + procedure ReadComplex(ASerializer: TObject); override; + procedure WriteComplex(ASerializer: TObject); override; + function Add(const Value:AnsiString): integer; + function GetIndex(const aPropertyName : string; + const aPropertyValue : Variant; + StartFrom : integer = 0; + Options : TROSearchOptions = [soIgnoreCase]) : integer; override; + + property Count : integer read GetCount; + property Items[Index: integer]:AnsiString read GetItems write SetItems; default; + property InnerArray: TStringArray_AnsiString read fItems; + end; + + { Exceptions } + ETestException = class(EROException) + private + fErrorCode: Integer; + fAdditionalInfo: AnsiString; + public + constructor Create(anExceptionMessage : string; aErrorCode: Integer; aAdditionalInfo: AnsiString); + procedure ReadException(ASerializer: TObject); override; + procedure WriteException(ASerializer: TObject); override; + published + property ErrorCode: Integer read fErrorCode write fErrorCode; + property AdditionalInfo: AnsiString read fAdditionalInfo write fAdditionalInfo; + end; + + + { IMegaDemoService } + IMegaDemoService = interface + ['{D9821C1A-A084-4120-93F3-BCE6CF2AE0F4}'] + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + procedure EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); + function TestIntegerArray(const anArray: TIntegerArray): TIntegerArray; + function TestStringArray(const anArray: TStringArray): TStringArray; + function TestPersonArray(const anArray: TPersonArray): TPersonArray; + procedure EchoBinary(const BinIN: binary; out BinOUT: Binary); + procedure SomeTypes(var aString: AnsiString; var aWidestring: Widestring; var anInteger: Integer; var aCurrency: Currency; + var aDatetime: DateTime); + function CustomObjectAsString: AnsiString; + function CustomObjectAsStream: Binary; + procedure RaiseError; + procedure RaiseTestException; + end; + + { CoMegaDemoService } + CoMegaDemoService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IMegaDemoService; + end; + + { TMegaDemoService_Proxy } + TMegaDemoService_Proxy = class(TROProxy, IMegaDemoService) + protected + function __GetInterfaceName:string; override; + + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + procedure EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); + function TestIntegerArray(const anArray: TIntegerArray): TIntegerArray; + function TestStringArray(const anArray: TStringArray): TStringArray; + function TestPersonArray(const anArray: TPersonArray): TPersonArray; + procedure EchoBinary(const BinIN: binary; out BinOUT: Binary); + procedure SomeTypes(var aString: AnsiString; var aWidestring: Widestring; var anInteger: Integer; var aCurrency: Currency; + var aDatetime: DateTime); + function CustomObjectAsString: AnsiString; + function CustomObjectAsStream: Binary; + procedure RaiseError; + procedure RaiseTestException; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ ETestException } + +constructor ETestException.Create(anExceptionMessage : string; aErrorCode: Integer; + aAdditionalInfo: AnsiString); +begin + inherited Create(anExceptionMessage); + + fErrorCode := aErrorCode; + fAdditionalInfo := aAdditionalInfo; +end; + +procedure ETestException.ReadException(ASerializer: TObject); +var + l_AdditionalInfo: AnsiString; + l_ErrorCode: Integer; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + l_ErrorCode := ErrorCode; + TROSerializer(ASerializer).ReadInteger('ErrorCode', otSLong, l_ErrorCode); + ErrorCode := l_ErrorCode; + l_AdditionalInfo := AdditionalInfo; + TROSerializer(ASerializer).ReadAnsiString('AdditionalInfo', l_AdditionalInfo); + AdditionalInfo := l_AdditionalInfo; + end + else begin + l_AdditionalInfo := AdditionalInfo; + TROSerializer(ASerializer).ReadAnsiString('AdditionalInfo', l_AdditionalInfo); + AdditionalInfo := l_AdditionalInfo; + l_ErrorCode := ErrorCode; + TROSerializer(ASerializer).ReadInteger('ErrorCode', otSLong, l_ErrorCode); + ErrorCode := l_ErrorCode; + end; +end; + +procedure ETestException.WriteException(ASerializer: TObject); +var + l_AdditionalInfo: AnsiString; + l_ErrorCode: Integer; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + TROSerializer(ASerializer).ChangeClass(ETestException); + l_ErrorCode := ErrorCode; + TROSerializer(ASerializer).WriteInteger('ErrorCode', otSLong, l_ErrorCode); + l_AdditionalInfo := AdditionalInfo; + TROSerializer(ASerializer).WriteAnsiString('AdditionalInfo', l_AdditionalInfo); + end + else begin + l_AdditionalInfo := AdditionalInfo; + TROSerializer(ASerializer).WriteAnsiString('AdditionalInfo', l_AdditionalInfo); + l_ErrorCode := ErrorCode; + TROSerializer(ASerializer).WriteInteger('ErrorCode', otSLong, l_ErrorCode); + end; +end; + +{ TPersonArray } + +procedure TPersonArray.Assign(iSource: TPersistent); +var lSource:TPersonArray; + i:integer; +begin + if (iSource is TPersonArray) then begin + lSource := TPersonArray(iSource); + Clear(); + Resize(lSource.Count); + + for i := 0 to Count-1 do begin + if Assigned(lSource.Items[i]) then begin + Items[i].Assign(lSource.Items[i]); + end; + end; + end + else begin + inherited Assign(iSource); + end; +end; + +class function TPersonArray.GetItemType: PTypeInfo; +begin + result := TypeInfo(TPerson); +end; + +class function TPersonArray.GetItemClass: TClass; +begin + result := TPerson; +end; + +class function TPersonArray.GetItemSize: integer; +begin + result := SizeOf(TPerson); +end; + +function TPersonArray.GetItems(aIndex: integer): TPerson; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +function TPersonArray.GetItemRef(aIndex: integer): pointer; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +procedure TPersonArray.SetItemRef(aIndex: integer; Ref: pointer); +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + if Ref <> fItems[aIndex] then begin + if fItems[aIndex] <> nil then fItems[aIndex].Free; + fItems[aIndex] := Ref; + end; +end; + +procedure TPersonArray.Clear; +var i: integer; +begin + for i := 0 to (Count-1) do fItems[i].Free(); + SetLength(fItems, 0); + FCount := 0; +end; + +procedure TPersonArray.Delete(aIndex: integer); +var i: integer; +begin + if (aIndex>=Count) then RaiseError(err_InvalidIndex, [aIndex]); + + fItems[aIndex].Free(); + + if (aIndex= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + if fItems[aIndex] <> Value then begin + fItems[aIndex].Free; + fItems[aIndex] := Value; + end; +end; + +procedure TPersonArray.Resize(ElementCount: integer); +var i: Integer; +begin + if fCount = ElementCount then Exit; + for i := FCount -1 downto ElementCount do + FItems[i].Free; + SetLength(fItems, ElementCount); + for i := FCount to ElementCount -1 do + FItems[i] := TPerson.Create; + FCount := ElementCount; +end; + +function TPersonArray.GetCount: integer; +begin + result := FCount; +end; + +procedure TPersonArray.Grow; +var + Delta, Capacity: Integer; +begin + Capacity := Length(fItems); + if Capacity > 64 then + Delta := Capacity div 4 + else + if Capacity > 8 then + Delta := 16 + else + Delta := 4; + SetLength(fItems, Capacity + Delta); +end; + +function TPersonArray.Add: TPerson; +begin + result := TPerson.Create; + Add(Result); +end; + +function TPersonArray.Add(const Value:TPerson): integer; +begin + Result := Count; + if Length(fItems) = Result then + Grow; + fItems[result] := Value; + Inc(fCount); +end; + +procedure TPersonArray.ReadComplex(ASerializer: TObject); +var + lval: TPerson; + i: integer; +begin + for i := 0 to Count-1 do begin + with TROSerializer(ASerializer) do + ReadStruct(GetArrayElementName(GetItemType, GetItemRef(i)), TPerson, lval, i); + Items[i] := lval; + end; +end; + +procedure TPersonArray.WriteComplex(ASerializer: TObject); +var + i: integer; +begin + for i := 0 to Count-1 do + with TROSerializer(ASerializer) do + WriteStruct(GetArrayElementName(GetItemType, GetItemRef(i)), fItems[i], TPerson, i); +end; + +{ TIntegerArray } + +procedure TIntegerArray.Assign(iSource: TPersistent); +var lSource:TIntegerArray; + i:integer; +begin + if (iSource is TIntegerArray) then begin + lSource := TIntegerArray(iSource); + Clear(); + Resize(lSource.Count); + + for i := 0 to Count-1 do begin + Items[i] := lSource.Items[i]; + end; + end + else begin + inherited Assign(iSource); + end; +end; + +class function TIntegerArray.GetItemType: PTypeInfo; +begin + result := TypeInfo(Integer); +end; + +class function TIntegerArray.GetItemSize: integer; +begin + result := SizeOf(Integer); +end; + +function TIntegerArray.GetItems(aIndex: integer): Integer; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +function TIntegerArray.GetItemRef(aIndex: integer): pointer; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := @fItems[aIndex]; +end; + +procedure TIntegerArray.Clear; +begin + SetLength(fItems, 0); + FCount := 0; +end; + +procedure TIntegerArray.Delete(aIndex: integer); +var i: integer; +begin + if (aIndex>=Count) then RaiseError(err_InvalidIndex, [aIndex]); + + if (aIndex= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + fItems[aIndex] := Value; +end; + +procedure TIntegerArray.Resize(ElementCount: integer); +begin + if fCount = ElementCount then Exit; + SetLength(fItems, ElementCount); + FCount := ElementCount; +end; + +function TIntegerArray.GetCount: integer; +begin + result := FCount; +end; + +procedure TIntegerArray.Grow; +var + Delta, Capacity: Integer; +begin + Capacity := Length(fItems); + if Capacity > 64 then + Delta := Capacity div 4 + else + if Capacity > 8 then + Delta := 16 + else + Delta := 4; + SetLength(fItems, Capacity + Delta); +end; + +function TIntegerArray.Add(const Value: Integer): integer; +begin + Result := Count; + if Length(fItems) = Result then + Grow; + fItems[result] := Value; + Inc(fCount); +end; + +function TIntegerArray.GetIndex(const aPropertyName: string; + const aPropertyValue: Variant; StartFrom: integer; + Options: TROSearchOptions): integer; +begin + result := -1; +end; + +procedure TIntegerArray.ReadComplex(ASerializer: TObject); +var + lval: Integer; + i: integer; +begin + for i := 0 to Count-1 do begin + with TROSerializer(ASerializer) do + ReadInteger(GetArrayElementName(GetItemType, GetItemRef(i)), otSLong, lval, i); + Items[i] := lval; + end; +end; + +procedure TIntegerArray.WriteComplex(ASerializer: TObject); +var + i: integer; +begin + for i := 0 to Count-1 do + with TROSerializer(ASerializer) do + WriteInteger(GetArrayElementName(GetItemType, GetItemRef(i)), otSLong, fItems[i], i); +end; + +{ TStringArray } + +procedure TStringArray.Assign(iSource: TPersistent); +var lSource:TStringArray; + i:integer; +begin + if (iSource is TStringArray) then begin + lSource := TStringArray(iSource); + Clear(); + Resize(lSource.Count); + + for i := 0 to Count-1 do begin + Items[i] := lSource.Items[i]; + end; + end + else begin + inherited Assign(iSource); + end; +end; + +class function TStringArray.GetItemType: PTypeInfo; +begin + result := TypeInfo(AnsiString); +end; + +class function TStringArray.GetItemSize: integer; +begin + result := SizeOf(AnsiString); +end; + +function TStringArray.GetItems(aIndex: integer): AnsiString; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := fItems[aIndex]; +end; + +function TStringArray.GetItemRef(aIndex: integer): pointer; +begin + if (aIndex < 0) or (aIndex >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + result := @fItems[aIndex]; +end; + +procedure TStringArray.Clear; +begin + SetLength(fItems, 0); + FCount := 0; +end; + +procedure TStringArray.Delete(aIndex: integer); +var i: integer; +begin + if (aIndex>=Count) then RaiseError(err_InvalidIndex, [aIndex]); + + if (aIndex= Count) then RaiseError(err_ArrayIndexOutOfBounds,[aIndex]); + fItems[aIndex] := Value; +end; + +procedure TStringArray.Resize(ElementCount: integer); +begin + if fCount = ElementCount then Exit; + SetLength(fItems, ElementCount); + FCount := ElementCount; +end; + +function TStringArray.GetCount: integer; +begin + result := FCount; +end; + +procedure TStringArray.Grow; +var + Delta, Capacity: Integer; +begin + Capacity := Length(fItems); + if Capacity > 64 then + Delta := Capacity div 4 + else + if Capacity > 8 then + Delta := 16 + else + Delta := 4; + SetLength(fItems, Capacity + Delta); +end; + +function TStringArray.Add(const Value: AnsiString): integer; +begin + Result := Count; + if Length(fItems) = Result then + Grow; + fItems[result] := Value; + Inc(fCount); +end; + +function TStringArray.GetIndex(const aPropertyName: string; + const aPropertyValue: Variant; StartFrom: integer; + Options: TROSearchOptions): integer; +begin + result := -1; +end; + +procedure TStringArray.ReadComplex(ASerializer: TObject); +var + lval: AnsiString; + i: integer; +begin + for i := 0 to Count-1 do begin + with TROSerializer(ASerializer) do + ReadAnsiString(GetArrayElementName(GetItemType, GetItemRef(i)), lval, i); + Items[i] := lval; + end; +end; + +procedure TStringArray.WriteComplex(ASerializer: TObject); +var + i: integer; +begin + for i := 0 to Count-1 do + with TROSerializer(ASerializer) do + WriteAnsiString(GetArrayElementName(GetItemType, GetItemRef(i)), fItems[i], i); +end; + +{ TPerson } + +procedure TPerson.Assign(iSource: TPersistent); +var lSource: MegaDemoLibrary_Intf.TPerson; +begin + inherited Assign(iSource); + if (iSource is MegaDemoLibrary_Intf.TPerson) then begin + lSource := MegaDemoLibrary_Intf.TPerson(iSource); + FirstName := lSource.FirstName; + LastName := lSource.LastName; + Age := lSource.Age; + Sex := lSource.Sex; + end; +end; + +procedure TPerson.ReadComplex(ASerializer: TObject); +var + l_Age: Integer; + l_FirstName: AnsiString; + l_LastName: AnsiString; + l_Sex: TSex; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + l_FirstName := FirstName; + TROSerializer(ASerializer).ReadAnsiString('FirstName', l_FirstName); + FirstName := l_FirstName; + l_LastName := LastName; + TROSerializer(ASerializer).ReadAnsiString('LastName', l_LastName); + LastName := l_LastName; + l_Age := Age; + TROSerializer(ASerializer).ReadInteger('Age', otSLong, l_Age); + Age := l_Age; + l_Sex := Sex; + TROSerializer(ASerializer).ReadEnumerated('Sex',TypeInfo(TSex), l_Sex); + Sex := l_Sex; + end + else begin + l_Age := Age; + TROSerializer(ASerializer).ReadInteger('Age', otSLong, l_Age); + Age := l_Age; + l_FirstName := FirstName; + TROSerializer(ASerializer).ReadAnsiString('FirstName', l_FirstName); + FirstName := l_FirstName; + l_LastName := LastName; + TROSerializer(ASerializer).ReadAnsiString('LastName', l_LastName); + LastName := l_LastName; + l_Sex := Sex; + TROSerializer(ASerializer).ReadEnumerated('Sex',TypeInfo(TSex), l_Sex); + Sex := l_Sex; + end; +end; + +procedure TPerson.WriteComplex(ASerializer: TObject); +var + l_Age: Integer; + l_FirstName: AnsiString; + l_LastName: AnsiString; + l_Sex: TSex; +begin + if TROSerializer(ASerializer).RecordStrictOrder then begin + TROSerializer(ASerializer).ChangeClass(TPerson); + l_FirstName := FirstName; + TROSerializer(ASerializer).WriteAnsiString('FirstName', l_FirstName); + l_LastName := LastName; + TROSerializer(ASerializer).WriteAnsiString('LastName', l_LastName); + l_Age := Age; + TROSerializer(ASerializer).WriteInteger('Age', otSLong, l_Age); + l_Sex := Sex; + TROSerializer(ASerializer).WriteEnumerated('Sex',TypeInfo(TSex), l_Sex); + end + else begin + l_Age := Age; + TROSerializer(ASerializer).WriteInteger('Age', otSLong, l_Age); + l_FirstName := FirstName; + TROSerializer(ASerializer).WriteAnsiString('FirstName', l_FirstName); + l_LastName := LastName; + TROSerializer(ASerializer).WriteAnsiString('LastName', l_LastName); + l_Sex := Sex; + TROSerializer(ASerializer).WriteEnumerated('Sex',TypeInfo(TSex), l_Sex); + end; +end; + +{ TPersonCollection } +constructor TPersonCollection.Create; +begin + inherited Create(TPerson); +end; + +constructor TPersonCollection.Create(aItemClass: TCollectionItemClass); +begin + inherited Create(aItemClass); +end; + +function TPersonCollection.Add: TPerson; +begin + result := TPerson(inherited Add); +end; + +function TPersonCollection.GetItems(aIndex: integer): TPerson; +begin + result := TPerson(inherited Items[aIndex]); +end; + +procedure TPersonCollection.LoadFromArray(anArray: TPersonArray); +var i : integer; +begin + Clear; + for i := 0 to (anArray.Count-1) do + Add.Assign(anArray[i]); +end; + +procedure TPersonCollection.SaveToArray(anArray: TPersonArray); +var i : integer; +begin + anArray.Clear; + anArray.Resize(Count); + for i := 0 to (Count-1) do begin + anArray[i] := TPerson.Create; + anArray[i].Assign(Items[i]); + end; +end; + +procedure TPersonCollection.SetItems(aIndex: integer; const Value: TPerson); +begin + TPerson(inherited Items[aIndex]).Assign(Value); +end; + +{ CoMegaDemoService } + +class function CoMegaDemoService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IMegaDemoService; +begin + result := TMegaDemoService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TMegaDemoService_Proxy } + +function TMegaDemoService_Proxy.__GetInterfaceName:string; +begin + result := 'MegaDemoService'; +end; + +function TMegaDemoService_Proxy.Sum(const A: Integer; const B: Integer): Integer; +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'Sum'); + __Message.Write('A', TypeInfo(Integer), A, []); + __Message.Write('B', TypeInfo(Integer), B, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Integer), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TMegaDemoService_Proxy.GetServerTime: DateTime; +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'GetServerTime'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DateTime), result, [paIsDateTime]); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TMegaDemoService_Proxy.EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + anotherPerson := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'EchoPerson'); + __Message.Write('aPerson', TypeInfo(MegaDemoLibrary_Intf.TPerson), aPerson, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('anotherPerson', TypeInfo(MegaDemoLibrary_Intf.TPerson), anotherPerson, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TMegaDemoService_Proxy.TestIntegerArray(const anArray: TIntegerArray): TIntegerArray; +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'TestIntegerArray'); + __Message.Write('anArray', TypeInfo(MegaDemoLibrary_Intf.TIntegerArray), anArray, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(MegaDemoLibrary_Intf.TIntegerArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TMegaDemoService_Proxy.TestStringArray(const anArray: TStringArray): TStringArray; +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'TestStringArray'); + __Message.Write('anArray', TypeInfo(MegaDemoLibrary_Intf.TStringArray), anArray, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(MegaDemoLibrary_Intf.TStringArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TMegaDemoService_Proxy.TestPersonArray(const anArray: TPersonArray): TPersonArray; +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'TestPersonArray'); + __Message.Write('anArray', TypeInfo(MegaDemoLibrary_Intf.TPersonArray), anArray, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(MegaDemoLibrary_Intf.TPersonArray), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TMegaDemoService_Proxy.EchoBinary(const BinIN: binary; out BinOUT: Binary); +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + BinOUT := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'EchoBinary'); + __Message.Write('BinIN', TypeInfo(binary), BinIN, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('BinOUT', TypeInfo(Binary), BinOUT, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TMegaDemoService_Proxy.SomeTypes(var aString: AnsiString; var aWidestring: Widestring; var anInteger: Integer; var aCurrency: Currency; + var aDatetime: DateTime); +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'SomeTypes'); + __Message.Write('aString', TypeInfo(AnsiString), aString, []); + __Message.Write('aWidestring', TypeInfo(Widestring), aWidestring, []); + __Message.Write('anInteger', TypeInfo(Integer), anInteger, []); + __Message.Write('aCurrency', TypeInfo(Currency), aCurrency, []); + __Message.Write('aDatetime', TypeInfo(DateTime), aDatetime, [paIsDateTime]); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('aString', TypeInfo(AnsiString), aString, []); + __Message.Read('aWidestring', TypeInfo(Widestring), aWidestring, []); + __Message.Read('anInteger', TypeInfo(Integer), anInteger, []); + __Message.Read('aCurrency', TypeInfo(Currency), aCurrency, []); + __Message.Read('aDatetime', TypeInfo(DateTime), aDatetime, [paIsDateTime]); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TMegaDemoService_Proxy.CustomObjectAsString: AnsiString; +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'CustomObjectAsString'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(AnsiString), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +function TMegaDemoService_Proxy.CustomObjectAsStream: Binary; +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'CustomObjectAsStream'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Binary), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TMegaDemoService_Proxy.RaiseError; +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'RaiseError'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TMegaDemoService_Proxy.RaiseTestException; +begin + __Message.SetAttributes(__TransportChannel, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + __Message.InitializeRequestMessage(__TransportChannel, 'MegaDemoLibrary', __InterfaceName, 'RaiseTestException'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterROClass(TPerson); + RegisterROClass(TPersonArray); + RegisterROClass(TIntegerArray); + RegisterROClass(TStringArray); + RegisterExceptionClass(ETestException); + RegisterProxyClass(IMegaDemoService_IID, TMegaDemoService_Proxy); + + +finalization + UnregisterROClass(TPerson); + UnregisterROClass(TPersonArray); + UnregisterROClass(TIntegerArray); + UnregisterROClass(TStringArray); + UnregisterExceptionClass(ETestException); + UnregisterProxyClass(IMegaDemoService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoLibrary_Invk.pas new file mode 100644 index 0000000..d9d70e6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoLibrary_Invk.pas @@ -0,0 +1,373 @@ +unit MegaDemoLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} MegaDemoLibrary_Intf; + +type + TMegaDemoService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_EchoPerson(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_TestIntegerArray(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_TestStringArray(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_TestPersonArray(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_EchoBinary(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_SomeTypes(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_CustomObjectAsString(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_CustomObjectAsStream(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_RaiseError(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_RaiseTestException(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TMegaDemoService_Invoker } + +constructor TMegaDemoService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TMegaDemoService_Invoker.Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Sum(const A: Integer; const B: Integer): Integer; } +var + A: Integer; + B: Integer; + lResult: Integer; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + __Message.Read('A', TypeInfo(Integer), A, []); + __Message.Read('B', TypeInfo(Integer), B, []); + + lResult := (__Instance as IMegaDemoService).Sum(A, B); + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'SumResponse'); + __Message.Write('Result', TypeInfo(Integer), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetServerTime: DateTime; } +var + lResult: DateTime; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + lResult := (__Instance as IMegaDemoService).GetServerTime; + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'GetServerTimeResponse'); + __Message.Write('Result', TypeInfo(DateTime), lResult, [paIsDateTime]); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_EchoPerson(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); } +var + aPerson: MegaDemoLibrary_Intf.TPerson; + anotherPerson: MegaDemoLibrary_Intf.TPerson; + __lObjectDisposer: TROObjectDisposer; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + aPerson := nil; + anotherPerson := nil; + try + __Message.Read('aPerson', TypeInfo(MegaDemoLibrary_Intf.TPerson), aPerson, []); + + (__Instance as IMegaDemoService).EchoPerson(aPerson, anotherPerson); + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'EchoPersonResponse'); + __Message.Write('anotherPerson', TypeInfo(MegaDemoLibrary_Intf.TPerson), anotherPerson, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(aPerson); + __lObjectDisposer.Add(anotherPerson); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_TestIntegerArray(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function TestIntegerArray(const anArray: TIntegerArray): TIntegerArray; } +var + anArray: MegaDemoLibrary_Intf.TIntegerArray; + lResult: MegaDemoLibrary_Intf.TIntegerArray; + __lObjectDisposer: TROObjectDisposer; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + anArray := nil; + lResult := nil; + try + __Message.Read('anArray', TypeInfo(MegaDemoLibrary_Intf.TIntegerArray), anArray, []); + + lResult := (__Instance as IMegaDemoService).TestIntegerArray(anArray); + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'TestIntegerArrayResponse'); + __Message.Write('Result', TypeInfo(MegaDemoLibrary_Intf.TIntegerArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(anArray); + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_TestStringArray(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function TestStringArray(const anArray: TStringArray): TStringArray; } +var + anArray: MegaDemoLibrary_Intf.TStringArray; + lResult: MegaDemoLibrary_Intf.TStringArray; + __lObjectDisposer: TROObjectDisposer; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + anArray := nil; + lResult := nil; + try + __Message.Read('anArray', TypeInfo(MegaDemoLibrary_Intf.TStringArray), anArray, []); + + lResult := (__Instance as IMegaDemoService).TestStringArray(anArray); + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'TestStringArrayResponse'); + __Message.Write('Result', TypeInfo(MegaDemoLibrary_Intf.TStringArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(anArray); + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_TestPersonArray(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function TestPersonArray(const anArray: TPersonArray): TPersonArray; } +var + anArray: MegaDemoLibrary_Intf.TPersonArray; + lResult: MegaDemoLibrary_Intf.TPersonArray; + __lObjectDisposer: TROObjectDisposer; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + anArray := nil; + lResult := nil; + try + __Message.Read('anArray', TypeInfo(MegaDemoLibrary_Intf.TPersonArray), anArray, []); + + lResult := (__Instance as IMegaDemoService).TestPersonArray(anArray); + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'TestPersonArrayResponse'); + __Message.Write('Result', TypeInfo(MegaDemoLibrary_Intf.TPersonArray), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(anArray); + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_EchoBinary(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure EchoBinary(const BinIN: binary; out BinOUT: Binary); } +var + BinIN: binary; + BinOUT: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + BinIN := nil; + BinOUT := nil; + try + __Message.Read('BinIN', TypeInfo(binary), BinIN, []); + + (__Instance as IMegaDemoService).EchoBinary(BinIN, BinOUT); + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'EchoBinaryResponse'); + __Message.Write('BinOUT', TypeInfo(Binary), BinOUT, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(BinIN); + __lObjectDisposer.Add(BinOUT); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_SomeTypes(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure SomeTypes(var aString: AnsiString; var aWidestring: Widestring; var anInteger: Integer; var aCurrency: Currency; + var aDatetime: DateTime); } +var + aString: AnsiString; + aWidestring: Widestring; + anInteger: Integer; + aCurrency: Currency; + aDatetime: DateTime; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + __Message.Read('aString', TypeInfo(AnsiString), aString, []); + __Message.Read('aWidestring', TypeInfo(Widestring), aWidestring, []); + __Message.Read('anInteger', TypeInfo(Integer), anInteger, []); + __Message.Read('aCurrency', TypeInfo(Currency), aCurrency, []); + __Message.Read('aDatetime', TypeInfo(DateTime), aDatetime, [paIsDateTime]); + + (__Instance as IMegaDemoService).SomeTypes(aString, aWidestring, anInteger, aCurrency, aDatetime); + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'SomeTypesResponse'); + __Message.Write('aString', TypeInfo(AnsiString), aString, []); + __Message.Write('aWidestring', TypeInfo(Widestring), aWidestring, []); + __Message.Write('anInteger', TypeInfo(Integer), anInteger, []); + __Message.Write('aCurrency', TypeInfo(Currency), aCurrency, []); + __Message.Write('aDatetime', TypeInfo(DateTime), aDatetime, [paIsDateTime]); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_CustomObjectAsString(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function CustomObjectAsString: AnsiString; } +var + lResult: AnsiString; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + lResult := (__Instance as IMegaDemoService).CustomObjectAsString; + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'CustomObjectAsStringResponse'); + __Message.Write('Result', TypeInfo(AnsiString), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_CustomObjectAsStream(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function CustomObjectAsStream: Binary; } +var + lResult: Binary; + __lObjectDisposer: TROObjectDisposer; +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + lResult := nil; + try + lResult := (__Instance as IMegaDemoService).CustomObjectAsStream; + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'CustomObjectAsStreamResponse'); + __Message.Write('Result', TypeInfo(Binary), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_RaiseError(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure RaiseError; } +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + (__Instance as IMegaDemoService).RaiseError; + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'RaiseErrorResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +procedure TMegaDemoService_Invoker.Invoke_RaiseTestException(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure RaiseTestException; } +begin + __Message.SetAttributes(__Transport, ['EA_Model'], + ['C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap']); + try + (__Instance as IMegaDemoService).RaiseTestException; + + __Message.InitializeResponseMessage(__Transport, 'MegaDemoLibrary', 'MegaDemoService', 'RaiseTestExceptionResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +initialization + RegisterServiceAttribute('','EA_Model','C:\Dev\ROSDK3\Tests\MegaDemo\NewLibrary.eap'); +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.bdsproj new file mode 100644 index 0000000..d1cbdcd --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MegaDemoServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.dpr new file mode 100644 index 0000000..d611779 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.dpr @@ -0,0 +1,22 @@ +program MegaDemoServer; + +{#ROGEN:MegaDemoLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + MegaDemoServerMain in 'MegaDemoServerMain.pas' {MegaDemoServerMainForm}, + MegaDemoCustomClass in 'MegaDemoCustomClass.pas', + MegaDemoLibrary_Intf in 'MegaDemoLibrary_Intf.pas', + MegaDemoLibrary_Invk in 'MegaDemoLibrary_Invk.pas', + MegaDemoService_Impl in 'MegaDemoService_Impl.pas' {MegaService: TDARemoteService}; + +{$R *.RES} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'RemObjects MegaDemo Server'; + Application.CreateForm(TMegaDemoServerMainForm, MegaDemoServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.dproj new file mode 100644 index 0000000..6fd7820 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.dproj @@ -0,0 +1,42 @@ + + + {f8cc3de2-12be-48eb-b46d-815b9569e1af} + MegaDemoServer.dpr + Debug + AnyCPU + DCC32 + MegaDemoServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + +FalseTrueFalseTrueFalse1000FalseFalseFalseFalseFalse105812511.0.0.01.0.0.0MegaDemoServer.dpr + + + + + MainSource + + + + + +
    MegaDemoServerMainForm
    +
    + +
    MegaService
    +
    +
    +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.res new file mode 100644 index 0000000..b0dd731 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServerMain.dfm new file mode 100644 index 0000000..9b4c9c2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServerMain.dfm @@ -0,0 +1,1117 @@ +object MegaDemoServerMainForm: TMegaDemoServerMainForm + Left = 271 + Top = 212 + BorderStyle = bsDialog + Caption = 'RemObjects SDK - Mega Demo Server' + ClientHeight = 450 + ClientWidth = 744 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 496 + Top = 397 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Memo: TMemo + Left = 460 + Top = 12 + Width = 279 + Height = 350 + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssVertical + TabOrder = 8 + end + object cbUseCompression: TCheckBox + Left = 10 + Top = 427 + Width = 155 + Height = 17 + Caption = '&Compress Binary messages' + Checked = True + State = cbChecked + TabOrder = 5 + OnClick = cbUseCompressionClick + end + object gbHTTP: TGroupBox + Left = 7 + Top = 7 + Width = 450 + Height = 90 + Caption = ' HTTP Server ' + TabOrder = 0 + object Label1: TLabel + Left = 8 + Top = 24 + Width = 24 + Height = 13 + Caption = '&Port:' + FocusControl = seHTTPPort + end + object Label5: TLabel + Left = 8 + Top = 68 + Width = 397 + Height = 13 + Caption = + 'Message: The HTTP Server can support multiple message formats at' + + ' the same time' + end + object Label13: TLabel + Left = 99 + Top = 24 + Width = 62 + Height = 13 + Alignment = taRightJustify + AutoSize = False + Caption = 'Component:' + end + object seHTTPPort: TSpinEdit + Left = 36 + Top = 21 + Width = 53 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 8099 + end + object bActivateHTTP: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = '&Activate' + TabOrder = 3 + OnClick = bActivateHTTPClick + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000120B0000120B00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FF811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00 + 811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00811E00811E00FF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF811E0095440F811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00A7632F811E0081 + 1E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF811E00BF8B62CCA17E811E00811E00FF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00D8 + B69CE6D1BFE7D3C4811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FF811E00F0E2D9FCF7F2FAF0E6811E00811E + 00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00D8AF96F4E2CFF0D7BDD8A784811E00811E00FF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FF811E00F3DECAEFD4B8EBC9A7DAA67D811E00FF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00E7BB92E3B081E0A672D5925A811E00FF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00DA995ED78F50D38441CF7B + 35811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FF811E00811E00811E00811E00811E00811E00FF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + end + object bDeactivateHTTP: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = 'Deactivate' + TabOrder = 4 + Visible = False + OnClick = bDeactivateHTTPClick + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 18000000000000060000C40E0000C40E00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A174AFD103BF400009AFF00FFFF00FFFF00FFFF00FF00009A002CF80030 + FC00009AFF00FFFF00FFFF00FFFF00FF6B6B6BA8A8A8A0A0A06B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6B9A9A9A9C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A1A47F81A4CFF123BF100009AFF00FFFF00FF00009A012DF60132FF002A + F300009AFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7AAAAAA9F9F9F6B6B6BFF + 00FFFF00FF6B6B6B9999999E9E9E9797976B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A1C47F61B4DFF143EF400009A00009A002DF80134FF032BF20000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ABABABA2A2A26B + 6B6B6B6B6B9A9A9A9E9E9E9898986B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A1D48F61D50FF103DFB0431FE0132FF002CF600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ACACACA3 + A3A39F9F9F9E9E9E9999996B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A1A48F91342FF0C3CFF0733F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7A7 + A7A7A3A3A39C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A214EFC1D4BFF1847FF1743F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BACACACAC + ACACA9A9A9A4A4A46B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A2E5BF92C5FFF224DF8204BF82355FF1B46F600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB1B1B1B3B3B3AB + ABABAAAAAAAFAFAFA6A6A66B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A3664FA386BFF2D59F400009A00009A224CF42558FF1D49F60000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB6B6B6B9B9B9AEAEAE6B + 6B6B6B6B6BA9A9A9B0B0B0A7A7A76B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A4071FA4274FF325DF100009AFF00FFFF00FF00009A224DF1275AFF204C + F800009AFF00FFFF00FFFF00FFFF00FF6B6B6BBBBBBBBEBEBEAFAFAF6B6B6BFF + 00FFFF00FF6B6B6BA7A7A7B1B1B1AAAAAA6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A497AFC3B66F300009AFF00FFFF00FFFF00FFFF00FF00009A2550F42655 + FA00009AFF00FFFF00FFFF00FFFF00FF6B6B6BC0C0C0B5B5B56B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6BAAAAAAAEAEAE6B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + NumGlyphs = 2 + end + object Panel2: TPanel + Left = 168 + Top = 23 + Width = 177 + Height = 17 + BevelOuter = bvNone + TabOrder = 1 + object rbBpdxHttp: TRadioButton + Left = 0 + Top = 0 + Width = 57 + Height = 17 + Caption = 'DXSock' + TabOrder = 0 + end + object RbIndyHttp: TRadioButton + Left = 60 + Top = 0 + Width = 45 + Height = 17 + Caption = 'Indy' + Checked = True + TabOrder = 1 + TabStop = True + end + object rbSynapseHttp: TRadioButton + Left = 104 + Top = 0 + Width = 65 + Height = 17 + Caption = 'Synapse' + TabOrder = 2 + end + end + object cb_SupportKeepAlive: TCheckBox + Left = 104 + Top = 41 + Width = 169 + Height = 17 + Caption = 'Support HTTP 1.1 KeepAlive' + Checked = True + State = cbChecked + TabOrder = 2 + OnClick = cb_SupportKeepAliveClick + end + end + object gbTCP: TGroupBox + Left = 7 + Top = 175 + Width = 450 + Height = 80 + Caption = ' TCP Server ' + TabOrder = 2 + object Label3: TLabel + Left = 8 + Top = 24 + Width = 24 + Height = 13 + Caption = '&Port:' + FocusControl = seHTTPPort + end + object Label6: TLabel + Left = 8 + Top = 52 + Width = 46 + Height = 13 + Caption = 'Message:' + end + object Label8: TLabel + Left = 99 + Top = 24 + Width = 62 + Height = 13 + Alignment = taRightJustify + AutoSize = False + Caption = 'Component:' + end + object seTCPPort: TSpinEdit + Left = 36 + Top = 22 + Width = 53 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 8090 + end + object bActivateTCP: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = '&Activate' + TabOrder = 4 + OnClick = bActivateTCPClick + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000120B0000120B00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FF811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00 + 811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00811E00811E00FF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF811E0095440F811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00A7632F811E0081 + 1E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF811E00BF8B62CCA17E811E00811E00FF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00D8 + B69CE6D1BFE7D3C4811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FF811E00F0E2D9FCF7F2FAF0E6811E00811E + 00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00D8AF96F4E2CFF0D7BDD8A784811E00811E00FF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FF811E00F3DECAEFD4B8EBC9A7DAA67D811E00FF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00E7BB92E3B081E0A672D5925A811E00FF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00DA995ED78F50D38441CF7B + 35811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FF811E00811E00811E00811E00811E00811E00FF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + end + object cbTCPMsg: TComboBox + Left = 62 + Top = 49 + Width = 145 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 2 + OnChange = cbTCPMsgChange + end + object bDeactivateTCP: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = 'Deactivate' + TabOrder = 5 + Visible = False + OnClick = bDeactivateTCPClick + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 18000000000000060000C40E0000C40E00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A174AFD103BF400009AFF00FFFF00FFFF00FFFF00FF00009A002CF80030 + FC00009AFF00FFFF00FFFF00FFFF00FF6B6B6BA8A8A8A0A0A06B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6B9A9A9A9C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A1A47F81A4CFF123BF100009AFF00FFFF00FF00009A012DF60132FF002A + F300009AFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7AAAAAA9F9F9F6B6B6BFF + 00FFFF00FF6B6B6B9999999E9E9E9797976B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A1C47F61B4DFF143EF400009A00009A002DF80134FF032BF20000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ABABABA2A2A26B + 6B6B6B6B6B9A9A9A9E9E9E9898986B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A1D48F61D50FF103DFB0431FE0132FF002CF600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ACACACA3 + A3A39F9F9F9E9E9E9999996B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A1A48F91342FF0C3CFF0733F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7A7 + A7A7A3A3A39C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A214EFC1D4BFF1847FF1743F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BACACACAC + ACACA9A9A9A4A4A46B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A2E5BF92C5FFF224DF8204BF82355FF1B46F600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB1B1B1B3B3B3AB + ABABAAAAAAAFAFAFA6A6A66B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A3664FA386BFF2D59F400009A00009A224CF42558FF1D49F60000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB6B6B6B9B9B9AEAEAE6B + 6B6B6B6B6BA9A9A9B0B0B0A7A7A76B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A4071FA4274FF325DF100009AFF00FFFF00FF00009A224DF1275AFF204C + F800009AFF00FFFF00FFFF00FFFF00FF6B6B6BBBBBBBBEBEBEAFAFAF6B6B6BFF + 00FFFF00FF6B6B6BA7A7A7B1B1B1AAAAAA6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A497AFC3B66F300009AFF00FFFF00FFFF00FFFF00FF00009A2550F42655 + FA00009AFF00FFFF00FFFF00FFFF00FF6B6B6BC0C0C0B5B5B56B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6BAAAAAAAEAEAE6B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + NumGlyphs = 2 + end + object Panel1: TPanel + Left = 168 + Top = 23 + Width = 182 + Height = 17 + BevelOuter = bvNone + TabOrder = 1 + object rbBpdxTcp: TRadioButton + Left = 0 + Top = 0 + Width = 57 + Height = 17 + Caption = 'DXSock' + TabOrder = 0 + end + object RbIndyTcp: TRadioButton + Left = 60 + Top = 0 + Width = 45 + Height = 17 + Caption = 'Indy' + Checked = True + TabOrder = 1 + TabStop = True + end + object rbSynapseTCP: TRadioButton + Left = 104 + Top = 0 + Width = 65 + Height = 17 + Caption = 'Synapse' + TabOrder = 2 + end + end + object cbDisableNagle: TCheckBox + Left = 240 + Top = 51 + Width = 161 + Height = 17 + Caption = 'Disable &Nagle for Indy Server' + TabOrder = 3 + OnClick = cbDisableNagleClick + end + end + object gbWinMsg: TGroupBox + Left = 7 + Top = 343 + Width = 450 + Height = 81 + Caption = ' WinMessage Server ' + TabOrder = 4 + object Label4: TLabel + Left = 10 + Top = 24 + Width = 50 + Height = 13 + Caption = 'Server ID:' + end + object Label7: TLabel + Left = 10 + Top = 52 + Width = 46 + Height = 13 + Caption = 'Message:' + end + object eServerID: TEdit + Left = 64 + Top = 21 + Width = 281 + Height = 21 + TabOrder = 0 + Text = 'eServerID' + end + object bActivateWinMsg: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = '&Activate' + TabOrder = 2 + OnClick = bActivateWinMsgClick + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000120B0000120B00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FF811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00 + 811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00811E00811E00FF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF811E0095440F811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00A7632F811E0081 + 1E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF811E00BF8B62CCA17E811E00811E00FF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00D8 + B69CE6D1BFE7D3C4811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FF811E00F0E2D9FCF7F2FAF0E6811E00811E + 00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00D8AF96F4E2CFF0D7BDD8A784811E00811E00FF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FF811E00F3DECAEFD4B8EBC9A7DAA67D811E00FF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00E7BB92E3B081E0A672D5925A811E00FF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00DA995ED78F50D38441CF7B + 35811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FF811E00811E00811E00811E00811E00811E00FF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + end + object cbWinMsgMsg: TComboBox + Left = 64 + Top = 49 + Width = 145 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 1 + OnChange = cbWinMsgMsgChange + end + object bDeactivateWinMsg: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = 'Deactivate' + TabOrder = 3 + Visible = False + OnClick = bDeactivateWinMsgClick + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 18000000000000060000C40E0000C40E00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A174AFD103BF400009AFF00FFFF00FFFF00FFFF00FF00009A002CF80030 + FC00009AFF00FFFF00FFFF00FFFF00FF6B6B6BA8A8A8A0A0A06B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6B9A9A9A9C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A1A47F81A4CFF123BF100009AFF00FFFF00FF00009A012DF60132FF002A + F300009AFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7AAAAAA9F9F9F6B6B6BFF + 00FFFF00FF6B6B6B9999999E9E9E9797976B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A1C47F61B4DFF143EF400009A00009A002DF80134FF032BF20000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ABABABA2A2A26B + 6B6B6B6B6B9A9A9A9E9E9E9898986B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A1D48F61D50FF103DFB0431FE0132FF002CF600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ACACACA3 + A3A39F9F9F9E9E9E9999996B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A1A48F91342FF0C3CFF0733F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7A7 + A7A7A3A3A39C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A214EFC1D4BFF1847FF1743F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BACACACAC + ACACA9A9A9A4A4A46B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A2E5BF92C5FFF224DF8204BF82355FF1B46F600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB1B1B1B3B3B3AB + ABABAAAAAAAFAFAFA6A6A66B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A3664FA386BFF2D59F400009A00009A224CF42558FF1D49F60000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB6B6B6B9B9B9AEAEAE6B + 6B6B6B6B6BA9A9A9B0B0B0A7A7A76B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A4071FA4274FF325DF100009AFF00FFFF00FF00009A224DF1275AFF204C + F800009AFF00FFFF00FFFF00FFFF00FF6B6B6BBBBBBBBEBEBEAFAFAF6B6B6BFF + 00FFFF00FF6B6B6BA7A7A7B1B1B1AAAAAA6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A497AFC3B66F300009AFF00FFFF00FFFF00FFFF00FF00009A2550F42655 + FA00009AFF00FFFF00FFFF00FFFF00FF6B6B6BC0C0C0B5B5B56B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6BAAAAAAAEAEAE6B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + NumGlyphs = 2 + end + end + object cb_Encrypt: TCheckBox + Left = 172 + Top = 427 + Width = 129 + Height = 17 + Caption = 'Encrypt communication' + TabOrder = 6 + OnClick = cb_EncryptClick + end + object cbVerbose: TCheckBox + Left = 460 + Top = 371 + Width = 97 + Height = 17 + Caption = 'Verbose' + Checked = True + State = cbChecked + TabOrder = 10 + end + object ErrorMemo: TMemo + Left = 460 + Top = 12 + Width = 279 + Height = 350 + Alignment = taCenter + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -25 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + Lines.Strings = ( + '' + '' + '' + '' + '' + 'Please activate at ' + 'least one server!') + ParentFont = False + TabOrder = 9 + end + object gbSuperHTTP: TGroupBox + Left = 7 + Top = 101 + Width = 450 + Height = 70 + Caption = ' Super HTTP Server ' + TabOrder = 1 + object Label2: TLabel + Left = 8 + Top = 24 + Width = 24 + Height = 13 + Caption = '&Port:' + FocusControl = seSuperHTTPPort + end + object Label9: TLabel + Left = 8 + Top = 47 + Width = 428 + Height = 13 + Caption = + 'Message: The Super HTTP Server can support multiple message form' + + 'ats at the same time' + end + object Label10: TLabel + Left = 99 + Top = 24 + Width = 62 + Height = 13 + Alignment = taRightJustify + AutoSize = False + Caption = 'Component:' + end + object seSuperHTTPPort: TSpinEdit + Left = 36 + Top = 21 + Width = 53 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 8098 + end + object bActivateSuperHTTP: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = '&Activate' + TabOrder = 2 + OnClick = bActivateSuperHTTPClick + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000120B0000120B00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FF811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00 + 811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00811E00811E00FF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF811E0095440F811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00A7632F811E0081 + 1E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF811E00BF8B62CCA17E811E00811E00FF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00D8 + B69CE6D1BFE7D3C4811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FF811E00F0E2D9FCF7F2FAF0E6811E00811E + 00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00D8AF96F4E2CFF0D7BDD8A784811E00811E00FF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FF811E00F3DECAEFD4B8EBC9A7DAA67D811E00FF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00E7BB92E3B081E0A672D5925A811E00FF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00DA995ED78F50D38441CF7B + 35811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FF811E00811E00811E00811E00811E00811E00FF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + end + object bDeactivateSuperHTTP: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = 'Deactivate' + TabOrder = 3 + Visible = False + OnClick = bDeactivateSuperHTTPClick + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 18000000000000060000C40E0000C40E00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A174AFD103BF400009AFF00FFFF00FFFF00FFFF00FF00009A002CF80030 + FC00009AFF00FFFF00FFFF00FFFF00FF6B6B6BA8A8A8A0A0A06B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6B9A9A9A9C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A1A47F81A4CFF123BF100009AFF00FFFF00FF00009A012DF60132FF002A + F300009AFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7AAAAAA9F9F9F6B6B6BFF + 00FFFF00FF6B6B6B9999999E9E9E9797976B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A1C47F61B4DFF143EF400009A00009A002DF80134FF032BF20000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ABABABA2A2A26B + 6B6B6B6B6B9A9A9A9E9E9E9898986B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A1D48F61D50FF103DFB0431FE0132FF002CF600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ACACACA3 + A3A39F9F9F9E9E9E9999996B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A1A48F91342FF0C3CFF0733F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7A7 + A7A7A3A3A39C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A214EFC1D4BFF1847FF1743F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BACACACAC + ACACA9A9A9A4A4A46B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A2E5BF92C5FFF224DF8204BF82355FF1B46F600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB1B1B1B3B3B3AB + ABABAAAAAAAFAFAFA6A6A66B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A3664FA386BFF2D59F400009A00009A224CF42558FF1D49F60000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB6B6B6B9B9B9AEAEAE6B + 6B6B6B6B6BA9A9A9B0B0B0A7A7A76B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A4071FA4274FF325DF100009AFF00FFFF00FF00009A224DF1275AFF204C + F800009AFF00FFFF00FFFF00FFFF00FF6B6B6BBBBBBBBEBEBEAFAFAF6B6B6BFF + 00FFFF00FF6B6B6BA7A7A7B1B1B1AAAAAA6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A497AFC3B66F300009AFF00FFFF00FFFF00FFFF00FF00009A2550F42655 + FA00009AFF00FFFF00FFFF00FFFF00FF6B6B6BC0C0C0B5B5B56B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6BAAAAAAAEAEAE6B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + NumGlyphs = 2 + end + object Panel3: TPanel + Left = 168 + Top = 23 + Width = 129 + Height = 17 + BevelOuter = bvNone + TabOrder = 1 + object rbSynapseSuperHttp: TRadioButton + Left = 0 + Top = 0 + Width = 65 + Height = 17 + Caption = 'Synapse' + Checked = True + TabOrder = 0 + TabStop = True + end + end + end + object gbSuperTcp: TGroupBox + Left = 7 + Top = 259 + Width = 450 + Height = 80 + Caption = ' Super TCP Server ' + TabOrder = 3 + object Label11: TLabel + Left = 8 + Top = 24 + Width = 24 + Height = 13 + Caption = '&Port:' + FocusControl = seSuperHTTPPort + end + object Label12: TLabel + Left = 8 + Top = 52 + Width = 46 + Height = 13 + Caption = 'Message:' + end + object Label14: TLabel + Left = 99 + Top = 24 + Width = 62 + Height = 13 + Alignment = taRightJustify + AutoSize = False + Caption = 'Component:' + end + object seSuperTCPPort: TSpinEdit + Left = 36 + Top = 22 + Width = 53 + Height = 22 + MaxValue = 0 + MinValue = 0 + TabOrder = 0 + Value = 8095 + end + object bActivateSuperTcp: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = '&Activate' + TabOrder = 3 + OnClick = bActivateSuperTCPClick + Glyph.Data = { + 36030000424D3603000000000000360000002800000010000000100000000100 + 18000000000000030000120B0000120B00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FF811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00 + 811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00811E00811E00FF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF811E0095440F811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00A7632F811E0081 + 1E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF811E00BF8B62CCA17E811E00811E00FF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00D8 + B69CE6D1BFE7D3C4811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FF811E00F0E2D9FCF7F2FAF0E6811E00811E + 00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00D8AF96F4E2CFF0D7BDD8A784811E00811E00FF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FF811E00F3DECAEFD4B8EBC9A7DAA67D811E00FF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF81 + 1E00E7BB92E3B081E0A672D5925A811E00FF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF811E00DA995ED78F50D38441CF7B + 35811E00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FF811E00811E00811E00811E00811E00811E00FF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + end + object cbSuperTCPMsg: TComboBox + Left = 62 + Top = 49 + Width = 145 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 2 + OnChange = cbSuperTCPMsgChange + end + object bDeactivateSuperTCP: TBitBtn + Left = 357 + Top = 14 + Width = 83 + Height = 25 + Caption = 'Deactivate' + TabOrder = 4 + Visible = False + OnClick = bDeactivateSuperTCPClick + Glyph.Data = { + 36060000424D3606000000000000360000002800000020000000100000000100 + 18000000000000060000C40E0000C40E00000000000000000000FF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A174AFD103BF400009AFF00FFFF00FFFF00FFFF00FF00009A002CF80030 + FC00009AFF00FFFF00FFFF00FFFF00FF6B6B6BA8A8A8A0A0A06B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6B9A9A9A9C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A1A47F81A4CFF123BF100009AFF00FFFF00FF00009A012DF60132FF002A + F300009AFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7AAAAAA9F9F9F6B6B6BFF + 00FFFF00FF6B6B6B9999999E9E9E9797976B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A1C47F61B4DFF143EF400009A00009A002DF80134FF032BF20000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ABABABA2A2A26B + 6B6B6B6B6B9A9A9A9E9E9E9898986B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A1D48F61D50FF103DFB0431FE0132FF002CF600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7ACACACA3 + A3A39F9F9F9E9E9E9999996B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A1A48F91342FF0C3CFF0733F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BA7A7A7A7 + A7A7A3A3A39C9C9C6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FF00009A214EFC1D4BFF1847FF1743F600009AFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BACACACAC + ACACA9A9A9A4A4A46B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FF00009A2E5BF92C5FFF224DF8204BF82355FF1B46F600009AFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB1B1B1B3B3B3AB + ABABAAAAAAAFAFAFA6A6A66B6B6BFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FF00009A3664FA386BFF2D59F400009A00009A224CF42558FF1D49F60000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6BB6B6B6B9B9B9AEAEAE6B + 6B6B6B6B6BA9A9A9B0B0B0A7A7A76B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + 00009A4071FA4274FF325DF100009AFF00FFFF00FF00009A224DF1275AFF204C + F800009AFF00FFFF00FFFF00FFFF00FF6B6B6BBBBBBBBEBEBEAFAFAF6B6B6BFF + 00FFFF00FF6B6B6BA7A7A7B1B1B1AAAAAA6B6B6BFF00FFFF00FFFF00FFFF00FF + 00009A497AFC3B66F300009AFF00FFFF00FFFF00FFFF00FF00009A2550F42655 + FA00009AFF00FFFF00FFFF00FFFF00FF6B6B6BC0C0C0B5B5B56B6B6BFF00FFFF + 00FFFF00FFFF00FF6B6B6BAAAAAAAEAEAE6B6B6BFF00FFFF00FFFF00FFFF00FF + FF00FF00009A00009AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00009A0000 + 9AFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FF6B6B6B6B6B6BFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF + FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00 + FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF + 00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF} + NumGlyphs = 2 + end + object Panel4: TPanel + Left = 168 + Top = 23 + Width = 129 + Height = 17 + BevelOuter = bvNone + TabOrder = 1 + object rbSynapseSuperTcp: TRadioButton + Left = 0 + Top = 0 + Width = 65 + Height = 17 + Caption = 'Synapse' + TabOrder = 0 + end + object rbIndySuperTCP: TRadioButton + Left = 68 + Top = 0 + Width = 41 + Height = 17 + Caption = 'Indy' + Checked = True + TabOrder = 1 + TabStop = True + end + end + end + object bClearLog: TButton + Left = 664 + Top = 367 + Width = 75 + Height = 25 + Caption = 'Clear Log' + TabOrder = 11 + OnClick = bClearLogClick + end + object cb_UseEnvelopes: TCheckBox + Left = 307 + Top = 427 + Width = 149 + Height = 17 + Caption = 'Use message envelopes' + TabOrder = 7 + OnClick = cb_UseEnvelopesClick + end + object ROBINMessage: TROBinMessage + OnInitializeMessage = MessageInitializeMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + Left = 563 + Top = 25 + end + object WinMessageServer: TROWinMessageServer + Encryption.EncryptionSendKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + Encryption.EncryptionRecvKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + Dispatchers = < + item + Name = 'ROBINMessage' + Message = ROBINMessage + Enabled = True + end> + OnAfterServerActivate = WinMessageServerAfterServerActivate + OnAfterServerDeactivate = WinMessageServerAfterServerDeactivate + ServerID = '{E46A5995-2260-44EA-AC60-121ADB4CC2D0}' + Left = 608 + Top = 312 + end + object ROSOAPMessage: TROSOAPMessage + OnInitializeMessage = MessageInitializeMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + SerializationOptions = [xsoWriteMultiRefArray, xsoWriteMultiRefObject] + Left = 592 + Top = 25 + end + object BpdxTcpServer: TROBPDXTCPServer + Encryption.EncryptionSendKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + Encryption.EncryptionRecvKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + Dispatchers = < + item + Name = 'ROBINMessage' + Message = ROBINMessage + Enabled = True + end> + OnAfterServerActivate = TcpServerAfterServerActivate + OnAfterServerDeactivate = TcpServerAfterServerDeactivate + BPDXServer.ReleaseDate = '2002-09-01' + BPDXServer.ListenerThreadPriority = tpIdle + BPDXServer.SpawnedThreadPriority = tpIdle + BPDXServer.Suspend = False + BPDXServer.UseSSL = False + BPDXServer.UseThreadPool = True + BPDXServer.ServerPort = 8090 + BPDXServer.ProtocolToBind = wpTCPOnly + BPDXServer.SocketOutputBufferSize = bsfNormal + BPDXServer.ServerType = stThreadBlocking + BPDXServer.ThreadCacheSize = 1000 + Port = 8090 + Left = 576 + Top = 312 + end + object BpdxHttpServer: TROBPDXHTTPServer + Encryption.EncryptionSendKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + Encryption.EncryptionRecvKey = 'CDB4E624C47EF40C26DCE65F70E6F3ABC03B6AD4FC0B064985F180A46895F064' + Dispatchers = < + item + Name = 'ROBINMessage' + Message = ROBINMessage + Enabled = True + PathInfo = '/BIN' + end + item + Name = 'ROSOAPMessage' + Message = ROSOAPMessage + Enabled = True + PathInfo = '/SOAP' + end + item + Name = 'ROPostMessage' + Message = ROPostMessage + Enabled = True + PathInfo = '/POST' + end + item + Name = 'ROXmlRpcMessage' + Message = ROXmlRpcMessage + Enabled = True + PathInfo = '/XMLRPC' + end + item + Name = 'ROServerMultiMessage' + Message = ROServerMultiMessage + Enabled = True + PathInfo = '/' + end> + OnAfterServerActivate = HttpServerAfterServerActivate + OnAfterServerDeactivate = HttpServerAfterServerDeactivate + BPDXServer.ReleaseDate = '2002-09-01' + BPDXServer.ListenerThreadPriority = tpIdle + BPDXServer.SpawnedThreadPriority = tpIdle + BPDXServer.Suspend = False + BPDXServer.UseSSL = False + BPDXServer.UseThreadPool = True + BPDXServer.ServerPort = 8099 + BPDXServer.ProtocolToBind = wpTCPOnly + BPDXServer.SocketOutputBufferSize = bsfNormal + BPDXServer.ServerType = stThreadBlocking + BPDXServer.ThreadCacheSize = 1000 + BPDXServer.Timeout = 50000 + BPDXServer.SupportKeepAlive = True + Port = 8099 + SupportKeepAlive = True + Left = 544 + Top = 312 + end + object ROPostMessage: TROPostMessage + OnInitializeMessage = MessageInitializeMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + Left = 535 + Top = 25 + end + object ROServerMultiMessage: TROServerMultiMessage + OnInitializeMessage = MessageInitializeMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + SupportedMessages = < + item + Message = ROBINMessage + end + item + Message = ROSOAPMessage + end + item + Message = ROPostMessage + end + item + Message = ROXmlRpcMessage + end> + Left = 507 + Top = 25 + end + object ROXmlRpcMessage: TROXmlRpcMessage + OnInitializeMessage = MessageInitializeMessage + Envelopes = < + item + Envelope = ROAESEncryptionEnvelope + end> + Left = 621 + Top = 25 + end + object ROAESEncryptionEnvelope: TROAESEncryptionEnvelope + EnvelopeMarker = 'AES' + BeforeEnvelopeProcessed = ROAESEncryptionEnvelopeBeforeEnvelopeProcessed + Password = 'All work and no play makes Jack a dull boy.' + Left = 504 + Top = 72 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServerMain.pas new file mode 100644 index 0000000..6d4ca1c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoServerMain.pas @@ -0,0 +1,733 @@ +unit MegaDemoServerMain; + +{ Activate this define if you are using the demo without having Indy installed. } +{.$DEFINE NO_INDY} + +{ Activate this define if you are using the demo without having Synapse installed. } +{.$DEFINE NO_Synapse} +{$INCLUDE RemObjects.inc} + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, Spin, Buttons, ExtCtrls, SyncObjs, + +{$IFNDEF NO_INDY} + IdBaseComponent, IdComponent, + IdTCPServer, IdHTTPServer, uROIndyTCPServer, uROIndyHTTPServer, uROSuperTCPServer, + {$IFDEF RemObjects_INDY10}IdContext,{$ENDIF} + +{$ENDIF NO_INDY} +{$IFNDEF NO_Synapse} + uROIpSuperHttpServer,uROSynapseSuperTCPServer,uROIpHttpServer,uROIpTcpServer, +{$ENDIF} + uROClient, uROBINMessage, uROClientIntf, uROServer, + uROBPDXHTTPServer, uROBPDXTCPServer, uROPoweredByRemObjectsButton, + uROSOAPMessage, uROWinMessageServer, uROEncryption, + uROPostMessage, uROServerMultiMessage, uROXmlRpcMessage, + uROEncryptionEnvelope; + +const + WM_LOG_MESSAGE = WM_APP + 1; + +type + TMegaDemoServerMainForm = class(TForm) + ROBINMessage: TROBinMessage; + Memo: TMemo; + cbUseCompression: TCheckBox; + WinMessageServer: TROWinMessageServer; + ROSOAPMessage: TROSOAPMessage; + gbHTTP: TGroupBox; + gbTCP: TGroupBox; + gbWinMsg: TGroupBox; + Label1: TLabel; + seHTTPPort: TSpinEdit; + seTCPPort: TSpinEdit; + Label4: TLabel; + eServerID: TEdit; + bActivateHTTP: TBitBtn; + bActivateTCP: TBitBtn; + bActivateWinMsg: TBitBtn; + cbWinMsgMsg: TComboBox; + Label3: TLabel; + Label6: TLabel; + cbTCPMsg: TComboBox; + Label7: TLabel; + BpdxTcpServer: TROBPDXTCPServer; + BpdxHttpServer: TROBPDXHTTPServer; + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + Label5: TLabel; + bDeactivateWinMsg: TBitBtn; + bDeactivateTCP: TBitBtn; + bDeactivateHTTP: TBitBtn; + Label13: TLabel; + Panel2: TPanel; + rbBpdxHttp: TRadioButton; + RbIndyHttp: TRadioButton; + Panel1: TPanel; + rbBpdxTcp: TRadioButton; + RbIndyTcp: TRadioButton; + Label8: TLabel; + cb_Encrypt: TCheckBox; + cb_SupportKeepAlive: TCheckBox; + cbDisableNagle: TCheckBox; + cbVerbose: TCheckBox; + ROPostMessage: TROPostMessage; + ErrorMemo: TMemo; + ROServerMultiMessage: TROServerMultiMessage; + ROXmlRpcMessage: TROXmlRpcMessage; + gbSuperHTTP: TGroupBox; + Label2: TLabel; + Label9: TLabel; + Label10: TLabel; + seSuperHTTPPort: TSpinEdit; + bActivateSuperHTTP: TBitBtn; + bDeactivateSuperHTTP: TBitBtn; + Panel3: TPanel; + rbSynapseSuperHttp: TRadioButton; + gbSuperTcp: TGroupBox; + Label11: TLabel; + Label12: TLabel; + Label14: TLabel; + seSuperTCPPort: TSpinEdit; + bActivateSuperTcp: TBitBtn; + cbSuperTCPMsg: TComboBox; + bDeactivateSuperTCP: TBitBtn; + Panel4: TPanel; + rbSynapseSuperTcp: TRadioButton; + rbIndySuperTCP: TRadioButton; + rbSynapseHttp: TRadioButton; + rbSynapseTCP: TRadioButton; + bClearLog: TButton; + cb_UseEnvelopes: TCheckBox; + ROAESEncryptionEnvelope: TROAESEncryptionEnvelope; + procedure FormCreate(Sender: TObject); + procedure HttpServerAfterServerActivate(Sender: TObject); + procedure HttpServerAfterServerDeactivate(Sender: TObject); + procedure cbUseCompressionClick(Sender: TObject); + procedure bActivateHTTPClick(Sender: TObject); + procedure bActivateTCPClick(Sender: TObject); + procedure bActivateWinMsgClick(Sender: TObject); + procedure cbTCPMsgChange(Sender: TObject); + procedure cbWinMsgMsgChange(Sender: TObject); + procedure bDeactivateHTTPClick(Sender: TObject); + procedure bDeactivateTCPClick(Sender: TObject); + procedure bDeactivateWinMsgClick(Sender: TObject); + procedure TcpServerAfterServerActivate(Sender: TObject); + procedure TcpServerAfterServerDeactivate(Sender: TObject); + procedure WinMessageServerAfterServerDeactivate(Sender: TObject); + procedure WinMessageServerAfterServerActivate(Sender: TObject); + procedure cb_EncryptClick(Sender: TObject); + procedure cb_SupportKeepAliveClick(Sender: TObject); + procedure cbDisableNagleClick(Sender: TObject); + procedure MessageInitializeMessage(Sender: TROMessage; + const aTransport: IROTransport; const anInterfaceName, + aMessageName: String); + procedure cbSuperTCPMsgChange(Sender: TObject); + procedure bDeactivateSuperTCPClick(Sender: TObject); + procedure bActivateSuperTCPClick(Sender: TObject); + procedure SuperTcpServerAfterServerActivate(Sender: TObject); + procedure SuperTcpServerAfterServerDeactivate(Sender: TObject); + procedure SuperHttpServerAfterServerActivate(Sender: TObject); + procedure SuperHttpServerAfterServerDeactivate(Sender: TObject); + procedure bActivateSuperHTTPClick(Sender: TObject); + procedure bDeactivateSuperHTTPClick(Sender: TObject); + procedure bClearLogClick(Sender: TObject); + procedure cb_UseEnvelopesClick(Sender: TObject); + procedure ROAESEncryptionEnvelopeBeforeEnvelopeProcessed( + AMessageEnvelope: TROMessageEnvelope; AStream: TStream; + aMode: TROMessageEnvelopeMode; AMessage: IROMessage); + private + {$IFNDEF NO_INDY} + ROIndyHTTPServer : TROIndyHTTPServer; + ROIndyTCPServer : TROIndyTCPServer; + ROIndySuperTCPServer: TROSuperTcpServer; + {$ENDIF NO_INDY} + {$IFNDEF NO_Synapse} + ROSynapseSuperHTTPServer : TROIpSuperHttpServer; + ROSynapseSuperTCPServer : TROSynapseSuperTcpServer; + ROSynapseTCPServer : TROIpTcpServer; + ROSynapseHTTPServer : TROIpHttpServer; + {$ENDIF NO_Synapse} + + fCritical: TCriticalSection; + + procedure ActivateGroupBox(iGroupBox: TGroupBox; iActivate: boolean); + procedure CheckStatus; + protected + procedure WMLog(var Message: TMessage); message WM_LOG_MESSAGE; + + public + constructor Create(aOwner: TComponent); override; + destructor Destroy; override; + + procedure Log(const someText: string); + + end; + +var + MegaDemoServerMainForm: TMegaDemoServerMainForm; + +implementation + +uses MegaDemoLibrary_Intf; + +{$R *.DFM} + +procedure TMegaDemoServerMainForm.FormCreate(Sender: TObject); +begin + rbBpdxTcp.Enabled:=True; + rbBpdxHttp.Enabled:=True; +{$IFDEF NO_INDY} + rbIndyHttp.Enabled := false; + rbIndyTcp.Enabled := false; + rbIndySuperTCP.Enabled := false; +{$ELSE} + ROIndyHTTPServer := TROIndyHTTPServer.Create(Self); + ROIndyHTTPServer.Dispatchers.Assign(BpdxHttpServer.Dispatchers); + ROIndyHTTPServer.OnAfterServerActivate := HttpServerAfterServerActivate; + ROIndyHTTPServer.OnAfterServerDeactivate := HttpServerAfterServerDeactivate; + + ROIndyTCPServer := TROIndyTCPServer.Create(Self); + ROIndyTCPServer.Dispatchers.Assign(BpdxTcpServer.Dispatchers); + ROIndyTCPServer.OnAfterServerActivate := TcpServerAfterServerActivate; + ROIndyTCPServer.OnAfterServerDeactivate := TcpServerAfterServerDeactivate; + + ROIndySuperTCPServer:= TROSuperTcpServer.Create(Self); + ROIndySuperTCPServer.Dispatchers.Assign(BpdxTcpServer.Dispatchers); + ROIndySuperTCPServer.OnAfterServerActivate := SuperTcpServerAfterServerActivate; + ROIndySuperTCPServer.OnAfterServerDeactivate := SuperTcpServerAfterServerDeactivate; +{$ENDIF NO_INDY} + +{$IFDEF NO_Synapse} + rbSynapseSuperHttp.Enabled:=False; + rbSynapseSuperTcp.Enabled:=False; + rbSynapseTCP.Enabled:=False; + rbSynapseHTTP.Enabled:=False; +{$ELSE} + ROSynapseSuperHTTPServer := TROIpSuperHttpServer.Create(Self); + ROSynapseSuperHTTPServer.Dispatchers.Assign(BpdxHttpServer.Dispatchers); + ROSynapseSuperHTTPServer.OnAfterServerActivate := SuperHttpServerAfterServerActivate; + ROSynapseSuperHTTPServer.OnAfterServerDeactivate := SuperHttpServerAfterServerDeactivate; + + ROSynapseSuperTCPServer := TROSynapseSuperTcpServer.Create(Self); + ROSynapseSuperTCPServer.Dispatchers.Assign(BpdxTcpServer.Dispatchers); + ROSynapseSuperTCPServer.OnAfterServerActivate := SuperTcpServerAfterServerActivate; + ROSynapseSuperTCPServer.OnAfterServerDeactivate := SuperTcpServerAfterServerDeactivate; + + ROSynapseHTTPServer := TROIpHttpServer.Create(Self); + ROSynapseHTTPServer.Dispatchers.Assign(BpdxHttpServer.Dispatchers); + ROSynapseHTTPServer.OnAfterServerActivate := HttpServerAfterServerActivate; + ROSynapseHTTPServer.OnAfterServerDeactivate := HttpServerAfterServerDeactivate; + + ROSynapseTCPServer := TROIpTcpServer.Create(Self); + ROSynapseTCPServer.Dispatchers.Assign(BpdxTcpServer.Dispatchers); + ROSynapseTCPServer.OnAfterServerActivate := TcpServerAfterServerActivate; + ROSynapseTCPServer.OnAfterServerDeactivate := TcpServerAfterServerDeactivate; +{$ENDIF NO_Synapse} + cb_SupportKeepAliveClick(Sender); + + // Misc + WinMessageServer.ServerID := LibraryUID; + + eServerID.Text := WinMessageServer.ServerID; + + cbTCPMsg.Items.Clear; + cbTCPMsg.Items.AddObject('Auto', ROServerMultiMessage); + cbTCPMsg.Items.AddObject('Bin', ROBINMessage); + cbTCPMsg.Items.AddObject('Soap', ROSOAPMessage); + cbTCPMsg.Items.AddObject('Post', ROPOSTMessage); + cbTCPMsg.Items.AddObject('XmlRpc', ROXmlRpcMessage); + cbTCPMsg.ItemIndex := 0; + cbTCPMsgChange(cbTCPMsg); + + cbSuperTcpMsg.Items.AddStrings(cbTCPMsg.Items); + cbSuperTcpMsg.ItemIndex := 0; + cbSuperTCPMsgChange(cbSuperTcpMsg); + + + cbWinMsgMsg.Items.AddStrings(cbTCPMsg.Items); + cbWinMsgMsg.ItemIndex := 0; + cbWinMsgMsgChange(cbWinMsgMsg); + + cbUseCompressionClick(cbUseCompression); + cb_EncryptClick(cb_Encrypt); + cb_UseEnvelopesClick(cb_UseEnvelopes); + + if (ParamCount > 0) and SameText(ParamStr(1), '/activate') then begin + Application.ProcessMessages(); + bActivateHTTP.Click; + bActivateTcP.Click; + bActivateWinMsg.Click; + bActivateSuperHTTP.Click; + bActivateSuperTCP.Click; + end; + CheckStatus; +end; + +procedure TMegaDemoServerMainForm.Log(const someText: string); +var + p: pChar; +begin + if Application.Terminated then Exit; + + if not cbVerbose.Checked then Exit; + + GetMem(p, (Length(someText) + 1)*SizeOf(Char)); + Move(someText[1], p^, (Length(someText)+ 1)*SizeOf(Char)); + PostMessage(Handle, WM_LOG_MESSAGE, 0, integer(p)); + + { Access to the VCL may only happen from within the main thread. To allow + Log to be called from within the Service implementattion, we must ensure + it's threadsafe. + + So instread of just addint the log message to the Memo, we'l send a + PostMessage to the window, which wil then later be handled within the + main thread. + + As a side benefit, the secution of the Log doe snot need to wait for this + logging to happen (as usage of, for example, Synchronize would require), + which will in turn make the server more respinsible for a simultaneous + calls. } +end; + +procedure TMegaDemoServerMainForm.WMLog(var Message: TMessage); +var + p: pChar; +begin + try + p := pChar(Message.LParam); + Memo.Lines.Add(p); + Freemem(p); + except + on E: Exception do + Memo.Lines.Add(E.Classname + ': ' + E.Message); + end; +end; + +procedure TMegaDemoServerMainForm.ActivateGroupBox(iGroupBox: TGroupBox; iActivate: boolean); +var + i, j: integer; + lPanel: TPanel; +begin + if iGroupBox <> nil then + for i := 0 to (iGroupBox.ControlCount - 1) do begin + if not (iGroupBox.Controls[i] is TBitBtn) and + not (iGroupBox.Controls[i] is TComboBox) and + not ((iGroupBox.Controls[i] is TLabel) and (TLabel(iGroupBox.Controls[i]).Caption = 'Message:')) then iGroupBox.Controls[i].Enabled := iActivate; + if (iGroupBox.Controls[i] is TPanel) then begin + lPanel := TPanel(iGroupBox.Controls[i]); + for j := 0 to (lPanel.ControlCount - 1) do begin + lPanel.Controls[j].Enabled := iActivate; + end; + end; + end; +end; + +procedure TMegaDemoServerMainForm.HttpServerAfterServerActivate(Sender: TObject); +begin + ActivateGroupBox(gbHttp, false); + Log((Sender as TComponent).ClassName + ' has been activated...'); +end; + +procedure TMegaDemoServerMainForm.HttpServerAfterServerDeactivate(Sender: TObject); +begin + ActivateGroupBox(gbHttp, true); + Log((Sender as TComponent).ClassName + ' has been deactivated...'); +end; + +procedure TMegaDemoServerMainForm.TcpServerAfterServerActivate(Sender: TObject); +begin + ActivateGroupBox(gbTcp, false); + Log((Sender as TComponent).ClassName + ' has been activated...'); +end; + +procedure TMegaDemoServerMainForm.TcpServerAfterServerDeactivate(Sender: TObject); +begin + ActivateGroupBox(gbTcp, true); + Log((Sender as TComponent).ClassName + ' has been deactivated...'); +end; + +procedure TMegaDemoServerMainForm.WinMessageServerAfterServerActivate(Sender: TObject); +begin + ActivateGroupBox(gbWinMsg, false); + Log((Sender as TComponent).ClassName + ' has been activated...'); +end; + +procedure TMegaDemoServerMainForm.WinMessageServerAfterServerDeactivate(Sender: TObject); +begin + ActivateGroupBox(gbWinMsg, true); + Log((Sender as TComponent).ClassName + ' has been deactivated...'); +end; + +procedure TMegaDemoServerMainForm.cbUseCompressionClick(Sender: TObject); +begin + ROBINMessage.UseCompression := cbUseCompression.Checked; +end; + +procedure TMegaDemoServerMainForm.cbTCPMsgChange(Sender: TObject); +begin + with TComboBox(Sender) do begin +{$IFNDEF NO_INDY} + ROIndyTCPServer.Dispatchers[0].Message := TROMessage(Items.Objects[ItemIndex]); +{$ENDIF NO_INDY} +{$IFNDEF NO_SYNAPSE} + ROSynapseTCPServer.Dispatchers[0].Message := TROMessage(Items.Objects[ItemIndex]); +{$ENDIF NO_SYNAPSE} + BpdxTCPServer.Dispatchers[0].Message := TROMessage(Items.Objects[ItemIndex]); + end; +end; + +procedure TMegaDemoServerMainForm.cbWinMsgMsgChange(Sender: TObject); +begin + with TComboBox(Sender) do + WinMessageServer.Dispatchers[0].Message :=TROMessage(Items.Objects[ItemIndex]); +end; + +procedure TMegaDemoServerMainForm.bActivateTCPClick(Sender: TObject); +begin +{$IFNDEF NO_INDY} + if RbIndyTcp.Checked then begin + ROIndyTCPServer.Port := seTCPPort.Value; + ROIndyTCPServer.Active := true; + end + else +{$ENDIF NO_INDY} +{$IFNDEF NO_SYNAPSE} + if rbSynapseTCP.Checked then begin + ROSynapseTCPServer.Port := seTCPPort.Value; + ROSynapseTCPServer.Active := true; + end + else +{$ENDIF NO_SYNAPSE} + begin + rbBpdxTcp.Checked:= True; + BpdxTCPServer.BpdxServer.ServerPort := seTCPPort.Value; + BpdxTCPServer.Active := true; + bDeactivateTcp.Enabled := false; + Log('Please note that BPDX Servers cannot be deactivated once they have been activated.' + + 'This is a limitation of the BPDX Library, see the Help topic for this sample for more details.'); + end; + bDeactivateTcp.Visible := true; + bActivateTcp.Visible := false; + CheckStatus; +end; + +procedure TMegaDemoServerMainForm.bDeactivateTCPClick(Sender: TObject); +begin + bActivateTcp.Visible := true; + bDeactivateTcp.Visible := false; + + BpdxTCPServer.Active := false; +{$IFNDEF NO_INDY} + ROIndyTCPServer.Active := false; +{$ENDIF NO_INDY} +{$IFNDEF NO_Synapse} + ROSynapseTCPServer.Active := false; +{$ENDIF NO_INDY} + CheckStatus; +end; + +procedure TMegaDemoServerMainForm.bActivateHTTPClick(Sender: TObject); +begin +{$IFNDEF NO_INDY} + if RbIndyHttp.Checked then begin + ROIndyHTTPServer.Port := seHTTPPort.Value; + ROIndyHTTPServer.Active := true; + end + else +{$ENDIF NO_INDY} +{$IFNDEF NO_SYNAPSE} + if rbSynapseHttp.Checked then begin + ROSynapseHTTPServer.Port := seHTTPPort.Value; + ROSynapseHTTPServer.Active := true; + end + else +{$ENDIF NO_SYNAPSE} + begin + rbBpdxHttp.Checked:= True; + BpdxHTTPServer.BpdxServer.ServerPort := seHTTPPort.Value; + BpdxHTTPServer.Active := true; + bDeactivateHttp.Enabled := false; + Log('Please note that BPDX Servers cannot be deactivated once they have been activated.' + + 'This is a limitation of the BPDX Library, see the Help topic for this sample for more details.'); + end; + bDeactivateHttp.Visible := true; + bActivateHttp.Visible := false; + CheckStatus; +end; + +procedure TMegaDemoServerMainForm.bDeactivateHTTPClick(Sender: TObject); +begin + bActivateHttp.Visible := true; + bDeactivateHttp.Visible := false; + + BpdxHTTPServer.Active := false; +{$IFNDEF NO_INDY} + ROIndyHTTPServer.Active := false; +{$ENDIF NO_INDY} +{$IFNDEF NO_Synapse} + ROSynapseHTTPServer.Active := false; +{$ENDIF NO_Synapse} + CheckStatus; +end; + +procedure TMegaDemoServerMainForm.bActivateWinMsgClick(Sender: TObject); +begin + WinMessageServer.ServerID := eServerID.Text; + WinMessageServer.Active := true; + + bDeactivateWinMsg.Visible := true; + bActivateWinMsg.Visible := false; + CheckStatus; +end; + +procedure TMegaDemoServerMainForm.bDeactivateWinMsgClick(Sender: TObject); +begin + bActivateWinMsg.Visible := true; + bDeactivateWinMsg.Visible := false; + WinMessageServer.Active := false; + CheckStatus; +end; + +procedure TMegaDemoServerMainForm.cb_EncryptClick(Sender: TObject); +var + lEncryption: TROEncryptionMethod; +begin + if cb_Encrypt.Checked then + lEncryption := tetDES + else + lEncryption := tetNone; + + BpdxHttpServer.Encryption.EncryptionMethod := lEncryption; + BpdxTcpServer.Encryption.Assign(BpdxHttpServer.Encryption); +{$IFNDEF NO_INDY} + ROIndyHttpServer.Encryption.Assign(BpdxHttpServer.Encryption); + ROIndyTcpServer.Encryption.Assign(BpdxHttpServer.Encryption); + ROIndySuperTCPServer.Encryption.Assign(BpdxHttpServer.Encryption); +{$ENDIF NO_INDY} +{$IFNDEF NO_Synapse} + ROSynapseSuperHTTPServer.Encryption.Assign(BpdxHttpServer.Encryption); + ROSynapseSuperTCPServer.Encryption.Assign(BpdxHttpServer.Encryption); + ROSynapseHTTPServer.Encryption.Assign(BpdxHttpServer.Encryption); + ROSynapseTCPServer.Encryption.Assign(BpdxHttpServer.Encryption); +{$ENDIF} + WinMessageServer.Encryption.Assign(BpdxHttpServer.Encryption); +end; + +procedure TMegaDemoServerMainForm.cb_SupportKeepAliveClick(Sender: TObject); +begin + BpdxHttpServer.SupportKeepAlive := cb_SupportKeepAlive.Checked; +{$IFNDEF NO_INDY} + ROIndyHttpServer.KeepAlive := cb_SupportKeepAlive.Checked; +{$ENDIF NO_INDY} +end; + +procedure TMegaDemoServerMainForm.cbDisableNagleClick(Sender: TObject); +begin +{$IFNDEF NO_INDY} + ROIndyTCPServer.DisableNagle := cbDisableNagle.Checked +{$ENDIF NO_INDY} +end; + +constructor TMegaDemoServerMainForm.Create(aOwner: TComponent); +begin + inherited; + fCritical := TCriticalSection.Create; +end; + +destructor TMegaDemoServerMainForm.Destroy; +begin + fCritical.Free; + inherited; +end; + +procedure TMegaDemoServerMainForm.CheckStatus; +var + fStatus: Boolean; +begin + FStatus := +{$IFNDEF NO_INDY} + ROIndyHTTPServer.Active or + ROIndyTCPServer.Active or + ROIndySuperTCPServer.Active or +{$ENDIF NO_INDY} +{$IFNDEF NO_Synapse} + ROSynapseSuperHTTPServer.Active or + ROSynapseSuperTCPServer.Active or + ROSynapseHTTPServer.Active or + ROSynapseTCPServer.Active or +{$ENDIF} + WinMessageServer.Active or + BpdxHttpServer.Active or + BpdxTcpServer.Active; + if FStatus then begin + ErrorMemo.Visible := False; + Memo.Visible := True; + end + else begin + ErrorMemo.Visible := True; + Memo.Visible := False; + end; +end; + +procedure TMegaDemoServerMainForm.MessageInitializeMessage( + Sender: TROMessage; const aTransport: IROTransport; + const anInterfaceName, aMessageName: String); +begin + Log('Request via '+Sender.ClassName); +end; + +procedure TMegaDemoServerMainForm.cbSuperTCPMsgChange(Sender: TObject); +begin + with TComboBox(Sender) do begin +{$IFNDEF NO_INDY} + ROIndySuperTCPServer.Dispatchers[0].Message := TROMessage(Items.Objects[ItemIndex]); +{$ENDIF NO_INDY} +{$IFNDEF NO_Synapse} + ROSynapseSuperTCPServer.Dispatchers[0].Message := TROMessage(Items.Objects[ItemIndex]); +{$ENDIF NO_Synapse} + end; +end; + +procedure TMegaDemoServerMainForm.bDeactivateSuperTCPClick( + Sender: TObject); +begin + bActivateSuperTcp.Visible := true; + bDeactivateSuperTcp.Visible := false; +{$IFNDEF NO_INDY} + ROIndySuperTCPServer.Active := false; +{$ENDIF NO_INDY} +{$IFNDEF NO_Synapse} + ROSynapseSuperTCPServer.Active := false; +{$ENDIF NO_Synapse} + CheckStatus; +end; + +procedure TMegaDemoServerMainForm.bActivateSuperTCPClick( + Sender: TObject); +var + fServer: TROServer; +begin + fServer:=nil; +{$IFDEF NO_Synapse} + rbIndySuperTCP.Checked:= True; +{$ENDIF} +{$IFNDEF NO_INDY} + if rbIndySuperTCP.Checked then begin + ROIndySuperTCPServer.Port := seSuperTCPPort.Value; + fServer := ROIndySuperTCPServer; + end; +{$ELSE} + rbSynapseSuperTcp.Checked := True; +{$ENDIF NO_INDY} + +{$IFNDEF NO_Synapse} + if rbSynapseSuperTcp.Checked then begin + ROSynapseSuperTCPServer.Port := seSuperTCPPort.Value; + fServer := ROSynapseSuperTCPServer; + end; +{$ENDIF} + if Assigned(fServer) then begin + fServer.Active:= True; + bDeactivateSuperTcp.Visible := true; + bActivateSuperTcp.Visible := false; + CheckStatus; + end + else begin + ShowMessage('No Super TCP servers was found.'+sLineBreak+ + 'Please use Indy or Synapse library.'); + end; +end; + +procedure TMegaDemoServerMainForm.SuperTcpServerAfterServerActivate( + Sender: TObject); +begin + ActivateGroupBox(gbSuperTcp, false); + Log((Sender as TComponent).ClassName + ' has been activated...'); +end; + +procedure TMegaDemoServerMainForm.SuperTcpServerAfterServerDeactivate( + Sender: TObject); +begin + ActivateGroupBox(gbSuperTcp, true); + Log((Sender as TComponent).ClassName + ' has been deactivated...'); +end; + +procedure TMegaDemoServerMainForm.SuperHttpServerAfterServerActivate( + Sender: TObject); +begin + ActivateGroupBox(gbSuperHTTP, false); + Log((Sender as TComponent).ClassName + ' has been activated...'); +end; + +procedure TMegaDemoServerMainForm.SuperHttpServerAfterServerDeactivate( + Sender: TObject); +begin + ActivateGroupBox(gbSuperHTTP, true); + Log((Sender as TComponent).ClassName + ' has been deactivated...'); +end; + +procedure TMegaDemoServerMainForm.bActivateSuperHTTPClick(Sender: TObject); +begin +{$IFNDEF NO_Synapse} + ROSynapseSuperHTTPServer.Port := seSuperHTTPPort.Value; + ROSynapseSuperHTTPServer.Active := true; + bDeactivateSuperHttp.Visible := true; + bActivateSuperHttp.Visible := false; + CheckStatus; +{$ELSE} + ShowMessage('No Super HTTP servers was found.'+sLineBreak+ + 'Please use Synapse library.'); +{$ENDIF} +end; + +procedure TMegaDemoServerMainForm.bDeactivateSuperHTTPClick( + Sender: TObject); +begin + bActivateSuperHttp.Visible := true; + bDeactivateSuperHttp.Visible := false; + +{$IFNDEF NO_Synapse} + ROSynapseSuperHTTPServer.Active := false; +{$ENDIF} + CheckStatus; +end; + +procedure TMegaDemoServerMainForm.bClearLogClick(Sender: TObject); +begin + Memo.Lines.Clear; +end; + +procedure TMegaDemoServerMainForm.cb_UseEnvelopesClick(Sender: TObject); + + procedure SetupMessage(AMessage: TROMessage); + var + i: integer; + begin + with AMessage.Envelopes do + for i:=0 to Count -1 do + Items[i].Enabled := cb_UseEnvelopes.Checked; + end; + +begin + SetupMessage(ROServerMultiMessage); + SetupMessage(ROBINMessage); + SetupMessage(ROSOAPMessage); + SetupMessage(ROPostMessage); + SetupMessage(ROXmlRpcMessage); +end; + +procedure TMegaDemoServerMainForm.ROAESEncryptionEnvelopeBeforeEnvelopeProcessed( + AMessageEnvelope: TROMessageEnvelope; AStream: TStream; + aMode: TROMessageEnvelopeMode; AMessage: IROMessage); +begin + case aMode of + memIncoming: Log(AMessageEnvelope.Name+' : processing incoming message'); + memOutgoing: Log(AMessageEnvelope.Name+' : processing outgoing message'); + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoService_Impl.dfm new file mode 100644 index 0000000..8fdbada --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoService_Impl.dfm @@ -0,0 +1,8 @@ +object MegaDemoService: TMegaDemoService + OldCreateOrder = True + OnDeactivate = RORemoteDataModuleDeactivate + Left = 391 + Top = 285 + Height = 300 + Width = 300 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoService_Impl.pas new file mode 100644 index 0000000..ae9e8b5 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/MegaDemoService_Impl.pas @@ -0,0 +1,175 @@ +unit MegaDemoService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Generated:} MegaDemoLibrary_Intf; + +type + { TMegaDemoService } + TMegaDemoService = class(TRORemoteDataModule, IMegaDemoService) + procedure RORemoteDataModuleDeactivate(const aClientID: TGUID; + aSession: TROSession); + private + protected + { IMegaDemoService methods } + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + procedure EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); + function TestIntegerArray(const anArray: TIntegerArray): TIntegerArray; + function TestStringArray(const anArray: TStringArray): TStringArray; + function TestPersonArray(const anArray: TPersonArray): TPersonArray; + procedure EchoBinary(const BinIN: binary; out BinOUT: Binary); + procedure SomeTypes(var aString: Ansistring; var aWidestring: Widestring; var anInteger: Integer; var + aCurrency: Currency; var aDatetime: DateTime); + function CustomObjectAsString: Ansistring; + function CustomObjectAsStream: Binary; + procedure RaiseError; + procedure RaiseTestException; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} MegaDemoLibrary_Invk, MegaDemoServerMain, + MegaDemoCustomClass, uROXMLSerializer, uROStreamSerializer; + +procedure Create_MegaDemoService(out anInstance: IUnknown); +begin + anInstance := TMegaDemoService.Create(nil); +end; + +{ MegaService } + +function TMegaDemoService.Sum(const A: Integer; const B: Integer): Integer; +begin + result := A + B; +end; + +function TMegaDemoService.GetServerTime: DateTime; +begin + result := Now; +end; + +procedure TMegaDemoService.EchoPerson(const aPerson: TPerson; out anotherPerson: TPerson); +begin + anotherPerson := TPerson.Create; + + anotherPerson.FirstName := aPerson.FirstName; + anotherPerson.LastName := aPerson.LastName; + anotherPerson.Age := aPerson.Age; + anotherPerson.Sex := aPerson.Sex; +end; + +function TMegaDemoService.TestIntegerArray(const anArray: TIntegerArray): TIntegerArray; +var + i: integer; +begin + result := TIntegerArray.Create; + for i := 0 to anArray.Count - 1 do + result.Add(anArray[i]); +end; + +function TMegaDemoService.TestStringArray(const anArray: TStringArray): TStringArray; +var + i: integer; +begin + result := TStringArray.Create; + for i := 0 to anArray.Count - 1 do + result.Add(anArray[i]); +end; + +function TMegaDemoService.TestPersonArray(const anArray: TPersonArray): TPersonArray; +var + i: integer; +begin + result := TPersonArray.Create; + for i := 0 to anArray.Count - 1 do begin + with result.Add do begin + FirstName := anArray[i].FirstName; + LastName := anArray[i].LastName; + Age := anArray[i].Age; + Sex := anArray[i].Sex; + end; + end; +end; + +procedure TMegaDemoService.EchoBinary(const BinIN: binary; out BinOUT: Binary); +begin + BinOut := Binary.Create; + BinOUT.CopyFrom(BinIN, BinIN.Size); +end; + +procedure TMegaDemoService.SomeTypes(var aString: Ansistring; var aWidestring: Widestring; var anInteger: + Integer; var aCurrency: Currency; var aDatetime: DateTime); +begin + aString := 'received aString: "' + aString + '"'; + aWidestring := 'received aWideString "' + aWideString + '"'; + anInteger := anInteger * 2; + aCurrency := aCurrency * 2; + aDatetime := Now; +end; + +function TMegaDemoService.CustomObjectAsString: Ansistring; +var + cls: TCustomClass; +begin + result := ''; + + cls := NewCustomClass; + try + result := ObjectToXML(cls); + finally + cls.Free; + end; +end; + +function TMegaDemoService.CustomObjectAsStream: Binary; +var + cls: TCustomClass; +begin + result := Binary.Create; + + cls := NewCustomClass; + try + ObjectToStream(cls, result); + finally + cls.Free; + end; +end; + +procedure TMegaDemoService.RaiseError; +begin + // Generic and unregistered exceptions + raise EDivByZero.Create('A fake div by zero!'); +end; + +procedure TMegaDemoService.RaiseTestException; +begin + raise ETestException.Create('This is the exception message'+ 'îøèáêà çäåñü!', 666, 'Îøèáêà!'); +end; + +procedure TMegaDemoService.RORemoteDataModuleDeactivate(const aClientID: TGUID; + aSession: TROSession); +begin + if Assigned(MegaDemoServerMainForm) then MegaDemoServerMainForm.Log('Complete!'); +end; + +initialization + TROClassFactory.Create('MegaDemoService', Create_MegaDemoService, TMegaDemoService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/RODLFile.RES b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/RODLFile.RES new file mode 100644 index 0000000..bf5d731 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/MegaDemo/RODLFile.RES differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes.Sample.html new file mode 100644 index 0000000..fa9f6f0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes.Sample.html @@ -0,0 +1,28 @@ + + + + + + + + + +

    + Message Envelopes Sample +

    + +

    Purpose

    + +

    This example illustrates usage message envelopes.

    +

    At using message envelopes, result stream contains only envelope marker and encrypted ouput stream so + if correspondent envelope isn't found at other-side, the exception will be raised.

    + +

    Testing

    +
      +
    • Test example with different combinations of predefined envelopes
    • +
    • Change server and client envelopes (create/update/delete) and test again.
    • +
    +

    + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes.bpg new file mode 100644 index 0000000..acc18fe --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = MessageEnvelopes_Server.exe MessageEnvelopes_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +MessageEnvelopes_Server.exe: MessageEnvelopes_Server.dpr + $(DCC) + +MessageEnvelopes_Client.exe: MessageEnvelopes_Client.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesLibrary.RODL b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesLibrary.RODL new file mode 100644 index 0000000..3ae3367 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesLibrary.RODL @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesLibrary_Intf.pas new file mode 100644 index 0000000..964d148 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesLibrary_Intf.pas @@ -0,0 +1,96 @@ +unit MessageEnvelopesLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{9FBE9FFC-D17D-4D9C-840E-949F7EEB9FC2}'; + TargetNamespace = ''; + + { Service Interface ID's } + IMessageEnvelopesService_IID : TGUID = '{D20EC6CD-45A8-4C62-8114-EE02C3FDF979}'; + + { Event ID's } + +type + { Forward declarations } + IMessageEnvelopesService = interface; + + + { IMessageEnvelopesService } + IMessageEnvelopesService = interface + ['{D20EC6CD-45A8-4C62-8114-EE02C3FDF979}'] + function Echo(const AStr: AnsiString): AnsiString; + end; + + { CoMessageEnvelopesService } + CoMessageEnvelopesService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IMessageEnvelopesService; + end; + + { TMessageEnvelopesService_Proxy } + TMessageEnvelopesService_Proxy = class(TROProxy, IMessageEnvelopesService) + protected + function __GetInterfaceName:string; override; + + function Echo(const AStr: AnsiString): AnsiString; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoMessageEnvelopesService } + +class function CoMessageEnvelopesService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IMessageEnvelopesService; +begin + result := TMessageEnvelopesService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TMessageEnvelopesService_Proxy } + +function TMessageEnvelopesService_Proxy.__GetInterfaceName:string; +begin + result := 'MessageEnvelopesService'; +end; + +function TMessageEnvelopesService_Proxy.Echo(const AStr: AnsiString): AnsiString; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'MessageEnvelopesLibrary', __InterfaceName, 'Echo'); + __Message.Write('AStr', TypeInfo(AnsiString), AStr, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(AnsiString), result, []); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IMessageEnvelopesService_IID, TMessageEnvelopesService_Proxy); + + +finalization + UnregisterProxyClass(IMessageEnvelopesService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesLibrary_Invk.pas new file mode 100644 index 0000000..b02161f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesLibrary_Invk.pas @@ -0,0 +1,64 @@ +unit MessageEnvelopesLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} MessageEnvelopesLibrary_Intf; + +type + TMessageEnvelopesService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_Echo(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TMessageEnvelopesService_Invoker } + +constructor TMessageEnvelopesService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TMessageEnvelopesService_Invoker.Invoke_Echo(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Echo(const AStr: AnsiString): AnsiString; } +var + AStr: AnsiString; + lResult: AnsiString; +begin + try + __Message.Read('AStr', TypeInfo(AnsiString), AStr, []); + + lResult := (__Instance as IMessageEnvelopesService).Echo(AStr); + + __Message.InitializeResponseMessage(__Transport, 'MessageEnvelopesLibrary', 'MessageEnvelopesService', 'EchoResponse'); + __Message.Write('Result', TypeInfo(AnsiString), lResult, []); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesService_Impl.dfm new file mode 100644 index 0000000..d0cd297 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesService_Impl.dfm @@ -0,0 +1,7 @@ +object MessageEnvelopesService: TMessageEnvelopesService + OldCreateOrder = True + Left = 200 + Top = 200 + Height = 300 + Width = 300 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesService_Impl.pas new file mode 100644 index 0000000..4658429 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopesService_Impl.pas @@ -0,0 +1,56 @@ +unit MessageEnvelopesService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROXMLIntf, uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Generated:} MessageEnvelopesLibrary_Intf; + +type + { TMessageEnvelopesService } + TMessageEnvelopesService = class(TRORemoteDataModule, IMessageEnvelopesService) + private + protected + { IMessageEnvelopesService methods } + function Echo(const AStr: AnsiString): AnsiString; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} MessageEnvelopesLibrary_Invk, MessageEnvelopes_ServerMain; + +procedure Create_MessageEnvelopesService(out anInstance : IUnknown); +begin + anInstance := TMessageEnvelopesService.Create(nil); +end; + +{ MessageEnvelopesService } +function TMessageEnvelopesService.Echo(const AStr: AnsiString): AnsiString; +begin + MessageEnvelopes_ServerMainForm.Log('Received: '+AStr); + Result := AStr; +end; + +var + fClassFactory: IROClassFactory; +initialization + fClassFactory := TROClassFactory.Create('MessageEnvelopesService', Create_MessageEnvelopesService, TMessageEnvelopesService_Invoker); + +finalization + UnRegisterClassFactory(fClassFactory); + fClassFactory := nil; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_AddEnvelope.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_AddEnvelope.dfm new file mode 100644 index 0000000..ca327a2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_AddEnvelope.dfm @@ -0,0 +1,60 @@ +object MessageEnvelopes_AddEnvelopeForm: TMessageEnvelopes_AddEnvelopeForm + Left = 666 + Top = 360 + Width = 330 + Height = 164 + Color = clBtnFace + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 7 + Top = 8 + Width = 33 + Height = 13 + Caption = 'Marker' + end + object Label2: TLabel + Left = 7 + Top = 50 + Width = 46 + Height = 13 + Caption = 'Password' + end + object eMarker: TEdit + Left = 7 + Top = 24 + Width = 301 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + end + object ePassword: TEdit + Left = 7 + Top = 66 + Width = 301 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 1 + end + object bOk: TButton + Left = 74 + Top = 94 + Width = 75 + Height = 22 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 2 + end + object bCancel: TButton + Left = 162 + Top = 94 + Width = 75 + Height = 22 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_AddEnvelope.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_AddEnvelope.pas new file mode 100644 index 0000000..d0b5738 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_AddEnvelope.pas @@ -0,0 +1,61 @@ +unit MessageEnvelopes_AddEnvelope; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls; + +type + TMessageEnvelopes_AddEnvelopeForm = class(TForm) + Label1: TLabel; + Label2: TLabel; + eMarker: TEdit; + ePassword: TEdit; + bOk: TButton; + bCancel: TButton; + private + { Private declarations } + public + { Public declarations } + end; + +var + MessageEnvelopes_AddEnvelopeForm: TMessageEnvelopes_AddEnvelopeForm; + +function AddAESEnvelope(var AMarker, APassword: string): Boolean; +function UpdateAESEnvelope(var AMarker, APassword: string): Boolean; + +implementation + +{$R *.dfm} +function ShowEnvelopeForm(AUpdateMode: Boolean;var AMarker, APassword: string): Boolean; +begin + with TMessageEnvelopes_AddEnvelopeForm.Create(Application) do try + if AUpdateMode then + Caption := 'Update Envelope' + else + Caption := 'Add Envelope'; + eMarker.Text := AMarker; + ePassword.Text := APassword; + Result:= ShowModal = mrOk; + if Result then begin + AMarker := eMarker.Text; + APassword := ePassword.Text; + end; + finally + Release; + end; +end; + +function AddAESEnvelope(var AMarker, APassword: string): Boolean; +begin + Result:= ShowEnvelopeForm(False,AMarker,APassword); +end; + +function UpdateAESEnvelope(var AMarker, APassword: string): Boolean; +begin + Result:= ShowEnvelopeForm(True,AMarker,APassword); +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Client.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Client.dpr new file mode 100644 index 0000000..06da221 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Client.dpr @@ -0,0 +1,17 @@ +program MessageEnvelopes_Client; + +uses + uROComInit, + Forms, + MessageEnvelopes_ClientMain in 'MessageEnvelopes_ClientMain.pas' {MessageEnvelopes_ClientMainForm}, + MessageEnvelopes_AddEnvelope in 'MessageEnvelopes_AddEnvelope.pas' {MessageEnvelopes_AddEnvelopeForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Message Envelopes Client'; + Application.CreateForm(TMessageEnvelopes_ClientMainForm, MessageEnvelopes_ClientMainForm); + Application.CreateForm(TMessageEnvelopes_AddEnvelopeForm, MessageEnvelopes_AddEnvelopeForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Client.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Client.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Client.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ClientMain.dfm new file mode 100644 index 0000000..ada7803 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ClientMain.dfm @@ -0,0 +1,224 @@ +object MessageEnvelopes_ClientMainForm: TMessageEnvelopes_ClientMainForm + Left = 513 + Top = 264 + Width = 389 + Height = 413 + BorderIcons = [biSystemMenu] + Caption = 'Message Envelopes Client' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 373 + Height = 153 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + DesignSize = ( + 373 + 153) + object Label1: TLabel + Left = 9 + Top = 11 + Width = 53 + Height = 13 + Caption = 'Envelopes:' + end + object bMoveDown: TButton + Left = 292 + Top = 128 + Width = 75 + Height = 22 + Action = aMoveDown + Anchors = [akTop, akRight] + TabOrder = 5 + end + object bMoveUp: TButton + Left = 292 + Top = 104 + Width = 75 + Height = 22 + Action = aMoveUp + Anchors = [akTop, akRight] + TabOrder = 4 + end + object bDelete: TButton + Left = 292 + Top = 80 + Width = 75 + Height = 22 + Action = aDelete + Anchors = [akTop, akRight] + TabOrder = 3 + end + object bUpdate: TButton + Left = 292 + Top = 56 + Width = 75 + Height = 22 + Action = aUpdate + Anchors = [akTop, akRight] + TabOrder = 2 + end + object bAdd: TButton + Left = 292 + Top = 32 + Width = 75 + Height = 22 + Action = aAdd + Anchors = [akTop, akRight] + TabOrder = 1 + end + object CheckListBox1: TCheckListBox + Left = 9 + Top = 32 + Width = 276 + Height = 118 + OnClickCheck = CheckListBox1ClickCheck + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 0 + end + end + object Panel2: TPanel + Left = 0 + Top = 217 + Width = 373 + Height = 160 + Align = alClient + BevelOuter = bvNone + TabOrder = 2 + DesignSize = ( + 373 + 160) + object bClearLog: TButton + Left = 292 + Top = 129 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'Clear Log' + TabOrder = 1 + OnClick = bClearLogClick + end + object Memo1: TMemo + Left = 9 + Top = 2 + Width = 275 + Height = 153 + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssVertical + TabOrder = 0 + end + end + object Panel3: TPanel + Left = 0 + Top = 153 + Width = 373 + Height = 64 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + DesignSize = ( + 373 + 64) + object Label2: TLabel + Left = 338 + Top = 42 + Width = 24 + Height = 13 + Caption = 'times' + end + object Edit1: TEdit + Left = 9 + Top = 11 + Width = 275 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Text = 'Test phrase' + end + object bTest: TButton + Left = 9 + Top = 37 + Width = 103 + Height = 22 + Caption = 'Run Test once' + TabOrder = 1 + OnClick = aTestExecute + end + object bRandomTest: TButton + Left = 117 + Top = 37 + Width = 167 + Height = 22 + Caption = 'Run test via random envelope' + TabOrder = 2 + OnClick = bRandomTestClick + end + object SpinEdit1: TSpinEdit + Left = 290 + Top = 37 + Width = 43 + Height = 22 + MaxValue = 999 + MinValue = 1 + TabOrder = 3 + Value = 5 + end + end + object ROMessage: TROBinMessage + Envelopes = <> + Left = 212 + Top = 40 + end + object ROChannel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + ServerLocators = <> + DispatchOptions = [] + Left = 184 + Top = 40 + end + object RORemoteService: TRORemoteService + Message = ROMessage + Channel = ROChannel + ServiceName = 'NewService' + Left = 240 + Top = 40 + end + object ActionList1: TActionList + Left = 152 + Top = 40 + object aAdd: TAction + Caption = 'Add' + OnExecute = bAddClick + end + object aUpdate: TAction + Caption = 'Update' + OnExecute = aUpdateExecute + OnUpdate = aDeleteUpdate + end + object aDelete: TAction + Caption = 'Delete' + OnExecute = aDeleteExecute + OnUpdate = aDeleteUpdate + end + object aMoveUp: TAction + Caption = 'Move Up' + OnExecute = aMoveUpExecute + OnUpdate = aMoveUpUpdate + end + object aMoveDown: TAction + Caption = 'Move Down' + OnExecute = aMoveDownExecute + OnUpdate = aMoveDownUpdate + end + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ClientMain.pas new file mode 100644 index 0000000..8d08783 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ClientMain.pas @@ -0,0 +1,228 @@ +unit MessageEnvelopes_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + ToolWin, ComCtrls, CheckLst, ExtCtrls, ActnList, uROEncryptionEnvelope, + Spin; + +type + TMessageEnvelopes_ClientMainForm = class(TForm) + ROMessage: TROBinMessage; + ROChannel: TROWinInetHTTPChannel; + RORemoteService: TRORemoteService; + ActionList1: TActionList; + aAdd: TAction; + aUpdate: TAction; + aDelete: TAction; + aMoveUp: TAction; + aMoveDown: TAction; + Panel1: TPanel; + bMoveDown: TButton; + bMoveUp: TButton; + bDelete: TButton; + bUpdate: TButton; + bAdd: TButton; + CheckListBox1: TCheckListBox; + Label1: TLabel; + Panel2: TPanel; + bClearLog: TButton; + Memo1: TMemo; + Panel3: TPanel; + Edit1: TEdit; + bTest: TButton; + bRandomTest: TButton; + SpinEdit1: TSpinEdit; + Label2: TLabel; + procedure bClearLogClick(Sender: TObject); + procedure aTestExecute(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure aDeleteExecute(Sender: TObject); + procedure aDeleteUpdate(Sender: TObject); + procedure CheckListBox1ClickCheck(Sender: TObject); + procedure aMoveUpUpdate(Sender: TObject); + procedure aMoveUpExecute(Sender: TObject); + procedure aMoveDownExecute(Sender: TObject); + procedure aMoveDownUpdate(Sender: TObject); + procedure bAddClick(Sender: TObject); + procedure aUpdateExecute(Sender: TObject); + procedure bRandomTestClick(Sender: TObject); + private + { Private declarations } + procedure Log(AStr: string); + procedure CreateAESEnvelope(AMarker, APass: String; AEnabled: Boolean); + procedure DoBeforeEnvelopeProcessed( + AMessageEnvelope: TROMessageEnvelope; AStream: TStream; + aMode: TROMessageEnvelopeMode; AMessage: IROMessage); + function GenerateString(AMessageEnvelope: TROAESEncryptionEnvelope): String; + public + { Public declarations } + end; + +var + MessageEnvelopes_ClientMainForm: TMessageEnvelopes_ClientMainForm; + +implementation + + +uses MessageEnvelopesLibrary_Intf, MessageEnvelopes_AddEnvelope, Math; + +{$R *.dfm} + +procedure TMessageEnvelopes_ClientMainForm.bClearLogClick(Sender: TObject); +begin + Memo1.Clear; +end; + +procedure TMessageEnvelopes_ClientMainForm.aTestExecute(Sender: TObject); +begin + if (RORemoteService as IMessageEnvelopesService).Echo(Edit1.Text) = Edit1.Text then + Log('Echo is OK!'); +end; + +procedure TMessageEnvelopes_ClientMainForm.Log(AStr: string); +begin + Memo1.Lines.Add(AStr); +end; + +procedure TMessageEnvelopes_ClientMainForm.FormCreate(Sender: TObject); +begin + CreateAESEnvelope('Marker A','Password A',True); + CheckListBox1.ItemIndex := 0; + CreateAESEnvelope('Marker B','Password B',False); + CreateAESEnvelope('Marker C','Password C',False); +end; + +procedure TMessageEnvelopes_ClientMainForm.CreateAESEnvelope(AMarker, APass: String; AEnabled: Boolean); +var + lEnv: TROAESEncryptionEnvelope; +begin + lEnv := TROAESEncryptionEnvelope.Create(nil); + with lEnv do begin + Password := APass; + EnvelopeMarker := AMarker; + BeforeEnvelopeProcessed := DoBeforeEnvelopeProcessed; + end; + with TROMessageEnvelopeItem(ROMessage.Envelopes.Add) do begin + Envelope := lEnv; + Enabled := AEnabled; + end; + CheckListBox1.AddItem(GenerateString(lEnv),lEnv); + CheckListBox1.Checked[CheckListBox1.Count-1]:=AEnabled; +end; + +procedure TMessageEnvelopes_ClientMainForm.aDeleteExecute(Sender: TObject); +var + lEnv: TROMessageEnvelope; +begin + lEnv := TROMessageEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + CheckListBox1.Items.Delete(CheckListBox1.ItemIndex); + ROMessage.Envelopes.Delete(ROMessage.Envelopes.ItemByEnvelope(lEnv).Index); + lEnv.Free; +end; + +procedure TMessageEnvelopes_ClientMainForm.aDeleteUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := CheckListBox1.ItemIndex <> -1; +end; + +procedure TMessageEnvelopes_ClientMainForm.CheckListBox1ClickCheck(Sender: TObject); +var + lEnv: TROMessageEnvelope; +begin + lEnv := TROMessageEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + ROMessage.Envelopes.ItemByEnvelope(lEnv).Enabled := CheckListBox1.Checked[CheckListBox1.ItemIndex]; +end; + +procedure TMessageEnvelopes_ClientMainForm.aMoveUpUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := (CheckListBox1.ItemIndex > 0); +end; + +procedure TMessageEnvelopes_ClientMainForm.aMoveUpExecute(Sender: TObject); +var + lEnv: TROMessageEnvelope; +begin + lEnv := TROMessageEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + with ROMessage.Envelopes.ItemByEnvelope(lEnv) do + Index := Index -1; + CheckListBox1.Items.Exchange(CheckListBox1.ItemIndex, CheckListBox1.ItemIndex-1); +end; + +procedure TMessageEnvelopes_ClientMainForm.aMoveDownExecute(Sender: TObject); +var + lEnv: TROMessageEnvelope; +begin + lEnv := TROMessageEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + with ROMessage.Envelopes.ItemByEnvelope(lEnv) do + Index := Index +1; + CheckListBox1.Items.Exchange(CheckListBox1.ItemIndex, CheckListBox1.ItemIndex+1); +end; + +procedure TMessageEnvelopes_ClientMainForm.aMoveDownUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := (CheckListBox1.ItemIndex <> -1) and (CheckListBox1.ItemIndex <> CheckListBox1.Count-1); +end; + +procedure TMessageEnvelopes_ClientMainForm.DoBeforeEnvelopeProcessed( + AMessageEnvelope: TROMessageEnvelope; AStream: TStream; + aMode: TROMessageEnvelopeMode; AMessage: IROMessage); +begin + case aMode of + memIncoming: Log(AMessageEnvelope.EnvelopeMarker+' : processing incoming message'); + memOutgoing: Log(AMessageEnvelope.EnvelopeMarker+' : processing outgoing message'); + end; +end; + +procedure TMessageEnvelopes_ClientMainForm.bAddClick(Sender: TObject); +var + lMarker, lPassword: string; +begin + lMarker := 'Marker '+ inttoStr(CheckListBox1.Count+1); + lPassword := 'Password '+ inttoStr(CheckListBox1.Count+1); + if AddAESEnvelope(lMarker,lPassword) then + CreateAESEnvelope(lMarker,lPassword,True); +end; + +procedure TMessageEnvelopes_ClientMainForm.aUpdateExecute(Sender: TObject); +var + lEnv: TROAESEncryptionEnvelope; + lMarker, lPassword: string; +begin + lEnv := TROAESEncryptionEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + lMarker :=lEnv.EnvelopeMarker; + lPassword := lEnv.Password; + if UpdateAESEnvelope(lMarker,lPassword) then begin + lEnv.EnvelopeMarker := lMarker; + lEnv.Password := lPassword; + CheckListBox1.Items[CheckListBox1.ItemIndex] := GenerateString(lEnv); + end; +end; + +procedure TMessageEnvelopes_ClientMainForm.bRandomTestClick(Sender: TObject); +var + i,j: integer; +begin + for j := 0 to SpinEdit1.Value -1 do begin + For i:= 0 to CheckListBox1.Count -1 do begin + CheckListBox1.Checked[i] := False; + ROMessage.Envelopes[i].Enabled := False; + end; + if CheckListBox1.Count > 0 then begin + i := RandomRange(0, CheckListBox1.Count-1); + CheckListBox1.Checked[i] := True; + ROMessage.Envelopes[i].Enabled := True; + aTestExecute(bTest); + end; + end; +end; + +function TMessageEnvelopes_ClientMainForm.GenerateString( + AMessageEnvelope: TROAESEncryptionEnvelope): String; +begin + Result := AMessageEnvelope.EnvelopeMarker + ' [ password = ''' + AMessageEnvelope.Password+''' ]' +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Server.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Server.dpr new file mode 100644 index 0000000..fa43e95 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Server.dpr @@ -0,0 +1,23 @@ +program MessageEnvelopes_Server; + +{#ROGEN:MessageEnvelopesLibrary.RODL} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + MessageEnvelopes_ServerMain in 'MessageEnvelopes_ServerMain.pas' {MessageEnvelopes_ServerMainForm}, + MessageEnvelopesLibrary_Intf in 'MessageEnvelopesLibrary_Intf.pas', + MessageEnvelopesLibrary_Invk in 'MessageEnvelopesLibrary_Invk.pas', + MessageEnvelopesService_Impl in 'MessageEnvelopesService_Impl.pas' {MessageEnvelopesService: TRORemoteDataModule}, + MessageEnvelopes_AddEnvelope in 'MessageEnvelopes_AddEnvelope.pas' {MessageEnvelopes_AddEnvelopeForm}; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'Message Envelopes Server'; + Application.CreateForm(TMessageEnvelopes_ServerMainForm, MessageEnvelopes_ServerMainForm); + Application.CreateForm(TMessageEnvelopes_AddEnvelopeForm, MessageEnvelopes_AddEnvelopeForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Server.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Server.res new file mode 100644 index 0000000..95e15d9 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_Server.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ServerMain.dfm new file mode 100644 index 0000000..40401e2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ServerMain.dfm @@ -0,0 +1,173 @@ +object MessageEnvelopes_ServerMainForm: TMessageEnvelopes_ServerMainForm + Left = 545 + Top = 360 + Width = 411 + Height = 407 + BorderIcons = [biSystemMenu] + Caption = 'Message Envelopes Server' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Panel2: TPanel + Left = 0 + Top = 153 + Width = 395 + Height = 218 + Align = alClient + BevelOuter = bvNone + TabOrder = 1 + DesignSize = ( + 395 + 218) + object bClearLog: TButton + Left = 314 + Top = 187 + Width = 75 + Height = 25 + Anchors = [akRight, akBottom] + Caption = 'Clear Log' + TabOrder = 0 + end + object Memo1: TMemo + Left = 9 + Top = 2 + Width = 297 + Height = 211 + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssVertical + TabOrder = 1 + end + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 395 + Height = 153 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + DesignSize = ( + 395 + 153) + object Label1: TLabel + Left = 9 + Top = 11 + Width = 53 + Height = 13 + Caption = 'Envelopes:' + end + object bMoveDown: TButton + Left = 314 + Top = 128 + Width = 75 + Height = 22 + Action = aMoveDown + Anchors = [akTop, akRight] + TabOrder = 5 + end + object bMoveUp: TButton + Left = 314 + Top = 104 + Width = 75 + Height = 22 + Action = aMoveUp + Anchors = [akTop, akRight] + TabOrder = 4 + end + object bDelete: TButton + Left = 314 + Top = 80 + Width = 75 + Height = 22 + Action = aDelete + Anchors = [akTop, akRight] + TabOrder = 3 + end + object bUpdate: TButton + Left = 314 + Top = 56 + Width = 75 + Height = 22 + Action = aUpdate + Anchors = [akTop, akRight] + TabOrder = 2 + end + object bAdd: TButton + Left = 314 + Top = 32 + Width = 75 + Height = 22 + Action = aAdd + Anchors = [akTop, akRight] + TabOrder = 1 + end + object CheckListBox1: TCheckListBox + Left = 9 + Top = 32 + Width = 298 + Height = 118 + OnClickCheck = CheckListBox1ClickCheck + Anchors = [akLeft, akTop, akRight] + ItemHeight = 13 + TabOrder = 0 + end + end + object ROMessage: TROBinMessage + Envelopes = <> + Left = 52 + Top = 96 + end + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 24 + Top = 96 + end + object ActionList1: TActionList + Left = 152 + Top = 40 + object aAdd: TAction + Caption = 'Add' + OnExecute = aAddExecute + end + object aUpdate: TAction + Caption = 'Update' + OnExecute = aUpdateExecute + OnUpdate = aUpdateUpdate + end + object aDelete: TAction + Caption = 'Delete' + OnExecute = aDeleteExecute + end + object aMoveUp: TAction + Caption = 'Move Up' + OnExecute = aMoveUpExecute + OnUpdate = aMoveUpUpdate + end + object aMoveDown: TAction + Caption = 'Move Down' + OnExecute = aMoveDownExecute + OnUpdate = aMoveDownUpdate + end + object aTest: TAction + Caption = 'Test' + end + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ServerMain.pas new file mode 100644 index 0000000..745e418 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/MessageEnvelopes_ServerMain.pas @@ -0,0 +1,229 @@ +unit MessageEnvelopes_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, uROIndyTCPServer, ActnList, CheckLst, + ExtCtrls, uROEncryptionEnvelope; + +const + WM_LOG_MESSAGE = WM_APP + 1; +type + TMessageEnvelopes_ServerMainForm = class(TForm) + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + ROMessage: TROBinMessage; + ROServer: TROIndyHTTPServer; + Panel2: TPanel; + bClearLog: TButton; + Memo1: TMemo; + Panel1: TPanel; + Label1: TLabel; + bMoveDown: TButton; + bMoveUp: TButton; + bDelete: TButton; + bUpdate: TButton; + bAdd: TButton; + CheckListBox1: TCheckListBox; + ActionList1: TActionList; + aAdd: TAction; + aUpdate: TAction; + aDelete: TAction; + aMoveUp: TAction; + aMoveDown: TAction; + aTest: TAction; + procedure FormCreate(Sender: TObject); + procedure aAddExecute(Sender: TObject); + procedure aUpdateExecute(Sender: TObject); + procedure aUpdateUpdate(Sender: TObject); + procedure aDeleteExecute(Sender: TObject); + procedure aMoveUpUpdate(Sender: TObject); + procedure aMoveUpExecute(Sender: TObject); + procedure aMoveDownUpdate(Sender: TObject); + procedure aMoveDownExecute(Sender: TObject); + procedure CheckListBox1ClickCheck(Sender: TObject); + private + { Private declarations } + protected + procedure WMLog(var Message: TMessage); message WM_LOG_MESSAGE; + procedure CreateAESEnvelope(AMarker, APass: String; AEnabled: Boolean); + procedure DoBeforeEnvelopeProcessed( + AMessageEnvelope: TROMessageEnvelope; AStream: TStream; + aMode: TROMessageEnvelopeMode; AMessage: IROMessage); + function GenerateString(AMessageEnvelope: TROAESEncryptionEnvelope): String; + public + { Public declarations } + Procedure Log(Astr: string); + end; + +var + MessageEnvelopes_ServerMainForm: TMessageEnvelopes_ServerMainForm; + +implementation + +uses + MessageEnvelopes_AddEnvelope; +{$R *.dfm} + +procedure TMessageEnvelopes_ServerMainForm.FormCreate(Sender: TObject); +begin + ROServer.Active := true; + CreateAESEnvelope('Marker A','Password A',True); + CheckListBox1.ItemIndex := 0; + CreateAESEnvelope('Marker B','Password B',False); + CreateAESEnvelope('Marker C','Password C',False); +end; + +procedure TMessageEnvelopes_ServerMainForm.aAddExecute(Sender: TObject); +var + lMarker, lPassword: string; +begin + lMarker := 'Marker '+ inttoStr(CheckListBox1.Count+1); + lPassword := 'Password '+ inttoStr(CheckListBox1.Count+1); + if AddAESEnvelope(lMarker,lPassword) then + CreateAESEnvelope(lMarker,lPassword,True); +end; + +procedure TMessageEnvelopes_ServerMainForm.aUpdateExecute(Sender: TObject); +var + lEnv: TROAESEncryptionEnvelope; + lMarker, lPassword: string; +begin + lEnv := TROAESEncryptionEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + lMarker :=lEnv.EnvelopeMarker; + lPassword := lEnv.Password; + if UpdateAESEnvelope(lMarker,lPassword) then begin + lEnv.EnvelopeMarker := lMarker; + lEnv.Password := lPassword; + CheckListBox1.Items[CheckListBox1.ItemIndex] := GenerateString(lEnv); + end; +end; + +procedure TMessageEnvelopes_ServerMainForm.aUpdateUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := CheckListBox1.ItemIndex <> -1; +end; + +procedure TMessageEnvelopes_ServerMainForm.aDeleteExecute(Sender: TObject); +var + lEnv: TROMessageEnvelope; +begin + lEnv := TROMessageEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + CheckListBox1.Items.Delete(CheckListBox1.ItemIndex); + ROMessage.Envelopes.Delete(ROMessage.Envelopes.ItemByEnvelope(lEnv).Index); + lEnv.Free; +end; + +procedure TMessageEnvelopes_ServerMainForm.aMoveUpUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := (CheckListBox1.ItemIndex > 0); +end; + +procedure TMessageEnvelopes_ServerMainForm.aMoveUpExecute(Sender: TObject); +var + lEnv: TROMessageEnvelope; +begin + lEnv := TROMessageEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + with ROMessage.Envelopes.ItemByEnvelope(lEnv) do + Index := Index -1; + CheckListBox1.Items.Exchange(CheckListBox1.ItemIndex, CheckListBox1.ItemIndex-1); +end; + +procedure TMessageEnvelopes_ServerMainForm.aMoveDownUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := (CheckListBox1.ItemIndex <> -1) and (CheckListBox1.ItemIndex <> CheckListBox1.Count-1); +end; + +procedure TMessageEnvelopes_ServerMainForm.aMoveDownExecute(Sender: TObject); +var + lEnv: TROMessageEnvelope; +begin + lEnv := TROMessageEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + with ROMessage.Envelopes.ItemByEnvelope(lEnv) do + Index := Index +1; + CheckListBox1.Items.Exchange(CheckListBox1.ItemIndex, CheckListBox1.ItemIndex+1); +end; + +procedure TMessageEnvelopes_ServerMainForm.Log(Astr: string); +var + p: pChar; +begin + if Application.Terminated then Exit; + + GetMem(p, (Length(Astr) + 1)*SizeOf(Char)); + Move(Astr[1], p^, (Length(Astr) + 1)*SizeOf(Char)); + PostMessage(Handle, WM_LOG_MESSAGE, 0, integer(p)); + + { Access to the VCL may only happen from within the main thread. To allow + Log to be called from within the Service implementattion, we must ensure + it's threadsafe. + + So instread of just addint the log message to the Memo, we'l send a + PostMessage to the window, which wil then later be handled within the + main thread. + + As a side benefit, the secution of the Log doe snot need to wait for this + logging to happen (as usage of, for example, Synchronize would require), + which will in turn make the server more respinsible for a simultaneous + calls. } +end; + +procedure TMessageEnvelopes_ServerMainForm.WMLog(var Message: TMessage); +var + p: pChar; +begin + try + p := pChar(Message.LParam); + Memo1.Lines.Add(p); + Freemem(p); + except + on E: Exception do + Memo1.Lines.Add(E.Classname + ': ' + E.Message); + end; +end; + +procedure TMessageEnvelopes_ServerMainForm.CreateAESEnvelope(AMarker, APass: String; + AEnabled: Boolean); +var + lEnv: TROAESEncryptionEnvelope; +begin + lEnv := TROAESEncryptionEnvelope.Create(nil); + with lEnv do begin + Password := APass; + EnvelopeMarker := AMarker; + BeforeEnvelopeProcessed := DoBeforeEnvelopeProcessed; + end; + with TROMessageEnvelopeItem(ROMessage.Envelopes.Add) do begin + Envelope := lEnv; + Enabled := AEnabled; + end; + CheckListBox1.AddItem(GenerateString(lEnv),lEnv); + CheckListBox1.Checked[CheckListBox1.Count-1]:=AEnabled; +end; + +procedure TMessageEnvelopes_ServerMainForm.DoBeforeEnvelopeProcessed( + AMessageEnvelope: TROMessageEnvelope; AStream: TStream; + aMode: TROMessageEnvelopeMode; AMessage: IROMessage); +begin + case aMode of + memIncoming: Log(AMessageEnvelope.EnvelopeMarker+' : processing incoming message'); + memOutgoing: Log(AMessageEnvelope.EnvelopeMarker+' : processing outgoing message'); + end; +end; + +procedure TMessageEnvelopes_ServerMainForm.CheckListBox1ClickCheck(Sender: TObject); +var + lEnv: TROMessageEnvelope; +begin + lEnv := TROMessageEnvelope(CheckListBox1.Items.Objects[CheckListBox1.ItemIndex]); + ROMessage.Envelopes.ItemByEnvelope(lEnv).Enabled := CheckListBox1.Checked[CheckListBox1.ItemIndex]; +end; + +function TMessageEnvelopes_ServerMainForm.GenerateString( + AMessageEnvelope: TROAESEncryptionEnvelope): String; +begin + Result := AMessageEnvelope.EnvelopeMarker + ' [ password = ''' + AMessageEnvelope.Password+''' ]' +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/RODLFILE.res new file mode 100644 index 0000000..3fa8bbf Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Message Envelopes/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.Sample.html new file mode 100644 index 0000000..098ee9f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.Sample.html @@ -0,0 +1,53 @@ + + + + + + + + + +

    + Multi Channel Sample +

    + + +

    Purpose

    + +

    + This example provides an introduction to using the Delphi edition of the RemObjects SDK product. + It shows how to use different channels to connect to the server application.
    + The following channels and servers are included: +

      +
    • TROWinMessageChannel / TROWinMessageServer
    • +
    • TRONamedPipeChannel / TRONamedPipeServer
    • +
    • TROWinInetHTTPChannel / TROIndyHTTPServer
    • +
    • TROIndyTCPChannel / TROIndyTCPServer
    • +
    • TROSuperTcpChannel / TROSuperTcpServer
    • +
    • TROIndySuperHttpChannel / TROIpSuperHttpServer
    • +
    • TROIndyUDPChannel / TROIndyUDPServer
    • +
    • TROIndyTCPChannel / TROBPDXTCPServer
    • +
    • TROWinInetHTTPChannel / TROBPDXHTTPServer
    • +
    • TROLocalChannel / TROLocalServer
    • +
    • TRODLLChannel
    • +
    + +

    + +

    Getting Started

    +
      +
    • Build or compile all projects.
    • +
    • Launch the server (via the menu option: RemObjects | Launch Server Executable).
    • +
    • Activate the server(s) you require.
    • +
    • Ensure that MultiChannel_Client is the selected project and run it.
    • +
    • Choose a server and test it.
    • +
    +

    Examine the Code

    +
      +
    • + See the code that changes the selected channel/server in MultiChannel_ClientMain.pas. +
    • +
    + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.bdsgroup new file mode 100644 index 0000000..b13f1a1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.bdsgroup @@ -0,0 +1,21 @@ + + + + + + + + + + + + + MultiChannel_Server.bdsproj + MultiChannel_DLLServer.bdsproj + MultiChannel_Client.bdsproj + MultiChannel_Server.exe MultiChannel_DLLServer.dll MultiChannel_Client.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.bpg new file mode 100644 index 0000000..cc87d7d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.bpg @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = MultiChannel_Server.exe MultiChannel_DLLServer.dll MultiChannel_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +MultiChannel_Server.exe: MultiChannel_Server.dpr + $(DCC) + +MultiChannel_Client.exe: MultiChannel_Client.dpr + $(DCC) + +MultiChannel_DLLServer.dll: MultiChannel_DLLServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.groupproj new file mode 100644 index 0000000..d3e81da --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel.groupproj @@ -0,0 +1,49 @@ + + + {3788f490-6c3b-412b-924c-ca4e290cbf69} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelLibrary.rodl new file mode 100644 index 0000000..71b3778 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelLibrary.rodl @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelLibrary_Intf.pas new file mode 100644 index 0000000..4729390 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelLibrary_Intf.pas @@ -0,0 +1,95 @@ +unit MultiChannelLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{60A753C4-1ED0-4385-AD64-B6B547D42BD5}'; + TargetNamespace = ''; + + { Service Interface ID's } + IMultiChannelService_IID : TGUID = '{DCA9C2C8-5CE4-4270-829D-503B0E9547B9}'; + + { Event ID's } + +type + { Forward declarations } + IMultiChannelService = interface; + + + { IMultiChannelService } + IMultiChannelService = interface + ['{DCA9C2C8-5CE4-4270-829D-503B0E9547B9}'] + function GetServerTime: DateTime; + end; + + { CoMultiChannelService } + CoMultiChannelService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IMultiChannelService; + end; + + { TMultiChannelService_Proxy } + TMultiChannelService_Proxy = class(TROProxy, IMultiChannelService) + protected + function __GetInterfaceName:string; override; + + function GetServerTime: DateTime; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoMultiChannelService } + +class function CoMultiChannelService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IMultiChannelService; +begin + result := TMultiChannelService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TMultiChannelService_Proxy } + +function TMultiChannelService_Proxy.__GetInterfaceName:string; +begin + result := 'MultiChannelService'; +end; + +function TMultiChannelService_Proxy.GetServerTime: DateTime; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'MultiChannelLibrary', __InterfaceName, 'GetServerTime'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DateTime), result, [paIsDateTime]); + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(IMultiChannelService_IID, TMultiChannelService_Proxy); + + +finalization + UnregisterProxyClass(IMultiChannelService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelLibrary_Invk.pas new file mode 100644 index 0000000..6de2033 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelLibrary_Invk.pas @@ -0,0 +1,54 @@ +unit MultiChannelLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} MultiChannelLibrary_Intf; + +type + {$M+} + TMultiChannelService_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + {$M-} + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TMultiChannelService_Invoker } + +procedure TMultiChannelService_Invoker.Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetServerTime: DateTime; } +var + lResult: DateTime; +begin + try + lResult := (__Instance as IMultiChannelService).GetServerTime; + + __Message.InitializeResponseMessage(__Transport, 'MultiChannelLibrary', 'MultiChannelService', 'GetServerTimeResponse'); + __Message.Write('Result', TypeInfo(DateTime), lResult, [paIsDateTime]); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + finally + end; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelService_Impl.pas new file mode 100644 index 0000000..ec076d7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannelService_Impl.pas @@ -0,0 +1,49 @@ +unit MultiChannelService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Generated:} MultiChannelLibrary_Intf; + +type + { TMultiChannelService } + TMultiChannelService = class(TRORemotable, IMultiChannelService) + private + protected + { IMultiChannelService methods } + function GetServerTime: DateTime; + end; + +implementation + +uses + {Generated:} MultiChannelLibrary_Invk; + +procedure Create_MultiChannelService(out anInstance: IUnknown); +begin + anInstance := TMultiChannelService.Create; +end; + +{ MultiChannelService } + +function TMultiChannelService.GetServerTime: DateTime; +begin + Result := Now; +end; + +initialization + TROClassFactory.Create('MultiChannelService', Create_MultiChannelService, TMultiChannelService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.bdsproj new file mode 100644 index 0000000..e08c4b6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MultiChannel_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.dpr new file mode 100644 index 0000000..2752a1f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.dpr @@ -0,0 +1,16 @@ +program MultiChannel_Client; + +uses + Forms, + MultiChannel_ClientMain in 'MultiChannel_ClientMain.pas' {MultiChannel_ClientMainForm}, + MultiChannel_ClientData in 'MultiChannel_ClientData.pas' {MultiChannel_ClientDataMain: TDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'MultiChannel - Client'; + Application.CreateForm(TMultiChannel_ClientDataMain, MultiChannel_ClientDataMain); + Application.CreateForm(TMultiChannel_ClientMainForm, MultiChannel_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.dproj new file mode 100644 index 0000000..47168bd --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.dproj @@ -0,0 +1,75 @@ + + + {c9e161f0-df30-424e-b087-976a9cda6727} + MultiChannel_Client.dpr + Debug + AnyCPU + DCC32 + MultiChannel_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MultiChannel_Client.dpr + + + + + + + MainSource + + +
    MultiChannel_ClientDataMain
    +
    + +
    MultiChannel_ClientMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Client.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientData.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientData.dfm new file mode 100644 index 0000000..403b473 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientData.dfm @@ -0,0 +1,22 @@ +object MultiChannel_ClientDataMain: TMultiChannel_ClientDataMain + OldCreateOrder = False + Left = 322 + Top = 227 + Height = 150 + Width = 215 + object LocalServer: TROLocalServer + Dispatchers = < + item + Name = 'BinMessage' + Message = BinMessage + Enabled = True + end> + Left = 41 + Top = 21 + end + object BinMessage: TROBinMessage + OnInitializeMessage = BinMessageInitializeMessage + Left = 38 + Top = 63 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientData.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientData.pas new file mode 100644 index 0000000..ae8009a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientData.pas @@ -0,0 +1,39 @@ +unit MultiChannel_ClientData; + +interface + +uses + SysUtils, Classes, uROClient, uROBinMessage, uROServer, uROLocalServer, uROClientIntf; + +type + TMultiChannel_ClientDataMain = class(TDataModule) + LocalServer: TROLocalServer; + BinMessage: TROBinMessage; + procedure BinMessageInitializeMessage(Sender: TROMessage; + const aTransport: IROTransport; const anInterfaceName, + aMessageName: string); + private + { Private declarations } + public + { Public declarations } + end; + +var + MultiChannel_ClientDataMain: TMultiChannel_ClientDataMain; + +implementation +uses MultiChannelService_Impl, MultiChannel_ClientMain; +{$R *.dfm} + +procedure TMultiChannel_ClientDataMain.BinMessageInitializeMessage( + Sender: TROMessage; const aTransport: IROTransport; + const anInterfaceName, aMessageName: string); +begin + MultiChannel_ClientMainForm.Log(''); + MultiChannel_ClientMainForm.Log('SERVER: Connect via ' + Tobject(aTransport.GetTransportObject).ClassName); + MultiChannel_ClientMainForm.Log('SERVER: ' + anInterfaceName + ':'#9 + StringReplace(aMessageName, 'Response', '', [])); + MultiChannel_ClientMainForm.Log(''); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientMain.dfm new file mode 100644 index 0000000..729a007 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientMain.dfm @@ -0,0 +1,167 @@ +object MultiChannel_ClientMainForm: TMultiChannel_ClientMainForm + Left = 301 + Top = 153 + AutoScroll = False + Caption = 'MultiChannel_ClientMainForm' + ClientHeight = 336 + ClientWidth = 384 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object Memo: TMemo + Left = 0 + Top = 148 + Width = 384 + Height = 188 + Align = alClient + ScrollBars = ssVertical + TabOrder = 0 + end + object Panel1: TPanel + Left = 0 + Top = 0 + Width = 384 + Height = 148 + Align = alTop + BevelOuter = bvNone + TabOrder = 1 + object GetServerTimeButton: TButton + Left = 7 + Top = 116 + Width = 104 + Height = 25 + Caption = 'GetServerTime' + TabOrder = 0 + OnClick = GetServerTimeButtonClick + end + object rgConnect: TRadioGroup + Left = 6 + Top = 5 + Width = 375 + Height = 105 + Caption = 'Connect to:' + Columns = 3 + ItemIndex = 0 + Items.Strings = ( + 'IndyHTTPServer' + 'BPDXHTTPServer' + 'SuperTcpServer' + 'IndyTCPServer' + 'BPDXTCPServer' + 'LocalServer' + 'IndyUDPServer' + 'NamedPipeServer' + 'WinMessageServer' + 'SuperHTTPServer' + 'DLLChannel') + TabOrder = 1 + end + end + object RemoteService: TRORemoteService + Message = BinMessage + ServiceName = 'MultiChannelService' + Left = 249 + Top = 276 + end + object BinMessage: TROBinMessage + Left = 248 + Top = 231 + end + object WinInetHTTPChannel: TROWinInetHTTPChannel + UserAgent = 'RemObjects SDK' + ServerLocators = <> + DispatchOptions = [] + Left = 30 + Top = 164 + end + object WinMessageChannel: TROWinMessageChannel + ServerID = '{30221B5E-6C56-4A91-A4E4-455BB3DA22B9}' + ServerLocators = <> + DispatchOptions = [] + Left = 86 + Top = 192 + end + object NamedPipeChannel: TRONamedPipeChannel + ServerID = 'MultiChannel_ServerMainForm_NamedPipeServer' + ServerName = '.' + ServerLocators = <> + DispatchOptions = [] + Left = 58 + Top = 192 + end + object DLLChannel: TRODLLChannel + DLLName = 'MultiChannel_DLLServer.dll' + ServerLocators = <> + DispatchOptions = [] + Left = 314 + Top = 257 + end + object LocalChannel: TROLocalChannel + ServerLocators = <> + DispatchOptions = [] + ServerChannel = MultiChannel_ClientDataMain.LocalServer + Left = 313 + Top = 216 + end + object IndyTCPChannel: TROIndyTCPChannel + ServerLocators = <> + DispatchOptions = [] + Port = 8090 + Host = '127.0.0.1' + Left = 58 + Top = 164 + end + object SuperTcpChannel: TROSuperTcpChannel + Host = 'localhost' + ServerLocators = <> + DispatchOptions = [] + Left = 30 + Top = 192 + end + object IndyUDPChannel: TROIndyUDPChannel + Retrys = 5 + IndyClient.Host = 'localhost' + IndyClient.Port = 8090 + Port = 8090 + Host = 'localhost' + ServerLocators = <> + DispatchOptions = [] + Left = 86 + Top = 164 + end + object IndySuperHttpChannel: TROIndySuperHttpChannel + Active = False + ClientWait.MaxLineAction = maException + ClientWait.ReadTimeout = 0 + ClientWait.AllowCookies = True + ClientWait.ProxyParams.BasicAuthentication = False + ClientWait.ProxyParams.ProxyPort = 0 + ClientWait.Request.ContentLength = -1 + ClientWait.Request.ContentRangeEnd = 0 + ClientWait.Request.ContentRangeStart = 0 + ClientWait.Request.ContentType = 'text/html' + ClientWait.Request.Accept = 'text/html, */*' + ClientWait.Request.BasicAuthentication = False + ClientWait.Request.UserAgent = 'RemObjects SDK' + ClientWait.HTTPOptions = [hoForceEncodeParams] + ClientRequest.MaxLineAction = maException + ClientRequest.ReadTimeout = 0 + ClientRequest.AllowCookies = True + ClientRequest.ProxyParams.BasicAuthentication = False + ClientRequest.ProxyParams.ProxyPort = 0 + ClientRequest.Request.ContentLength = -1 + ClientRequest.Request.ContentRangeEnd = 0 + ClientRequest.Request.ContentRangeStart = 0 + ClientRequest.Request.ContentType = 'text/html' + ClientRequest.Request.Accept = 'text/html, */*' + ClientRequest.Request.BasicAuthentication = False + ClientRequest.Request.UserAgent = 'RemObjects SDK' + ClientRequest.HTTPOptions = [hoForceEncodeParams] + Left = 114 + Top = 164 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientMain.pas new file mode 100644 index 0000000..3ba4eee --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ClientMain.pas @@ -0,0 +1,139 @@ +unit MultiChannel_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + StdCtrls, MultiChannelLibrary_Intf, MultiChannel_ClientData, SyncObjs, + uROIndyUDPChannel, uROSuperTCPChannel, uROIndyTCPChannel, + uROLocalChannel, uRODLLChannel, uRONamedPipeChannel, + uROWinMessageChannel, uROClient, uROWinInetHttpChannel, uROBinMessage, + uRORemoteService, ExtCtrls, uROBaseSuperHttpChannel, + uROIndySuperHttpChannel; + +type + TMultiChannel_ClientMainForm = class(TForm) + RemoteService: TRORemoteService; + BinMessage: TROBinMessage; + WinInetHTTPChannel: TROWinInetHTTPChannel; + WinMessageChannel: TROWinMessageChannel; + NamedPipeChannel: TRONamedPipeChannel; + DLLChannel: TRODLLChannel; + LocalChannel: TROLocalChannel; + IndyTCPChannel: TROIndyTCPChannel; + SuperTcpChannel: TROSuperTcpChannel; + IndyUDPChannel: TROIndyUDPChannel; + Memo: TMemo; + Panel1: TPanel; + GetServerTimeButton: TButton; + rgConnect: TRadioGroup; + IndySuperHttpChannel: TROIndySuperHttpChannel; + procedure GetServerTimeButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + private + CriticalSection: TCriticalSection; + function GetMultiChannelService: IMultiChannelService; + { Private declarations } + public + procedure Log(Astr: string); + { Public declarations } + end; + +var + MultiChannel_ClientMainForm: TMultiChannel_ClientMainForm; + +implementation + +{$R *.dfm} + +function TMultiChannel_ClientMainForm.GetMultiChannelService: IMultiChannelService; +const + atargetUrl = 'http://localhost:%d/BIN'; + aHost = '127.0.0.1'; +begin + case rgConnect.ItemIndex of + {IndyHTTPServer} 0: begin + RemoteService.Channel := WinInetHTTPChannel; + WinInetHTTPChannel.TargetURL := Format(atargetUrl, [8099]); + end; + {BPDXHTTPServer} 1: begin + RemoteService.Channel := WinInetHTTPChannel; + WinInetHTTPChannel.TargetURL := Format(atargetUrl, [8098]); + end; + {SuperTcpServer} 2: begin + RemoteService.Channel := SuperTcpChannel; + SuperTcpChannel.Host := aHost; + end; + {IndyTCPServer} 3: begin + RemoteService.Channel := IndyTCPChannel; + IndyTCPChannel.Host := aHost; + IndyTCPChannel.Port := 8090; + end; + {BPDXTCPServer} 4: begin + RemoteService.Channel := IndyTCPChannel; + IndyTCPChannel.Host := aHost; + IndyTCPChannel.Port := 8089; + end; + {LocalServer} 5: begin + RemoteService.Channel := LocalChannel; + end; + {IndyUDPServer} 6: begin + RemoteService.Channel := IndyUDPChannel; + IndyUDPChannel.Host := aHost; + IndyUDPChannel.Port := 8090; + end; + {NamedPipeServer} 7: begin + RemoteService.Channel := NamedPipeChannel; + end; + {WinMessageServer} 8: begin + RemoteService.Channel := WinMessageChannel; + end; + {SuperHTTPServer} 9: begin + RemoteService.Channel := IndySuperHttpChannel; + IndySuperHttpChannel.TargetURL := Format(atargetUrl, [8094]); + end; + else + {DLLChannel} + RemoteService.Channel := DLLChannel; + end; + + RemoteService.Message := BinMessage; + Result := RemoteService as IMultiChannelService; +end; + +procedure TMultiChannel_ClientMainForm.GetServerTimeButtonClick( + Sender: TObject); +var + srv: IMultiChannelService; +begin + srv := GetMultiChannelService; + Log('use ' + RemoteService.Channel.Name); + Log('GetServerTime'); + Log('-------------'); + Log('Receiving:'#9 + DateTimeToStr(srv.GetServerTime)); + Log(''); +end; + +procedure TMultiChannel_ClientMainForm.Log(Astr: string); +begin + CriticalSection.Enter; + try + Memo.Lines.Add(Astr); + finally + CriticalSection.Leave; + end; +end; + +procedure TMultiChannel_ClientMainForm.FormCreate(Sender: TObject); +begin + CriticalSection := TCriticalSection.Create; +end; + +procedure TMultiChannel_ClientMainForm.FormDestroy(Sender: TObject); +begin + CriticalSection.Free; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.bdsproj new file mode 100644 index 0000000..cbeccf8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MultiChannel_DLLServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.dpr new file mode 100644 index 0000000..d6f53fc --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.dpr @@ -0,0 +1,33 @@ +library MultiChannel_DLLServer; + +{#ROGEN:MultiChannelLibrary.rodl} // RemObjects: Careful, do not remove! +{$R RODLFile.res} +{$R *.res} + +uses + Windows, + uRODLLServer, + uROBinMessage, + MultiChannelLibrary_Intf in 'MultiChannelLibrary_Intf.pas', + MultiChannelLibrary_Invk in 'MultiChannelLibrary_Invk.pas', + MultiChannelService_Impl in 'MultiChannelService_Impl.pas'; + +var BINMessage : TROBINMessage; + +procedure ROProc(Reason:integer); +begin + case Reason of + DLL_PROCESS_ATTACH: begin + BINMessage := TROBINMessage.Create(NIL); + RegisterMessage(BINMessage); + end; + DLL_PROCESS_DETACH: begin + BINMessage.Free; + end; + end +end; + +begin + DLLProc:=@ROProc; + ROProc(DLL_PROCESS_ATTACH) + end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.dproj new file mode 100644 index 0000000..fcd0858 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.dproj @@ -0,0 +1,72 @@ + + + {adbefef6-fc25-4d38-b90a-93262644f71e} + MultiChannel_DLLServer.dpr + Debug + AnyCPU + DCC32 + MultiChannel_DLLServer.dll + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MultiChannel_DLLServer.dpr + + + + + + + MainSource + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.res new file mode 100644 index 0000000..08ba56e Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_DLLServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.bdsproj new file mode 100644 index 0000000..d2b55cb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + MultiChannel_Server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.dpr new file mode 100644 index 0000000..12d5046 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.dpr @@ -0,0 +1,20 @@ +program MultiChannel_Server; + +uses + Forms, + MultiChannel_ServerMain in 'MultiChannel_ServerMain.pas' {MultiChannel_ServerMainForm}, + MultiChannelLibrary_Intf in 'MultiChannelLibrary_Intf.pas', + MultiChannelLibrary_Invk in 'MultiChannelLibrary_Invk.pas', + MultiChannelService_Impl in 'MultiChannelService_Impl.pas'; + +{#ROGEN:MultiChannelLibrary.rodl} // RemObjects: Careful, do not remove! +{$R RODLFile.res} +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'MultiChannel - Server'; + Application.CreateForm(TMultiChannel_ServerMainForm, MultiChannel_ServerMainForm); + Application.Run; +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.dproj new file mode 100644 index 0000000..78be504 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.dproj @@ -0,0 +1,75 @@ + + + {afd44946-8e31-4a11-adce-eecf8dfa9da7} + MultiChannel_Server.dpr + Debug + AnyCPU + DCC32 + MultiChannel_Server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + MultiChannel_Server.dpr + + + + + + + MainSource + + + + + +
    MultiChannel_ServerMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.res new file mode 100644 index 0000000..b0dd731 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_Server.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ServerMain.dfm new file mode 100644 index 0000000..81a23bc --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ServerMain.dfm @@ -0,0 +1,269 @@ +object MultiChannel_ServerMainForm: TMultiChannel_ServerMainForm + Left = 331 + Top = 214 + AutoScroll = False + Caption = 'MultiChannel_ServerMainForm' + ClientHeight = 295 + ClientWidth = 386 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 96 + Top = 3 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object Memo: TMemo + Left = 0 + Top = 128 + Width = 386 + Height = 166 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + ScrollBars = ssVertical + TabOrder = 9 + end + object cbIndyHTTPServer: TCheckBox + Left = 7 + Top = 57 + Width = 120 + Height = 17 + Caption = 'IndyHTTPServer' + TabOrder = 0 + OnClick = cbIndyHTTPServerClick + end + object cbBPDXHttpServer: TCheckBox + Left = 7 + Top = 74 + Width = 120 + Height = 17 + Caption = 'BPDXHttpServer' + TabOrder = 1 + OnClick = cbBPDXHttpServerClick + end + object cbSuperTcpServer: TCheckBox + Left = 7 + Top = 91 + Width = 120 + Height = 17 + Caption = 'SuperTcpServer' + TabOrder = 2 + OnClick = cbSuperTcpServerClick + end + object cbIndyTcpServer: TCheckBox + Left = 129 + Top = 57 + Width = 120 + Height = 17 + Caption = 'IndyTcpServer' + TabOrder = 3 + OnClick = cbIndyTcpServerClick + end + object cbBPDXTcpServer: TCheckBox + Left = 129 + Top = 74 + Width = 120 + Height = 17 + Caption = 'BPDXTcpServer' + TabOrder = 4 + OnClick = cbBPDXTcpServerClick + end + object cbIndyUdpServer: TCheckBox + Left = 129 + Top = 91 + Width = 120 + Height = 17 + Caption = 'IndyUdpServer' + TabOrder = 5 + OnClick = cbIndyUdpServerClick + end + object cbNamedPipeServer: TCheckBox + Left = 250 + Top = 57 + Width = 120 + Height = 17 + Caption = 'NamedPipeServer' + TabOrder = 6 + OnClick = cbNamedPipeServerClick + end + object cbWinMessageServer: TCheckBox + Left = 250 + Top = 74 + Width = 120 + Height = 17 + Caption = 'WinMessageServer' + TabOrder = 7 + OnClick = cbWinMessageServerClick + end + object ErrorMemo: TMemo + Left = 0 + Top = 111 + Width = 386 + Height = 201 + Alignment = taCenter + Anchors = [akLeft, akTop, akRight, akBottom] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -25 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + Lines.Strings = ( + '' + '' + 'Please activate ' + 'at least one server!') + ParentFont = False + TabOrder = 10 + end + object cbSuperHttpServer: TCheckBox + Left = 250 + Top = 91 + Width = 120 + Height = 17 + Caption = 'SuperHttpServer' + TabOrder = 8 + OnClick = cbSuperHttpServerClick + end + object ROBinMessage: TROBinMessage + OnInitializeMessage = ROBinMessageInitializeMessage + Left = 330 + Top = 243 + end + object WinMessageServer: TROWinMessageServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + end> + OnWriteToStream = stub + OnReadFromStream = stub + ServerID = '{30221B5E-6C56-4A91-A4E4-455BB3DA22B9}' + Left = 266 + Top = 192 + end + object NamedPipeServer: TRONamedPipeServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + end> + ServerID = 'MultiChannel_ServerMainForm_NamedPipeServer' + Left = 265 + Top = 148 + end + object IndyHTTPServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8099 + Left = 15 + Top = 139 + end + object IndyTCPServer: TROIndyTCPServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + end> + Port = 8090 + Left = 144 + Top = 144 + end + object SuperTcpServer: TROSuperTcpServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + end> + Left = 30 + Top = 189 + end + object IndyUDPServer: TROIndyUDPServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + end> + IndyUDPServer.Bindings = <> + IndyUDPServer.DefaultPort = 8090 + Port = 8090 + Left = 154 + Top = 194 + end + object BPDXTCPServer: TROBPDXTCPServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + end> + BPDXServer.ReleaseDate = '2002-09-01' + BPDXServer.ListenerThreadPriority = tpIdle + BPDXServer.SpawnedThreadPriority = tpIdle + BPDXServer.Suspend = False + BPDXServer.UseSSL = False + BPDXServer.UseThreadPool = False + BPDXServer.ServerPort = 8089 + BPDXServer.ProtocolToBind = wpTCPOnly + BPDXServer.SocketOutputBufferSize = bsfNormal + BPDXServer.ServerType = stThreadBlocking + BPDXServer.ThreadCacheSize = 10 + Port = 8089 + Left = 171 + Top = 145 + end + object BPDXHTTPServer: TROBPDXHTTPServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + PathInfo = 'Bin' + end> + BPDXServer.ReleaseDate = '2002-09-01' + BPDXServer.ListenerThreadPriority = tpIdle + BPDXServer.SpawnedThreadPriority = tpIdle + BPDXServer.Suspend = False + BPDXServer.UseSSL = False + BPDXServer.UseThreadPool = False + BPDXServer.ServerPort = 8098 + BPDXServer.ProtocolToBind = wpTCPOnly + BPDXServer.SocketOutputBufferSize = bsfNormal + BPDXServer.ServerType = stThreadBlocking + BPDXServer.ThreadCacheSize = 10 + BPDXServer.Timeout = 50000 + BPDXServer.SupportKeepAlive = False + Port = 8098 + SupportKeepAlive = False + Left = 42 + Top = 139 + end + object SuperHttpServer: TROIpSuperHttpServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + PathInfo = 'Bin' + end> + Port = 8094 + ServerName = 'RemObjects SDK Super IpHttp Server for Delphi' + Left = 328 + Top = 152 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ServerMain.pas new file mode 100644 index 0000000..e67d2d9 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Multi Channel/MultiChannel_ServerMain.pas @@ -0,0 +1,194 @@ +unit MultiChannel_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + uROClientIntf, SyncObjs, uROBPDXHTTPServer, uROBPDXTCPServer, + uROIndyUDPServer, uROSuperTCPServer, uROIndyTCPServer, uROIndyHTTPServer, + uRONamedPipeServer, uROClient, uROServer, uROWinMessageServer, + uROBinMessage, StdCtrls, uROPoweredByRemObjectsButton, + uROBaseSuperHttpServer, uROIpSuperHttpServer; + +type + TMultiChannel_ServerMainForm = class(TForm) + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + ROBinMessage: TROBinMessage; + WinMessageServer: TROWinMessageServer; + NamedPipeServer: TRONamedPipeServer; + IndyHTTPServer: TROIndyHTTPServer; + IndyTCPServer: TROIndyTCPServer; + SuperTcpServer: TROSuperTcpServer; + IndyUDPServer: TROIndyUDPServer; + BPDXTCPServer: TROBPDXTCPServer; + BPDXHTTPServer: TROBPDXHTTPServer; + Memo: TMemo; + cbIndyHTTPServer: TCheckBox; + cbBPDXHttpServer: TCheckBox; + cbSuperTcpServer: TCheckBox; + cbIndyTcpServer: TCheckBox; + cbBPDXTcpServer: TCheckBox; + cbIndyUdpServer: TCheckBox; + cbNamedPipeServer: TCheckBox; + cbWinMessageServer: TCheckBox; + ErrorMemo: TMemo; + SuperHttpServer: TROIpSuperHttpServer; + cbSuperHttpServer: TCheckBox; + procedure ROBinMessageInitializeMessage(Sender: TROMessage; + const aTransport: IROTransport; const anInterfaceName, + aMessageName: string); + procedure stub(aStream: TStream); + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure cbIndyHTTPServerClick(Sender: TObject); + procedure cbBPDXHttpServerClick(Sender: TObject); + procedure cbSuperTcpServerClick(Sender: TObject); + procedure cbIndyTcpServerClick(Sender: TObject); + procedure cbBPDXTcpServerClick(Sender: TObject); + procedure cbLocalServerClick(Sender: TObject); + procedure cbIndyUdpServerClick(Sender: TObject); + procedure cbNamedPipeServerClick(Sender: TObject); + procedure cbWinMessageServerClick(Sender: TObject); + procedure EmailServerException(aSender: TObject; + aExceptionClass: TClass; const aExceptionMessage: string); + procedure cbSuperHttpServerClick(Sender: TObject); + private + { Private declarations } + CriticalSection: tCriticalSection; + procedure ActivateServer(Server: TROServer; Mode: Boolean); + public + procedure Log(Astr: string); + { Public declarations } + end; + +var + MultiChannel_ServerMainForm: TMultiChannel_ServerMainForm; + +implementation +uses Dialogs; +{$R *.dfm} + +procedure TMultiChannel_ServerMainForm.Log(Astr: string); +begin + CriticalSection.Enter; + try + Memo.Lines.Add(Astr); + finally + CriticalSection.Leave; + end; +end; + +procedure TMultiChannel_ServerMainForm.ROBinMessageInitializeMessage( + Sender: TROMessage; const aTransport: IROTransport; + const anInterfaceName, aMessageName: string); +begin + Log('Connect via ' + Tobject(aTransport.GetTransportObject).ClassName); + Log(anInterfaceName + ':'#9 + StringReplace(aMessageName, 'Response', '', [])); + Log(''); +end; + +procedure TMultiChannel_ServerMainForm.stub(aStream: TStream); +begin + // stub for prevention of a error +end; + +procedure TMultiChannel_ServerMainForm.FormCreate(Sender: TObject); +begin + CriticalSection := TCriticalSection.Create; +end; + +procedure TMultiChannel_ServerMainForm.FormDestroy(Sender: TObject); +begin + CriticalSection.Free; +end; + +procedure TMultiChannel_ServerMainForm.cbIndyHTTPServerClick( + Sender: TObject); +begin + ActivateServer(IndyHTTPServer, TCheckBox(Sender).Checked); +end; + +procedure TMultiChannel_ServerMainForm.cbBPDXHttpServerClick( + Sender: TObject); +begin + ActivateServer(BPDXHttpServer, TCheckBox(Sender).Checked); +end; + +procedure TMultiChannel_ServerMainForm.cbSuperTcpServerClick( + Sender: TObject); +begin + ActivateServer(SuperTcpServer, TCheckBox(Sender).Checked); +end; + +procedure TMultiChannel_ServerMainForm.cbIndyTcpServerClick( + Sender: TObject); +begin + ActivateServer(IndyTcpServer, TCheckBox(Sender).Checked); +end; + +procedure TMultiChannel_ServerMainForm.cbBPDXTcpServerClick( + Sender: TObject); +begin + ActivateServer(BPDXTcpServer, TCheckBox(Sender).Checked); +end; + +procedure TMultiChannel_ServerMainForm.cbLocalServerClick(Sender: TObject); +begin + Log('This server can be tested only on client side.') +end; + +procedure TMultiChannel_ServerMainForm.cbIndyUdpServerClick( + Sender: TObject); +begin + ActivateServer(IndyUdpServer, TCheckBox(Sender).Checked); +end; + +procedure TMultiChannel_ServerMainForm.cbNamedPipeServerClick( + Sender: TObject); +begin + ActivateServer(NamedPipeServer, TCheckBox(Sender).Checked); +end; + +procedure TMultiChannel_ServerMainForm.cbWinMessageServerClick( + Sender: TObject); +begin + ActivateServer(WinMessageServer, TCheckBox(Sender).Checked); +end; + +procedure TMultiChannel_ServerMainForm.ActivateServer(Server: TROServer; + Mode: Boolean); +begin + Server.Active := Mode; + Memo.Visible := + WinMessageServer.Active or + NamedPipeServer.Active or + IndyHTTPServer.Active or + IndyTCPServer.Active or + SuperTcpServer.Active or + IndyUDPServer.Active or + BPDXTCPServer.Active or + BPDXHTTPServer.Active or + SuperHTTPServer.Active; + ErrorMemo.Visible := not Memo.Visible; + if Server.Active then + Log(Server.Name + ' is activated!') + else + Log(Server.Name + ' is deactivated!'); + Log(''); +end; + +procedure TMultiChannel_ServerMainForm.EmailServerException( + aSender: TObject; aExceptionClass: TClass; + const aExceptionMessage: string); +begin + ShowMessage('There was a problem in the Email Server Thread:'#13#13 + aExceptionClass.ClassName + ': ' + aExceptionMessage); +end; + +procedure TMultiChannel_ServerMainForm.cbSuperHttpServerClick( + Sender: TObject); +begin + ActivateServer(SuperHttpServer, TCheckBox(Sender).Checked); +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.Sample.html new file mode 100644 index 0000000..13caf4e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.Sample.html @@ -0,0 +1,28 @@ + + + + + + + + + +

    + Proxy Server Sample +

    + + +

    Purpose

    + +

    This example shows how to create a proxy server to redirect the calls to another + server without having to recreate the RODL file, thus allowing the use of the same types of the original server.
    +This provides total control. As every call will pass from the proxy class before going to the real server, you can even stop methods from being dispatched any further.

    + +

    +ProxyServer_ProxyServer_Impl was created by simply copying the original MainService_Impl.pas file, renaming the TMainService class to TProxyService followed by implementing a bypass for all the method calls. This class is basically a server which accesses a RemObjects SDK server as a client would do. +

    +

    Getting Started

    +Launch both servers and run the client.
    +The client allows you to select either server. When you execute a method using the Proxy Server, you will see both servers log the call. + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.bdsgroup new file mode 100644 index 0000000..adffb7a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.bdsgroup @@ -0,0 +1,21 @@ + + + + + + + + + + + + + ProxyServer_MainServer.bdsproj + ProxyServer_Client.bdsproj + ProxyServer_ProxyServer.bdsproj + ProxyServer_MainServer.exe ProxyServer_Client.exe ProxyServer_ProxyServer.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.bpg new file mode 100644 index 0000000..10a7447 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.bpg @@ -0,0 +1,26 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = ProxyServer_MainServer.exe ProxyServer_Client.exe ProxyServer_ProxyServer.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +ProxyServer_MainServer.exe: ProxyServer_MainServer.dpr + $(DCC) + +ProxyServer_Client.exe: ProxyServer_Client.dpr + $(DCC) + +ProxyServer_ProxyServer.exe: ProxyServer_ProxyServer.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.groupproj new file mode 100644 index 0000000..c758a07 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer.groupproj @@ -0,0 +1,49 @@ + + + {908dd4fb-64f2-4f8b-b627-9f3ff95b8990} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainLibrary.rodl new file mode 100644 index 0000000..f891a62 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainLibrary.rodl @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainLibrary_Intf.pas new file mode 100644 index 0000000..9b4dcf1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainLibrary_Intf.pas @@ -0,0 +1,194 @@ +unit ProxyServerMainLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{00B1E82E-7479-4679-AB2F-4D18228C6F44}'; + + { Service Interface ID's } + IProxyServerMainService_IID : TGUID = '{00B1E82E-7479-4679-AB2F-4D18228C6F44}'; + + { Event ID's } + +type + { Forward declarations } + IProxyServerMainService = interface; + + TestStruct = class; + + + { TestStruct } + TestStruct = class(TROComplexType) + private + fName: String; + fIntNumber: Integer; + public + procedure Assign(iSource: TPersistent); override; + published + property Name:String read fName write fName; + property IntNumber:Integer read fIntNumber write fIntNumber; + end; + + { TestStructCollection } + TestStructCollection = class(TROCollection) + protected + constructor Create(aItemClass: TCollectionItemClass); overload; + function GetItems(Index: integer): TestStruct; + procedure SetItems(Index: integer; const Value: TestStruct); + public + constructor Create; overload; + function Add: TestStruct; reintroduce; + property Items[Index: integer]:TestStruct read GetItems write SetItems; default; + end; + + { IProxyServerMainService } + IProxyServerMainService = interface + ['{00B1E82E-7479-4679-AB2F-4D18228C6F44}'] + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + function EchoStruct(const aTestStruct: TestStruct): TestStruct; + end; + + { CoProxyServerMainService } + CoProxyServerMainService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IProxyServerMainService; + end; + + { TProxyServerMainService_Proxy } + TProxyServerMainService_Proxy = class(TROProxy, IProxyServerMainService) + protected + function __GetInterfaceName:string; override; + + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + function EchoStruct(const aTestStruct: TestStruct): TestStruct; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ TestStruct } + +procedure TestStruct.Assign(iSource: TPersistent); +var lSource:TestStruct; +begin + inherited Assign(iSource); + if (iSource is TestStruct) then begin + lSource := TestStruct(iSource); + Name := lSource.Name; + IntNumber := lSource.IntNumber; + end; +end; + +{ TestStructCollection } +constructor TestStructCollection.Create; +begin + inherited Create(TestStruct); +end; + +constructor TestStructCollection.Create(aItemClass: TCollectionItemClass); +begin + inherited Create(aItemClass); +end; + +function TestStructCollection.Add: TestStruct; +begin + result := TestStruct(inherited Add); +end; + +function TestStructCollection.GetItems(Index: integer): TestStruct; +begin + result := TestStruct(inherited Items[Index]); +end; + +procedure TestStructCollection.SetItems(Index: integer; const Value: TestStruct); +begin + TestStruct(inherited Items[Index]).Assign(Value); +end; + +{ CoProxyServerMainService } + +class function CoProxyServerMainService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IProxyServerMainService; +begin + result := TProxyServerMainService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TProxyServerMainService_Proxy } + +function TProxyServerMainService_Proxy.__GetInterfaceName:string; +begin + result := 'ProxyServerMainService'; +end; + +function TProxyServerMainService_Proxy.Sum(const A: Integer; const B: Integer): Integer; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ProxyServerMainLibrary', __InterfaceName, 'Sum'); + __Message.Write('A', TypeInfo(Integer), A, []); + __Message.Write('B', TypeInfo(Integer), B, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Integer), result, []); + finally + __Message.FreeStream; + end +end; + +function TProxyServerMainService_Proxy.GetServerTime: DateTime; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'ProxyServerMainLibrary', __InterfaceName, 'GetServerTime'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DateTime), result, [paIsDateTime]); + finally + __Message.FreeStream; + end +end; + +function TProxyServerMainService_Proxy.EchoStruct(const aTestStruct: TestStruct): TestStruct; +begin + try + result := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'ProxyServerMainLibrary', __InterfaceName, 'EchoStruct'); + __Message.Write('aTestStruct', TypeInfo(ProxyServerMainLibrary_Intf.TestStruct), aTestStruct, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(ProxyServerMainLibrary_Intf.TestStruct), result, []); + finally + __Message.FreeStream; + end +end; + +initialization + RegisterROClass(TestStruct); + RegisterProxyClass(IProxyServerMainService_IID, TProxyServerMainService_Proxy); + + +finalization + UnregisterROClass(TestStruct); + UnregisterProxyClass(IProxyServerMainService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainLibrary_Invk.pas new file mode 100644 index 0000000..9ba0915 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainLibrary_Invk.pas @@ -0,0 +1,101 @@ +unit ProxyServerMainLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} ProxyServerMainLibrary_Intf; + +type + TProxyServerMainService_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_EchoStruct(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TProxyServerMainService_Invoker } + +procedure TProxyServerMainService_Invoker.Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Sum(const A: Integer; const B: Integer): Integer; } +var + A: Integer; + B: Integer; + lResult: Integer; +begin + try + __Message.Read('A', TypeInfo(Integer), A, []); + __Message.Read('B', TypeInfo(Integer), B, []); + + lResult := (__Instance as IProxyServerMainService).Sum(A, B); + + __Message.InitializeResponseMessage(__Transport, 'ProxyServerMainLibrary', 'ProxyServerMainService', 'SumResponse'); + __Message.Write('Result', TypeInfo(Integer), lResult, []); + __Message.Finalize; + + finally + end; +end; + +procedure TProxyServerMainService_Invoker.Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetServerTime: DateTime; } +var + lResult: DateTime; +begin + try + lResult := (__Instance as IProxyServerMainService).GetServerTime; + + __Message.InitializeResponseMessage(__Transport, 'ProxyServerMainLibrary', 'ProxyServerMainService', 'GetServerTimeResponse'); + __Message.Write('Result', TypeInfo(DateTime), lResult, [paIsDateTime]); + __Message.Finalize; + + finally + end; +end; + +procedure TProxyServerMainService_Invoker.Invoke_EchoStruct(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function EchoStruct(const aTestStruct: TestStruct): TestStruct; } +var + aTestStruct: ProxyServerMainLibrary_Intf.TestStruct; + lResult: ProxyServerMainLibrary_Intf.TestStruct; + __lObjectDisposer: TROObjectDisposer; +begin + aTestStruct := nil; + lResult := nil; + try + __Message.Read('aTestStruct', TypeInfo(ProxyServerMainLibrary_Intf.TestStruct), aTestStruct, []); + + lResult := (__Instance as IProxyServerMainService).EchoStruct(aTestStruct); + + __Message.InitializeResponseMessage(__Transport, 'ProxyServerMainLibrary', 'ProxyServerMainService', 'EchoStructResponse'); + __Message.Write('Result', TypeInfo(ProxyServerMainLibrary_Intf.TestStruct), lResult, []); + __Message.Finalize; + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(aTestStruct); + __lObjectDisposer.Add(lResult); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainService_Impl.pas new file mode 100644 index 0000000..43bd3a8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServerMainService_Impl.pas @@ -0,0 +1,63 @@ +unit ProxyServerMainService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Generated:} ProxyServerMainLibrary_Intf; + +type + { TProxyServerMainService } + TProxyServerMainService = class(TRORemotable, IProxyServerMainService) + private + protected + { IProxyServerMainService methods } + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + function EchoStruct(const aTestStruct: TestStruct): TestStruct; + end; + +implementation + +uses + {Generated:} ProxyServerMainLibrary_Invk; + +procedure Create_ProxyServerMainService(out anInstance: IUnknown); +begin + anInstance := TProxyServerMainService.Create; +end; + +{ ProxyServerMainService } + +function TProxyServerMainService.Sum(const A: Integer; const B: Integer): Integer; +begin + result := A + B; +end; + +function TProxyServerMainService.GetServerTime: DateTime; +begin + result := Now; +end; + +function TProxyServerMainService.EchoStruct(const aTestStruct: TestStruct): TestStruct; +begin + result := TestStruct.Create; + result.Name := aTestStruct.Name; + result.IntNumber := aTestStruct.IntNumber; +end; + +initialization + TROClassFactory.Create('ProxyServerMainService', Create_ProxyServerMainService, TProxyServerMainService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.bdsproj new file mode 100644 index 0000000..d54685a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ProxyServer_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.dpr new file mode 100644 index 0000000..82dca25 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.dpr @@ -0,0 +1,14 @@ +program ProxyServer_Client; + +uses + Forms, + ProxyServer_Client_Main in 'ProxyServer_Client_Main.pas' {ProxyServer_Client_MainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'ProxyServer - Client'; + Application.CreateForm(TProxyServer_Client_MainForm, ProxyServer_Client_MainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.dproj new file mode 100644 index 0000000..005b284 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.dproj @@ -0,0 +1,72 @@ + + + {40192763-adee-47c0-a56b-982934cc7c3f} + ProxyServer_Client.dpr + Debug + AnyCPU + DCC32 + ProxyServer_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ProxyServer_Client.dpr + + + + + + + MainSource + + +
    ProxyServer_Client_MainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.res new file mode 100644 index 0000000..fb3116f Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client_Main.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client_Main.dfm new file mode 100644 index 0000000..912eba6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client_Main.dfm @@ -0,0 +1,81 @@ +object ProxyServer_Client_MainForm: TProxyServer_Client_MainForm + Left = 127 + Top = 126 + Width = 209 + Height = 188 + Caption = 'ProxyServer - Client' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 9 + Top = 12 + Width = 36 + Height = 13 + Caption = 'Server:' + end + object cbServer: TComboBox + Left = 49 + Top = 8 + Width = 145 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + ItemIndex = 0 + TabOrder = 0 + Text = 'Main Server' + Items.Strings = ( + 'Main Server' + 'Proxy Server') + end + object SumButton: TButton + Left = 46 + Top = 56 + Width = 109 + Height = 25 + Caption = 'Sum(1,2)' + TabOrder = 1 + OnClick = SumButtonClick + end + object GetServerTimeButton: TButton + Left = 46 + Top = 88 + Width = 109 + Height = 25 + Caption = 'GetServerTime' + TabOrder = 2 + OnClick = GetServerTimeButtonClick + end + object EchoStructButton: TButton + Left = 46 + Top = 120 + Width = 109 + Height = 25 + Caption = 'EchoStruct' + TabOrder = 3 + OnClick = EchoStructButtonClick + end + object ROBINMessage: TROBinMessage + Left = 8 + Top = 40 + end + object ROIndyTCPChannel: TROIndyTCPChannel + ServerLocators = <> + DispatchOptions = [] + Port = 8090 + Host = '127.0.0.1' + Left = 40 + Top = 40 + end + object ROWinMessageChannel: TROWinMessageChannel + ServerLocators = <> + DispatchOptions = [] + ServerID = '{F5B38440-F071-45B8-AF67-1023F20C179D}' + Delay = 50 + Left = 40 + Top = 72 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client_Main.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client_Main.pas new file mode 100644 index 0000000..fb18fd2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_Client_Main.pas @@ -0,0 +1,72 @@ +unit ProxyServer_Client_Main; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, uROIndyTCPChannel, + uROClient, uROBINMessage, ProxyServerMainLibrary_Intf, uROWinMessageChannel; + +type + TProxyServer_Client_MainForm = class(TForm) + ROBINMessage: TROBINMessage; + ROIndyTCPChannel: TROIndyTCPChannel; + Label1: TLabel; + cbServer: TComboBox; + SumButton: TButton; + GetServerTimeButton: TButton; + EchoStructButton: TButton; + ROWinMessageChannel: TROWinMessageChannel; + procedure SumButtonClick(Sender: TObject); + procedure GetServerTimeButtonClick(Sender: TObject); + procedure EchoStructButtonClick(Sender: TObject); + private + function CreateService: IProxyServerMainService; + public + + end; + +var + ProxyServer_Client_MainForm: TProxyServer_Client_MainForm; + +implementation + +{$R *.dfm} + +function TProxyServer_Client_MainForm.CreateService: IProxyServerMainService; +begin + if cbServer.ItemIndex = 0 then + result := CoProxyServerMainService.Create(ROBINMessage, ROIndyTCPChannel) // TCP over main one + else + result := CoProxyServerMainService.Create(ROBINMessage, ROWinMessageChannel) // Windows messages to proxy +end; + +procedure TProxyServer_Client_MainForm.SumButtonClick(Sender: TObject); +begin + ShowMessage('Result is ' + IntToStr(CreateService.Sum(1, 2))); +end; + +procedure TProxyServer_Client_MainForm.GetServerTimeButtonClick(Sender: TObject); +begin + ShowMessage('Time is ' + DateTimeToStr(CreateService.GetServerTime)); +end; + +procedure TProxyServer_Client_MainForm.EchoStructButtonClick(Sender: TObject); +var + out_struct, in_struct: TestStruct; +begin + in_struct := nil; + out_struct := TestStruct.Create; + out_struct.Name := 'Dave Fuller'; + out_struct.IntNumber := 666; + try + in_struct := CreateService.EchoStruct(out_struct); + ShowMessage(out_struct.Name + ', ' + IntToStr(out_struct.IntNumber)); + finally + if in_struct <> nil then in_struct.Free; + out_struct.Free; + end; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.bdsproj new file mode 100644 index 0000000..9ae271b --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ProxyServer_MainServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.dpr new file mode 100644 index 0000000..e009288 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.dpr @@ -0,0 +1,20 @@ +program ProxyServer_MainServer; + +{#ROGEN:ProxyServerMainLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + Forms, + ProxyServer_MainServer_Main in 'ProxyServer_MainServer_Main.pas' {ProxyServer_MainServer_MainForm}, + ProxyServerMainLibrary_Intf in 'ProxyServerMainLibrary_Intf.pas', + ProxyServerMainLibrary_Invk in 'ProxyServerMainLibrary_Invk.pas', + ProxyServerMainService_Impl in 'ProxyServerMainService_Impl.pas'; + +{$R *.RES} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'ProxyServer - Main Server'; + Application.CreateForm(TProxyServer_MainServer_MainForm, ProxyServer_MainServer_MainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.dproj new file mode 100644 index 0000000..c362725 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.dproj @@ -0,0 +1,75 @@ + + + {6d2f01cb-292f-4613-bb90-73f9c18e9b28} + ProxyServer_MainServer.dpr + Debug + AnyCPU + DCC32 + ProxyServer_MainServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ProxyServer_MainServer.dpr + + + + + + + MainSource + + + + + +
    ProxyServer_MainServer_MainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.res new file mode 100644 index 0000000..53aa370 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer_Main.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer_Main.dfm new file mode 100644 index 0000000..cc88fa8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer_Main.dfm @@ -0,0 +1,38 @@ +object ProxyServer_MainServer_MainForm: TProxyServer_MainServer_MainForm + Left = 202 + Top = 241 + Width = 232 + Height = 109 + Caption = 'ProxyServer - Main Server' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Memo: TMemo + Left = 0 + Top = 0 + Width = 224 + Height = 76 + Align = alClient + TabOrder = 0 + end + object ROMessage: TROBinMessage + Left = 88 + Top = 8 + end + object ROServer: TROIndyTCPServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + end> + OnReadFromStream = ROServerReadFromStream + Port = 8090 + Left = 56 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer_Main.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer_Main.pas new file mode 100644 index 0000000..f32fb8b --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_MainServer_Main.pas @@ -0,0 +1,42 @@ +unit ProxyServer_MainServer_Main; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, uROClient, uROBINMessage, uROClientIntf, uROServer, uROIndyTCPServer; + +type + TProxyServer_MainServer_MainForm = class(TForm) + ROMessage: TROBINMessage; + ROServer: TROIndyTCPServer; + Memo: TMemo; + procedure FormCreate(Sender: TObject); + procedure ROServerReadFromStream(aStream: TStream); + private + + protected + + public + + end; + +var + ProxyServer_MainServer_MainForm: TProxyServer_MainServer_MainForm; + +implementation + + +{$R *.DFM} + +procedure TProxyServer_MainServer_MainForm.FormCreate(Sender: TObject); +begin + ROServer.Active := TRUE; +end; + +procedure TProxyServer_MainServer_MainForm.ROServerReadFromStream(aStream: TStream); +begin + Memo.Lines.Add('Request arrived...') +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.bdsproj new file mode 100644 index 0000000..1b26556 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ProxyServer_ProxyServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.dpr new file mode 100644 index 0000000..4e2e858 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.dpr @@ -0,0 +1,15 @@ +program ProxyServer_ProxyServer; + +uses + Forms, + ProxyServer_ProxyServer_Main in 'ProxyServer_ProxyServer_Main.pas' {ProxyServer_ProxyServer_MainForm}, + ProxyServer_ProxyServer_Impl in 'ProxyServer_ProxyServer_Impl.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'ProxyServer - Proxy Server'; + Application.CreateForm(TProxyServer_ProxyServer_MainForm, ProxyServer_ProxyServer_MainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.dproj new file mode 100644 index 0000000..e9f7ec9 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.dproj @@ -0,0 +1,73 @@ + + + {9099b695-4d6f-4abe-8cc9-ee7cb8b02ae4} + ProxyServer_ProxyServer.dpr + Debug + AnyCPU + DCC32 + ProxyServer_ProxyServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ProxyServer_ProxyServer.dpr + + + + + + + MainSource + + + +
    ProxyServer_ProxyServer_MainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.res new file mode 100644 index 0000000..53aa370 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer_Impl.pas new file mode 100644 index 0000000..1aa4be7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer_Impl.pas @@ -0,0 +1,110 @@ +unit ProxyServer_ProxyServer_Impl; + +{ This example shows how to create a proxy server to redirect the calls to another + server without having to recreate the RODL file, thus allowing the use of the same types + of the original server. + + In order to create this kind of proxy server you need to: + + 1) start a **blank** project (without any RODL, since we want to use that of the original server) and + add the server and message components that the proxy will use to listen to requests. + !!! See the unit fProxyServerForm.pas and the DPR of this project. There's no RODL referenced in it. + + 2) Link the two components via a standard dispatcher item like you would normally do. + + 3) Create a new TRORemotable unit like this exact file you are looking at + + 4) Done! + + This unit was created by simply copying the original MainService_Impl.pas file, + renaming the TMainService class to TProxyService followed by implementing a bypass for all + the method calls. This class is basically a server which accesses a RO server as a client would do. + + There are other possible solutions to the proxy dilemma. This one though provides + more control over everything. Specifically, since every call will pass from the proxy class before + going to the real server, you can stop methods from being dispatched any further. + + Enjoy! +} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, + {Generated:} ProxyServerMainLibrary_Intf, + + uROIndyTCPChannel, uROClient, uROBINMessage; + +type + TProxyService = class(TRORemotable, IProxyServerMainService) + private + fTCPChannel: TROIndyTCPChannel; + fBINMessage: TROBINMessage; + + function CreateService: IProxyServerMainService; + + protected + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + function EchoStruct(const aTestStruct: TestStruct): TestStruct; + + public + constructor Create; override; + destructor Destroy; override; + + end; + +implementation + +uses + {Generated:} ProxyServerMainLibrary_Invk, SysUtils; + +procedure Create_ProxyService(out anInstance: IUnknown); +begin + anInstance := TProxyService.Create; +end; + +constructor TProxyService.Create; +begin + inherited; + + fTCPChannel := TROIndyTCPChannel.Create(nil); + fBINMessage := TROBINMessage.Create(nil); +end; + +destructor TProxyService.Destroy; +begin + fTCPChannel.Free; + fBINMessage.Free; + + inherited; +end; + +function TProxyService.CreateService: IProxyServerMainService; +begin + result := CoProxyServerMainService.Create(fBINMessage, fTCPChannel); +end; + +function TProxyService.Sum(const A: Integer; const B: Integer): Integer; +begin + result := CreateService.Sum(A, B) +end; + +function TProxyService.GetServerTime: DateTime; +begin + result := CreateService.GetServerTime +end; + +function TProxyService.EchoStruct(const aTestStruct: TestStruct): TestStruct; +begin + result := CreateService.EchoStruct(aTestStruct) +end; + +initialization + TROClassFactory.Create('ProxyServerMainService', Create_ProxyService, TProxyServerMainService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer_Main.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer_Main.dfm new file mode 100644 index 0000000..f92cc99 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer_Main.dfm @@ -0,0 +1,37 @@ +object ProxyServer_ProxyServer_MainForm: TProxyServer_ProxyServer_MainForm + Left = 177 + Top = 117 + Width = 290 + Height = 120 + Caption = 'ProxyServer - Proxy Server' + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Memo: TMemo + Left = 0 + Top = 0 + Width = 282 + Height = 87 + Align = alClient + TabOrder = 0 + end + object ROWinMessageServer: TROWinMessageServer + Dispatchers = < + item + Name = 'ROBINMessage1' + Message = ROBINMessage1 + Enabled = True + end> + OnReadFromStream = ROWinMessageServerReadFromStream + ServerID = '{F5B38440-F071-45B8-AF67-1023F20C179D}' + Left = 72 + Top = 32 + end + object ROBINMessage1: TROBinMessage + Left = 104 + Top = 32 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer_Main.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer_Main.pas new file mode 100644 index 0000000..25532ab --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/ProxyServer_ProxyServer_Main.pas @@ -0,0 +1,40 @@ +unit ProxyServer_ProxyServer_Main; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uROServer, uROWinMessageServer, + uROIndyTCPChannel, uROClient, uROBINMessage, StdCtrls; + +type + TProxyServer_ProxyServer_MainForm = class(TForm) + ROWinMessageServer: TROWinMessageServer; + ROBINMessage1: TROBINMessage; + Memo: TMemo; + procedure FormCreate(Sender: TObject); + procedure ROWinMessageServerReadFromStream(aStream: TStream); + private + { Private declarations } + public + { Public declarations } + end; + +var + ProxyServer_ProxyServer_MainForm: TProxyServer_ProxyServer_MainForm; + +implementation + +{$R *.dfm} + +procedure TProxyServer_ProxyServer_MainForm.FormCreate(Sender: TObject); +begin + ROWinMessageServer.Active := TRUE; +end; + +procedure TProxyServer_ProxyServer_MainForm.ROWinMessageServerReadFromStream(aStream: TStream); +begin + Memo.Lines.Add('Request arrived...') +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/RODLFILE.res new file mode 100644 index 0000000..e313b96 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Proxy Server/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Samples.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Samples.html new file mode 100644 index 0000000..b5ef964 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Samples.html @@ -0,0 +1,392 @@ + + + + + + + + + +

    + RemObjects SDK Samples for Delphi +

    +

    + Please keep the following things in mind when working with the samples: +

    +
      +
    • +To help you find the sample you need and also to provide a suggested start order, +the samples are listed in one or more categories followed by the actual sample descriptions +in alphabetical order. 
    • +
    • There may be samples shipped that are not listed below. +Samples are not added to the list until they have passed our final quality inspection. +This doesn't mean they are faulty, only that they are still pending final inspection.
    • +
    + +

    + Getting Started

    +Most of the samples provide a project group containing server and client projects. +The standard procedure for testing these is as follows: +
      +
    • Build or compile both projects.
    • +
    • Ensure that the server is the current project. Note: if there is + only one RemObjects SDK server contained within the project group, this step is + not needed because the next step will still work even if the lient is the current + project. 
    • Launch the server (IDE menu: RemObjects | Launch Server Executable).
    • +
    • Examine the server window. Some samples require that you activate one or more channels.
    • +
    • Make the client the current project.
    • +
    • Run the client.
    • +
    +Having tested the sample, next examine the services provided. Do this by examining the RODL +via the Service Builder tool provided: +
      +
    • Ensure that the server is the current project.
    • +
    • Open the Service Builder (IDE menu: RemObjects | Edit Service Library).
    • +
    +

    + Sample Categories

    +
      +
    • Some samples are shown below in more than one category.
    • +
    • The Dynamic Request,  RODL and Named Pipe samples do not ship with + the trial version of the RemObjects SDK. +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Category

    Samples

    Introduction +

    First Sample

    +

    Multi Channel

    +

    Super TCP Channel Chat

    +

    RODL (not shipped with the trial version)

    +

    Async

    +

    Auto Server

    +

    Dynamic Request (not shipped with the trial version) 

    +

    Session Types

    +

    + Time Server +

    +
    Channels +

    MegaDemo

    +

    Multi Channel

    +

    Super TCP Channel Chat

    +

    HTTP Chat

    +

    Named Pipes (not shipped with the trial version)

    +
    Intermediate +

    Arrays

    +

    + Broadcast Chat +

    +

    Extended File Transfer

    +

    Named Pipes (not shipped with the trial version)

    +

    Service Discovery

    +

    Variants

    +
    Architecture +

    Session Types

    +

    + Class Factories +

    +

    FPC Server

    +

    + DataSnap +

    +

    Dispatch Notifier

    +

    Auto Server

    +

    Multi Channel

    +

    Proxy Server

    +
    Advanced +

    Class Factories

    +

    COM

    +

    Dispatch Notifier

    +

    Proxy Server

    +
    + + +

    + Sample Descriptions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameCategoryDescription
    + Arrays + Intermediate + This sample shows how to use TROArray for presentating DB tables in a master/detail + relationship.
    AsyncIntroductionThis sample shows how to call methods on a RemObjects SDK server asynchronously.
    +There may be times where you want to submit a request for information and defer receiving the result +until a bit later. A very simple calculation (Sum) is performed, +but this has a built in ten second delay so that it is possible to query the +server before the calculation is completed.
    +
    Auto ServerIntroduction
    Architecture
    This sample shows how a client can control its server when they are both running locally. +This is useful if you want to provide a simple standard alone solution which is easily +upgraded to multi-tier (or you might want to provide both options). +
    Broadcast ChatIntermediate + This example shows how to use the TROBroadcastServer and TROBroadcastChannel + channels to write an UDP broadcasting chat program.
    Class FactoriesArchitecture
    Advanced
    + This example shows how to use a Class Factory to generate three + types of server:
      +
    • Singleton: all clients access a single server object.
    • +
    • Single Call: server instances are created on demand and destroyed + after processing the method call.
    • +
    • Pooled: multiple server instances are accessible by clients. This + works exactly the same as Singleton, unless the first server instance is busy.
    +

    + Note: to test this sample properly, you need to run at least two + clients. +

    +
    COMAdvanced + This sample shows how to call an existing RemObjects SDK server using COM.
    DataSnapArchitecture + Standard example of the use of the TRODataSnapModule and TRODataSnapConnection + components.
    Dispatch NotifierArchitecture
    Advanced
    + This example shows how to customize message dispatching. IRODispatchNotifier + is a special interface that TROInvoker classes know and look for. +
    + If your server side object implements it, the IRODispatchNotifier.GetDispatchInfo + method will be called before the target method is invoked.
    Dynamic Request
    + (not shipped with the trial version)
    Introduction + This example shows how to use the TRODynamicRequest component to execute + server methods.
    Extended File TransferIntermediate + This example shows how to transfer files to and from a RemObjects SDK Server in + chunks and how to monitor new files via server events. Note: needs at least two + clients open. File(s) uploaded from one client are downloaded to the other(s).
    First SampleIntroduction +This sample provides an introduction to using the Delphi edition of the RemObjects SDK product. +The example shows how to define/implement methods on the server and how to access them from the client. +The data consists of name information and four simple methods are provided by the +service: Nicknames, VerifyName, CheckName and FullNames. +
    + FPC Server + Architecture +
    HTTP ChatChannels + This shows how to use polled events to create an HTTP based chat program. +
    + The clients poll every few seconds for new messages and the server distributes the + messages to the appropriate client(s).
    MegaDemoChannelsThis comprehensive example illustrates many of the features of the RemObjects SDK by +providing benchmark facilities for the various protocols and + channels supported. +
    Multi ChannelIntroduction
    Channels
    Architecture
    This example provides an introduction to using the Delphi edition of the RemObjects SDK product. +It shows how to use different channels to connect to the server application. +
    Named Pipes +
    + (not shipped with the trial version)
    Channels
    Intermediate
    This example shows the use of a named pipe connection. +It creates a named pipe server as a Windows service. +
    Proxy ServerArchitecture
    Advanced
    This example shows how to create a proxy server to redirect the calls to another + server without having to recreate the RODL file, thus allowing the use of the same types + of the original server.
    +This provides total control. As every call will pass from the proxy class before going to the real server, +you can even stop methods from being dispatched any further. +
    RODL
    + (not shipped with the trial version)
    Introduction + <to follow>
    Service DiscoveryIntermediateThis sample illustrates how to use the TRODiscoveryClient and + TRODiscoveryServer components. +
    +Each instance of the application acts both as a server and as a client. +For the server, you can modify the list of services supported on the right-hand side, while for the client you can enter a service name and get a list of the servers available on your LAN to support it. +
    Session Types
    +
    Architecture
    Introduction
    + This example shows the use of sessions and illustrates several SessionManagers: TROEventSessionManager, +
    + TROInMemorySessionManager,
    + TROMasterServerSessionManager
    and +
    + TRODBSessionManager. +
    + Important note: this sample needs a "Sessions" table to be created in one of your databases. + By default, the sample looks for the Sessions table in MSSQL's Northwind Database, + but you can easily change to connect to any other database. +
    +Super TCP Channel ChatIntroduction
    Channels
    + This sample shows how the Super TCP Channel can be used to create + a chat server and clients. +
    + Unlike the HTTP Chat sample, this sample doesn't poll the server + but sends events back to clients directly. +
    Time ServerIntroduction + This is an extremely basic sample illustrating how to use the TROBroadcastServer + and TROBroadcastChannel components.
    VariantsIntermediate + This example shows how the RemObjects SDK can transfer variants + and array of variants from the client and server using the + TROBinMessage and TROSOAPMessage message types.
    +
    + +

    + Support

    +

    + If you encounter any problems or have questions regarding the samples, please feel + free to ask on our newsgroup at + news://news.remobjects.com/remobjects.public.sdk.delphi. +

    +

    + Thank you very much,
    + Your RemObjects Team
    + http://www.remobjects.com +

    + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/RODLFILE.res new file mode 100644 index 0000000..4b9eb58 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.Sample.html new file mode 100644 index 0000000..460f40e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.Sample.html @@ -0,0 +1,27 @@ + + + + + + + + + +

    + Service Discovery +

    + +
    +

    Purpose

    +

    + This sample illustrates how to use the TRODiscoveryClient and TRODiscoveryServer components.
    +

    +

    + Each instance of the application acts both as a server and as a client.
    + For the server, you can modify the list of services supported on the right-hand side, + while for the client you can enter a service name and get a list of the servers available on your LAN to support it. +

    + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.bdsproj new file mode 100644 index 0000000..807740c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + ServiceDiscovery.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.dpr new file mode 100644 index 0000000..1385bb3 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.dpr @@ -0,0 +1,14 @@ +program ServiceDiscovery; + +uses + Forms, + ServiceDiscoveryMain in 'ServiceDiscoveryMain.pas' {ServiceDiscoveryMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Service Discovery Sample'; + Application.CreateForm(TServiceDiscoveryMainForm, ServiceDiscoveryMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.dproj new file mode 100644 index 0000000..858c3be --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.dproj @@ -0,0 +1,72 @@ + + + {f03be2e9-512e-4df7-9a1e-ea0b0d926a40} + ServiceDiscovery.dpr + Debug + AnyCPU + DCC32 + ServiceDiscovery.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + ServiceDiscovery.dpr + + + + + + + MainSource + + +
    ServiceDiscoveryMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.res new file mode 100644 index 0000000..0f940ed Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscovery.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscoveryMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscoveryMain.dfm new file mode 100644 index 0000000..64fbad2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscoveryMain.dfm @@ -0,0 +1,246 @@ +object ServiceDiscoveryMainForm: TServiceDiscoveryMainForm + Left = 275 + Top = 222 + BorderIcons = [biSystemMenu] + BorderStyle = bsSingle + BorderWidth = 5 + Caption = 'RemObjects SDK Discovery Sample' + ClientHeight = 376 + ClientWidth = 583 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 0 + Top = 0 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object GroupBox1: TGroupBox + Left = 0 + Top = 52 + Width = 289 + Height = 270 + Anchors = [akLeft, akTop, akRight, akBottom] + Caption = ' Client ' + TabOrder = 0 + DesignSize = ( + 289 + 270) + object Label1: TLabel + Left = 11 + Top = 16 + Width = 80 + Height = 13 + Caption = 'Look for service:' + end + object Label2: TLabel + Left = 11 + Top = 88 + Width = 74 + Height = 13 + Caption = 'Found Servers:' + end + object ed_ServiceName: TEdit + Left = 8 + Top = 29 + Width = 273 + Height = 21 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + Text = 'IRODiscoveryService' + end + object btn_LookupService: TBitBtn + Left = 8 + Top = 56 + Width = 273 + Height = 25 + Action = ac_DiscoverServers + Anchors = [akLeft, akTop, akRight] + Caption = 'Discover Servers' + TabOrder = 1 + end + object lb_Servers: TListBox + Left = 8 + Top = 101 + Width = 273 + Height = 160 + Anchors = [akLeft, akTop, akRight, akBottom] + ItemHeight = 13 + TabOrder = 2 + end + end + object GroupBox2: TGroupBox + Left = 296 + Top = 52 + Width = 287 + Height = 270 + Anchors = [akLeft, akTop, akRight, akBottom] + Caption = ' Server ' + TabOrder = 1 + DesignSize = ( + 287 + 270) + object Label3: TLabel + Left = 11 + Top = 16 + Width = 240 + Height = 13 + Caption = 'List of Services supported by this server instance:' + end + object ed_Services: TMemo + Left = 8 + Top = 29 + Width = 271 + Height = 174 + Anchors = [akLeft, akTop, akRight, akBottom] + Lines.Strings = ( + 'SomeService' + 'SomeOtherService') + TabOrder = 0 + OnChange = btn_UpdateServiceListClick + end + object Panel1: TPanel + Left = 8 + Top = 225 + Width = 273 + Height = 37 + Anchors = [akLeft, akBottom] + BevelOuter = bvLowered + Color = clInfoBk + TabOrder = 1 + object Label4: TLabel + Left = 6 + Top = 5 + Width = 250 + Height = 26 + Caption = + 'Enter names representing the services you want to simulate as be' + + 'ing supported on this server instance.' + WordWrap = True + end + end + object cb_SupportRegisteredServerClasses: TCheckBox + Left = 8 + Top = 205 + Width = 209 + Height = 17 + Anchors = [akLeft, akBottom] + Caption = 'List registered RO Servers as supported' + Checked = True + State = cbChecked + TabOrder = 2 + OnClick = cb_SupportRegisteredServerClassesClick + end + end + object GroupBox3: TGroupBox + Left = 0 + Top = 326 + Width = 585 + Height = 48 + Anchors = [akLeft, akBottom] + Caption = ' Custom Discovery Options: Load' + TabOrder = 2 + object Label5: TLabel + Left = 304 + Top = 20 + Width = 111 + Height = 13 + Caption = 'Simulated Server Load:' + end + object Label6: TLabel + Left = 8 + Top = 20 + Width = 148 + Height = 13 + Caption = 'Find a Server with Load below:' + end + object ed_ServerLoad: TEdit + Left = 418 + Top = 17 + Width = 63 + Height = 21 + TabOrder = 0 + Text = '50' + end + object ed_MaxLoad: TEdit + Left = 160 + Top = 17 + Width = 63 + Height = 21 + TabOrder = 1 + Text = '75' + end + object cb_ReturnInfo: TCheckBox + Left = 496 + Top = 19 + Width = 81 + Height = 17 + Caption = 'Return Info' + Checked = True + State = cbChecked + TabOrder = 2 + end + end + object ROBroadcastServer: TROBroadcastServer + Active = True + Dispatchers = < + item + Name = 'ROBINMessage_Server' + Message = ROBINMessage_Server + Enabled = True + end> + IndyUDPServer.BroadcastEnabled = True + IndyUDPServer.Bindings = <> + IndyUDPServer.DefaultPort = 8090 + IndyUDPServer.ThreadedEvent = True + Port = 8090 + Left = 400 + Top = 24 + end + object ROBroadcastChannel: TROBroadcastChannel + ServerLocators = <> + DispatchOptions = [] + Retrys = 5 + IndyClient.BroadcastEnabled = True + IndyClient.Port = 8090 + Port = 8090 + Left = 215 + Top = 25 + end + object RODiscoveryClient: TRODiscoveryClient + Channel = ROBroadcastChannel + Message = ROBINMessage_Client + ServiceName = 'SomeService' + OnNewServersFound = RODiscoveryClientNewServersFound + OnNewServiceFound = RODiscoveryClientNewServiceFound + Left = 272 + Top = 25 + end + object RODiscoveryServer: TRODiscoveryServer + OnServiceFound = RODiscoveryServerServiceFound + Left = 456 + Top = 24 + end + object ROBINMessage_Server: TROBinMessage + Left = 428 + Top = 24 + end + object ROBINMessage_Client: TROBinMessage + Left = 244 + Top = 25 + end + object ActionList: TActionList + OnUpdate = ActionListUpdate + Left = 520 + Top = 24 + object ac_DiscoverServers: TAction + Caption = 'Discover Servers' + OnExecute = btn_LookupServiceClick + end + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscoveryMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscoveryMain.pas new file mode 100644 index 0000000..8a66d1e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Service Discovery/ServiceDiscoveryMain.pas @@ -0,0 +1,179 @@ +unit ServiceDiscoveryMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uROClient, uROBINMessage, uRODiscovery, + uROIndyUDPChannel, uROBroadcastChannel, uROServer, + uROIndyUDPServer, uROBroadcastServer, StdCtrls, ExtCtrls, Buttons, + uROPoweredByRemObjectsButton, uRODiscovery_Intf, ActnList; + +type + TServiceDiscoveryMainForm = class(TForm) + ROBroadcastServer: TROBroadcastServer; + ROBroadcastChannel: TROBroadcastChannel; + RODiscoveryClient: TRODiscoveryClient; + RODiscoveryServer: TRODiscoveryServer; + GroupBox1: TGroupBox; + Label1: TLabel; + ed_ServiceName: TEdit; + btn_LookupService: TBitBtn; + lb_Servers: TListBox; + Label2: TLabel; + GroupBox2: TGroupBox; + Label3: TLabel; + ed_Services: TMemo; + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + ROBINMessage_Server: TROBINMessage; + ROBINMessage_Client: TROBINMessage; + Panel1: TPanel; + Label4: TLabel; + cb_SupportRegisteredServerClasses: TCheckBox; + GroupBox3: TGroupBox; + ed_ServerLoad: TEdit; + Label5: TLabel; + Label6: TLabel; + ed_MaxLoad: TEdit; + ActionList: TActionList; + ac_DiscoverServers: TAction; + cb_ReturnInfo: TCheckBox; + procedure FormCreate(Sender: TObject); + procedure btn_UpdateServiceListClick(Sender: TObject); + procedure btn_LookupServiceClick(Sender: TObject); + procedure cb_SupportRegisteredServerClassesClick(Sender: TObject); + procedure ActionListUpdate(Action: TBasicAction; + var Handled: Boolean); + procedure RODiscoveryClientNewServiceFound(aSender: TObject; + aName: String; aDiscoveryOptions: TRODiscoveryOptions); + procedure RODiscoveryClientNewServersFound(Sender: TObject); + procedure RODiscoveryServerServiceFound(aSender: TObject; aName: string; + var ioDiscoveryOptions: TRODiscoveryOptions; var ioHandled: Boolean); + private + { Private declarations } + public + { Public declarations } + end; + + TMyDiscoveryQueryOptions = class(TRODiscoveryOptions) + private + fMaximumLoad: integer; + published + property MaximumLoad: integer read fMaximumLoad write fMaximumLoad; + end; + + TMyDiscoveryResultOptions = class(TRODiscoveryOptions) + private + fServerTime: TDateTime; + fMoreInfo: Widestring; + fLoad: integer; + published + property ServerTime: TDateTime read fServerTime write fServerTime; + property MoreInfo: Widestring read fMoreInfo write fMoreInfo; + property Load: integer read fLoad write fLoad; + end; + +var + ServiceDiscoveryMainForm: TServiceDiscoveryMainForm; + +implementation + +uses + uROTypes, uROClasses; + +{$R *.dfm} + +procedure TServiceDiscoveryMainForm.FormCreate(Sender: TObject); +begin + ROBroadcastServer.Active := true; + btn_UpdateServiceListClick(self); +end; + +procedure TServiceDiscoveryMainForm.btn_UpdateServiceListClick(Sender: TObject); +begin + RODiscoveryServer.ServiceList.Assign(ed_Services.Lines); +end; + +procedure TServiceDiscoveryMainForm.btn_LookupServiceClick(Sender: TObject); +var + lOptions: TMyDiscoveryQueryOptions; +begin + lb_Servers.Items.Clear(); + + RODiscoveryClient.ServiceName := {$IFDEF UNICODE}WideStringToAnsiString{$ENDIF}(ed_ServiceName.Text); + + lOptions := TMyDiscoveryQueryOptions.Create(); + try + lOptions.MaximumLoad := StrToIntDef(ed_MaxLoad.Text,100); + RODiscoveryClient.RefreshServerList(lOptions); + finally + lOptions.Free(); + end; +end; + +procedure TServiceDiscoveryMainForm.RODiscoveryClientNewServersFound( + Sender: TObject); +begin +// lb_Servers.Items.Assign(RODiscoveryClient.ServerList); +end; + +procedure TServiceDiscoveryMainForm.RODiscoveryClientNewServiceFound( + aSender: TObject; aName: String; aDiscoveryOptions: TRODiscoveryOptions); +var + lOptions: TMyDiscoveryResultOptions; +begin + if Assigned(aDiscoveryOptions) and (aDiscoveryOptions is TMyDiscoveryResultOptions) then begin + lOptions := TMyDiscoveryResultOptions(aDiscoveryOptions); + lb_Servers.Items.Add(Format('%s (Load: %d; Info: %s)',[aName, lOptions.Load, lOptions.MoreInfo])); + end + else begin + lb_Servers.Items.Add(aName+' (no info)'); + end; +end; + +procedure TServiceDiscoveryMainForm.cb_SupportRegisteredServerClassesClick(Sender: TObject); +begin + RODiscoveryServer.SupportRegisteredServerClasses := cb_SupportRegisteredServerClasses.Checked; +end; + +procedure TServiceDiscoveryMainForm.RODiscoveryServerServiceFound( + aSender: TObject; aName: string; var ioDiscoveryOptions: TRODiscoveryOptions; + var ioHandled: Boolean); +begin + if Assigned(ioDiscoveryOptions) and (ioDiscoveryOptions is TMyDiscoveryQueryOptions) then begin + { Check if we fullfill the load requirement. if our load is too high, abort + without sending a response to the client } + if TMyDiscoveryQueryOptions(ioDiscoveryOptions).MaximumLoad <= StrToIntDef(ed_ServerLoad.Text,100) then begin + ROSendNoResponse(); + end; + end; + + if cb_ReturnInfo.Checked then begin + ioDiscoveryOptions := TMyDiscoveryResultOptions.Create; + with TMyDiscoveryResultOptions(ioDiscoveryOptions) do begin + Load := StrToIntDef(ed_ServerLoad.Text,-1); + MoreInfo := 'Some info'; + ServerTime := Now; + end; { with } + end + else begin + ioDiscoveryOptions := nil; + end; + + { Don't free the original ioDiscoveryOptions (if it was assigned), the RO + framework take scare of that, just as it will free the one we pass back } +end; + +procedure TServiceDiscoveryMainForm.ActionListUpdate(Action: TBasicAction; + var Handled: Boolean); +begin + ac_DiscoverServers.Enabled := not ROBroadcastChannel.Busy; +end; + +initialization + RegisterROClass(TMyDiscoveryQueryOptions); + RegisterROClass(TMyDiscoveryResultOptions); +finalization + UnregisterROClass(TMyDiscoveryQueryOptions); + UnregisterROClass(TMyDiscoveryResultOptions); +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/LoginService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/LoginService_Impl.dfm new file mode 100644 index 0000000..41bac0b --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/LoginService_Impl.dfm @@ -0,0 +1,7 @@ +object LoginService: TLoginService + OldCreateOrder = True + Left = 200 + Top = 200 + Height = 300 + Width = 300 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/LoginService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/LoginService_Impl.pas new file mode 100644 index 0000000..77cd5d8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/LoginService_Impl.pas @@ -0,0 +1,97 @@ +unit LoginService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Generated:} SessionTypesLibrary_Intf; + +type + TLogProcedure = procedure(AStr: string) of object; + { TLoginService } + TLoginService = class(TRORemoteDataModule, ILoginService) + private + procedure Log(Astr: string); + protected + { ILoginService methods } + function Login(const UserID: string; const Password: string): boolean; + procedure Logout(const SessionID: string); + public + constructor Create(aOwner: TComponent); override; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} SessionTypesLibrary_Invk, Variants, + SessionTypes_ServerMain; + +procedure Create_LoginService(out anInstance: IUnknown); +begin + anInstance := TLoginService.Create(nil); +end; + +{ LoginService } + +constructor TLoginService.Create(aOwner: TComponent); +begin + inherited; + SessionManager := SessionTypes_ServerMainForm._SessionManager; +end; + +procedure TLoginService.Log(Astr: string); +begin + SessionTypes_ServerMainForm.Log(AStr); +end; + +function TLoginService.Login(const UserID: string; const Password: string): boolean; +begin + Log('User ''' + UserID + ''' is trying logon with password ''' + Password + ''''); + if (Session.Values['Login'] <> Null) then begin + Log('User ''' + Session.Values['Login'] + ''' is already connected to session ' + GUIDToString(ClientID)); + Log('Login unsuccessful'); + Result := True; + Exit; + end; + + result := (UserID <> '') and (UserID = Password); // Dummy test... You would code the one specific to your system + if Result then begin + Session.Values['Login'] := UserId; + Session.Values['Password'] := Password; + Log('Login successful'); + end + else begin + Log('Invalid login!'); + DestroySession; // Wrong login! The session cannot be persisted + end; + Log(''); +end; + +procedure TLoginService.Logout(const SessionID: string); +var + aUser: string; +begin + if Session.Values['Login'] <> Null then + aUser := Session.Values['Login'] + else + aUser := ''; + Log('User ''' + aUser + ''' has requested logout'); + Log(''); + DestroySession; // Removes the session from the SessionManager +end; + +initialization + TROClassFactory.Create('LoginService', Create_LoginService, TLoginService_Invoker); +finalization +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/RODLFILE.res new file mode 100644 index 0000000..a0a58c2 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes Create Session Table.sql b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes Create Session Table.sql new file mode 100644 index 0000000..73a7ed4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes Create Session Table.sql @@ -0,0 +1,15 @@ +CREATE TABLE [dbo].[Sessions] ( + [SessionID] [char] (38) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , + [Created] [datetime] NULL , + [LastAccessed] [datetime] NULL , + [Data] [IMAGE] NULL +) +GO + +ALTER TABLE [dbo].[Sessions] WITH NOCHECK ADD + CONSTRAINT [PK_Sessions] PRIMARY KEY CLUSTERED + ( + [SessionID] + ) ON [PRIMARY] +GO + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.Sample.html new file mode 100644 index 0000000..9106947 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.Sample.html @@ -0,0 +1,63 @@ + + + + + + + + + +

    + Session Types +

    + +
    +

    Purpose

    +

    + This example shows the use of sessions and illustrates: +

      +
    • TROEventSessionManager
    • +
    • TROInMemorySessionManager
    • +
    • TROMasterServerSessionManager
    • +
    • TRODBSessionManager
    • +
    +

    + +

    Getting Started

    +
      +
    • Build or compile all projects.
    • +
    • Launch the server (via the menu option: RemObjects | Launch Server Executable).
    • +
    • Activate the session desired.
    • +
    • Ensure that SessionTypes_Client is the selected project and run it.
    • +
    +

    Examine the Code

    +
      +
    • + Examine the simple code needed for changing the session in SessionTypes_ServerMain.pas. +
    • +
    + + +

    + Important note: this sample needs a "Sessions" table to be created in one of your databases. By default, the sample looks for the Sessions table in MSSQL's Northwind Database, but you can easily change to connect to any other database. +

    +

    + To create the Sessions table, run the .SQL script provided: +

    +

    + ..\RemObjects SDK for Delphi\Samples\Session Types\SessionTypes Create Session Table.sql +

    +

    + using the appropriate query tool provided with your database (e.g. Query Analyzer for MSSQL). +

    + +

    Data Abstract Users

    +This sample can easily be extended to encompass Data Abstract via the following steps: +
      +
    • Create TDAConnectionManager, TDADriverManager, TDAADODriver and TDASchema instances.
    • +
    • Relink.
    • +
    • In the schema, create the datasets and commands similar to qu* (TADOQuery).
    • +
    • Create a DADBSessionManager instance and assign the corresponding datasets and commands.
    • +
    + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.bdsgroup new file mode 100644 index 0000000..addf1d9 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + SessionTypes_Server.bdsproj + SessionTypes_Client.bdsproj + SessionTypes_Server.exe SessionTypes_Client.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.bpg new file mode 100644 index 0000000..479f06e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = SessionTypes_Server.exe SessionTypes_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +SessionTypes_Client.exe: SessionTypes_Client.dpr + $(DCC) + +SessionTypes_Server.exe: SessionTypes_Server.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.groupproj new file mode 100644 index 0000000..2a72a57 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes.groupproj @@ -0,0 +1,40 @@ + + + {ee6c030a-a2a2-4e8d-8869-acf773696e8f} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesLibrary.rodl new file mode 100644 index 0000000..4450ae1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesLibrary.rodl @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesLibrary_Intf.pas new file mode 100644 index 0000000..c7bad37 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesLibrary_Intf.pas @@ -0,0 +1,210 @@ +unit SessionTypesLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{EE96A14F-A446-4194-A1FD-C4F900DFBE62}'; + + { Service Interface ID's } + ISessionTypesService_IID : TGUID = '{EE96A14F-A446-4194-A1FD-C4F900DFBE62}'; + ILoginService_IID : TGUID = '{A8C9C8A2-3988-4E92-8846-6CDE7B35AA1E}'; + + { Event ID's } + +type + { Forward declarations } + ISessionTypesService = interface; + ILoginService = interface; + + + { ISessionTypesService } + ISessionTypesService = interface + ['{EE96A14F-A446-4194-A1FD-C4F900DFBE62}'] + function GetSessionValue(const Name: String): String; + procedure SetSessionValue(const Name: String; const Value: String); + function GetSessionID: String; + function GetSessionManagerName: String; + end; + + { CoSessionTypesService } + CoSessionTypesService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ISessionTypesService; + end; + + { TSessionTypesService_Proxy } + TSessionTypesService_Proxy = class(TROProxy, ISessionTypesService) + protected + function __GetInterfaceName:string; override; + + function GetSessionValue(const Name: String): String; + procedure SetSessionValue(const Name: String; const Value: String); + function GetSessionID: String; + function GetSessionManagerName: String; + end; + + { ILoginService } + ILoginService = interface + ['{A8C9C8A2-3988-4E92-8846-6CDE7B35AA1E}'] + function Login(const UserID: String; const Password: String): boolean; + procedure Logout(const SessionID: String); + end; + + { CoLoginService } + CoLoginService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginService; + end; + + { TLoginService_Proxy } + TLoginService_Proxy = class(TROProxy, ILoginService) + protected + function __GetInterfaceName:string; override; + + function Login(const UserID: String; const Password: String): boolean; + procedure Logout(const SessionID: String); + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoSessionTypesService } + +class function CoSessionTypesService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ISessionTypesService; +begin + result := TSessionTypesService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TSessionTypesService_Proxy } + +function TSessionTypesService_Proxy.__GetInterfaceName:string; +begin + result := 'SessionTypesService'; +end; + +function TSessionTypesService_Proxy.GetSessionValue(const Name: String): String; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SessionTypesLibrary', __InterfaceName, 'GetSessionValue'); + __Message.Write('Name', TypeInfo(String), Name, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(String), result, []); + finally + __Message.FreeStream; + end +end; + +procedure TSessionTypesService_Proxy.SetSessionValue(const Name: String; const Value: String); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SessionTypesLibrary', __InterfaceName, 'SetSessionValue'); + __Message.Write('Name', TypeInfo(String), Name, []); + __Message.Write('Value', TypeInfo(String), Value, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.FreeStream; + end +end; + +function TSessionTypesService_Proxy.GetSessionID: String; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SessionTypesLibrary', __InterfaceName, 'GetSessionID'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(String), result, []); + finally + __Message.FreeStream; + end +end; + +function TSessionTypesService_Proxy.GetSessionManagerName: String; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SessionTypesLibrary', __InterfaceName, 'GetSessionManagerName'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(String), result, []); + finally + __Message.FreeStream; + end +end; + +{ CoLoginService } + +class function CoLoginService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginService; +begin + result := TLoginService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TLoginService_Proxy } + +function TLoginService_Proxy.__GetInterfaceName:string; +begin + result := 'LoginService'; +end; + +function TLoginService_Proxy.Login(const UserID: String; const Password: String): boolean; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SessionTypesLibrary', __InterfaceName, 'Login'); + __Message.Write('UserID', TypeInfo(String), UserID, []); + __Message.Write('Password', TypeInfo(String), Password, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(boolean), result, []); + finally + __Message.FreeStream; + end +end; + +procedure TLoginService_Proxy.Logout(const SessionID: String); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SessionTypesLibrary', __InterfaceName, 'Logout'); + __Message.Write('SessionID', TypeInfo(String), SessionID, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(ISessionTypesService_IID, TSessionTypesService_Proxy); + RegisterProxyClass(ILoginService_IID, TLoginService_Proxy); + + +finalization + UnregisterProxyClass(ISessionTypesService_IID); + UnregisterProxyClass(ILoginService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesLibrary_Invk.pas new file mode 100644 index 0000000..60a83c0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesLibrary_Invk.pas @@ -0,0 +1,158 @@ +unit SessionTypesLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} SessionTypesLibrary_Intf; + +type + TSessionTypesService_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_GetSessionValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_SetSessionValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetSessionID(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetSessionManagerName(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + + TLoginService_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TSessionTypesService_Invoker } + +procedure TSessionTypesService_Invoker.Invoke_GetSessionValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetSessionValue(const Name: String): String; } +var + Name: String; + lResult: String; +begin + try + __Message.Read('Name', TypeInfo(String), Name, []); + + lResult := (__Instance as ISessionTypesService).GetSessionValue(Name); + + __Message.InitializeResponseMessage(__Transport, 'SessionTypesLibrary', 'SessionTypesService', 'GetSessionValueResponse'); + __Message.Write('Result', TypeInfo(String), lResult, []); + __Message.Finalize; + + finally + end; +end; + +procedure TSessionTypesService_Invoker.Invoke_SetSessionValue(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure SetSessionValue(const Name: String; const Value: String); } +var + Name: String; + Value: String; +begin + try + __Message.Read('Name', TypeInfo(String), Name, []); + __Message.Read('Value', TypeInfo(String), Value, []); + + (__Instance as ISessionTypesService).SetSessionValue(Name, Value); + + __Message.InitializeResponseMessage(__Transport, 'SessionTypesLibrary', 'SessionTypesService', 'SetSessionValueResponse'); + __Message.Finalize; + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +procedure TSessionTypesService_Invoker.Invoke_GetSessionID(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetSessionID: String; } +var + lResult: String; +begin + try + lResult := (__Instance as ISessionTypesService).GetSessionID; + + __Message.InitializeResponseMessage(__Transport, 'SessionTypesLibrary', 'SessionTypesService', 'GetSessionIDResponse'); + __Message.Write('Result', TypeInfo(String), lResult, []); + __Message.Finalize; + + finally + end; +end; + +procedure TSessionTypesService_Invoker.Invoke_GetSessionManagerName(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetSessionManagerName: String; } +var + lResult: String; +begin + try + lResult := (__Instance as ISessionTypesService).GetSessionManagerName; + + __Message.InitializeResponseMessage(__Transport, 'SessionTypesLibrary', 'SessionTypesService', 'GetSessionManagerNameResponse'); + __Message.Write('Result', TypeInfo(String), lResult, []); + __Message.Finalize; + + finally + end; +end; + +{ TLoginService_Invoker } + +procedure TLoginService_Invoker.Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Login(const UserID: String; const Password: String): boolean; } +var + UserID: String; + Password: String; + lResult: boolean; +begin + try + __Message.Read('UserID', TypeInfo(String), UserID, []); + __Message.Read('Password', TypeInfo(String), Password, []); + + lResult := (__Instance as ILoginService).Login(UserID, Password); + + __Message.InitializeResponseMessage(__Transport, 'SessionTypesLibrary', 'LoginService', 'LoginResponse'); + __Message.Write('Result', TypeInfo(boolean), lResult, []); + __Message.Finalize; + + finally + end; +end; + +procedure TLoginService_Invoker.Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure Logout(const SessionID: String); } +var + SessionID: String; +begin + try + __Message.Read('SessionID', TypeInfo(String), SessionID, []); + + (__Instance as ILoginService).Logout(SessionID); + + __Message.InitializeResponseMessage(__Transport, 'SessionTypesLibrary', 'LoginService', 'LogoutResponse'); + __Message.Finalize; + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesService_Impl.dfm new file mode 100644 index 0000000..f6a2e16 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesService_Impl.dfm @@ -0,0 +1,7 @@ +object SessionTypesService: TSessionTypesService + OldCreateOrder = True + Left = 200 + Top = 200 + Height = 300 + Width = 300 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesService_Impl.pas new file mode 100644 index 0000000..cf39c62 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypesService_Impl.pas @@ -0,0 +1,107 @@ +unit SessionTypesService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Generated:} SessionTypesLibrary_Intf; + +type + TLogProcedure = procedure(AStr: string) of object; + + { TSessionTypesService } + + TSessionTypesService = class(TRORemoteDataModule, ISessionTypesService) + private + procedure Log(Astr: string); + protected + { ISessionTypesService methods } + function GetSessionValue(const Name: string): string; + procedure SetSessionValue(const Name: string; const Value: string); + function GetSessionID: string; + function GetSessionManagerName: string; + public + constructor Create(aOwner: TComponent); override; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} SessionTypesLibrary_Invk, Variants, + SessionTypes_ServerMain; + +procedure Create_SessionTypesService(out anInstance: IUnknown); +begin + anInstance := TSessionTypesService.Create(nil); +end; + +{ SessionTypesService } + +function TSessionTypesService.GetSessionValue(const Name: string): string; +begin + if Session.Values['Login'] = Null then begin + Log('Session ' + GUIDToString(Session.SessionID) + ' was trying get value for ''' + Name + ''''); + Log('Illegal user. Disconnect!'); + DestroySession; + end + else begin + result := VarToStr(Session.Values[Name]); + Log(Session.Values['Login'] + ' is requested value for ''' + Name + '''. Value =''' + Result + ''''); + end; +end; + +procedure TSessionTypesService.SetSessionValue(const Name: string; const Value: string); +begin + if Session.Values['Login'] = Null then begin + Log('Session ' + GUIDToString(Session.SessionID) + ' was trying set value ''' + Value + ''' for ''' + Name + ''''); + Log('Illegal user. Disconnect!'); + DestroySession; + end + else begin + Session.Values[Name] := Value; + Log(Session.Values['Login'] + ' has set value ''' + Value + ''' for ''' + Name + ''''); + end; +end; + +function TSessionTypesService.GetSessionID: string; +begin + result := GUIDToString(ClientID); +end; + +procedure TSessionTypesService.Log(Astr: string); +begin + SessionTypes_ServerMainForm.Log(AStr); +end; + +constructor TSessionTypesService.Create(aOwner: TComponent); +begin + inherited; + SessionManager := SessionTypes_ServerMainForm._SessionManager; + RequiresSession:=True; +end; + +function TSessionTypesService.GetSessionManagerName: string; +begin + if Session.Values['Login'] <> Null then + Log(Session.Values['Login'] + ' is requested SessionManagerName') + else + Log('Request SessionManagerName - Illegal request!'); + Result := SessionManager.Name; + if Session.Values['Login'] = Null then DestroySession; +end; + +initialization + TROClassFactory.Create('SessionTypesService', Create_SessionTypesService, TSessionTypesService_Invoker); +finalization +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.bdsproj new file mode 100644 index 0000000..c9772f4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + SessionTypes_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.dpr new file mode 100644 index 0000000..24f2940 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.dpr @@ -0,0 +1,16 @@ +program SessionTypes_Client; + +uses + Forms, + SessionTypes_ClientMain in 'SessionTypes_ClientMain.pas' {SessionTypes_ClientMainForm}; + + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'SessionTypes - Client'; + Application.CreateForm(TSessionTypes_ClientMainForm, SessionTypes_ClientMainForm); + Application.Run; +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.dproj new file mode 100644 index 0000000..c0ffa0f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.dproj @@ -0,0 +1,72 @@ + + + {f1691183-136d-49e5-87e6-388fe20cc7db} + SessionTypes_Client.dpr + Debug + AnyCPU + DCC32 + SessionTypes_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + SessionTypes_Client.dpr + + + + + + + MainSource + + +
    SessionTypes_ClientMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Client.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ClientMain.dfm new file mode 100644 index 0000000..6369391 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ClientMain.dfm @@ -0,0 +1,177 @@ +object SessionTypes_ClientMainForm: TSessionTypes_ClientMainForm + Left = 279 + Top = 260 + AutoScroll = False + Caption = 'SessionTypes - Client' + ClientHeight = 249 + ClientWidth = 385 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Label3: TLabel + Left = 7 + Top = 16 + Width = 36 + Height = 13 + Caption = '&UserID:' + end + object Label4: TLabel + Left = 7 + Top = 47 + Width = 49 + Height = 13 + Caption = 'Pass&word:' + end + object Label5: TLabel + Left = 7 + Top = 69 + Width = 116 + Height = 13 + Caption = 'Session Manager Name:' + end + object GroupBox1: TGroupBox + Left = 8 + Top = 156 + Width = 369 + Height = 88 + Anchors = [akLeft, akTop, akBottom] + Caption = 'Session Values' + TabOrder = 7 + object Label1: TLabel + Left = 8 + Top = 28 + Width = 31 + Height = 13 + Caption = '&Name:' + end + object Label2: TLabel + Left = 8 + Top = 60 + Width = 30 + Height = 13 + Caption = '&Value:' + end + object SetValueButton: TButton + Left = 280 + Top = 22 + Width = 75 + Height = 25 + Caption = '&Set Value' + TabOrder = 2 + OnClick = SetValueButtonClick + end + object GetValueButton: TButton + Left = 280 + Top = 54 + Width = 75 + Height = 25 + Caption = '&Get Value' + TabOrder = 3 + OnClick = GetValueButtonClick + end + object eName: TEdit + Left = 48 + Top = 24 + Width = 225 + Height = 21 + TabOrder = 0 + end + object eValue: TEdit + Left = 48 + Top = 56 + Width = 225 + Height = 21 + TabOrder = 1 + end + end + object stSessionID: TStaticText + Left = 32 + Top = 120 + Width = 314 + Height = 17 + AutoSize = False + BorderStyle = sbsSunken + Caption = 'stSessionID' + TabOrder = 6 + end + object LoginButton: TButton + Left = 221 + Top = 10 + Width = 75 + Height = 25 + Caption = '&Login' + TabOrder = 2 + OnClick = LoginButtonClick + end + object LogoutButton: TButton + Left = 301 + Top = 9 + Width = 75 + Height = 25 + Caption = 'Log&out' + TabOrder = 3 + OnClick = LogoutButtonClick + end + object cbUserID: TComboBox + Left = 63 + Top = 12 + Width = 145 + Height = 21 + ItemHeight = 13 + TabOrder = 0 + OnChange = cbUserIDChange + end + object ePassword: TEdit + Left = 63 + Top = 43 + Width = 145 + Height = 21 + TabOrder = 1 + end + object stSessionManagerName: TStaticText + Left = 32 + Top = 85 + Width = 314 + Height = 17 + AutoSize = False + BorderStyle = sbsSunken + TabOrder = 5 + end + object GetSessionManagerNameButton: TButton + Left = 222 + Top = 40 + Width = 154 + Height = 25 + Caption = 'Get Session Manager Name' + TabOrder = 4 + OnClick = GetSessionManagerNameButtonClick + end + object ROBINMessage: TROBinMessage + Left = 239 + Top = 200 + end + object rsSessionService: TRORemoteService + Message = ROBINMessage + Channel = SuperTcpChannel + ServiceName = 'SessionTypesService' + Left = 239 + Top = 174 + end + object rsLoginService: TRORemoteService + Message = ROBINMessage + Channel = SuperTcpChannel + ServiceName = 'LoginService' + Left = 211 + Top = 174 + end + object SuperTcpChannel: TROSuperTcpChannel + ServerLocators = <> + DispatchOptions = [] + Host = '127.0.0.1' + Left = 212 + Top = 202 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ClientMain.pas new file mode 100644 index 0000000..9efba8d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ClientMain.pas @@ -0,0 +1,105 @@ +unit SessionTypes_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, uRORemoteService, uROClient, + uROBinMessage, StdCtrls, uROSuperTCPChannel, SessionTypesLibrary_Intf; + +type + TSessionTypes_ClientMainForm = class(TForm) + Label3: TLabel; + Label4: TLabel; + GroupBox1: TGroupBox; + Label1: TLabel; + Label2: TLabel; + SetValueButton: TButton; + GetValueButton: TButton; + eName: TEdit; + eValue: TEdit; + stSessionID: TStaticText; + LoginButton: TButton; + LogoutButton: TButton; + cbUserID: TComboBox; + ePassword: TEdit; + ROBINMessage: TROBinMessage; + rsSessionService: TRORemoteService; + rsLoginService: TRORemoteService; + SuperTcpChannel: TROSuperTcpChannel; + stSessionManagerName: TStaticText; + Label5: TLabel; + GetSessionManagerNameButton: TButton; + procedure LoginButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure LogoutButtonClick(Sender: TObject); + procedure cbUserIDChange(Sender: TObject); + procedure GetValueButtonClick(Sender: TObject); + procedure SetValueButtonClick(Sender: TObject); + procedure GetSessionManagerNameButtonClick(Sender: TObject); + private + { Private declarations } + FService: ISessionTypesService; + FLoginService: ILoginService; + public + { Public declarations } + end; + +var + SessionTypes_ClientMainForm: TSessionTypes_ClientMainForm; + +implementation + +{$R *.dfm} + +const + UserNames: array[0..2] of string = ('john', 'brian', 'marta'); + +procedure TSessionTypes_ClientMainForm.LoginButtonClick(Sender: TObject); +begin + FLoginService.Login(cbUserID.Text, ePassword.Text); +end; + +procedure TSessionTypes_ClientMainForm.FormCreate(Sender: TObject); +var + i: integer; +begin + for i := 0 to High(UserNames) do + cbUserID.Items.Add(UserNames[i]); + + stSessionID.Caption := GUIDToString(ROBINMessage.ClientID); + fService := (rsSessionService as ISessionTypesService); + FLoginService := (rsLoginService as ILoginService); + SuperTcpChannel.Active := True; +end; + +procedure TSessionTypes_ClientMainForm.LogoutButtonClick(Sender: TObject); +begin + FLoginService.Logout(stSessionID.Caption); +end; + +procedure TSessionTypes_ClientMainForm.cbUserIDChange(Sender: TObject); +begin + ePassword.Text := cbUserID.Text; +end; + +procedure TSessionTypes_ClientMainForm.GetValueButtonClick( + Sender: TObject); +begin + eValue.Text := fService.GetSessionValue(eName.Text); +end; + +procedure TSessionTypes_ClientMainForm.SetValueButtonClick( + Sender: TObject); +begin + fService.SetSessionValue(eName.Text, eValue.Text); +end; + +procedure TSessionTypes_ClientMainForm.GetSessionManagerNameButtonClick( + Sender: TObject); +begin + stSessionManagerName.Caption := fService.GetSessionManagerName; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.bdsproj new file mode 100644 index 0000000..2f255c1 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + SessionTypes_Server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.dpr new file mode 100644 index 0000000..aeb3a4f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.dpr @@ -0,0 +1,24 @@ +program SessionTypes_Server; + + +{#ROGEN:SessionTypesLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + SessionTypes_ServerMain in 'SessionTypes_ServerMain.pas' {SessionTypes_ServerMainForm}, + SessionTypesLibrary_Intf in 'SessionTypesLibrary_Intf.pas', + SessionTypesLibrary_Invk in 'SessionTypesLibrary_Invk.pas', + SessionTypesService_Impl in 'SessionTypesService_Impl.pas' {SessionTypesService: TRORemoteDataModule}, + LoginService_Impl in 'LoginService_Impl.pas' {LoginService: TRORemoteDataModule}, + SessionTypes_Server_DBSessionManager in 'SessionTypes_Server_DBSessionManager.pas' {SessionTypes_Server_DBSessionManagerForm: TDataModule}; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'SessionTypes - Server'; + Application.CreateForm(TSessionTypes_Server_DBSessionManagerForm, SessionTypes_Server_DBSessionManagerForm); + Application.CreateForm(TSessionTypes_ServerMainForm, SessionTypes_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.dproj new file mode 100644 index 0000000..d5bfa23 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.dproj @@ -0,0 +1,83 @@ + + + {bf2e1d05-f797-4869-96a9-62100733f9c2} + SessionTypes_Server.dpr + Debug + AnyCPU + DCC32 + SessionTypes_Server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + SessionTypes_Server.dpr + + + + + + + MainSource + + +
    LoginService
    +
    + + + +
    SessionTypesService
    +
    + +
    SessionTypes_ServerMainForm
    +
    + +
    SessionTypes_Server_DBSessionManagerForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.res new file mode 100644 index 0000000..aa9db5a Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ServerMain.dfm new file mode 100644 index 0000000..bcf4725 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ServerMain.dfm @@ -0,0 +1,124 @@ +object SessionTypes_ServerMainForm: TSessionTypes_ServerMainForm + Left = 137 + Top = 83 + AutoScroll = False + Caption = 'SessionTypes - Server' + ClientHeight = 386 + ClientWidth = 601 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + OnDestroy = FormDestroy + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 194 + Top = 3 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object infotext: TLabel + Left = 179 + Top = 60 + Width = 417 + Height = 84 + Anchors = [akLeft, akTop, akRight] + AutoSize = False + Caption = 'infotext' + WordWrap = True + end + object Memo: TMemo + Left = 0 + Top = 149 + Width = 601 + Height = 235 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + TabOrder = 0 + end + object rgSessions: TRadioGroup + Left = 0 + Top = 53 + Width = 176 + Height = 96 + Align = alCustom + Caption = 'Session' + ItemIndex = 0 + Items.Strings = ( + 'InMemorySessionManager' + 'MasterServerSessionManager' + 'EventSessionManager' + 'RODBSessionManager') + TabOrder = 1 + OnClick = rgSessionsClick + end + object ROBinMessage: TROBinMessage + Left = 52 + Top = 5 + end + object ROServer: TROSuperTcpServer + Dispatchers = < + item + Name = 'ROBinMessage' + Message = ROBinMessage + Enabled = True + end> + Left = 81 + Top = 5 + end + object EventSessionManager: TROEventSessionManager + OnSessionCreated = SessionManagerSessionCreated + OnSessionDeleted = SessionManagerSessionDeleted + OnDeleteSession = EventSessionManagerDeleteSession + OnFindSession = EventSessionManagerFindSession + OnReleaseSession = EventSessionManagerReleaseSession + OnClearSessions = EventSessionManagerClearSessions + OnGetSessionCount = EventSessionManagerGetSessionCount + Left = 75 + Top = 209 + end + object InMemorySessionManager: TROInMemorySessionManager + OnSessionCreated = SessionManagerSessionCreated + OnSessionDeleted = SessionManagerSessionDeleted + Left = 74 + Top = 152 + end + object MasterServerSessionManager: TROMasterServerSessionManager + OnSessionCreated = SessionManagerSessionCreated + OnSessionDeleted = SessionManagerSessionDeleted + OnException = MasterServerSessionManagerException + Channel = ROIndyTCPChannel + Left = 75 + Top = 181 + end + object RODBSessionManager: TRODBSessionManager + OnSessionCreated = SessionManagerSessionCreated + OnSessionDeleted = SessionManagerSessionDeleted + OnException = RODBSessionManagerException + FieldNameSessionID = 'SessionID' + FieldNameCreated = 'Created' + FieldNameLastAccessed = 'LastAccessed' + FieldNameData = 'Data' + InsertDataset = SessionTypes_Server_DBSessionManagerForm.quInsertSession + DeleteDataset = SessionTypes_Server_DBSessionManagerForm.quDeleteSession + UpdateDataset = SessionTypes_Server_DBSessionManagerForm.quUpdateSession + SelectDataset = SessionTypes_Server_DBSessionManagerForm.quSelectSession + GetCountDataset = SessionTypes_Server_DBSessionManagerForm.quGetSessionCount + ClearSessionsDataset = SessionTypes_Server_DBSessionManagerForm.quClearSessions + SelectAllDataset = SessionTypes_Server_DBSessionManagerForm.quSelectAllSessions + ClearSessionsOnCreate = False + ClearSessionsOnDestroy = False + Left = 75 + Top = 256 + end + object ROIndyTCPChannel: TROIndyTCPChannel + ServerLocators = <> + DispatchOptions = [] + Port = 8090 + Host = '127.0.0.1' + Left = 102 + Top = 180 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ServerMain.pas new file mode 100644 index 0000000..2833fd6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_ServerMain.pas @@ -0,0 +1,245 @@ +unit SessionTypes_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, uROPoweredByRemObjectsButton, SyncObjs, ExtCtrls, + uROSuperTCPServer, uROClient, uROServer, uROBinMessage, + uROMasterServerSessionManager, uROSessions, + uRODBSessionManager, SessionTypes_Server_DBSessionManager, + uROIndyTCPChannel; +type + TSessionTypes_ServerMainForm = class(TForm) + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + Memo: TMemo; + rgSessions: TRadioGroup; + ROBinMessage: TROBinMessage; + ROServer: TROSuperTcpServer; + EventSessionManager: TROEventSessionManager; + InMemorySessionManager: TROInMemorySessionManager; + MasterServerSessionManager: TROMasterServerSessionManager; + RODBSessionManager: TRODBSessionManager; + infotext: TLabel; + ROIndyTCPChannel: TROIndyTCPChannel; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure SessionManagerSessionCreated(const aSession: TROSession); + procedure SessionManagerSessionDeleted(const aSessionID: TGUID; IsExpired: Boolean); + procedure EventSessionManagerReleaseSession(var aSession: TROSession; NewSession: Boolean); + function EventSessionManagerGetSessionCount(SessionManager: TROCustomSessionManager): Integer; + procedure EventSessionManagerDeleteSession(const aSessionID: TGUID; IsExpired: Boolean); + procedure EventSessionManagerClearSessions(SessionManager: TROCustomSessionManager; OnlyExpired: Boolean); + procedure rgSessionsClick(Sender: TObject); + procedure EventSessionManagerFindSession(const aSessionID: TGUID; + out aSession: TROSession); + procedure MasterServerSessionManagerException(aSessionID: TGUID; + anException: Exception; var aRetry: Boolean); + procedure RODBSessionManagerException(aSessionID: TGUID; + anException: Exception; var aRetry: Boolean); + private + CriticalSection: TCriticalSection; + EventSessionList: TStringList; + function GetSessionManager: TROCustomSessionManager; + public + { Public declarations } + procedure Log(Astr: string); + published + property _SessionManager: TROCustomSessionManager read GetSessionManager; + end; + +var + SessionTypes_ServerMainForm: TSessionTypes_ServerMainForm; + +implementation +uses Inifiles; +{$R *.dfm} + +{ TSessionTypes_ServerMainForm } + +procedure TSessionTypes_ServerMainForm.Log(Astr: string); +begin + if CriticalSection = nil then exit; + CriticalSection.Enter; + try + if AStr = '' then + Memo.Lines.Add('') + else + Memo.Lines.Add(DateTimetoStr(Now) + ': ' + Astr); + finally + CriticalSection.Leave; + end; +end; + +procedure TSessionTypes_ServerMainForm.FormCreate(Sender: TObject); +begin + CriticalSection := TCriticalSection.Create; + ROServer.Active := True; + // init Event manager + + EventSessionList := TStringList.Create; + EventSessionList.Duplicates := dupError; + EventSessionList.Sorted := TRUE; + + rgSessionsClick(rgSessions); +end; + +procedure TSessionTypes_ServerMainForm.FormDestroy(Sender: TObject); +begin + // we should manually clear sessions for TROEventSessionManager + EventSessionManager.ClearSessions(False); + CriticalSection.Free; + CriticalSection:=nil; + EventSessionList.Free; +end; + +function TSessionTypes_ServerMainForm.GetSessionManager: TROCustomSessionManager; +begin + case rgSessions.ItemIndex of + 1: Result := MasterServerSessionManager; + 2: Result := EventSessionManager; + 3: Result := RODBSessionManager; + else + { 0:} Result := InMemorySessionManager; + end; +end; + +procedure TSessionTypes_ServerMainForm.SessionManagerSessionCreated( + const aSession: TROSession); +begin + Log(rgSessions.Items[rgSessions.ItemIndex] + ': Session ' + GUIDToString(aSession.SessionID) + ' created!'); +end; + +procedure TSessionTypes_ServerMainForm.SessionManagerSessionDeleted( + const aSessionID: TGUID; IsExpired: Boolean); +begin + if (csDestroying in ComponentState) then Exit; // See destructor + Log(rgSessions.Items[rgSessions.ItemIndex] + ': Session ' + GUIDToString(aSessionID) + ' has been closed'); + Log(''); +end; + +procedure TSessionTypes_ServerMainForm.EventSessionManagerReleaseSession( + var aSession: TROSession; NewSession: Boolean); +var + id: string; +begin + inherited; + if NewSession then begin + id := GUIDToString(aSession.SessionID); + EventSessionList.AddObject(id, aSession); + end; +end; + +function TSessionTypes_ServerMainForm.EventSessionManagerGetSessionCount( + SessionManager: TROCustomSessionManager): Integer; +begin + result := EventSessionList.Count; +end; + + +procedure TSessionTypes_ServerMainForm.EventSessionManagerDeleteSession( + const aSessionID: TGUID; IsExpired: Boolean); +var + idx: integer; +begin + idx := EventSessionList.IndexOf(GUIDToString(aSessionID)); + if (idx >= 0) then begin + EventSessionList.Objects[idx].Free; + EventSessionList.Delete(idx); + end; +end; + +procedure TSessionTypes_ServerMainForm.EventSessionManagerClearSessions( + SessionManager: TROCustomSessionManager; OnlyExpired: Boolean); +var + i: integer; + lSessionID: TGUID; +begin + if OnlyExpired then begin + for i := (EventSessionList.Count - 1) downto 0 do + if EventSessionManager.CheckSessionIsExpired(TROSession(EventSessionList.Objects[i])) then begin + lSessionID := TROSession(EventSessionList.Objects[i]).SessionID; + EventSessionManager.DeleteSession(lSessionID, TRUE); + end; + end + else + for i := (EventSessionList.Count - 1) downto 0 do begin + lSessionID := TROSession(EventSessionList.Objects[i]).SessionID; + EventSessionManager.DeleteSession(lSessionID, FALSE); + end; +end; + +procedure TSessionTypes_ServerMainForm.rgSessionsClick(Sender: TObject); + + procedure SetupDBSession; + begin + // init RODBSessionManager + with RODBSessionManager do + if InsertDataset = nil then begin + InsertDataset := SessionTypes_Server_DBSessionManagerForm.quInsertSession; + DeleteDataset := SessionTypes_Server_DBSessionManagerForm.quDeleteSession; + UpdateDataset := SessionTypes_Server_DBSessionManagerForm.quUpdateSession; + SelectDataset := SessionTypes_Server_DBSessionManagerForm.quSelectSession; + GetCountDataset := SessionTypes_Server_DBSessionManagerForm.quGetSessionCount; + ClearSessionsDataset := SessionTypes_Server_DBSessionManagerForm.quClearSessions; + end; + end; + +begin + case rgSessions.ItemIndex of + 1 {MasterServerSessionManager}: begin + infotext.Caption := + 'Stores session data in a precompiled mini database server provided with' + + 'RemObjects SDK (the Master Server). Provides the same benefits ' + + 'as the database session managers, without the need to manually maintain a ' + + 'database or database server.' + sLineBreak + + 'Demands started ''...\RemObjects SDK for Delphi\Bin\ROMasterServer.exe'''; + end; + 2 {EventSessionManager}: + infotext.Caption := + 'Provides an easy way to use custom code to manually store and retrieve session data.'; + 3 {RODBSessionManager}: begin + infotext.Caption := + 'Stores session data in a database table accessible via ADO.NET, a Delphi TDataSet ' + + 'component. This allows sharing of session data between servers and keeps session ' + + 'information persisted across server restarts.'; + SetupDBSession; + end; + else + {0}{InMemorySessionManager} + infotext.Caption := + 'Stores session data in local memory within the application server. ' + + 'This provides fast access, but does not persist session ' + + 'information when the server is restarted. Also, common session ' + + 'data cannot be shared by a server farm.'; + end; +end; + +procedure TSessionTypes_ServerMainForm.EventSessionManagerFindSession( + const aSessionID: TGUID; out aSession: TROSession); +var + idx: integer; +begin + aSession := nil; + idx := EventSessionList.IndexOf(GUIDToString(aSessionID)); + if (idx >= 0) then aSession := TROSession(EventSessionList.Objects[idx]); + if (aSession <> nil) then aSession.LastAccessed := Now; +end; + +procedure TSessionTypes_ServerMainForm.MasterServerSessionManagerException( + aSessionID: TGUID; anException: Exception; var aRetry: Boolean); +begin + aRetry:=False; + Raise Exception.Create('Error connecting to MasterServer. Please run the MasterServer before attempting to store session data in the MasterServerSessionManager.'); +end; + +procedure TSessionTypes_ServerMainForm.RODBSessionManagerException( + aSessionID: TGUID; anException: Exception; var aRetry: Boolean); +begin + aRetry:=False; + Raise Exception.Create('Error connecting to MSSQL server.'); +end; + +end. + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server_DBSessionManager.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server_DBSessionManager.dfm new file mode 100644 index 0000000..4bf72a8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server_DBSessionManager.dfm @@ -0,0 +1,166 @@ +object SessionTypes_Server_DBSessionManagerForm: TSessionTypes_Server_DBSessionManagerForm + OldCreateOrder = False + Left = 478 + Top = 240 + Height = 212 + Width = 327 + object quClearSessions: TADOQuery + Connection = ADOConnection + Parameters = < + item + Name = 'LastAccessed' + DataType = ftFloat + Value = 37751.3380116088 + end> + Prepared = True + SQL.Strings = ( + 'DELETE FROM Sessions ' + 'WHERE LastAccessed<:LastAccessed') + Left = 16 + Top = 120 + end + object ADOConnection: TADOConnection + ConnectionString = + 'Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initi' + + 'al Catalog=Northwind;Data Source=.' + LoginPrompt = False + Provider = 'SQLOLEDB.1' + Left = 16 + Top = 80 + end + object quInsertSession: TADOQuery + Connection = ADOConnection + Parameters = < + item + Name = 'SessionID' + DataType = ftString + NumericScale = 255 + Precision = 255 + Size = 38 + Value = Null + end + item + Name = 'Created' + Attributes = [paNullable] + DataType = ftDateTime + NumericScale = 3 + Precision = 23 + Size = 16 + Value = Null + end + item + Name = 'LastAccessed' + Attributes = [paNullable] + DataType = ftDateTime + NumericScale = 3 + Precision = 23 + Size = 16 + Value = Null + end + item + Name = 'Data' + Attributes = [paNullable, paLong] + DataType = ftBlob + Size = -1 + Value = Null + end> + Prepared = True + SQL.Strings = ( + + 'INSERT INTO Sessions ([SessionID], [Created], [LastAccessed], [D' + + 'ata])' + 'VALUES(:SessionID, :Created, :LastAccessed, :Data)') + Left = 48 + Top = 120 + end + object quDeleteSession: TADOQuery + Connection = ADOConnection + Parameters = < + item + Name = 'SessionID' + DataType = ftString + NumericScale = 255 + Precision = 255 + Size = 38 + Value = Null + end> + Prepared = True + SQL.Strings = ( + 'DELETE FROM Sessions' + 'WHERE SessionID=:SessionID') + Left = 80 + Top = 120 + end + object quUpdateSession: TADOQuery + Connection = ADOConnection + Parameters = < + item + Name = 'LastAccessed' + Attributes = [paNullable] + DataType = ftDateTime + NumericScale = 3 + Precision = 23 + Size = 16 + Value = Null + end + item + Name = 'Data' + Attributes = [paNullable, paLong] + DataType = ftBlob + Size = -1 + Value = Null + end + item + Name = 'SessionID' + DataType = ftString + NumericScale = 255 + Precision = 255 + Size = 38 + Value = Null + end> + Prepared = True + SQL.Strings = ( + 'UPDATE Sessions SET LastAccessed=:LastAccessed, Data=:Data' + 'WHERE SessionID=:SessionID') + Left = 112 + Top = 120 + end + object quSelectSession: TADOQuery + Connection = ADOConnection + CursorType = ctStatic + Parameters = < + item + Name = 'SessionID' + DataType = ftString + NumericScale = 255 + Precision = 255 + Size = 38 + Value = Null + end> + Prepared = True + SQL.Strings = ( + 'SELECT * FROM Sessions' + 'WHERE SessionID=:SessionID') + Left = 144 + Top = 120 + end + object quGetSessionCount: TADOQuery + Connection = ADOConnection + Parameters = <> + Prepared = True + SQL.Strings = ( + 'SELECT COUNT(*) FROM Sessions') + Left = 176 + Top = 120 + end + object quSelectAllSessions: TADOQuery + Connection = ADOConnection + CursorType = ctStatic + Parameters = <> + Prepared = True + SQL.Strings = ( + 'SELECT * FROM Sessions') + Left = 208 + Top = 120 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server_DBSessionManager.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server_DBSessionManager.pas new file mode 100644 index 0000000..14ee4ab --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Session Types/SessionTypes_Server_DBSessionManager.pas @@ -0,0 +1,32 @@ +unit SessionTypes_Server_DBSessionManager; + +interface + +uses + SysUtils, Classes, uROClient, uROSessions, uRODBSessionManager, DB, ADODB; + +type + TSessionTypes_Server_DBSessionManagerForm = class(TDataModule) + quClearSessions: TADOQuery; + ADOConnection: TADOConnection; + quInsertSession: TADOQuery; + quDeleteSession: TADOQuery; + quUpdateSession: TADOQuery; + quSelectSession: TADOQuery; + quGetSessionCount: TADOQuery; + quSelectAllSessions: TADOQuery; + private + { Private declarations } + public + { Public declarations } + end; + +var + SessionTypes_Server_DBSessionManagerForm: TSessionTypes_Server_DBSessionManagerForm; + +implementation + +{$R *.dfm} + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Styles.css b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Styles.css new file mode 100644 index 0000000..c8e0628 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Styles.css @@ -0,0 +1,103 @@ +body +{ + background-color: #f7f7f7; + margin-top: 15px; + margin-bottom: 15px; + margin-left: 15px; + margin-right: 15px; + padding-top: 10px; + padding-bottom: 10px; + padding-left: 10px; + padding-right: 10px; + font-family: tahoma, verdana, sans-serif; + font-size: 10pt; + width: 700px; + color: #000000; +} +p +{ + padding-top: 0; + padding-bottom: 0; + padding-left: 0; + padding-right: 0.5em; +} +ul +{ + padding-top: 0; + padding-bottom: 0; + list-style-type: disc; +} +li +{ + padding-top: 0; + padding-bottom: 0; +} +img +{ + margin: 5px; + border-width: 0; +} +table +{ + background-color: #f7f7f7; + margin: 15px; + padding: 0px; + font-size: 10pt; +} +tr +{ + background-color: #f7f7f7; + margin: 15px; + padding: 0px; + font-size: 10pt; +} +td, th +{ + background-color: #f7f7f7; + margin: 0; + padding: 5px; + font-size: 10pt; +} +td ul +{ + padding-left: 2em; +} + +img:left { margin-left: 0; } +img:right { margin-right: 0; } +p.h1 +{ + margin-top: 1em; + margin-bottom: 0.5px; + padding-bottom:0px; + font-size:13pt; + font-weight:bold; +} +p.h2 +{ + margin-top: 1em; + margin-bottom: 0.5px; + padding-bottom:0px; + font-size:11pt; + font-weight:bold; +} +p.h3 +{ + margin-top: 1em; + margin-bottom: 0.5px; + padding-bottom:0px; + font-size:10pt; + font-weight:bold; +} +pre +{ + margin-top:0px; + margin-bottom:0px; + margin-left:0px; + margin-right:0px; +} +.spaced +{ + letter-spacing:1px; + color:#000060; +} diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/ChatServerService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/ChatServerService_Impl.dfm new file mode 100644 index 0000000..5ceacb7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/ChatServerService_Impl.dfm @@ -0,0 +1,10 @@ +object ChatServerService: TChatServerService + OldCreateOrder = True + RequiresSession = True + SessionManager = SuperTCPChannelChat_ServerMainForm.ROSessionManager + EventRepository = SuperTCPChannelChat_ServerMainForm.ROEventRepository + Left = 200 + Top = 200 + Height = 300 + Width = 300 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/ChatServerService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/ChatServerService_Impl.pas new file mode 100644 index 0000000..6e12e92 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/ChatServerService_Impl.pas @@ -0,0 +1,72 @@ +unit ChatServerService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, Variants, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Generated:} SuperTCPChannelChatLibrary_Intf; + +type + { TChatServerService } + TChatServerService = class(TRORemoteDataModule, IChatServerService) + private + protected + { IChatServerService methods } + procedure TalkPrivate(const TargetNickname: WideString; const Message: WideString); + procedure Talk(const Message: WideString); + end; + +implementation + +{$R *.dfm} +uses + {Generated:} SuperTCPChannelChatLibrary_Invk, SuperTCPChannelChat_ServerMain; + +procedure Create_ChatServerService(out anInstance : IUnknown); +begin + anInstance := TChatServerService.Create(nil); +end; + +{ ChatServerService } +procedure TChatServerService.TalkPrivate(const TargetNickname: WideString; const Message: WideString); +var + ev: IChatEvents_Writer; + i: Integer; + aDestGuid: string; +begin + UserClientIDListCs.Acquire; + try + i := UserClientIDList.IndexOfName(TargetNickname); + if i = -1 then + raise Exception.Create('Invalid user: '+TargetNickname); + aDestGuid := UserClientIDList.Values[TargetNickname]; + finally + UserClientIDListCs.Release; + end; + ev := (EventRepository as IChatEvents_Writer); + ev.ExcludeSender := False; + ev.SessionList.Add(aDestGuid); + ev.Message(session.SessionID, VarToStr(Session['nick']), TargetNickname, Message); +end; + +procedure TChatServerService.Talk(const Message: WideString); +var + ev: IChatEvents_Writer; +begin + ev := (EventRepository as IChatEvents_Writer); + ev.ExcludeSender := False; + ev.Message(session.SessionID, VarToStr(Session['nick']), '', Message); +end; + +initialization + TROClassFactory.Create('ChatServerService', Create_ChatServerService, TChatServerService_Invoker); +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/LoginService_Impl.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/LoginService_Impl.dfm new file mode 100644 index 0000000..c349242 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/LoginService_Impl.dfm @@ -0,0 +1,9 @@ +object LoginService: TLoginService + OldCreateOrder = True + SessionManager = SuperTCPChannelChat_ServerMainForm.ROSessionManager + EventRepository = SuperTCPChannelChat_ServerMainForm.ROEventRepository + Left = 582 + Top = 194 + Height = 304 + Width = 300 +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/LoginService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/LoginService_Impl.pas new file mode 100644 index 0000000..8747e36 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/LoginService_Impl.pas @@ -0,0 +1,105 @@ +unit LoginService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Required:} uRORemoteDataModule, + {Generated:} SuperTCPChannelChatLibrary_Intf; + +type + { TLoginService } + TLoginService = class(TRORemoteDataModule, ILoginService) + private + protected + { ILoginService methods } + procedure Login(const Nickname: Widestring); + procedure Logout; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} SuperTCPChannelChatLibrary_Invk, SuperTCPChannelChat_ServerMain, Variants, uROClasses; + +procedure Create_LoginService(out anInstance: IUnknown); +begin + anInstance := TLoginService.Create(nil); +end; + +{ LoginService } + +procedure TLoginService.Login(const Nickname: Widestring); +var + ev: IChatEvents_Writer; + i: Integer; + s: Widestring; +begin + UserClientIDListCs.Acquire; + try + if UserClientIDList.IndexOfName(Nickname) <> -1 then raise Exception.Create('Nickname already in use'); + s := VarToWideStr(Session['nick']); + if s <> '' then + UserClientIDList.Delete(UserClientIDList.IndexOfName(s)); + + + RegisterEventClient({$IFDEF UNICODE}WideStringToAnsiString{$ENDIF}(GuidToString(self.ClientID)), 'IChatEvents'); + ev := (EventRepository as IChatEvents_Writer); + ev.ExcludeSender := False; + ev.SessionList.Add(GuidToString(Session.SessionID)); + + for i := 0 to UserClientIDList.Count - 1 do begin + ev.UserLogin(Session.SessionID, UserClientIDList.Names[i]); + end; + + UserClientIDList.Add(Nickname + '=' + GUIDToString(Session.SessionID)); + + ev := (EventRepository as IChatEvents_Writer); + ev.ExcludeSender := False; + for i := 0 to UserClientIDList.Count - 1 do + ev.SessionList.Add(Copy(UserClientIDList[i], pos('=', UserClientIDList[i])+1, MaxInt)); + ev.UserLogin(Session.SessionID, Nickname); + finally + UserClientIDListCs.Release; + end; + Session['nick'] := Nickname; +end; + +procedure TLoginService.Logout; +var + i: Integer; + ev: IChatEvents_Writer; + s: Widestring; +begin + UserClientIDListCs.Acquire; + s := VarToWideStr(Session['nick']); + try + i := UserClientIDList.IndexOfName(s); + if i <> -1 then + UserClientIDList.Delete(i); + finally + UserClientIDListCs.Release; + end; + ev := (EventRepository as IChatEvents_Writer); + ev.ExcludeSender := False; + ev.UserLogout(Session.SessionID, s); + UnregisterEventClient({$IFDEF UNICODE}WideStringToAnsiString{$ENDIF}(GUIDToString(ClientID)), 'IChatEvents'); + DestroySession; +end; + +initialization + TROClassFactory.Create('LoginService', Create_LoginService, TLoginService_Invoker); + +finalization + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/RODLFILE.res new file mode 100644 index 0000000..8c6b33a Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.Sample.html new file mode 100644 index 0000000..80ff876 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.Sample.html @@ -0,0 +1,29 @@ + + + + + + + + + +

    + SuperTCP Channel Chat +

    + + +

    Purpose

    + +

    This sample shows how the Super TCP Channel can be used to create a chat server and clients. +
    +Unlike the HTTP Chat sample, this sample doesn't poll the server + but sends events back to clients directly.

    + +

    + Note: to test this sample properly, you need to open at least three clients. +
    + Each client instance will provide a default login user name, + but you can modify these as needed (there is no verification provided in this simple sample). +

    + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.bdsgroup new file mode 100644 index 0000000..42cc3e6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + SuperTCPChannelChat_Server.bdsproj + SuperTCPChannelChat_Client.bdsproj + SuperTCPChannelChat_Server.exe SuperTCPChannelChat_Client.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.bpg new file mode 100644 index 0000000..ce3c2fa --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = SuperTCPChannelChat_Server.exe SuperTCPChannelChat_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +SuperTCPChannelChat_Server.exe: SuperTCPChannelChat_Server.dpr + $(DCC) + +SuperTCPChannelChat_Client.exe: SuperTCPChannelChat_Client.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.groupproj new file mode 100644 index 0000000..3d46358 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat.groupproj @@ -0,0 +1,40 @@ + + + {352fd1c6-4fbe-4ec9-bc17-20a16a676c6f} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChatLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChatLibrary.rodl new file mode 100644 index 0000000..1145332 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChatLibrary.rodl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChatLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChatLibrary_Intf.pas new file mode 100644 index 0000000..ff35c65 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChatLibrary_Intf.pas @@ -0,0 +1,375 @@ +unit SuperTCPChannelChatLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROXMLIntf, uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{8A53A750-1F2B-4060-AAC0-77B4FC071D2D}'; + TargetNamespace = ''; + + { Service Interface ID's } + IChatServerService_IID : TGUID = '{6CC2111F-DDD6-4CF5-AB57-2CD98EF4FF5B}'; + ILoginService_IID : TGUID = '{3D19AEB1-6D2F-4142-B937-B97367133A2F}'; + + { Event ID's } + EID_ChatEvents = 'ChatEvents'; + +type + { Forward declarations } + IChatServerService = interface; + ILoginService = interface; + + IChatEvents = interface; + + + { IChatServerService } + IChatServerService = interface + ['{6CC2111F-DDD6-4CF5-AB57-2CD98EF4FF5B}'] + procedure TalkPrivate(const TargetNickname: Widestring; const Message: Widestring); + procedure Talk(const Message: Widestring); + end; + + { CoChatServerService } + CoChatServerService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IChatServerService; + end; + + { TChatServerService_Proxy } + TChatServerService_Proxy = class(TROProxy, IChatServerService) + protected + function __GetInterfaceName:string; override; + + procedure TalkPrivate(const TargetNickname: Widestring; const Message: Widestring); + procedure Talk(const Message: Widestring); + end; + + { ILoginService } + ILoginService = interface + ['{3D19AEB1-6D2F-4142-B937-B97367133A2F}'] + procedure Login(const Nickname: Widestring); + procedure Logout; + end; + + { CoLoginService } + CoLoginService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginService; + end; + + { TLoginService_Proxy } + TLoginService_Proxy = class(TROProxy, ILoginService) + protected + function __GetInterfaceName:string; override; + + procedure Login(const Nickname: Widestring); + procedure Logout; + end; + + { IChatEvents } + IChatEvents = interface + ['{C456D3B2-E44A-4FA6-8F71-3838D7F7525B}'] + procedure Message(const From: Widestring; const Target: Widestring; const Message: Widestring); + procedure UserLogin(const Nickname: Widestring); + procedure UserLogout(const Nickname: Widestring); + procedure ShutdownServer; + end; + + { IChatEvents_Writer } + IChatEvents_Writer = interface(IROEventWriter) + ['{C456D3B2-E44A-4FA6-8F71-3838D7F7525B}'] + procedure Message(const __Sender : TGUID; const From: Widestring; const Target: Widestring; const Message: Widestring); + procedure UserLogin(const __Sender : TGUID; const Nickname: Widestring); + procedure UserLogout(const __Sender : TGUID; const Nickname: Widestring); + procedure ShutdownServer(const __Sender : TGUID); + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uROSerializer, uRORes; + +{ CoChatServerService } + +class function CoChatServerService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IChatServerService; +begin + result := TChatServerService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TChatServerService_Proxy } + +function TChatServerService_Proxy.__GetInterfaceName:string; +begin + result := 'ChatServerService'; +end; + +procedure TChatServerService_Proxy.TalkPrivate(const TargetNickname: Widestring; const Message: Widestring); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SuperTCPChannelChatLibrary', __InterfaceName, 'TalkPrivate'); + __Message.Write('TargetNickname', TypeInfo(Widestring), TargetNickname, []); + __Message.Write('Message', TypeInfo(Widestring), Message, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TChatServerService_Proxy.Talk(const Message: Widestring); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SuperTCPChannelChatLibrary', __InterfaceName, 'Talk'); + __Message.Write('Message', TypeInfo(Widestring), Message, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +{ CoLoginService } + +class function CoLoginService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ILoginService; +begin + result := TLoginService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TLoginService_Proxy } + +function TLoginService_Proxy.__GetInterfaceName:string; +begin + result := 'LoginService'; +end; + +procedure TLoginService_Proxy.Login(const Nickname: Widestring); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SuperTCPChannelChatLibrary', __InterfaceName, 'Login'); + __Message.Write('Nickname', TypeInfo(Widestring), Nickname, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.UnsetAttributes(__TransportChannel); + __Message.FreeStream; + end +end; + +procedure TLoginService_Proxy.Logout; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'SuperTCPChannelChatLibrary', __InterfaceName, 'Logout'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + finally + __Message.FreeStream; + end +end; + +type + { TChatEvents_Writer } + TChatEvents_Writer = class(TROEventWriter, IChatEvents_Writer) + protected + procedure Message(const __Sender : TGUID; const From: Widestring; const Target: Widestring; const Message: Widestring); + procedure UserLogin(const __Sender : TGUID; const Nickname: Widestring); + procedure UserLogout(const __Sender : TGUID; const Nickname: Widestring); + procedure ShutdownServer(const __Sender : TGUID); + end; + +procedure TChatEvents_Writer.Message(const __Sender : TGUID; const From: Widestring; const Target: Widestring; const Message: Widestring); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'SuperTCPChannelChatLibrary', EID_ChatEvents, 'Message'); + __Message.Write('From', TypeInfo(Widestring), From, []); + __Message.Write('Target', TypeInfo(Widestring), Target, []); + __Message.Write('Message', TypeInfo(Widestring), Message, []); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +procedure TChatEvents_Writer.UserLogin(const __Sender : TGUID; const Nickname: Widestring); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'SuperTCPChannelChatLibrary', EID_ChatEvents, 'UserLogin'); + __Message.Write('Nickname', TypeInfo(Widestring), Nickname, []); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +procedure TChatEvents_Writer.UserLogout(const __Sender : TGUID; const Nickname: Widestring); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'SuperTCPChannelChatLibrary', EID_ChatEvents, 'UserLogout'); + __Message.Write('Nickname', TypeInfo(Widestring), Nickname, []); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +procedure TChatEvents_Writer.ShutdownServer(const __Sender : TGUID); +var __eventdata : Binary; +begin + __eventdata := Binary.Create; + try + __Message.InitializeEventMessage(NIL, 'SuperTCPChannelChatLibrary', EID_ChatEvents, 'ShutdownServer'); + __Message.Finalize; + + __Message.WriteToStream(__eventdata); + + Repository.StoreEventData(__Sender, __eventdata, ExcludeSender, ExcludeSessionList, SessionList.CommaText); + finally + __eventdata.Free; + end; +end; + +type + { TChatEvents_Invoker } + TChatEvents_Invoker = class(TROEventInvoker) + published + procedure Invoke_Message(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + procedure Invoke_UserLogin(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + procedure Invoke_UserLogout(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + procedure Invoke_ShutdownServer(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); + end; + +procedure TChatEvents_Invoker.Invoke_Message(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; + From: Widestring; + Target: Widestring; + Message: Widestring; +begin + + try + __Message.Read('From', TypeInfo(Widestring), From, []); + __Message.Read('Target', TypeInfo(Widestring), Target, []); + __Message.Read('Message', TypeInfo(Widestring), Message, []); + + (__Target as IChatEvents).Message(From, Target, Message); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + finally + __lObjectDisposer.Free(); + end + end +end; + +procedure TChatEvents_Invoker.Invoke_UserLogin(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; + Nickname: Widestring; +begin + + try + __Message.Read('Nickname', TypeInfo(Widestring), Nickname, []); + + (__Target as IChatEvents).UserLogin(Nickname); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + finally + __lObjectDisposer.Free(); + end + end +end; + +procedure TChatEvents_Invoker.Invoke_UserLogout(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; + Nickname: Widestring; +begin + + try + __Message.Read('Nickname', TypeInfo(Widestring), Nickname, []); + + (__Target as IChatEvents).UserLogout(Nickname); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + finally + __lObjectDisposer.Free(); + end + end +end; + +procedure TChatEvents_Invoker.Invoke_ShutdownServer(__EventReceiver : TROEventReceiver; const __Message : IROMessage; const __Target : IUnknown); +var +__lObjectDisposer: TROObjectDisposer; +begin + try + + (__Target as IChatEvents).ShutdownServer(); + + finally + __lObjectDisposer:= TROObjectDisposer.Create(__EventReceiver); + try + finally + __lObjectDisposer.Free(); + end + end +end; + +initialization + RegisterProxyClass(IChatServerService_IID, TChatServerService_Proxy); + RegisterProxyClass(ILoginService_IID, TLoginService_Proxy); + + RegisterEventWriterClass(IChatEvents_Writer, TChatEvents_Writer); + RegisterEventInvokerClass(EID_ChatEvents, TChatEvents_Invoker); + +finalization + UnregisterProxyClass(IChatServerService_IID); + UnregisterProxyClass(ILoginService_IID); + + UnregisterEventWriterClass(IChatEvents_Writer); + UnregisterEventInvokerClass(EID_ChatEvents); +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChatLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChatLibrary_Invk.pas new file mode 100644 index 0000000..85f7468 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChatLibrary_Invk.pas @@ -0,0 +1,140 @@ +unit SuperTCPChannelChatLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +{$I Remobjects.inc} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROXMLIntf, uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} SuperTCPChannelChatLibrary_Intf; + +type + TChatServerService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_TalkPrivate(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_Talk(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + + TLoginService_Invoker = class(TROInvoker) + private + protected + public + constructor Create; override; + published + procedure Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TChatServerService_Invoker } + +constructor TChatServerService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TChatServerService_Invoker.Invoke_TalkPrivate(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure TalkPrivate(const TargetNickname: Widestring; const Message: Widestring); } +var + TargetNickname: Widestring; + Message: Widestring; +begin + try + __Message.Read('TargetNickname', TypeInfo(Widestring), TargetNickname, []); + __Message.Read('Message', TypeInfo(Widestring), Message, []); + + (__Instance as IChatServerService).TalkPrivate(TargetNickname, Message); + + __Message.InitializeResponseMessage(__Transport, 'SuperTCPChannelChatLibrary', 'ChatServerService', 'TalkPrivateResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +procedure TChatServerService_Invoker.Invoke_Talk(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure Talk(const Message: Widestring); } +var + Message: Widestring; +begin + try + __Message.Read('Message', TypeInfo(Widestring), Message, []); + + (__Instance as IChatServerService).Talk(Message); + + __Message.InitializeResponseMessage(__Transport, 'SuperTCPChannelChatLibrary', 'ChatServerService', 'TalkResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +{ TLoginService_Invoker } + +constructor TLoginService_Invoker.Create; +begin + inherited Create; + FAbstract := False; +end; + +procedure TLoginService_Invoker.Invoke_Login(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure Login(const Nickname: Widestring); } +var + Nickname: Widestring; +begin + try + __Message.Read('Nickname', TypeInfo(Widestring), Nickname, []); + + (__Instance as ILoginService).Login(Nickname); + + __Message.InitializeResponseMessage(__Transport, 'SuperTCPChannelChatLibrary', 'LoginService', 'LoginResponse'); + __Message.Finalize; + __Message.UnsetAttributes(__Transport); + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +procedure TLoginService_Invoker.Invoke_Logout(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure Logout; } +begin + try + (__Instance as ILoginService).Logout; + + __Message.InitializeResponseMessage(__Transport, 'SuperTCPChannelChatLibrary', 'LoginService', 'LogoutResponse'); + __Message.Finalize; + + __oResponseOptions := [roNoResponse]; + + finally + end; +end; + +initialization +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.bdsproj new file mode 100644 index 0000000..47723f9 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + SuperTCPChannelChat_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.dpr new file mode 100644 index 0000000..76f79e8 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.dpr @@ -0,0 +1,14 @@ +program SuperTCPChannelChat_Client; + +uses + uROComInit, + Forms, + SuperTCPChannelChat_ClientMain in 'SuperTCPChannelChat_ClientMain.pas' {SuperTCPChannelChat_ClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TSuperTCPChannelChat_ClientMainForm, SuperTCPChannelChat_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.dproj new file mode 100644 index 0000000..d61eaca --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.dproj @@ -0,0 +1,72 @@ + + + {7d065047-d58a-4b2c-a706-00fb58c52394} + SuperTCPChannelChat_Client.dpr + Debug + AnyCPU + DCC32 + SuperTCPChannelChat_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + SuperTCPChannelChat_Client.dpr + + + + + + + MainSource + + +
    SuperTCPChannelChat_ClientMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.res new file mode 100644 index 0000000..0f940ed Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Client.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ClientMain.dfm new file mode 100644 index 0000000..30e7a83 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ClientMain.dfm @@ -0,0 +1,110 @@ +object SuperTCPChannelChat_ClientMainForm: TSuperTCPChannelChat_ClientMainForm + Left = 92 + Top = 108 + AutoScroll = False + Caption = 'SuperTCPChannelChat - Client' + ClientHeight = 244 + ClientWidth = 424 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 12 + Top = 12 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object edOutput: TMemo + Left = 12 + Top = 62 + Width = 282 + Height = 143 + Anchors = [akLeft, akTop, akRight, akBottom] + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 0 + end + object edUsers: TListBox + Left = 300 + Top = 62 + Width = 112 + Height = 143 + Anchors = [akTop, akRight, akBottom] + ItemHeight = 13 + Items.Strings = ( + '[All Users]') + TabOrder = 1 + end + object edText: TEdit + Left = 12 + Top = 211 + Width = 315 + Height = 21 + Anchors = [akLeft, akRight, akBottom] + TabOrder = 2 + end + object SendButton: TButton + Left = 333 + Top = 209 + Width = 79 + Height = 22 + Anchors = [akRight, akBottom] + Caption = '&Send' + Default = True + TabOrder = 3 + OnClick = SendButtonClick + end + object LogonButton: TButton + Left = 336 + Top = 5 + Width = 75 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Log On' + TabOrder = 4 + OnClick = LogonButtonClick + end + object LogoffButton: TButton + Left = 336 + Top = 33 + Width = 75 + Height = 22 + Anchors = [akTop, akRight] + Caption = 'Log Off' + TabOrder = 5 + OnClick = LogoffButtonClick + end + object ROMessage: TROBinMessage + Left = 36 + Top = 8 + end + object ROChannel: TROSuperTcpChannel + ServerLocators = <> + DispatchOptions = [] + Host = 'localhost' + Left = 8 + Top = 8 + end + object RORemoteService: TRORemoteService + ServiceName = 'ChatServerService' + Message = ROMessage + Channel = ROChannel + Left = 64 + Top = 8 + end + object ROEventReceiver: TROEventReceiver + Message = ROMessage + Channel = ROChannel + ServiceName = 'LoginService' + Left = 241 + Top = 16 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ClientMain.pas new file mode 100644 index 0000000..8e0ad68 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ClientMain.pas @@ -0,0 +1,196 @@ +unit SuperTCPChannelChat_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROSuperTcpChannel, + uROPoweredByRemObjectsButton, SuperTCPChannelChatLibrary_Intf, + uROEventRepository; + +type + TSuperTCPChannelChat_ClientMainForm = class(TForm, IChatEvents) + ROMessage: TROBinMessage; + ROChannel: TROSuperTcpChannel; + RORemoteService: TRORemoteService; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + edOutput: TMemo; + edUsers: TListBox; + edText: TEdit; + SendButton: TButton; + ROEventReceiver: TROEventReceiver; + LogonButton: TButton; + LogoffButton: TButton; + procedure FormCreate(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure SendButtonClick(Sender: TObject); + procedure LogonButtonClick(Sender: TObject); + procedure LogoffButtonClick(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormShow(Sender: TObject); + private + aUserName: string; + FConnected: Boolean; + lLogin: ILoginService; + lChat: IChatServerService; + { Private declarations } + public + procedure Message(const From: Widestring; const Target: Widestring; + const Message: Widestring); + procedure UserLogin(const Nickname: Widestring); + procedure UserLogout(const Nickname: Widestring); + procedure ShutdownServer; + + procedure SyncCall(var Msg: TMessage); message WM_USER; + + end; + TSyncType = (stMessage, stUserLogin, stUserLogout); + TStringArray = array of Widestring; + +var + SuperTCPChannelChat_ClientMainForm: TSuperTCPChannelChat_ClientMainForm; + +implementation + +uses DateUtils; + +{$R *.dfm} + +{ TClientForm } + +procedure TSuperTCPChannelChat_ClientMainForm.Message(const From, Target, Message: Widestring); +var + Data: TStringArray; +begin + SetLength(Data, 3); + Data[0] := From; + Data[1] := Target; + Data[2] := Message; + SendMessage(Handle, WM_USER, Longint(stMessage), Longint(Data)); +end; + +procedure TSuperTCPChannelChat_ClientMainForm.UserLogin(const Nickname: Widestring); +var + Data: TStringArray; +begin + SetLength(Data, 1); + Data[0] := Nickname; + SendMessage(Handle, WM_USER, Longint(stUserLogin), Longint(Data)); +end; + +procedure TSuperTCPChannelChat_ClientMainForm.UserLogout(const Nickname: Widestring); +var + Data: TStringArray; +begin + SetLength(Data, 1); + Data[0] := Nickname; + SendMessage(Handle, WM_USER, Longint(stUserLogout), Longint(Data)); +end; + +procedure TSuperTCPChannelChat_ClientMainForm.FormCreate(Sender: TObject); +begin + Fconnected := False; + ROChannel.Host := 'localhost'; + lLogin := CoLoginService.Create(ROMessage, ROChannel); + lChat := CoChatServerService.Create(ROMessage, ROChannel); + ROEventReceiver.RegisterEventHandlers([EID_ChatEvents], [Self]); + ROEventReceiver.Activate; + aUserName := 'User' + IntToHex(GetTickCount and $FFFF, 4); +end; + +procedure TSuperTCPChannelChat_ClientMainForm.FormDestroy(Sender: TObject); +begin + ROEventReceiver.UnregisterEventHandlers([EID_ChatEvents]); +end; + +procedure TSuperTCPChannelChat_ClientMainForm.SendButtonClick(Sender: TObject); +var + idx: Integer; +begin + idx := edUsers.ItemIndex; + if idx < 1 then + lChat.Talk(edText.Text) + else + lChat.TalkPrivate(edUsers.Items[idx], edText.Text); + edText.Text := ''; + ActiveControl := edText; +end; + +procedure TSuperTCPChannelChat_ClientMainForm.SyncCall(var Msg: TMessage); +var + i: Integer; + lSyncType: TSyncType; + lData: TStringArray; +begin + lSyncType := TSyncType(Msg.WParam); + lData := TStringArray(Msg.LParam); + case lSyncType of + stMessage: begin + if lData[1] = '' then + SuperTCPChannelChat_ClientMainForm.edOutput.Lines.Add(Format('<%s> %s', [lData[0], lData[2]])) + else + SuperTCPChannelChat_ClientMainForm.edOutput.Lines.Add(Format('<%s: %s> %s', [lData[0], lData[1], lData[2]])); + end; + stUserLogin: + SuperTCPChannelChat_ClientMainForm.edUsers.Items.Add(lData[0]); + stUserLogout: begin + i := SuperTCPChannelChat_ClientMainForm.edUsers.Items.IndexOf(lData[0]); + if i <> -1 then + SuperTCPChannelChat_ClientMainForm.EdUsers.Items.Delete(i); + end; + end; +end; + +procedure TSuperTCPChannelChat_ClientMainForm.LogonButtonClick( + Sender: TObject); +begin + if not FConnected then try + if InputQuery('Username', 'Please enter your &username:', aUsername) then begin + lLogin.Login(aUsername); + Fconnected := True; + end; + finally + SendButton.Enabled := FConnected; + LogonButton.Enabled := not FConnected; + LogoffButton.Enabled := FConnected; + end; +end; + +procedure TSuperTCPChannelChat_ClientMainForm.LogoffButtonClick( + Sender: TObject); +begin + try + if FConnected then try + lLogin.Logout; + Fconnected := False; + while edUsers.Count > 1 do + edUsers.Items.Delete(1); + ROChannel.Active := False; + finally + SendButton.Enabled := FConnected; + LogonButton.Enabled := not FConnected; + LogoffButton.Enabled := FConnected; + end; + except + end; +end; + +procedure TSuperTCPChannelChat_ClientMainForm.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + LogoffButton.Click; +end; + +procedure TSuperTCPChannelChat_ClientMainForm.ShutdownServer; +begin + edOutput.Lines.Add('Server has been shutdown!'); + LogoffButton.Click; +end; + +procedure TSuperTCPChannelChat_ClientMainForm.FormShow(Sender: TObject); +begin + LogonButton.Click; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.bdsproj new file mode 100644 index 0000000..dd83339 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + SuperTCPChannelChat_Server.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.dpr new file mode 100644 index 0000000..bbe05ff --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.dpr @@ -0,0 +1,22 @@ +program SuperTCPChannelChat_Server; + +{#ROGEN:SuperTCPChannelChatLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + SuperTCPChannelChat_ServerMain in 'SuperTCPChannelChat_ServerMain.pas' {SuperTCPChannelChat_ServerMainForm}, + LoginService_Impl in 'LoginService_Impl.pas' {LoginService: TDARemoteService}, + ChatServerService_Impl in 'ChatServerService_Impl.pas' {ChatServerService: TDARemoteService}, + SuperTCPChannelChatLibrary_Intf in 'SuperTCPChannelChatLibrary_Intf.pas', + SuperTCPChannelChatLibrary_Invk in 'SuperTCPChannelChatLibrary_Invk.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'SuperTCPChannelChat - Server'; + Application.CreateForm(TSuperTCPChannelChat_ServerMainForm, SuperTCPChannelChat_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.dproj new file mode 100644 index 0000000..32d8e0d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.dproj @@ -0,0 +1,80 @@ + + + {7073a51d-5965-439b-aee5-bbb1c1109129} + SuperTCPChannelChat_Server.dpr + Debug + AnyCPU + DCC32 + SuperTCPChannelChat_Server.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + SuperTCPChannelChat_Server.dpr + + + + + + + MainSource + + +
    ChatServerService
    +
    + +
    LoginService
    +
    + + + +
    SuperTCPChannelChat_ServerMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.res new file mode 100644 index 0000000..95e15d9 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_Server.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ServerMain.dfm new file mode 100644 index 0000000..fc267aa --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ServerMain.dfm @@ -0,0 +1,49 @@ +object SuperTCPChannelChat_ServerMainForm: TSuperTCPChannelChat_ServerMainForm + Left = 76 + Top = 115 + BorderStyle = bsDialog + Caption = 'SuperTCPChannelChat - Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCloseQuery = FormCloseQuery + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredButton: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object ROMessage: TROBinMessage + Left = 40 + Top = 8 + end + object ROServer: TROSuperTcpServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + end> + EventRepository = ROEventRepository + OnClientDisconnected = ROServerClientDisconnected + Left = 8 + Top = 8 + end + object ROSessionManager: TROInMemorySessionManager + Left = 72 + Top = 8 + end + object ROEventRepository: TROInMemoryEventRepository + Message = ROMessage + SessionManager = ROSessionManager + Left = 104 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ServerMain.pas new file mode 100644 index 0000000..cf348d6 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Super TCP Channel Chat/SuperTCPChannelChat_ServerMain.pas @@ -0,0 +1,85 @@ +unit SuperTCPChannelChat_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROSuperTcpServer, uROSessions, uROEventRepository,SyncObjs; + +type + TSuperTCPChannelChat_ServerMainForm = class(TForm) + ROPoweredButton: TROPoweredByRemObjectsButton; + ROMessage: TROBinMessage; + ROServer: TROSuperTcpServer; + ROSessionManager: TROInMemorySessionManager; + ROEventRepository: TROInMemoryEventRepository; + procedure FormCreate(Sender: TObject); + procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure ROServerClientDisconnected(aChannel: IROTransport; + const aGuid: TGUID); + private + { Private declarations } + public + { Public declarations } + end; + +var + SuperTCPChannelChat_ServerMainForm: TSuperTCPChannelChat_ServerMainForm; + +var + UserClientIDList: TStringList; + UserClientIDListCs: TCriticalSection; + +implementation +uses + SuperTCPChannelChatLibrary_Intf; +{$R *.dfm} + +procedure TSuperTCPChannelChat_ServerMainForm.FormCreate(Sender: TObject); +begin + ROServer.Active := true; +end; + +procedure TSuperTCPChannelChat_ServerMainForm.FormCloseQuery( + Sender: TObject; var CanClose: Boolean); +var + ev: IChatEvents_Writer; +begin + ev := (ROEventRepository as IChatEvents_Writer); + ev.ShutdownServer(EmptyGUID); + Sleep(2000); // allow clients to gracefully logout. +end; + +procedure TSuperTCPChannelChat_ServerMainForm.ROServerClientDisconnected( + aChannel: IROTransport; const aGuid: TGUID); +var + ev: IChatEvents_Writer; + s: TROSession; + i: integer; +begin + s := ROSessionManager.FindSession(aGuid,False); + ev := (ROEventRepository as IChatEvents_Writer); + ev.ExcludeSender := False; + if s <> nil then begin + UserClientIDListCs.Acquire; + try + i := UserClientIDList.IndexOfName(S['nick']); + if i <> -1 then UserClientIDList.Delete(i); + finally + UserClientIDListCs.Release; + end; + ev.UserLogout(aGuid, s['nick']); + end; + ROEventRepository.RemoveSession(aGuid); + ROSessionManager.DeleteSession(aGuid, False); +end; + +initialization + UserClientIDList := TStringList.Create; + UserClientIDListCs := TCriticalSection.Create; +finalization + UserClientIDListCs.Free; + UserClientIDList.Free; +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/RODLFILE.res new file mode 100644 index 0000000..469544d Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TfrmServerSelectSrc.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TfrmServerSelectSrc.dfm new file mode 100644 index 0000000..3594a18 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TfrmServerSelectSrc.dfm @@ -0,0 +1,52 @@ +object frmServerSelect: TfrmServerSelect + Left = 501 + Top = 272 + BorderStyle = bsDialog + Caption = 'frmServerSelect' + ClientHeight = 323 + ClientWidth = 392 + Color = clBtnFace + OldCreateOrder = False + PixelsPerInch = 96 + TextHeight = 13 + object lbServers: TCheckListBox + Left = 8 + Top = 8 + Width = 369 + Height = 249 + OnClickCheck = lbServersClickCheck + ItemHeight = 13 + Items.Strings = ( + '1' + '2' + '3') + Sorted = True + TabOrder = 0 + end + object pnlButtons: TPanel + Left = 0 + Top = 282 + Width = 392 + Height = 41 + Align = alBottom + TabOrder = 1 + object btnOk: TButton + Left = 224 + Top = 8 + Width = 75 + Height = 25 + Caption = '&Ok' + ModalResult = 1 + TabOrder = 0 + end + object btCancel: TButton + Left = 304 + Top = 8 + Width = 75 + Height = 25 + Caption = '&Cancel' + ModalResult = 2 + TabOrder = 1 + end + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TfrmServerSelectSrc.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TfrmServerSelectSrc.pas new file mode 100644 index 0000000..0e15669 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TfrmServerSelectSrc.pas @@ -0,0 +1,104 @@ +unit TfrmServerSelectSrc; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, CheckLst, + TXPBrdCastServerSrc, + uROServer; + +type + TfrmServerSelect = class(TForm) + lbServers: TCheckListBox; + pnlButtons: TPanel; + btnOk: TButton; + btCancel: TButton; + procedure lbServersClickCheck(Sender: TObject); + private + fBrdCstSvr: TXPBrdCastServer; + fSvrItems: TXPServerCollection; + protected + procedure RefreshServers; + procedure AddServer(aServer: TROServer); + procedure RemoveServer(aServer: TROServer); + public + constructor Create(aBrdCstServer : TXPBrdCastServer); reintroduce; + end; + + +implementation + +{$R *.dfm} + +{ TfrmServerSelect } + +constructor TfrmServerSelect.Create(aBrdCstServer: TXPBrdCastServer); +begin + inherited Create(nil); + fBrdCstSvr := aBrdCstServer; + + if Assigned(fBrdCstSvr) + then fSvrItems := fBrdCstSvr.ExportedServers + else fSvrItems := nil; + + RefreshServers; +end; + +procedure TfrmServerSelect.RefreshServers; +var lOwner: TComponent; + i,Idx: Integer; +begin + lbServers.Clear; + if not(Assigned(fBrdCstSvr)) then + Exit; + + lOwner := fBrdCstSvr.Owner; + if not(Assigned(lOwner)) then + Exit; + + // Get all the ROServers from the owner of the TXPBrdCastServer + for i := 0 to lOwner.ComponentCount-1 do + begin + if lOwner.Components[i].InheritsFrom(TROServer) then + begin + if not(lOwner.Components[i].InheritsFrom(TXPBrdCastServer)) then + lbServers.AddItem(lOwner.Components[i].Name,lOwner.Components[i]); + end; + end; + + // Set checkmark for all servers containd in ExposedServers + for i := 0 to fSvrItems.Count-1 do + begin + Idx := lbServers.Items.IndexOfObject(fSvrItems.Servers[i]); + if Idx >= 0 then + begin + lbServers.Checked[Idx] := True; + end; + end; + +end; + +procedure TfrmServerSelect.lbServersClickCheck(Sender: TObject); +begin + if lbServers.Checked[lbServers.ItemIndex] + then AddServer(TROServer(lbServers.Items.Objects[lbServers.ItemIndex])) + else RemoveServer(TROServer(lbServers.Items.Objects[lbServers.ItemIndex])); + +end; + +procedure TfrmServerSelect.AddServer(aServer: TROServer); +begin + if not(Assigned(aServer)) then + Exit; + fSvrItems.AddServer(aServer); +end; + +procedure TfrmServerSelect.RemoveServer(aServer: TROServer); +begin + if not(Assigned(aServer)) then + Exit; + fSvrItems.DeleteServer(aServer); +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.bdsproj new file mode 100644 index 0000000..b1bdf5d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + TimeServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.dpr new file mode 100644 index 0000000..a8598a2 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.dpr @@ -0,0 +1,20 @@ +program TimeServer; + +{#ROGEN:TimeServer.rodl} // RemObjects: Careful, do not remove! + +uses + Forms, + TimeServer_ServerMain in 'TimeServer_ServerMain.pas' {TimeServer_ServerMainForm}, + TimeServer_Intf in 'TimeServer_Intf.pas', + TimeServer_Invk in 'TimeServer_Invk.pas', + TimeServer_Impl in 'TimeServer_Impl.pas'; + +{$R *.RES} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.Title := 'Time Server'; + Application.CreateForm(TTimeServer_ServerMainForm, TimeServer_ServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.dproj new file mode 100644 index 0000000..8c9e7bd --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.dproj @@ -0,0 +1,75 @@ + + + {4814a248-a012-4462-8202-c9312422846a} + TimeServer.dpr + Debug + AnyCPU + DCC32 + TimeServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + TimeServer.dpr + + + + + + + MainSource + + + + + +
    TimeServer_ServerMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.res new file mode 100644 index 0000000..b72ce48 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.rodl new file mode 100644 index 0000000..fa39afe --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer.rodl @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.Sample.html new file mode 100644 index 0000000..76b4ebe --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.Sample.html @@ -0,0 +1,18 @@ + + + + + + + + + +

    + Time Server Sample +

    + +

    Purpose

    +

    This is an extremely basic sample illustrating how to use the TROBroadcastServer and TROBroadcastChannel components.

    + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.bdsgroup new file mode 100644 index 0000000..045a814 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + TimeServer.bdsproj + TimeServer_Client.bdsproj + TimeServer.exe TimeServer_Client.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.bpg new file mode 100644 index 0000000..b904350 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = TimeServer.exe TimeServer_Client.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +TimeServer.exe: TimeServer.dpr + $(DCC) + +TimeServer_Client.exe: TimeServer_Client.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.groupproj new file mode 100644 index 0000000..e8a4246 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServerGroup.groupproj @@ -0,0 +1,40 @@ + + + {be071276-ccf9-403b-899d-27eaddb3adba} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.bdsproj new file mode 100644 index 0000000..0d80d9e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + TimeServer_Client.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.dpr new file mode 100644 index 0000000..82d8da0 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.dpr @@ -0,0 +1,15 @@ +program TimeServer_Client; + +uses + Forms, + TimeServer_ClientMain in 'TimeServer_ClientMain.pas' {TimeServer_ClientMainForm}, + TimeServer_Intf in 'TimeServer_Intf.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.Title := 'Time Client'; + Application.CreateForm(TTimeServer_ClientMainForm, TimeServer_ClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.dproj new file mode 100644 index 0000000..efd159a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.dproj @@ -0,0 +1,73 @@ + + + {04a61aab-fbdf-4651-bba7-a097a06d5b04} + TimeServer_Client.dpr + Debug + AnyCPU + DCC32 + TimeServer_Client.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + TimeServer_Client.dpr + + + + + + + MainSource + + +
    TimeServer_ClientMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.res new file mode 100644 index 0000000..852a6c3 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Client.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ClientMain.dfm new file mode 100644 index 0000000..54123c3 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ClientMain.dfm @@ -0,0 +1,60 @@ +object TimeServer_ClientMainForm: TTimeServer_ClientMainForm + Left = 422 + Top = 409 + AutoScroll = False + Caption = 'TimeServer Client' + ClientHeight = 217 + ClientWidth = 285 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 37 + Top = 2 + Width = 212 + Height = 48 + Cursor = crHandPoint + ApplicationType = atClient + end + object TimeButton: TButton + Left = 87 + Top = 192 + Width = 113 + Height = 22 + Anchors = [akLeft, akBottom] + Caption = 'Get Time' + TabOrder = 0 + OnClick = TimeButtonClick + end + object mmRequest: TMemo + Left = 0 + Top = 53 + Width = 286 + Height = 133 + Align = alCustom + Anchors = [akLeft, akTop, akRight, akBottom] + Lines.Strings = ( + '') + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 1 + end + object BINMessage: TROBinMessage + Left = 152 + Top = 16 + end + object ROBroadcastChannel: TROBroadcastChannel + ServerLocators = <> + DispatchOptions = [] + Retrys = 2 + IndyClient.BroadcastEnabled = True + IndyClient.Port = 8090 + IndyClient.ReceiveTimeout = 100 + Port = 8090 + Left = 56 + Top = 16 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ClientMain.pas new file mode 100644 index 0000000..ff6ab33 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ClientMain.pas @@ -0,0 +1,47 @@ +unit TimeServer_ClientMain; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, TimeServer_Intf, + StdCtrls, uROClient, uROBINMessage, uROSOAPMessage, + uROIndyUDPChannel, uROBroadcastChannel, uROPoweredByRemObjectsButton; + +type + TTimeServer_ClientMainForm = class(TForm) + TimeButton: TButton; + BINMessage: TROBINMessage; + mmRequest: TMemo; + ROBroadcastChannel: TROBroadcastChannel; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + procedure FormCreate(Sender: TObject); + procedure TimeButtonClick(Sender: TObject); + private + FTimeServer: ITimeServer; + public + { Public declarations } + end; + +var + TimeServer_ClientMainForm: TTimeServer_ClientMainForm; + +implementation + +{$R *.dfm} + +procedure TTimeServer_ClientMainForm.FormCreate(Sender: TObject); +begin + FTimeServer := CoTimeServer.Create(BINMessage,ROBroadcastChannel); +end; + +procedure TTimeServer_ClientMainForm.TimeButtonClick(Sender: TObject); +var Time: String; +begin + mmRequest.Lines.Add('* Broadcasting Time request.'); + Time := DateTimeToStr(FTimeServer.GetServerTime); + mmRequest.Lines.Add('Received time from a server: '+Time); + mmRequest.Lines.Add(''); +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Impl.pas new file mode 100644 index 0000000..48c50bb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Impl.pas @@ -0,0 +1,52 @@ +unit TimeServer_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROServer, uROServerIntf, + {Generated:} TimeServer_Intf; + +type + TTimeServer = class(TRORemotable, ITimeServer) + private + protected + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + end; + +implementation + +uses + {Generated:} TimeServer_Invk, TimeServer_ServerMain; + +procedure Create_TimeServer(out anInstance : IUnknown); +begin + anInstance := TTimeServer.Create; +end; + +function TTimeServer.Sum(const A: Integer; const B: Integer): Integer; +begin + result := A+B; + TimeServer_ServerMainForm.mmRequest.Lines.Add('* Processing Sum request.'); +end; + +function TTimeServer.GetServerTime: DateTime; +begin + result := Now; + TimeServer_ServerMainForm.mmRequest.Lines.Add('* Processing Time request.'); +end; + +initialization + TROClassFactory.Create('TimeServer', Create_TimeServer, TTimeServer_Invoker); + +finalization + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Intf.pas new file mode 100644 index 0000000..e3e410a --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Intf.pas @@ -0,0 +1,109 @@ +unit TimeServer_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{CD4F46E5-B0FA-4AF9-9B7E-6E01FE096885}'; + + { Service Interface ID's } + ITimeServer_IID : TGUID = '{CD4F46E5-B0FA-4AF9-9B7E-6E01FE096885}'; + + { Event ID's } + +type + { Forward declarations } + ITimeServer = interface; + + + { ITimeServer } + ITimeServer = interface + ['{CD4F46E5-B0FA-4AF9-9B7E-6E01FE096885}'] + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + end; + + { CoTimeServer } + CoTimeServer = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ITimeServer; + end; + + { TTimeServer_Proxy } + TTimeServer_Proxy = class(TROProxy, ITimeServer) + protected + function __GetInterfaceName:string; override; + + function Sum(const A: Integer; const B: Integer): Integer; + function GetServerTime: DateTime; + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ CoTimeServer } + +class function CoTimeServer.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): ITimeServer; +begin + result := TTimeServer_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TTimeServer_Proxy } + +function TTimeServer_Proxy.__GetInterfaceName:string; +begin + result := 'TimeServer'; +end; + +function TTimeServer_Proxy.Sum(const A: Integer; const B: Integer): Integer; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'TimeServer', __InterfaceName, 'Sum'); + __Message.Write('A', TypeInfo(Integer), A, []); + __Message.Write('B', TypeInfo(Integer), B, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(Integer), result, []); + finally + __Message.FreeStream; + end +end; + +function TTimeServer_Proxy.GetServerTime: DateTime; +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'TimeServer', __InterfaceName, 'GetServerTime'); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('Result', TypeInfo(DateTime), result, [paIsDateTime]); + finally + __Message.FreeStream; + end +end; + +initialization + RegisterProxyClass(ITimeServer_IID, TTimeServer_Proxy); + + +finalization + UnregisterProxyClass(ITimeServer_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Invk.pas new file mode 100644 index 0000000..154162b --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_Invk.pas @@ -0,0 +1,71 @@ +unit TimeServer_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} TimeServer_Intf; + +type + TTimeServer_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TTimeServer_Invoker } + +procedure TTimeServer_Invoker.Invoke_Sum(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function Sum(const A: Integer; const B: Integer): Integer; } +var + A: Integer; + B: Integer; + lResult: Integer; +begin + try + __Message.Read('A', TypeInfo(Integer), A, []); + __Message.Read('B', TypeInfo(Integer), B, []); + + lResult := (__Instance as ITimeServer).Sum(A, B); + + __Message.InitializeResponseMessage(__Transport, 'TimeServer', 'TimeServer', 'SumResponse'); + __Message.Write('Result', TypeInfo(Integer), lResult, []); + __Message.Finalize; + + finally + end; +end; + +procedure TTimeServer_Invoker.Invoke_GetServerTime(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ function GetServerTime: DateTime; } +var + lResult: DateTime; +begin + try + lResult := (__Instance as ITimeServer).GetServerTime; + + __Message.InitializeResponseMessage(__Transport, 'TimeServer', 'TimeServer', 'GetServerTimeResponse'); + __Message.Write('Result', TypeInfo(DateTime), lResult, [paIsDateTime]); + __Message.Finalize; + + finally + end; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ServerMain.dfm new file mode 100644 index 0000000..378a857 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ServerMain.dfm @@ -0,0 +1,53 @@ +object TimeServer_ServerMainForm: TTimeServer_ServerMainForm + Left = 422 + Top = 301 + AutoScroll = False + Caption = 'TimeServer' + ClientHeight = 217 + ClientWidth = 285 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 36 + Top = 2 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object mmRequest: TMemo + Left = 0 + Top = 54 + Width = 285 + Height = 163 + Align = alBottom + Anchors = [akLeft, akTop, akRight, akBottom] + Lines.Strings = ( + '') + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 0 + end + object ROMessage: TROBinMessage + Left = 51 + Top = 59 + end + object UDPServer: TROBroadcastServer + Dispatchers = < + item + Name = 'ROMessage' + Message = ROMessage + Enabled = True + end> + IndyUDPServer.BroadcastEnabled = True + IndyUDPServer.Bindings = <> + IndyUDPServer.DefaultPort = 8090 + Port = 8090 + OnRORequest = UDPServerRORequest + Left = 25 + Top = 59 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ServerMain.pas new file mode 100644 index 0000000..5fcdd63 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Time Server/TimeServer_ServerMain.pas @@ -0,0 +1,47 @@ +unit TimeServer_ServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + StdCtrls, uROClient, uROBINMessage, uROClientIntf, uROServer, uROIndyTCPServer, + uROSOAPMessage, uROIndyUDPServer, uROBroadcastServer, + uROPoweredByRemObjectsButton; + +type + TTimeServer_ServerMainForm = class(TForm) + ROMessage: TROBINMessage; + UDPServer: TROBroadcastServer; + mmRequest: TMemo; + ROPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton; + procedure FormCreate(Sender: TObject); + procedure UDPServerRORequest(Sender: TObject); + private + + protected + + public + + end; + +var + TimeServer_ServerMainForm: TTimeServer_ServerMainForm; + +implementation + + +{$R *.DFM} + +procedure TTimeServer_ServerMainForm.FormCreate(Sender: TObject); +begin + UDPServer.Active := True; + mmRequest.Lines.Add({+UDPServer.IndyUDPServer.LocalName+}'Server is ready to receive broadcasts.'); + mmRequest.Lines.Add(''); +end; + +procedure TTimeServer_ServerMainForm.UDPServerRORequest(Sender: TObject); +begin + mmRequest.Lines.Add('Received a broadcast to process a RO message.'); +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/RODLFILE.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/RODLFILE.res new file mode 100644 index 0000000..ca0bbf4 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/RODLFILE.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.bdsproj new file mode 100644 index 0000000..b0b669e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + VariantsClient.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.dpr new file mode 100644 index 0000000..e115553 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.dpr @@ -0,0 +1,14 @@ +program VariantsClient; + +uses + uROComInit, + Forms, + VariantsClientMain in 'VariantsClientMain.pas' {VariantsClientMainForm}; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TVariantsClientMainForm, VariantsClientMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.dproj new file mode 100644 index 0000000..cb3eb41 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.dproj @@ -0,0 +1,72 @@ + + + {3f03bbe3-e281-4026-95ec-cb282e6ffcf4} + VariantsClient.dpr + Debug + AnyCPU + DCC32 + VariantsClient.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + VariantsClient.dpr + + + + + + + MainSource + + +
    VariantsClientMainForm
    +
    +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.res new file mode 100644 index 0000000..90e4219 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClient.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClientMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClientMain.dfm new file mode 100644 index 0000000..4c0d549 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClientMain.dfm @@ -0,0 +1,66 @@ +object VariantsClientMainForm: TVariantsClientMainForm + Left = 102 + Top = 118 + AutoScroll = False + Caption = 'Variants Client' + ClientHeight = 220 + ClientWidth = 328 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object TestButton: TButton + Left = 8 + Top = 8 + Width = 75 + Height = 25 + Caption = 'Test Variants' + TabOrder = 0 + OnClick = TestButtonClick + end + object Memo: TMemo + Left = 0 + Top = 81 + Width = 328 + Height = 139 + Align = alBottom + ScrollBars = ssVertical + TabOrder = 1 + end + object rgMessageType: TRadioGroup + Left = 96 + Top = 0 + Width = 225 + Height = 73 + Caption = 'Message' + TabOrder = 2 + OnClick = rgMessageTypeClick + end + object BINMessage: TROBinMessage + Left = 204 + Top = 96 + end + object HTTPChannel: TROWinInetHTTPChannel + ServerLocators = <> + DispatchOptions = [] + UserAgent = 'RemObjects SDK' + TargetURL = 'http://localhost:8099/BIN' + Left = 176 + Top = 96 + end + object RORemoteService: TRORemoteService + Message = BINMessage + Channel = HTTPChannel + ServiceName = 'NewService' + Left = 232 + Top = 96 + end + object SOAPMessage: TROSOAPMessage + SerializationOptions = [xsoWriteMultiRefArray, xsoWriteMultiRefObject] + Left = 144 + Top = 96 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClientMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClientMain.pas new file mode 100644 index 0000000..65f60be --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsClientMain.pas @@ -0,0 +1,210 @@ +unit VariantsClientMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROClientIntf, uRORemoteService, uROBinMessage, uROWinInetHTTPChannel, + ExtCtrls, uROSOAPMessage, VariantsLibrary_Intf; + +type + TVariantsClientMainForm = class(TForm) + BINMessage: TROBinMessage; + HTTPChannel: TROWinInetHTTPChannel; + RORemoteService: TRORemoteService; + TestButton: TButton; + Memo: TMemo; + SOAPMessage: TROSOAPMessage; + rgMessageType: TRadioGroup; + procedure TestButtonClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure rgMessageTypeClick(Sender: TObject); + private + fVariantsService: IVariantsService; + { Private declarations } + public + { Public declarations } + end; + +var + VariantsClientMainForm: TVariantsClientMainForm; + +implementation + +uses Variants; + +{$R *.dfm} + +procedure TVariantsClientMainForm.TestButtonClick(Sender: TObject); + + procedure CheckVariants(const InputVariant, OutputVariant: Variant; CheckType: boolean = TRUE); + var + v1, v2: integer; + begin + if (InputVariant <> OutputVariant) then + raise Exception.Create('Variants differ!'); + { if CheckType then begin + v1 := VarType(InputVariant); + v2 := VarType(OutputVariant); + if v1<>v2 then + raise Exception.CreateFmt('Variant TYPE is different (%d, %d)!', [v1, v2]); + end;} + end; + +var + inputvar, outputvar: Variant; + i: integer; + incomplex, outcomplex: TComplexObject; + inarray, outarray: TVariantArray; +begin + + // Complex object + incomplex := TComplexObject.Create; + incomplex.IntegerId := 101; + incomplex.VariantValue := 'My Variant'; + fVariantsService.EchoComplexObject(incomplex, outcomplex); + Memo.Lines.Add('Received ' + IntToStr(outcomplex.IntegerId) + ', ' + outcomplex.VariantValue); + incomplex.Free; + outcomplex.Free; + + // Simple variant array + if not (RORemoteService.Message is TROSOAPMessage) then begin + inputvar := VarArrayCreate([0, 10], varVariant); + i := 0; + for i := 0 to 10 do inputvar[i] := 'SomeText'; + fVariantsService.EchoVariant(inputvar, outputvar); + + for i := 0 to VarArrayHighBound(outputvar, 1) do + Memo.Lines.Add('Simple variant array item #' + IntToStr(i) + '=' + VarToStr(outputvar[i])); + end; + + // Variant array (complex type) + inarray := TVariantArray.Create; + inarray.Add('A string'); + inarray.Add(1); + inarray.Add(Now); + inarray.Add(True); + fVariantsService.EchoVariantArray(inarray, outarray); + for i := 0 to outarray.Count - 1 do + Memo.Lines.Add('Variant array item #' + IntToStr(i) + '=' + VarToStr(outarray[i])); + inarray.Free; + outarray.Free; + Memo.Lines.Add(''); + + // String + inputvar := 'Test'; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Shortint + inputvar := 12; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Byte + inputvar := 200; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Integer + inputvar := 123456; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Float + inputvar := 22.39; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar, FALSE); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Float (big one) + inputvar := 780000.32; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar, FALSE); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Shortint + inputvar := -12; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Byte + inputvar := -200; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Integer + inputvar := -123456; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Float + inputvar := -22.39; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar, FALSE); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Float (big one) + inputvar := -780000.32; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar, FALSE); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Datetime + inputvar := Now; + fVariantsService.EchoVariant(inputvar, outputvar); + // CheckVariants(inputvar, outputvar); // For some reason 2 equal datetimes seem different to Delphi (using SOAP) + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + // Boolean + inputvar := true; + fVariantsService.EchoVariant(inputvar, outputvar); + CheckVariants(inputvar, outputvar); + Memo.Lines.Add('Received ' + VarToStr(outputvar)); + + if (RORemoteService.Message is TROSOAPMessage) then Exit; + + // Array + Memo.Lines.Add(''); + inputvar := VarArrayCreate([0, 3], varVariant); + inputvar[0] := 1; + inputvar[1] := 1234.5678; + inputvar[2] := 'Hello world'; + inputvar[3] := True; + fVariantsService.EchoVariant(inputvar, outputvar); + + for i := 0 to VarArrayHighBound(outputvar, 1) do + Memo.Lines.Add('Array element #' + IntToStr(i) + ': ' + VarToStr(outputvar[i])); +end; + +procedure TVariantsClientMainForm.FormCreate(Sender: TObject); +var + i: integer; +begin + for i := 0 to ComponentCount - 1 do + if (Components[i] is TROMessage) then begin + rgMessageType.Items.AddObject(TROMessage(Components[i]).Name, Components[i]); + end; + + rgMessageType.ItemIndex := 1; + FVariantsService := (RORemoteService as IVariantsService); +end; + +procedure TVariantsClientMainForm.rgMessageTypeClick(Sender: TObject); +begin + RORemoteService.Message := TROMessage(rgMessageType.Items.Objects[rgMessageType.ItemIndex]); + FVariantsService := (RORemoteService as IVariantsService); + + if (RORemoteService.Message is TROSOAPMessage) then HTTPChannel.TargetURL := 'http://localhost:8099/SOAP' + else HTTPChannel.TargetURL := 'http://localhost:8099/BIN'; +end; + +end. + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.Sample.html b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.Sample.html new file mode 100644 index 0000000..51a7db7 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.Sample.html @@ -0,0 +1,31 @@ + + + + + + + + + +

    + Variants +

    + +

    Purpose

    + +

    This example shows how the RemObjects SDK can transfer variants and array of Variants from the client and server using the TROBinMessage and TROSOAPMessage message types.

    + +

    Examine the Code

    + +
      +
    • + See how the service is defined in the service library. Do this by making the server the selected project and by using the menu option: RemObjects | Edit Service Library. Note: if you don't see this menu option but see 'Service Builder' instead, you still have the client set as the current project. +
    • +
    • + Examine the simple code needed to invoke the methods in + VariantsClientMain.pas. +
    • +
    + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.bdsgroup b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.bdsgroup new file mode 100644 index 0000000..a7532eb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.bdsgroup @@ -0,0 +1,20 @@ + + + + + + + + + + + + + VariantsServer.bdsproj + VariantsClient.bdsproj + VariantsServer.exe VariantsClient.exe + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.bpg b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.bpg new file mode 100644 index 0000000..fd2c63c --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = VariantsServer.exe VariantsClient.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +VariantsServer.exe: VariantsServer.dpr + $(DCC) + +VariantsClient.exe: VariantsClient.dpr + $(DCC) + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.groupproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.groupproj new file mode 100644 index 0000000..2e2c50d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsGroup.groupproj @@ -0,0 +1,40 @@ + + + {ecb75d83-34ba-4d9e-8222-3bbf34aee98f} + + + + + Default.Personality + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsLibrary.rodl b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsLibrary.rodl new file mode 100644 index 0000000..3e56db3 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsLibrary.rodl @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsLibrary_Intf.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsLibrary_Intf.pas new file mode 100644 index 0000000..3db3e92 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsLibrary_Intf.pas @@ -0,0 +1,324 @@ +unit VariantsLibrary_Intf; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, TypInfo, + {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf; + +const + { Library ID } + LibraryUID = '{997272DF-9CE1-42FC-A341-669D18AE18ED}'; + + { Service Interface ID's } + IVariantsService_IID : TGUID = '{509D1C6D-51DF-4269-A160-DB5B5B671874}'; + + { Event ID's } + +type + { Forward declarations } + IVariantsService = interface; + + TVariantArray = class; + + TComplexObject = class; + + + { TComplexObject } + TComplexObject = class(TROComplexType) + private + fIntegerId: Integer; + fVariantValue: Variant; + public + procedure Assign(iSource: TPersistent); override; + published + property IntegerId:Integer read fIntegerId write fIntegerId; + property VariantValue:Variant read fVariantValue write fVariantValue; + end; + + { TComplexObjectCollection } + TComplexObjectCollection = class(TROCollection) + protected + constructor Create(aItemClass: TCollectionItemClass); overload; + function GetItems(Index: integer): TComplexObject; + procedure SetItems(Index: integer; const Value: TComplexObject); + public + constructor Create; overload; + function Add: TComplexObject; reintroduce; + property Items[Index: integer]:TComplexObject read GetItems write SetItems; default; + end; + + { TVariantArray } + TVariantArray = class(TROArray) + private + fCount: Integer; + fItems : array of Variant; + protected + procedure Grow; virtual; + function GetItems(Index: integer): Variant; + procedure SetItems(Index: integer; const Value: Variant); + function GetCount: integer; override; + public + class function GetItemType: PTypeInfo; override; + class function GetItemSize: integer; override; + function GetItemRef(Index: integer): pointer; override; + procedure Clear; override; + procedure Delete(Index: integer); override; + procedure Resize(ElementCount: integer); override; + + procedure Assign(iSource:TPersistent); override; + function Add(const Value:Variant): integer; + + property Count : integer read GetCount; + property Items[Index: integer]:Variant read GetItems write SetItems; default; + end; + + { IVariantsService } + IVariantsService = interface + ['{509D1C6D-51DF-4269-A160-DB5B5B671874}'] + procedure EchoVariant(const InputVariant: Variant; out OutputVariant: Variant); + procedure EchoComplexObject(const InComplexObject: TComplexObject; out OutComplexObject: TComplexObject); + procedure EchoVariantArray(const InArray: TVariantArray; out OutArray: TVariantArray); + end; + + { CoVariantsService } + CoVariantsService = class + class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IVariantsService; + end; + + { TVariantsService_Proxy } + TVariantsService_Proxy = class(TROProxy, IVariantsService) + protected + function __GetInterfaceName:string; override; + + procedure EchoVariant(const InputVariant: Variant; out OutputVariant: Variant); + procedure EchoComplexObject(const InComplexObject: TComplexObject; out OutComplexObject: TComplexObject); + procedure EchoVariantArray(const InArray: TVariantArray; out OutArray: TVariantArray); + end; + +implementation + +uses + {vcl:} SysUtils, + {RemObjects:} uROEventRepository, uRORes; + +{ TVariantArray } + +procedure TVariantArray.Assign(iSource: TPersistent); +var lSource:TVariantArray; + i:integer; +begin + if (iSource is TVariantArray) then begin + lSource := TVariantArray(iSource); + Clear(); + Resize(lSource.Count); + for i := 0 to Count-1 do begin + Items[i] := lSource.Items[i]; + end; + end + else begin + inherited Assign(iSource); + end; +end; + +class function TVariantArray.GetItemType: PTypeInfo; +begin + result := TypeInfo(Variant); +end; + +class function TVariantArray.GetItemSize: integer; +begin + result := SizeOf(Variant); +end; + +function TVariantArray.GetItems(Index: integer): Variant; +begin + if (Index < 0) or (Index >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[Index]); + result := fItems[Index]; +end; + +function TVariantArray.GetItemRef(Index: integer): pointer; +begin + if (Index < 0) or (Index >= Count) then RaiseError(err_ArrayIndexOutOfBounds,[Index]); + result := @fItems[Index]; +end; + +procedure TVariantArray.Clear; +begin + SetLength(fItems, 0); + FCount := 0; +end; + +procedure TVariantArray.Delete(Index: integer); +var i: integer; +begin + if (Index>=Count) then RaiseError(err_InvalidIndex, [Index]); + + if (Index= Count) then RaiseError(err_ArrayIndexOutOfBounds,[Index]); + fItems[Index] := Value; +end; + +procedure TVariantArray.Resize(ElementCount: integer); +begin + SetLength(fItems, ElementCount); + FCount := ElementCount; +end; + +function TVariantArray.GetCount: integer; +begin + result := FCount; +end; + +procedure TVariantArray.Grow; +var + Delta, Capacity: Integer; +begin + Capacity := Length(fItems); + if Capacity > 64 then + Delta := Capacity div 4 + else + if Capacity > 8 then + Delta := 16 + else + Delta := 4; + SetLength(fItems, Capacity + Delta); +end; + +function TVariantArray.Add(const Value: Variant): integer; +begin + Result := Count; + if Length(fItems) = Result then + Grow; + fItems[result] := Value; + Inc(fCount); +end; + +{ TComplexObject } + +procedure TComplexObject.Assign(iSource: TPersistent); +var lSource:TComplexObject; +begin + inherited Assign(iSource); + if (iSource is TComplexObject) then begin + lSource := TComplexObject(iSource); + IntegerId := lSource.IntegerId; + VariantValue := lSource.VariantValue; + end; +end; + +{ TComplexObjectCollection } +constructor TComplexObjectCollection.Create; +begin + inherited Create(TComplexObject); +end; + +constructor TComplexObjectCollection.Create(aItemClass: TCollectionItemClass); +begin + inherited Create(aItemClass); +end; + +function TComplexObjectCollection.Add: TComplexObject; +begin + result := TComplexObject(inherited Add); +end; + +function TComplexObjectCollection.GetItems(Index: integer): TComplexObject; +begin + result := TComplexObject(inherited Items[Index]); +end; + +procedure TComplexObjectCollection.SetItems(Index: integer; const Value: TComplexObject); +begin + TComplexObject(inherited Items[Index]).Assign(Value); +end; + +{ CoVariantsService } + +class function CoVariantsService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): IVariantsService; +begin + result := TVariantsService_Proxy.Create(aMessage, aTransportChannel); +end; + +{ TVariantsService_Proxy } + +function TVariantsService_Proxy.__GetInterfaceName:string; +begin + result := 'VariantsService'; +end; + +procedure TVariantsService_Proxy.EchoVariant(const InputVariant: Variant; out OutputVariant: Variant); +begin + try + __Message.InitializeRequestMessage(__TransportChannel, 'VariantsLibrary', __InterfaceName, 'EchoVariant'); + __Message.Write('InputVariant', TypeInfo(Variant), InputVariant, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('OutputVariant', TypeInfo(Variant), OutputVariant, []); + finally + __Message.FreeStream; + end +end; + +procedure TVariantsService_Proxy.EchoComplexObject(const InComplexObject: TComplexObject; out OutComplexObject: TComplexObject); +begin + try + OutComplexObject := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'VariantsLibrary', __InterfaceName, 'EchoComplexObject'); + __Message.Write('InComplexObject', TypeInfo(VariantsLibrary_Intf.TComplexObject), InComplexObject, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('OutComplexObject', TypeInfo(VariantsLibrary_Intf.TComplexObject), OutComplexObject, []); + finally + __Message.FreeStream; + end +end; + +procedure TVariantsService_Proxy.EchoVariantArray(const InArray: TVariantArray; out OutArray: TVariantArray); +begin + try + OutArray := nil; + __Message.InitializeRequestMessage(__TransportChannel, 'VariantsLibrary', __InterfaceName, 'EchoVariantArray'); + __Message.Write('InArray', TypeInfo(VariantsLibrary_Intf.TVariantArray), InArray, []); + __Message.Finalize; + + __TransportChannel.Dispatch(__Message); + + __Message.Read('OutArray', TypeInfo(VariantsLibrary_Intf.TVariantArray), OutArray, []); + finally + __Message.FreeStream; + end +end; + +initialization + RegisterROClass(TComplexObject); + RegisterROClass(TVariantArray); + RegisterProxyClass(IVariantsService_IID, TVariantsService_Proxy); + + +finalization + UnregisterROClass(TComplexObject); + UnregisterROClass(TVariantArray); + UnregisterProxyClass(IVariantsService_IID); + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsLibrary_Invk.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsLibrary_Invk.pas new file mode 100644 index 0000000..db6740e --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsLibrary_Invk.pas @@ -0,0 +1,112 @@ +unit VariantsLibrary_Invk; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ Do not modify this unit manually, or your changes will be lost when this } +{ unit is regenerated the next time you compile the project. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, + {RemObjects:} uROServer, uROServerIntf, uROTypes, uROClientIntf, + {Generated:} VariantsLibrary_Intf; + +type + TVariantsService_Invoker = class(TROInvoker) + private + protected + published + procedure Invoke_EchoVariant(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_EchoComplexObject(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + procedure Invoke_EchoVariantArray(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); + end; + +implementation + +uses + {RemObjects:} uRORes, uROClient; + +{ TVariantsService_Invoker } + +procedure TVariantsService_Invoker.Invoke_EchoVariant(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure EchoVariant(const InputVariant: Variant; out OutputVariant: Variant); } +var + InputVariant: Variant; + OutputVariant: Variant; +begin + try + __Message.Read('InputVariant', TypeInfo(Variant), InputVariant, []); + + (__Instance as IVariantsService).EchoVariant(InputVariant, OutputVariant); + + __Message.InitializeResponseMessage(__Transport, 'VariantsLibrary', 'VariantsService', 'EchoVariantResponse'); + __Message.Write('OutputVariant', TypeInfo(Variant), OutputVariant, []); + __Message.Finalize; + + finally + end; +end; + +procedure TVariantsService_Invoker.Invoke_EchoComplexObject(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure EchoComplexObject(const InComplexObject: TComplexObject; out OutComplexObject: TComplexObject); } +var + InComplexObject: VariantsLibrary_Intf.TComplexObject; + OutComplexObject: VariantsLibrary_Intf.TComplexObject; + __lObjectDisposer: TROObjectDisposer; +begin + InComplexObject := nil; + OutComplexObject := nil; + try + __Message.Read('InComplexObject', TypeInfo(VariantsLibrary_Intf.TComplexObject), InComplexObject, []); + + (__Instance as IVariantsService).EchoComplexObject(InComplexObject, OutComplexObject); + + __Message.InitializeResponseMessage(__Transport, 'VariantsLibrary', 'VariantsService', 'EchoComplexObjectResponse'); + __Message.Write('OutComplexObject', TypeInfo(VariantsLibrary_Intf.TComplexObject), OutComplexObject, []); + __Message.Finalize; + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(InComplexObject); + __lObjectDisposer.Add(OutComplexObject); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +procedure TVariantsService_Invoker.Invoke_EchoVariantArray(const __Instance:IInterface; const __Message:IROMessage; const __Transport:IROTransport; out __oResponseOptions:TROResponseOptions); +{ procedure EchoVariantArray(const InArray: TVariantArray; out OutArray: TVariantArray); } +var + InArray: VariantsLibrary_Intf.TVariantArray; + OutArray: VariantsLibrary_Intf.TVariantArray; + __lObjectDisposer: TROObjectDisposer; +begin + InArray := nil; + OutArray := nil; + try + __Message.Read('InArray', TypeInfo(VariantsLibrary_Intf.TVariantArray), InArray, []); + + (__Instance as IVariantsService).EchoVariantArray(InArray, OutArray); + + __Message.InitializeResponseMessage(__Transport, 'VariantsLibrary', 'VariantsService', 'EchoVariantArrayResponse'); + __Message.Write('OutArray', TypeInfo(VariantsLibrary_Intf.TVariantArray), OutArray, []); + __Message.Finalize; + + finally + __lObjectDisposer := TROObjectDisposer.Create(__Instance); + try + __lObjectDisposer.Add(InArray); + __lObjectDisposer.Add(OutArray); + finally + __lObjectDisposer.Free(); + end; + end; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.bdsproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.bdsproj new file mode 100644 index 0000000..46a956f --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.bdsproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + VariantsServer.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + + + + False + + + + + + False + + + True + False + + + + $00000000 + + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.dpr b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.dpr new file mode 100644 index 0000000..f1e3e55 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.dpr @@ -0,0 +1,20 @@ +program VariantsServer; + +{#ROGEN:VariantsLibrary.rodl} // RemObjects: Careful, do not remove! + +uses + uROComInit, + Forms, + VariantsServerMain in 'VariantsServerMain.pas' {VariantsServerMainForm}, + VariantsLibrary_Intf in 'VariantsLibrary_Intf.pas', + VariantsLibrary_Invk in 'VariantsLibrary_Invk.pas', + VariantsService_Impl in 'VariantsService_Impl.pas'; + +{$R *.res} +{$R RODLFile.res} + +begin + Application.Initialize; + Application.CreateForm(TVariantsServerMainForm, VariantsServerMainForm); + Application.Run; +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.dproj b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.dproj new file mode 100644 index 0000000..fabf576 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.dproj @@ -0,0 +1,75 @@ + + + {3360785c-eedb-4055-b208-6a68c355d46d} + VariantsServer.dpr + Debug + AnyCPU + DCC32 + VariantsServer.exe + + + 7.0 + False + False + 0 + RELEASE + + + 7.0 + DEBUG + + + Delphi.Personality + VCLApplication + + + False + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1058 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + VariantsServer.dpr + + + + + + + MainSource + + + + +
    VariantsServerMainForm
    +
    + +
    + +
    \ No newline at end of file diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.res b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.res new file mode 100644 index 0000000..b0dd731 Binary files /dev/null and b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServer.res differ diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServerMain.dfm b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServerMain.dfm new file mode 100644 index 0000000..35c0ddb --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServerMain.dfm @@ -0,0 +1,49 @@ +object VariantsServerMainForm: TVariantsServerMainForm + Left = 60 + Top = 50 + BorderStyle = bsDialog + Caption = 'Variants Server' + ClientHeight = 64 + ClientWidth = 228 + Color = clBtnFace + ParentFont = True + OldCreateOrder = False + Position = poScreenCenter + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object RoPoweredByRemObjectsButton1: TROPoweredByRemObjectsButton + Left = 8 + Top = 8 + Width = 212 + Height = 48 + Cursor = crHandPoint + end + object BINMessage: TROBinMessage + Left = 36 + Top = 8 + end + object ROServer: TROIndyHTTPServer + Dispatchers = < + item + Name = 'BINMessage' + Message = BINMessage + Enabled = True + PathInfo = 'Bin' + end + item + Name = 'ROSOAPMessage' + Message = ROSOAPMessage + Enabled = True + PathInfo = 'SOAP' + end> + Port = 8099 + Left = 8 + Top = 8 + end + object ROSOAPMessage: TROSOAPMessage + SerializationOptions = [xsoWriteMultiRefArray, xsoWriteMultiRefObject] + Left = 64 + Top = 8 + end +end diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServerMain.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServerMain.pas new file mode 100644 index 0000000..2d971c4 --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsServerMain.pas @@ -0,0 +1,36 @@ +unit VariantsServerMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, + uROClient, uROPoweredByRemObjectsButton, uROClientIntf, uROServer, + uROBinMessage, uROIndyHTTPServer, uROIndyTCPServer, uROSOAPMessage; + +type + TVariantsServerMainForm = class(TForm) + RoPoweredByRemObjectsButton1: TRoPoweredByRemObjectsButton; + BINMessage: TROBinMessage; + ROServer: TROIndyHTTPServer; + ROSOAPMessage: TROSOAPMessage; + procedure FormCreate(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + VariantsServerMainForm: TVariantsServerMainForm; + +implementation + + +{$R *.dfm} + +procedure TVariantsServerMainForm.FormCreate(Sender: TObject); +begin + ROServer.Active := true; +end; + +end. diff --git a/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsService_Impl.pas b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsService_Impl.pas new file mode 100644 index 0000000..01bfb3d --- /dev/null +++ b/internal/5.0.35.741/1/RemObjects SDK for Delphi/Samples/Variants/VariantsService_Impl.pas @@ -0,0 +1,61 @@ +unit VariantsService_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Generated:} VariantsLibrary_Intf; + +type + { TVariantsService } + TVariantsService = class(TRORemotable, IVariantsService) + private + protected + { IVariantsService methods } + procedure EchoVariant(const InputVariant: Variant; out OutputVariant: Variant); + procedure EchoComplexObject(const InComplexObject: TComplexObject; out OutComplexObject: TComplexObject); + procedure EchoVariantArray(const InArray: TVariantArray; out OutArray: TVariantArray); + end; + +implementation + +uses + {Generated:} VariantsLibrary_Invk; + +procedure Create_VariantsService(out anInstance: IUnknown); +begin + anInstance := TVariantsService.Create; +end; + +{ VariantsService } + +procedure TVariantsService.EchoVariant(const InputVariant: Variant; out OutputVariant: Variant); +begin + OutputVariant := InputVariant; +end; + +procedure TVariantsService.EchoComplexObject(const InComplexObject: TComplexObject; out OutComplexObject: TComplexObject); +begin + OutComplexObject := InComplexObject; +end; + +procedure TVariantsService.EchoVariantArray(const InArray: TVariantArray; out OutArray: TVariantArray); +begin + OutArray := InArray; +end; + +initialization + TROClassFactory.Create('VariantsService', Create_VariantsService, TVariantsService_Invoker); + +finalization + +end. +