Server

Server

This class provides the facilities used to communicate with the back-end.

Constructor

new Server()

Source:

Methods

(async, static) binaryCall(cls, meth, injson) → {Promise.<unknown>}

Source:
See:
Perform a binary call. JSON is sent and JSON is returned. However, a new element will be in the returned json called '_data'. _data will contain the binary data. This method is often used to retrieve images. The back-end service should call servlet.returnBinary()
Parameters:
Name Type Default Description
cls
meth
injson null
Returns:
Type
Promise.<unknown>

(async, static) call(cls, meth, injson)

Source:
Evoke a back-end REST service.

This function is typically called with an await or a then in order to process the result.
Parameters:
Name Type Default Description
cls string the web service to be called
meth string the web method
injson object null data to be passed to the back-end
Returns:
data returned from the back-end

(static) callAll()

Source:
Used to call a number of simultaneous web services and wait till they're all done before processing any of their results.

This function takes a variable number of arguments.

The first argument is an array of the Promises from each web service call.

Each remaining argument is a function that gets the result from the positionally corresponding promise in the first argument. If any are null there is no function executed for that returned promise. Each function that gets executed gets passed the return value of the associated web service.

You can wait for this function to complete asynchronously by calling it with an await.

The return value is false if all the web services complete and true if there is an error.

(static) fileUploadSend(cls, meth, fd, injson, waitMsg, successMessage)

Source:
See:
Send the file upload to the server. This method displays a wait message and a final status message.

fd can either be form data or it can be the ID of the file upload control.
Parameters:
Name Type Default Description
cls string
meth string
fd FormData | string ctl-id, FormData, FileList, or array of FileList
injson object null
waitMsg string optional wait message
successMessage string optional success message

(static) logout()

Source:
Removes the user association between the back-end and front-end.

(static) setMaxInactivityHours(hours)

Source:
Set the maximum number of hours between calls or zero for no max. If the maximum number of hours is exceeded, the user will be logged out on their next attempt to make a service call.
Parameters:
Name Type Description
hours

(static) setMaxInactivityMinutes(minutes)

Source:
Set the maximum number of minutes between calls or zero for no max. If the maximum number of minutes is exceeded, the user will be logged out on their next attempt to make a service call.
Parameters:
Name Type Description
minutes

(static) setMaxInactivitySeconds(seconds)

Source:
Set the maximum number of seconds between calls or zero for no max. If the maximum number of seconds is exceeded, the user will be logged out on their next attempt to make a service call.
Parameters:
Name Type Description
seconds

(static) setURL(url)

Source:
Set the URL of the back-end.
Parameters:
Name Type Description
url string