Web operator environment


Besides the ordinary operator environment in X windows, ProviewR also contains an operator
environment written in HTML5 and javascript. The environment is runnable in most webbrowsers on
phones, tablets and PCs.

The interface consists of three parts
- an operator window opened in the web browser.
- a server process that serves the operator window with information via a web socket.
- a directory where files are available for the web.

Operator window

The operator window displays a menu to the left and a start page to the right.


Fig Web operator window

The operator window is configured with an OpPlaceWeb object in the node hierarchy.

The menu is divided in three sections. The first contains a number of standard functions
- language selection.
- login and logout.
- open alarm and event list.
- open event log.
- open runtime navigator.
- link to project help texts.
- link to ProviewR documentation.

These buttons can be enabled or disabled with the Enable/Disable attributes in the
OpPlaceWeb object.

The second section contains buttons to open graphs configured with WebGraph objects. The
WebGraph objects is placed as children to the OpPlaceWeb object and contains the name of
the Ge graph pwg-file.

The third section contains links defined with WebLink objects. The WebLink objects contains
an URL and is positions below the OpPlaceWeb object.

The right page will by default contain the help text for the project, written in the file
$pwrp_cnf/xtt_help.dat. If another page is prefered, this can be stated in the StartURL
attribute.

There can be serveral OpPlaceWeb objects in one node, configuring web pages with different
settings. The OpPlaceWeb objects should have different filenames stated in the FileName
attribute, and can be opened with an URL to the specified file. The default file is index.html
for the first OpPlaceWeb object, and index2.html, index3.html etc, for the preceeding
OpPlaceWeb objects.

The opplace with the FileName index.html can be opened with the URL

http://'hostname'/pwrp_web/index.html


Fig Web operator configuration

Server process

The server process is configured with a WebSocketServer object in the node hierarchy. The
server is a java process and requires that java is installed. The server listens for
requests from operator windows to open a web socket, and supplies information about the
realtime database to the operator window.

Alarm and event list

The alarm and event list requires that the EventSelectList in the WebSocketServer object is
filled in with hierarchies from which alarms and events should be displayed.

Web directory

The operator window requires a number of files, and these are gathered on the web directory,
pwrp_web. This directory is exposed by the web server and available from the web.

Here are some files that should be present on the directory

- pwg files for Ge graphs, used in WebGraph objects. Should be copied from $pwrp_pop.
- pwg files for object graphs, can be copied from $pwr_exe.
- flw files for plc trace, shoud be copied from $pwrp_load.
- crossreference files, rtt_crr*.dat should be copied from $pwrp_load.
- xtt help text html files. These are generated when the node is built.
- documentation of local classes are generated when the class volume is built.
- All files on $pwr_web are copied to $pwrp_web at installation of the pwrrt package.

Some files are generated or copied at installation, but some have to be copied manually or
preferably automatically by creating Build objects in the directory volume.
In the example below there are BuildCopy objects configured to copy

- pwg files from $pwrp_pop.
- flw files from $pwrp_load.
- crossreference files from $pwrp_load.


Fig Directory pwrp_web build configuration

Help texts

The help texts for the project in the file xtt_help.dat, is exported to html files on
$pwrp_web by the build method of the OpPlaceWeb object. The start page for the help texts are
$pwrp_web/xtt_help_index.html. This is showed as default in the right frame of the home page
if no other URL is stated in the StartURL attribute of the OpPlaceWeb.

If the helptext contains image tags, the png or gif files have to be copied to $pwrp_web.

Distribution

The files on $pwrp_web should be part of the distribution package, and distributed to
$pwrp_web on the process or operator station. This is done by setting WebFiles in the
Distribution object under the NodeConfig object in the directory volume.

Web server configuration

The pwrp_web directory has to be avaiable from the web, and inserted in the web server
configuration. For nginx and apache this is done at installation of the pwrrt package, but
if you want to view a project on a development station this has to be done manually. Hhere are
some examples.

nginx
Add these lines in /etc/nginx/sites-enabled/default (replace /pwrp/common/web/ with
the real location of $pwrp_web)

location /pwrp_web/ {
   alias /pwrp/common/web/;
}

apache
Add these lines in /etc/apache2/apache2.conf (replace /pwrp/common/web/ with
the real location of $pwrp_web)

Alias /pwrp_web/ /pwrp/common/web/


     AllowOverride None
     Require all granted



Security

If the login frame is enabled, a user can login with a valid username and password, and gain
the privileges granted for the logged in user. Valid users are members or the system group
specified in WebSystemGroup in the Security object.

In the example below, the system group 'Common' is used that contains the ordinary users
pwrp, system etc, but you are recommended to create a specific system group with special
users for the web.

For not logged in users, the privileges are determined by DefaultWebPriv in the Security
object. It is recommended that DefaultWebPriv is RtRead or zero (no privileges). Users that
have no privileges can only open the login frame.


Fig Security configuration