Writing Relativity Clients

From RemObjects Wiki

Jump to:navigation, search

This is a HowTo topic about Data Abstract
Feel free to add your notes to this topic below.

Contents

Overview

Client applications for Relativity server are very similar to ordinal DataAbstract application. The only two specific features used by Relativity client applications are LoginEx (unified Login service interface) and Schema dynamic selection.


LoginEx feature

Because login to Relativity server requires the specification of a Domain (and optionally, a Schema) in addition to username and password, Relativity uses the LoginEx infrastructure that was introduced in Summer 2009 release of DataAbstract. LoginEx itself is not specific for Relativity server - any DataAbstract server using the standard LoginService supports it, and any client application can use it.

Rather than passing individual parameters, LoginEx provides common Login service interface based on connection string that can , in addition to username and password, take an arbitrary number of parameters required by the server. For Relativity, these are Domain and (optionally) Schema. The format of the connection string is quite straightforward – it is several key-value pairs separated by ';' symbol.

Because LoginEx is part of the base LoginService infrastructure, there is no need to import the server's LoginService RODL and create _Intf files, as would be the case with a custom Login method.

Login call using LoginEx looks like this:

.NET

(new RemObjects.DataAbstract.Server.BaseLoginService_Proxy(message, clientChannel, "LoginService"))
  .LoginEx("User=UserName;Password=UserPassword;Domain=DomainName;Schema=SchemaName");

Delphi

DynamicRequest.ParamByName('aLoginString').AsString := 'User Id=UserName;Password=UserPassword;Domain=DomainName;Schema=SchemaName';
DynamicRequest.Execute();

Dynamic Request setup:

lRemoteService := TRORemoteService.Create(nil);
lRemoteService.Channel := self.Channel;
lRemoteService.Message := self.Message;
lRemoteService.ServiceName :='LoginService';

lDynamicRequest := TRODynamicRequest.Create(nil);
lDynamicRequest.RemoteService := lRemoteService;
lDynamicRequest.MethodName := 'LoginEx';

lDynamicRequest.Params.Add('Result', rtBoolean, fResult);
lDynamicRequest.Params.Add('aLoginString', rtUTF8String, fIn);

Xcode

[remoteDataAdapter loginWithString:@"User=UserName;Password=UserPassword;Domain=DomainName;Schema=SchemaName"];

For Delphi and .NET, the proxy is created for BaseLoginService (ancestor of all DataAbstract Login services) and "LoginEx" method of service named "LoginService" is called. For Xcode, the DARemoteDataAdapter class provides login functionality out of the box, via the loginWithString message, for LoginEx.

Dynamic Schema Selection

Using LoginEx feature you can connect to a specific Domain and use one Schema in this Domain.

Relativity Server provides a second mechanism to select the schema that requests will be run against, without calling LoginEx a second time: by including the name of the desired schema in the Service Name. By default name of the service for Relativity, as for most DA servers, is DataService and default Schema (ot the one that is selected in LoginEx string) will be used. But if you change service name to DataService.{SCHEMA NAME} (for example DataService.SomeOtherSchema) data will be retrieved from the schema named SomeOtherSchema.

Navigation
products
platforms
special
Toolbox