Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Overview of the WEB technology in the PROMOTIC system

The WEB server is an application that provides WEB pages (HTML, XML, BMP, etc. files) into the Intranet/Internet and then these pages are viewed by standard browsers as for example the InternetExplorer/Edge, Firefox, Chrome, Opera, etc. An application of the PROMOTIC system can become such WEB server and the following text describes the principles of creating such application.
 
The PROMOTIC application as the WEB server has advantages first of all from the following reasons:
- Clients (on other PCs) that want to browse data (from the PROMOTIC WEB server), needn't install the PROMOTIC system. Clients can browse these data only by means of for example the Internet Explorer.
- Other application (on the same PC or another PC) makes use of offered data and is processing them. Such applications can be again PROMOTIC applications but even others that can process for example XML data.
- The data transfer is based on the standard of the HTTP protocol (or its secured variant HTTPS see HTTPS - secured HTTP protocol) and that's why the data can be transferred even over the Internet. Company firewalls transmit the HTTP protocol (standard port 80) and HTTPS protocol (standard port 443) by default and thus it isn't necessary to do big changes into these SW.
- Pages can be enabled only to some users. So called authentication of the client can be carried out by entering permissions in the "Permissions" page. (See also the PmWeb.onNewRequest event).
 
Caution! The WEB server in licensed in the PROMOTIC system, which means that for running in the runtime (with the runtime license) it is necessary to purchase an item for network users into the runtime license (Data or Web client - according to the type of offered WEB components - see further). It is necessary to purchase as many licenses as how many clients the application is supposed to communicate with in one moment (10 minutes) at the most. See the PROMOTIC system pricelist.
- The Development key contains 5 available clients of PmWebClient type for testing purposes.
- In the PmFree type application, there are 2 available clients of the PmWebClient type.
 
