Table of Contents

TXDataServerModule Class

The XData server module: answers the REST API requests addressed to its base URL, using Aurelius to read and write the entities of an XData model.

Remarks

Create a module, add it to a Sparkle dispatcher, and the API is published. It provides the automatic CRUD endpoints for the entity sets it is given permission to, and the endpoints of the service operations found in the model. The module needs a connection pool to reach the database. Pass one to the constructor, or pass a single connection and let the module build a pool of one connection around it. Settings such as TXDataBaseModule.PutMode or TXDataBaseModule.DefaultExpandLevel are inherited from XData.Module.Base.TXDataBaseModule and apply to every request, while Events gives access to the server-side events. The XData.Comp.Server.TXDataServer component creates and configures a module of this class from its design-time settings, so a component-based server does not need to instantiate one directly.

Syntax

Unit: XData.Server.Module

TXDataServerModule = class(TXDataBaseModule);

Constructors

Methods

Name Description
AddServiceImplementation Registers a class that implements one or more service operation interfaces.
HasEndpoint Checks whether an automatic CRUD endpoint is published for an entity set.

Properties

Name Description
ConnectionPool Gets the connection pool the module acquires database connections from.
Events Gets the container of the server-side events of this module.
OnGetAbsoluteUrl Occurs when the module builds an absolute URL for a resource, allowing the URL to be replaced.
RedocOptions Gets the options of the Redoc interface published by the module.
SwaggerOptions Gets the options of the OpenAPI (Swagger) document generated by the module.
SwaggerUIOptions Gets the options of the Swagger UI interface published by the module.
XModel Gets the Aurelius-based model published by this module.