Promotic
WikipediaLinkedInYoutubeTwitterFacebook

FindViewers - method of object Pm

Description:
The method allows to obtain a list of object viewers according to selected criteria. The list is especially suitable for displaying as a menu via the SelectionDialog method. Allows to comfortably create user menus with variable and versatile content. The menus can be of a global character with a list of all available objects in the application and/or the menus can be oriented only to a part of the application (technology) when using the logical groups.
Syntax:
FindViewers(sFilter As String, sExpression As String, sParams As String) As Array
Calling:
data = Pm.FindViewers(sFilter, sExpression, sParams)
Parameters:
sFilter(String) Allows to filter the objects and their viewers. For example "groups:menu;viewers:panel,alarm_state,alarm_history;viewertype:0;". The preset value is "viewers:all;viewertype:0;"
groups - Filtering according to the viewer (object) logical group. For example "groups:menu;".
viewers (optional) - Filtering according to the viewer types. For example "viewers:panel,alarm_state,alarm_history;".
all (default) - Any viewer.
workspace - The PmWorkspace object viewer with workspace.
panel - PmPanel object viewer with user graphics.
report - PmReport object wiever with print reports.
alarm_state - PmAlarmEvent object viewer - alarm states.
alarm_history - PmAlarmEvent object viewer - alarm history.
event - PmAlarmEvent object viewer - event history.
viewertype (optional) - The filter type based on the fact whether the wiever is designed for local application or for the WEB. If not defined, then it is configured automatically, based on the fact whether the method is called in the local application or on the WEB - therefore normally, it is not necessary to define this.
1 - Only viewers designed for the local application.

So far it is not possible to define that some viewers (e.g. in the PmPanel objects) are not available for the local usage and therefore this option will not filter anythig.

2 - Only viewers designed for the WEB.

In the output list, only viewers enabled for WEB sharing, will be displayed. The default way for enabling the object (e.g. PmPanel) for the WEB is by the Enable as WEB component configurator on the Web Server page.

sExpression(String) Reserved, must contain an empty string ("").
sParams(String) Defines the format of output data. For example "headers:title;columns:path,title;lang:cs;". The preset value is "headers:title;columns:path,title;"
headers (optional) - Defines whether the output list will contain (on the first row) also the localised column names while being viewed.
title (default) - The first row of the output list will contain the localised column names while being viewed.
columns (optional) - Column identifier list of the output list (the separator is comma ',').
path (default) - Full path to the object viewer (with posible extra details, for example #state, allowing to open the viewer by the Object viewer open method). This column is always stated first for the purpose of displying itself by the SelectionDialog method and it is invisible when displaying the menu. The next colmns are then visible in the menu.
title (default) - The localized text connected with the viewer of the (Title) object found, to be listed in the menu.
alstate3 - The number of alarms in the active unacknowledged (red) state in the alarm group.
alstate2 - The number of alarms in the active acknowledged (yellow) state in the alarm group.
alstate1 - The number of alarms in the inactive unacknowledged (blue) state in the alarm group.
alhoot - The number of beeping alarms in the alarm group.
lang (optional) - Defines the language ti be used for evaluated localised texts. Language is determined with a text identifier, e.g. "en", "de", "ru" etc. - see Fully supported languages in the PROMOTIC system. If not defined, the language currently used in the viewer will be used - this entry does not need to be defined by default. See the configurator "PmRoot > Application > Main language of runtime".
Return Values:
The result is represented by 2-dimensional array, where one row represents each object viewer found.
Note:
The rows represent each object viewer found according to the filtering criteria. The columns are defined by the columns item in the sParams parameter.

The basic format of the output list is as follows: the first column contains a full path to the found object viewer (with posible extra details, for example #state, allowing to open the viewer by the Object viewer open method) and in the second column, there is a locatized text connected with corresponding object viewer (to be displayed in the menu). It corresponds with the setting of "columns:path,title;", which is the default value of this item. The first row will contain the localized header with column titles. It corresponds with the setting of "headers:title;", which is the default value of this item.

 
The method can also be called in the graphic item events for Web Panels. Calling this method on the WEB will cause the internal XML communication with the server, so in fact the method is called on the server and only the input and output data are transmitted by the communication.
See also:
Example1:
Obtain the list of all user graphic viewers, that are offered as a part of a logical group menu, with a basic representation (path to the viewer and a localised user name). The list will include also the first row with column names.

This script is called in the graphic item script (e.g. in the PmiButton.onButtonUp event). The PmiRoot.ClientType properties can be used, in order to offer all the local panels will be offered in the local panel and the WEB panel will offer all WEB panels.

Dim a
a = Pm.FindViewers("groups:menu;viewers:panel;", "", "")
Example2:
Obtain the list of all alarm state viewers, that are offered as a part of a logical group menu, with a detailed report of alarm counts in each possible state. The list will include also the first row with column names. The localised texts will be evaluated in Czech language.
Dim a
a = Pm.FindViewers("groups:menu;viewers:alarm_state;", "", "columns:path,title,alstate3,alstate2,alstate1,alhoot;lang:cs;")
Next examples:
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- FindViewers
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice