TSimpleLoginService

Overview

Implements the base service for user authentication with the ISimpleLoginService service interface.

A service of this type will be automatically created for you if you select the Simple Login template when starting a new project.

Location

Implements

 

constructor Create  override    (declared in TDataAbstractService)

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner:

AcquireConnection    (declared in TDataAbstractService)

Toggles whether the service can automatically acquire a connection when needed (true, default) or not (false).

property AcquireConnection: Boolean read write

AllowAllFieldsInDynamicWhere    (declared in TDataAbstractService)

By security reasons, only fields that are present in table definition can be used in Dynamic Where expression.

This property allows to override default behavior and use any fields in such expressions. (Default value is False).

property AllowAllFieldsInDynamicWhere: Boolean read write

AllowCustomSqlMacros    (declared in TDataAbstractService)

property AllowCustomSqlMacros: Boolean read write

AllowDataAccess    (declared in TDataAbstractService)

Allows the clients to access schema information from the published schema (true, default) or not (false). Set this property to false if you want to prevent clients from accessing the data published by the ServiceSchema. This might be done on a per-client basis, depending on user rights, by setting the property on the OnActivate event.

property AllowDataAccess: Boolean read write

AllowDynamicSelect    (declared in TDataAbstractService)

Allows clients to use Dynamic Select feature.

property AllowDynamicSelect: Boolean read write

AllowDynamicWhere    (declared in TDataAbstractService)

Allows clients to use Dynamic Where feature.

property AllowDynamicWhere: Boolean read write

AllowExecuteCommands    (declared in TDataAbstractService)

Allows clients to execute commands that are published in the schema (true) or not (false, default). Set this property to true if you want to enable clients to manually execute commands defined in the ServiceSchema.

property AllowExecuteCommands: Boolean read write

AllowExecuteSQL    (declared in TDataAbstractService)

Allows clients to execute custom SQL, as command or for retrieving data published in the schema (true) or not (false, default). Since enabling this option opens a huge security risk, AllowExecuteSQL is set to false by default. If enabled, client applications can send custom SQL text to the server for execution, including code that could potentially harm or destroy the database. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers.

property AllowExecuteSQL: Boolean read write

AllowRemoteEventsRegistration  protected    (declared in TRORemoteDataModule)

Obsolete, replaced by the LegacyEvents property.

function AllowRemoteEventsRegistration: boolean

AllowSchemaAccess    (declared in TDataAbstractService)

Allows clients to access data from the published schema (true, default) or not (false). While access to schema information from the server is often helpful while designing the client application, most clients do not need to refresh schema information from the server at runtime. Although proper use of user authentication will restrict access, disabling this option for production servers prevents unnecessary exposure of the server's schema.

property AllowSchemaAccess: Boolean read write

AllowUpdates    (declared in TDataAbstractService)

Allows clients to update data.

property AllowUpdates: Boolean read write

AllowWhereSQL    (declared in TDataAbstractService)

Allows clients to transmit custom WHERE clauses as part of fetching data (true) or not (false, default). Since WHERE clauses are plain text base SQL, enabling this option opens a huge security risk, as malicious clients could use SQL injections to perform unexpected database operations as part of the submitted WHERE clause. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers.

property AllowWhereSQL: Boolean read write

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source:

AutoCreateBusinessProcessors    (declared in TDataAbstractService)

Specifies if the service will automatically instantiate TDABusinessProcessors to process Deltas, if needed. If set to true (default), the service will use the TDABusinessProcessors dropped on the service to perform updates, if present, but will automatically create new Business Processors if none are configured for a particular data table. If set to false, the server will only process Deltas for tables that explicitly have a business processor configured for them; if none is configured, the Delta will be rejected with an exception.

property AutoCreateBusinessProcessors: Boolean read write

Check  protected    (declared in TDataAbstractService)

Validates TDataAbstractService properties.

procedure Check(CheckOnlyDataStreamer: Boolean)

Parameters:


CheckForConnectionManager    (declared in TDataAbstractService)

Validates ServiceSchema.ConnectionManager property.

procedure CheckForConnectionManager

ClientID    (declared in TRORemoteDataModule)

The unique identifier for the client connected to the service. It is equal to the session ID if the session already exists. When the service method is called, this property is already initialized with a proper value. Do not change it unless you know what you are doing!

property ClientID: TGUID read write

Connection    (declared in TDataAbstractService)

Returns a live connection to the back-end database based on the configured ConnectionName value. If a connection was previously requested, the same instance will be returned, if a fresh connection to the database couldn't be obtained from the connection manager. Once a connection is acquired, it will be held on until the service gets deactivated, or ReleaseConnection is called.

property Connection: IDAConnection read write

ConnectionName    (declared in TDataAbstractService)

Defines the name of the connection that this service will use to connect to the back-end database. If set, all data access done by the service will use the specified connection; if not set, the default connection as defined in connection manager will be used. A typical use case for this property would be to set the connection name in the OnActivate or BeforeAcquireConnection event to match a specific connection, which, for example, could have been stored in the Sessions. The default code provided by the MultiDb Server template uses this approach. When setting ConnectionName and a connection is already acquired, make sure to call the ReleaseConnection method, so that a new connection will be obtained when needed.

property ConnectionName: string read write

CreateSession    (declared in TRORemoteDataModule)

Creates a new session object and makes it available via the Session property. As a rule, there is no need to call this method because the session is created automatically when required.

procedure CreateSession

CustomRequireSession  protected virtual    (declared in TRORemoteDataModule)

Internal use only, don't override.

function CustomRequireSession(const aMessage: IROMessage): boolean

Parameters:

  • aMessage: Message

DestroySession    (declared in TRORemoteDataModule)

Destroys the current session object. This method is primarily used to destroy the session in case of unsuccessful client authentication.

procedure DestroySession

DoBeforeGetDatasetData  protected virtual    (declared in TDataAbstractService)

Fires BeforeGetDatasetData event.

