Browse Source

* Add RoutesRegistered property to TSQLDBRestBridge

git-svn-id: trunk@42264 -
michael 6 years ago
parent
commit
961b27b4a7
1 changed files with 7 additions and 0 deletions
  1. 7 0
      packages/fcl-web/src/restbridge/sqldbrestbridge.pp

+ 7 - 0
packages/fcl-web/src/restbridge/sqldbrestbridge.pp

@@ -231,6 +231,7 @@ Type
     FMetadataItemRoute: THTTPRoute;
     FMetadataItemRoute: THTTPRoute;
     FStatus: TRestStatusConfig;
     FStatus: TRestStatusConfig;
     FStrings: TRestStringsConfig;
     FStrings: TRestStringsConfig;
+    function GetRoutesRegistered: Boolean;
     procedure SetActive(AValue: Boolean);
     procedure SetActive(AValue: Boolean);
     procedure SetAdminUserIDS(AValue: TStrings);
     procedure SetAdminUserIDS(AValue: TStrings);
     procedure SetAuthenticator(AValue: TRestAuthenticator);
     procedure SetAuthenticator(AValue: TRestAuthenticator);
@@ -325,6 +326,7 @@ Type
     Function ExposeDatabase(Const aType,aHostName,aDatabaseName,aUserName,aPassword : String; aTables : TStrings = nil; aMinFieldOpts : TRestFieldOptions = []) : TSQLDBRestConnection;
     Function ExposeDatabase(Const aType,aHostName,aDatabaseName,aUserName,aPassword : String; aTables : TStrings = nil; aMinFieldOpts : TRestFieldOptions = []) : TSQLDBRestConnection;
     Function ExposeConnection(aOwner : TComponent; Const aConnection : TSQLDBRestConnection; aTables : TStrings = nil; aMinFieldOpts : TRestFieldOptions = []) : TSQLDBRestSchema;
     Function ExposeConnection(aOwner : TComponent; Const aConnection : TSQLDBRestConnection; aTables : TStrings = nil; aMinFieldOpts : TRestFieldOptions = []) : TSQLDBRestSchema;
     Function ExposeConnection(Const aConnection : TSQLDBRestConnection; aTables : TStrings = nil; aMinFieldOpts : TRestFieldOptions = []) : TSQLDBRestSchema;
     Function ExposeConnection(Const aConnection : TSQLDBRestConnection; aTables : TStrings = nil; aMinFieldOpts : TRestFieldOptions = []) : TSQLDBRestSchema;
+    Property RoutesRegistered : Boolean Read GetRoutesRegistered;
   Published
   Published
     // Register or unregister HTTP routes
     // Register or unregister HTTP routes
     Property Active : Boolean Read FActive Write SetActive;
     Property Active : Boolean Read FActive Write SetActive;
@@ -518,6 +520,11 @@ begin
   FActive:=AValue;
   FActive:=AValue;
 end;
 end;
 
 
+function TSQLDBRestDispatcher.GetRoutesRegistered: Boolean;
+begin
+  Result:=FItemRoute<>Nil;
+end;
+
 procedure TSQLDBRestDispatcher.SetAdminUserIDS(AValue: TStrings);
 procedure TSQLDBRestDispatcher.SetAdminUserIDS(AValue: TStrings);
 begin
 begin
   if FAdminUserIDs=AValue then Exit;
   if FAdminUserIDs=AValue then Exit;