Improved router ACCEPT resolution - Improved MSSQLServer support for nvarchar(max) data type

This commit is contained in:
Daniele Teti 2019-12-17 14:52:11 +01:00
parent 2f43b31bbd
commit 3793a42b5d
15 changed files with 402 additions and 59 deletions

View File

@ -79,6 +79,7 @@ Congratulations to Daniele Teti and all the staff for the excellent work!" -- Ma
- New! Added support for interfaces serialization - now it is possible to serialize Spring4D collections (thanks to [João Antônio Duarte](https://github.com/joaoduarte19))
- New! Added support for Spring4D Nullable Types - check (thanks to [João Antônio Duarte](https://github.com/joaoduarte19))
- Added `TMVCJSONRPCExecutor.ConfigHTTPClient` to fully customize the inner `THTTPClient` (e.g. `ConnectionTimeout`, `ResponseTimeout` and so on)
- Improved! Now the router consider `Accept:*/*` compatible for every `MVCProduces` values
- Improved! Greatly improved support for [HATEOAS](https://en.wikipedia.org/wiki/HATEOAS) in renders. Check `TRenderSampleController.GetPeople_AsObjectList_HATEOS` and all the others actions end with `HATEOS` in `renders.dproj` sample)
```delphi

View File

@ -131,7 +131,8 @@ contains
Swag.Doc.SecurityDefinitionApiKey in '..\..\lib\swagdoc\Source\Swag.Doc.SecurityDefinitionApiKey.pas',
Swag.Doc.SecurityDefinitionBasic in '..\..\lib\swagdoc\Source\Swag.Doc.SecurityDefinitionBasic.pas',
Swag.Doc.SecurityDefinitionOAuth2 in '..\..\lib\swagdoc\Source\Swag.Doc.SecurityDefinitionOAuth2.pas',
Swag.Doc.Tags in '..\..\lib\swagdoc\Source\Swag.Doc.Tags.pas';
Swag.Doc.Tags in '..\..\lib\swagdoc\Source\Swag.Doc.Tags.pas',
MVCFramework.Middleware.Trace in '..\..\sources\MVCFramework.Middleware.Trace.pas';
end.

View File

@ -107,7 +107,7 @@
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<Debugger_HostApplication>C:\DEV\dmscontainer3\bin\DMSContainerService.exe</Debugger_HostApplication>
<Debugger_HostApplication>C:\DEV\dmscontainer v3.1.0\bin\DMSContainerService.exe</Debugger_HostApplication>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_MapFile>3</DCC_MapFile>
@ -115,6 +115,7 @@
<DllSuffix>103</DllSuffix>
<Debugger_IncludeSystemVars>true</Debugger_IncludeSystemVars>
<DCC_UNSUPPORTED_CONSTRUCT>false</DCC_UNSUPPORTED_CONSTRUCT>
<Debugger_RunParams>/console</Debugger_RunParams>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
@ -224,6 +225,7 @@
<DCCReference Include="..\..\lib\swagdoc\Source\Swag.Doc.SecurityDefinitionBasic.pas"/>
<DCCReference Include="..\..\lib\swagdoc\Source\Swag.Doc.SecurityDefinitionOAuth2.pas"/>
<DCCReference Include="..\..\lib\swagdoc\Source\Swag.Doc.Tags.pas"/>
<DCCReference Include="..\..\sources\MVCFramework.Middleware.Trace.pas"/>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>

View File

@ -19,7 +19,7 @@ object MainForm: TMainForm
Top = 0
Width = 842
Height = 527
ActivePage = TabSheet1
ActivePage = TabSheet2
Align = alClient
TabOrder = 0
object TabSheet1: TTabSheet
@ -197,6 +197,15 @@ object MainForm: TMainForm
TabOrder = 15
OnClick = btnFloatsTestsClick
end
object btnWithJSON: TButton
Left = 545
Top = 30
Width = 75
Height = 25
Caption = 'JSON Prop'
TabOrder = 16
OnClick = btnWithJSONClick
end
end
object GroupBox2: TGroupBox
Left = 3
@ -339,9 +348,12 @@ object MainForm: TMainForm
Left = 11
Top = 18
Width = 489
Height = 159
Height = 391
Caption = 'Returning Objects'
TabOrder = 0
DesignSize = (
489
391)
object edtSearchText: TEdit
Left = 16
Top = 24
@ -363,7 +375,8 @@ object MainForm: TMainForm
Left = 16
Top = 53
Width = 435
Height = 82
Height = 316
Anchors = [akLeft, akTop, akRight, akBottom]
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
@ -375,15 +388,6 @@ object MainForm: TMainForm
end
end
end
object btnWithJSON: TButton
Left = 552
Top = 76
Width = 75
Height = 25
Caption = 'JSON Prop'
TabOrder = 1
OnClick = btnWithJSONClick
end
object DataSource1: TDataSource
DataSet = FDMemTable1
Left = 767

View File

@ -272,8 +272,9 @@ var
lResp: IJSONRPCResponse;
lJSON: TJsonArray;
I: Integer;
lJObj: TJsonObject;
begin
lbPerson.Clear;
ListBox1.Clear;
lReq := TJSONRPCRequest.Create;
lReq.Method := 'searchproducts';
lReq.RequestID := 1234;
@ -287,7 +288,8 @@ begin
lJSON := lResp.Result.AsObject as TJsonArray;
for I := 0 to lJSON.Count - 1 do
begin
ListBox1.Items.Add(lJSON[I].ObjectValue.ToJSON());
lJObj := lJSON[I].ObjectValue;
ListBox1.Items.Add(Format('%6s: %-34s € %5.2f',[lJObj.S['codice'], lJObj.S['descrizione'], lJObj.F['prezzo']]));
end;
// lbPerson.Items.Add('First Name:'.PadRight(15) + lJSON.S['firstname']);
// lbPerson.Items.Add('Last Name:'.PadRight(15) + lJSON.S['lastname']);
@ -339,6 +341,7 @@ begin
lResp := FExecutor.ExecuteRequest(lReq);
FDMemTable1.Active := True;
FDMemTable1.LoadFromTValue(lResp.Result);
FDMemTable1.First;
end;
procedure TMainForm.FormCreate(Sender: TObject);

View File

@ -9,9 +9,6 @@
<Projects Include="jsonrpcclientwithobjects.dproj">
<Dependencies/>
</Projects>
<Projects Include="..\custom_exception_handling\custom_exception_handling.dproj">
<Dependencies/>
</Projects>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Default.Personality.12</Borland.Personality>
@ -38,23 +35,14 @@
<Target Name="jsonrpcclientwithobjects:Make">
<MSBuild Projects="jsonrpcclientwithobjects.dproj" Targets="Make"/>
</Target>
<Target Name="custom_exception_handling">
<MSBuild Projects="..\custom_exception_handling\custom_exception_handling.dproj"/>
</Target>
<Target Name="custom_exception_handling:Clean">
<MSBuild Projects="..\custom_exception_handling\custom_exception_handling.dproj" Targets="Clean"/>
</Target>
<Target Name="custom_exception_handling:Make">
<MSBuild Projects="..\custom_exception_handling\custom_exception_handling.dproj" Targets="Make"/>
</Target>
<Target Name="Build">
<CallTarget Targets="jsonrpcserverwithobjects;jsonrpcclientwithobjects;custom_exception_handling"/>
<CallTarget Targets="jsonrpcserverwithobjects;jsonrpcclientwithobjects"/>
</Target>
<Target Name="Clean">
<CallTarget Targets="jsonrpcserverwithobjects:Clean;jsonrpcclientwithobjects:Clean;custom_exception_handling:Clean"/>
<CallTarget Targets="jsonrpcserverwithobjects:Clean;jsonrpcclientwithobjects:Clean"/>
</Target>
<Target Name="Make">
<CallTarget Targets="jsonrpcserverwithobjects:Make;jsonrpcclientwithobjects:Make;custom_exception_handling:Make"/>
<CallTarget Targets="jsonrpcserverwithobjects:Make;jsonrpcclientwithobjects:Make"/>
</Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project>

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{300F83FF-8F7B-43FD-B740-A3DFDF7238ED}</ProjectGuid>
<ProjectVersion>18.7</ProjectVersion>
<ProjectVersion>18.8</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>jsonrpcclientwithobjects.dpr</MainSource>
<Base>True</Base>
@ -151,12 +151,20 @@
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
@ -169,138 +177,242 @@
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
@ -389,6 +501,9 @@
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
@ -722,6 +837,9 @@
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
@ -814,6 +932,10 @@
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
@ -838,6 +960,12 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
@ -875,6 +1003,7 @@
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{AF5FBC36-0D1D-4C07-B2E3-C2A2E688AC6F}</ProjectGuid>
<ProjectVersion>18.7</ProjectVersion>
<ProjectVersion>18.8</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>jsonrpcserverwithobjects.dpr</MainSource>
<Base>True</Base>
@ -18,6 +18,11 @@
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Android64' and '$(Base)'=='true') or '$(Base_Android64)'!=''">
<Base_Android64>true</Base_Android64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Linux64' and '$(Base)'=='true') or '$(Base_Linux64)'!=''">
<Base_Linux64>true</Base_Linux64>
<CfgParent>Base</CfgParent>
@ -75,6 +80,20 @@
<Android_NotificationIcon72>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png</Android_NotificationIcon72>
<Android_NotificationIcon96>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png</Android_NotificationIcon96>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android64)'!=''">
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<BT_BuildType>Debug</BT_BuildType>
<Base_Android>true</Base_Android>
<CfgParent>Base</CfgParent>
<Base>true</Base>
<DCC_UsePackage>DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;FireDACDBXDriver;dbexpress;IndyCore;dsnap;DataSnapCommon;bindengine;DataSnapClient;IndyIPCommon;bindcompdbx;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;DataSnapNativeClient;FireDACDSDriver;rtl;ibxbindings;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;DataSnapProviderClient;dbrtl;IndyProtocols;$(DCC_UsePackage);$(DCC_UsePackage)</DCC_UsePackage>
<EnabledSysJars>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</EnabledSysJars>
<Android_NotificationIcon24>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png</Android_NotificationIcon24>
<Android_NotificationIcon36>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png</Android_NotificationIcon36>
<Android_NotificationIcon48>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png</Android_NotificationIcon48>
<Android_NotificationIcon72>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png</Android_NotificationIcon72>
<Android_NotificationIcon96>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png</Android_NotificationIcon96>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Linux64)'!=''">
<DCC_UsePackage>FireDACADSDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;Spring.Data;inetdb;emsedge;dbexpress;IndyCore;dsnap;DataSnapCommon;DataSnapConnectors;bindengine;FireDACOracleDriver;FireDACMySQLDriver;FireDACCommonODBC;DataSnapClient;IndySystem;FireDACDb2Driver;FireDACInfxDriver;emshosting;FireDACPgDriver;FireDACASADriver;FireDACTDataDriver;DbxCommonDriver;DataSnapServer;xmlrtl;DataSnapNativeClient;rtl;DbxClientDriver;CustomIPTransport;bindcomp;dbxcds;FireDACODBCDriver;DataSnapIndy10ServerTransport;dsnapxml;dbrtl;IndyProtocols;FireDACMongoDBDriver;DataSnapServerMidas;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
@ -184,12 +203,20 @@
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
@ -202,138 +229,242 @@
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
@ -403,6 +534,9 @@
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
@ -734,6 +868,9 @@
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
@ -777,6 +914,10 @@
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
@ -799,6 +940,12 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
@ -836,9 +983,11 @@
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment>
<Platforms>
<Platform value="Android">False</Platform>
<Platform value="Android64">False</Platform>
<Platform value="Linux64">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>

View File

@ -701,10 +701,10 @@ begin
lQry.SQL.Text := lSQL;
lHandled := False;
//lQry.Prepare;
MapObjectToParams(lQry.Params, lHandled);
if not lHandled then
begin
// lQry.Prepare;
for lPair in fMap do
begin
lPar := lQry.FindParam(lPair.value);
@ -1271,7 +1271,24 @@ begin
// end;
tkString, tkUString:
begin
aParam.AsString := aValue.AsString;
case aParam.DataType of
ftUnknown, ftString, ftWideString:
begin
aParam.AsString := aValue.AsString;
end;
ftWideMemo:
begin
aParam.AsWideMemo := aValue.AsString;
end;
ftMemo:
begin
aParam.AsMemo := aValue.AsString;
end;
else
begin
raise EMVCActiveRecord.CreateFmt('Invalid data type for (tkString, tkUString) [%s]', [lName]);
end;
end;
end;
{$IF Defined(SeattleOrBetter)}
tkWideString:

View File

@ -345,11 +345,10 @@ type
end;
EMVCException = class(Exception)
private
protected
FHttpErrorCode: UInt16;
FAppErrorCode: UInt16;
FDetailedMessage: string;
protected
procedure CheckHTTPErrorCode(const AHTTPErrorCode: UInt16);
public
constructor Create(const AMsg: string); overload; virtual;

View File

@ -55,6 +55,24 @@ const
JSONRPC_MESSAGE = 'message';
JSONRPC_DATA = 'data';
{
http://www.jsonrpc.org/historical/json-rpc-over-http.html#response-codes
HTTP Status code message
500 -32700 Parse error.
400 -32600 Invalid Request.
404 -32601 Method not found.
500 -32602 Invalid params.
500 -32603 Internal error.
500 -32099..-32000 Server error.
}
JSONRPC_ERR_PARSE_ERROR = -32700;
JSONRPC_ERR_INVALID_REQUEST = -32600;
JSONRPC_ERR_METHOD_NOT_FOUND = -32601;
JSONRPC_ERR_INVALID_PARAMS = -32602;
JSONRPC_ERR_INTERNAL_ERROR = -32603;
JSONRPC_ERR_SERVER_ERROR_LOWERBOUND = -32099;
JSONRPC_ERR_SERVER_ERROR_UPPERBOUND = -32000;
type
IMVCJSONRPCMessage = interface
['{73B8D463-75E1-404B-8437-EF4B3C950D2F}']
@ -250,34 +268,39 @@ type
EMVCJSONRPCErrorResponse = class abstract(Exception)
private
FJSONRPCErrorCode: Integer;
fJSONRPCErrorCode: Integer;
public
property JSONRPCErrorCode: Integer read FJSONRPCErrorCode;
property JSONRPCErrorCode: Integer read fJSONRPCErrorCode;
end;
EMVCJSONRPCParseError = class(EMVCJSONRPCErrorResponse)
public
constructor Create;
procedure AfterConstruction; override;
end;
EMVCJSONRPCInvalidRequest = class(EMVCJSONRPCErrorResponse)
public
constructor Create(const Message: String = ''); overload;
procedure AfterConstruction; override;
end;
EMVCJSONRPCMethodNotFound = class(EMVCJSONRPCErrorResponse)
public
constructor Create(const MethodName: string);
procedure AfterConstruction; override;
end;
EMVCJSONRPCInvalidParams = class(EMVCJSONRPCErrorResponse)
public
constructor Create(const Message: string);
procedure AfterConstruction; override;
end;
EMVCJSONRPCInternalError = class(EMVCJSONRPCErrorResponse)
public
constructor Create;
procedure AfterConstruction; override;
end;
{ -32000 to -32099 Server error Reserved for implementation-defined server-errors. }
@ -885,7 +908,8 @@ end;
procedure TMVCJSONRPCController.GetPublishedMethodList;
begin
ResponseStream.AppendLine('// ' + StringOfChar('*', 80));
ResponseStream.AppendLine('// Generated by ' + DMVCFRAMEWORK_VERSION + ' at ' + FormatDateTime('yyyy-mm-dd hh:nn:ss', Now));
ResponseStream.AppendLine('// Generated by ' + DMVCFRAMEWORK_VERSION + ' at ' +
FormatDateTime('yyyy-mm-dd hh:nn:ss', Now));
ResponseStream.AppendLine('// ' + StringOfChar('*', 80));
ResponseStream.AppendLine('');
ForEachInvokableMethod(
@ -1028,17 +1052,17 @@ begin
500 -32099..-32000 Server error.
}
case E.JSONRPCErrorCode of
- 32700:
JSONRPC_ERR_PARSE_ERROR:
ResponseStatus(500);
-32600:
JSONRPC_ERR_INVALID_REQUEST:
ResponseStatus(400);
-32601:
JSONRPC_ERR_METHOD_NOT_FOUND:
ResponseStatus(404);
-32602:
JSONRPC_ERR_INVALID_PARAMS:
ResponseStatus(500);
-32603:
JSONRPC_ERR_INTERNAL_ERROR:
ResponseStatus(500);
-32099 .. -32000:
JSONRPC_ERR_SERVER_ERROR_LOWERBOUND .. JSONRPC_ERR_SERVER_ERROR_UPPERBOUND:
ResponseStatus(500);
end;
Render(CreateError(lReqID, E.JSONRPCErrorCode, E.Message), True);
@ -1066,15 +1090,26 @@ end;
{ EMVCJSONRPCParseError }
procedure EMVCJSONRPCParseError.AfterConstruction;
begin
inherited;
fJSONRPCErrorCode := JSONRPC_ERR_PARSE_ERROR;
end;
constructor EMVCJSONRPCParseError.Create;
begin
inherited Create
('Parse error. Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text');
FJSONRPCErrorCode := -32700;
end;
{ EMVCJSONRPCInvalidRequest }
procedure EMVCJSONRPCInvalidRequest.AfterConstruction;
begin
inherited;
fJSONRPCErrorCode := JSONRPC_ERR_INVALID_REQUEST;
end;
constructor EMVCJSONRPCInvalidRequest.Create(const Message: String);
var
lMsg: string;
@ -1085,32 +1120,46 @@ begin
lMsg := lMsg + ' [HINT] ' + Message;
end;
inherited Create(lMsg);
FJSONRPCErrorCode := -32600;
end;
{ EMVCJSONRPCMethodNotFound }
procedure EMVCJSONRPCMethodNotFound.AfterConstruction;
begin
inherited;
fJSONRPCErrorCode := JSONRPC_ERR_METHOD_NOT_FOUND;
end;
constructor EMVCJSONRPCMethodNotFound.Create(const MethodName: string);
begin
inherited CreateFmt('Method "%s" not found. The method does not exist or is not available.',
[MethodName]);
FJSONRPCErrorCode := -32601;
end;
{ EMVCJSONRPCInvalidParams }
procedure EMVCJSONRPCInvalidParams.AfterConstruction;
begin
inherited;
fJSONRPCErrorCode := JSONRPC_ERR_INVALID_PARAMS;
end;
constructor EMVCJSONRPCInvalidParams.Create(const Message: string);
begin
inherited Create('Invalid params. [hint: ' + message + ']');
FJSONRPCErrorCode := -32602;
end;
{ EMVCJSONRPCInternalError }
procedure EMVCJSONRPCInternalError.AfterConstruction;
begin
inherited;
fJSONRPCErrorCode := JSONRPC_ERR_INTERNAL_ERROR;
end;
constructor EMVCJSONRPCInternalError.Create;
begin
inherited Create('Internal JSON-RPC error');
FJSONRPCErrorCode := -32603;
end;
{ EMVCJSONRPCServerError }
@ -1118,7 +1167,7 @@ end;
constructor EMVCJSONRPCServerError.Create(const JSONRPCError: Integer; const Message: string);
begin
inherited Create(message);
FJSONRPCErrorCode := JSONRPCError;
fJSONRPCErrorCode := JSONRPCError;
end;
{ TJSONRPCRequest }

View File

@ -26,11 +26,8 @@ uses
procedure REPLEmit(const Value: string);
begin
// TextColor(LightGreen);
write('#> ');
// TextColor(White);
WriteLn(Value);
// TextColor(White);
end;
function HandleCommand(const Value: string; const Server: TIdHTTPWebBrokerBridge;

View File

@ -392,6 +392,10 @@ var
FoundOneAttProduces: Boolean;
begin
Result := False;
if AAccept = '*/*' then
begin
Exit(True);
end;
FoundOneAttProduces := False;
for I := 0 to high(AAttributes) do

View File

@ -1,4 +1,4 @@
// ***************************************************************************
// ***************************************************************************
//
// Delphi MVC Framework
//
@ -280,7 +280,7 @@ const
JSONNameLowerCase = ncLowerCase deprecated 'Use MVCNameCaseAttribute(ncLowerCase)';
JSONNameUpperCase = ncUpperCase deprecated 'Use MVCNameCaseAttribute(ncUpperCase)';
function NewDataObjectHolder(const AObject: TObject; const AMetaFiller: TProc<TMVCStringDictionary> = nil;
function NewObjectHolder(const AObject: TObject; const AMetaFiller: TProc<TMVCStringDictionary> = nil;
const AOwns: boolean = false): TDataObjectHolder;
function NewCollectionHolder(const AList: TObject; const AMetaFiller: TProc<TMVCStringDictionary> = nil;
const AOwns: boolean = false): TDataObjectHolder;
@ -291,7 +291,7 @@ uses
MVCFramework.Serializer.JsonDataObjects,
MVCFramework.Serializer.Intf;
function NewDataObjectHolder(const AObject: TObject; const AMetaFiller: TProc<TMVCStringDictionary> = nil;
function NewObjectHolder(const AObject: TObject; const AMetaFiller: TProc<TMVCStringDictionary> = nil;
const AOwns: boolean = false): TDataObjectHolder;
begin
Result := TDataObjectHolder.Create(AObject, AOwns, dstSingleRecord);

View File

@ -1,2 +1,2 @@
const
DMVCFRAMEWORK_VERSION = '3.2.0 (boron) RC2';
DMVCFRAMEWORK_VERSION = '3.2.0 (boron) RC3';