LoginFunctions
This object is returned after a successful login
to the server. Use the following methods for this object to retrieve information regarding the Priority installation and API.
Methods
Name | Description |
---|---|
apiVersion |
Returns the current version of the Web SDK API. |
companies |
Returns information on available companies and user profiles. |
languages |
Returns information on available system languages. |
constants |
Returns information on system constants currently in effect. |
entMessages |
Used to retrieve messages for a specific Priority entity. |
priorityVersion |
Returns the current version of Priority installed on the server. |
isUserConsent |
Checks whether the user has provided consent for personal data stored by the system (to address GDPR regulations). |
apiVersion()
This method can only be run on the LoginFunctions
object, which is returned after a successful login
.
This method returns a string with the current version of the Web SDK API supported on the server. Version numbering is divided into MAJOR.MINOR.PATCH, e.g. 3.0.13.
Param | Type | Description |
---|---|---|
version | string |
Version number of the Web SDK API on the server. |
companies()
This method can only be run on the LoginFunctions
object, which is returned after a successful login
.
This method returns an array Company which provides information on the available companies and user profiles for each one.
Company: array
Properties
Param | Type | Description |
---|---|---|
dname | string |
Internal (short) name of the company. |
title | string |
Full company name. |
color | array |
Color[] array containing the RGB values of the company color. |
EnvProfile | array |
EnvProfile[] array that contains the usage profiles configured for this company. |
EnvProfile: array
Properties
Param | Type | Description |
---|---|---|
profilename | string |
The profile name. |
profile | number |
The profile ID number. |
languages())
This method can only be run on the LoginFunctions
object, which is returned after a successful login
.
This method returns an array of type language which provides information on the available languages you can work with.
Language: array type
Properties
Param | Type | Description |
---|---|---|
lang | number |
Language code number. |
langtitle | string |
Language description e.g. “Australian English”. |
constants()
This method can only be run on the LoginFunctions
object, which is returned after a successful login
.
Results in an object with properties that describe various system constants currently in effect, e.g. decimalsign which determines the decimal sign.
entMessages(ename, type, from, to)
This method can only be run on the LoginFunctions
object, which is returned after a successful login
.
Use this method to retrieve messages from a specified Priority entity, returned as an array Message. This is useful in apps catering to multiple languages, as the returned message will be in the language specified when logging in (assuming the message has a translation recorded on the server).
Param | Type | Description |
---|---|---|
ename | string |
Entity name. |
type | string |
Type of entity. Available types are C - compiled program or P - procedure. |
from | number |
Retrieve messages starting with this message number. |
to | number |
Retrieve messages up to this message number. |
Returns: Promise
Fulfill: object with entMessages array
Reject: ServerResponse
entMessages: array of objects
Properties
Param | Type | Description |
---|---|---|
message | string |
Message text. |
num | number |
Message number. |
priorityVersion()
This method can only be run on the LoginFunctions
object, which is returned after a successful login
.
This method returns the current version of Priority installed on the server.
Param | Type | Description |
---|---|---|
version | string |
Priority version number. |
isUserConsent()
This method can only be run on the LoginFunctions
object, which is returned after a successful login
. Use it to check whether the user has approved a new personal data consent policy.
Properties
Name | Type | Description |
---|---|---|
userConsent | number | Shows whether the user has provided consent for the latest personal data consent policy. 1: User has approved the latest version. 0: User has yet to provide consent to the latest version of the policy. |
marketgateUrl | string | URL component used to construct URL to access the consent interface. Only provided if userConsent is 0. |
Checking User Consents
After a successful login, check the userConsent property of the LoginFunctions
object. If the value is 1 (consent has been given), login can proceed as usual. If the value is 0, the user has not yet provided consent, and the consent interface should be called.
To call the consent interface, you must construct a URL based on the following instructions, and open it within a frame.
URL Structure
mg + "?" + "WWWUSERCONSENTS" + "&_tabulaini=" + TABULAINI + "&_uselang=" + LANGUAGE + "&_portal=1" + "&_html5=1";
Where:
- mg is the value of the marketgateUrl property of the
LoginFunctions
object. - TABULAINI is the tabula.ini file name used during
login
. - LANGUAGE is the language code used during
login
.
Once the consent interface has been opened, call isUserConsent repeatedly (every second) to check whether the user has provided consent. If the returned value is 1, consent has been provided, and login can proceed as usual.