DSTP Protocol

DSTP (Dictionary Server Transfer Protocol) is a protocol that the dictionary components and Language Manager use to communicate with Dictionary Server.

Message format

Client sends a  message. The server sends a reply back to the client. The messages are strings. Each message has a message name part and the data part.

command<s>data<end>

where

Parameter Type Description
command string The message command
data string The message data
<s> = Char(127)
<end> = Char(0)

Reply message format

The server sends a reply message back to the client. The reply message contains the result code and the reply data. The reply data is separated from the result code with the space character.

resultCode[<s>data]<end>

where

Parameter Type Description
resultcode integer The result code of the message
data string The result data
<s> = Char(127)
<end> = Char(0)

If the data or reply data contains several fields, each field is separated by the Char(127) character.

field1<s>field2<s>field3

where

<s> = Char(127)

Character sets

DSTP uses UTF-8 character coding. UTF-8 is backward compatible to ASCII characters.

Messages

DSTP contains basic and edit messages. The basic messages are used by the dictionary components. They are required to make is possible to an application to get the dictionary data from the server. The basic messages are:

Message Description
LOGIN Logs in to the server
LOGOUT Logs out from the server
OPEN Opens the dictionary
CLOSE Closes the dictionary
TRANSLATE Translates one or more strings.
CONTEXT Translates one or more context sensitive strings.
GET Gets data from the dictionary or information from the server.
SET Sets dictionary or server data.

The edit messages are used to edit the dictionary and to change the settings of the server. Language Manager uses these messages. The edit messages are:

Message Description
ADD Adds a user to the server.
RENAME Renames a dictionary.
DELETE Deletes a dictionary or a user.
EDIT Sets the dictionary to the editing state.
UPDATE Adds a language, translation or locale to the editing dictionary.
POST Posts the changes made to the editing dictionary.
CANCEL Cancels the changes made to the editing dictionary.

Result codes

DSTP uses the following result codes:

Name Value Description
OK 0 The operation was successful.
READ_ONLY 1  
ERROR 2  
NOT_FOUND 3  
INVALID_DATA 4  
ACCESS_ERROR 5  
TOO_MANY_CONNECTIONS 6  
NOT_ENOUGH_MEMORY 7  
LOCKED 8  
ALREADY_EXISTS 9  
EXPIRED 10  
INVALID_PARAMETER 11  
NOT_SUPPORTED 12  
INVALID_COMMAND 13  
NVALID_VERSION 14  
INVALID_LOCALE_CODING 15  
TIMEOUT 16