<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html class="client-nojs" dir="ltr" lang="en"> <head> <meta charset="UTF-8" /> <title>Модули/Web Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ - OpenSCADAWiki</title> <meta content="MediaWiki 1.26.4" name="generator" /> <link href="https://www.gnu.org/copyleft/fdl.html" rel="copyright" /> <link href="../../en/files/doc.css" rel="stylesheet" /></head> <body><div class="floatright"><a href="../index.html"><img alt="OpenSCADA" src="../../en/files/index.png" /></a></div><div id="mw_header"> <div class="mw-indicators"> </div> <h1 id="firstHeading" lang="ru">Модули/Web пользователÑ</h1> </div><div class="mw-content-ltr" dir="ltr" id="mw-content-text" lang="ru"><div class="mw-pt-translate-header noprint" dir="ltr" lang="en">This page is a <span class="plainlinks"><a class="external text" href="http://oscada.org/wiki/index.php?title=Special:Translate&group=page-Modules%2FWebUser&action=page&filter=&language=ru" rel="nofollow noreferrer noopener" target="_blank">translated version</a></span> of the page <a class="external" href="http://oscada.org/wiki/Modules/WebUser" title="Modules/WebUser">Modules/WebUser</a> and the translation is 65% complete.</div><hr /><div class="mw-pt-languages" dir="ltr" lang="en"><div class="mw-pt-languages-list autonym"><a class="mw-pt-languages-ui mw-pt-progress mw-pt-progress--complete" href="../../en/Modules/WebUser.html" title="Modules/WebUser (100% translated)">English</a> • ‎<span class="mw-pt-languages-selected mw-pt-progress mw-pt-progress--high">mRussian</span> • ‎<a class="mw-pt-progress mw-pt-progress--complete" href="../../uk/Modules/WebUser.html" title="Модулі/Web кориÑтувача (100% translated)">УкраїнÑька</a></div></div> <table class="wikitable"> <tr> <th> Модуль </th> <th> Ð˜Ð¼Ñ </th> <th> ВерÑÐ¸Ñ </th> <th> Ð›Ð¸Ñ†ÐµÐ½Ð·Ð¸Ñ </th> <th> ИÑточник </th> <th> Языки </th> <th> Платформы </th> <th> Тип </th> <th> Ðвтор </th> <th> ОпиÑание </th></tr> <tr> <td> <a href="../Modules/WebUser.html" title="Special:MyLanguage/Modules/WebUser">WebUser</a> </td> <td> WWW-Ñтраница Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ </td> <td> 2.0 </td> <td> GPL2 </td> <td> ui_WebUser.so </td> <td> en,uk,ru,de </td> <td> x86,x86_64,ARM </td> <td> ПользовательÑкие интерфейÑÑ‹ </td> <td> Роман Савоченко </td> <td> ОбеÑпечивает Ñоздание ÑобÑтвенных WWW-Ñтраниц на внутреннем Ñзыке OpenSCADA. </td></tr></table> <p>The module provides the user with a mechanism to create WWW-pages, and can process other WWW-requests in internal OpenSCADA language, usually <a href="../Modules/JavaLikeCalc.html" title="Special:MyLanguage/Modules/JavaLikeCalc">JavaLikeCalc</a>, without involving low level programming. As a page processor, the module allows you to use <a href="../Program_manual.html#DAQTmpl" title="Special:MyLanguage/Documents/Program manual">standard DAQ-Templates</a>. Using DAQ-Templates allows you to create WWW-page libraries and call them in this module multiple times as their implementations, as well as provide the data context of the template with their connection to the data of the subsystem "Data Acquisition". </p><p>Except of the module's belonging to OpenSCADA it also belongs and is the module of the <a href="../Modules/HTTP.html" title="Special:MyLanguage/Modules/HTTP">Protocol.HTTP</a> transport protocol module. Actually, the module WebUser call is made from Protocol.HTTP and through the enhanced communication mechanism — by the exported function HTTP() of the module. </p><p>ÐдреÑÐ°Ñ†Ð¸Ñ Ñтраниц начинаетÑÑ Ñо второго Ñлемента URI. Ðто ÑвÑзанно Ñ Ñ‚ÐµÐ¼, что первый Ñлемент URI иÑпользуетÑÑ Ð´Ð»Ñ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ð¸ Ñамого Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÑŒÑкого WWW-интерфейÑа. Ðапример, URL <i>http://localhost.localdomain:10002/WebUser/UserPage</i> можно раÑшифровать как вызов пользовательÑкой Ñтраницы "UserPage" Ñтого Ð¼Ð¾Ð´ÑƒÐ»Ñ "WebUser" на хоÑте "localhost.localdomain" через порт 10002. Ð’ Ñлучае отÑутÑÑ‚Ð²Ð¸Ñ Ð²Ñ‚Ð¾Ñ€Ð¾Ð³Ð¾ Ñлемента URI и ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ Ð¾Ñ‚Ð¾Ð±Ñ€Ð°Ð¶Ð°Ñ‚ÑŒ Ð¸Ð½Ð´ÐµÐºÑ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÑŒÑких Ñтраниц в конфигурации — формируетÑÑ Ð¸Ð½Ð´ÐµÐºÑ Ñтраниц (риÑ.1). </p> <div class="center"><div class="thumb tnone"><div class="thumbinner" style="width:636px;"><a class="image" href="http://oscada.org/wiki/File:WebUser_idx_ru.png"><img class="thumbimage" height="310" src="../files/WebUser_idx_ru.png" width="634" /></a> <div class="thumbcaption">РиÑ.1. Ð˜Ð½Ð´ÐµÐºÑ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»ÑŒÑких Ñтраниц.</div></div></div></div> <p>Ð“Ð»Ð°Ð²Ð½Ð°Ñ Ð²ÐºÐ»Ð°Ð´ÐºÐ° конфигурации Ð¼Ð¾Ð´ÑƒÐ»Ñ (риÑ.2) Ñодержит ÑоÑтоÑние модулÑ, предоÑтавлÑет возможноÑÑ‚ÑŒ выбора Ñтраницы по умолчанию и позволÑет Ñформировать перечень пользовательÑких Ñтраниц. </p> <div class="center"><div class="thumb tnone"><div class="thumbinner" style="width:828px;"><a class="image" href="http://oscada.org/wiki/File:WebUser_main_ru.png"><img class="thumbimage" height="532" src="../files/WebUser_main_ru.png" width="826" /></a> <div class="thumbcaption">РиÑ.2. ОÑÐ½Ð¾Ð²Ð½Ð°Ñ Ð²ÐºÐ»Ð°Ð´ÐºÐ° конфигурации модулÑ.</div></div></div></div> <h2><span class="mw-headline" id="WWW-.D1.81.D1.82.D1.80.D0.B0.D0.BD.D0.B8.D1.86.D1.8B">WWW-Ñтраницы</span></h2> <p>Модуль предоÑтавлÑет возможноÑÑ‚ÑŒ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ñ€ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ð¹ множеÑтва WWW-Ñтраниц в объекте "ПользовательÑÐºÐ°Ñ WWW-Ñтраница" (риÑ.3). </p> <div class="center"><div class="thumb tnone"><div class="thumbinner" style="width:782px;"><a class="image" href="http://oscada.org/wiki/File:WebUser_up_main_ru.png"><img class="thumbimage" height="583" src="../files/WebUser_up_main_ru.png" width="780" /></a> <div class="thumbcaption">РиÑ.3. Ð“Ð»Ð°Ð²Ð½Ð°Ñ Ð²ÐºÐ»Ð°Ð´ÐºÐ° конфигурации пользовательÑкой Ñтраницы.</div></div></div></div> <p>The main tab contains the basic settings of the WWW-page: </p> <ul><li> Section "State" — contains properties that characterize the state of the page: Status, "Enabled", the name of the database containing the configuration (with tracking the availability of the data in different storages and providing the sequentially removing duplicates) and date of the last modification.</li> <li> Identifier, name and description of the page.</li> <li> The state "Enabled", in which the page must be translated at boot.</li> <li> Language of the direct procedure or <a href="../Program_manual.html#DAQTmpl" title="Special:MyLanguage/Documents/Program manual">DAQ-Template</a> associated with the page.</li></ul> <p>All requests to the user pages are sent to the direct procedure of the processing of the requests of the user page, or to the DAQ-Template procedure, which is represented on the "Program" tab of the user page object (Fig.4). In the case of the DAQ-Template, the template configuration tab is also provided (Fig.5). </p> <div class="center"><div class="thumb tnone"><div class="thumbinner" style="width:910px;"><a class="image" href="http://oscada.org/wiki/File:WebUser_up_prog_ru.png"><img class="thumbimage" height="683" src="../files/WebUser_up_prog_ru.png" width="908" /></a> <div class="thumbcaption">РиÑ.4. Вкладка "Процедура" объекта пользовательÑкой WWW-Ñтраницы.</div></div></div></div> <p>Вкладка процедуры обработки запроÑов к пользовательÑкой Ñтранице Ñодержит: </p> <ul><li> Таблицу контекÑта данных процедуры. Ð’ оÑновном имеет ÑмыÑл только при работе по шаблону и где можно контролировать Ñтот процеÑÑ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ¸, Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑ‚ÑŒ вмешательÑтва через изменение значений данных.</li> <li> ТекÑÑ‚ прÑмой процедуры Ñтраницы, отÑутÑтвует в режиме работы по шаблону.</li> <li> СвÑзи на данные подÑиÑтемы "Сбор Данных", которые видимы и доÑтупны Ð´Ð»Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² режиме работы по шаблону и во включенном ÑоÑтоÑнии объекта Ñтраницы.</li></ul> <p>For the direct processing procedure, and the required or optional ones to create in the template, the following exchange attributes with the HTTP-protocol are predetermined: </p> <ul><li> <i><b>Result (rez)</b></i> <String> — processing result, by defaults — "200 OK"; in the DAQ-Template mode you must write thither directly, not by the operator "return"; to prevent sending a HTTP-wrapped response, put an empty string here, that is, send the response directly via <a href="../User_API.html#SYSTransport" title="Special:MyLanguage/Documents/User API">SYS.Transport["Modul"]["in_Transp"].writeTo()</a>;</li> <li> <i><b>HTTP request (HTTPreq)</b></i> <String> — the HTTP request method like to GET, POST, ...;</li> <li> <i><b>URL (url)</b></i> <String> — URI of the request;</li> <li> <i><b>WWW-page (page)</b></i> <String> — content of the Get/Post page for the request and respond as well;</li> <li> <i>Sender (sender)</i> <String> — request sender;</li> <li> <i>User (user)</i> <String> — authenticated user;</li> <li> <i><b>HTTP variables (HTTPvars)</b></i> <Object> — HTTP variables; changed and appended variables (besides "Date", "Server", "Accept-Ranges" and "Content-Length") will be placed to the response package;</li> <li> <i>URL's parameters (URLprms)</i> <Object> — URL parameters;</li> <li> <i>Content items (cnts)</i> <Object::Array<XMLNodeObj>> — content items for POST;</li> <li> <i>This object (this)</i> <Object> — pointer to this page's object;</li> <li> <i>Protocol's object (prt)</i> <Object> — pointer to the input part object of the HTTP protocol;</li> <li> <i>Transport's object (tr)</i> <Object> — pointer to the input transport to the input part object of the HTTP protocol;</li> <li> <i>Scheduling the next service call (schedCall)</i> <Integer> — write here the time value in seconds for scheduling the procedure context execution in a service call; <a class="image" href="http://oscada.org/wiki/File:At.png"><img alt="At.png" height="22" src="../../en/files/At.png" width="22" /></a> the service calls are performed in the periodicity 10 seconds usually, so you can schedule the calls not often than at 10 seconds.</li></ul> <p>The overall scenario of the user's page request: </p> <ul><li> External network station generates an HTTP request with the following form of URI "/WebUser/{UserPage}" which falls on the OpenSCADA transport with the value of the configuration field "Protocol" equal to "HTTP".</li> <li> Transport sends the request to the module of the transport protocol "Protocol.HTTP".</li> <li> The transport protocol module, in accordance with the first element of the URI, sends the request to this module.</li> <li> This module selects the object of the user's page which is specified in the second element of the URI.</li> <li> Initialization of the HTTP-protocol variables for the page procedure is made: <ul><li> <i><b>HTTPreq</b></i> — is set to value of the HTTP-Method (like to "GET", "POST"), depending on the request type;</li> <li> <i><b>url</b></i> — address of the requested resource (URI);</li> <li> <i><b>page</b></i> — the input single content and the sending page for the method "POST";</li> <li> <i>sender</i> — address of sender of the request;</li> <li> <i>user</i> — identifier of the authenticated user, if the authentication has occurred;</li> <li> <i><b>HTTPvars</b></i> — parsed list of variables of the HTTP-protocol in the form of object's properties;</li> <li> <i>URLprms</i> — parsed list of the URL parameters in the form of object's properties;</li> <li> <i>cnts</i> — parsed content's items for POST, in the Array <XMLNodeObj>, with the elements content in the text and properties, in the XMLNodeObj attributes.</li></ul></li> <li> Calling the procedure for execution, which, having processed the request, forms the page content in the "page" and the request result in the "rez".</li> <li> At the end, the answer is formed with the return code of the HTTP from "rez" and with the content from the "page", and also with changed and appended variables of the HTTP-protocol from "HTTPvars". For empty "rez" the answer is not generated!</li></ul> </div><table style="border-top: dotted 2px #999999; margin-top: 20pt; color: gray;" width="100%"><tr><td style="text-align: left;" width="40%"><a href="http://oscada.org/wiki/Modules/WebUser/ru">Modules/WebUser/ru</a> - <a href="http://oscada.org/en/main/about-the-project/licenses/">GFDL</a></td><td style="text-align: center;">April 2025</td><td style="text-align: right;" width="40%">OpenSCADA 1+r3018</td></tr></table></body> </html>