WEBVUE
Manage the connections to WebVue clients.
WebVue support - Yes.
Mode |
Mnemonic |
Syntax |
1 | LIST | 1, 6 |
4 | CONNECTURL | 2 |
6 | USERNAME | 3 |
7 | WEBVUE_CONTEXT | 5 |
8 | MULTIMEDIA | 4 |
9 | CONTEXT | 3 |
10 | HYPERLINK | 7 |
With version 12 of PcVue, the following modes are no longer supported because they are no longer applicable:
-
SETWINDOW - Used to select the start-up window for the Web client.
-
RESTOREWINDOW - Used to restore the configuration of the initial mimic based on the profile configuration.
-
RESTOREURL - Used to provide the user name for connection to a Url address.
These modes were originally designed for integration of the legacy WebVue applet into 3rd party web portals. Such integration is now realized differently, based on the REST API.
The following modes are deprecated and replacement instructions are available. They are still supported at runtime for compatibility but will be removed in a later version:
-
CONNECTURL - Select the start window of the Web client.
It is replaced by the instruction WEBVUE("HYPERLINK"). -
USERNAME - Get the name of the user that started the WebVue session.
It is replaced by the instruction SYSTEM("USER"). -
WEBVUE_CONTEXT - Return the context in which the program is executed.
It is replaced by the instruction SESSION("GETTYPE"). -
CONTEXT - Return the name of the context variable when the program is run from a context window.
It is replaced by the system variable @SYSTEM.CONTEXT.NAME.
Syntax 1
IntVal = WEBVUE(Mode, Handle);
Return type: INTEGER.
Argument |
Meaning |
Handle |
Identifies the list of user-station pairs of connected web client. Type LONG. The list's format is: Username1,, Username2,, ... The second field used to include information about the client host name, IP address and router address. Starting with version 12, it is always empty. |
Execution
Mode |
Mnemonic |
Action |
1 |
LIST |
Retrieve the list of web client sessions. Return: Number of connected clients, or -1 if the allocation for Handle is not large enough. See ALLOC_BUFFER. |
Syntax 2
IntVal = WEBVUE(Mode, UserName, HtmlPage , BitVariableName, Reconnect, NewBrowser);
Return type: INTEGER.
Argument |
Meaning |
UserName |
Leave empty (""). Type STR. |
HtmlPage |
The Url of the web page where to redirect the web client upon connection under the form "https://...". Type STR. |
BitVariableName |
A database BIT variable that is set to 1 when the connection is made. Type STR. |
Reconnect |
After disconnection: a delay before reconnection is attempted. Type INTEGER. 0: Re-connect immediately. |
NewBrowser |
Whether to open a new web browser instance or not. Type INTEGER. 0: New tab in the current web browser instance. |
Execution
Mode |
Mnemonic |
Action |
4 |
CONNECTURL |
This mode is deprecated, use WEBVUE("HYPERLINK") instead. Select the start window of the Web client. Return: 1 if successful, else 0 (variable cannot be found or incorrect type). |
If the Url does not start with the protocol (http:// or https://), then it is considered relative by the web browser and it will redirect to the web resource relative to the /WebClient virtual directory on the WebVue web server.
Syntax 3
IntVal = WEBVUE(Mode, WebSession, UserHandle);
Return type: INTEGER.
Argument |
Meaning |
WebSession |
Web session type. Type INTEGER. For details, see GETARG mode 29: WEB. |
UserHandle |
The handle of a buffer in which the result of the instruction is returned. Type LONG. |
Execution
Mode |
Mnemonic |
Action |
6 |
USERNAME |
This mode is deprecated, use SYSTEM("USER") instead. Get the name of the user that started the WebVue session. Return: 0 if successful, else: -1: WebSessionis not an INTEGER. -2: WebSession is empty. -3: UserHandle is not a LONG. -4: UserHandle has a size of 0 (i.e. no buffer was allocated). -5: UserHandle is empty. Normally this is impossible. -6: UserHandle's length is larger than the size allocated by ALLOC_BUFFER. |
9 | CONTEXT |
This mode is deprecated, use the system variable @SYSTEM.CONTEXT.NAME instead. Get the name of the context variable when the program is run from a context window. Return: 1 if successful, else 0. |
Both modes return a null string in the buffer when run from the PcVue desktop client. You can get a list of active WebVue sessions by using mode 1 (LIST).
Syntax 4
IntVal = WEBVUE(Mode, Sub-mode);
Return type: INTEGER.
Argument |
Meaning |
Sub-mode |
The sub-mode. Type STR.
|
Execution
Mode |
Mnemonic |
Action |
8 |
MULTIMEDIA |
Play a multimedia file on the WebVue client device. Return: 1 if successful, else 0. |
The operation of mode MULTIMEDIA sub-mode BEEP depends on the context of execution of the caller program
-
The audio file is played on all current WebVue clients if the caller program IS NOT a web context; for example if the caller program is running on the Web back end server, triggered by an event on a variable of scope Shared.
-
If the caller program is executed in the context of a particular WebVue session, then the audio file is played only on this web client; for example, if the program is triggered by a click on a button in a mimic displayed at the web client.
The ability of a WebVue client to play a multimedia file depends on the setting of the property Allow multimedia operation in the profile of the User that started the WebVue session. See the topic Adding a WebVue User in the main help.
It is not possible to configure the sound file played by mode MULTIMEDIA, sub-mode BEEP. However, it is possible to change the sound file manually.
The sound file played is called beep.wav and is located in the following folder:
<Installation folder>\usr\<MyProject>\WEB\audios\beep.wav
Changing the sound played by WEBVUE
Syntax 5
IntVal = WEBVUE(Mode);
Return type: INTEGER.
Execution
Mode |
Mnemonic |
Action |
7 |
WEBVUE_CONTEXT |
This mode is deprecated, use SESSION("GETTYPE") instead. Return the context in which the program was executed. Return: 0 when the program is executed in the context of the PcVue desktop client, else !=0 when executed on a web client. |
Syntax 6
IntVal = WEBVUE(Mode);
Return type: is INTEGER.
Execution
Mode |
Mnemonic |
Action |
1 |
LIST |
Retrieve the list of web client sessions in an XML fragment. This information includes:
For more information, see the example below and XMLPATH. |
Syntax 7
IntVal = WEBVUE(Mode, Url, NewTab);
Return type: is INTEGER.
Argument |
Meaning |
Url |
A Url under the form "https://...". Type STR. |
NewTab |
Whether to open a new tab in the web browser or not. Type INTEGER. 0: Open in the current tab of the web browser. |
Execution
Mode |
Mnemonic |
Action |
10 |
HYPERLINK |
Redirect the calling web client to the web page defined by Url. Return: 1 if successful, else 0. |
If the Url does not start with the protocol (http:// or https://), then it is considered relative by the web browser and it will open the web resource relative to the /WebClient virtual directory of the WebVue web server.
Example
For an example, select the Example link above.