diff --git a/samples/basicdemo_server/App1MainControllerU.pas b/samples/basicdemo_server/App1MainControllerU.pas index c4852c60..e7938e9d 100644 --- a/samples/basicdemo_server/App1MainControllerU.pas +++ b/samples/basicdemo_server/App1MainControllerU.pas @@ -64,7 +64,7 @@ end; procedure TApp1MainController.Index; begin - Redirect('index.html'); + Redirect('/app/index.html'); end; procedure TApp1MainController.RaiseException(const par1, par2: integer); diff --git a/samples/basicdemo_server/BasicDemo.dproj b/samples/basicdemo_server/BasicDemo.dproj index fb3c01fd..3a7b04c1 100644 --- a/samples/basicdemo_server/BasicDemo.dproj +++ b/samples/basicdemo_server/BasicDemo.dproj @@ -1,7 +1,7 @@  {BCE38CEB-AE61-49C6-8C51-8D6776B45034} - 18.8 + 19.2 None BasicDemo.dpr True @@ -350,6 +350,16 @@ 1 + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + res\drawable-ldpi @@ -580,6 +590,32 @@ 0 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + 1 @@ -712,6 +748,16 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + 1 @@ -734,6 +780,66 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + 1 @@ -833,6 +939,16 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + 1 @@ -844,6 +960,16 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + 1 @@ -888,6 +1014,86 @@ 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + 1 @@ -909,6 +1115,7 @@ + 1 diff --git a/sources/MVCFramework.ActiveRecord.pas b/sources/MVCFramework.ActiveRecord.pas index e7647e94..bd59d0de 100644 --- a/sources/MVCFramework.ActiveRecord.pas +++ b/sources/MVCFramework.ActiveRecord.pas @@ -89,25 +89,6 @@ type const id: Integer; var Handled: Boolean); end; - IMVCUnitOfWork = interface - ['{68B55DD3-57F6-4CC0-A4DE-BFDE7C3AA287}'] - procedure RegisterDelete(const Value: T); overload; - procedure RegisterDelete(const Enumerable: TEnumerable); overload; - procedure RegisterUpdate(const Value: T); - procedure RegisterInsert(const Value: T); - procedure UnregisterDelete(const Value: T); - procedure UnregisterUpdate(const Value: T); - procedure UnregisterInsert(const Value: T); - end; - - TMVCItemApplyAction = reference to procedure(const Obj: T; - const EntityAction: TMVCEntityAction; var Handled: Boolean); - - IMVCMultiExecutor = interface - ['{C815246B-19CA-4F6C-AA67-8E491F809340}'] - procedure Apply(const ItemApplyAction: TMVCItemApplyAction = nil); - end; - TFieldInfo = class public // TableName: string; @@ -357,6 +338,25 @@ type class function CurrentConnection: TFDConnection; end; + IMVCUnitOfWork = interface + ['{68B55DD3-57F6-4CC0-A4DE-BFDE7C3AA287}'] + procedure RegisterDelete(const Value: T); overload; + procedure RegisterDelete(const Enumerable: TEnumerable); overload; + procedure RegisterUpdate(const Value: T); + procedure RegisterInsert(const Value: T); + procedure UnregisterDelete(const Value: T); + procedure UnregisterUpdate(const Value: T); + procedure UnregisterInsert(const Value: T); + end; + + TMVCItemApplyAction = reference to procedure(const Obj: T; + const EntityAction: TMVCEntityAction; var Handled: Boolean); + + IMVCMultiExecutor = interface + ['{C815246B-19CA-4F6C-AA67-8E491F809340}'] + procedure Apply(const ItemApplyAction: TMVCItemApplyAction = nil); + end; + TMVCActiveRecordHelper = class helper for TMVCActiveRecord class function GetByPK(const aValue: int64; const RaiseExceptionIfNotFound: Boolean = True): T; overload; diff --git a/sources/MVCFramework.Commons.pas b/sources/MVCFramework.Commons.pas index 91c9d29f..3784afaf 100644 --- a/sources/MVCFramework.Commons.pas +++ b/sources/MVCFramework.Commons.pas @@ -595,6 +595,12 @@ type class function GuidFromString(const AGuidStr: string): TGUID; static; end; + TMVCStringHelper = record + public + class function StartsText(const ASubText, AText: string): Boolean; static; + class function StartsWith(const ASubText, AText: string; AIgnoreCase: Boolean): Boolean; static; + end; + TMVCFieldsMapping = TArray; {$SCOPEDENUMS ON} @@ -1550,6 +1556,37 @@ begin Result := MVCFramework.DuckTyping.WrapAsList(AObject, AOwnsObject); end; +{ TMVCStringHelper } + +class function TMVCStringHelper.StartsText(const ASubText, AText: string): Boolean; +begin + if ASubText = EmptyStr then + Result := True + else + begin + if (AText.Length >= ASubText.Length) then + Result := AnsiStrLIComp(PChar(ASubText), PChar(AText), ASubText.Length) = 0 + else + Result := False; + end; +end; + +class function TMVCStringHelper.StartsWith(const ASubText, AText: string; AIgnoreCase: Boolean): Boolean; +begin + if AIgnoreCase then + Result := StartsText(ASubText, AText) + else + if ASubText = EmptyStr then + Result := True + else + begin + if (AText.Length >= ASubText.Length) then + Result := CompareStr(AText.Substring(0, ASubText.Length), ASubText) = 0 + else + Result := False; + end; +end; + initialization gLock := TObject.Create; diff --git a/sources/MVCFramework.Router.pas b/sources/MVCFramework.Router.pas index 41a2784d..f48151b4 100644 --- a/sources/MVCFramework.Router.pas +++ b/sources/MVCFramework.Router.pas @@ -208,7 +208,11 @@ begin LControllerMappedPath := ''; end; +{$IF defined(TOKYOORBETTER)} if not LRequestPathInfo.StartsWith(APathPrefix + LControllerMappedPath, True) then +{$ELSE} + if not TMVCStringHelper.StartsWith(APathPrefix + LControllerMappedPath, LRequestPathInfo, True) then +{$ENDIF} begin Continue; end;