procedure DoBeforeGetDatasetData(const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

Parameters:

  • aDataset: Source dataset.
  • aIncludeSchema: Schema information should be included or not.
  • aMaxRecords: The count of rows of the request.

DoCommitTransaction  protected virtual    (declared in TDataAbstractService)

Commits transaction, fires OnUpdateDataCommitTransaction event and related Business Rules Scripting Events

procedure DoCommitTransaction(aConnection: IDAConnection)

Parameters:

  • aConnection: Used connection.

DoOnDeactivate  protected override    (declared in TDataAbstractService)

Destroys default connection.

procedure DoOnDeactivate(aClientID: TGUID)

Parameters:

  • aClientID: Client ID

DoRollbackTransaction  protected virtual    (declared in TDataAbstractService)

Rollbacks transaction, fires OnUpdateDataRollBackTransaction event and related Business Rules Scripting Events

procedure DoRollbackTransaction(aConnection: IDAConnection)

Parameters:

  • aConnection: Used connection.

DoStartTransaction  protected virtual    (declared in TDataAbstractService)

Starts transaction, fires OnUpdateDataBeginTransaction event and related Business Rules Scripting Events

function DoStartTransaction(var aConnection: IDAConnection): Boolean

Parameters:

  • aConnection: Used connection.

DoValidateCommandAccess  protected    (declared in TDataAbstractService)

Pefrorms processing of ValidateCommandExecution

procedure DoValidateCommandAccess(const aConnection: IDAConnection; const aDatasetName: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aConnection: Used connection.
  • aDatasetName: Command name
  • aRec: internal structure that contain some shared data

DoValidateDataTableAccess  protected    (declared in TDataAbstractService)

Pefrorms processing of ValidateDatasetAccess

procedure DoValidateDataTableAccess(const aDatasetName: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aDatasetName: Dataset name
  • aRec: internal structure that contain some shared data

DoValidateDirectSQLAccess  protected    (declared in TDataAbstractService)

Pefrorms processing of OnValidateDirectSQLAccess

procedure DoValidateDirectSQLAccess(const aConnection: IDAConnection; const aSQLText: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aConnection: Used connection.
  • aSQLText: SQL text
  • aRec: internal structure that contain some shared data

EventRepository    (declared in TRORemoteDataModule)

Points to the event repository (TROEventRepository instance) for the service. The value must be set to use the events feature.

property EventRepository: TROEventRepository read write

ExecuteCommand  protected virtual    (declared in TDataAbstractService)

Executes specified command

function ExecuteCommand(const aCommandName: ROUTF8String; const aParameterArray: DataParameterArray): Integer

Parameters:

  • aCommandName: Command name in the Schema
  • aParameterArray: List of input paramaters

ExecuteCommandEx  protected virtual    (declared in TDataAbstractService)

Executes specified command

function ExecuteCommandEx(const aCommandName: ROUTF8String; const aInputParameters: DataParameterArray; out aOutputParameters: DataParameterArray): Integer

Parameters:

  • aCommandName: Command name in the Schema
  • aInputParameters: List of input paramaters
  • aOutputParameters: List of output paramaters

ExportedDataTables    (declared in TDataAbstractService)

Maintains a list of server-side TDADataTables that will be published by the server, alongside the data tables defined in the schema. This allows the service to publish data that does not necessarily come from the back-end database targeted by the schema and connection, but also from other sources. For example, the TDADataTables could be filled from a different database, loaded from a file on disk, or manually filled from code. For the client application, these tables will look like any other data table published by the server.

property ExportedDataTables: TDADataTableReferenceCollection read write

GetCommandSchema  protected virtual    (declared in TDataAbstractService)

Returns the definitions of the schema commands identified by the names passed through the parameter.

function GetCommandSchema(const aCommandNameArray: StringArray): ROUTF8String

Parameters:

  • aCommandNameArray: specifies the name or names of the commands

GetConnectionForObject  protected virtual    (declared in TDataAbstractService)

Returns connection for specified object

function GetConnectionForObject(const aName: string): IDAConnection

Parameters:

  • aName: name of object

GetData  protected virtual    (declared in TDataAbstractService)

Returns a stream that includes the data of all data tables indicated in the first parameter. Each data table can return a different number of rows or be opened using specific parameters that are passed as TableInfoRequest in the second parameter.

This method provides the primary means of fetching data from the server to the client, and is invoked when the Fill method is called on a client-side TDARemoteDataAdapter component.

function GetData(const aTableNameArray: StringArray; const aTableRequestInfoArray: TableRequestInfoArray): Binary

Parameters:

  • aTableNameArray: specifies the name or names of the tables to retrieve
  • aTableRequestInfoArray: specifies one or several TableRequestInfo with additional options

GetDatasetScripts  protected virtual    (declared in TDataAbstractService)

Returns client-side Business Rules scripts in xml format

function GetDatasetScripts(const DatasetNames: ROUTF8String): ROUTF8String

Parameters:

  • DatasetNames: List of dataset names which should be devided by comma

GetDispatchInfo  protected virtual    (declared in TRORemoteDataModule)

Allows to grab the input parameters to get all information about the upcoming call including the remote method parameters and the calling client transport object.

procedure GetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

Parameters:

  • aTransport: Points to the transport object containing connection-specific information
  • aMessage: Message that needs to be processed

GetEventsData  protected    (declared in TRORemoteDataModule)

Collects events data to the memory stream. For internal use only, don't call or override.

function GetEventsData(const ClientID: string; out EventsData: Binary): integer

Parameters:

  • ClientID: Client ID
  • EventsData: Binary stream that holds the event data

GetSchema  protected virtual    (declared in TDataAbstractService)

Returns the schema referenced by the service to the calling client application, as XML.

function GetSchema(const aFilter: ROUTF8String): ROUTF8String

Parameters:

  • aFilter: not used

GetScriptContext  protected virtual    (declared in TDataAbstractService)

Returns Business Rules script content

function GetScriptContext: IDAServerScriptContext

GetTableSchema  protected virtual    (declared in TDataAbstractService)

Returns the definitions of the schema data tables identified by the names passed through the parameter.

function GetTableSchema(const aTableNameArray: StringArray): ROUTF8String

Parameters:

  • aTableNameArray: specifies the name or names of the tables

IsRetained  protected    (declared in TRORemoteDataModule)

Returns true if anObject is retained by Self.

function IsRetained(const anObject: TObject): boolean

Parameters:

  • anObject: Object to check

IsSessionPresent    (declared in TRORemoteDataModule)

Checks if session is present

function IsSessionPresent: Boolean

LegacyEvents    (declared in TRORemoteDataModule)

Enables or disables the legacy events mode for the service. The default value is true. The legacy mode is less secure and it is recommended to set this property to false for new projects. Note that refusing to use the legacy mode will break compatibility with legacy Delphi clients.

property LegacyEvents: boolean read write

Login  protected virtual

This method performs user authentication based on the provided credentials. It returns true if the user was successully authenticated and false otherwise.

function Login(const aUserID: ROUTF8String; const aPassword: ROUTF8String; out aUserInfo: UserInfo): Boolean

Parameters:

  • aUserID: User name
  • aPassword: User password
  • aUserInfo: Variable of UserInfo type that will contain additional information about the logged in user.

LoginEx  protected override

Provides the actual login procedure.

function LoginEx(const aLoginString: ROUTF8String): Boolean

Parameters:

  • aLoginString: String that contains the connection name, user name and password

Logout  protected    (declared in TBaseLoginService)

This method performs the log out.

procedure Logout

NewSession    (declared in TRORemoteDataModule)

Indicates that the client's session was just created, i.e. this indicates the first connection of a so far unknown client.

property NewSession: boolean read write

Notification  protected override    (declared in TDataAbstractService)

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent:
  • Operation:

OnAcquireConnectionFailure    (declared in TDataAbstractService)

Fired when acquiring a connection failed.

property OnAcquireConnectionFailure: TDAAcquireConnectionFailureEvent read write
delegate: procedure OnAcquireConnectionFailure(aSender: TObject; const aConnectionName: string; aError: Exception)

OnActivate    (declared in TRORemoteDataModule)

Called just after the service is created and before any service method is called. Handle this event for everything you need to do when the service instance is created.

property OnActivate: TActivateEvent read write
delegate: procedure OnActivate(const aClientID: TGUID; aSession: TROSession; const aMessage: IROMessage)

OnAfterAcquireConnection    (declared in TDataAbstractService)

Fires right after a new connection is acquired through the Connection property. Use this event to make perform initializations on the new connection, such as opening a transaction, or setting connection options.

property OnAfterAcquireConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnAfterAcquireConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnAfterExecuteCommand    (declared in TDataAbstractService)

Fires right after a command was executed.

property OnAfterExecuteCommand: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecuteCommand(aSender: TObject; const aCommand: IDASQLCommand; aRowsAffacted: integer)

OnAfterGetDatasetData    (declared in TDataAbstractService)

Fires right after data for a dataset (data table) was retrieved.

property OnAfterGetDatasetData: TDAGetDatasetDataEvent read write
delegate: procedure OnAfterGetDatasetData(aSender: TObject; const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

OnAfterGetDatasetSchema    (declared in TDataAbstractService)

Fires right after schema info for a dataset (data table) was retrieved.

property OnAfterGetDatasetSchema: TDAGetDatasetSchemaEvent read write
delegate: procedure OnAfterGetDatasetSchema(aSender: TObject; const aDataset: IDADataset)

OnAfterProcessDeltas    (declared in TDataAbstractService)

Fires right after Deltas for a data table have been processed.

property OnAfterProcessDeltas: TDAProcessDeltasEvent read write
delegate: procedure OnAfterProcessDeltas(aSender: TObject; aDeltaStructs: TDADeltaStructList)

OnAfterReleaseConnection    (declared in TDataAbstractService)

Fires right after a connection is released.

property OnAfterReleaseConnection: TDAConnectionReleasedEvent read write
delegate: procedure OnAfterReleaseConnection(aSender: TObject; const aConnectionName: string)

OnBeforeAcquireConnection    (declared in TDataAbstractService)

Fires just before a new connection is acquired through the Connection property. Use this event to make last-minute configurations before the connection will be acquired, such as changing the ConnectionName.

property OnBeforeAcquireConnection: TDAAcquireConnectionEvent read write
delegate: procedure OnBeforeAcquireConnection(aSender: TObject; var aConnectionName: string)

OnBeforeExecuteCommand    (declared in TDataAbstractService)

Fires just before a command will be executed.

property OnBeforeExecuteCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteCommand(aSender: TObject; const aCommand: IDASQLCommand)

OnBeforeExecuteDeltaCommand    (declared in TDataAbstractService)

Fires just before a delta command will be executed.

property OnBeforeExecuteDeltaCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteDeltaCommand(const Sender: IDASQLCommand)

OnBeforeGetDatasetData    (declared in TDataAbstractService)

Fires just before data for a dataset (data table) is retrieved.

property OnBeforeGetDatasetData: TDAGetDatasetDataEvent read write
delegate: procedure OnBeforeGetDatasetData(aSender: TObject; const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

OnBeforeGetDatasetSchema    (declared in TDataAbstractService)

Fires just before schema info for a dataset (data table) is retrieved.

property OnBeforeGetDatasetSchema: TDAGetDatasetSchemaEvent read write
delegate: procedure OnBeforeGetDatasetSchema(aSender: TObject; const aDataset: IDADataset)

OnBeforeProcessDeltas    (declared in TDataAbstractService)

Fires just before Deltas for a data table will be processed.

property OnBeforeProcessDeltas: TDAProcessDeltasEvent read write
delegate: procedure OnBeforeProcessDeltas(aSender: TObject; aDeltaStructs: TDADeltaStructList)

OnBeforeRegisterEventClient    (declared in TRORemoteDataModule)

Called when the new client is being registered to receive events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeRegisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeRegisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBeforeReleaseConnection    (declared in TDataAbstractService)

Fires just before the connection is released. Use this event to perform any finalization tasks on the new connection, such as closing a transaction, or setting connection options.

property OnBeforeReleaseConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnBeforeReleaseConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnBeforeUnregisterEventClient    (declared in TRORemoteDataModule)

Called when the client is being unsubscribed from events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeUnregisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeUnregisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBusinessProcessorAutoCreated    (declared in TDataAbstractService)

Fires whenever a new TDABusinessProcessor was auto-created to process deltas. You can use this event to perform additional configuration on the Business Processor before it will be used.

property OnBusinessProcessorAutoCreated: TDABusinessProcessorAutoCreatedEvent read write
delegate: procedure OnBusinessProcessorAutoCreated(aSender: TRORemoteDataModule; BusinessProcessor: TDABusinessProcessor)

OnDeactivate    (declared in TRORemoteDataModule)

Called after the service method completes and before the service instance is freed. Handle this event to perform actions on service destruction, such as disposing of resources.

property OnDeactivate: TDeactivateEvent read write
delegate: procedure OnDeactivate(const aClientID: TGUID; aSession: TROSession)

OnGetDispatchInfo    (declared in TRORemoteDataModule)

This event is fired before the invoker executes the service method. Handle this event to preview remote methods about to be executed; the input parameters allow to get all information about the upcoming call including the remote method parameters and the calling client transport object.

property OnGetDispatchInfo: TGetDispatchInfoEvent read write
delegate: procedure OnGetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

OnGetSchemaAsXMLEvent    (declared in TDataAbstractService)

Fires whenever a client retrieves the ServiceSchema. You can use this event to manually adjust or filter the Schema XML before it will be returned to the client.

property OnGetSchemaAsXMLEvent: TDAGetSchemaAsXMLEvent read write
delegate: procedure OnGetSchemaAsXMLEvent(aSender: TObject; var aSchemaXML: ROUTF8String)

OnLogin

Implements this event handler to provide the actual login procedure. Ideally this method should: *Validate the passed login credentials, *Create a new session if login is considered successful, *Fill the outgoing UserInfo class with any information that should be sent back to the client.
Skeleton code for the event handler will automatically be created for you if you select the Simple Login template when starting a new project.

property OnLogin: TSimpleLoginEvent read write
delegate: procedure OnLogin(Sender: TObject; aUserID: ROUTF8String; aPassword: ROUTF8String; out aUserInfo: UserInfo; var aLoginSuccessful: boolean)

OnLogout    (declared in TBaseLoginService)

Implement this event handler to provide the actual logout procedure.

property OnLogout: TNotifyEvent read write

OnProcessDeltasError    (declared in TDataAbstractService)

Fires if an error occurred while processing Deltas. Among other things, you can use this event to determine whether processing of the remaining Delta changes should continue, or if all changes should be rejected.

property OnProcessDeltasError: TDAProcessDeltasErrorEvent read write
delegate: procedure OnProcessDeltasError(aSender: TObject; aDeltaStructs: TDADeltaStructList; aError: Exception; var aDoRaise: boolean)

OnUnknownMacroVariable    (declared in TDataAbstractService)

Fires when unknown macro variable is found. it can be usable when user-defined variables are used inside sql or Dynamic Where expression.

property OnUnknownMacroVariable: TOnUnknownIdentifier read write
delegate: function OnUnknownMacroVariable(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnUnknownSqlMacroIdentifier    (declared in TDataAbstractService)

property OnUnknownSqlMacroIdentifier: TOnUnknownIdentifier read write
delegate: function OnUnknownSqlMacroIdentifier(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnUpdateDataBeginTransaction    (declared in TDataAbstractService)

Fires when a transaction will be started for processing a new set of deltas. You can handle this event to determine if the transaction should be started (default) or not.

property OnUpdateDataBeginTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataBeginTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnUpdateDataCommitTransaction    (declared in TDataAbstractService)

Fires when a transaction used for processing Deltas will be committed. You can handle this event to determine if the transaction should be committed (default) or not.

property OnUpdateDataCommitTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataCommitTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnUpdateDataRollBackTransaction    (declared in TDataAbstractService)

Fires when a transaction used for processing Deltas will be rolled back due to errors. You can handle this event to determine if the transaction should be rolled back (default) or not.

property OnUpdateDataRollBackTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataRollBackTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnValidateCommandExecution    (declared in TDataAbstractService)

Fires before a command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.

property OnValidateCommandExecution: TDASchemaElementAccessValidationEvent read write
delegate: procedure OnValidateCommandExecution(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of variant; aSchema: TDASchema; var Allowed: boolean)

OnValidateDatasetAccess    (declared in TDataAbstractService)

Fires before a data access retrieves data tables. You can use this event handler to do validation, for example to check if the current user is allowed to access the data table(s) in question, and raise an exception if the data access should be aborted.

property OnValidateDatasetAccess: TDASchemaElementAccessValidationEvent read write
delegate: procedure OnValidateDatasetAccess(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of variant; aSchema: TDASchema; var Allowed: boolean)

OnValidateDirectSQLAccess    (declared in TDataAbstractService)

Fires before a SQL command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.

property OnValidateDirectSQLAccess: TDASQLValidationEvent read write
delegate: procedure OnValidateDirectSQLAccess(Sender: TObject; const aConnection: IDAConnection; const aSQLText: string; const aParamNames: array of string; const aParamValues: array of variant; var Allowed: boolean)

OnValidateRoles    (declared in TRORemoteDataModule)

Validates roles.

property OnValidateRoles: TValidateRolesEvent read write
delegate: procedure OnValidateRoles(aRoles: array of string; var aAllow: Boolean)

ProcessDeltasWithoutUpdateRules    (declared in TDataAbstractService)

Manages whether the service will process Deltas for which no update rules have been defined (true) or not (false). If set to true (default), the service will process all delta packets it receives. If set to false, it will only process those deltas for which an update rule has been defined. Please refer to the Update Rules help topic for more details on update rules.

property ProcessDeltasWithoutUpdateRules: Boolean read write

RefCount    (declared in TRORemoteDataModule)

Reference counter - this class is the interfaced object.

property RefCount: integer read write

RegisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession: Client session
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterForDataChangeNotification  protected virtual    (declared in TDataAbstractService)

Registers a new table which will be refreshed automatically after other users apply changes to it.

This method isn't implemented yet!

procedure RegisterForDataChangeNotification(const aTableName: ROUTF8String)

Parameters:

  • aTableName: table name

ReleaseConnection    (declared in TDataAbstractService)

Releases any connection currently acquired in the Connection property.

procedure ReleaseConnection

ReleaseObject  protected    (declared in TRORemoteDataModule)

Takes away the hold of anObject set by RetainObject.

procedure ReleaseObject(const anObject: TObject)

Parameters:

  • anObject: Object to release

RequiresSession    (declared in TRORemoteDataModule)

This property should be set to true (perhaps with the designer) to make the service protected and to disallow unauthenticated clients to call its methods. Read more.

property RequiresSession: boolean read write

RetainObject  protected    (declared in TRORemoteDataModule)

Sets the hold of anObject.

procedure RetainObject(const anObject: TObject)

Parameters:

  • anObject: Object to hold

ReturnFullSchema    (declared in TDataAbstractService)

Allows to return full schema including content of statements. by default is False. We recommend to not change this value by security reasons.

property ReturnFullSchema: Boolean read write

ReturnUpdateFailureDelta    (declared in TDataAbstractService)

Part of Reconcile Dialog feature. Allows to return of failed changes to client via setting RaiseExceptionAtError for all autogenerated TDABusinessProcessor. by default is True.

Can be used for applying changes for several tables in one transaction with False value.

See also TDABusinessProcessor.RaiseExceptionAtError

property ReturnUpdateFailureDelta: Boolean read write

ScriptProvider    (declared in TDataAbstractService)

Specifies Business Rules Scripting provider.

property ScriptProvider: IDAScriptProvider read write

ServiceDataStreamer    (declared in TDataAbstractService)

References the TDADataStreamer that will be used to stream data to and from the network. The data streamer determines the format that will be used to send data on the wire, so the type selected on the service must match the type selected for the TDARemoteDataAdapter.DataStreamer property on the client. Note that data streamers are not re-entrant, so every service instance must use its own data streamer instance. The best way to achieve this is to make sure the data streamer component is dropped into the service module itself, and not referenced from elsewhere. Also note that the data streamer assigned to the ServiceDataStreamer should be reserved for use by the service only. If you do any custom processing requiring a data streamer in your own code (such as filling server-side TDADataTables), make sure to use a second streamer instance for this, to avoid conflicts.

property ServiceDataStreamer: TDADataStreamer read write

ServiceSchema    (declared in TDataAbstractService)

This property points to the TDASchema component defining the schema that will be published by this service. This can be a schema component located on the service data module or (more typically) on a separate global data module in the server application. Data Abstract uses a 1:1 mapping of services and schemas, where every service publishes one schema. Depending on your application design and the scope of your server, you might only use one schema for the entire data access, or logically partition your data tables across different schemas (and services). Locating the schema on a global data module rather than the service module itself might provide a slight performance benefit, as the schema structure only has to be loaded into memory once (on application startup), not every time a new service instance is created. Also note that the TDAConnectionManager (referenced from the schema) must be located off the service module and in a global location for connection pooling to work properly across service instances.

property ServiceSchema: TDASchema read write

ServiceValidateRoles  protected    (declared in TRORemoteDataModule)

Validates roles.

procedure ServiceValidateRoles(aRequiredRoles: array of string)

Parameters:

  • aRequiredRoles: Roles

Session    (declared in TRORemoteDataModule)

Provides access to the session object of the current connection. If the session does not exist, it is created at the moment of property access.

property Session: TROSession read write

SessionManager    (declared in TRORemoteDataModule)

Points to the session manager to use. It is necessary to assign the session manager if the protected service is being developed and/or it is necessary to use the events feature.

property SessionManager: TROCustomSessionManager read write

SetConnection  deprecated    (declared in TDataAbstractService)

procedure SetConnection(aConnection: IDAConnection)

Parameters:

  • aConnection:

SimpleGetData  protected virtual    (declared in TDataAbstractService)

Simplified GetData method that is used in Odata calls

function SimpleGetData(const Request: SimpleRequestInfoArray): SimpleDataResultArray

Parameters:

  • Request: the requests to send to the server. These will all be processed in the same transaction.

SimpleUpdateData  protected virtual    (declared in TDataAbstractService)

Simplified UpdateData method that is used in Odata calls

function SimpleUpdateData(const aDelta: SimpleDeltaArray): SimpleDeltaArray

Parameters:

  • aDelta: delta list to process

SQLExecuteCommand  protected virtual    (declared in TDataAbstractService)

Executes the passed SQL statement as a command.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set False by default, to prevent SQL commands from being executed.

function SQLExecuteCommand(const aSQLText: ROUTF8String): Integer

Parameters:

  • aSQLText: SQL statement

SQLExecuteCommandEx  protected virtual    (declared in TDataAbstractService)

Executes the passed SQL statement as a command. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set False by default, to prevent SQL commands from being executed.

function SQLExecuteCommandEx(const aSQLText: ROUTF8String; const aDynamicWhereXML: UnicodeString): Integer

Parameters:

  • aSQLText: SQL statement
  • aDynamicWhereXML: xml with Dynamic Where condition

SQLGetData  protected virtual    (declared in TDataAbstractService)

Executes the passed SQL statement and returns the record set as streamed data table.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLGetData(const aSQLText: ROUTF8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer): Binary

Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.

SQLGetDataEx  protected virtual    (declared in TDataAbstractService)

Executes the passed SQL statement and returns the record set as streamed data table. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLGetDataEx(const aSQLText: ROUTF8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer; const aDynamicWhereXML: UnicodeString): Binary

Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.
  • aDynamicWhereXML: xml with Dynamic Where condition

Transport    (declared in TRORemoteDataModule)

Provides access to the transport object that processes the current network (or other) connection to the server. Various information, such as client IP address, can be available via the transport objects.

property Transport: IROTransport read write

UnregisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

The action is opposite to RegisterEventClient, it cancels the subscription. Unregistration is not absolutely necessary as the client session dies after some time of inactivity but allows to conserve some system resources.

procedure UnregisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to unsubscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to unsubscribe the client from.

UnregisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID:
  • EventTypes:

UnregisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession:
  • EventTypes:

UnregisterForDataChangeNotification  protected virtual    (declared in TDataAbstractService)

Unregisters a table that was registered by the RegisterForDataChangeNotification method.

This method isn't implemented yet!

procedure UnregisterForDataChangeNotification(const aTableName: ROUTF8String)

Parameters:

  • aTableName: table name

UpdateData  protected virtual    (declared in TDataAbstractService)

Applies the deltas encoded in the passed stream to the database and returns a stream that includes status information about the applied updates and possibly refreshed data for the client.

This method provides the primary means of applying data updates from the client back to the server, and is invoked when the Update method is called on a client-side remote data adapter component.

function UpdateData(const aDelta: Binary): Binary

Parameters:

  • aDelta: delta list to process

 

AcquireConnection    (declared in TDataAbstractService)

Toggles whether the service can automatically acquire a connection when needed (true, default) or not (false).

property AcquireConnection: Boolean read write

AllowAllFieldsInDynamicWhere    (declared in TDataAbstractService)

By security reasons, only fields that are present in table definition can be used in Dynamic Where expression.

This property allows to override default behavior and use any fields in such expressions. (Default value is False).

property AllowAllFieldsInDynamicWhere: Boolean read write

AllowCustomSqlMacros    (declared in TDataAbstractService)

property AllowCustomSqlMacros: Boolean read write

AllowDataAccess    (declared in TDataAbstractService)

Allows the clients to access schema information from the published schema (true, default) or not (false). Set this property to false if you want to prevent clients from accessing the data published by the ServiceSchema. This might be done on a per-client basis, depending on user rights, by setting the property on the OnActivate event.

property AllowDataAccess: Boolean read write

AllowDynamicSelect    (declared in TDataAbstractService)

Allows clients to use Dynamic Select feature.

property AllowDynamicSelect: Boolean read write

AllowDynamicWhere    (declared in TDataAbstractService)

Allows clients to use Dynamic Where feature.

property AllowDynamicWhere: Boolean read write

AllowExecuteCommands    (declared in TDataAbstractService)

Allows clients to execute commands that are published in the schema (true) or not (false, default). Set this property to true if you want to enable clients to manually execute commands defined in the ServiceSchema.

property AllowExecuteCommands: Boolean read write

AllowExecuteSQL    (declared in TDataAbstractService)

Allows clients to execute custom SQL, as command or for retrieving data published in the schema (true) or not (false, default). Since enabling this option opens a huge security risk, AllowExecuteSQL is set to false by default. If enabled, client applications can send custom SQL text to the server for execution, including code that could potentially harm or destroy the database. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers.

property AllowExecuteSQL: Boolean read write

AllowSchemaAccess    (declared in TDataAbstractService)

Allows clients to access data from the published schema (true, default) or not (false). While access to schema information from the server is often helpful while designing the client application, most clients do not need to refresh schema information from the server at runtime. Although proper use of user authentication will restrict access, disabling this option for production servers prevents unnecessary exposure of the server's schema.

property AllowSchemaAccess: Boolean read write

AllowUpdates    (declared in TDataAbstractService)

Allows clients to update data.

property AllowUpdates: Boolean read write

AllowWhereSQL    (declared in TDataAbstractService)

Allows clients to transmit custom WHERE clauses as part of fetching data (true) or not (false, default). Since WHERE clauses are plain text base SQL, enabling this option opens a huge security risk, as malicious clients could use SQL injections to perform unexpected database operations as part of the submitted WHERE clause. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers.

property AllowWhereSQL: Boolean read write

AutoCreateBusinessProcessors    (declared in TDataAbstractService)

Specifies if the service will automatically instantiate TDABusinessProcessors to process Deltas, if needed. If set to true (default), the service will use the TDABusinessProcessors dropped on the service to perform updates, if present, but will automatically create new Business Processors if none are configured for a particular data table. If set to false, the server will only process Deltas for tables that explicitly have a business processor configured for them; if none is configured, the Delta will be rejected with an exception.

property AutoCreateBusinessProcessors: Boolean read write

ClientID    (declared in TRORemoteDataModule)

The unique identifier for the client connected to the service. It is equal to the session ID if the session already exists. When the service method is called, this property is already initialized with a proper value. Do not change it unless you know what you are doing!

property ClientID: TGUID read write

Connection    (declared in TDataAbstractService)

Returns a live connection to the back-end database based on the configured ConnectionName value. If a connection was previously requested, the same instance will be returned, if a fresh connection to the database couldn't be obtained from the connection manager. Once a connection is acquired, it will be held on until the service gets deactivated, or ReleaseConnection is called.

property Connection: IDAConnection read write

ConnectionName    (declared in TDataAbstractService)

Defines the name of the connection that this service will use to connect to the back-end database. If set, all data access done by the service will use the specified connection; if not set, the default connection as defined in connection manager will be used. A typical use case for this property would be to set the connection name in the OnActivate or BeforeAcquireConnection event to match a specific connection, which, for example, could have been stored in the Sessions. The default code provided by the MultiDb Server template uses this approach. When setting ConnectionName and a connection is already acquired, make sure to call the ReleaseConnection method, so that a new connection will be obtained when needed.

property ConnectionName: string read write

EventRepository    (declared in TRORemoteDataModule)

Points to the event repository (TROEventRepository instance) for the service. The value must be set to use the events feature.

property EventRepository: TROEventRepository read write

ExportedDataTables    (declared in TDataAbstractService)

Maintains a list of server-side TDADataTables that will be published by the server, alongside the data tables defined in the schema. This allows the service to publish data that does not necessarily come from the back-end database targeted by the schema and connection, but also from other sources. For example, the TDADataTables could be filled from a different database, loaded from a file on disk, or manually filled from code. For the client application, these tables will look like any other data table published by the server.

property ExportedDataTables: TDADataTableReferenceCollection read write

LegacyEvents    (declared in TRORemoteDataModule)

Enables or disables the legacy events mode for the service. The default value is true. The legacy mode is less secure and it is recommended to set this property to false for new projects. Note that refusing to use the legacy mode will break compatibility with legacy Delphi clients.

property LegacyEvents: boolean read write

NewSession    (declared in TRORemoteDataModule)

Indicates that the client's session was just created, i.e. this indicates the first connection of a so far unknown client.

property NewSession: boolean read write

ProcessDeltasWithoutUpdateRules    (declared in TDataAbstractService)

Manages whether the service will process Deltas for which no update rules have been defined (true) or not (false). If set to true (default), the service will process all delta packets it receives. If set to false, it will only process those deltas for which an update rule has been defined. Please refer to the Update Rules help topic for more details on update rules.

property ProcessDeltasWithoutUpdateRules: Boolean read write

RefCount    (declared in TRORemoteDataModule)

Reference counter - this class is the interfaced object.

property RefCount: integer read write

RequiresSession    (declared in TRORemoteDataModule)

This property should be set to true (perhaps with the designer) to make the service protected and to disallow unauthenticated clients to call its methods. Read more.

property RequiresSession: boolean read write

ReturnFullSchema    (declared in TDataAbstractService)

Allows to return full schema including content of statements. by default is False. We recommend to not change this value by security reasons.

property ReturnFullSchema: Boolean read write

ReturnUpdateFailureDelta    (declared in TDataAbstractService)

Part of Reconcile Dialog feature. Allows to return of failed changes to client via setting RaiseExceptionAtError for all autogenerated TDABusinessProcessor. by default is True.

Can be used for applying changes for several tables in one transaction with False value.

See also TDABusinessProcessor.RaiseExceptionAtError

property ReturnUpdateFailureDelta: Boolean read write

ScriptProvider    (declared in TDataAbstractService)

Specifies Business Rules Scripting provider.

property ScriptProvider: IDAScriptProvider read write

ServiceDataStreamer    (declared in TDataAbstractService)

References the TDADataStreamer that will be used to stream data to and from the network. The data streamer determines the format that will be used to send data on the wire, so the type selected on the service must match the type selected for the TDARemoteDataAdapter.DataStreamer property on the client. Note that data streamers are not re-entrant, so every service instance must use its own data streamer instance. The best way to achieve this is to make sure the data streamer component is dropped into the service module itself, and not referenced from elsewhere. Also note that the data streamer assigned to the ServiceDataStreamer should be reserved for use by the service only. If you do any custom processing requiring a data streamer in your own code (such as filling server-side TDADataTables), make sure to use a second streamer instance for this, to avoid conflicts.

property ServiceDataStreamer: TDADataStreamer read write

ServiceSchema    (declared in TDataAbstractService)

This property points to the TDASchema component defining the schema that will be published by this service. This can be a schema component located on the service data module or (more typically) on a separate global data module in the server application. Data Abstract uses a 1:1 mapping of services and schemas, where every service publishes one schema. Depending on your application design and the scope of your server, you might only use one schema for the entire data access, or logically partition your data tables across different schemas (and services). Locating the schema on a global data module rather than the service module itself might provide a slight performance benefit, as the schema structure only has to be loaded into memory once (on application startup), not every time a new service instance is created. Also note that the TDAConnectionManager (referenced from the schema) must be located off the service module and in a global location for connection pooling to work properly across service instances.

property ServiceSchema: TDASchema read write

Session    (declared in TRORemoteDataModule)

Provides access to the session object of the current connection. If the session does not exist, it is created at the moment of property access.

property Session: TROSession read write

SessionManager    (declared in TRORemoteDataModule)

Points to the session manager to use. It is necessary to assign the session manager if the protected service is being developed and/or it is necessary to use the events feature.

property SessionManager: TROCustomSessionManager read write

Transport    (declared in TRORemoteDataModule)

Provides access to the transport object that processes the current network (or other) connection to the server. Various information, such as client IP address, can be available via the transport objects.

property Transport: IROTransport read write

 

constructor Create  override    (declared in TDataAbstractService)

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner:

AllowRemoteEventsRegistration  protected    (declared in TRORemoteDataModule)

Obsolete, replaced by the LegacyEvents property.

function AllowRemoteEventsRegistration: boolean

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source:

Check  protected    (declared in TDataAbstractService)

Validates TDataAbstractService properties.

procedure Check(CheckOnlyDataStreamer: Boolean)

Parameters:


CheckForConnectionManager    (declared in TDataAbstractService)

Validates ServiceSchema.ConnectionManager property.

procedure CheckForConnectionManager

CreateSession    (declared in TRORemoteDataModule)

Creates a new session object and makes it available via the Session property. As a rule, there is no need to call this method because the session is created automatically when required.

procedure CreateSession

CustomRequireSession  protected virtual    (declared in TRORemoteDataModule)

Internal use only, don't override.

function CustomRequireSession(const aMessage: IROMessage): boolean

Parameters:

  • aMessage: Message

DestroySession    (declared in TRORemoteDataModule)

Destroys the current session object. This method is primarily used to destroy the session in case of unsuccessful client authentication.

procedure DestroySession

DoBeforeGetDatasetData  protected virtual    (declared in TDataAbstractService)

Fires BeforeGetDatasetData event.

procedure DoBeforeGetDatasetData(const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

Parameters:

  • aDataset: Source dataset.
  • aIncludeSchema: Schema information should be included or not.
  • aMaxRecords: The count of rows of the request.

DoCommitTransaction  protected virtual    (declared in TDataAbstractService)

Commits transaction, fires OnUpdateDataCommitTransaction event and related Business Rules Scripting Events

procedure DoCommitTransaction(aConnection: IDAConnection)

Parameters:

  • aConnection: Used connection.

DoOnDeactivate  protected override    (declared in TDataAbstractService)

Destroys default connection.

procedure DoOnDeactivate(aClientID: TGUID)

Parameters:

  • aClientID: Client ID

DoRollbackTransaction  protected virtual    (declared in TDataAbstractService)

Rollbacks transaction, fires OnUpdateDataRollBackTransaction event and related Business Rules Scripting Events

procedure DoRollbackTransaction(aConnection: IDAConnection)

Parameters:

  • aConnection: Used connection.

DoStartTransaction  protected virtual    (declared in TDataAbstractService)

Starts transaction, fires OnUpdateDataBeginTransaction event and related Business Rules Scripting Events

function DoStartTransaction(var aConnection: IDAConnection): Boolean

Parameters:

  • aConnection: Used connection.

DoValidateCommandAccess  protected    (declared in TDataAbstractService)

Pefrorms processing of ValidateCommandExecution

procedure DoValidateCommandAccess(const aConnection: IDAConnection; const aDatasetName: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aConnection: Used connection.
  • aDatasetName: Command name
  • aRec: internal structure that contain some shared data

DoValidateDataTableAccess  protected    (declared in TDataAbstractService)

Pefrorms processing of ValidateDatasetAccess

procedure DoValidateDataTableAccess(const aDatasetName: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aDatasetName: Dataset name
  • aRec: internal structure that contain some shared data

DoValidateDirectSQLAccess  protected    (declared in TDataAbstractService)

Pefrorms processing of OnValidateDirectSQLAccess

procedure DoValidateDirectSQLAccess(const aConnection: IDAConnection; const aSQLText: UnicodeString; const aRec: PDAServiceExchangeData)

Parameters:

  • aConnection: Used connection.
  • aSQLText: SQL text
  • aRec: internal structure that contain some shared data

ExecuteCommand  protected virtual    (declared in TDataAbstractService)

Executes specified command

function ExecuteCommand(const aCommandName: ROUTF8String; const aParameterArray: DataParameterArray): Integer

Parameters:

  • aCommandName: Command name in the Schema
  • aParameterArray: List of input paramaters

ExecuteCommandEx  protected virtual    (declared in TDataAbstractService)

Executes specified command

function ExecuteCommandEx(const aCommandName: ROUTF8String; const aInputParameters: DataParameterArray; out aOutputParameters: DataParameterArray): Integer

Parameters:

  • aCommandName: Command name in the Schema
  • aInputParameters: List of input paramaters
  • aOutputParameters: List of output paramaters

GetCommandSchema  protected virtual    (declared in TDataAbstractService)

Returns the definitions of the schema commands identified by the names passed through the parameter.

function GetCommandSchema(const aCommandNameArray: StringArray): ROUTF8String

Parameters:

  • aCommandNameArray: specifies the name or names of the commands

GetConnectionForObject  protected virtual    (declared in TDataAbstractService)

Returns connection for specified object

function GetConnectionForObject(const aName: string): IDAConnection

Parameters:

  • aName: name of object

GetData  protected virtual    (declared in TDataAbstractService)

Returns a stream that includes the data of all data tables indicated in the first parameter. Each data table can return a different number of rows or be opened using specific parameters that are passed as TableInfoRequest in the second parameter.

This method provides the primary means of fetching data from the server to the client, and is invoked when the Fill method is called on a client-side TDARemoteDataAdapter component.

function GetData(const aTableNameArray: StringArray; const aTableRequestInfoArray: TableRequestInfoArray): Binary

Parameters:

  • aTableNameArray: specifies the name or names of the tables to retrieve
  • aTableRequestInfoArray: specifies one or several TableRequestInfo with additional options

GetDatasetScripts  protected virtual    (declared in TDataAbstractService)

Returns client-side Business Rules scripts in xml format

function GetDatasetScripts(const DatasetNames: ROUTF8String): ROUTF8String

Parameters:

  • DatasetNames: List of dataset names which should be devided by comma

GetDispatchInfo  protected virtual    (declared in TRORemoteDataModule)

Allows to grab the input parameters to get all information about the upcoming call including the remote method parameters and the calling client transport object.

procedure GetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

Parameters:

  • aTransport: Points to the transport object containing connection-specific information
  • aMessage: Message that needs to be processed

GetEventsData  protected    (declared in TRORemoteDataModule)

Collects events data to the memory stream. For internal use only, don't call or override.

function GetEventsData(const ClientID: string; out EventsData: Binary): integer

Parameters:

  • ClientID: Client ID
  • EventsData: Binary stream that holds the event data

GetSchema  protected virtual    (declared in TDataAbstractService)

Returns the schema referenced by the service to the calling client application, as XML.

function GetSchema(const aFilter: ROUTF8String): ROUTF8String

Parameters:

  • aFilter: not used

GetScriptContext  protected virtual    (declared in TDataAbstractService)

Returns Business Rules script content

function GetScriptContext: IDAServerScriptContext

GetTableSchema  protected virtual    (declared in TDataAbstractService)

Returns the definitions of the schema data tables identified by the names passed through the parameter.

function GetTableSchema(const aTableNameArray: StringArray): ROUTF8String

Parameters:

  • aTableNameArray: specifies the name or names of the tables

IsRetained  protected    (declared in TRORemoteDataModule)

Returns true if anObject is retained by Self.

function IsRetained(const anObject: TObject): boolean

Parameters:

  • anObject: Object to check

IsSessionPresent    (declared in TRORemoteDataModule)

Checks if session is present

function IsSessionPresent: Boolean

Login  protected virtual

This method performs user authentication based on the provided credentials. It returns true if the user was successully authenticated and false otherwise.

function Login(const aUserID: ROUTF8String; const aPassword: ROUTF8String; out aUserInfo: UserInfo): Boolean

Parameters:

  • aUserID: User name
  • aPassword: User password
  • aUserInfo: Variable of UserInfo type that will contain additional information about the logged in user.

LoginEx  protected override

Provides the actual login procedure.

function LoginEx(const aLoginString: ROUTF8String): Boolean

Parameters:

  • aLoginString: String that contains the connection name, user name and password

Logout  protected    (declared in TBaseLoginService)

This method performs the log out.

procedure Logout

Notification  protected override    (declared in TDataAbstractService)

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent:
  • Operation:

RegisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession: Client session
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterForDataChangeNotification  protected virtual    (declared in TDataAbstractService)

Registers a new table which will be refreshed automatically after other users apply changes to it.

This method isn't implemented yet!

procedure RegisterForDataChangeNotification(const aTableName: ROUTF8String)

Parameters:

  • aTableName: table name

ReleaseConnection    (declared in TDataAbstractService)

Releases any connection currently acquired in the Connection property.

procedure ReleaseConnection

ReleaseObject  protected    (declared in TRORemoteDataModule)

Takes away the hold of anObject set by RetainObject.

procedure ReleaseObject(const anObject: TObject)

Parameters:

  • anObject: Object to release

RetainObject  protected    (declared in TRORemoteDataModule)

Sets the hold of anObject.

procedure RetainObject(const anObject: TObject)

Parameters:

  • anObject: Object to hold

ServiceValidateRoles  protected    (declared in TRORemoteDataModule)

Validates roles.

procedure ServiceValidateRoles(aRequiredRoles: array of string)

Parameters:

  • aRequiredRoles: Roles

SetConnection  deprecated    (declared in TDataAbstractService)

procedure SetConnection(aConnection: IDAConnection)

Parameters:

  • aConnection:

SimpleGetData  protected virtual    (declared in TDataAbstractService)

Simplified GetData method that is used in Odata calls

function SimpleGetData(const Request: SimpleRequestInfoArray): SimpleDataResultArray

Parameters:

  • Request: the requests to send to the server. These will all be processed in the same transaction.

SimpleUpdateData  protected virtual    (declared in TDataAbstractService)

Simplified UpdateData method that is used in Odata calls

function SimpleUpdateData(const aDelta: SimpleDeltaArray): SimpleDeltaArray

Parameters:

  • aDelta: delta list to process

SQLExecuteCommand  protected virtual    (declared in TDataAbstractService)

Executes the passed SQL statement as a command.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set False by default, to prevent SQL commands from being executed.

function SQLExecuteCommand(const aSQLText: ROUTF8String): Integer

Parameters:

  • aSQLText: SQL statement

SQLExecuteCommandEx  protected virtual    (declared in TDataAbstractService)

Executes the passed SQL statement as a command. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set False by default, to prevent SQL commands from being executed.

function SQLExecuteCommandEx(const aSQLText: ROUTF8String; const aDynamicWhereXML: UnicodeString): Integer

Parameters:

  • aSQLText: SQL statement
  • aDynamicWhereXML: xml with Dynamic Where condition

SQLGetData  protected virtual    (declared in TDataAbstractService)

Executes the passed SQL statement and returns the record set as streamed data table.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLGetData(const aSQLText: ROUTF8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer): Binary

Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.

SQLGetDataEx  protected virtual    (declared in TDataAbstractService)

Executes the passed SQL statement and returns the record set as streamed data table. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.

function SQLGetDataEx(const aSQLText: ROUTF8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer; const aDynamicWhereXML: UnicodeString): Binary

Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.
  • aDynamicWhereXML: xml with Dynamic Where condition

UnregisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

The action is opposite to RegisterEventClient, it cancels the subscription. Unregistration is not absolutely necessary as the client session dies after some time of inactivity but allows to conserve some system resources.

procedure UnregisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to unsubscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to unsubscribe the client from.

UnregisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID:
  • EventTypes:

UnregisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession:
  • EventTypes:

UnregisterForDataChangeNotification  protected virtual    (declared in TDataAbstractService)

Unregisters a table that was registered by the RegisterForDataChangeNotification method.

This method isn't implemented yet!

procedure UnregisterForDataChangeNotification(const aTableName: ROUTF8String)

Parameters:

  • aTableName: table name

UpdateData  protected virtual    (declared in TDataAbstractService)

Applies the deltas encoded in the passed stream to the database and returns a stream that includes status information about the applied updates and possibly refreshed data for the client.

This method provides the primary means of applying data updates from the client back to the server, and is invoked when the Update method is called on a client-side remote data adapter component.

function UpdateData(const aDelta: Binary): Binary

Parameters:

  • aDelta: delta list to process

 

OnAcquireConnectionFailure    (declared in TDataAbstractService)

Fired when acquiring a connection failed.

property OnAcquireConnectionFailure: TDAAcquireConnectionFailureEvent read write
delegate: procedure OnAcquireConnectionFailure(aSender: TObject; const aConnectionName: string; aError: Exception)

OnActivate    (declared in TRORemoteDataModule)

Called just after the service is created and before any service method is called. Handle this event for everything you need to do when the service instance is created.

property OnActivate: TActivateEvent read write
delegate: procedure OnActivate(const aClientID: TGUID; aSession: TROSession; const aMessage: IROMessage)

OnAfterAcquireConnection    (declared in TDataAbstractService)

Fires right after a new connection is acquired through the Connection property. Use this event to make perform initializations on the new connection, such as opening a transaction, or setting connection options.

property OnAfterAcquireConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnAfterAcquireConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnAfterExecuteCommand    (declared in TDataAbstractService)

Fires right after a command was executed.

property OnAfterExecuteCommand: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecuteCommand(aSender: TObject; const aCommand: IDASQLCommand; aRowsAffacted: integer)

OnAfterGetDatasetData    (declared in TDataAbstractService)

Fires right after data for a dataset (data table) was retrieved.

property OnAfterGetDatasetData: TDAGetDatasetDataEvent read write
delegate: procedure OnAfterGetDatasetData(aSender: TObject; const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

OnAfterGetDatasetSchema    (declared in TDataAbstractService)

Fires right after schema info for a dataset (data table) was retrieved.

property OnAfterGetDatasetSchema: TDAGetDatasetSchemaEvent read write
delegate: procedure OnAfterGetDatasetSchema(aSender: TObject; const aDataset: IDADataset)

OnAfterProcessDeltas    (declared in TDataAbstractService)

Fires right after Deltas for a data table have been processed.

property OnAfterProcessDeltas: TDAProcessDeltasEvent read write
delegate: procedure OnAfterProcessDeltas(aSender: TObject; aDeltaStructs: TDADeltaStructList)

OnAfterReleaseConnection    (declared in TDataAbstractService)

Fires right after a connection is released.

property OnAfterReleaseConnection: TDAConnectionReleasedEvent read write
delegate: procedure OnAfterReleaseConnection(aSender: TObject; const aConnectionName: string)

OnBeforeAcquireConnection    (declared in TDataAbstractService)

Fires just before a new connection is acquired through the Connection property. Use this event to make last-minute configurations before the connection will be acquired, such as changing the ConnectionName.

property OnBeforeAcquireConnection: TDAAcquireConnectionEvent read write
delegate: procedure OnBeforeAcquireConnection(aSender: TObject; var aConnectionName: string)

OnBeforeExecuteCommand    (declared in TDataAbstractService)

Fires just before a command will be executed.

property OnBeforeExecuteCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteCommand(aSender: TObject; const aCommand: IDASQLCommand)

OnBeforeExecuteDeltaCommand    (declared in TDataAbstractService)

Fires just before a delta command will be executed.

property OnBeforeExecuteDeltaCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteDeltaCommand(const Sender: IDASQLCommand)

OnBeforeGetDatasetData    (declared in TDataAbstractService)

Fires just before data for a dataset (data table) is retrieved.

property OnBeforeGetDatasetData: TDAGetDatasetDataEvent read write
delegate: procedure OnBeforeGetDatasetData(aSender: TObject; const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)

OnBeforeGetDatasetSchema    (declared in TDataAbstractService)

Fires just before schema info for a dataset (data table) is retrieved.

property OnBeforeGetDatasetSchema: TDAGetDatasetSchemaEvent read write
delegate: procedure OnBeforeGetDatasetSchema(aSender: TObject; const aDataset: IDADataset)

OnBeforeProcessDeltas    (declared in TDataAbstractService)

Fires just before Deltas for a data table will be processed.

property OnBeforeProcessDeltas: TDAProcessDeltasEvent read write
delegate: procedure OnBeforeProcessDeltas(aSender: TObject; aDeltaStructs: TDADeltaStructList)

OnBeforeRegisterEventClient    (declared in TRORemoteDataModule)

Called when the new client is being registered to receive events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeRegisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeRegisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBeforeReleaseConnection    (declared in TDataAbstractService)

Fires just before the connection is released. Use this event to perform any finalization tasks on the new connection, such as closing a transaction, or setting connection options.

property OnBeforeReleaseConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnBeforeReleaseConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnBeforeUnregisterEventClient    (declared in TRORemoteDataModule)

Called when the client is being unsubscribed from events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeUnregisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeUnregisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBusinessProcessorAutoCreated    (declared in TDataAbstractService)

Fires whenever a new TDABusinessProcessor was auto-created to process deltas. You can use this event to perform additional configuration on the Business Processor before it will be used.

property OnBusinessProcessorAutoCreated: TDABusinessProcessorAutoCreatedEvent read write
delegate: procedure OnBusinessProcessorAutoCreated(aSender: TRORemoteDataModule; BusinessProcessor: TDABusinessProcessor)

OnDeactivate    (declared in TRORemoteDataModule)

Called after the service method completes and before the service instance is freed. Handle this event to perform actions on service destruction, such as disposing of resources.

property OnDeactivate: TDeactivateEvent read write
delegate: procedure OnDeactivate(const aClientID: TGUID; aSession: TROSession)

OnGetDispatchInfo    (declared in TRORemoteDataModule)

This event is fired before the invoker executes the service method. Handle this event to preview remote methods about to be executed; the input parameters allow to get all information about the upcoming call including the remote method parameters and the calling client transport object.

property OnGetDispatchInfo: TGetDispatchInfoEvent read write
delegate: procedure OnGetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

OnGetSchemaAsXMLEvent    (declared in TDataAbstractService)

Fires whenever a client retrieves the ServiceSchema. You can use this event to manually adjust or filter the Schema XML before it will be returned to the client.

property OnGetSchemaAsXMLEvent: TDAGetSchemaAsXMLEvent read write
delegate: procedure OnGetSchemaAsXMLEvent(aSender: TObject; var aSchemaXML: ROUTF8String)

OnLogin

Implements this event handler to provide the actual login procedure. Ideally this method should: *Validate the passed login credentials, *Create a new session if login is considered successful, *Fill the outgoing UserInfo class with any information that should be sent back to the client.
Skeleton code for the event handler will automatically be created for you if you select the Simple Login template when starting a new project.

property OnLogin: TSimpleLoginEvent read write
delegate: procedure OnLogin(Sender: TObject; aUserID: ROUTF8String; aPassword: ROUTF8String; out aUserInfo: UserInfo; var aLoginSuccessful: boolean)

OnLogout    (declared in TBaseLoginService)

Implement this event handler to provide the actual logout procedure.

property OnLogout: TNotifyEvent read write

OnProcessDeltasError    (declared in TDataAbstractService)

Fires if an error occurred while processing Deltas. Among other things, you can use this event to determine whether processing of the remaining Delta changes should continue, or if all changes should be rejected.

property OnProcessDeltasError: TDAProcessDeltasErrorEvent read write
delegate: procedure OnProcessDeltasError(aSender: TObject; aDeltaStructs: TDADeltaStructList; aError: Exception; var aDoRaise: boolean)

OnUnknownMacroVariable    (declared in TDataAbstractService)

Fires when unknown macro variable is found. it can be usable when user-defined variables are used inside sql or Dynamic Where expression.

property OnUnknownMacroVariable: TOnUnknownIdentifier read write
delegate: function OnUnknownMacroVariable(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnUnknownSqlMacroIdentifier    (declared in TDataAbstractService)

property OnUnknownSqlMacroIdentifier: TOnUnknownIdentifier read write
delegate: function OnUnknownSqlMacroIdentifier(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnUpdateDataBeginTransaction    (declared in TDataAbstractService)

Fires when a transaction will be started for processing a new set of deltas. You can handle this event to determine if the transaction should be started (default) or not.

property OnUpdateDataBeginTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataBeginTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnUpdateDataCommitTransaction    (declared in TDataAbstractService)

Fires when a transaction used for processing Deltas will be committed. You can handle this event to determine if the transaction should be committed (default) or not.

property OnUpdateDataCommitTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataCommitTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnUpdateDataRollBackTransaction    (declared in TDataAbstractService)

Fires when a transaction used for processing Deltas will be rolled back due to errors. You can handle this event to determine if the transaction should be rolled back (default) or not.

property OnUpdateDataRollBackTransaction: TDAUpdateDataTransactionEvent read write
delegate: procedure OnUpdateDataRollBackTransaction(Sender: TObject; var aUseDefaultTransactionLogic: Boolean)

OnValidateCommandExecution    (declared in TDataAbstractService)

Fires before a command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.

property OnValidateCommandExecution: TDASchemaElementAccessValidationEvent read write
delegate: procedure OnValidateCommandExecution(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of variant; aSchema: TDASchema; var Allowed: boolean)

OnValidateDatasetAccess    (declared in TDataAbstractService)

Fires before a data access retrieves data tables. You can use this event handler to do validation, for example to check if the current user is allowed to access the data table(s) in question, and raise an exception if the data access should be aborted.

property OnValidateDatasetAccess: TDASchemaElementAccessValidationEvent read write
delegate: procedure OnValidateDatasetAccess(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of variant; aSchema: TDASchema; var Allowed: boolean)

OnValidateDirectSQLAccess    (declared in TDataAbstractService)

Fires before a SQL command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.

property OnValidateDirectSQLAccess: TDASQLValidationEvent read write
delegate: procedure OnValidateDirectSQLAccess(Sender: TObject; const aConnection: IDAConnection; const aSQLText: string; const aParamNames: array of string; const aParamValues: array of variant; var Allowed: boolean)

OnValidateRoles    (declared in TRORemoteDataModule)

Validates roles.

property OnValidateRoles: TValidateRolesEvent read write
delegate: procedure OnValidateRoles(aRoles: array of string; var aAllow: Boolean)

See Also