Class WFAPI
Object
|
+--WFAPI
- class
WFAPI
Defined in wflogin.js
Field Summary |
WFAPI.Application[]|undefined |
Applications
Array of applications. |
string|undefined |
AppListCustomTitleText
The title text for the list of applications. |
number|boolean |
AppParametersVisible
Whether the runtime parameters input should be visible or hidden
for all applications. |
number|boolean |
AppWorkingDirVisible
Whether the working directory input should be visible or hidden
for all applications. |
number|boolean |
ButtonRunInActiveXVisible
Whether the button to run an application in a deprecated
ActiveX client should be visible or hidden for all applications. |
number|boolean |
ButtonRunInBrowserVisible
Whether the button to run an application in a web-based
client should be visible or hidden for all applications. |
number|boolean |
ButtonRunVisible
Whether the button to run an application in a native
client should be visible or hidden for all applications. |
number|boolean |
ButtonSetClientOptionsVisible
Whether the button to set the user's options for all clients
should be visible or hidden. |
number|boolean |
ButtonUpdateClientVisible
Whether the button to update the native client should be visible
or hidden. |
number |
LoginPageTimeout
Time (milliseconds from now) when the current session expires
and the user must log in again. |
function(?number, ?string, ?string) |
onerror
User's callback function to be called if an error occurs. |
function(number) |
onprogress
User's callback function to display a progress feedback. |
string |
WFLCheckActiveXVer
Current version of an ActiveX checking the presence of a native
client. |
string |
WFLClientActiveXVer
Current version of a deprecated ActiveX client. |
Constructor Summary |
WFAPI()
Winflector public API constructor.
|
Method Summary |
void
|
getApps(<loginTokenCallback> callback)
Retrieves the application list.
|
String
|
getLogin()
Returns the current login name (login identifier).
|
void
|
logout(<function()=> callback)
Logs out the current user and finishes the current session.
|
void
|
sendLogin(<string> login_val, <string> password_val, <string=> domain_val, <loginTokenCallback> ltoken_fun)
Sends login action to the server.
|
<static> WFAPI
|
getInstance()
Winflector public API singleton accessor.
|
Applications
WFAPI.Application[]|undefined Applications
Array of applications. You should not change the contents
of this array. It should be initialized by getApps().
AppListCustomTitleText
string|undefined AppListCustomTitleText
The title text for the list of applications. This text can be
set on the server by an administrator or it can be a default
predefined text. You can use it in a header of the list of
applications.
This field is initialized by getApps(). You should not
change its value.
AppParametersVisible
number|boolean AppParametersVisible
Whether the runtime parameters input should be visible or hidden
for all applications. This value can be set on the server by
an administrator. This field can contain a boolean value or
a number which can be automatically converted to boolean.
This field is initialized by getApps(). You should not
change its value.
AppWorkingDirVisible
number|boolean AppWorkingDirVisible
Whether the working directory input should be visible or hidden
for all applications. This value can be set on the server by
an administrator. This field can contain a boolean value or
a number which can be automatically converted to boolean.
This field is initialized by getApps(). You should not
change its value.
ButtonRunInActiveXVisible
number|boolean ButtonRunInActiveXVisible
Whether the button to run an application in a deprecated
ActiveX client should be visible or hidden for all applications.
This value can be set on the server by an administrator but it
also depends on whether the ActiveX client is supported by the
server and the client. This field can contain a boolean value or
a number which can be automatically converted to boolean.
This field is initialized by getApps(). You should not
change its value.
ButtonRunInBrowserVisible
number|boolean ButtonRunInBrowserVisible
Whether the button to run an application in a web-based
client should be visible or hidden for all applications.
This value can be set on the server by an administrator but it
also depends on whether the web-based client is supported by the
server and the client. This field can contain a boolean value or
a number which can be automatically converted to boolean.
This field is initialized by getApps(). You should not
change its value.
ButtonRunVisible
number|boolean ButtonRunVisible
Whether the button to run an application in a native
client should be visible or hidden for all applications.
This value can be set on the server by an administrator but it
also depends on whether the native client is available for
the client platform. This field can contain a boolean value or
a number which can be automatically converted to boolean.
This field is initialized by getApps(). You should not
change its value.
ButtonSetClientOptionsVisible
number|boolean ButtonSetClientOptionsVisible
Whether the button to set the user's options for all clients
should be visible or hidden.
This value can be set on the server by an administrator.
This field can contain a boolean value or
a number which can be automatically converted to boolean.
This field is initialized by getApps(). You should not
change its value.
ButtonUpdateClientVisible
number|boolean ButtonUpdateClientVisible
Whether the button to update the native client should be visible
or hidden.
This value can be set on the server by an administrator but it
also depends on whether the native client is available for
the client platform. This field can contain a boolean value or
a number which can be automatically converted to boolean.
This field is initialized by getApps(). You should not
change its value.
LoginPageTimeout
number LoginPageTimeout
Time (milliseconds from now) when the current session expires
and the user must log in again.
This field is initialized by getApps(). You should not
change its value.
onerror
function(?number, ?string, ?string) onerror
User's callback function to be called if an error occurs.
You should provide a callback here which should be a function
accepting three parameters: an error number, a title of the message
box, and a body (detailed text) of the message box.
The error number is useful to easily distinguish errors without
parsing the error message and provide different ways to handle
the problem, for example redirect to the login page if login
is required. If you don't provide your own callback or provide
an incorrect value here then WFAPI calls its own internal
implementation which displays a default alert box.
onprogress
function(number) onprogress
User's callback function to display a progress feedback.
You can provide a callback here which should be a function
accepting one parameter: a number being the current progress
value, in percent between 0 and 100. The parameter may be
a fractional number, usually will start from 0 and will not
reach 100 because 100 means the operation has finished and
the progress display should be hidden rather than showing 100.
If you don't provide your own callback or provide an incorrect
value then WFAPI does not use it.
This callback is currently called from getApps(). Other
methods are fast enough and don't need it.
WFLCheckActiveXVer
string WFLCheckActiveXVer
Current version of an ActiveX checking the presence of a native
client. The ActiveX is not always available and not always
needed, also may be disabled by a server administrator. This
field may be an empty string or missing. If present, it should
be used to load the ActiveX.
This field is initialized by getApps(). You should not
change its value.
WFLClientActiveXVer
string WFLClientActiveXVer
Current version of a deprecated ActiveX client. The ActiveX
client is not always available, also may be disabled by
a server administrator. This field may be an empty string or
missing. If present, it can be used to start the ActiveX client.
This field is initialized by getApps(). You should not
change its value.
WFAPI
WFAPI()
Winflector public API constructor. This constructor
should not be used, use getInstance() instead.
This is the singleton pattern implementation.
getApps
void getApps(<loginTokenCallback> callback)
Retrieves the application list. This method requires this object
to be successfully logged in, preferably in a callback to sendLogin()
method. This method is asynchronous: it should be assumed that it
will finish almost immediately but the callback will be called only
when the list of applications is delivered back from the server
to the web browser. Note that the WFAPI object can serialize and
deserialize itself automatically. It must be logged in
before calling this method but it may happen that it will be logged
in on a different page. The encryption algorithms may be required but
not loaded on the current web page. Therefore this method first loads
the encryption algorithms if needed. It may require multiple roundtrips
to the server. Also on some older web browsers processing the
application list locally (decrypting) may take long time, up to
several seconds.
Parameters:
callback
- The callback to be called on success, it will receive this object as its only parameter.
getLogin
String getLogin()
Returns the current login name (login identifier). May return undefined
if a user is not logged in.
logout
void logout(<function()=> callback)
Logs out the current user and finishes the current session. Calling
this method may be considered optional because the server will eventually
close the inactive sessions but it is strongly
recommended to call it at the end of the session because it saves
the server-side resources. This method never fails, even unsuccessful
attempts to log out are considered successful because we should not
force the user to wait for the successful logout in case of the
network failure. Also it may be considered possible that the logout
request has arrived to the server but the acknowledgement has not.
This method clears all internal session data and the user should
either stop using this WFAPI object or log in again.
Parameters:
callback
- An optional callback to be called when the logout action finishes successfully, or if it is successful but the implementation gives up.
sendLogin
void sendLogin(<string> login_val, <string> password_val, <string=> domain_val, <loginTokenCallback> ltoken_fun)
Sends login action to the server. This method first ensures that the
encryption algorithms (implementation scripts) and keys are downloaded
from the server, initializes the communication, and sends the login
credentials. No additional actions are required, this is the first
method to be called after getInstance(). This method requires
multiple roundtrips to the server and therefore it is asynchronous:
it should be expected that it will be finished almost immediately but
the callback will be called only if all required data are downloaded.
Parameters:
login_val
- The user's login name.
password_val
- The user's password.
domain_val
- The user's Windows domain to log in; should be null or an empty string if domain login is not used.
ltoken_fun
- callback to be called on success
getInstance
<static> WFAPI getInstance()
Winflector public API singleton accessor. This is the only valid way
to create and use WFAPI object. Before using other methods
sendLogin() must be called. Note that thanks to the automatic
serialization and deserialization it can be called on another page inside
the same web browser session.
Returns:
the single instance of this class
Documentation generated by
JSDoc on Thu Dec 1 15:54:46 2016