├── QuickORM.png
├── Quick.ORM.Engine.pas
├── Quick.ORM.Security.pas
├── Quick.ORM.App.Config.pas
├── Quick.ORM.Form.Login.pas
├── Quick.ORM.RestClient.pas
├── Quick.ORM.RestDBFull.pas
├── Quick.ORM.RestServer.pas
├── Quick.ORM.Security.GUI.pas
├── Quick.ORM.Server.Base.pas
├── Quick.ORM.UTF8Helper.pas
├── Quick.ORM.Server.Config.pas
├── Quick.ORM.RestClient.Cross.pas
├── samples
├── ORMUF8HelperTest
│ ├── QuickUTF8Helper_Test.dpr
│ ├── QuickUTF8Helper_Test.res
│ └── QuickUTF8Helper_Test.dproj
└── ORMRestServerDemo
│ └── source
│ ├── delphi
│ ├── ORMRestClient.res
│ ├── ORMRestServer.res
│ ├── ORMRestClient.dpr
│ ├── ORMDemo.RestMethods.pas
│ ├── ORMDemo.CustomServer.pas
│ ├── ClientMain.dfm
│ ├── ClientMain.pas
│ └── ORMRestServer.dpr
│ ├── fpc
│ ├── ClientHTTPSocket.res
│ ├── ServerHTTPSocket.res
│ ├── ClientHTTPSocket.dpr
│ ├── ORMDemo.RestMethods.pas
│ ├── ORMDemo.CustomServer.pas
│ ├── ORMRestServer.lpi
│ ├── ClientMain.dfm
│ ├── ClientMain.pas
│ ├── ORMRestServer.pas
│ └── ORMRestServer.lps
│ ├── win32
│ └── HTTPSocket
│ │ ├── ClientHTTPSocket.res
│ │ ├── ServerHTTPSocket.res
│ │ ├── ClientHTTPSocket.dpr
│ │ ├── ORMDemo.RestMethods.pas
│ │ ├── ORMDemo.CustomServer.pas
│ │ ├── ClientMain.dfm
│ │ ├── ClientMain.pas
│ │ ├── ServerHTTPSocket.dpr
│ │ ├── ClientHTTPSocket.dproj
│ │ └── ServerHTTPSocket.dproj
│ ├── Firemonkey
│ └── android
│ │ ├── MobileHTTPRestClient.res
│ │ ├── MobileHTTPRestClient.dpr
│ │ ├── Main.pas
│ │ ├── Main.fmx
│ │ └── MobileHTTPRestClient.deployproj
│ └── common
│ ├── ORMDemo.Interf.pas
│ └── ORMDemo.Model.pas
├── Delphinus.Install.json
├── quickorm.pas
├── Delphinus.Info.json
├── .gitignore
├── Quick.ORM.Form.Login.dfm
├── quickorm.lpk
├── Quick.ORM.DataBase.pas
├── QuickORM.inc
├── README.md
└── Quick.ORM.RestDB.pas
/QuickORM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/QuickORM.png
--------------------------------------------------------------------------------
/Quick.ORM.Engine.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.Engine.pas
--------------------------------------------------------------------------------
/Quick.ORM.Security.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.Security.pas
--------------------------------------------------------------------------------
/Quick.ORM.App.Config.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.App.Config.pas
--------------------------------------------------------------------------------
/Quick.ORM.Form.Login.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.Form.Login.pas
--------------------------------------------------------------------------------
/Quick.ORM.RestClient.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.RestClient.pas
--------------------------------------------------------------------------------
/Quick.ORM.RestDBFull.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.RestDBFull.pas
--------------------------------------------------------------------------------
/Quick.ORM.RestServer.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.RestServer.pas
--------------------------------------------------------------------------------
/Quick.ORM.Security.GUI.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.Security.GUI.pas
--------------------------------------------------------------------------------
/Quick.ORM.Server.Base.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.Server.Base.pas
--------------------------------------------------------------------------------
/Quick.ORM.UTF8Helper.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.UTF8Helper.pas
--------------------------------------------------------------------------------
/Quick.ORM.Server.Config.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.Server.Config.pas
--------------------------------------------------------------------------------
/Quick.ORM.RestClient.Cross.pas:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/Quick.ORM.RestClient.Cross.pas
--------------------------------------------------------------------------------
/samples/ORMUF8HelperTest/QuickUTF8Helper_Test.dpr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/samples/ORMUF8HelperTest/QuickUTF8Helper_Test.dpr
--------------------------------------------------------------------------------
/samples/ORMUF8HelperTest/QuickUTF8Helper_Test.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/samples/ORMUF8HelperTest/QuickUTF8Helper_Test.res
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/delphi/ORMRestClient.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/samples/ORMRestServerDemo/source/delphi/ORMRestClient.res
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/delphi/ORMRestServer.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/samples/ORMRestServerDemo/source/delphi/ORMRestServer.res
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ClientHTTPSocket.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/samples/ORMRestServerDemo/source/fpc/ClientHTTPSocket.res
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ServerHTTPSocket.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/samples/ORMRestServerDemo/source/fpc/ServerHTTPSocket.res
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ClientHTTPSocket.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/samples/ORMRestServerDemo/source/win32/HTTPSocket/ClientHTTPSocket.res
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ServerHTTPSocket.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/samples/ORMRestServerDemo/source/win32/HTTPSocket/ServerHTTPSocket.res
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/Firemonkey/android/MobileHTTPRestClient.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/exilon/QuickORM/HEAD/samples/ORMRestServerDemo/source/Firemonkey/android/MobileHTTPRestClient.res
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/Firemonkey/android/MobileHTTPRestClient.dpr:
--------------------------------------------------------------------------------
1 | program MobileHTTPRestClient;
2 |
3 | uses
4 | System.StartUpCopy,
5 | FMX.Forms,
6 | Main in 'Main.pas' {Form1},
7 | Quick.ORM.RestClient.Cross in '..\..\..\..\Quick.ORM.RestClient.Cross.pas';
8 |
9 | {$R *.res}
10 |
11 | begin
12 | Application.Initialize;
13 | Application.CreateForm(TForm1, Form1);
14 | Application.Run;
15 | end.
16 |
--------------------------------------------------------------------------------
/Delphinus.Install.json:
--------------------------------------------------------------------------------
1 | {
2 | "search_pathes":
3 | [
4 | {
5 | "pathes": ".",
6 | "platforms": "Win32;Win64;Android;Linux64"
7 | }
8 | ],
9 | "browsing_pathes":
10 | [
11 | {
12 | "pathes": ".",
13 | "platforms": "Win32;Win64;Android;Linux64"
14 | }
15 | ],
16 |
17 | "source_folders":
18 | [
19 | {
20 | "folder": ".",
21 | "recursive": true,
22 | "filter": "*;*.*"
23 | }
24 | ]
25 |
26 | }
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/delphi/ORMRestClient.dpr:
--------------------------------------------------------------------------------
1 | program ORMRestClient;
2 |
3 | uses
4 | Vcl.Forms,
5 | ClientMain in 'ClientMain.pas' {MainForm},
6 | Quick.ORM.Form.Login in '..\..\..\..\Quick.ORM.Form.Login.pas' {frmLogin},
7 | Quick.ORM.Security.GUI in '..\..\..\..\Quick.ORM.Security.GUI.pas',
8 | Quick.AppSecurity in '..\..\..\..\Quick.AppSecurity.pas';
9 |
10 | {$R *.res}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.MainFormOnTaskbar := True;
15 | Application.CreateForm(TMainForm, MainForm);
16 | Application.CreateForm(TfrmLogin, frmLogin);
17 | Application.Run;
18 | end.
19 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ClientHTTPSocket.dpr:
--------------------------------------------------------------------------------
1 | program ClientHTTPSocket;
2 |
3 | uses
4 | Vcl.Forms,
5 | ClientMain in 'ClientMain.pas' {MainForm},
6 | Quick.ORM.Form.Login in '..\..\..\..\Quick.ORM.Form.Login.pas' {frmLogin},
7 | Quick.ORM.Security.GUI in '..\..\..\..\Quick.ORM.Security.GUI.pas',
8 | Quick.AppSecurity in '..\..\..\..\Quick.AppSecurity.pas';
9 |
10 | {$R *.res}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.MainFormOnTaskbar := True;
15 | Application.CreateForm(TMainForm, MainForm);
16 | Application.CreateForm(TfrmLogin, frmLogin);
17 | Application.Run;
18 | end.
19 |
--------------------------------------------------------------------------------
/quickorm.pas:
--------------------------------------------------------------------------------
1 | { This file was automatically created by Lazarus. Do not edit!
2 | This source is only used to compile and install the package.
3 | }
4 |
5 | unit quickORM;
6 |
7 | {$warn 5023 off : no warning about unused units}
8 | interface
9 |
10 | uses
11 | Quick.ORM.App.Config, Quick.ORM.DataBase, Quick.ORM.Engine,
12 | Quick.ORM.Form.Login, Quick.ORM.RestClient.Cross, Quick.ORM.RestClient,
13 | Quick.ORM.RestDB, Quick.ORM.RestDBFull, Quick.ORM.RestServer,
14 | Quick.ORM.Security.GUI, Quick.ORM.Security, Quick.ORM.Server.Base,
15 | Quick.ORM.Server.Config, Quick.ORM.UTF8Helper;
16 |
17 | implementation
18 |
19 | end.
20 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ClientHTTPSocket.dpr:
--------------------------------------------------------------------------------
1 | program ClientHTTPSocket;
2 |
3 | uses
4 | Vcl.Forms,
5 | ClientMain in 'ClientMain.pas' {MainForm},
6 | Quick.ORM.Form.Login in '..\..\..\..\Quick.ORM.Form.Login.pas' {frmLogin},
7 | Quick.ORM.Security.GUI in '..\..\..\..\Quick.ORM.Security.GUI.pas',
8 | Quick.AppSecurity in '..\..\..\..\Quick.AppSecurity.pas';
9 |
10 | {$R *.res}
11 |
12 | begin
13 | Application.Initialize;
14 | Application.MainFormOnTaskbar := True;
15 | Application.CreateForm(TMainForm, MainForm);
16 | Application.CreateForm(TfrmLogin, frmLogin);
17 | Application.Run;
18 | end.
19 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/common/ORMDemo.Interf.pas:
--------------------------------------------------------------------------------
1 | unit ORMDemo.Interf;
2 |
3 | interface
4 |
5 | uses
6 | {$IFDEF NEXTGEN}
7 | SynCrossPlatformJSON,
8 | SynCrossPlatformRest;
9 | {$ELSE}
10 | mORMot;
11 | {$ENDIF}
12 |
13 | type
14 |
15 | IServiceMethods = interface(IInvokable)
16 | ['{4EB49814-A4A9-40D2-B85A-137DDF43C72C}']
17 | function Sum(val1, val2 : Double) : Double;
18 | function Mult(val1, val2 : Double) : Double;
19 | function RandomNumber : Int64;
20 | end;
21 |
22 | implementation
23 |
24 | initialization
25 |
26 | {$IFNDEF NEXTGEN}
27 | TInterfaceFactory.RegisterInterfaces([TypeInfo(IServiceMethods)]);
28 | {$ENDIF}
29 | end.
30 |
--------------------------------------------------------------------------------
/Delphinus.Info.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "{03486B13-869C-4836-BF1A-828A93318F0D}",
3 | "name": "",
4 | "picture": "QuickORM.png",
5 | "license_type": "Apache-2.0",
6 | "license_file": "LICENSE.txt",
7 | "platforms": "Win32;Win64;Android;Linux64",
8 | "package_compiler_min": 22,
9 | "package_compiler_max": 33,
10 | "compiler_min": 22,
11 | "compiler_max": 33,
12 | "first_version": "",
13 | "report_url": "",
14 | "dependencies":
15 | [
16 | {
17 | "id": "{039708CE-1DC1-4FC5-A58E-A77B3177A9C8}",
18 | "version_min": "1.0"
19 | }
20 | ,
21 | {
22 | "id": "{58455621-E9CB-4DDC-8812-7FF096576B21}",
23 | "version_min": "1.0"
24 | }
25 | ]
26 | }
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ORMDemo.RestMethods.pas:
--------------------------------------------------------------------------------
1 | unit ORMDemo.RestMethods;
2 |
3 | interface
4 |
5 | uses
6 | mORMot,
7 | ORMDemo.Interf;
8 |
9 | type
10 |
11 | TServiceMethods = class(TInjectableObject,IServiceMethods)
12 | public
13 | function Sum(val1, val2 : Double) : Double;
14 | function Mult(val1, val2 : Double) : Double;
15 | function RandomNumber : Int64;
16 | end;
17 |
18 | implementation
19 |
20 | function TServiceMethods.Sum(val1, val2 : Double) : Double;
21 | begin
22 | Result := val1 + val2;
23 | end;
24 |
25 | function TServiceMethods.Mult(val1: Double; val2: Double) : Double;
26 | begin
27 | Result := val1 * val2;
28 | end;
29 |
30 | function TServiceMethods.RandomNumber : Int64;
31 | begin
32 | Result := Random(999999999);
33 | end;
34 |
35 | end.
36 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/delphi/ORMDemo.RestMethods.pas:
--------------------------------------------------------------------------------
1 | unit ORMDemo.RestMethods;
2 |
3 | interface
4 |
5 | uses
6 | mORMot,
7 | ORMDemo.Interf;
8 |
9 | type
10 |
11 | TServiceMethods = class(TInjectableObject,IServiceMethods)
12 | public
13 | function Sum(val1, val2 : Double) : Double;
14 | function Mult(val1, val2 : Double) : Double;
15 | function RandomNumber : Int64;
16 | end;
17 |
18 | implementation
19 |
20 | function TServiceMethods.Sum(val1, val2 : Double) : Double;
21 | begin
22 | Result := val1 + val2;
23 | end;
24 |
25 | function TServiceMethods.Mult(val1: Double; val2: Double) : Double;
26 | begin
27 | Result := val1 * val2;
28 | end;
29 |
30 | function TServiceMethods.RandomNumber : Int64;
31 | begin
32 | Result := Random(999999999);
33 | end;
34 |
35 | end.
36 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ORMDemo.RestMethods.pas:
--------------------------------------------------------------------------------
1 | unit ORMDemo.RestMethods;
2 |
3 | interface
4 |
5 | uses
6 | mORMot,
7 | ORMDemo.Interf;
8 |
9 | type
10 |
11 | TServiceMethods = class(TInjectableObject,IServiceMethods)
12 | public
13 | function Sum(val1, val2 : Double) : Double;
14 | function Mult(val1, val2 : Double) : Double;
15 | function RandomNumber : Int64;
16 | end;
17 |
18 | implementation
19 |
20 | function TServiceMethods.Sum(val1, val2 : Double) : Double;
21 | begin
22 | Result := val1 + val2;
23 | end;
24 |
25 | function TServiceMethods.Mult(val1: Double; val2: Double) : Double;
26 | begin
27 | Result := val1 * val2;
28 | end;
29 |
30 | function TServiceMethods.RandomNumber : Int64;
31 | begin
32 | Result := Random(999999999);
33 | end;
34 |
35 | end.
36 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ORMDemo.CustomServer.pas:
--------------------------------------------------------------------------------
1 | unit ORMDemo.CustomServer;
2 |
3 | interface
4 |
5 | uses
6 | Classes,
7 | mORMot,
8 | mORMotSQLite3,
9 | Quick.ORM.RestServer;
10 |
11 | type
12 | TORMServer = class(TCustomORMServer)
13 | published
14 | procedure Test(Ctxt: TSQLRestServerURIContext);
15 | procedure AppActions(Ctxt: TSQLRestServerURIContext);
16 | procedure List(Ctxt: TSQLRestServerURIContext);
17 | end;
18 |
19 | implementation
20 |
21 | procedure TORMServer.Test(Ctxt: TSQLRestServerURIContext);
22 | begin
23 | Ctxt.Returns('{"Test" : "OK"}',200);
24 | end;
25 |
26 | procedure TORMServer.AppActions(Ctxt: TSQLRestServerURIContext);
27 | begin
28 | Ctxt.Returns('{"AppActions" : "OK"}',200);
29 | end;
30 |
31 | procedure TORMServer.List(Ctxt: TSQLRestServerURIContext);
32 | begin
33 | Ctxt.Returns('{"List" : "OK"}',200);
34 | end;
35 |
36 | end.
37 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/delphi/ORMDemo.CustomServer.pas:
--------------------------------------------------------------------------------
1 | unit ORMDemo.CustomServer;
2 |
3 | interface
4 |
5 | uses
6 | Classes,
7 | mORMot,
8 | mORMotSQLite3,
9 | Quick.ORM.RestServer;
10 |
11 | type
12 | TORMServer = class(TCustomORMServer)
13 | published
14 | procedure Test(Ctxt: TSQLRestServerURIContext);
15 | procedure AppActions(Ctxt: TSQLRestServerURIContext);
16 | procedure List(Ctxt: TSQLRestServerURIContext);
17 | end;
18 |
19 | implementation
20 |
21 | procedure TORMServer.Test(Ctxt: TSQLRestServerURIContext);
22 | begin
23 | Ctxt.Returns('{"Test" : "OK"}',200);
24 | end;
25 |
26 | procedure TORMServer.AppActions(Ctxt: TSQLRestServerURIContext);
27 | begin
28 | Ctxt.Returns('{"AppActions" : "OK"}',200);
29 | end;
30 |
31 | procedure TORMServer.List(Ctxt: TSQLRestServerURIContext);
32 | begin
33 | Ctxt.Returns('{"List" : "OK"}',200);
34 | end;
35 |
36 | end.
37 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ORMDemo.CustomServer.pas:
--------------------------------------------------------------------------------
1 | unit ORMDemo.CustomServer;
2 |
3 | interface
4 |
5 | uses
6 | Classes,
7 | mORMot,
8 | mORMotSQLite3,
9 | Quick.ORM.RestServer;
10 |
11 | type
12 | TORMServer = class(TCustomORMServer)
13 | published
14 | procedure Test(Ctxt: TSQLRestServerURIContext);
15 | procedure AppActions(Ctxt: TSQLRestServerURIContext);
16 | procedure List(Ctxt: TSQLRestServerURIContext);
17 | end;
18 |
19 | implementation
20 |
21 | procedure TORMServer.Test(Ctxt: TSQLRestServerURIContext);
22 | begin
23 | Ctxt.Returns('{"Test" : "OK"}',200);
24 | end;
25 |
26 | procedure TORMServer.AppActions(Ctxt: TSQLRestServerURIContext);
27 | begin
28 | Ctxt.Returns('{"AppActions" : "OK"}',200);
29 | end;
30 |
31 | procedure TORMServer.List(Ctxt: TSQLRestServerURIContext);
32 | begin
33 | Ctxt.Returns('{"List" : "OK"}',200);
34 | end;
35 |
36 | end.
37 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | #ignore thumbnails created by windows
3 | Thumbs.db
4 | *.bak
5 | *.cache
6 | # Delphi compiler-generated binaries (safe to delete)
7 | *.exe
8 | *.dll
9 | *.bpl
10 | *.bpi
11 | *.dcp
12 | *.so
13 | *.apk
14 | *.drc
15 | *.map
16 | *.dres
17 | *.rsm
18 | *.tds
19 | *.dcu
20 | *.lib
21 | *.a
22 | *.o
23 | *.ocx
24 | *.zip
25 | *.log
26 |
27 | # Delphi autogenerated files (duplicated info)
28 | *.cfg
29 | *.hpp
30 | *Resource.rc
31 |
32 | # Delphi local files (user-specific info)
33 | *.local
34 | *.identcache
35 | *.projdata
36 | *.tvsconfig
37 | *.dsk
38 |
39 | # Delphi history and backups
40 | __history/
41 | __recovery/
42 | *.~*
43 |
44 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi)
45 | *.stat
46 | desktop.ini
47 | *.compiled
48 |
49 | samples/ORMRestServerDemo/bin/Win64/Debug/
50 |
51 | samples/ORMRestServerDemo/bin/Android/Debug/
52 |
53 | samples/ORMRestServerDemo/source/bin/Android/Debug/
54 |
55 | samples/ORMRestServerDemo/source/Firemonkey/android/AndroidManifest\.template\.xml
56 |
57 | *.ppu
58 |
59 | *.rsj
60 |
61 | *.db3
62 |
63 | *.db3-journal
64 |
65 | samples/ORMRestServerDemo/source/fpc/backup/
66 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/common/ORMDemo.Model.pas:
--------------------------------------------------------------------------------
1 | unit ORMDemo.Model;
2 |
3 | interface
4 |
5 | uses
6 | {$IFDEF NEXTGEN}
7 | SynCrossPlatformJSON,
8 | SynCrossPlatformRest,
9 | {$ELSE}
10 | mORMot,
11 | SynCommons,
12 | {$ENDIF}
13 | Quick.ORM.Engine;
14 |
15 | type
16 | TLogin = class
17 | private
18 | fUsername : RawUTF8;
19 | fUserPass : RawUTF8;
20 | fLastLogin : TDateTime;
21 | published
22 | property Username : RawUTF8 read fUsername write fUsername;
23 | property UserPass : RawUTF8 read fUserPass write fUserPass;
24 | property LastLogin : TDateTime read fLastLogin write fLastLogin;
25 | end;
26 |
27 | { TAUser }
28 |
29 | TAUser = class(TSQLRecordTimeStamped)
30 | private
31 | fName : RawUTF8;
32 | fSurname : RawUTF8;
33 | fAge : Integer;
34 | fLogin : TLogin;
35 | public
36 | constructor Create; override;
37 | published
38 | property Name : RawUTF8 read fName write fName;
39 | property Surname : RawUTF8 read fSurname write fSurname;
40 | property Age : Integer read fAge write fAge;
41 | property Login : TLogin read fLogin write fLogin;
42 | end;
43 |
44 | TAGroup = class(TSQLRecord)
45 | private
46 | fName : RawUTF8;
47 | fAllowNewUsers : Boolean;
48 | published
49 | property Name : RawUTF8 read fName write fName;
50 | property AllowNewUsers : Boolean read fAllowNewUsers write fAllowNewUsers;
51 | end;
52 |
53 | implementation
54 |
55 | { TAUser }
56 |
57 | constructor TAUser.Create;
58 | begin
59 | inherited;
60 | fLogin := TLogin.Create;
61 | end;
62 |
63 | end.
64 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ORMRestServer.lpi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ClientMain.dfm:
--------------------------------------------------------------------------------
1 | object MainForm: TMainForm
2 | Left = 0
3 | Top = 0
4 | Caption = 'ORMRestClient HTTP Socket'
5 | ClientHeight = 380
6 | ClientWidth = 635
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | Position = poScreenCenter
15 | OnClose = FormClose
16 | OnCreate = FormCreate
17 | PixelsPerInch = 96
18 | TextHeight = 13
19 | object btnConnect: TButton
20 | Left = 552
21 | Top = 347
22 | Width = 75
23 | Height = 25
24 | Caption = 'Connect'
25 | TabOrder = 0
26 | OnClick = btnConnectClick
27 | end
28 | object meInfo: TMemo
29 | Left = 8
30 | Top = 8
31 | Width = 619
32 | Height = 273
33 | ReadOnly = True
34 | ScrollBars = ssVertical
35 | TabOrder = 1
36 | end
37 | object btnGetUsers: TButton
38 | Left = 463
39 | Top = 296
40 | Width = 75
41 | Height = 25
42 | Caption = 'Get Users'
43 | Enabled = False
44 | TabOrder = 2
45 | OnClick = btnGetUsersClick
46 | end
47 | object btnGetGroups: TButton
48 | Left = 382
49 | Top = 296
50 | Width = 75
51 | Height = 25
52 | Caption = 'Get Groups'
53 | Enabled = False
54 | TabOrder = 3
55 | OnClick = btnGetGroupsClick
56 | end
57 | object btnFuncSum: TButton
58 | Left = 95
59 | Top = 324
60 | Width = 75
61 | Height = 25
62 | Caption = 'Sum'
63 | Enabled = False
64 | TabOrder = 4
65 | OnClick = btnFuncSumClick
66 | end
67 | object btnFuncRandom: TButton
68 | Left = 301
69 | Top = 296
70 | Width = 75
71 | Height = 25
72 | Caption = 'Random'
73 | Enabled = False
74 | TabOrder = 5
75 | OnClick = btnFuncRandomClick
76 | end
77 | object btnFuncMult: TButton
78 | Left = 95
79 | Top = 296
80 | Width = 75
81 | Height = 25
82 | Caption = 'Mult'
83 | Enabled = False
84 | TabOrder = 6
85 | OnClick = btnFuncMultClick
86 | end
87 | object edVal1: TEdit
88 | Left = 12
89 | Top = 298
90 | Width = 77
91 | Height = 21
92 | TabOrder = 7
93 | Text = '4'
94 | end
95 | object edVal2: TEdit
96 | Left = 12
97 | Top = 325
98 | Width = 77
99 | Height = 21
100 | TabOrder = 8
101 | Text = '2'
102 | end
103 | end
104 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/delphi/ClientMain.dfm:
--------------------------------------------------------------------------------
1 | object MainForm: TMainForm
2 | Left = 0
3 | Top = 0
4 | Caption = 'ORMRestClient HTTP Socket'
5 | ClientHeight = 380
6 | ClientWidth = 635
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | Position = poScreenCenter
15 | OnClose = FormClose
16 | OnCreate = FormCreate
17 | PixelsPerInch = 96
18 | TextHeight = 13
19 | object btnConnect: TButton
20 | Left = 552
21 | Top = 347
22 | Width = 75
23 | Height = 25
24 | Caption = 'Connect'
25 | TabOrder = 0
26 | OnClick = btnConnectClick
27 | end
28 | object meInfo: TMemo
29 | Left = 8
30 | Top = 8
31 | Width = 619
32 | Height = 273
33 | ReadOnly = True
34 | ScrollBars = ssVertical
35 | TabOrder = 1
36 | end
37 | object btnGetUsers: TButton
38 | Left = 463
39 | Top = 296
40 | Width = 75
41 | Height = 25
42 | Caption = 'Get Users'
43 | Enabled = False
44 | TabOrder = 2
45 | OnClick = btnGetUsersClick
46 | end
47 | object btnGetGroups: TButton
48 | Left = 382
49 | Top = 296
50 | Width = 75
51 | Height = 25
52 | Caption = 'Get Groups'
53 | Enabled = False
54 | TabOrder = 3
55 | OnClick = btnGetGroupsClick
56 | end
57 | object btnFuncSum: TButton
58 | Left = 95
59 | Top = 324
60 | Width = 75
61 | Height = 25
62 | Caption = 'Sum'
63 | Enabled = False
64 | TabOrder = 4
65 | OnClick = btnFuncSumClick
66 | end
67 | object btnFuncRandom: TButton
68 | Left = 301
69 | Top = 296
70 | Width = 75
71 | Height = 25
72 | Caption = 'Random'
73 | Enabled = False
74 | TabOrder = 5
75 | OnClick = btnFuncRandomClick
76 | end
77 | object btnFuncMult: TButton
78 | Left = 95
79 | Top = 296
80 | Width = 75
81 | Height = 25
82 | Caption = 'Mult'
83 | Enabled = False
84 | TabOrder = 6
85 | OnClick = btnFuncMultClick
86 | end
87 | object edVal1: TEdit
88 | Left = 12
89 | Top = 298
90 | Width = 77
91 | Height = 21
92 | TabOrder = 7
93 | Text = '4'
94 | end
95 | object edVal2: TEdit
96 | Left = 12
97 | Top = 325
98 | Width = 77
99 | Height = 21
100 | TabOrder = 8
101 | Text = '2'
102 | end
103 | end
104 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ClientMain.dfm:
--------------------------------------------------------------------------------
1 | object MainForm: TMainForm
2 | Left = 0
3 | Top = 0
4 | Caption = 'ORMRestClient HTTP Socket'
5 | ClientHeight = 380
6 | ClientWidth = 635
7 | Color = clBtnFace
8 | Font.Charset = DEFAULT_CHARSET
9 | Font.Color = clWindowText
10 | Font.Height = -11
11 | Font.Name = 'Tahoma'
12 | Font.Style = []
13 | OldCreateOrder = False
14 | Position = poScreenCenter
15 | OnClose = FormClose
16 | OnCreate = FormCreate
17 | PixelsPerInch = 96
18 | TextHeight = 13
19 | object btnConnect: TButton
20 | Left = 552
21 | Top = 347
22 | Width = 75
23 | Height = 25
24 | Caption = 'Connect'
25 | TabOrder = 0
26 | OnClick = btnConnectClick
27 | end
28 | object meInfo: TMemo
29 | Left = 8
30 | Top = 8
31 | Width = 619
32 | Height = 273
33 | ReadOnly = True
34 | ScrollBars = ssVertical
35 | TabOrder = 1
36 | end
37 | object btnGetUsers: TButton
38 | Left = 463
39 | Top = 296
40 | Width = 75
41 | Height = 25
42 | Caption = 'Get Users'
43 | Enabled = False
44 | TabOrder = 2
45 | OnClick = btnGetUsersClick
46 | end
47 | object btnGetGroups: TButton
48 | Left = 382
49 | Top = 296
50 | Width = 75
51 | Height = 25
52 | Caption = 'Get Groups'
53 | Enabled = False
54 | TabOrder = 3
55 | OnClick = btnGetGroupsClick
56 | end
57 | object btnFuncSum: TButton
58 | Left = 95
59 | Top = 324
60 | Width = 75
61 | Height = 25
62 | Caption = 'Sum'
63 | Enabled = False
64 | TabOrder = 4
65 | OnClick = btnFuncSumClick
66 | end
67 | object btnFuncRandom: TButton
68 | Left = 301
69 | Top = 296
70 | Width = 75
71 | Height = 25
72 | Caption = 'Random'
73 | Enabled = False
74 | TabOrder = 5
75 | OnClick = btnFuncRandomClick
76 | end
77 | object btnFuncMult: TButton
78 | Left = 95
79 | Top = 296
80 | Width = 75
81 | Height = 25
82 | Caption = 'Mult'
83 | Enabled = False
84 | TabOrder = 6
85 | OnClick = btnFuncMultClick
86 | end
87 | object edVal1: TEdit
88 | Left = 12
89 | Top = 298
90 | Width = 77
91 | Height = 21
92 | TabOrder = 7
93 | Text = '4'
94 | end
95 | object edVal2: TEdit
96 | Left = 12
97 | Top = 325
98 | Width = 77
99 | Height = 21
100 | TabOrder = 8
101 | Text = '2'
102 | end
103 | end
104 |
--------------------------------------------------------------------------------
/Quick.ORM.Form.Login.dfm:
--------------------------------------------------------------------------------
1 | object frmLogin: TfrmLogin
2 | Left = 0
3 | Top = 0
4 | BorderIcons = []
5 | BorderStyle = bsDialog
6 | Caption = 'Login'
7 | ClientHeight = 158
8 | ClientWidth = 338
9 | Color = clBtnFace
10 | Font.Charset = DEFAULT_CHARSET
11 | Font.Color = clWindowText
12 | Font.Height = -11
13 | Font.Name = 'Tahoma'
14 | Font.Style = []
15 | OldCreateOrder = False
16 | Position = poOwnerFormCenter
17 | OnCreate = FormCreate
18 | DesignSize = (
19 | 338
20 | 158)
21 | PixelsPerInch = 96
22 | TextHeight = 13
23 | object lblHost: TLabel
24 | Left = 83
25 | Top = 12
26 | Width = 54
27 | Height = 13
28 | AutoSize = False
29 | Caption = 'Server:'
30 | end
31 | object Label2: TLabel
32 | Left = 83
33 | Top = 39
34 | Width = 54
35 | Height = 13
36 | AutoSize = False
37 | Caption = 'User:'
38 | end
39 | object Label3: TLabel
40 | Left = 83
41 | Top = 66
42 | Width = 54
43 | Height = 13
44 | AutoSize = False
45 | Caption = 'Password:'
46 | end
47 | object imgLogo: TImage
48 | Left = 8
49 | Top = 14
50 | Width = 64
51 | Height = 64
52 | Center = True
53 | Stretch = True
54 | end
55 | object edHost: TEdit
56 | Left = 143
57 | Top = 9
58 | Width = 119
59 | Height = 21
60 | TabOrder = 0
61 | TextHint = 'Host or ip'
62 | end
63 | object edUsername: TEdit
64 | Left = 143
65 | Top = 36
66 | Width = 161
67 | Height = 21
68 | TabOrder = 2
69 | TextHint = 'User name'
70 | end
71 | object edUserPass: TEdit
72 | Left = 143
73 | Top = 63
74 | Width = 161
75 | Height = 21
76 | PasswordChar = '*'
77 | TabOrder = 3
78 | TextHint = 'Password'
79 | end
80 | object btnOk: TButton
81 | Left = 170
82 | Top = 125
83 | Width = 76
84 | Height = 25
85 | Anchors = [akRight, akBottom]
86 | Caption = 'Ok'
87 | ModalResult = 1
88 | TabOrder = 5
89 | end
90 | object btnCancel: TButton
91 | Left = 255
92 | Top = 125
93 | Width = 75
94 | Height = 25
95 | Anchors = [akRight, akBottom]
96 | Caption = 'Cancel'
97 | ModalResult = 2
98 | TabOrder = 6
99 | end
100 | object cxSaveCredentials: TCheckBox
101 | Left = 143
102 | Top = 97
103 | Width = 187
104 | Height = 17
105 | Caption = 'Remember my credentials'
106 | TabOrder = 4
107 | end
108 | object edPort: TEdit
109 | Left = 265
110 | Top = 9
111 | Width = 39
112 | Height = 21
113 | NumbersOnly = True
114 | TabOrder = 1
115 | TextHint = 'Port'
116 | end
117 | end
118 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/Firemonkey/android/Main.pas:
--------------------------------------------------------------------------------
1 | unit Main;
2 |
3 | interface
4 |
5 | uses
6 | System.SysUtils,
7 | System.Types,
8 | System.UITypes,
9 | System.Classes,
10 | System.Variants,
11 | FMX.Types,
12 | FMX.Controls,
13 | FMX.Forms,
14 | FMX.Graphics,
15 | FMX.Dialogs,
16 | FMX.Controls.Presentation,
17 | FMX.StdCtrls,
18 | FMX.ScrollBox,
19 | FMX.Memo,
20 | FMX.Edit,
21 | System.Generics.Collections,
22 | SynCrossPlatformRest,
23 | Quick.Commons,
24 | Quick.ORM.Engine,
25 | Quick.ORM.RestClient.Cross,
26 | ORMDemo.Model,
27 | ORMDemo.Interf; //unit contains interface for rest methods;
28 |
29 | type
30 | TForm1 = class(TForm)
31 | meInfo: TMemo;
32 | Panel1: TPanel;
33 | Panel2: TPanel;
34 | edHost: TEdit;
35 | btnConnect: TButton;
36 | btnRandom: TButton;
37 | btnGetUsers: TButton;
38 | procedure FormCreate(Sender: TObject);
39 | procedure btnConnectClick(Sender: TObject);
40 | procedure btnGetUsersClick(Sender: TObject);
41 | procedure GetUsers;
42 | private
43 | { Private declarations }
44 | public
45 | { Public declarations }
46 | end;
47 |
48 | var
49 | Form1: TForm1;
50 | RestClient : TORMRestClient;
51 | RestFunc : IServiceMethods;
52 |
53 | implementation
54 |
55 | {$R *.fmx}
56 |
57 | procedure TForm1.btnConnectClick(Sender: TObject);
58 | var
59 | done : Boolean;
60 | begin
61 | RestClient.Host := edHost.Text;
62 | done := RestClient.Connect;
63 | if done then meInfo.Lines.Add('Connected to RestServer!')
64 | else
65 | begin
66 | meInfo.Lines.Add('Can''t connect to Restserver!');
67 | Exit;
68 | end;
69 | end;
70 |
71 | procedure TForm1.btnGetUsersClick(Sender: TObject);
72 | begin
73 | GetUsers;
74 | end;
75 |
76 | procedure TForm1.GetUsers;
77 | var
78 | User : TAUser;
79 | begin
80 | User := TAUser.CreateAndFillPrepare(RestClient.ORM,'','',[]);
81 | try
82 | if User = nil then
83 | begin
84 | meInfo.Lines.Add('No results found!');
85 | Exit;
86 | end;
87 | while User.FillOne do
88 | begin
89 | meInfo.Lines.Add(Format('%s / %d year(s) / LastLogin: %s',[User.Name,User.Age,DateTimeToStr(User.Login.LastLogin)]));
90 | end;
91 | finally
92 | User.Free;
93 | end;
94 | end;
95 |
96 | procedure TForm1.FormCreate(Sender: TObject);
97 | begin
98 | RestClient := TORMRestClient.Create;
99 | RestClient.Host := '192.168.1.107';
100 | RestClient.Port := 8099;
101 | RestClient.DataBase.IncludedClasses := [TAUser,TAGroup];
102 | RestClient.Login.UserName := 'Admin';
103 | RestClient.Login.UserPass := 'exilon';
104 | RestClient.HTTPOptions.Protocol := TSrvProtocol.spHTTP_Socket;
105 | RestClient.HTTPOptions.AuthMode := TAuthMode.amDefault;
106 | RestClient.Service.MethodInterface := IServiceMethods;
107 | RestClient.Service.InstanceImplementation := sicShared;
108 | RestClient.Service.Enabled := True;
109 | end;
110 |
111 | end.
112 |
--------------------------------------------------------------------------------
/quickorm.lpk:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/Firemonkey/android/Main.fmx:
--------------------------------------------------------------------------------
1 | object Form1: TForm1
2 | Left = 0
3 | Top = 0
4 | Caption = 'Form1'
5 | ClientHeight = 593
6 | ClientWidth = 449
7 | FormFactor.Width = 320
8 | FormFactor.Height = 480
9 | FormFactor.Devices = [Desktop]
10 | OnCreate = FormCreate
11 | DesignerMasterStyle = 3
12 | object meInfo: TMemo
13 | Touch.InteractiveGestures = [Pan, LongTap, DoubleTap]
14 | DataDetectorTypes = []
15 | Align = Client
16 | Size.Width = 449.000000000000000000
17 | Size.Height = 495.000000000000000000
18 | Size.PlatformDefault = False
19 | TabOrder = 1
20 | Viewport.Width = 441.000000000000000000
21 | Viewport.Height = 487.000000000000000000
22 | end
23 | object Panel1: TPanel
24 | Align = Bottom
25 | Position.Y = 544.000000000000000000
26 | Size.Width = 449.000000000000000000
27 | Size.Height = 49.000000000000000000
28 | Size.PlatformDefault = False
29 | TabOrder = 2
30 | object btnRandom: TButton
31 | Align = Right
32 | Margins.Top = 5.000000000000000000
33 | Margins.Right = 5.000000000000000000
34 | Margins.Bottom = 5.000000000000000000
35 | Position.X = 181.000000000000000000
36 | Position.Y = 5.000000000000000000
37 | Size.Width = 129.000000000000000000
38 | Size.Height = 39.000000000000000000
39 | Size.PlatformDefault = False
40 | TabOrder = 1
41 | Text = 'Random'
42 | end
43 | object btnGetUsers: TButton
44 | Align = Right
45 | Margins.Top = 5.000000000000000000
46 | Margins.Right = 5.000000000000000000
47 | Margins.Bottom = 5.000000000000000000
48 | Position.X = 315.000000000000000000
49 | Position.Y = 5.000000000000000000
50 | Size.Width = 129.000000000000000000
51 | Size.Height = 39.000000000000000000
52 | Size.PlatformDefault = False
53 | TabOrder = 0
54 | Text = 'Get Users'
55 | OnClick = btnGetUsersClick
56 | end
57 | end
58 | object Panel2: TPanel
59 | Align = MostTop
60 | Size.Width = 449.000000000000000000
61 | Size.Height = 49.000000000000000000
62 | Size.PlatformDefault = False
63 | TabOrder = 3
64 | object edHost: TEdit
65 | Touch.InteractiveGestures = [LongTap, DoubleTap]
66 | Anchors = [akLeft, akTop, akRight]
67 | TabOrder = 1
68 | Text = '192.168.1.107'
69 | Position.X = 8.000000000000000000
70 | Position.Y = 8.000000000000000000
71 | Size.Width = 300.000000000000000000
72 | Size.Height = 32.000000000000000000
73 | Size.PlatformDefault = False
74 | end
75 | object btnConnect: TButton
76 | Align = Right
77 | Margins.Left = 5.000000000000000000
78 | Margins.Top = 5.000000000000000000
79 | Margins.Right = 5.000000000000000000
80 | Margins.Bottom = 5.000000000000000000
81 | Position.X = 315.000000000000000000
82 | Position.Y = 5.000000000000000000
83 | Size.Width = 129.000000000000000000
84 | Size.Height = 39.000000000000000000
85 | Size.PlatformDefault = False
86 | TabOrder = 0
87 | Text = 'Connect'
88 | OnClick = btnConnectClick
89 | end
90 | end
91 | end
92 |
--------------------------------------------------------------------------------
/Quick.ORM.DataBase.pas:
--------------------------------------------------------------------------------
1 | { ***************************************************************************
2 |
3 | Copyright (c) 2016-2019 Kike P�rez
4 |
5 | Unit : Quick.ORM.DataBase
6 | Description : Rest ORM Database config & connection
7 | Author : Kike P�rez
8 | Version : 1.2
9 | Created : 20/06/2017
10 | Modified : 27/02/2019
11 |
12 | This file is part of QuickORM: https://github.com/exilon/QuickORM
13 |
14 | Uses Synopse mORMot framework. Copyright (C) 2017 Arnaud Bouchez
15 | Synopse Informatique - https://synopse.info
16 |
17 | ***************************************************************************
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 |
31 | *************************************************************************** }
32 |
33 | unit Quick.ORM.DataBase;
34 |
35 | {$i QuickORM.inc}
36 |
37 | interface
38 |
39 | uses
40 | Classes,
41 | SysUtils,
42 | SynCommons,
43 | mORMot,
44 | mORMotDB,
45 | SynDB,
46 | {$IFNDEF FPC}
47 | System.IOUtils,
48 | {$ELSE}
49 | Quick.Files,
50 | {$ENDIF}
51 | Quick.Commons,
52 | Quick.ORM.Engine;
53 |
54 | type
55 |
56 | TORMDataBase = class
57 | private
58 | fSQLProperties : TSQLDBConnectionProperties;
59 | fDBFileName : RawUTF8;
60 | fDBType : TDBType;
61 | fDBIndexes : TDBIndexArray;
62 | fDBMappingFields : TDBMappingArray;
63 | fFullMemoryMode : Boolean;
64 | fModel : TSQLModel;
65 | faRootURI : RawUTF8;
66 | fIncludedClasses : TSQLRecordClassArray;
67 | fSQLConnection : TSQLConnection;
68 | fLockMode : TSQLiteLockMode;
69 | procedure SetDBFileName(const dbfname : RawUTF8);
70 | public
71 | property DBType : TDBType read fDBType write fDBType;
72 | property DBFileName : RawUTF8 read fDBFileName write SetDBFileName;
73 | property DBIndexes : TDBIndexArray read fDBIndexes write fDBIndexes;
74 | property DBMappingFields : TDBMappingArray read fDBMappingFields write fDBMappingFields;
75 | property Model : TSQLModel read fModel write fModel;
76 | property FullMemoryMode : Boolean read fFullMemoryMode write fFullMemoryMode;
77 | property LockMode : TSQLiteLockMode read fLockMode write fLockMode;
78 | property aRootURI : RawUTF8 read faRootURI write faRootURI;
79 | property IncludedClasses : TSQLRecordClassArray read fIncludedClasses write fIncludedClasses;
80 | property SQLProperties : TSQLDBConnectionProperties read fSQLProperties write fSQLProperties;
81 | property SQLConnection : TSQLConnection read fSQLConnection write fSQLConnection;
82 | constructor Create;
83 | destructor Destroy; override;
84 | end;
85 |
86 | implementation
87 |
88 |
89 | {TORMDataBase Class}
90 |
91 | constructor TORMDataBase.Create;
92 | begin
93 | fDBType := dtSQLite;
94 | fModel := nil;
95 | faRootURI := 'root';
96 | fDBFileName := '.\default.db3';
97 | fSQLConnection := TSQLConnection.Create;
98 | fSQLConnection.Provider := TDBProvider.dbMSSQL;
99 | fLockMode := TSQLiteLockMode.lmNormal;
100 | end;
101 |
102 | destructor TORMDataBase.Destroy;
103 | begin
104 | if Assigned(fModel) then fModel.Free;
105 | if Assigned(fSQLConnection) then fSQLConnection.Free;
106 | inherited;
107 | end;
108 |
109 | procedure TORMDataBase.SetDBFileName(const dbfname : RawUTF8);
110 | begin
111 | //if dbfile not found, sets as current app dir
112 | if (CompareText(dbfname,'SQLITE_MEMORY_DATABASE_NAME') = 0) or TFile.Exists(dbfname) then fDBFileName := dbfname
113 | else fDBFileName := Format('%s\%s',[path.EXEPATH,TPath.GetFileName(dbfname)]);
114 | end;
115 |
116 | end.
117 |
--------------------------------------------------------------------------------
/QuickORM.inc:
--------------------------------------------------------------------------------
1 | {
2 | This file is part of QuickORM: https://github.com/exilon/QuickORM
3 |
4 | QuickLibs. Copyright (C) 2020 Kike Pérez
5 | Exilon - https://www.exilon.es
6 |
7 | ***************************************************************************
8 |
9 | Licensed under the Apache License, Version 2.0 (the "License");
10 | you may not use this file except in compliance with the License.
11 | You may obtain a copy of the License at
12 |
13 | http://www.apache.org/licenses/LICENSE-2.0
14 |
15 | Unless required by applicable law or agreed to in writing, software
16 | distributed under the License is distributed on an "AS IS" BASIS,
17 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | See the License for the specific language governing permissions and
19 | limitations under the License.
20 |
21 | ***************************************************************************
22 | }
23 |
24 | {$ifdef FPC}
25 | {$MODE DELPHI}
26 |
27 | {$INLINE ON}
28 | {$define HASINLINE}
29 |
30 | {$ifdef LINUX}
31 | {$define FPCLINUX}
32 | {$endif}
33 |
34 | {$ifdef ANDROID}
35 | {$define LINUX}
36 | {$endif}
37 |
38 | {$ifdef VER2_7}
39 | {$define ISFPC27}
40 | {$endif}
41 |
42 | {$ifdef VER3_0}
43 | {$define ISFPC27}
44 | {$define ISFPC30}
45 | {$endif}
46 |
47 | {$ifdef VER3_1}
48 | {$define ISFPC27}
49 | {$define ISFPC30}
50 | {$endif}
51 |
52 | {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
53 | {$define FPC_ENUMHASINNER}
54 | {$endif}
55 |
56 | {$ifdef FPC_HAS_MANAGEMENT_OPERATORS}
57 | {$define ISDELPHI2006ANDUP}
58 | {$endif FPC_HAS_MANAGEMENT_OPERATORS}
59 |
60 | {$else FPC}
61 |
62 | {$ifdef CONDITIONALEXPRESSIONS} //Delphi 6 or newer
63 | {$define HASINTERFACERTTI} //interface RTTI (not FPC)
64 | {$ifndef LINUX}
65 | {$ifdef VER140}
66 | {$define DELPHI6_UP} //Delphi 6 or newer
67 | {$else}
68 | {$define DELPHI7_UP} //Delphi 7 or newer
69 | {$endif}
70 | {$endif LINUX}
71 | {$if CompilerVersion >= 17}
72 | {$define DELPHI2005_UP} //Delphi 2005 or newer
73 | {$ifend}
74 | {$if CompilerVersion >= 18}
75 | {$define DELPHI2006_UP} //Delphi 2006 or newer
76 | {$define HASINLINE}
77 | {$ifend}
78 | {$if CompilerVersion > 18}
79 | {$define DELPHI2007_UP} //Delphi 2007 or newer
80 | {$ifend}
81 | {$if CompilerVersion = 20}
82 | {$define DELPHI2009_UP} //Delphi 2009
83 | {$ifend}
84 | {$if CompilerVersion >= 21.0} //Delphi 2010
85 | {$define DELPHI2010_UP}
86 | {$define FPC_OR_UNICODE}
87 | {$ifend}
88 | {$if CompilerVersion >= 22.0} //Delphi XE
89 | {$define DELPHIXE_UP}
90 | {$ifend}
91 | {$if CompilerVersion >= 23.0} //Delphi XE2
92 | {$define DELPHIXE2_UP}
93 | {$ifend}
94 | {$if CompilerVersion >= 24.0} //Delphi XE3
95 | {$define DELPHIXE3_UP}
96 | {$ifend}
97 | {$if CompilerVersion >= 25.0} //Delphi XE4
98 | {$define DELPHIXE4_UP}
99 | {$ifend}
100 | {$if CompilerVersion >= 26.0} //Delphi XE5
101 | {$define DELPHIXE5_UP}
102 | {$ifend}
103 | {$if CompilerVersion >= 27.0} //Delphi XE6
104 | {$define DELPHIXE6_UP}
105 | {$ifend}
106 | {$if CompilerVersion >= 28.0} //Delphi XE7
107 | {$define DELPHIXE7_UP}
108 | {$ifend}
109 | {$if CompilerVersion >= 29.0} //Delphi XE8
110 | {$define DELPHIXE8_UP}
111 | {$ifend}
112 | {$if CompilerVersion >= 30.0} //Delphi XE10 Seattle
113 | {$define DELPHIRX10_UP}
114 | {$define DELPHISEATTLE_UP}
115 | {$ifend}
116 | {$if CompilerVersion >= 31.0} //Delphi RX10.1 Berlin
117 | {$define DELPHIRX101_UP}
118 | {$define DELPHIBERLIN_UP}
119 | {$ifend}
120 | {$if CompilerVersion >= 32.0} //Delphi RX10.2 Tokyo
121 | {$define DELPHIRX102_UP}
122 | {$define DELPHITOKYO_UP}
123 | {$ifdef LINUX}
124 | {$define DELPHILINUX}
125 | {$ifend}
126 | {$ifend}
127 | {$if CompilerVersion >= 33.0} //Delphi RX10.3 Rio
128 | {$define DELPHIRX103_UP}
129 | {$define DELPHIRIO_UP}
130 | {$ifend}
131 | {$if CompilerVersion >= 33.0} //Delphi RX10.4 Sydney
132 | {$define DELPHIRX104_UP}
133 | {$define DELPHISYDNEY_UP}
134 | {$if defined(ANDROID) OR defined(LINUX) OR defined(IOS)}
135 | {$define NEXTGEN} //compatibility with older delphis
136 | {$endif}
137 | {$ifend}
138 | {$else}
139 | //Delphi 5 or older
140 | {$define DELPHI6OROLDER}
141 | {$define DELPHI5OROLDER}
142 | {$define DELPHI5ORFPC}
143 | {$define MSWINDOWS}
144 | {$endif}
145 |
146 | {$endif FPC}
147 |
148 | {$ifdef VER150}
149 | {$WARN SYMBOL_DEPRECATED OFF}
150 | {$WARN UNSAFE_TYPE OFF}
151 | {$WARN UNSAFE_CODE OFF}
152 | {$WARN UNSAFE_CAST OFF}
153 | {$ENDIF}
154 |
155 | {$ifdef CONDITIONALEXPRESSIONS} //Delphi 6 or newer
156 | {.$WARN SYMBOL_PLATFORM OFF}
157 | {.$WARN UNIT_PLATFORM OFF}
158 | {$endif}
159 |
160 |
161 |
162 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/delphi/ClientMain.pas:
--------------------------------------------------------------------------------
1 | unit ClientMain;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
8 | mORMot,
9 | SynCommons,
10 | Quick.ORM.Engine,
11 | Quick.ORM.RestClient,
12 | ORMDemo.Model, //unit contains Models for Demo
13 | Vcl.StdCtrls,
14 | System.Generics.Collections,
15 | ORMDemo.Interf; //unit contains interface for rest methods
16 |
17 | type
18 | TMainForm = class(TForm)
19 | btnConnect: TButton;
20 | meInfo: TMemo;
21 | btnGetUsers: TButton;
22 | btnGetGroups: TButton;
23 | btnFuncSum: TButton;
24 | btnFuncRandom: TButton;
25 | btnFuncMult: TButton;
26 | edVal1: TEdit;
27 | edVal2: TEdit;
28 | procedure FormCreate(Sender: TObject);
29 | procedure FormClose(Sender: TObject; var Action: TCloseAction);
30 | procedure btnConnectClick(Sender: TObject);
31 | procedure btnGetUsersClick(Sender: TObject);
32 | procedure GetUsers;
33 | procedure GetGroups;
34 | procedure btnGetGroupsClick(Sender: TObject);
35 | procedure btnFuncSumClick(Sender: TObject);
36 | procedure btnFuncMultClick(Sender: TObject);
37 | procedure btnFuncRandomClick(Sender: TObject);
38 | private
39 | { Private declarations }
40 | public
41 | { Public declarations }
42 | end;
43 |
44 | var
45 | MainForm: TMainForm;
46 | RestClient : TORMRestClient;
47 | RestFunc : IServiceMethods;
48 |
49 | implementation
50 |
51 | {$R *.dfm}
52 |
53 | procedure TMainForm.btnConnectClick(Sender: TObject);
54 | var
55 | done : Boolean;
56 | begin
57 | if RestClient.HTTPOptions.AuthMode = amNoAuthentication then done := RestClient.Connect
58 | else done := RestClient.LoginPrompt(True);
59 | //done := RestClient.Connect(edHost.Text,StrToInt(edPort.Text));
60 | if done then meInfo.Lines.Add('Connected to RestServer!')
61 | else
62 | begin
63 | meInfo.Lines.Add('Can''t connect to Restserver!');
64 | Exit;
65 | end;
66 | btnGetUsers.Enabled := done;
67 | btnGetGroups.Enabled := done;
68 | btnFuncSum.Enabled := done;
69 | btnFuncMult.Enabled := done;
70 | btnFuncRandom.Enabled := done;
71 |
72 | //gets Interface-Method service
73 | if RestClient.Service.Enabled then RestClient.Service.SetRestMethod(RestFunc);
74 |
75 | //show apps actions access security
76 | if RestClient.ActionAllowed('Home.Open') then meInfo.Lines.Add('Allowed "Home.Open"')
77 | else meInfo.Lines.Add('Denied "Home.Open"');
78 |
79 | if RestClient.ActionAllowed('Users.List') then meInfo.Lines.Add('Allowed "Users.List"')
80 | else meInfo.Lines.Add('Denied "Users.List"');
81 | end;
82 |
83 | procedure TMainForm.btnFuncMultClick(Sender: TObject);
84 | begin
85 | meInfo.Lines.Add(FloatToStr(RestFunc.Mult(StrToFloat(edVal1.Text),StrToFloat(edVal2.Text))));
86 | end;
87 |
88 | procedure TMainForm.btnFuncRandomClick(Sender: TObject);
89 | begin
90 | meInfo.Lines.Add(IntToStr(RestFunc.RandomNumber));
91 | end;
92 |
93 | procedure TMainForm.btnFuncSumClick(Sender: TObject);
94 | begin
95 | meInfo.Lines.Add(FloatToStr(RestFunc.Sum(StrToFloat(edVal1.Text),StrToFloat(edVal2.Text))));
96 | end;
97 |
98 | procedure TMainForm.btnGetGroupsClick(Sender: TObject);
99 | begin
100 | GetGroups;
101 | end;
102 |
103 | procedure TMainForm.btnGetUsersClick(Sender: TObject);
104 | begin
105 | if RestClient.ActionAllowed('Users.List') then GetUsers
106 | else ShowMessage('Action not allowed!');
107 | end;
108 |
109 | procedure TMainForm.GetUsers;
110 | var
111 | User : TAUser;
112 | begin
113 | User := TAUser.CreateAndFillPrepare(RestClient.ORM,'',[]);
114 | try
115 | if User = nil then
116 | begin
117 | meInfo.Lines.Add('No results found!');
118 | Exit;
119 | end;
120 | while User.FillOne do
121 | begin
122 | meInfo.Lines.Add(Format('%s / %d year(s) / LastLogin: %s',[User.Name,User.Age,DateTimeToStr(User.Login.LastLogin)]));
123 | end;
124 | finally
125 | User.Free;
126 | end;
127 | end;
128 |
129 | procedure TMainForm.GetGroups;
130 | var
131 | Group : TAGroup;
132 | Groups : TObjectList;
133 | begin
134 | Groups := RestClient.ORM.RetrieveList;
135 | if (Groups <> nil) and (Groups.Count > 0) then
136 | begin
137 | try
138 | for Group in Groups do
139 | begin
140 | meInfo.Lines.Add(Format('%s / Allowed: %s',[Group.Name,Group.AllowNewUsers.ToString]));
141 | end;
142 | finally
143 | Groups.Free;
144 | end
145 | end
146 | else
147 | begin
148 | meInfo.Lines.Add('No results found!');
149 | Exit;
150 | end;
151 | end;
152 |
153 |
154 | procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
155 | begin
156 | RestFunc := nil;
157 | RestClient.Free;
158 | end;
159 |
160 | procedure TMainForm.FormCreate(Sender: TObject);
161 | begin
162 | RestClient := TORMRestClient.Create;
163 | RestClient.Host := '127.0.0.1';
164 | RestClient.Port := 8099;
165 | RestClient.DataBase.IncludedClasses := [TAUser,TAGroup];
166 | RestClient.Login.UserName := 'Admin';
167 | RestClient.Login.UserPass := 'exilon';
168 | RestClient.HTTPOptions.Protocol := TSrvProtocol.spWebSocketBidir_Binary;
169 | RestClient.HTTPOptions.AuthMode := TAuthMode.amDefault;
170 | RestClient.Service.MethodInterface := IServiceMethods;
171 | RestClient.Service.InstanceImplementation := sicShared;
172 | RestClient.Service.Enabled := True;
173 | end;
174 |
175 | end.
176 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ClientMain.pas:
--------------------------------------------------------------------------------
1 | unit ClientMain;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
8 | mORMot,
9 | SynCommons,
10 | Quick.ORM.Engine,
11 | Quick.ORM.RestClient,
12 | ORMDemo.Model, //unit contains Models for Demo
13 | Vcl.StdCtrls,
14 | System.Generics.Collections,
15 | ORMDemo.Interf; //unit contains interface for rest methods
16 |
17 | type
18 | TMainForm = class(TForm)
19 | btnConnect: TButton;
20 | meInfo: TMemo;
21 | btnGetUsers: TButton;
22 | btnGetGroups: TButton;
23 | btnFuncSum: TButton;
24 | btnFuncRandom: TButton;
25 | btnFuncMult: TButton;
26 | edVal1: TEdit;
27 | edVal2: TEdit;
28 | procedure FormCreate(Sender: TObject);
29 | procedure FormClose(Sender: TObject; var Action: TCloseAction);
30 | procedure btnConnectClick(Sender: TObject);
31 | procedure btnGetUsersClick(Sender: TObject);
32 | procedure GetUsers;
33 | procedure GetGroups;
34 | procedure btnGetGroupsClick(Sender: TObject);
35 | procedure btnFuncSumClick(Sender: TObject);
36 | procedure btnFuncMultClick(Sender: TObject);
37 | procedure btnFuncRandomClick(Sender: TObject);
38 | private
39 | { Private declarations }
40 | public
41 | { Public declarations }
42 | end;
43 |
44 | var
45 | MainForm: TMainForm;
46 | RestClient : TORMRestClient;
47 | RestFunc : IServiceMethods;
48 |
49 | implementation
50 |
51 | {$R *.dfm}
52 |
53 | procedure TMainForm.btnConnectClick(Sender: TObject);
54 | var
55 | done : Boolean;
56 | begin
57 | if RestClient.HTTPOptions.AuthMode = amNoAuthentication then done := RestClient.Connect
58 | else done := RestClient.LoginPrompt(True);
59 | //done := RestClient.Connect(edHost.Text,StrToInt(edPort.Text));
60 | if done then meInfo.Lines.Add('Connected to RestServer!')
61 | else
62 | begin
63 | meInfo.Lines.Add('Can''t connect to Restserver!');
64 | Exit;
65 | end;
66 | btnGetUsers.Enabled := done;
67 | btnGetGroups.Enabled := done;
68 | btnFuncSum.Enabled := done;
69 | btnFuncMult.Enabled := done;
70 | btnFuncRandom.Enabled := done;
71 |
72 | //gets Interface-Method service
73 | if RestClient.Service.Enabled then RestClient.Service.SetRestMethod(RestFunc);
74 |
75 | //show apps actions access security
76 | if RestClient.ActionAllowed('Home.Open') then meInfo.Lines.Add('Allowed "Home.Open"')
77 | else meInfo.Lines.Add('Denied "Home.Open"');
78 |
79 | if RestClient.ActionAllowed('Users.List') then meInfo.Lines.Add('Allowed "Users.List"')
80 | else meInfo.Lines.Add('Denied "Users.List"');
81 | end;
82 |
83 | procedure TMainForm.btnFuncMultClick(Sender: TObject);
84 | begin
85 | meInfo.Lines.Add(FloatToStr(RestFunc.Mult(StrToFloat(edVal1.Text),StrToFloat(edVal2.Text))));
86 | end;
87 |
88 | procedure TMainForm.btnFuncRandomClick(Sender: TObject);
89 | begin
90 | meInfo.Lines.Add(IntToStr(RestFunc.RandomNumber));
91 | end;
92 |
93 | procedure TMainForm.btnFuncSumClick(Sender: TObject);
94 | begin
95 | meInfo.Lines.Add(FloatToStr(RestFunc.Sum(StrToFloat(edVal1.Text),StrToFloat(edVal2.Text))));
96 | end;
97 |
98 | procedure TMainForm.btnGetGroupsClick(Sender: TObject);
99 | begin
100 | GetGroups;
101 | end;
102 |
103 | procedure TMainForm.btnGetUsersClick(Sender: TObject);
104 | begin
105 | if RestClient.ActionAllowed('Users.List') then GetUsers
106 | else ShowMessage('Action not allowed!');
107 | end;
108 |
109 | procedure TMainForm.GetUsers;
110 | var
111 | User : TAUser;
112 | begin
113 | User := TAUser.CreateAndFillPrepare(RestClient.ORM,'',[]);
114 | try
115 | if User = nil then
116 | begin
117 | meInfo.Lines.Add('No results found!');
118 | Exit;
119 | end;
120 | while User.FillOne do
121 | begin
122 | meInfo.Lines.Add(Format('%s / %d year(s) / LastLogin: %s',[User.Name,User.Age,DateTimeToStr(User.Login.LastLogin)]));
123 | end;
124 | finally
125 | User.Free;
126 | end;
127 | end;
128 |
129 | procedure TMainForm.GetGroups;
130 | var
131 | Group : TAGroup;
132 | Groups : TObjectList;
133 | begin
134 | Groups := RestClient.ORM.RetrieveList;
135 | if (Groups <> nil) and (Groups.Count > 0) then
136 | begin
137 | try
138 | for Group in Groups do
139 | begin
140 | meInfo.Lines.Add(Format('%s / Allowed: %s',[Group.Name,Group.AllowNewUsers.ToString]));
141 | end;
142 | finally
143 | Groups.Free;
144 | end
145 | end
146 | else
147 | begin
148 | meInfo.Lines.Add('No results found!');
149 | Exit;
150 | end;
151 | end;
152 |
153 |
154 | procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
155 | begin
156 | RestFunc := nil;
157 | RestClient.Free;
158 | end;
159 |
160 | procedure TMainForm.FormCreate(Sender: TObject);
161 | begin
162 | RestClient := TORMRestClient.Create;
163 | RestClient.Host := '127.0.0.1';
164 | RestClient.Port := 8099;
165 | RestClient.DataBase.IncludedClasses := [TAUser,TAGroup];
166 | RestClient.Login.UserName := 'Admin';
167 | RestClient.Login.UserPass := 'exilon';
168 | RestClient.HTTPOptions.Protocol := TSrvProtocol.spWebSocketBidir_Binary;
169 | RestClient.HTTPOptions.AuthMode := TAuthMode.amDefault;
170 | RestClient.Service.MethodInterface := IServiceMethods;
171 | RestClient.Service.InstanceImplementation := sicShared;
172 | RestClient.Service.Enabled := True;
173 | end;
174 |
175 | end.
176 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ClientMain.pas:
--------------------------------------------------------------------------------
1 | unit ClientMain;
2 |
3 | interface
4 |
5 | uses
6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
8 | mORMot,
9 | SynCommons,
10 | Quick.ORM.Engine,
11 | Quick.ORM.RestClient,
12 | ORMDemo.Model, //unit contains Models for Demo
13 | Vcl.StdCtrls,
14 | System.Generics.Collections,
15 | ORMDemo.Interf; //unit contains interface for rest methods
16 |
17 | type
18 | TMainForm = class(TForm)
19 | btnConnect: TButton;
20 | meInfo: TMemo;
21 | btnGetUsers: TButton;
22 | btnGetGroups: TButton;
23 | btnFuncSum: TButton;
24 | btnFuncRandom: TButton;
25 | btnFuncMult: TButton;
26 | edVal1: TEdit;
27 | edVal2: TEdit;
28 | procedure FormCreate(Sender: TObject);
29 | procedure FormClose(Sender: TObject; var Action: TCloseAction);
30 | procedure btnConnectClick(Sender: TObject);
31 | procedure btnGetUsersClick(Sender: TObject);
32 | procedure GetUsers;
33 | procedure GetGroups;
34 | procedure btnGetGroupsClick(Sender: TObject);
35 | procedure btnFuncSumClick(Sender: TObject);
36 | procedure btnFuncMultClick(Sender: TObject);
37 | procedure btnFuncRandomClick(Sender: TObject);
38 | private
39 | { Private declarations }
40 | public
41 | { Public declarations }
42 | end;
43 |
44 | var
45 | MainForm: TMainForm;
46 | RestClient : TORMRestClient;
47 | RestFunc : IServiceMethods;
48 |
49 | implementation
50 |
51 | {$R *.dfm}
52 |
53 | procedure TMainForm.btnConnectClick(Sender: TObject);
54 | var
55 | done : Boolean;
56 | begin
57 | if RestClient.HTTPOptions.AuthMode = amNoAuthentication then done := RestClient.Connect
58 | else done := RestClient.LoginPrompt(True);
59 | //done := RestClient.Connect(edHost.Text,StrToInt(edPort.Text));
60 | if done then meInfo.Lines.Add('Connected to RestServer!')
61 | else
62 | begin
63 | meInfo.Lines.Add('Can''t connect to Restserver!');
64 | Exit;
65 | end;
66 | btnGetUsers.Enabled := done;
67 | btnGetGroups.Enabled := done;
68 | btnFuncSum.Enabled := done;
69 | btnFuncMult.Enabled := done;
70 | btnFuncRandom.Enabled := done;
71 |
72 | //gets Interface-Method service
73 | if RestClient.Service.Enabled then RestClient.Service.SetRestMethod(RestFunc);
74 |
75 | //show apps actions access security
76 | if RestClient.ActionAllowed('Home.Open') then meInfo.Lines.Add('Allowed "Home.Open"')
77 | else meInfo.Lines.Add('Denied "Home.Open"');
78 |
79 | if RestClient.ActionAllowed('Users.List') then meInfo.Lines.Add('Allowed "Users.List"')
80 | else meInfo.Lines.Add('Denied "Users.List"');
81 | end;
82 |
83 | procedure TMainForm.btnFuncMultClick(Sender: TObject);
84 | begin
85 | meInfo.Lines.Add(FloatToStr(RestFunc.Mult(StrToFloat(edVal1.Text),StrToFloat(edVal2.Text))));
86 | end;
87 |
88 | procedure TMainForm.btnFuncRandomClick(Sender: TObject);
89 | begin
90 | meInfo.Lines.Add(IntToStr(RestFunc.RandomNumber));
91 | end;
92 |
93 | procedure TMainForm.btnFuncSumClick(Sender: TObject);
94 | begin
95 | meInfo.Lines.Add(FloatToStr(RestFunc.Sum(StrToFloat(edVal1.Text),StrToFloat(edVal2.Text))));
96 | end;
97 |
98 | procedure TMainForm.btnGetGroupsClick(Sender: TObject);
99 | begin
100 | GetGroups;
101 | end;
102 |
103 | procedure TMainForm.btnGetUsersClick(Sender: TObject);
104 | begin
105 | if RestClient.ActionAllowed('Users.List') then GetUsers
106 | else ShowMessage('Action not allowed!');
107 | end;
108 |
109 | procedure TMainForm.GetUsers;
110 | var
111 | User : TAUser;
112 | begin
113 | User := TAUser.CreateAndFillPrepare(RestClient.ORM,'',[]);
114 | try
115 | if User = nil then
116 | begin
117 | meInfo.Lines.Add('No results found!');
118 | Exit;
119 | end;
120 | while User.FillOne do
121 | begin
122 | meInfo.Lines.Add(Format('%s / %d year(s) / LastLogin: %s',[User.Name,User.Age,DateTimeToStr(User.Login.LastLogin)]));
123 | end;
124 | finally
125 | User.Free;
126 | end;
127 | end;
128 |
129 | procedure TMainForm.GetGroups;
130 | var
131 | Group : TAGroup;
132 | Groups : TObjectList;
133 | begin
134 | Groups := RestClient.ORM.RetrieveList;
135 | if (Groups <> nil) and (Groups.Count > 0) then
136 | begin
137 | try
138 | for Group in Groups do
139 | begin
140 | meInfo.Lines.Add(Format('%s / Allowed: %s',[Group.Name,Group.AllowNewUsers.ToString]));
141 | end;
142 | finally
143 | Groups.Free;
144 | end
145 | end
146 | else
147 | begin
148 | meInfo.Lines.Add('No results found!');
149 | Exit;
150 | end;
151 | end;
152 |
153 |
154 | procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
155 | begin
156 | RestFunc := nil;
157 | RestClient.Free;
158 | end;
159 |
160 | procedure TMainForm.FormCreate(Sender: TObject);
161 | var
162 | listbox : TListBox;
163 | begin
164 | RestClient := TORMRestClient.Create;
165 | RestClient.Host := '127.0.0.1';
166 | RestClient.Port := 8099;
167 | RestClient.DataBase.IncludedClasses := [TAUser,TAGroup];
168 | RestClient.Login.UserName := 'Admin';
169 | RestClient.Login.UserPass := 'exilon';
170 | RestClient.HTTPOptions.Protocol := TSrvProtocol.spWebSocketBidir_Binary;
171 | RestClient.HTTPOptions.AuthMode := TAuthMode.amDefault;
172 | RestClient.Service.MethodInterface := IServiceMethods;
173 | RestClient.Service.InstanceImplementation := sicShared;
174 | RestClient.Service.Enabled := True;
175 | end;
176 |
177 | end.
178 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | **QuickORM**
3 | ----------
4 | QuickORM is a simple RestServer and Restclient based on mORMot framework. Provides a fast implementation of client-server applications in few minutes.
5 |
6 | *NEW: Custom external database compatibility (Thanks to @juanter)
7 | *NEW: Easy external DB Mapping Fields
8 | *NEW: Client with basic android compatibility.
9 | *NEW: Delphinus support
10 |
11 | ----------
12 | This framework uses next libraries:
13 |
14 | Synopse mORMot framework. Copyright (C) 2017 Arnaud Bouchez (Synopse Informatique - https://synopse.info)
15 | https://synopse/mORMot
16 |
17 | QuickLib. Copyright (C) 2016-2018 Kike Pérez
18 | https://github.com/exilon/QuickLib
19 |
20 | ## Server classes
21 | There are 3 server flavors:
22 |
23 | **TORMRestDB:** Rest ORM access to database. For single applications without client connection needs.
24 | **TORMRestDBFull:** It's a client and embeded server. Client comunicates to server that provides cache benefits. For single application without client connection needs.
25 | **TORMRestServer:** Rest ORM with http server embeded, allowing clients connections to ORM and services published.
26 | ## Client classes
27 | **TORMRestClient:** Client to connect to ORMRestServer and acces to database or published services.
28 | ## Documentation
29 | ### TORMRestServer:
30 | Connect to your SQLite, InMemory or External database providing ORM access and publish rest services with http server or websockets. Define security, ip and apikey restrictions with easy.
31 | You can provide a binding port in command line to allow reverse proxies like ARR (with httpplatform module installed) or Azure Webservices integration.
32 | - **CustomORMServerClass:** Define a inherited class to declare your http published methods.
33 | - **ConfigFile:** Defines configfile options. If enabled, a json config file will created with binding options, ip restrictions and api keys.
34 | - **Enabled:** If enabled uses config file and overrides in code options defined.
35 | - **RestartServerIfChanged:** Restarts server applying new settings if config file is modified (like web.config in IIS).
36 | - **ORMRestServer.DataBase:** Defines connection to database and options.
37 | - **DBType:** Sqlite or MSSQL (more soon)
38 | - **DBFileName:** Path to sqlite database.
39 | - **aRootURI:** First path of URL /root/ by default.
40 | - **DBIndexes:** Specifies indexes your database will create if not exists.
41 | - **FullMemoryMode:** Database creates in memory, no file needed.
42 | - **LockMode:** Normal or exclusive acces to speedup operations.
43 | - **IncludedClasses:** SQLRecord classes used in your database.
44 | - **SQLConnection:** Properties to connect to external database (host, user, password,...).
45 | - **DBMappingFiels:** Can map your internal class fields with external database fields (example: can map your SQLRecord ID with external IdCustom)
46 |
47 | - **ORMRestServer.HTTPOptions:** HTTP Server configuration.
48 | - **Binding:** Defines listen ip and port for http server.
49 | - **Protocol:** Defines protocol as HTTPSocket, Websockets or HTTP.Sys
50 | - **AuthMode:** HTTP Authentification mode.
51 | - **IPRestriction:** Defines restricted ip and exclusions.
52 |
53 | - **ORMRestServer.Service:** Services configuration.
54 | - **ServiceInterface:** Interface with contract definition for your services.
55 | - **MethodClass:** Class with implementation of services.
56 | - **Enabled**: Defines if services are published through your http server.
57 |
58 |
59 | - **ORMRestServer.Security:** Security related options, user, groups and tables permissions.
60 | - **DefaultAdminPassword:** Defines default password when database is first created.
61 | - **ServiceAuthorizationPolicy:** Defines if all your services are accesible to all users or not.
62 | - **PublicServices:** Defines which services interface-based are public (No authentification needed).
63 | - **PublicMethods:** Defines which methods are public (No authentification needed).
64 | - **Users:** Create, modify and remove users, passwords and group membership.
65 | - **Groups:** Create, modify and remove groups. Manage services and tables permissions. All permissions are stored on database.
66 |
67 | ## Examples
68 | ```delphi
69 |
70 | //Create a new user and group and allow services access
71 | RestServer.Security.Groups.Add('Operators').CopySecurityFrom('User').GlobalSecurity.AllowServices := spAllow;
72 | RestServer.Security.Users.Add('mike','5555').Group('Supervisor');
73 | //Change user "mike" password
74 | RestServer.Security.Users['mike'].Password := '1234';
75 |
76 | //Allow Guest group access to "Sum" service only
77 | RestServer.Security.Groups['Guest'].GlobalSecurity.AllowAllServices := spDeny;
78 | RestServer.Security.Groups['Guest'].Service('Sum').Allow;
79 |
80 | //Deny Operators group access to table "Reports"
81 | RestServer.Security.Groups['Operators'].Table('Reports').DenyAll;
82 |
83 | //Gives readonly permissions to Operators group
84 | RestServer.Security.Groups['Operators'].Table('Reports').ReadOnly
85 |
86 | //Allow "Operators" group Read and Create access to table "Reports"
87 | with RestServer.Security.Groups['Operators'].Table('Reports') do
88 | begin
89 | CanRead := True;
90 | CanCreate := True;
91 | CanUpdate := False;
92 | CanDelete := False;
93 | end;
94 |
95 | //Create a unique index
96 | RestServer.DBIndexes.Add(TMyClass,'FieldName',True);
97 |
98 | //Create a multiindex
99 | ORMRestServer.DBIndexes.Add(TMyClass,['FieldName1','FieldName2']);
100 |
101 | //Define public methods
102 | RestServer.Security.PublicMethods := ['Method1','Method2'];
103 |
104 | //Mapping fields
105 | RestServer.Database.DBMappingFiels.Map(TMySQLRecord,'ID','IDCustom');
106 | ```
107 |
108 | >Do you want to learn delphi or improve your skills? [learndelphi.org](https://learndelphi.org)
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/delphi/ORMRestServer.dpr:
--------------------------------------------------------------------------------
1 | program ORMRestServer;
2 |
3 | {$APPTYPE CONSOLE}
4 |
5 | {$INCLUDE synopse.inc}
6 | {$R *.res}
7 |
8 | uses
9 |
10 | System.SysUtils,
11 | System.DateUtils,
12 | mORMot,
13 | SynCommons,
14 | Quick.Commons,
15 | Quick.Log,
16 | Quick.Console,
17 | Quick.ORM.Engine,
18 | Quick.ORM.RestServer,
19 | Quick.ORM.Security,
20 | Quick.ORM.DataBase,
21 | ORMDemo.Model,
22 | ORMDemo.RestMethods,
23 | ORMDemo.Interf,
24 | ORMDemo.CustomServer;
25 |
26 | //contains interface for rest service
27 |
28 | var
29 | RestServer : TORMRestServer;
30 | i : Integer;
31 | User : TAUser;
32 | Group : TAGroup;
33 | Login : TLogin;
34 | randomname : string;
35 |
36 | begin
37 | try
38 | Log := TQuickLog.Create;
39 | Log.SetLog('.\ServerHTTPSocket.log',False,20);
40 | Log.ShowEventType := True;
41 | Log.ShowHeaderInfo := True;
42 | Console.LogVerbose := LOG_DEBUG;
43 | Console.Log := Log;
44 | RestServer := TORMRestServer.Create(False);
45 | RestServer.CustomORMServerClass := TORMServer;
46 | RestServer.DataBase.DBType := dtSQLite;
47 | RestServer.DataBase.DBFileName := '.\ORMTest.db3';
48 | RestServer.DataBase.IncludedClasses := [TAUser,TAGroup];
49 | RestServer.HTTPOptions.Binding.IP := '127.0.0.1';
50 | RestServer.HTTPOptions.Binding.Port := 8099;
51 | RestServer.HTTPOptions.Protocol := TSrvProtocol.spWebSocketBidir_Binary;
52 | RestServer.HTTPOptions.AuthMode := TAuthMode.amDefault;
53 | RestServer.ServerLog := LOG_ONLYERRORS;
54 | RestServer.HTTPOptions.IPRestriction.DefaultSecurityRule := TSecurityAccess.saAllowed;
55 | //RestServer.HTTPOptions.IPRestriction.ExcludedIPFromDefaultRule.Add('127.0.0.1');
56 | RestServer.Service.MethodClass := TServiceMethods;
57 | RestServer.Service.MethodInterface := IServiceMethods;
58 | RestServer.Service.InstanceImplementation := sicShared;
59 | RestServer.Service.Enabled := True;
60 | RestServer.Security.DefaultAdminPassword := 'exilon';
61 | RestServer.Security.ServiceAuthorizationPolicy := TServiceAuthorizationPolicy.saDenyAll;
62 | RestServer.Security.PublicMethods := ['Test','AppActions']; //method-based public allowed
63 | RestServer.Security.PublicServices := True; //interface-based public allowed
64 | RestServer.ConfigFile.Enabled := True; //config file overwrites in-code config
65 | RestServer.Connect;
66 | coutFmt('DB service listening on port %d',[RestServer.HTTPOptions.Binding.Port],etInfo);
67 | RestServer.Security.Users.Add('pepe','1234').DisplayName := 'Pepelu';
68 | RestServer.Security.Users.Add('joan','5555').Group('Supervisor');
69 | RestServer.Security.Users.Add('restricted').Password('1234').Group('Guest');
70 | RestServer.Security.Users.Add('other').Password('1234').Group('Operator');
71 | RestServer.Security.Groups.Add('Admin2').CopySecurityFrom('User').GlobalSecurity.AllowServices := spAllow;
72 | RestServer.Security.Groups.Add('Operator').CopySecurityFrom('User');
73 | RestServer.Security.Users['pepe'].Group('Admin');
74 | RestServer.Security.Groups['Admin'].GlobalSecurity.AllowAllServices := spAllow;
75 | RestServer.Security.Groups['Supervisor'].AllowedServices := ['Sum','Mult'];
76 | RestServer.Security.Groups['Supervisor'].GlobalSecurity.AllowAllTables := spDeny;
77 | RestServer.Security.Groups['Supervisor'].Table('AUser').AllowAll;
78 | RestServer.Security.Groups['Admin'].Service('RandomNumber').Deny;
79 | RestServer.Security.Groups['Operator'].Service('Sum').Allow;
80 | RestServer.Security.Groups['Guest'].GlobalSecurity.AllowServices := spAllow;
81 | RestServer.Security.Groups['Guest'].Service('Sum').Allow;
82 | RestServer.Security.Groups['Operator'].Table('AUser').DenyAll;
83 | RestServer.Security.Groups['Operator'].Table('AGroup').AllowAll.CanDelete := False;
84 | RestServer.Security.Groups['Guest'].Table('AUser').DenyAll;
85 | with RestServer.Security.Groups['Guest'].Table('AGroup') do
86 | begin
87 | CanRead := True;
88 | CanCreate := True;
89 | CanUpdate := False;
90 | CanDelete := False;
91 | end;
92 | RestServer.Security.Groups['User'].Table('AGroup').ReadOnly;
93 |
94 | RestServer.Security.Groups['Admin'].AppAction('Home.Open').Allow;
95 | RestServer.Security.Groups['Admin'].AppAction('Users.List').Allow;
96 |
97 | RestServer.Security.Groups['Operator'].AppAction('Home.Open').Allow;
98 | RestServer.Security.Groups['Operator'].AppAction('Users.List').Deny;
99 |
100 | RestServer.Security.ApplySecurity;
101 |
102 | //access from browser
103 | //http://127.0.0.1:8099/root/ServiceMethods.Sum?[2,2]
104 |
105 | //creates 10 dummy users
106 | for i := 1 to 10 do
107 | begin
108 | User := TAUser.Create;
109 | try
110 | randomname := IntToStr(Random(10000));
111 | User.Name := 'User' + randomname;
112 | User.Surname := 'Surname' + randomname;
113 | User.Age := Random(50)+20;
114 | User.Login.Username := 'user' + randomname;
115 | User.Login.UserPass := TSQLAuthUser.ComputeHashedPassword(IntToStr(Random(9999)+1000));
116 | User.Login.LastLogin := IncDay(Now,Random(60)*-1);
117 | RestServer.ORM.AddOrUpdate(User);
118 | finally
119 | User.Free;
120 | end;
121 | end;
122 | for i := 1 to 10 do
123 | begin
124 | Group := TAGroup.Create;
125 | try
126 | Group.Name := 'Group' + IntToStr(Random(10000));
127 | Group.AllowNewUsers := Boolean(Random(1));
128 | RestServer.ORM.AddOrUpdate(Group);
129 | finally
130 | Group.Free;
131 | end;
132 | end;
133 | ConsoleWaitForEnterKey;
134 | RestServer.Free;
135 | except
136 | on E: Exception do
137 | Writeln(E.ClassName, ': ', E.Message);
138 | end;
139 | end.
140 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ORMRestServer.pas:
--------------------------------------------------------------------------------
1 | program ORMRestServer;
2 |
3 | {$mode delphi}
4 |
5 | {$INCLUDE synopse.inc}
6 |
7 | uses
8 | SysUtils,
9 | DateUtils,
10 | SynCommons,
11 | Quick.Commons,
12 | Quick.Log,
13 | Quick.Console,
14 | Quick.ORM.Engine,
15 | Quick.ORM.RestServer,
16 | Quick.ORM.Security,
17 | Quick.ORM.DataBase,
18 | ORMDemo.Model,
19 | ORMDemo.RestMethods,
20 | ORMDemo.Interf,
21 | mORMot,
22 | ORMDemo.CustomServer;
23 |
24 | //contains interface for rest service
25 |
26 | var
27 | RestServer : TORMRestServer;
28 | i : Integer;
29 | User : TAUser;
30 | Group : TAGroup;
31 | Login : TLogin;
32 | randomname : string;
33 |
34 | begin
35 | try
36 | Log := TQuickLog.Create;
37 | Log.SetLog('.\ServerHTTPSocket.log',False,20);
38 | Log.ShowEventType := True;
39 | Log.ShowHeaderInfo := True;
40 | Console.LogVerbose := LOG_DEBUG;
41 | Console.Log := Log;
42 | RestServer := TORMRestServer.Create(False);
43 | RestServer.CustomORMServerClass := TORMServer;
44 | RestServer.DataBase.DBType := dtSQLite;
45 | RestServer.DataBase.DBFileName := '.\ORMTest.db3';
46 | RestServer.DataBase.IncludedClasses := [TAUser,TAGroup];
47 | RestServer.HTTPOptions.Binding.IP := '127.0.0.1';
48 | RestServer.HTTPOptions.Binding.Port := 8099;
49 | RestServer.HTTPOptions.Protocol := TSrvProtocol.spWebSocketBidir_Binary;
50 | RestServer.HTTPOptions.AuthMode := TAuthMode.amDefault;
51 | RestServer.ServerLog := LOG_ONLYERRORS;
52 | RestServer.HTTPOptions.IPRestriction.DefaultSecurityRule := TSecurityAccess.saAllowed;
53 | RestServer.HTTPOptions.IPRestriction.ExcludedIPFromDefaultRule.Add('127.0.0.1');
54 | RestServer.Service.MethodClass := TServiceMethods;
55 | RestServer.Service.MethodInterface := IServiceMethods;
56 | RestServer.Service.InstanceImplementation := TServiceInstanceImplementation.sicShared;
57 | RestServer.Service.Enabled := True;
58 | RestServer.Security.DefaultAdminPassword := 'exilon';
59 | RestServer.Security.ServiceAuthorizationPolicy := TServiceAuthorizationPolicy.saDenyAll;
60 | RestServer.Security.PublicMethods := ['Test','AppActions']; //method-based public allowed
61 | RestServer.Security.PublicServices := True; //interface-based public allowed
62 | RestServer.ConfigFile.Enabled := True; //config file overwrites in-code config
63 | RestServer.Connect;
64 | coutFmt('DB service listening on port %d',[RestServer.HTTPOptions.Binding.Port],etInfo);
65 | RestServer.Security.Users.Add('pepe','1234').DisplayName := 'Pepelu';
66 | RestServer.Security.Users.Add('joan','5555').Group('Supervisor');
67 | RestServer.Security.Users.Add('restricted').Password('1234').Group('Guest');
68 | RestServer.Security.Users.Add('other').Password('1234').Group('Operator');
69 | RestServer.Security.Groups.Add('Admin2').CopySecurityFrom('User').GlobalSecurity.AllowServices := spAllow;
70 | RestServer.Security.Groups.Add('Operator').CopySecurityFrom('User');
71 | RestServer.Security.Users['pepe'].Group('Admin');
72 | RestServer.Security.Groups['Admin'].GlobalSecurity.AllowAllServices := spAllow;
73 | RestServer.Security.Groups['Supervisor'].AllowedServices := ['Sum','Mult'];
74 | RestServer.Security.Groups['Supervisor'].GlobalSecurity.AllowAllTables := spDeny;
75 | RestServer.Security.Groups['Supervisor'].Table('AUser').AllowAll;
76 | RestServer.Security.Groups['Admin'].Service('RandomNumber').Deny;
77 | RestServer.Security.Groups['Operator'].Service('Sum').Allow;
78 | RestServer.Security.Groups['Guest'].GlobalSecurity.AllowServices := spAllow;
79 | RestServer.Security.Groups['Guest'].Service('Sum').Allow;
80 | RestServer.Security.Groups['Operator'].Table('AUser').DenyAll;
81 | RestServer.Security.Groups['Operator'].Table('AGroup').AllowAll.CanDelete := False;
82 | RestServer.Security.Groups['Guest'].Table('AUser').DenyAll;
83 | with RestServer.Security.Groups['Guest'].Table('AGroup') do
84 | begin
85 | CanRead := True;
86 | CanCreate := True;
87 | CanUpdate := False;
88 | CanDelete := False;
89 | end;
90 | RestServer.Security.Groups['User'].Table('AGroup').ReadOnly;
91 |
92 | RestServer.Security.Groups['Admin'].AppAction('Home.Open').Allow;
93 | RestServer.Security.Groups['Admin'].AppAction('Users.List').Allow;
94 |
95 | RestServer.Security.Groups['Operator'].AppAction('Home.Open').Allow;
96 | RestServer.Security.Groups['Operator'].AppAction('Users.List').Deny;
97 |
98 | RestServer.Security.ApplySecurity;
99 |
100 | //access from browser
101 | //http://127.0.0.1:8099/root/ServiceMethods.Sum?[2,2]
102 |
103 | //creates 10 dummy users
104 | for i := 1 to 10 do
105 | begin
106 | User := TAUser.Create;
107 | try
108 | randomname := IntToStr(Random(10000));
109 | User.Name := 'User' + randomname;
110 | User.Surname := 'Surname' + randomname;
111 | User.Age := Random(50)+20;
112 | Login.Username := 'user' + randomname;
113 | Login.UserPass := TSQLAuthUser.ComputeHashedPassword(IntToStr(Random(9999)+1000));
114 | Login.LastLogin := IncDay(Now,Random(60)*-1);
115 | User.Login := Login;
116 | RestServer.ORM.AddOrUpdate(User);
117 | finally
118 | User.Free;
119 | end;
120 | end;
121 | for i := 1 to 10 do
122 | begin
123 | Group := TAGroup.Create;
124 | try
125 | Group.Name := 'Group' + IntToStr(Random(10000));
126 | Group.AllowNewUsers := Boolean(Random(1));
127 | RestServer.ORM.AddOrUpdate(Group);
128 | finally
129 | Group.Free;
130 | end;
131 | end;
132 | ConsoleWaitForEnterKey;
133 | RestServer.Free;
134 | except
135 | on E: Exception do
136 | Writeln(E.ClassName, ': ', E.Message);
137 | end;
138 | end.
139 |
--------------------------------------------------------------------------------
/Quick.ORM.RestDB.pas:
--------------------------------------------------------------------------------
1 | { ***************************************************************************
2 |
3 | Copyright (c) 2016-2019 Kike Pérez
4 |
5 | Unit : Quick.ORM.RestDB
6 | Description : Rest ORM access SQLite db only
7 | Author : Kike Pérez
8 | Version : 1.6
9 | Created : 02/06/2017
10 | Modified : 08/05/2019
11 |
12 | This file is part of QuickORM: https://github.com/exilon/QuickORM
13 |
14 | Uses Synopse mORMot framework. Copyright (C) 2017 Arnaud Bouchez
15 | Synopse Informatique - https://synopse.info
16 |
17 | ***************************************************************************
18 |
19 | Licensed under the Apache License, Version 2.0 (the "License");
20 | you may not use this file except in compliance with the License.
21 | You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software
26 | distributed under the License is distributed on an "AS IS" BASIS,
27 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 | See the License for the specific language governing permissions and
29 | limitations under the License.
30 |
31 | *************************************************************************** }
32 |
33 | unit Quick.ORM.RestDB;
34 |
35 | {$i QuickORM.inc}
36 | {$INCLUDE synopse.inc}
37 |
38 | interface
39 |
40 | uses
41 | Classes,
42 | SysUtils,
43 | {$IFDEF NEXTGEN}
44 | Not compatible with firemonkey android/ios
45 | {$ENDIF}
46 | SynCommons,
47 | SynDBODBC,
48 | mORMot,
49 | mORMotDB,
50 | mORMotSQLite3,
51 | SynSQLite3,
52 | SynSQLite3Static,
53 | Quick.ORM.Engine,
54 | Quick.ORM.DataBase,
55 | Quick.ORM.Security,
56 | Quick.ORM.Server.Config;
57 |
58 | type
59 |
60 | TIDDynArray = mORMot.TIDDynArray;
61 |
62 | //Client with direct SQLite DB access
63 | TORMRestDB = class
64 | private
65 | fDataBase : TORMDataBase;
66 | fSecurity : TORMSecurity;
67 | fConfigFile : TORMRestDBConfig;
68 | fUseConfigFile : Boolean;
69 | public
70 | ORM : TSQLRestClientDB;
71 | property DataBase : TORMDataBase read fDataBase write fDataBase;
72 | property Security : TORMSecurity read fSecurity write fSecurity;
73 | constructor Create;
74 | destructor Destroy; override;
75 | function Connect : Boolean; overload;
76 | function Connect(DoCustomDB : TProc) : Boolean; overload;
77 | end;
78 |
79 |
80 | implementation
81 |
82 | {TORMRestDB Class}
83 |
84 | constructor TORMRestDB.Create;
85 | begin
86 | inherited;
87 | fDataBase := TORMDataBase.Create;
88 | fSecurity := TORMSecurity.Create;
89 | end;
90 |
91 | destructor TORMRestDB.Destroy;
92 | begin
93 | if Assigned(ORM) then ORM.Free;
94 | if Assigned(fDataBase) then fDataBase.Free;
95 | if Assigned(fSecurity) then fSecurity.Free;
96 | inherited;
97 | end;
98 |
99 | function TORMRestDB.Connect : Boolean;
100 | begin
101 | Result := Connect(nil);
102 | end;
103 |
104 | function TORMRestDB.Connect(DoCustomDB : TProc) : Boolean;
105 | var
106 | DBIndex : TDBIndex;
107 | begin
108 | Result := False;
109 |
110 | if Assigned(fDataBase.Model) then fDataBase.Model.Free;
111 | fDataBase.Model := TSQLModel.Create(fDataBase.IncludedClasses, fDataBase.aRootURI);
112 | if fDataBase.FullMemoryMode then
113 | begin
114 | ORM := TSQLRestClientDB.Create(fDataBase.Model,nil,SQLITE_MEMORY_DATABASE_NAME,TSQLRestServerDB,fSecurity.Enabled,'');
115 | end
116 | else
117 | begin
118 | if not Assigned(DoCustomDb) then
119 | begin
120 | case fDataBase.DBType of
121 | dtSQLite : ORM := TSQLRestClientDB.Create(fDataBase.Model, nil, fDataBase.DBFileName, TSQLRestServerDB);
122 | dtMSSQL :
123 | begin {SQL Server Native Client 10.0} {Microsoft OLE DB Provider for SQL Server}
124 | //fDataBase.Model := TSQLModel.Create(fDataBase.IncludedClasses);
125 | fDataBase.SQLProperties := //TOleDBMSSQL2008ConnectionProperties.Create(fDataBase.SQLConnection.ServerName,fDataBase.SQLConnection.DataBase,fDataBase.SQLConnection.Username,fDataBase.SQLConnection.UserPass);
126 | //TODBCConnectionProperties.Create('','Driver={SQL Server Native Client 10.0} ;Database='+fDataBase.SQLConnection.DataBase+';'+
127 | // 'Server='+fDataBase.SQLConnection.ServerName+';UID='+fDataBase.SQLConnection.Username+';Pwd='+fDataBase.SQLConnection.UserPass+';MARS_Connection=yes','','');
128 | TODBCConnectionProperties.Create('',DataBase.SQLConnection.GetConnectionString,'','');
129 | VirtualTableExternalRegisterAll(fDataBase.Model,fDataBase.SQLProperties);
130 | //fDataBase.Model.VirtualTableRegister(fDataBase.IncludedClasses[0],TSQLVirtualTableBinary);
131 | ORM := TSQLRestClientDB.Create(fDataBase.Model,nil,SQLITE_MEMORY_DATABASE_NAME,TSQLRestServerDB,fSecurity.Enabled,'');
132 | end;
133 | end;
134 | end
135 | else DoCustomDB;
136 | end;
137 | //exclusive mode speeds up sqlite performance, but db can't be accessible from outside processes
138 | if fDataBase.LockMode = TSQLiteLockMode.lmExclusive then ORM.Server.DB.LockingMode := TSQLLockingMode.lmExclusive
139 | else ORM.Server.DB.LockingMode := TSQLLockingMode.lmNormal;
140 | //creates tables if not exists
141 | ORM.Server.CreateMissingTables;
142 | //create indexes
143 | for DBIndex in DataBase.DBIndexes do
144 | begin
145 | if DBIndex.FieldNames.Count > 1 then ORM.Server.CreateSQLMultiIndex(DBIndex.SQLRecordClass,DBIndex.FieldNames,DBIndex.Unique)
146 | else ORM.Server.CreateSQLIndex(DBIndex.SQLRecordClass,DBIndex.FieldNames,DBIndex.Unique);
147 | end;
148 | //assigns ORM to security class
149 | fSecurity.SetORMServer(ORM);
150 | //checks if default security needs to apply
151 | fSecurity.SetDefaultSecurity;
152 | Result := True;
153 | end;
154 |
155 | end.
156 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ServerHTTPSocket.dpr:
--------------------------------------------------------------------------------
1 | program ServerHTTPSocket;
2 |
3 | {$APPTYPE CONSOLE}
4 |
5 | {$INCLUDE synopse.inc}
6 | {$R *.res}
7 |
8 | uses
9 | System.SysUtils,
10 | System.DateUtils,
11 | mORMot,
12 | SynCommons,
13 | Quick.Commons,
14 | Quick.Log,
15 | Quick.Console,
16 | Quick.ORM.Engine,
17 | Quick.ORM.RestServer,
18 | Quick.ORM.Security,
19 | Quick.ORM.DataBase,
20 | ORMDemo.Model,
21 | ORMDemo.RestMethods,
22 | ORMDemo.Interf,
23 | ORMDemo.CustomServer;
24 |
25 | //contains interface for rest service
26 |
27 | var
28 | RestServer : TORMRestServer;
29 | i : Integer;
30 | User : TAUser;
31 | Group : TAGroup;
32 | Login : TLogin;
33 | randomname : string;
34 |
35 | begin
36 | try
37 | Log := TQuickLog.Create;
38 | Log.SetLog('.\ServerHTTPSocket.log',False,20);
39 | Log.ShowEventType := True;
40 | Log.ShowHeaderInfo := True;
41 | Console.LogVerbose := LOG_DEBUG;
42 | Console.Log := Log;
43 | RestServer := TORMRestServer.Create(False);
44 | RestServer.CustomORMServerClass := TORMServer;
45 | RestServer.DataBase.DBType := dtSQLite;
46 | RestServer.DataBase.DBFileName := '.\ORMTest.db3';
47 | RestServer.DataBase.IncludedClasses := [TAUser,TAGroup];
48 | RestServer.HTTPOptions.Binding.IP := '127.0.0.1';
49 | RestServer.HTTPOptions.Binding.Port := 8099;
50 | RestServer.HTTPOptions.Protocol := TSrvProtocol.spWebSocketBidir_Binary;
51 | RestServer.HTTPOptions.AuthMode := TAuthMode.amDefault;
52 | RestServer.ServerLog := LOG_ONLYERRORS;
53 | RestServer.HTTPOptions.IPRestriction.DefaultSecurityRule := TSecurityAccess.saAllowed;
54 | RestServer.HTTPOptions.IPRestriction.ExcludedIPFromDefaultRule.Add('127.0.0.1');
55 | RestServer.Service.MethodClass := TServiceMethods;
56 | RestServer.Service.MethodInterface := IServiceMethods;
57 | RestServer.Service.InstanceImplementation := sicShared;
58 | RestServer.Service.Enabled := True;
59 | RestServer.Security.DefaultAdminPassword := 'exilon';
60 | RestServer.Security.ServiceAuthorizationPolicy := TServiceAuthorizationPolicy.saDenyAll;
61 | RestServer.Security.PublicMethods := ['Test','AppActions']; //method-based public allowed
62 | RestServer.Security.PublicServices := True; //interface-based public allowed
63 | RestServer.ConfigFile.Enabled := True; //config file overwrites in-code config
64 | RestServer.Connect;
65 | coutFmt('DB service listening on port %d',[RestServer.HTTPOptions.Binding.Port],etInfo);
66 | RestServer.Security.Users.Add('pepe','1234').DisplayName := 'Pepelu';
67 | RestServer.Security.Users.Add('joan','5555').Group('Supervisor');
68 | RestServer.Security.Users.Add('restricted').Password('1234').Group('Guest');
69 | RestServer.Security.Users.Add('other').Password('1234').Group('Operator');
70 | RestServer.Security.Groups.Add('Admin2').CopySecurityFrom('User').GlobalSecurity.AllowServices := spAllow;
71 | RestServer.Security.Groups.Add('Operator').CopySecurityFrom('User');
72 | RestServer.Security.Users['pepe'].Group('Admin');
73 | RestServer.Security.Groups['Admin'].GlobalSecurity.AllowAllServices := spAllow;
74 | RestServer.Security.Groups['Supervisor'].AllowedServices := ['Sum','Mult'];
75 | RestServer.Security.Groups['Supervisor'].GlobalSecurity.AllowAllTables := spDeny;
76 | RestServer.Security.Groups['Supervisor'].Table('AUser').AllowAll;
77 | RestServer.Security.Groups['Admin'].Service('RandomNumber').Deny;
78 | RestServer.Security.Groups['Operator'].Service('Sum').Allow;
79 | RestServer.Security.Groups['Guest'].GlobalSecurity.AllowServices := spAllow;
80 | RestServer.Security.Groups['Guest'].Service('Sum').Allow;
81 | RestServer.Security.Groups['Operator'].Table('AUser').DenyAll;
82 | RestServer.Security.Groups['Operator'].Table('AGroup').AllowAll.CanDelete := False;
83 | RestServer.Security.Groups['Guest'].Table('AUser').DenyAll;
84 | with RestServer.Security.Groups['Guest'].Table('AGroup') do
85 | begin
86 | CanRead := True;
87 | CanCreate := True;
88 | CanUpdate := False;
89 | CanDelete := False;
90 | end;
91 | RestServer.Security.Groups['User'].Table('AGroup').ReadOnly;
92 |
93 | RestServer.Security.Groups['Admin'].AppAction('Home.Open').Allow;
94 | RestServer.Security.Groups['Admin'].AppAction('Users.List').Allow;
95 |
96 | RestServer.Security.Groups['Operator'].AppAction('Home.Open').Allow;
97 | RestServer.Security.Groups['Operator'].AppAction('Users.List').Deny;
98 |
99 | RestServer.Security.ApplySecurity;
100 |
101 | //access from browser
102 | //http://127.0.0.1:8099/root/ServiceMethods.Sum?[2,2]
103 |
104 | //creates 10 dummy users
105 | for i := 1 to 10 do
106 | begin
107 | User := TAUser.Create;
108 | try
109 | randomname := IntToStr(Random(10000));
110 | User.Name := 'User' + randomname;
111 | User.Surname := 'Surname' + randomname;
112 | User.Age := Random(50)+20;
113 | Login.Username := 'user' + randomname;
114 | Login.UserPass := TSQLAuthUser.ComputeHashedPassword(IntToStr(Random(9999)+1000));
115 | Login.LastLogin := IncDay(Now,Random(60)*-1);
116 | User.Login := Login;
117 | RestServer.ORM.AddOrUpdate(User);
118 | finally
119 | User.Free;
120 | end;
121 | end;
122 | for i := 1 to 10 do
123 | begin
124 | Group := TAGroup.Create;
125 | try
126 | Group.Name := 'Group' + IntToStr(Random(10000));
127 | Group.AllowNewUsers := Boolean(Random(1));
128 | RestServer.ORM.AddOrUpdate(Group);
129 | finally
130 | Group.Free;
131 | end;
132 | end;
133 | ConsoleWaitForEnterKey;
134 | RestServer.Free;
135 | except
136 | on E: Exception do
137 | Writeln(E.ClassName, ': ', E.Message);
138 | end;
139 | end.
140 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/fpc/ORMRestServer.lps:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/Firemonkey/android/MobileHTTPRestClient.deployproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 12
5 |
6 |
7 | 06157df6495b5a3e
8 |
9 |
10 | iPhone5
11 |
12 |
13 |
14 |
15 |
16 |
17 | MobileHTTPRestClient\
18 | MobileHTTPRestClient.exe
19 | ProjectOutput
20 | 0
21 |
22 |
23 | True
24 | True
25 |
26 |
27 |
28 |
29 | MobileHTTPRestClient.app\Contents\MacOS\
30 | libcgsqlite3.dylib
31 | DependencyModule
32 | 1
33 |
34 |
35 | True
36 |
37 |
38 | MobileHTTPRestClient.app\Contents\MacOS\
39 | libcgunwind.1.0.dylib
40 | DependencyModule
41 | 1
42 |
43 |
44 | True
45 |
46 |
47 |
48 |
49 | MobileHTTPRestClient\res\drawable-ldpi\
50 | ic_launcher.png
51 | Android_LauncherIcon36
52 | 1
53 |
54 |
55 | True
56 |
57 |
58 | MobileHTTPRestClient\
59 | AndroidManifest.xml
60 | ProjectAndroidManifest
61 | 1
62 |
63 |
64 | True
65 |
66 |
67 | MobileHTTPRestClient\res\drawable-xxhdpi\
68 | ic_launcher.png
69 | Android_LauncherIcon144
70 | 1
71 |
72 |
73 | True
74 |
75 |
76 | MobileHTTPRestClient\library\lib\armeabi\
77 | libMobileHTTPRestClient.so
78 | AndroidLibnativeArmeabiFile
79 | 1
80 |
81 |
82 | True
83 |
84 |
85 | MobileHTTPRestClient\library\lib\armeabi-v7a\
86 | libMobileHTTPRestClient.so
87 | ProjectOutput
88 | 1
89 |
90 |
91 | True
92 | True
93 |
94 |
95 | MobileHTTPRestClient\res\drawable-large\
96 | splash_image.png
97 | Android_SplashImage640
98 | 1
99 |
100 |
101 | True
102 |
103 |
104 | MobileHTTPRestClient\res\drawable-hdpi\
105 | ic_launcher.png
106 | Android_LauncherIcon72
107 | 1
108 |
109 |
110 | True
111 |
112 |
113 | MobileHTTPRestClient\res\drawable-xlarge\
114 | splash_image.png
115 | Android_SplashImage960
116 | 1
117 |
118 |
119 | True
120 |
121 |
122 | MobileHTTPRestClient\res\drawable-small\
123 | splash_image.png
124 | Android_SplashImage426
125 | 1
126 |
127 |
128 | True
129 |
130 |
131 | MobileHTTPRestClient\res\drawable-normal\
132 | splash_image.png
133 | Android_SplashImage470
134 | 1
135 |
136 |
137 | True
138 |
139 |
140 | MobileHTTPRestClient\res\drawable-xhdpi\
141 | ic_launcher.png
142 | Android_LauncherIcon96
143 | 1
144 |
145 |
146 | True
147 |
148 |
149 | MobileHTTPRestClient\classes\
150 | classes.dex
151 | AndroidClassesDexFile
152 | 1
153 |
154 |
155 | True
156 |
157 |
158 | MobileHTTPRestClient\res\drawable\
159 | splash_image_def.xml
160 | AndroidSplashImageDef
161 | 1
162 |
163 |
164 | True
165 |
166 |
167 | MobileHTTPRestClient\res\values\
168 | styles.xml
169 | AndroidSplashStyles
170 | 1
171 |
172 |
173 | True
174 |
175 |
176 | MobileHTTPRestClient\res\drawable-mdpi\
177 | ic_launcher.png
178 | Android_LauncherIcon48
179 | 1
180 |
181 |
182 | True
183 |
184 |
185 | MobileHTTPRestClient\library\lib\mips\
186 | libMobileHTTPRestClient.so
187 | AndroidLibnativeMipsFile
188 | 1
189 |
190 |
191 | True
192 |
193 |
194 | MobileHTTPRestClient\classes\
195 | classes.dex
196 | AndroidClassesDexFile
197 | 1
198 |
199 |
200 | True
201 |
202 |
203 | MobileHTTPRestClient\library\lib\armeabi-v7a\
204 | gdbserver
205 | AndroidGDBServer
206 | 1
207 |
208 |
209 | True
210 |
211 |
212 |
213 |
214 | MobileHTTPRestClient.app\
215 | libcgunwind.1.0.dylib
216 | DependencyModule
217 | 1
218 |
219 |
220 | True
221 |
222 |
223 | MobileHTTPRestClient.app\
224 | libPCRE.dylib
225 | DependencyModule
226 | 1
227 |
228 |
229 | True
230 |
231 |
232 |
233 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ClientHTTPSocket.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {4735B76F-51C2-42CD-A564-B3567CCA1D00}
4 | 18.2
5 | VCL
6 | ClientHTTPSocket.dpr
7 | True
8 | Debug
9 | Win64
10 | 3
11 | Application
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Base
29 | true
30 |
31 |
32 | true
33 | Cfg_1
34 | true
35 | true
36 |
37 |
38 | true
39 | Cfg_1
40 | true
41 | true
42 |
43 |
44 | true
45 | Base
46 | true
47 |
48 |
49 | true
50 | Cfg_2
51 | true
52 | true
53 |
54 |
55 | true
56 | Cfg_2
57 | true
58 | true
59 |
60 |
61 | ..\..\..\bin\$(Platform)\$(Config)\dcu
62 | ..\..\..\bin\$(Platform)\$(Config)
63 | false
64 | false
65 | false
66 | false
67 | false
68 | RESTComponents;FireDACIBDriver;FireDACCommon;RESTBackendComponents;soapserver;CloudService;FireDACCommonDriver;inet;FireDAC;FireDACSqliteDriver;soaprtl;soapmidas;$(DCC_UsePackage)
69 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)
70 | $(BDS)\bin\delphi_PROJECTICON.ico
71 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png
72 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png
73 | ClientHTTPSocket
74 | ..\..\..\bin\$(Platform)\$(Config)
75 | ..\..\..\bin\$(Platform)\$(Config);$(DCC_FrameworkPath)
76 | 3082
77 | ..\..\common;$(DCC_UnitSearchPath)
78 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
79 |
80 |
81 | DBXSqliteDriver;UbuntuProgressPackage;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;svnui;JvGlobus;FireDACADSDriver;JvPluginSystem;JvMM;tmsxlsdXE11;vcltouch;JvBands;vcldb;bindcompfmx;svn;Intraweb;JvJans;JvNet;inetdb;JvAppFrm;EssentialsDR;vcwdedXE11;vcwdXE11;FmxTeeUI;JvDotNetCtrls;AbbreviaVCLD;fmx;fmxdae;tmsdXE11;vclib;JvWizards;tmsexdXE11;dbexpress;IndyCore;vclx;JvPageComps;dsnap;JvDB;VCLRESTComponents;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;JvCmp;FireDACMySQLDriver;JvHMI;FireDACCommonODBC;LockBoxDR;bindcompdbx;IndyIPCommon;JvCustom;advchartdedxe11;vcl;IndyIPServer;GR32_D;JvXPCtrls;PngComponents;IndySystem;advchartdxe11;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;TeeDB;Jcl;JvCore;JvCrypt;FireDACPgDriver;ibmonitor;FMXTee;SevenZippro;DbxCommonDriver;JvDlgs;JvRuntimeDesign;ibxpress;Tee;JvManagedThreads;xmlrtl;ibxbindings;fmxobj;vclwinx;JvTimeFramework;rtl;GR32_R;DbxClientDriver;CustomIPTransport;vcldsnap;JvSystem;JvStdCtrls;bindcomp;appanalytics;CoolTrayIcon_D210_XE7;tmswizdXE11;IndyIPClient;bindcompvcl;TeeUI;TMSFMXPackPkgDXE11;JvDocking;dbxcds;VclSmp;JvPascalInterpreter;adortl;JclVcl;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;JvControls;JvPrintPreview;Analog_XE7;JclContainers;fmxase;$(DCC_UsePackage)
82 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
83 | Debug
84 | true
85 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
86 | 1033
87 | $(BDS)\bin\default_app.manifest
88 |
89 |
90 | $(BDS)\bin\default_app.manifest
91 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)
92 | 1033
93 | true
94 | Debug
95 | DBXSqliteDriver;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;FireDACADSDriver;vcltouch;vcldb;bindcompfmx;Intraweb;inetdb;EssentialsDR;vcwdXE11;FmxTeeUI;AbbreviaVCLD;fmx;fmxdae;tmsdXE11;vclib;tmsexdXE11;dbexpress;IndyCore;vclx;dsnap;VCLRESTComponents;vclie;bindengine;DBXMySQLDriver;FireDACMySQLDriver;FireDACCommonODBC;bindcompdbx;IndyIPCommon;vcl;IndyIPServer;IndySystem;advchartdxe11;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;TeeDB;FireDACPgDriver;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;Tee;xmlrtl;ibxbindings;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;fmxase;$(DCC_UsePackage)
96 |
97 |
98 | DEBUG;$(DCC_Define)
99 | true
100 | false
101 | true
102 | true
103 | true
104 |
105 |
106 | false
107 | true
108 | true
109 | true
110 | 1033
111 |
112 |
113 | true
114 | true
115 |
116 |
117 | false
118 | RELEASE;$(DCC_Define)
119 | 0
120 | 0
121 |
122 |
123 | true
124 | true
125 |
126 |
127 | true
128 | true
129 |
130 |
131 |
132 | MainSource
133 |
134 |
135 |
136 | dfm
137 |
138 |
139 |
140 | dfm
141 |
142 |
143 |
144 |
145 | Cfg_2
146 | Base
147 |
148 |
149 | Base
150 |
151 |
152 | Cfg_1
153 | Base
154 |
155 |
156 |
157 | Delphi.Personality.12
158 | Application
159 |
160 |
161 |
162 | ClientHTTPSocket.dpr
163 |
164 |
165 | Embarcadero C++Builder Office 2000 Servers Package
166 | Embarcadero C++Builder Office XP Servers Package
167 | Microsoft Office 2000 Sample Automation Server Wrapper Components
168 | Microsoft Office XP Sample Automation Server Wrapper Components
169 |
170 |
171 |
172 |
173 |
174 | ClientHTTPSocket.exe
175 | true
176 |
177 |
178 |
179 |
180 | ClientHTTPSocket.exe
181 | true
182 |
183 |
184 |
185 |
186 | ClientHTTPSocket.rsm
187 | true
188 |
189 |
190 |
191 |
192 | 1
193 |
194 |
195 | Contents\MacOS
196 | 1
197 |
198 |
199 | Contents\MacOS
200 | 0
201 |
202 |
203 |
204 |
205 | classes
206 | 1
207 |
208 |
209 |
210 |
211 | library\lib\armeabi-v7a
212 | 1
213 |
214 |
215 |
216 |
217 | library\lib\armeabi
218 | 1
219 |
220 |
221 |
222 |
223 | library\lib\mips
224 | 1
225 |
226 |
227 |
228 |
229 | library\lib\armeabi-v7a
230 | 1
231 |
232 |
233 |
234 |
235 | res\drawable
236 | 1
237 |
238 |
239 |
240 |
241 | res\values
242 | 1
243 |
244 |
245 |
246 |
247 | res\drawable
248 | 1
249 |
250 |
251 |
252 |
253 | res\drawable-xxhdpi
254 | 1
255 |
256 |
257 |
258 |
259 | res\drawable-ldpi
260 | 1
261 |
262 |
263 |
264 |
265 | res\drawable-mdpi
266 | 1
267 |
268 |
269 |
270 |
271 | res\drawable-hdpi
272 | 1
273 |
274 |
275 |
276 |
277 | res\drawable-xhdpi
278 | 1
279 |
280 |
281 |
282 |
283 | res\drawable-small
284 | 1
285 |
286 |
287 |
288 |
289 | res\drawable-normal
290 | 1
291 |
292 |
293 |
294 |
295 | res\drawable-large
296 | 1
297 |
298 |
299 |
300 |
301 | res\drawable-xlarge
302 | 1
303 |
304 |
305 |
306 |
307 | 1
308 |
309 |
310 | Contents\MacOS
311 | 1
312 |
313 |
314 | 0
315 |
316 |
317 |
318 |
319 | Contents\MacOS
320 | 1
321 | .framework
322 |
323 |
324 | 0
325 |
326 |
327 |
328 |
329 | 1
330 | .dylib
331 |
332 |
333 | 1
334 | .dylib
335 |
336 |
337 | 1
338 | .dylib
339 |
340 |
341 | Contents\MacOS
342 | 1
343 | .dylib
344 |
345 |
346 | 0
347 | .dll;.bpl
348 |
349 |
350 |
351 |
352 | 1
353 | .dylib
354 |
355 |
356 | 1
357 | .dylib
358 |
359 |
360 | 1
361 | .dylib
362 |
363 |
364 | Contents\MacOS
365 | 1
366 | .dylib
367 |
368 |
369 | 0
370 | .bpl
371 |
372 |
373 |
374 |
375 | 0
376 |
377 |
378 | 0
379 |
380 |
381 | 0
382 |
383 |
384 | 0
385 |
386 |
387 | Contents\Resources\StartUp\
388 | 0
389 |
390 |
391 | 0
392 |
393 |
394 |
395 |
396 | 1
397 |
398 |
399 | 1
400 |
401 |
402 | 1
403 |
404 |
405 |
406 |
407 | 1
408 |
409 |
410 | 1
411 |
412 |
413 | 1
414 |
415 |
416 |
417 |
418 | 1
419 |
420 |
421 | 1
422 |
423 |
424 | 1
425 |
426 |
427 |
428 |
429 | 1
430 |
431 |
432 | 1
433 |
434 |
435 | 1
436 |
437 |
438 |
439 |
440 | 1
441 |
442 |
443 | 1
444 |
445 |
446 | 1
447 |
448 |
449 |
450 |
451 | 1
452 |
453 |
454 | 1
455 |
456 |
457 | 1
458 |
459 |
460 |
461 |
462 | 1
463 |
464 |
465 | 1
466 |
467 |
468 | 1
469 |
470 |
471 |
472 |
473 | 1
474 |
475 |
476 |
477 |
478 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
479 | 1
480 |
481 |
482 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
483 | 1
484 |
485 |
486 |
487 |
488 | 1
489 |
490 |
491 | 1
492 |
493 |
494 |
495 |
496 | ..\
497 | 1
498 |
499 |
500 | ..\
501 | 1
502 |
503 |
504 |
505 |
506 | 1
507 |
508 |
509 | 1
510 |
511 |
512 | 1
513 |
514 |
515 |
516 |
517 | 1
518 |
519 |
520 | 1
521 |
522 |
523 | 1
524 |
525 |
526 |
527 |
528 | ..\
529 | 1
530 |
531 |
532 |
533 |
534 | Contents
535 | 1
536 |
537 |
538 |
539 |
540 | Contents\Resources
541 | 1
542 |
543 |
544 |
545 |
546 | library\lib\armeabi-v7a
547 | 1
548 |
549 |
550 | 1
551 |
552 |
553 | 1
554 |
555 |
556 | 1
557 |
558 |
559 | 1
560 |
561 |
562 | Contents\MacOS
563 | 1
564 |
565 |
566 | 0
567 |
568 |
569 |
570 |
571 | 1
572 |
573 |
574 | 1
575 |
576 |
577 |
578 |
579 | Assets
580 | 1
581 |
582 |
583 | Assets
584 | 1
585 |
586 |
587 |
588 |
589 | Assets
590 | 1
591 |
592 |
593 | Assets
594 | 1
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 | True
608 | True
609 |
610 |
611 | 12
612 |
613 |
614 |
615 |
616 |
617 |
--------------------------------------------------------------------------------
/samples/ORMUF8HelperTest/QuickUTF8Helper_Test.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {61E4438A-3B7B-456A-8A96-5EF48AA3B7B2}
4 | 18.2
5 | None
6 | QuickUTF8Helper_Test.dpr
7 | True
8 | Debug
9 | Win32
10 | 1
11 | Console
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Base
29 | true
30 |
31 |
32 | true
33 | Base
34 | true
35 |
36 |
37 | true
38 | Base
39 | true
40 |
41 |
42 | true
43 | Base
44 | true
45 |
46 |
47 | true
48 | Base
49 | true
50 |
51 |
52 | true
53 | Base
54 | true
55 |
56 |
57 | true
58 | Cfg_1
59 | true
60 | true
61 |
62 |
63 | true
64 | Base
65 | true
66 |
67 |
68 | .\$(Platform)\$(Config)
69 | .\$(Platform)\$(Config)
70 | false
71 | false
72 | false
73 | false
74 | false
75 | RESTComponents;FireDACIBDriver;FireDACCommon;RESTBackendComponents;soapserver;CloudService;FireDACCommonDriver;inet;FireDAC;FireDACSqliteDriver;soaprtl;soapmidas;$(DCC_UsePackage)
76 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)
77 | QuickUTF8Helper_Test
78 |
79 |
80 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;CoolTrayIcon_D210_XE7;IndyIPClient;dbxcds;Gauge3D;dsnapxml;dbrtl;IndyProtocols;$(DCC_UsePackage)
81 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png
82 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png
83 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png
84 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png
85 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png
86 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png
87 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png
88 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png
89 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png
90 | 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
91 |
92 |
93 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage)
94 |
95 |
96 | DBXSqliteDriver;DBXInterBaseDriver;tethering;vacommpkgdXE11;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;TMSFMXPackPkgDXE11;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage)
97 |
98 |
99 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage)
100 |
101 |
102 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;inetdb;FmxTeeUI;fmx;fmxdae;dbexpress;IndyCore;dsnap;bindengine;DBXMySQLDriver;FireDACMySQLDriver;FireDACCommonODBC;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDACPgDriver;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;fmxobj;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;fmxase;$(DCC_UsePackage)
103 | true
104 |
105 |
106 | DBXSqliteDriver;UbuntuProgressPackage;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;svnui;JvGlobus;FireDACADSDriver;JvPluginSystem;JvMM;vacommpkgdXE11;tmsxlsdXE11;vcltouch;JvBands;vcldb;bindcompfmx;svn;Intraweb;JvJans;JvNet;inetdb;JvAppFrm;EssentialsDR;vcwdedXE11;vcwdXE11;FmxTeeUI;JvDotNetCtrls;AbbreviaVCLD;fmx;fmxdae;tmsdXE11;vclib;JvWizards;tmsexdXE11;dbexpress;IndyCore;vclx;JvPageComps;dsnap;JvDB;VCLRESTComponents;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;JvCmp;FireDACMySQLDriver;JvHMI;FireDACCommonODBC;LockBoxDR;bindcompdbx;IndyIPCommon;JvCustom;advchartdedxe11;vcl;IndyIPServer;GR32_D;JvXPCtrls;PngComponents;IndySystem;advchartdxe11;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;vacommpkgdedXE11;TeeDB;Jcl;madBasic_;JvCore;JvCrypt;FireDACPgDriver;ibmonitor;FMXTee;SevenZippro;DbxCommonDriver;JvDlgs;JvRuntimeDesign;ibxpress;Tee;JvManagedThreads;xmlrtl;ibxbindings;fmxobj;vclwinx;JvTimeFramework;rtl;GR32_R;DbxClientDriver;QuickVCL;CustomIPTransport;vcldsnap;JvSystem;JvStdCtrls;DCEF_DX10;bindcomp;appanalytics;tmswizdXE11;CoolTrayIcon_D210_XE7;IndyIPClient;bindcompvcl;TeeUI;TMSFMXPackPkgDXE11;JvDocking;dbxcds;VclSmp;JvPascalInterpreter;adortl;JclVcl;Gauge3D;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;JvControls;JvPrintPreview;Analog_XE7;JclContainers;fmxase;$(DCC_UsePackage)
107 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
108 | Debug
109 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
110 | 1033
111 | true
112 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png
113 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png
114 |
115 |
116 | DBXSqliteDriver;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;FireDACADSDriver;vcltouch;vcldb;bindcompfmx;Intraweb;inetdb;EssentialsDR;vcwdXE11;FmxTeeUI;AbbreviaVCLD;fmx;fmxdae;tmsdXE11;vclib;tmsexdXE11;dbexpress;IndyCore;vclx;dsnap;VCLRESTComponents;vclie;bindengine;DBXMySQLDriver;FireDACMySQLDriver;FireDACCommonODBC;bindcompdbx;IndyIPCommon;vcl;IndyIPServer;IndySystem;advchartdxe11;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;TeeDB;FireDACPgDriver;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;Tee;xmlrtl;ibxbindings;fmxobj;vclwinx;rtl;DbxClientDriver;QuickVCL;CustomIPTransport;vcldsnap;DCEF_DX10;bindcomp;appanalytics;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;fmxase;$(DCC_UsePackage)
117 | true
118 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png
119 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png
120 |
121 |
122 | DEBUG;$(DCC_Define)
123 | true
124 | false
125 | true
126 | true
127 | true
128 |
129 |
130 | false
131 |
132 |
133 | false
134 | RELEASE;$(DCC_Define)
135 | 0
136 | 0
137 |
138 |
139 |
140 | MainSource
141 |
142 |
143 | Cfg_2
144 | Base
145 |
146 |
147 | Base
148 |
149 |
150 | Cfg_1
151 | Base
152 |
153 |
154 |
155 | Delphi.Personality.12
156 | Application
157 |
158 |
159 |
160 | QuickUTF8Helper_Test.dpr
161 |
162 |
163 |
164 |
165 |
166 | true
167 |
168 |
169 |
170 |
171 | true
172 |
173 |
174 |
175 |
176 | true
177 |
178 |
179 |
180 |
181 | true
182 |
183 |
184 |
185 |
186 | QuickUTF8Helper_Test.exe
187 | true
188 |
189 |
190 |
191 |
192 | 1
193 |
194 |
195 | Contents\MacOS
196 | 1
197 |
198 |
199 | Contents\MacOS
200 | 0
201 |
202 |
203 |
204 |
205 | classes
206 | 1
207 |
208 |
209 |
210 |
211 | library\lib\armeabi-v7a
212 | 1
213 |
214 |
215 |
216 |
217 | library\lib\armeabi
218 | 1
219 |
220 |
221 |
222 |
223 | library\lib\mips
224 | 1
225 |
226 |
227 |
228 |
229 | library\lib\armeabi-v7a
230 | 1
231 |
232 |
233 |
234 |
235 | res\drawable
236 | 1
237 |
238 |
239 |
240 |
241 | res\values
242 | 1
243 |
244 |
245 |
246 |
247 | res\drawable
248 | 1
249 |
250 |
251 |
252 |
253 | res\drawable-xxhdpi
254 | 1
255 |
256 |
257 |
258 |
259 | res\drawable-ldpi
260 | 1
261 |
262 |
263 |
264 |
265 | res\drawable-mdpi
266 | 1
267 |
268 |
269 |
270 |
271 | res\drawable-hdpi
272 | 1
273 |
274 |
275 |
276 |
277 | res\drawable-xhdpi
278 | 1
279 |
280 |
281 |
282 |
283 | res\drawable-small
284 | 1
285 |
286 |
287 |
288 |
289 | res\drawable-normal
290 | 1
291 |
292 |
293 |
294 |
295 | res\drawable-large
296 | 1
297 |
298 |
299 |
300 |
301 | res\drawable-xlarge
302 | 1
303 |
304 |
305 |
306 |
307 | 1
308 |
309 |
310 | Contents\MacOS
311 | 1
312 |
313 |
314 | 0
315 |
316 |
317 |
318 |
319 | Contents\MacOS
320 | 1
321 | .framework
322 |
323 |
324 | 0
325 |
326 |
327 |
328 |
329 | 1
330 | .dylib
331 |
332 |
333 | 1
334 | .dylib
335 |
336 |
337 | 1
338 | .dylib
339 |
340 |
341 | Contents\MacOS
342 | 1
343 | .dylib
344 |
345 |
346 | 0
347 | .dll;.bpl
348 |
349 |
350 |
351 |
352 | 1
353 | .dylib
354 |
355 |
356 | 1
357 | .dylib
358 |
359 |
360 | 1
361 | .dylib
362 |
363 |
364 | Contents\MacOS
365 | 1
366 | .dylib
367 |
368 |
369 | 0
370 | .bpl
371 |
372 |
373 |
374 |
375 | 0
376 |
377 |
378 | 0
379 |
380 |
381 | 0
382 |
383 |
384 | 0
385 |
386 |
387 | Contents\Resources\StartUp\
388 | 0
389 |
390 |
391 | 0
392 |
393 |
394 |
395 |
396 | 1
397 |
398 |
399 | 1
400 |
401 |
402 | 1
403 |
404 |
405 |
406 |
407 | 1
408 |
409 |
410 | 1
411 |
412 |
413 | 1
414 |
415 |
416 |
417 |
418 | 1
419 |
420 |
421 | 1
422 |
423 |
424 | 1
425 |
426 |
427 |
428 |
429 | 1
430 |
431 |
432 | 1
433 |
434 |
435 | 1
436 |
437 |
438 |
439 |
440 | 1
441 |
442 |
443 | 1
444 |
445 |
446 | 1
447 |
448 |
449 |
450 |
451 | 1
452 |
453 |
454 | 1
455 |
456 |
457 | 1
458 |
459 |
460 |
461 |
462 | 1
463 |
464 |
465 | 1
466 |
467 |
468 | 1
469 |
470 |
471 |
472 |
473 | 1
474 |
475 |
476 |
477 |
478 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
479 | 1
480 |
481 |
482 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
483 | 1
484 |
485 |
486 |
487 |
488 | 1
489 |
490 |
491 | 1
492 |
493 |
494 |
495 |
496 | ..\
497 | 1
498 |
499 |
500 | ..\
501 | 1
502 |
503 |
504 |
505 |
506 | 1
507 |
508 |
509 | 1
510 |
511 |
512 | 1
513 |
514 |
515 |
516 |
517 | 1
518 |
519 |
520 | 1
521 |
522 |
523 | 1
524 |
525 |
526 |
527 |
528 | ..\
529 | 1
530 |
531 |
532 |
533 |
534 | Contents
535 | 1
536 |
537 |
538 |
539 |
540 | Contents\Resources
541 | 1
542 |
543 |
544 |
545 |
546 | library\lib\armeabi-v7a
547 | 1
548 |
549 |
550 | 1
551 |
552 |
553 | 1
554 |
555 |
556 | 1
557 |
558 |
559 | 1
560 |
561 |
562 | Contents\MacOS
563 | 1
564 |
565 |
566 | 0
567 |
568 |
569 |
570 |
571 | 1
572 |
573 |
574 | 1
575 |
576 |
577 |
578 |
579 | Assets
580 | 1
581 |
582 |
583 | Assets
584 | 1
585 |
586 |
587 |
588 |
589 | Assets
590 | 1
591 |
592 |
593 | Assets
594 | 1
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 | False
608 | False
609 | False
610 | False
611 | False
612 | False
613 | True
614 | False
615 |
616 |
617 | 12
618 |
619 |
620 |
621 |
622 |
623 |
--------------------------------------------------------------------------------
/samples/ORMRestServerDemo/source/win32/HTTPSocket/ServerHTTPSocket.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {9AACF2F3-ACA0-4402-81FC-7E77DC392FA8}
4 | 18.3
5 | None
6 | ServerHTTPSocket.dpr
7 | True
8 | Debug
9 | Win64
10 | 3
11 | Console
12 |
13 |
14 | true
15 |
16 |
17 | true
18 | Base
19 | true
20 |
21 |
22 | true
23 | Base
24 | true
25 |
26 |
27 | true
28 | Base
29 | true
30 |
31 |
32 | true
33 | Base
34 | true
35 |
36 |
37 | true
38 | Base
39 | true
40 |
41 |
42 | true
43 | Base
44 | true
45 |
46 |
47 | true
48 | Base
49 | true
50 |
51 |
52 | true
53 | Base
54 | true
55 |
56 |
57 | true
58 | Cfg_1
59 | true
60 | true
61 |
62 |
63 | true
64 | Base
65 | true
66 |
67 |
68 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
69 | ..\..\..\bin\$(Platform)\$(Config);$(DCC_FrameworkPath)
70 | 3082
71 | ..\..\..\bin\$(Platform)\$(Config)
72 | ..\..\common\;$(DCC_UnitSearchPath)
73 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)
74 | ServerHTTPSocket
75 | ..\..\..\bin\$(Platform)\$(Config)\dcu
76 | ..\..\..\bin\$(Platform)\$(Config)
77 | false
78 | false
79 | false
80 | false
81 | false
82 |
83 |
84 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png
85 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png
86 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png
87 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png
88 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png
89 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png
90 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png
91 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png
92 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png
93 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;dbexpress;IndyCore;dsnap;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;rtl;DbxClientDriver;CustomIPTransport;bindcomp;CoolTrayIcon_D210_XE7;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;$(DCC_UsePackage)
94 | 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
95 |
96 |
97 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;dbexpress;IndyCore;dsnap;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage)
98 |
99 |
100 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;dbexpress;IndyCore;dsnap;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;rtl;DbxClientDriver;CustomIPTransport;TMSFMXPackPkgDXE10;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage)
101 |
102 |
103 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;FireDACIBDriver;fmx;dbexpress;IndyCore;dsnap;FireDACCommon;RESTBackendComponents;soapserver;bindengine;CloudService;FireDACCommonDriver;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage)
104 |
105 |
106 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;tethering;bindcompfmx;inetdb;FmxTeeUI;FireDACIBDriver;fmx;fmxdae;dbexpress;IndyCore;dsnap;FireDACCommon;RESTBackendComponents;soapserver;bindengine;DBXMySQLDriver;CloudService;FireDACMySQLDriver;FireDACCommonODBC;FireDACCommonDriver;inet;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;FireDAC;FireDACSqliteDriver;FireDACPgDriver;FMXTee;soaprtl;DbxCommonDriver;xmlrtl;soapmidas;fmxobj;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;inetdbxpress;fmxase;$(DCC_UsePackage)
107 | true
108 |
109 |
110 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
111 | 1033
112 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png
113 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png
114 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=
115 | true
116 | Debug
117 | DBXSqliteDriver;RESTComponents;OmniThreadLibraryRuntime;UbuntuProgressPackage;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;svnui;JvGlobus;advchartdedxe10;FireDACADSDriver;JvPluginSystem;JvMM;advchartdxe10;vcltouch;JvBands;vcldb;bindcompfmx;svn;Intraweb;JvJans;JvNet;inetdb;JvAppFrm;EssentialsDR;FmxTeeUI;JvDotNetCtrls;AbbreviaVCLD;FireDACIBDriver;fmx;fmxdae;frx24;JvWizards;tmsexdXE10;dbexpress;IndyCore;vclx;JvPageComps;dsnap;FireDACCommon;JvDB;RESTBackendComponents;VCLRESTComponents;soapserver;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;CloudService;JvCmp;FireDACMySQLDriver;JvHMI;vcwdedXE10;FireDACCommonODBC;FireDACCommonDriver;LockBoxDR;inet;IndyIPCommon;bindcompdbx;GR32_D;JvCustom;vcl;IndyIPServer;JvXPCtrls;PngComponents;IndySystem;tmsxlsdXE10;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;madBasic_;TeeDB;FireDAC;OtherControls;Jcl;JvCore;vcwdXE10;JvCrypt;FireDACSqliteDriver;FireDACPgDriver;FMXTee;SevenZippro;soaprtl;DbxCommonDriver;JvDlgs;JvRuntimeDesign;JvManagedThreads;Tee;xmlrtl;soapmidas;JvTimeFramework;fmxobj;vclwinx;GR32_R;rtl;DbxClientDriver;frxTee24;CustomIPTransport;vcldsnap;JvSystem;JvStdCtrls;TMSFMXPackPkgDXE10;bindcomp;appanalytics;CoolTrayIcon_D210_XE7;tmswizdXE10;IndyIPClient;bindcompvcl;frxe24;TeeUI;JvDocking;dbxcds;VclSmp;KernowSoftwareFMX;adortl;JvPascalInterpreter;JclVcl;frxDB24;dsnapxml;dbrtl;IndyProtocols;inetdbxpress;JvControls;JvPrintPreview;Analog_XE7;JclContainers;tmsdXE10;fmxase;$(DCC_UsePackage)
118 |
119 |
120 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)
121 | 1033
122 | Debug
123 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png
124 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png
125 | true
126 | DBXSqliteDriver;RESTComponents;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;FireDACADSDriver;advchartdxe10;vcltouch;vcldb;bindcompfmx;Intraweb;inetdb;EssentialsDR;FmxTeeUI;AbbreviaVCLD;FireDACIBDriver;fmx;fmxdae;tmsexdXE10;dbexpress;IndyCore;vclx;dsnap;FireDACCommon;RESTBackendComponents;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACMySQLDriver;FireDACCommonODBC;FireDACCommonDriver;inet;IndyIPCommon;bindcompdbx;vcl;IndyIPServer;PngComponents;IndySystem;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;TeeDB;FireDAC;vcwdXE10;FireDACSqliteDriver;FireDACPgDriver;FMXTee;soaprtl;DbxCommonDriver;Tee;xmlrtl;soapmidas;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;dsnapxml;dbrtl;IndyProtocols;inetdbxpress;tmsdXE10;fmxase;$(DCC_UsePackage)
127 |
128 |
129 | DEBUG;$(DCC_Define)
130 | true
131 | false
132 | true
133 | true
134 | true
135 |
136 |
137 | 1033
138 | (None)
139 | false
140 |
141 |
142 | false
143 | RELEASE;$(DCC_Define)
144 | 0
145 | 0
146 |
147 |
148 |
149 | MainSource
150 |
151 |
152 | Cfg_2
153 | Base
154 |
155 |
156 | Base
157 |
158 |
159 | Cfg_1
160 | Base
161 |
162 |
163 |
164 | Delphi.Personality.12
165 | Application
166 |
167 |
168 |
169 | ServerHTTPSocket.dpr
170 |
171 |
172 | (untitled)
173 | Embarcadero C++Builder Office 2000 Servers Package
174 | Embarcadero C++Builder Office XP Servers Package
175 | Microsoft Office 2000 Sample Automation Server Wrapper Components
176 | Microsoft Office XP Sample Automation Server Wrapper Components
177 |
178 |
179 |
180 |
181 |
182 | true
183 |
184 |
185 |
186 |
187 | ServerHTTPSocket.rsm
188 | true
189 |
190 |
191 |
192 |
193 | true
194 |
195 |
196 |
197 |
198 | true
199 |
200 |
201 |
202 |
203 | ServerHTTPSocket.exe
204 | true
205 |
206 |
207 |
208 |
209 | true
210 |
211 |
212 |
213 |
214 | ServerHTTPSocket.exe
215 | true
216 |
217 |
218 |
219 |
220 | 1
221 |
222 |
223 | Contents\MacOS
224 | 1
225 |
226 |
227 | Contents\MacOS
228 | 0
229 |
230 |
231 |
232 |
233 | classes
234 | 1
235 |
236 |
237 |
238 |
239 | library\lib\armeabi-v7a
240 | 1
241 |
242 |
243 |
244 |
245 | library\lib\armeabi
246 | 1
247 |
248 |
249 |
250 |
251 | library\lib\mips
252 | 1
253 |
254 |
255 |
256 |
257 | library\lib\armeabi-v7a
258 | 1
259 |
260 |
261 |
262 |
263 | res\drawable
264 | 1
265 |
266 |
267 |
268 |
269 | res\values
270 | 1
271 |
272 |
273 |
274 |
275 | res\drawable
276 | 1
277 |
278 |
279 |
280 |
281 | res\drawable-xxhdpi
282 | 1
283 |
284 |
285 |
286 |
287 | res\drawable-ldpi
288 | 1
289 |
290 |
291 |
292 |
293 | res\drawable-mdpi
294 | 1
295 |
296 |
297 |
298 |
299 | res\drawable-hdpi
300 | 1
301 |
302 |
303 |
304 |
305 | res\drawable-xhdpi
306 | 1
307 |
308 |
309 |
310 |
311 | res\drawable-small
312 | 1
313 |
314 |
315 |
316 |
317 | res\drawable-normal
318 | 1
319 |
320 |
321 |
322 |
323 | res\drawable-large
324 | 1
325 |
326 |
327 |
328 |
329 | res\drawable-xlarge
330 | 1
331 |
332 |
333 |
334 |
335 | 1
336 |
337 |
338 | Contents\MacOS
339 | 1
340 |
341 |
342 | 0
343 |
344 |
345 |
346 |
347 | Contents\MacOS
348 | 1
349 | .framework
350 |
351 |
352 | 0
353 |
354 |
355 |
356 |
357 | 1
358 | .dylib
359 |
360 |
361 | 1
362 | .dylib
363 |
364 |
365 | 1
366 | .dylib
367 |
368 |
369 | Contents\MacOS
370 | 1
371 | .dylib
372 |
373 |
374 | 0
375 | .dll;.bpl
376 |
377 |
378 |
379 |
380 | 1
381 | .dylib
382 |
383 |
384 | 1
385 | .dylib
386 |
387 |
388 | 1
389 | .dylib
390 |
391 |
392 | Contents\MacOS
393 | 1
394 | .dylib
395 |
396 |
397 | 0
398 | .bpl
399 |
400 |
401 |
402 |
403 | 0
404 |
405 |
406 | 0
407 |
408 |
409 | 0
410 |
411 |
412 | 0
413 |
414 |
415 | Contents\Resources\StartUp\
416 | 0
417 |
418 |
419 | 0
420 |
421 |
422 |
423 |
424 | 1
425 |
426 |
427 | 1
428 |
429 |
430 | 1
431 |
432 |
433 |
434 |
435 | 1
436 |
437 |
438 | 1
439 |
440 |
441 | 1
442 |
443 |
444 |
445 |
446 | 1
447 |
448 |
449 | 1
450 |
451 |
452 | 1
453 |
454 |
455 |
456 |
457 | 1
458 |
459 |
460 | 1
461 |
462 |
463 | 1
464 |
465 |
466 |
467 |
468 | 1
469 |
470 |
471 | 1
472 |
473 |
474 | 1
475 |
476 |
477 |
478 |
479 | 1
480 |
481 |
482 | 1
483 |
484 |
485 | 1
486 |
487 |
488 |
489 |
490 | 1
491 |
492 |
493 | 1
494 |
495 |
496 | 1
497 |
498 |
499 |
500 |
501 | 1
502 |
503 |
504 |
505 |
506 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
507 | 1
508 |
509 |
510 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF
511 | 1
512 |
513 |
514 |
515 |
516 | 1
517 |
518 |
519 | 1
520 |
521 |
522 |
523 |
524 | ..\
525 | 1
526 |
527 |
528 | ..\
529 | 1
530 |
531 |
532 |
533 |
534 | 1
535 |
536 |
537 | 1
538 |
539 |
540 | 1
541 |
542 |
543 |
544 |
545 | 1
546 |
547 |
548 | 1
549 |
550 |
551 | 1
552 |
553 |
554 |
555 |
556 | ..\
557 | 1
558 |
559 |
560 |
561 |
562 | Contents
563 | 1
564 |
565 |
566 |
567 |
568 | Contents\Resources
569 | 1
570 |
571 |
572 |
573 |
574 | library\lib\armeabi-v7a
575 | 1
576 |
577 |
578 | 1
579 |
580 |
581 | 1
582 |
583 |
584 | 1
585 |
586 |
587 | 1
588 |
589 |
590 | Contents\MacOS
591 | 1
592 |
593 |
594 | 0
595 |
596 |
597 |
598 |
599 | 1
600 |
601 |
602 | 1
603 |
604 |
605 |
606 |
607 | Assets
608 | 1
609 |
610 |
611 | Assets
612 | 1
613 |
614 |
615 |
616 |
617 | Assets
618 | 1
619 |
620 |
621 | Assets
622 | 1
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 | False
636 | False
637 | False
638 | False
639 | False
640 | False
641 | True
642 | True
643 |
644 |
645 | 12
646 |
647 |
648 |
649 |
650 |
651 |
--------------------------------------------------------------------------------