The PROMOTIC application becomes the WEB server if you place the PmWeb Promotic object into this application. Ordinarily there is only one such object in the application. This object is responsible for the fact that any WEB component of the PROMOTIC system is registered into the object and then this component offers its data. Each WEB PROMOTIC component (for the list of components see further) has unique text identifier (we'll mark it further as "ComponentId").
 
The runtime information regarding the status of the PROMOTIC WEB server communication with its clients (the statistics of HTTP transmissions, the contents of the last transmissions, etc.) can be observed in the INFO system on the /COMM/WebServer page.
 
In the PmWeb object it is possible to set so called port. The port is important information for the data transfer over the TCP/IP. The standard value is 80 for HTTP and 443 for HTTPS. If the PROMOTIC application becomes the WEB server then each its WEB component is accessible in the intranet (e.g. from the Internet Explorer) on the following URL address:
http://ComputerName:Port/ComponentId/default.htm

or if the port is set in the PmWeb object to the standard value, then in simpler way:

http://ComputerName/ComponentId/default.htm

The default.htm page is mostly only the basic page of the component. The component offers even (mostly many) other pages, not only with the extension .htm but also .xml, .png, etc. respectively. On the default.htm page there is mostly a list of these next possible pages with links to them.

The PmWeb object itself offers also its own page. Thus it is also the component but with the empty identifier. There is a list of the WEB components of the application with links to them on this page. The address of this page is as follows:

http://ComputerName:Port/default.htm

You can also reach this page by the simpler address (on the standard port):

http://ComputerName
 
Possibilities of WEB data offering are circulating quickly in the PROMOTIC system. Let's summarize now all, the PROMOTIC application can offer as the WEB server. There are the following objects as the WEB component in the PROMOTIC application:
- PmData: (see its Web Server page) it offers its values in XML form.
- PmDataTable: (see its Web Server page) it offers its values in XML form.
- PmWorkspace: (see its Web Server page) it offers all visual views of workspace in HTML page.
- PmPanel: (see its Web Server page) it offers visual views (control and current data transfer included) as dynamic HTML page.
- PmReport: (see its Web Server page) offers the user HTML page with the possibility of very general modifications of this page before it is provided to the client.
- PmAlarmEvent: (see its Web Server page) it offers HTML pages for viewing of state and historical entries of alarms/events system.
- PmTrend: (see its Web Server page) it offers HTML pages for viewing trends (table/graphics) and offers XML data for TrendsView graphic ActiveX item.
- PmWebFolder: enables to create hierarchic level of URL adress
- PmWebDir: offers the files in specific folder as static WEB pages.
- PmWebInfo: offers INFO system as HTML pages
- PmWebLang: offers the national language selection

By these objects the PROMOTIC application offers the following data:

 

1. Application workspace (PmWorkspace)

The PmWorkspace object can be used for offering the workspace layout, so that multiple windows (frames) are available simultaneously. In some frames, the HTML pages of the PmPanel object are displayed, while another may contain different web components namely PmReport, PmWebDir, etc. The framework of the visual layout is based on the dynamic pages of the PmPanel object.
 
The client requiring data from this WEB component is type of "PmWebClient" from the license point of view.

2. Images of the application (PmPanel)

The panels of the application can be offered into the WEB server by the PmPanel object.
 
PmPanel object offers its data in the form of dynamic HTML pages that (if it is enabled in the Enable as WEB component configurator) are created automatically when compiling the panel. These pages have some limitations in comparison with the panels that are started directly in the PROMOTIC application. For the description and limitation, see Web Panels.

The PmPanel object also offers static pages of the panel. On the request of the WEB client, the object creates the current image (in the PNG file format) and sends it to the client.

 
The client requiring data from this WEB component is type of "PmWebClient" from the license point of view.

3. Application reports (PmReport)

The application reports can be enabled for WEB server by the PmReport object.
 
The client requiring data from this WEB component is type of "PmWebClient" from the license point of view.

4. Current data in the XML format (PmData, PmDataTable)

The application offers current data that are located in the PmData and the PmDataTable Promotic object. These objects are then the WEB server of the data, see the Web Server page. The offered data are in several possible formats of the XML text. This offering allows reading and writing into the PmData/PmDataTable object. See also: XML data sharing.

The first usage is on communication between two or more PROMOTIC applications. The first application has the PmData/PmDataTable object set as the WebServer and the other has the identical object set as the WebClient. The WebClient reads or writes data into the WEB server (See method PmData.WriteToWeb and PmData.ReadFromWeb).

The second usage is on viewing dynamic HTML pages by the Internet Explorer. Only when the HTML pages whose content has to be changed, are offered, these pages must be refreshed periodically, which is slow and causes blinking. By the XML it is possible to create a dynamic HTML page that reads periodically the XML data on background and it refreshes only necessary visual parts. This approach is at present the best one for creating "animated" HTML pages. But if the designer wants to create such page, he must have the knowledge about making the dynamic HTML pages and using the XML. This can be too ambitious and that's why simpler walkthroughs exist in the PROMOTIC system about how to create "animated" HTML pages - see further.

Of course it is possible to use the offered XML data to lots of other purposes because the work with the XML data begins to be one of the biggest standard in the computer world. Thanks to this it is possible to offer data to other operating systems such as UNIX, LINUX, etc.

The client requiring data from this WEB component is type of "PmDataClient" from the license point of view.

5. Creating tree structure of WEB component addresses (PmWebFolder)

The PmWebFolder Promotic object represents the WEB address, into which WEB addresses of other WEB components can be inserted. It is possible to create suitable tree structure of WEB component addresses. For example, there can be WEB components of all data on one address, components of picturse on the next address, of trends, alarms, on the next, etc.

6. Offering HTMP pages created by the application designer (PmWebDir)

The PmWebDir Promotic object offers HTML (but even other) files that are located in the specified folder on the disk. The client asks for the file and the WEB server finds this file in this folder and sends it to the client.

This wouldn't be too useful because only static pages would be offered. Thus the PmWebDir object has a conception that enables to change the static file on the disk by the current state before sending to the client. This is enabled by means of keywords that are written into the static HTML and then these keywords are replaced by current values before sending. Thus the keyword can be replaced for example by the number representing temperature, by the determination of background color, even by the part of the HTML text and thus to display different data in different time.

By this it is possible in a very simple way to create even very universal "animated" pages. Their size is smaller by an order than the static raster image but it is necessary to create pictures (HTML files) for example by mean of Microsoft FrontPage, Microsoft ExpressionWeb, etc. (HTML expert can these pages create even in ordinary text editors of the Notepad type).

The client requiring data from this WEB component is type of "PmDataClient" from the license point of view.

7. Offering viewing alarms and events (PmAlarmEvent)

On the page PmAlarmEvent > Web Server it is possible to enable offering pages for viewing alarms and events. These pages are generated automatically. These WEB components offer HTML pages and XML data of the current state and even the whole history of alarms and events.

In the WEB panel it is possible to open the alarm/event viewer by the PmPanel.OpenView method - see Example of alarm viewer opening.

The client requiring data from this WEB component is type of "PmWebClient" from the license point of view.

8. Offering data and viewing trends (PmTrend)

On the page PmTrend > Web Server it is possible to enable offering data for trends clients and also offering pages for viewing trends. These pages are generated automatically. These WEB components offer HTML pages and XML data of the current state and event the whole history of trends. The format of the default HTML pages is in the /Pm/Web folder. If the default HTML pages don't suit to the user, he can create his own ones, preferably by copying the default pages into the user's folder and then to offer these pages for example by the PmWebDir component.

The client requiring data from this WEB component is type of "PmWebClient" from the license point of view.

9. INFO system

The PmWebInfo Promotic object offers HTML pages where the data of the PROMOTIC Info system are placed. These WEB pages are generated automatically and thus the designer can find out very easily that the information about running the application can be watched remotely over the Web.

The client requiring data from this WEB component is type of "PmDataClient" from the license point of view.

10. Language versions of HTML pages (PmWebLang)

Promotic object PmWebLang represents the language selection, offers a WEB page where the language can be selected. When the language is being selected the component list is displayed, registered into the PmWebLang object. All of these components will be displayed in selected language.

For example, if in the PmWebLang object the (PmPanel) is registered, then the automaticaly translated HTML page in this panel and all the included texts entered using the Macro expression $.text, will be displayed in selected language.

© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice