From b0080184d2521b7fcfdeb652afd1e3090f593570 Mon Sep 17 00:00:00 2001 From: Daniele Teti Date: Thu, 10 Nov 2022 18:30:11 +0100 Subject: [PATCH] Improved Samples, mostrly ActiveRecord related --- samples/activerecord_showcase/EntitiesU.pas | 92 ++ .../FDConnectionConfigU.pas | 29 +- samples/activerecord_showcase/MainFormU.dfm | 23 +- samples/activerecord_showcase/MainFormU.pas | 56 +- samples/async_task/MainFormU.pas | 6 + .../JWTBlacklistServerSample.dpr | 1 - .../JWTBlacklistServerSample.dproj | 7 +- samples/serversentevents/SSESample.dpr | 10 +- samples/serversentevents/SSESample.dproj | 463 ++----- .../ServerSideViews.dproj | 386 +----- .../SimpleRESTAPIUsingDatasets.dproj | 430 ++----- .../CustomersControllerU.pas | 49 +- .../SimpleRESTAPIUsingActiveRecord.dpr | 62 +- .../SimpleRESTAPIUsingActiveRecord.dproj | 430 ++----- samples/winecellarclient/MainFormU.dfm | 26 +- samples/winecellarclient/MainFormU.pas | 21 +- .../winecellarclient/WineCellarClient.dproj | 1099 +---------------- samples/winecellarclient_mobile/MainFormU.fmx | 2 +- .../WineCellarMobileClient.dproj | 712 ++--------- .../winecellarserver/WineCellarServer.dproj | 1015 +-------------- sources/MVCFramework.ActiveRecord.pas | 21 +- .../general/Several/ActiveRecordTestsU.pas | 9 +- unittests/general/Several/BOs.pas | 2 +- 23 files changed, 761 insertions(+), 4190 deletions(-) diff --git a/samples/activerecord_showcase/EntitiesU.pas b/samples/activerecord_showcase/EntitiesU.pas index dcfe1344..06e442de 100644 --- a/samples/activerecord_showcase/EntitiesU.pas +++ b/samples/activerecord_showcase/EntitiesU.pas @@ -497,6 +497,75 @@ type property XML: String read fXML write fXML; end; + [MVCTable('customers')] + [MVCEntityActions([eaRetrieve])] //only the "R" in CRUD + TReadOnlyCustomer = class(TCustomer) + + end; + +// person, employee, manager + [MVCTable('people')] + [MVCEntityActions([])] //no CRUD operations allowed for this entity + TAbstractPerson = class abstract(TMVCActiveRecord) + private + [MVCTableField('id', [foPrimaryKey, foAutoGenerated])] + fID: NullableInt64; + [MVCTableField('last_name')] + fLastName: String; + [MVCTableField('first_name')] + fFirstName: String; + [MVCTableField('dob')] + fDob: NullableTDate; + [MVCTableField('full_name')] + fFullName: NullableString; + [MVCTableField('is_male')] + fIsMale: NullableBoolean; + [MVCTableField('note')] + fNote: NullableString; + [MVCTableField('photo')] + fPhoto: TStream; + function GetFullName: NullableString; + protected + procedure OnBeforeInsertOrUpdate; override; + public + constructor Create; override; + destructor Destroy; override; + property ID: NullableInt64 read fID write fID; + property LastName: String read fLastName write fLastName; + property FirstName: String read fFirstName write fFirstName; + property Dob: NullableTDate read fDob write fDob; + property FullName: NullableString read GetFullName; + property IsMale: NullableBoolean read fIsMale write fIsMale; + property Note: NullableString read fNote write fNote; + property Photo: TStream read fPhoto write fPhoto; + end; + + [MVCTable('people')] + [MVCPartition('person_type=(string)employee')] + TEmployee = class(TAbstractPerson) + private + [MVCTableField('salary')] + fSalary: Currency; + public + property Salary: Currency read fSalary write fSalary; + end; + + [MVCTable('people')] + [MVCPartition('person_type=(string)manager')] + TManager = class(TEmployee) + private + [MVCTableField('annual_bonus')] + fAnnualBonus: Currency; + public + property AnnualBonus: Currency read fAnnualBonus write fAnnualBonus; + end; + + [MVCTable('people', 'in(person_type,["manager","employee"])')] + [MVCEntityActions([eaRetrieve, eaDelete])] + TPerson = class(TAbstractPerson) + + end; + implementation uses @@ -655,4 +724,27 @@ begin Result, fCode.ValueOrDefault, fCompanyName.ValueOrDefault, fCity, fNote]); end; +constructor TAbstractPerson.Create; +begin + inherited Create; + fPhoto := TMemoryStream.Create; +end; + +destructor TAbstractPerson.Destroy; +begin + fPhoto.Free; + inherited; +end; + +function TAbstractPerson.GetFullName: NullableString; +begin + Result := fFirstName + ' ' + fLastName; +end; + +procedure TAbstractPerson.OnBeforeInsertOrUpdate; +begin + inherited; + fFullName := GetFullName; +end; + end. diff --git a/samples/activerecord_showcase/FDConnectionConfigU.pas b/samples/activerecord_showcase/FDConnectionConfigU.pas index dc4732eb..d688b7c6 100644 --- a/samples/activerecord_showcase/FDConnectionConfigU.pas +++ b/samples/activerecord_showcase/FDConnectionConfigU.pas @@ -17,7 +17,14 @@ implementation uses System.Classes, System.IOUtils, - FireDAC.Comp.Client; + FireDAC.Comp.Client, + FireDAC.Moni.Base, + FireDAC.Moni.FlatFile, FireDAC.Stan.Intf + ; + + +var + gFlatFileMonitor: TFDMoniFlatFileClientLink = nil; procedure CreateMySQLPrivateConnDef(AIsPooled: boolean); var @@ -95,7 +102,7 @@ var begin LParams := TStringList.Create; try - LParams.Add('Database=' + TPath.GetFullPath(TPath.Combine('..', + LParams.Add('Database=' + TPath.GetFullPath(TPath.Combine('..\..', 'data\ACTIVERECORDDB.FDB'))); LParams.Add('Protocol=TCPIP'); LParams.Add('Server=localhost'); @@ -156,6 +163,7 @@ begin LParams.Add('Server=localhost'); LParams.Add('User_Name=postgres'); LParams.Add('Password=postgres'); + LParams.Add('MonitorBy=FlatFile'); // https://quality.embarcadero.com/browse/RSP-19755?jql=text%20~%20%22firedac%20guid%22 LParams.Add('GUIDEndian=Big'); @@ -200,4 +208,21 @@ begin end; end; +initialization + +gFlatFileMonitor := TFDMoniFlatFileClientLink.Create(nil); +gFlatFileMonitor.FileColumns := [tiRefNo, tiTime, tiThreadID, tiClassName, tiObjID, tiMsgText]; +gFlatFileMonitor.EventKinds := [ + ekLiveCycle, ekError, ekConnTransact, + ekCmdPrepare, ekCmdExecute, ekCmdDataIn, ekCmdDataOut]; + +gFlatFileMonitor.ShowTraces := False; +gFlatFileMonitor.FileAppend := False; +gFlatFileMonitor.FileName := TPath.ChangeExtension(ParamStr(0), '.trace.log'); +gFlatFileMonitor.Tracing := True; + +finalization + +gFlatFileMonitor.Free; + end. diff --git a/samples/activerecord_showcase/MainFormU.dfm b/samples/activerecord_showcase/MainFormU.dfm index 69ab3f60..64b70e0c 100644 --- a/samples/activerecord_showcase/MainFormU.dfm +++ b/samples/activerecord_showcase/MainFormU.dfm @@ -230,8 +230,27 @@ object MainForm: TMainForm TabOrder = 21 OnClick = btnCRUDWithGUIDClick end + object btnOOP: TButton + Left = 144 + Top = 402 + Width = 121 + Height = 34 + Caption = 'OOP with Partitioning and Filtering' + TabOrder = 22 + WordWrap = True + OnClick = btnOOPClick + end + object btnReadOnly: TButton + Left = 8 + Top = 442 + Width = 121 + Height = 34 + Caption = 'Read/Only Entities' + TabOrder = 23 + OnClick = btnReadOnlyClick + end object FDConnection1: TFDConnection - Left = 168 - Top = 464 + Left = 200 + Top = 504 end end diff --git a/samples/activerecord_showcase/MainFormU.pas b/samples/activerecord_showcase/MainFormU.pas index c25d9ad2..466277cc 100644 --- a/samples/activerecord_showcase/MainFormU.pas +++ b/samples/activerecord_showcase/MainFormU.pas @@ -54,6 +54,8 @@ type btnTableFilter: TButton; btnPartitioning: TButton; btnCRUDWithGUID: TButton; + btnOOP: TButton; + btnReadOnly: TButton; procedure btnCRUDClick(Sender: TObject); procedure btnInheritanceClick(Sender: TObject); procedure btnMultiThreadingClick(Sender: TObject); @@ -78,6 +80,8 @@ type procedure btnTableFilterClick(Sender: TObject); procedure btnPartitioningClick(Sender: TObject); procedure btnCRUDWithGUIDClick(Sender: TObject); + procedure btnOOPClick(Sender: TObject); + procedure btnReadOnlyClick(Sender: TObject); private procedure Log(const Value: string); procedure LoadCustomers; @@ -942,6 +946,18 @@ begin end; end; +procedure TMainForm.btnReadOnlyClick(Sender: TObject); +begin + var lROCustomer := TMVCActiveRecord.GetFirstByWhere('',[]); + try + lROCustomer.Code := '1234'; + ShowMessage('An exception is going to be raised'); + lROCustomer.Update(); + finally + lROCustomer.Free; + end; +end; + procedure TMainForm.btnRelationsClick(Sender: TObject); var lCustomer: TCustomerEx; @@ -1326,7 +1342,7 @@ begin end; - Log('Retrieving only best customers...'); + Log('Retrieving only worst customers...'); lNotAGoodCustomer := TMVCActiveRecord.SelectOneByRQL('eq(rating,1)', True); try @@ -1530,6 +1546,44 @@ begin end; end; +procedure TMainForm.btnOOPClick(Sender: TObject); +begin + Log('** OOP with ActiveRecord (person, employee, manager)'); + TMVCActiveRecord.DeleteAll(TPerson); + + var lEmployee := TEmployee.Create; + try + lEmployee.FirstName := 'Peter'; + lEmployee.LastName := 'Parker'; + lEmployee.Dob := EncodeDate(1985,11,4); + lEmployee.IsMale := True; + lEmployee.Salary := 2100; + lEmployee.Store; + finally + lEmployee.Free; + end; + + var lManager := TManager.Create; + try + lManager.FirstName := 'Bruce'; + lManager.LastName := 'Banner'; + lManager.Dob := EncodeDate(1975,11,4); + lManager.IsMale := True; + lManager.Salary := 2800; + lManager.AnnualBonus := 5000; + lManager.Store; + finally + lManager.Free; + end; + + var lPeople := TMVCActiveRecord.All; + try + Assert(lPeople.Count = 2); + finally + lPeople.Free; + end; +end; + procedure TMainForm.FormDestroy(Sender: TObject); begin ActiveRecordConnectionsRegistry.RemoveDefaultConnection(False); diff --git a/samples/async_task/MainFormU.pas b/samples/async_task/MainFormU.pas index 79adcd39..756bc5ab 100644 --- a/samples/async_task/MainFormU.pas +++ b/samples/async_task/MainFormU.pas @@ -45,6 +45,9 @@ end; procedure TMainForm.btnWithExClick(Sender: TObject); begin + var lSavedCaption := btnWithEx.Caption; + btnWithEx.Caption := 'processing...'; + btnWithEx.Enabled := False; MVCAsync.Run( function: String begin @@ -57,6 +60,9 @@ begin end, procedure(const Expt: Exception) begin + btnWithEx.Caption := lSavedCaption; + btnWithEx.Enabled := True; + btnWithEx.Update; ShowMessage(Expt.Message); end ); diff --git a/samples/middleware_jwtblacklist/JWTBlacklistServerSample.dpr b/samples/middleware_jwtblacklist/JWTBlacklistServerSample.dpr index 139d6aaa..8d22abaf 100644 --- a/samples/middleware_jwtblacklist/JWTBlacklistServerSample.dpr +++ b/samples/middleware_jwtblacklist/JWTBlacklistServerSample.dpr @@ -14,7 +14,6 @@ uses IdContext, WebModuleUnit1 in 'WebModuleUnit1.pas' {WebModule1: TWebModule}, AppControllerU in 'AppControllerU.pas', - MVCFramework.Middleware.JWT in '..\..\sources\MVCFramework.Middleware.JWT.pas', AuthenticationU in 'AuthenticationU.pas'; {$R *.res} diff --git a/samples/middleware_jwtblacklist/JWTBlacklistServerSample.dproj b/samples/middleware_jwtblacklist/JWTBlacklistServerSample.dproj index c1d019f7..3d3d7eda 100644 --- a/samples/middleware_jwtblacklist/JWTBlacklistServerSample.dproj +++ b/samples/middleware_jwtblacklist/JWTBlacklistServerSample.dproj @@ -103,7 +103,6 @@ TWebModule - Base @@ -169,6 +168,12 @@ + + + JWTBlacklistServerSample.exe + true + + 1 diff --git a/samples/serversentevents/SSESample.dpr b/samples/serversentevents/SSESample.dpr index 25ea603a..7a90f660 100644 --- a/samples/serversentevents/SSESample.dpr +++ b/samples/serversentevents/SSESample.dpr @@ -4,6 +4,8 @@ program SSESample; uses System.SysUtils, + MVCFramework, + MVCFramework.Signal, MVCFramework.Logger, MVCFramework.Commons, {$IFDEF MSWINDOWS} @@ -30,20 +32,20 @@ begin try LServer.KeepAlive := True; LServer.DefaultPort := APort; - LServer.Active := True; - LogI(Format('Server started on port 8080', [APort])); { more info about MaxConnections http://www.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=TIdCustomTCPServer_MaxConnections.html } LServer.MaxConnections := 0; { more info about ListenQueue http://www.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=TIdCustomTCPServer_ListenQueue.html } LServer.ListenQueue := 200; + LServer.Active := True; { Comment the next line to avoid the default browser startup } {$IFDEF MSWINDOWS} ShellExecute(0, 'open', PChar('http://localhost:' + inttostr(APort) + '/static'), nil, nil, SW_SHOWMAXIMIZED); {$ENDIF} - Writeln('Press RETURN to stop the server'); - ReadLn; + Write('CTRL+C to stop the server'); + WaitForTerminationSignal; + EnterInShutdownState; finally LServer.Free; end; diff --git a/samples/serversentevents/SSESample.dproj b/samples/serversentevents/SSESample.dproj index c72bbee2..467e4faf 100644 --- a/samples/serversentevents/SSESample.dproj +++ b/samples/serversentevents/SSESample.dproj @@ -1,7 +1,7 @@  {56928A09-5B7B-4920-ABAA-CB68F0AC2958} - 19.1 + 19.5 VCL SSESample.dpr True @@ -74,6 +74,7 @@ true DBXSqliteDriver;DBXInterBaseDriver;DataSnapFireDAC;tethering;bindcompfmx;FmxTeeUI;fmx;RadiantShapesFmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;bindengine;DataSnapClient;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;DataSnapNativeClient;ibxbindings;rtl;FireDACDSDriver;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage);$(DCC_UsePackage) android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png DataSnapServerMidas;FireDACADSDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;inetdb;emsedge;IndyCore;dsnap;DataSnapCommon;DataSnapConnectors;bindengine;FireDACOracleDriver;FireDACMySQLDriver;FireDACCommonODBC;DataSnapClient;IndySystem;FireDACDb2Driver;FireDACInfxDriver;emshosting;FireDACPgDriver;FireDACASADriver;FireDACTDataDriver;DbxCommonDriver;DataSnapServer;xmlrtl;DataSnapNativeClient;rtl;DbxClientDriver;CustomIPTransport;bindcomp;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;$(DCC_UsePackage) @@ -117,10 +118,6 @@ TWebModule - - Cfg_2 - Base - Base @@ -128,6 +125,10 @@ Cfg_1 Base + + Cfg_2 + Base + Delphi.Personality.12 @@ -144,33 +145,12 @@ Microsoft Office XP Sample Automation Server Wrapper Components - - - - true - - - - - true - - - - - true - - - - - true - - - - - SSESample.exe - true - - + + + + + + 1 @@ -179,14 +159,14 @@ 0 - + classes - 1 + 64 classes - 1 + 64 @@ -307,6 +287,16 @@ 1 + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + res\drawable-ldpi @@ -467,6 +457,10 @@ 1 .framework + + 1 + .framework + 0 @@ -480,6 +474,10 @@ 1 .dylib + + 1 + .dylib + 0 .dll;.bpl @@ -494,7 +492,7 @@ 1 .dylib - + 1 .dylib @@ -506,6 +504,10 @@ 1 .dylib + + 1 + .dylib + 0 .bpl @@ -524,7 +526,7 @@ 0 - + 0 @@ -533,6 +535,9 @@ 0 + + 0 + 0 @@ -542,13 +547,17 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -558,181 +567,27 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -742,7 +597,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -752,7 +607,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -762,7 +617,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -772,7 +627,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -782,191 +637,37 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -976,7 +677,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -986,7 +687,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -996,7 +697,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1006,7 +707,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1016,7 +717,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1026,7 +727,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1036,7 +737,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1058,8 +759,11 @@ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + - @@ -1070,7 +774,7 @@ 1 - + 1 @@ -1086,6 +790,10 @@ Contents\Resources 1 + + Contents\Resources + 1 + @@ -1102,7 +810,7 @@ 1 - + 1 @@ -1114,6 +822,9 @@ 1 + + 1 + 0 @@ -1152,16 +863,18 @@ 1 - - - - - - - - + + + + + + + + + + False diff --git a/samples/serversideviews_mustache/ServerSideViews.dproj b/samples/serversideviews_mustache/ServerSideViews.dproj index 014a64f9..dd63292c 100644 --- a/samples/serversideviews_mustache/ServerSideViews.dproj +++ b/samples/serversideviews_mustache/ServerSideViews.dproj @@ -1,7 +1,7 @@  {C829684B-145E-49F2-8C37-2562C6C5904E} - 19.4 + 19.5 VCL ServerSideViews.dpr True @@ -122,13 +122,8 @@ Microsoft Office 2000 Sample Automation Server Wrapper Components - - - - ServerSideViews.exe - true - - + + 1 @@ -147,16 +142,6 @@ 64 - - - classes - 1 - - - classes - 1 - - res\xml @@ -199,7 +184,6 @@ 1 - library\lib\armeabi-v7a @@ -481,7 +465,7 @@ 1 .dylib - + 1 .dylib @@ -515,7 +499,7 @@ 0 - + 0 @@ -536,13 +520,17 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -552,181 +540,27 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -736,7 +570,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -746,7 +580,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -756,7 +590,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -766,7 +600,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -776,191 +610,37 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -970,7 +650,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -980,7 +660,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -990,7 +670,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1000,7 +680,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1010,7 +690,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1020,7 +700,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1030,7 +710,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1052,8 +732,11 @@ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + - @@ -1064,7 +747,7 @@ 1 - + 1 @@ -1100,7 +783,7 @@ 1 - + 1 @@ -1157,6 +840,7 @@ + diff --git a/samples/simple_api_using_datasets/SimpleRESTAPIUsingDatasets.dproj b/samples/simple_api_using_datasets/SimpleRESTAPIUsingDatasets.dproj index be7e7534..1941d6ef 100644 --- a/samples/simple_api_using_datasets/SimpleRESTAPIUsingDatasets.dproj +++ b/samples/simple_api_using_datasets/SimpleRESTAPIUsingDatasets.dproj @@ -1,7 +1,7 @@  {B236EE43-17B7-45E2-9BEF-472B44C424C1} - 19.2 + 19.5 None SimpleRESTAPIUsingDatasets.dpr True @@ -23,13 +23,8 @@ Base true - - true - Base - true - - - true + + true Base true @@ -97,17 +92,29 @@ android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png - - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers - iPhoneAndiPad - true - Debug - $(MSBuildProjectName) - - - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + iPhoneAndiPad true + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png RESTComponents;DataSnapServerMidas;emsclientfiredac;DataSnapFireDAC;FireDACADSDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;inetdb;emsedge;FireDACIBDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;soapserver;bindengine;FireDACOracleDriver;CloudService;FireDACMySQLDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndySystem;FireDACDb2Driver;FireDACInfxDriver;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;rtl;emsserverresource;DbxClientDriver;CustomIPTransport;bindcomp;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;$(DCC_UsePackage) @@ -156,10 +163,6 @@ dfm TDataModule - - Cfg_2 - Base - Base @@ -167,6 +170,10 @@ Cfg_1 Base + + Cfg_2 + Base + Delphi.Personality.12 @@ -183,12 +190,7 @@ Microsoft Office XP Sample Automation Server Wrapper Components - - - - true - - + true @@ -199,12 +201,12 @@ true - - - SimpleRESTAPIUsingDatasets.exe + + true + 1 @@ -213,14 +215,14 @@ 0 - + classes - 1 + 64 classes - 1 + 64 @@ -511,6 +513,10 @@ 1 .framework + + 1 + .framework + 0 @@ -524,6 +530,10 @@ 1 .dylib + + 1 + .dylib + 0 .dll;.bpl @@ -538,7 +548,7 @@ 1 .dylib - + 1 .dylib @@ -550,6 +560,10 @@ 1 .dylib + + 1 + .dylib + 0 .bpl @@ -568,7 +582,7 @@ 0 - + 0 @@ -577,6 +591,9 @@ 0 + + 0 + 0 @@ -586,13 +603,17 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -602,137 +623,27 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -742,7 +653,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -752,7 +663,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -762,7 +673,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -772,7 +683,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -782,191 +693,37 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -976,7 +733,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -986,7 +743,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -996,7 +753,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1006,7 +763,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1016,7 +773,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1026,7 +783,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1036,7 +793,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1058,8 +815,11 @@ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + - @@ -1070,7 +830,7 @@ 1 - + 1 @@ -1086,6 +846,10 @@ Contents\Resources 1 + + Contents\Resources + 1 + @@ -1102,7 +866,7 @@ 1 - + 1 @@ -1114,6 +878,9 @@ 1 + + 1 + 0 @@ -1152,22 +919,23 @@ 1 - - - - - - - - + + + + + + + + + + False False - False - False + False False True False diff --git a/samples/simple_api_using_mvcactiverecord/CustomersControllerU.pas b/samples/simple_api_using_mvcactiverecord/CustomersControllerU.pas index 61a7c9fd..e0f0966e 100644 --- a/samples/simple_api_using_mvcactiverecord/CustomersControllerU.pas +++ b/samples/simple_api_using_mvcactiverecord/CustomersControllerU.pas @@ -5,7 +5,9 @@ interface uses MVCFramework, MVCFramework.ActiveRecord, - MVCFramework.Commons; + MVCFramework.Commons, + System.Generics.Collections, + EntitiesU; type @@ -14,7 +16,7 @@ type public [MVCPath] [MVCHTTPMethods([httpGET])] - procedure GetCustomers; + procedure GetCustomers([MVCFromQueryString('rql','')] RQLFilter: String); [MVCPath('/($ID)')] [MVCHTTPMethods([httpGET])] @@ -22,7 +24,11 @@ type [MVCPath] [MVCHTTPMethods([httpPOST])] - procedure CreateCustomers; + procedure CreateCustomer([MVCFromBody] const Customer: TCustomer); + + [MVCPath('/_bulk')] + [MVCHTTPMethods([httpPOST])] + procedure BulkCreateCustomers([MVCFromBody] const Customers: TObjectList); end; implementation @@ -33,21 +39,14 @@ uses FireDAC.Stan.Param, MVCFramework.Logger, MVCFramework.Serializer.Commons, - JsonDataObjects, EntitiesU; + JsonDataObjects; { TCustomersController } -procedure TCustomersController.CreateCustomers; -var - lCustomer: TCustomer; +procedure TCustomersController.CreateCustomer(const Customer: TCustomer); begin - lCustomer := Context.Request.BodyAs; - try - lCustomer.Insert; - Render201Created('/api/customers/' + lCustomer.ID.Value.ToString); - finally - lCustomer.Free; - end; + Customer.Insert; + Render201Created('/api/customers/' + Customer.ID.Value.ToString); end; procedure TCustomersController.GetCustomerByID(const ID: Integer); @@ -55,9 +54,27 @@ begin Render(ObjectDict().Add('data', TMVCActiveRecord.GetByPK(ID))); end; -procedure TCustomersController.GetCustomers; +procedure TCustomersController.GetCustomers([MVCFromQueryString('rql','')] RQLFilter: String); begin - Render(ObjectDict().Add('data', TMVCActiveRecord.All)); + if RQLFilter.IsEmpty then + Render(ObjectDict().Add('data', TMVCActiveRecord.All)) + else + Render(ObjectDict().Add('data', TMVCActiveRecord.SelectRQL(RQLFilter, 1000))); +end; + +procedure TCustomersController.BulkCreateCustomers(const Customers: TObjectList); +begin + TMVCActiveRecord.CurrentConnection.StartTransaction; + try + for var lCustomer in Customers do + begin + lCustomer.Insert; + end; + TMVCActiveRecord.CurrentConnection.Commit; + Render201Created(); + except + TMVCActiveRecord.CurrentConnection.Rollback; + end; end; end. diff --git a/samples/simple_api_using_mvcactiverecord/SimpleRESTAPIUsingActiveRecord.dpr b/samples/simple_api_using_mvcactiverecord/SimpleRESTAPIUsingActiveRecord.dpr index 714aad63..775245c2 100644 --- a/samples/simple_api_using_mvcactiverecord/SimpleRESTAPIUsingActiveRecord.dpr +++ b/samples/simple_api_using_mvcactiverecord/SimpleRESTAPIUsingActiveRecord.dpr @@ -4,8 +4,10 @@ program SimpleRESTAPIUsingActiveRecord; uses System.SysUtils, + MVCFramework, MVCFramework.Logger, MVCFramework.Commons, + MVCFramework.Signal, MVCFramework.REPLCommandsHandlerU, Web.ReqMulti, Web.WebReq, @@ -22,35 +24,8 @@ uses procedure RunServer(APort: Integer); var LServer: TIdHTTPWebBrokerBridge; - LCustomHandler: TMVCCustomREPLCommandsHandler; - LCmd: string; begin Writeln('** DMVCFramework Server ** build ' + DMVCFRAMEWORK_VERSION); - LCmd := 'start'; - if ParamCount >= 1 then - LCmd := ParamStr(1); - - LCustomHandler := function(const Value: String; const Server: TIdHTTPWebBrokerBridge; out Handled: Boolean): THandleCommandResult - begin - Handled := False; - Result := THandleCommandResult.Unknown; - - // Write here your custom command for the REPL using the following form... - // *** - // Handled := False; - // if (Value = 'apiversion') then - // begin - // REPLEmit('Print my API version number'); - // Result := THandleCommandResult.Continue; - // Handled := True; - // end - // else if (Value = 'datetime') then - // begin - // REPLEmit(DateTimeToStr(Now)); - // Result := THandleCommandResult.Continue; - // Handled := True; - // end; - end; LServer := TIdHTTPWebBrokerBridge.Create(nil); try @@ -64,34 +39,11 @@ begin { more info about ListenQueue http://www.indyproject.org/docsite/html/frames.html?frmname=topic&frmfile=TIdCustomTCPServer_ListenQueue.html } LServer.ListenQueue := 200; - - WriteLn('Write "quit" or "exit" to shutdown the server'); - repeat - if LCmd.IsEmpty then - begin - Write('-> '); - ReadLn(LCmd) - end; - try - case HandleCommand(LCmd.ToLower, LServer, LCustomHandler) of - THandleCommandResult.Continue: - begin - Continue; - end; - THandleCommandResult.Break: - begin - Break; - end; - THandleCommandResult.Unknown: - begin - REPLEmit('Unknown command: ' + LCmd); - end; - end; - finally - LCmd := ''; - end; - until False; - + LServer.Active := True; + Writeln('Listening on port ', APort); + Write('CTRL+C to shutdown the server'); + WaitForTerminationSignal; + EnterInShutdownState; finally LServer.Free; end; diff --git a/samples/simple_api_using_mvcactiverecord/SimpleRESTAPIUsingActiveRecord.dproj b/samples/simple_api_using_mvcactiverecord/SimpleRESTAPIUsingActiveRecord.dproj index ef31b676..0aa29aa1 100644 --- a/samples/simple_api_using_mvcactiverecord/SimpleRESTAPIUsingActiveRecord.dproj +++ b/samples/simple_api_using_mvcactiverecord/SimpleRESTAPIUsingActiveRecord.dproj @@ -1,7 +1,7 @@  {2921E3FB-91B6-4BA4-A930-D3F18FEED6C6} - 19.2 + 19.5 None SimpleRESTAPIUsingActiveRecord.dpr True @@ -23,13 +23,8 @@ Base true - - true - Base - true - - - true + + true Base true @@ -97,17 +92,29 @@ android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png - - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers - iPhoneAndiPad - true - Debug - $(MSBuildProjectName) - - - CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + iPhoneAndiPad true + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_180x180.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImage_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_LaunchImageDark_3x.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_120x120.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_SettingIcon_87x87.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_40x40.png + $(BDS)\bin\Artwork\iOS\iPhone\FM_NotificationIcon_60x60.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png + $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_167x167.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImage_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageDark_2x.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png + $(BDS)\bin\Artwork\iOS\iPad\FM_SettingIcon_58x58.png + $(BDS)\bin\Artwork\iOS\iPad\FM_NotificationIcon_40x40.png RESTComponents;DataSnapServerMidas;emsclientfiredac;DataSnapFireDAC;FireDACADSDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;inetdb;emsedge;FireDACIBDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;soapserver;bindengine;FireDACOracleDriver;CloudService;FireDACMySQLDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;IndySystem;FireDACDb2Driver;FireDACInfxDriver;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;FireDACASADriver;FireDACTDataDriver;soaprtl;DbxCommonDriver;DataSnapServer;xmlrtl;soapmidas;DataSnapNativeClient;rtl;emsserverresource;DbxClientDriver;CustomIPTransport;bindcomp;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;$(DCC_UsePackage) @@ -152,10 +159,6 @@ TWebModule - - Cfg_2 - Base - Base @@ -163,6 +166,10 @@ Cfg_1 Base + + Cfg_2 + Base + Delphi.Personality.12 @@ -179,12 +186,7 @@ Microsoft Office XP Sample Automation Server Wrapper Components - - - - true - - + true @@ -195,12 +197,12 @@ true - - - SimpleRESTAPIUsingActiveRecord.exe + + true + 1 @@ -209,14 +211,14 @@ 0 - + classes - 1 + 64 classes - 1 + 64 @@ -507,6 +509,10 @@ 1 .framework + + 1 + .framework + 0 @@ -520,6 +526,10 @@ 1 .dylib + + 1 + .dylib + 0 .dll;.bpl @@ -534,7 +544,7 @@ 1 .dylib - + 1 .dylib @@ -546,6 +556,10 @@ 1 .dylib + + 1 + .dylib + 0 .bpl @@ -564,7 +578,7 @@ 0 - + 0 @@ -573,6 +587,9 @@ 0 + + 0 + 0 @@ -582,13 +599,17 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -598,137 +619,27 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -738,7 +649,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -748,7 +659,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -758,7 +669,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -768,7 +679,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -778,191 +689,37 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -972,7 +729,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -982,7 +739,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -992,7 +749,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1002,7 +759,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1012,7 +769,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1022,7 +779,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1032,7 +789,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1054,8 +811,11 @@ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + - @@ -1066,7 +826,7 @@ 1 - + 1 @@ -1082,6 +842,10 @@ Contents\Resources 1 + + Contents\Resources + 1 + @@ -1098,7 +862,7 @@ 1 - + 1 @@ -1110,6 +874,9 @@ 1 + + 1 + 0 @@ -1148,22 +915,23 @@ 1 - - - - - - - - + + + + + + + + + + False False - False - False + False False True False diff --git a/samples/winecellarclient/MainFormU.dfm b/samples/winecellarclient/MainFormU.dfm index dbd85d8a..25de8351 100644 --- a/samples/winecellarclient/MainFormU.dfm +++ b/samples/winecellarclient/MainFormU.dfm @@ -3,20 +3,18 @@ object Form5: TForm5 Top = 0 Anchors = [akLeft, akTop, akRight, akBottom] Caption = 'DMVCFramework RESTClient' - ClientHeight = 425 - ClientWidth = 758 + ClientHeight = 415 + ClientWidth = 927 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] - OldCreateOrder = False OnCreate = FormCreate DesignSize = ( - 758 - 425) - PixelsPerInch = 96 + 927 + 415) TextHeight = 13 object Button1: TButton Left = 8 @@ -30,18 +28,20 @@ object Form5: TForm5 object PageControl1: TPageControl Left = 8 Top = 47 - Width = 742 - Height = 370 + Width = 911 + Height = 360 ActivePage = TabSheet1 Anchors = [akLeft, akTop, akRight, akBottom] TabOrder = 2 + ExplicitWidth = 738 + ExplicitHeight = 369 object TabSheet1: TTabSheet Caption = 'Wines' object DBGrid1: TDBGrid Left = 0 Top = 0 - Width = 734 - Height = 342 + Width = 903 + Height = 332 Align = alClient DataSource = DataSource1 Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit, dgTitleClick, dgTitleHotTrack] @@ -203,8 +203,8 @@ object Form5: TForm5 object Memo1: TMemo Left = 0 Top = 0 - Width = 734 - Height = 342 + Width = 903 + Height = 332 Align = alClient Font.Charset = ANSI_CHARSET Font.Color = clWindowText @@ -214,6 +214,8 @@ object Form5: TForm5 ParentFont = False ReadOnly = True TabOrder = 0 + ExplicitWidth = 734 + ExplicitHeight = 342 end end end diff --git a/samples/winecellarclient/MainFormU.pas b/samples/winecellarclient/MainFormU.pas index bd0b13f2..b8d9ef88 100644 --- a/samples/winecellarclient/MainFormU.pas +++ b/samples/winecellarclient/MainFormU.pas @@ -68,17 +68,18 @@ uses procedure TForm5.Button1Click(Sender: TObject); -var - response: IMVCRESTResponse; begin - response := RESTClient.Get('/api/wines'); - Memo1.Lines.Text := response.Content; - FDMemTable1.Close; - FDMemTable1.Open; - Loading := True; - FDMemTable1.AppendFromJSONArrayString(response.Content); - FDMemTable1.First; - Loading := False; + RESTClient.Async( + procedure (Resp: IMVCRESTResponse) + begin + Memo1.Lines.Text := Resp.Content; + FDMemTable1.Close; + FDMemTable1.Open; + Loading := True; + FDMemTable1.AppendFromJSONArrayString(Resp.Content); + FDMemTable1.First; + Loading := False; + end, nil, True).Get('/api/wines'); end; procedure TForm5.DBGrid1DblClick(Sender: TObject); diff --git a/samples/winecellarclient/WineCellarClient.dproj b/samples/winecellarclient/WineCellarClient.dproj index 4f2842f6..3a47068b 100644 --- a/samples/winecellarclient/WineCellarClient.dproj +++ b/samples/winecellarclient/WineCellarClient.dproj @@ -1,7 +1,7 @@  {92D799DE-2A65-48F8-96D8-08C51166B50F} - 19.2 + 19.5 VCL WineCellarClient.dpr True @@ -101,10 +101,6 @@ dfm - - Cfg_2 - Base - Base @@ -112,6 +108,10 @@ Cfg_1 Base + + Cfg_2 + Base + Delphi.Personality.12 @@ -163,1094 +163,7 @@ Microsoft Office XP Sample Automation Server Wrapper Components - - - - 1 - - - Contents\MacOS - 1 - - - 0 - - - - - classes - 1 - - - classes - 1 - - - - - res\xml - 1 - - - res\xml - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\armeabi - 1 - - - library\lib\armeabi - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\mips - 1 - - - library\lib\mips - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\values-v21 - 1 - - - res\values-v21 - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-xxxhdpi - 1 - - - res\drawable-xxxhdpi - 1 - - - - - res\drawable-ldpi - 1 - - - res\drawable-ldpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-xxxhdpi - 1 - - - res\drawable-xxxhdpi - 1 - - - - - res\drawable-small - 1 - - - res\drawable-small - 1 - - - - - res\drawable-normal - 1 - - - res\drawable-normal - 1 - - - - - res\drawable-large - 1 - - - res\drawable-large - 1 - - - - - res\drawable-xlarge - 1 - - - res\drawable-xlarge - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - 1 - - - Contents\MacOS - 1 - - - 0 - - - - - Contents\MacOS - 1 - .framework - - - Contents\MacOS - 1 - .framework - - - 0 - - - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - Contents\MacOS - 1 - .dylib - - - Contents\MacOS - 1 - .dylib - - - 0 - .dll;.bpl - - - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - Contents\MacOS - 1 - .dylib - - - Contents\MacOS - 1 - .dylib - - - 0 - .bpl - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - Contents\Resources\StartUp\ - 0 - - - Contents\Resources\StartUp\ - 0 - - - 0 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - - - 1 - - - 1 - - - - - ..\ - 1 - - - ..\ - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen - 64 - - - ..\$(PROJECTNAME).launchscreen - 64 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - - - ..\ - 1 - - - ..\ - 1 - - - - - Contents - 1 - - - Contents - 1 - - - - - Contents\Resources - 1 - - - Contents\Resources - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - Contents\MacOS - 1 - - - Contents\MacOS - 1 - - - 0 - - - - - library\lib\armeabi-v7a - 1 - - - - - 1 - - - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - - - - - - - - - + True False diff --git a/samples/winecellarclient_mobile/MainFormU.fmx b/samples/winecellarclient_mobile/MainFormU.fmx index de29ee54..7d9d667d 100644 --- a/samples/winecellarclient_mobile/MainFormU.fmx +++ b/samples/winecellarclient_mobile/MainFormU.fmx @@ -431,7 +431,7 @@ object HeaderFooterForm: THeaderFooterForm Left = 192 Top = 280 Content = { - 414442530F00000025030000FF00010001FF02FF03040016000000460044004D + 414442531000000025030000FF00010001FF02FF03040016000000460044004D 0065006D005400610062006C006500310005000A0000005400610062006C0065 00060000000000070000080032000000090000FF0AFF0B040004000000690064 00050004000000690064000C00010000000E000D000F00011000011100011200 diff --git a/samples/winecellarclient_mobile/WineCellarMobileClient.dproj b/samples/winecellarclient_mobile/WineCellarMobileClient.dproj index b693498c..248c18a9 100644 --- a/samples/winecellarclient_mobile/WineCellarMobileClient.dproj +++ b/samples/winecellarclient_mobile/WineCellarMobileClient.dproj @@ -1,7 +1,7 @@  {6BBE33E4-1C16-4F41-99DF-C40C746C2EA7} - 19.2 + 19.5 FMX WineCellarMobileClient.dpr True @@ -209,10 +209,6 @@
HeaderFooterForm
fmx
- - Cfg_2 - Base - Base @@ -220,6 +216,10 @@ Cfg_1 Base + + Cfg_2 + Base + Delphi.Personality.12 @@ -237,246 +237,59 @@ File C:\Program Files (x86)\Raize\RadiantShapes\1.3\Bin\RadiantShapesFmx_Design270.bpl not found - - - - ic_launcher.png - true - - - - - ic_launcher.png - true - - - - - ic_launcher.png - true - - - - - libWinesClient.so - true - - - - - ic_launcher.png - true - - - - - splash_image.png - true - - - - - libWineCellarMobileClient.so - true - - - - - splash_image.png - true - - - - - splash_image.png - true - - - - - libWinesClient.so - true - - - - - libWinesClient.so - true - - - - - ic_launcher.png - true - - - - - ic_launcher.png - true - - - - - ic_launcher.png - true - - - - - true - - - - - libWineCellarMobile.so - true - - - - - classes.dex - true - - - - - splash_image.png - true - - - - - true - - - - - true - - - - - true - - - - - true - - - - - true - - - - - libWineCellarMobileClient.so - true - - - - - true - - - - - ic_launcher.png - true - - - - - ic_launcher.png - true - - - - - splash_image.png - true - - - - - libWineCellarMobile.so - true - - - - - true - - + + + + + + + + + + + + + + + + + + + + true - - - splash_image.png - true - - - - - true - - true - - - classes.dex - true - - + + true - - - ic_launcher.png - true - - - - - splash_image.png - true - - - - - WineCellarMobileClient.exe - true - - - - - styles.xml - true - - - - - true - - - - - splash_image.png - true - - + + + + + + + + + + + + + + + + 1 @@ -489,14 +302,14 @@ 0 - + classes - 1 + 64 classes - 1 + 64 @@ -790,6 +603,11 @@ 1 .framework + + Contents\MacOS + 1 + .framework + 0 @@ -803,7 +621,7 @@ 1 .dylib - + 1 .dylib @@ -817,6 +635,11 @@ 1 .dylib + + Contents\MacOS + 1 + .dylib + 0 .dll;.bpl @@ -831,7 +654,7 @@ 1 .dylib - + 1 .dylib @@ -845,6 +668,11 @@ 1 .dylib + + Contents\MacOS + 1 + .dylib + 0 .bpl @@ -863,7 +691,7 @@ 0 - + 0 @@ -874,6 +702,10 @@ Contents\Resources\StartUp\ 0 + + Contents\Resources\StartUp\ + 0 + 0 @@ -883,13 +715,17 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -899,181 +735,27 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -1083,7 +765,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1093,7 +775,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1103,7 +785,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1113,7 +795,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1123,191 +805,37 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -1317,7 +845,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -1327,7 +855,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1337,7 +865,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1347,7 +875,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1357,7 +885,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1367,7 +895,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1377,7 +905,7 @@ ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -1399,12 +927,8 @@ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 - - - - 1 - - + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 @@ -1417,6 +941,10 @@ ..\ 1 + + ..\ + 1 + @@ -1425,7 +953,7 @@ 1 - + 1 @@ -1434,7 +962,7 @@ ..\$(PROJECTNAME).launchscreen 64 - + ..\$(PROJECTNAME).launchscreen 64 @@ -1446,7 +974,7 @@ 1 - + 1 @@ -1455,6 +983,10 @@ ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + @@ -1465,6 +997,10 @@ ..\ 1 + + ..\ + 1 + @@ -1475,6 +1011,10 @@ Contents 1 + + Contents + 1 + @@ -1485,6 +1025,10 @@ Contents\Resources 1 + + Contents\Resources + 1 + @@ -1501,7 +1045,7 @@ 1 - + 1 @@ -1515,6 +1059,10 @@ Contents\MacOS 1 + + Contents\MacOS + 1 + 0 @@ -1553,16 +1101,18 @@ 1 - - - - - - - - + + + + + + + + + + False diff --git a/samples/winecellarserver/WineCellarServer.dproj b/samples/winecellarserver/WineCellarServer.dproj index 294abcc6..2ffcde52 100644 --- a/samples/winecellarserver/WineCellarServer.dproj +++ b/samples/winecellarserver/WineCellarServer.dproj @@ -1,7 +1,7 @@  {D87A49D2-D936-4F0E-BC4F-38702084A156} - 19.2 + 19.5 VCL WineCellarServer.dpr True @@ -166,10 +166,6 @@ TDataModule
- - Cfg_2 - Base - Base @@ -177,6 +173,10 @@ Cfg_1 Base + + Cfg_2 + Base + Delphi.Personality.12 @@ -228,1010 +228,7 @@ Microsoft Office XP Sample Automation Server Wrapper Components - - - - 1 - - - 0 - - - - - classes - 1 - - - classes - 1 - - - - - res\xml - 1 - - - res\xml - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\armeabi - 1 - - - library\lib\armeabi - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\mips - 1 - - - library\lib\mips - 1 - - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\values-v21 - 1 - - - res\values-v21 - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-xxxhdpi - 1 - - - res\drawable-xxxhdpi - 1 - - - - - res\drawable-ldpi - 1 - - - res\drawable-ldpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-xxxhdpi - 1 - - - res\drawable-xxxhdpi - 1 - - - - - res\drawable-small - 1 - - - res\drawable-small - 1 - - - - - res\drawable-normal - 1 - - - res\drawable-normal - 1 - - - - - res\drawable-large - 1 - - - res\drawable-large - 1 - - - - - res\drawable-xlarge - 1 - - - res\drawable-xlarge - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - 1 - - - 1 - - - 0 - - - - - 1 - .framework - - - 1 - .framework - - - 0 - - - - - 1 - .dylib - - - 1 - .dylib - - - 0 - .dll;.bpl - - - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 0 - .bpl - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - - - - - - - 1 - - - 1 - - - 1 - - - - - - - - Contents\Resources - 1 - - - Contents\Resources - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 0 - - - - - library\lib\armeabi-v7a - 1 - - - - - 1 - - - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - - - - - - - - - + False False diff --git a/sources/MVCFramework.ActiveRecord.pas b/sources/MVCFramework.ActiveRecord.pas index e97dbfdd..ee6773f3 100644 --- a/sources/MVCFramework.ActiveRecord.pas +++ b/sources/MVCFramework.ActiveRecord.pas @@ -1190,7 +1190,9 @@ begin begin fPrimaryKeyFieldType := ftLargeInt; end - else if lPrimaryFieldTypeAsStr.EndsWith('integer') or lPrimaryFieldTypeAsStr.EndsWith('int32') then + else if lPrimaryFieldTypeAsStr.EndsWith('integer') + or lPrimaryFieldTypeAsStr.EndsWith('int16') + or lPrimaryFieldTypeAsStr.EndsWith('int32') then begin fPrimaryKeyFieldType := ftInteger; end @@ -1205,7 +1207,7 @@ begin else begin raise EMVCActiveRecord.Create - ('Allowed primary key types are: (Nullable)Integer, (Nullable)Int64, (Nullable)String, GUID - found: ' + + ('Allowed primary key types are: (Nullable)Integer, (Nullable)Int16, (Nullable)Int32, (Nullable)Int64, (Nullable)String, GUID - found: ' + lPrimaryFieldTypeAsStr); end; fPrimaryKeyFieldName := MVCTableFieldAttribute(lAttribute).FieldName; @@ -1603,7 +1605,7 @@ begin Result := aEntityAction in fEntityAllowedActions; if (not Result) and aRaiseException then raise EMVCActiveRecord.CreateFmt - ('Action [%s] not allowed on entity [%s]. [HINT] Add the entity action in MVCEntityActions attribute.', + ('Action [%s] not allowed on entity [%s]. [HINT] If this isn''t the expected behavior, add the entity action in MVCEntityActions attribute.', [GetEnumName(TypeInfo(TMVCEntityAction), Ord(aEntityAction)), ClassName]); end; @@ -2871,7 +2873,8 @@ var begin lAR := aClass.Create; try - Result := Select(aClass, lAR.GenerateSelectSQL, []); + Result := Select(aClass, + lAR.GenerateSelectSQL + lAR.SQLGenerator.GetDefaultSQLFilter(True), []); finally lAR.Free; end; @@ -2888,7 +2891,8 @@ var begin lAR := T.Create; try - Result := Select(lAR.GenerateSelectSQL, []); + Result := Select( + lAR.GenerateSelectSQL + lAR.SQLGenerator.GetDefaultSQLFilter(True), []); finally lAR.Free; end; @@ -3208,6 +3212,10 @@ begin if not PKFieldName.IsEmpty then begin Result := Result + ' where ' + GetFieldNameForSQL(PKFieldName) + '= :' + GetParamNameForSQL(PKFieldName); + end + else + begin + raise EMVCActiveRecord.Create('Cannot perform an update without an entity primary key'); end; end; @@ -3435,9 +3443,6 @@ begin begin lQry.Connection := Connection; end; -// lQry.SQL.Clear; -// lQry.SQL.Add(SQL); - // lQry.Prepare; if Length(ValueTypes) = 0 then begin lQry.Open(SQL, Values); diff --git a/unittests/general/Several/ActiveRecordTestsU.pas b/unittests/general/Several/ActiveRecordTestsU.pas index 3f3b20fe..6e92fbf9 100644 --- a/unittests/general/Several/ActiveRecordTestsU.pas +++ b/unittests/general/Several/ActiveRecordTestsU.pas @@ -1199,7 +1199,6 @@ begin Assert.IsFalse(lTest.f_float8.HasValue); Assert.IsFalse(lTest.f_bool.HasValue); Assert.IsNotNull(lTest); - lTest.f_int2 := lTest.f_int2.Value + 2; lTest.f_int4 := lTest.f_int4.Value + 4; lTest.f_int8 := lTest.f_int8.Value + 8; lTest.f_blob.Free; @@ -1209,9 +1208,9 @@ begin lTest.Free; end; - lTest := TMVCActiveRecord.GetFirstByWhere('f_int2 = ?', [4]); + lTest := TMVCActiveRecord.GetFirstByWhere('f_int2 = ?', [2]); try - Assert.IsTrue(lTest.f_int2.ValueOrDefault = 4); + Assert.IsTrue(lTest.f_int2.ValueOrDefault = 2); Assert.IsTrue(lTest.f_int4.ValueOrDefault = 8); Assert.IsTrue(lTest.f_int8.ValueOrDefault = 16); Assert.IsFalse(lTest.f_string.HasValue); @@ -1223,12 +1222,12 @@ begin Assert.IsFalse(lTest.f_float8.HasValue); Assert.IsFalse(lTest.f_bool.HasValue); Assert.IsFalse(Assigned(lTest.f_blob), 'Blob contains a value when should not'); - TMVCActiveRecord.DeleteRQL(TNullablesTest, 'eq(f_int2,4)'); + TMVCActiveRecord.DeleteRQL(TNullablesTest, 'eq(f_int2,2)'); finally lTest.Free; end; - Assert.IsNull(TMVCActiveRecord.GetFirstByWhere('f_int2 = 4', [], False)); + Assert.IsNull(TMVCActiveRecord.GetFirstByWhere('f_int2 = 2', [], False)); lTest := TNullablesTest.Create; try diff --git a/unittests/general/Several/BOs.pas b/unittests/general/Several/BOs.pas index e23f1bc2..773ea191 100644 --- a/unittests/general/Several/BOs.pas +++ b/unittests/general/Several/BOs.pas @@ -337,7 +337,7 @@ type [MVCTable('nullables_test')] TNullablesTest = class(TMVCActiveRecord) private - [MVCTableField('f_int2')] + [MVCTableField('f_int2', [foPrimaryKey])] ff_int2: NullableInt16; [MVCTableField('f_int4')] ff_int4: NullableInt32;