SDK Reference

REST API

Introduction: Starting with September 2013, the PSG application server includes a new API for data integration with 3rd party applications, applications that do not use the PSG client interfaces. It is a REST API that implements basic CRUD operations based on JSON data encapsulation. The PSG REST API provides a single URI that acts as… (read more)

Localisation

The PSG platform can be used to build multi language applications. To facilitate this, a table with translations should be created and updated. From September 2013, PSG International toolkit includes a Google translate service utility, when you need a new language support just set it up and translate all text items automatically. Please check UTILS… (read more)

Using Transactions

Transaction commands are depending on the database server type. They can be implemented any time by using the SQLCON object to send commands to the server:   ** Sample as VFP script …   .sqlcon.sqlcommand = ‘BEGIN TRANSACTION’ .sqlcon.sqlexec()   .sqlcon.sqlcommand = ‘COMMIT’ .sqlcon.sqlexec()   .sqlcon.sqlcommand = ‘ROLLBACK’ .sqlcon.sqlexec()   Codes like the previous ones,… (read more)

The Users Collection

PSGUSERS  – the users collection – each user has a user object here  - server.psgusers   Methods: getuserprop(<username>,<property to return>)   Available properties of user object: active_usr returns .T. if the server accepts connections from this user computer returns the user computer name logintime returns the datetime of last login remoteIP returns the user remote IP,… (read more)

User Object

Properties: active_usr returns .T. if the server accepts connections from this user computer returns the user computer name logintime returns the datetime of last login remoteIP returns thee user remote IP, or the user router’s IP remotePort returns the user remote port or the user router’s port uid returns the user unique ID uname returns… (read more)

SQLCON Object

SQLCON is the connector to the database server. At the starting point, it is connected to the main database (server.main_connection). The connection can be changed to any database in your services code when required. Properties: cname result cursor name (if the result is a cursor) connectionstring ODBC connection string – each database server has a… (read more)

PSG Services

PSG services are dynamic implemented from defined PSG service scripts. The editor is found in the server configuration application in the ‘utils’ page. C#,VFP, JavaScript or VBScript can be used for services code. Received commands are interpreted by the connection object. Commands/requests are sent by the PSG client <command_name>#<parameter1>,<parameter2> Services rules: each service has at least… (read more)

Default PSG Services

Services that start with PSG, serve for system configuration, being mainly related to user management. The modules using them are provided as they are and it is recommended not to modify these services. All the major PSG services are presented here. Please check the PSG services editor to see the complete list. Services presented hereafter,… (read more)

Using Javascript or VBScript

JavaScript and VB-Script are implemented using Microsoft Script Control (MSScriptcontrol.scriptcontrol.1).  All accepted scripting languages can access the same server objects, the only difference being noticed in the approach. While VFP commands start with “PARAMETERS …” and end with “RETURN …”, for other scripting languages the parameters are being passed to an object array and the… (read more)

PSG Server

The client/server programming model is REST based on web services, named here “services” to avoid confusion with standard web services. For security reasons, the PSG services could be used only by a PSG client application. Secured bridges to other platforms can be built as requested. The PSG services engine is implemented into the PSG WEB… (read more)