This commit is contained in:
@ -1,19 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="ru">
|
||||
|
||||
<head>
|
||||
<title>Connect to the external service module with the SOAP protocol</title>
|
||||
<title>Подключение к модулю внешнего сервиса с протоколом SOAP</title>
|
||||
<meta name="generator" content="Help+Manual" />
|
||||
<meta name="keywords" content="" />
|
||||
<meta name="keywords" content="URL спецификации" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="In a custom module, you can configure the connection of a web service that uses SOAP (Simple Object Access Protocol) to exchange data with BRIX." />
|
||||
<meta name="description" content="В пользовательском модуле можно настроить подключение веб-сервиса, использующего протокол SOAP (Simple Object Access Protocol), для обмена данными с ELMA365. " />
|
||||
<meta name="picture" content="" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="Full documentation for BRIX365 platform. Low-code developer guide. User guide. Admin guide. Developer guide." />
|
||||
<meta property="og:url" content="https://brix365.com/en/help" />
|
||||
<meta property="og:image" content="" />
|
||||
<meta property="og:title" content="Cправка по Low-code платформе ELMA365" />
|
||||
<meta property="og:url" content="https://elma365.com/ru/help" />
|
||||
<meta property="og:image" content="" />
|
||||
<meta property="og:site_name" content="ELMA365" />
|
||||
<link rel="icon" href="favicon.png" type="image/png" />
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
|
||||
@ -23,6 +24,7 @@
|
||||
<link rel="stylesheet" href="./article.css" />
|
||||
<link rel="stylesheet" href="./glossary.css" />
|
||||
<link rel="stylesheet" href="./theme.css" />
|
||||
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="helpman_settings.js"></script>
|
||||
<script type="text/javascript" src="helpman_topicinit.js"></script>
|
||||
@ -34,16 +36,16 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-M6ETBEC1R9"></script><script>window.dataLayer=window.dataLayer || []; function gtag(){dataLayer.push(arguments);}gtag('js', new Date()); gtag('config', 'G-M6ETBEC1R9');</script>
|
||||
<script>!function(e,t,c,n,r,a,m){e.ym=e.ym||function(){(e.ym.a=e.ym.a||[]).push(arguments)},e.ym.l=1*new Date;for(var s=0;s<document.scripts.length;s++)if(document.scripts[s].src===n)return;a=t.createElement(c),m=t.getElementsByTagName(c)[0],a.async=1,a.src=n,m.parentNode.insertBefore(a,m)}(window,document,"script","https://mc.yandex.ru/metrika/tag.js"),ym(83179930,"init",{clickmap:!0,trackLinks:!0,accurateTrackBounce:!0,webvisor:!0})</script><noscript><div><img alt=""src=https://mc.yandex.ru/watch/83179930 style=position:absolute;left:-9999px></div></noscript>
|
||||
|
||||
<header class="header elma-365">
|
||||
<div class="container">
|
||||
<a class="header__logo" href="https://brix365.com/en/help">
|
||||
<img src="./logo-en.svg" alt="header logo">
|
||||
<a class="header__logo" href="https://elma365.com/ru/help">
|
||||
<img src="./logo.svg" alt="header logo">
|
||||
</a>
|
||||
<!-- <div class="hero__search-form" id="search-panel">
|
||||
<form class="search-form" onsubmit="ym(83180416,'reachGoal','poisk')">
|
||||
<form class="search-form" onsubmit="ym(83179930,'reachGoal','poisk')">
|
||||
<label class="search-form__label">
|
||||
<span id="reset-search" class="search__icon"></span>
|
||||
<input class="search-form__input" type="text">
|
||||
@ -63,7 +65,7 @@
|
||||
</div>
|
||||
<div class="header__navi">
|
||||
|
||||
<ul class="header__list"><li><span class="solution-select"><span class="solution-select__selected"></span><svg width="7" height="4" viewBox="0 0 7 4" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L3.5 3.5L6 1" stroke="white" stroke-linecap="round" stroke-linejoin="round"/></svg><ul class="solution-select__list"><li><a class="project-link" href="https://brix365.com/en/help/platform/get-trial.html">Platform</a></li><li><a class="project-link" href="https://brix365.com/en/help/ecm/ecm-functions.html">ECM</a></li><li><a class="project-link" href="https://brix365.com/en/help/crm/crm_overview.html">CRM</a></li><li><a class="project-link" href="https://brix365.com/en/help/service/service-functions.html">Service</a></li><li><a class="project-link" href="https://brix365.com/en/help/projects/projects-functions.html">Projects</a></li><li><a class="project-link" href="https://brix365.com/en/help/business_solutions/-elma365-store.html">Business Solutions</a></li></ul></span></li><li><a href="https://api.brix365.com/en/" target="_blank">API</a></li><li><a href="https://tssdk.brix365.com/" target="_blank">SDK</a></li></ul>
|
||||
<ul class="header__list"><li><span class="solution-select"><span class="solution-select__selected"></span><svg width="7" height="4" viewBox="0 0 7 4" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L3.5 3.5L6 1" stroke="white" stroke-linecap="round" stroke-linejoin="round"/></svg><ul class="solution-select__list"><li><a class="project-link" href="https://elma365.com/ru/help/platform/get-trial.html">Платформа</a></li><li><a class="project-link" href="https://elma365.com/ru/help/ecm/ecm-functions.html">ECM</a></li><li><a class="project-link" href="https://elma365.com/ru/help/crm/crm_overview.html">CRM</a></li><li><a class="project-link" href="https://elma365.com/ru/help/service/service-functions.html">Service</a></li><li><a class="project-link" href="https://elma365.com/ru/help/projects/projects-functions.html">Проекты</a></li><li><a class="project-link" href="https://elma365.com/ru/help/business_solutions/-elma365-store.html">Бизнес-решения</a></li></ul></span></li><li><a href="https://api.elma365.com/ru/"target="_blank">API</a></li><li><a href="https://tssdk.elma365.com/"target="_blank">SDK</a></li><li><a href="https://community.elma365.com/" target="_blank">Community</a></li><li><a href="https://elma-academy.com/ru/" target="_blank">Академия</a></li><li><a href="https://elma365.com/ru/" target="_blank">Сайт ELMA365</a></li></ul>
|
||||
|
||||
|
||||
</div>
|
||||
@ -78,8 +80,8 @@
|
||||
|
||||
<aside class="sidebar" id="sidebar">
|
||||
<div class="sidebar__header">
|
||||
<a class="header__logo" href="https://brix365.com/en/help">
|
||||
<img src="./logo-light-en.svg">
|
||||
<a class="header__logo" href="https://elma365.com/ru/help">
|
||||
<img src="./logo-light.svg">
|
||||
</a>
|
||||
<span class="sidebar__close elma-365-close" id="close"></span>
|
||||
</div>
|
||||
@ -92,15 +94,15 @@
|
||||
<div class="article-inner">
|
||||
<div class="content">
|
||||
<header class="article__header">
|
||||
<div class="article__bread" style="display:flex; gap:10px;">
|
||||
<div class="article__bread" style="display:flex; gap:10px;">
|
||||
<span id="subcategory" class="search-res__item-category search-res__item-category_subcategory subcategory article__badge"></span>
|
||||
|
||||
<div class="topic__breadcrumbs">
|
||||
<p><a href="360024498352.html">Modules</a> > <a href="extentions.html">Custom modules</a> / Connect to the external service module with the SOAP protocol</p>
|
||||
<p><a href="360024498352.html">Модули расширения системы</a> > <a href="extentions.html">Пользовательские модули</a> / Подключение к модулю внешнего сервиса с протоколом SOAP</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="topic__title"><h1 class="p_Heading1"><span class="f_Heading1">Connect to the external service module with the SOAP protocol</span></h1>
|
||||
<div class="topic__title"><h1 class="p_Heading1"><span class="f_Heading1">Подключение к модулю внешнего сервиса с протоколом SOAP</span></h1>
|
||||
</div>
|
||||
|
||||
</header>
|
||||
@ -109,106 +111,107 @@
|
||||
<a href="#h1-article" class="scroll-top"></a>
|
||||
</div>
|
||||
<!-- Placeholder for topic body. -->
|
||||
<p class="p_Normal">In a custom module, you can configure the connection of a web service that uses SOAP (Simple Object Access Protocol) to exchange data with BRIX.</p>
|
||||
<p class="p_Normal">The web service will act as a connector point. In the module, the <span style="font-weight: bold;">.xml</span> file of the specification of a particular web service is uploaded. This will allow you to access its description language (WSDL). You will then be able to access the methods and data types of the web service in server scripts and use them to implement certain logic in BRIX.</p>
|
||||
<p class="p_Normal">For example, in the module, you can configure integration with a web service that provides country data by its ISO code. To use the service methods, you can create a widget and add a server script to it. The user will be able to specify the ISO code of the country in the widget and send a request to the web service. The received country data will be sent to BRIX and displayed in the widget. Then the widget can be placed on any pages and forms of the system apps and receive information from the web service.</p>
|
||||
<p class="p_Normal">To configure integration, an <span style="font-weight: bold;">external service</span> is created in the custom module.</p>
|
||||
<p class="p_Normal">Only <a href="360006871932.html#administrators" class="topiclink">system administrators</a> can add external services to modules.</p>
|
||||
<h2 class="p_Heading2"><span class="f_Heading2">Create an external service in a module</span></h2>
|
||||
<p class="p_Normal">To connect a web service to BRIX, follow the steps below:</p>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">В пользовательском модуле можно настроить подключение веб-сервиса, использующего протокол SOAP (Simple Object Access Protocol), для обмена данными с ELMA365. </p>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">Веб-сервис будет выступать в качестве точки-коннектора. В модуле загружается <span style="font-weight: bold;">.xml</span>-файл спецификации определённого веб-сервиса. Это позволит получить доступ к его языку описания (WSDL). Затем вы сможете обращаться к методам и типам данных веб-сервиса в серверных скриптах и использовать их для решения задач в ELMA365.</p>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">Например, в модуле можно настроить интеграцию с веб-сервисом, который предоставляет данные о стране по её ISO-коду. Для использования методов сервиса, можно создать виджет и добавить в него серверный скрипт. Пользователь сможет указывать в виджете ISO-код страны и отправлять запрос в веб-сервис. Полученные данные о стране будут направляться в ELMA365 и отображаться в виджете. Далее виджет можно разместить на любых страницах и формах приложений системы и получать информацию из веб-сервиса. </p>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">Для настройки интеграции в пользовательском модуле создаётся <span style="font-weight: bold;">Внешний сервис</span>. </p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">начало внимание</span></p>
|
||||
<p class="p_Normal">Добавлять внешние сервисы в модули могут только <a href="360006871932.html#administrators" class="topiclink">администраторы системы</a>.</p>
|
||||
<p class="p_CodeExample" style="page-break-inside: avoid;"><span class="f_CodeExample">конец внимание</span></p>
|
||||
<h2 class="p_Heading2"><a id="create-soap-service" class="hmanchor"></a><span class="f_Heading2">Создать внешний сервис в модуле</span></h2>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">Чтобы подключить веб-сервис к ELMA365, выполните следующие действия: </p>
|
||||
<ol style="list-style-type:upper-roman">
|
||||
<li value="1" class="p_Normal">Go to the <span style="font-weight: bold;">Administration > Modules</span> workspace and select the created <a href="extentions.html" class="topiclink">custom module</a>.</li><li value="2" class="p_Normal">On the module page, click <span style="font-weight: bold;">Settings</span> and go to the <span style="font-weight: bold;">External Services</span> tab.</li><li value="3" class="p_Normal">Fill in the connection details:</li></ol>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 34px;"><img alt="soap-service-1" width="532" height="557" style="margin:0;width:532px;height:557px;border:none" src="soap-service-1.png"/></p>
|
||||
<li value="1" style="margin-top: 0; margin-right: 0; margin-bottom: 11px;">Перейдите в раздел <span style="font-weight: bold;">Администрирование > Модули</span> и выберите созданный <a href="https://elma365.com/ru/help/platform/extentions.html" target="_blank" class="weblink">пользовательский модуль</a>.</li><li value="2" style="margin-top: 0; margin-right: 0; margin-bottom: 11px;">На странице модуля нажмите <span style="font-weight: bold;">Управление</span> и перейдите на вкладку <span style="font-weight: bold;">Внешние сервисы</span>.</li><li value="3" style="margin-top: 0; margin-right: 0; margin-bottom: 11px;">Заполните данные для подключения:</li></ol>
|
||||
<p style="margin: 0 0 11px 36px;"><img alt="soap-service-1" width="585" height="675" style="margin:0;width:585px;height:675px;border:none" src="soap-service-1.png"/></p>
|
||||
<ul style="list-style-type:disc">
|
||||
<li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Name</span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold; color: #ff0000;">*</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">. Specify the name of the external service.</span></li><li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Unique name</span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold; color: #ff0000;">*</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">. Specify the name that will be used in scripts to access the external service. It must be unique.</span></li><li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Specification URL</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">. Enter the URL where the </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">.xml</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> table with the service description language (WSDL) is available. To upload the specification to the system, click the </span><img alt="clip0214" width="20" height="20" style="margin:0;width:20px;height:20px;border:none" src="clip0214.png"/><span class="f_ImageCaption"> </span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">icon to the right of the field. A specification file will then be generated and displayed in the field.</span></li><li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Specification file</span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold; color: #ff0000;">*</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">. An </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">.xml </span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">file of the web service specification is uploaded to the field. If you entered a URL in the previous field, the file will be displayed automatically.</span></li><li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">SOAP service</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">,</span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;"> SOAP port</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">. The fields are filled in automatically from the data in the downloaded </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">.xml</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> file of the web service specification. The data is used to debug the interaction with the web service. If multiple SOAP ports are displayed in the field, select the desired one by referring to the web service documentation.</span></li><li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Basic URL</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">. Specify the URL of the web service. If the field is not filled in, the address from the downloaded </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">.xml</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> specification file is used by default.</span></li><li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Authentication</span>. Select an option to authenticate the web service:</li></ul>
|
||||
<ul style="list-style-type:disc"><ul style="list-style-type:circle">
|
||||
<li style="line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">None</span>.</li><li style="line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Basic</span>. Login and password are used for authentication.</li><li style="line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">With Token</span>. A token is required for authentication.</li></ul></li></ul>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 36px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif;">To specify a login and password or token, click the key icon to the right of the field. Please note that when exporting the module, the data is transmitted in an unencrypted form.</span></p>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 36px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif;">To encrypt sensitive data, we recommend using template variables, i.e., </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; color: #0000ff;"><a href="extention-settings.html" class="topiclink">parameters created in the module settings</a></span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">. To do this, click the </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">{+}</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> icon in the right part of the field, select the added parameter, and save the settings.</span></p>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 36px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif;">For example, on the </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Module Settings</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> page, you can create the </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Token</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> parameter of the </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">String</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> type. Then, when adding an external service, specify the variable in the authentication rule. Then in the settings of the enabled module, the token can be added, changed, or deleted.</span></p>
|
||||
<li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Имя</span><span style="font-weight: bold; color: #ff0000;">*</span> — укажите название внешнего сервиса; </li><li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Уникальное имя</span><span style="font-weight: bold; color: #ff0000;">*</span> — укажите название, которое будет использоваться в скриптах для обращения к внешнему сервису. Оно должно быть уникальным; </li><li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">URL спецификации</span> — внесите URL-адрес, по которому доступна <span style="font-weight: bold;">.xml</span>-таблица с языком описания сервиса (WSDL). Для загрузки спецификации в систему нажмите значок <img alt="download-icon" width="22" height="22" style="margin:0;width:22px;height:22px;border:none" src="download-icon.png"/> справа от поля. После этого сформируется и отобразится в поле файл спецификации;</li><li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Файл спецификации</span><span style="font-weight: bold; color: #ff0000;">*</span> — в поле загружается <span style="font-weight: bold;">.xml</span>-файл спецификации веб-сервиса. Если в предыдущем поле вы ввели URL-адрес, файл отобразится автоматически; </li><li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">SOAP сервис</span>, <span style="font-weight: bold;">SOAP порт</span> — поля заполняются автоматически из данных загруженного <span style="font-weight: bold;">.xml</span>-файла спецификации веб-сервиса. Данные используются для отладки взаимодействия с веб-сервисом. Если в поле отображается несколько SOAP портов, выберите нужный, обратившись к документации веб-сервиса;</li><li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Базовый URL</span> — укажите URL-адрес веб-сервиса. Если поле не заполнено, по умолчанию используется адрес из загруженного <span style="font-weight: bold;">.xml</span>-файла спецификации;</li><li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Аутентификация</span> — выберите опцию для аутентификации веб-сервиса:<ul style="list-style-type:circle">
|
||||
<li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Не требуется</span>;</li><li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Базовая</span> — для аутентификации используется логин и пароль;</li><li style="margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">По токену</span> — для аутентификации необходим токен.</li></ul></li></ul>
|
||||
<p style="margin: 0 0 11px 36px;">Чтобы указать логин и пароль или токен, нажмите на значок ключа справа от поля. Обратите внимание, при экспорте модуля данные передаются в открытом виде. </p>
|
||||
<p style="margin: 0 0 11px 36px;">Чтобы зашифровать конфиденциальные данные, рекомендуем использовать шаблонизированные переменные, т. е. <a href="extention-settings.html" class="topiclink">параметры, созданные в настройках модуля</a>. Для этого в правой части поля нажмите значок <span style="font-weight: bold;">{+}</span>, выберите добавленный параметр и сохраните настройки.</p>
|
||||
<p style="margin: 0 0 11px 36px;">Например, на странице <span style="font-weight: bold;">Настройки модуля</span> вы можете создать параметр <span style="font-weight: bold;">Токен</span> с типом <span style="font-weight: bold;">Строка</span>. Затем при добавлении внешнего сервиса указать переменную в правиле аутентификации. Тогда токен можно внести, изменить или удалить в настройках включённого модуля.</p>
|
||||
<ol style="list-style-type:upper-roman" start="4">
|
||||
<li value="4" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif;">Click </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Create</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">.</span></li><li value="5" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-family: 'Times New Roman',Times,Georgia,serif;">A window with full settings of the external service will open. To provide access to the service, click </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Save</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> and </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; font-weight: bold;">Publish</span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> in the top panel.</span></li></ol>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 0;"><span style="font-family: 'Times New Roman',Times,Georgia,serif;">Now you can use the available methods of the web service described in its documentation.</span></p>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 0;"><span style="font-family: 'Times New Roman',Times,Georgia,serif;">The methods can only be accessed in server scripts that are processed on the BRIX server.</span></p>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 0;"><span style="font-family: 'Times New Roman',Times,Georgia,serif;">For convenience, you can add scripts within an existing module, for example, in </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; color: #0000ff;"><a href="extention-widegets.html" class="topiclink">custom widgets</a></span><span style="font-family: 'Times New Roman',Times,Georgia,serif;"> or </span><span style="font-family: 'Times New Roman',Times,Georgia,serif; color: #0000ff;"><a href="extention-activities.html" class="topiclink">activities in business processes</a></span><span style="font-family: 'Times New Roman',Times,Georgia,serif;">. Created components with server scripts can be applied in any BRIX workspace but are executed only when the custom module is enabled.</span></p>
|
||||
<h2 class="p_Heading2"><span class="f_Heading2">Example of using external service methods </span></h2>
|
||||
<p class="p_Normal">Let’s consider the use of an external service in the module on the example of a configured integration with a web service that provides data about a country by its ISO code. You can read and use the service description language (WSDL) at the <a href="http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL" target="_blank" class="weblink">URL specification</a>.</p>
|
||||
<p class="p_Normal">In the module, we will create and customize a widget where the user specifies the ISO code of the country and clicks the button to run the script. The script uses a method from a web service. After the request is processed, the widget in BRIX displays full information about the country: name, capital city, phone and currency code, national languages, and flag.</p>
|
||||
<p class="p_Normal">To allow users to use the widget, let’s place it on a separate page added to a system workspace.</p>
|
||||
<p class="p_Normal">Let’s see how to configure such functionality.</p>
|
||||
<h3 class="p_Heading3"><span class="f_Heading3">Step 1. Create a widget in the module and configure its context</span></h3>
|
||||
<li value="4" style="margin-top: 0; margin-right: 0; margin-bottom: 11px;">Нажмите <span style="font-weight: bold;">Создать</span>. </li><li value="5" style="margin-top: 0; margin-right: 0; margin-bottom: 11px;">Откроется окно с полными настройками внешнего сервиса. Чтобы предоставить доступ к сервису, на верхней панели нажмите <span style="font-weight: bold;">Сохранить</span> и <span style="font-weight: bold;">Опубликовать</span>.</li></ol>
|
||||
<p style="margin: 0 0 11px 0;">Теперь вы можете использовать доступные методы веб-сервиса, описанные в его документации. </p>
|
||||
<p style="margin: 0 0 11px 0;">Обращаться к методам можно только в серверных скриптах, которые обрабатываются на стороне сервера ELMA365. </p>
|
||||
<p style="margin: 0 0 11px 0;">Для удобства вы можете добавить скрипты в рамках существующего модуля, например, в <a href="extention-widegets.html" class="topiclink">пользовательских виджетах</a> или <a href="extention-activities.html" class="topiclink">действиях в бизнес-процессах</a>. Созданные компоненты с серверными скриптами могут применяться в любых разделах ELMA365, но выполняются только при включённом пользовательском модуле.</p>
|
||||
<h2 class="p_Heading2"><a id="soap-service-use-case" class="hmanchor"></a><span class="f_Heading2">Пример использования методов внешнего сервиса </span></h2>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">Рассмотрим использование внешнего сервиса в модуле на примере настроенной интеграции с веб-сервисом, который предоставляет данные о стране по её ISO-коду. Язык описания сервиса (WSDL) доступен для ознакомления и использования по <a href="http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL" target="_blank" class="weblink">URL спецификации</a>.</p>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">В модуле создадим и настроим виджет, в котором пользователь указывает ISO-код страны и нажимает кнопку запуска скрипта. В скрипте используется метод из веб-сервиса. После обработки запроса в виджете в ELMA365 отображается полная информация о стране: название, столица, телефонный код и код валюты, государственные языки, флаг. </p>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">Чтобы пользователи могли применять виджет, разместим его на отдельной странице, добавленной в разделе системы. </p>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">Рассмотрим действия, которые выполняются для подобной настройки.</p>
|
||||
<h3 class="p_Heading3"><a id="step-1-create-fields" class="hmanchor"></a><span class="f_Heading3">Шаг 1. Создание виджета в модуле и настройка его контекста</span></h3>
|
||||
<ol style="list-style-type:decimal">
|
||||
<li value="1" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Go to the custom module settings and open the <span style="font-weight: bold;">Widgets</span> tab.</li><li value="2" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Click <span style="font-weight: bold;">+Widget</span>, specify a name for the widget, for example, <span style="font-weight: bold;">Country information</span>, and click <span style="font-weight: bold;">Create</span>. The interface designer will open.</li><li value="3" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Create context variables that are placed on the modeling canvas and used to exchange data between BRIX and the web service. To do this, click the <span style="font-weight: bold;">Context</span> tab and add properties:</li></ol>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 34px;"><img alt="soap-service-2" width="815" height="350" style="margin:0;width:815px;height:350px;border:none" src="soap-service-2.png"/></p>
|
||||
<li value="1" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Перейдите в настройки пользовательского модуля и откройте вкладку <span style="font-weight: bold;">Виджеты</span>. </li><li value="2" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Нажмите <span style="font-weight: bold;">+ Виджет</span>, задайте название виджета, например, <span style="font-weight: bold;">Данные страны</span> и нажмите <span style="font-weight: bold;">Создать</span>. Откроется дизайнер интерфейсов.</li><li value="3" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Создайте контекстные переменные, которые размещаются на поле для моделирования и используются для обмена данными между ELMA365 и веб-сервисом. Для этого перейдите на вкладку <span style="font-weight: bold;">Контекст</span> и добавьте свойства: </li></ol>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 36px;"><img alt="soap-service-2" width="959" height="398" style="margin:0;width:959px;height:398px;border:none" src="soap-service-2.png"/></p>
|
||||
<ul style="list-style-type:disc">
|
||||
<li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">ISO country code</span> (<code><b>isocode</b></code>). It is a variable of the <span style="color: #0000ff;"><a href="360009707032.html" class="topiclink">String (string)</a></span> type. In the widget, employees will use this field to specify the ISO code of the country.</li><li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Country information</span> (<code><b>countryinfo</b></code>). It is a variable with of the <span style="color: #0000ff;"><a href="360009707032.html" class="topiclink">String (text)</a></span> type. After processing a request to the web service, this field will display full information about the country.</li><li style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Country flag</span> (<code><b>flag</b></code>). It is a variable of the <span style="color: #0000ff;"><a href="360009707032.html#image" class="topiclink">Image (one)</a></span> type. This field will display the flag image obtained from the link to it in the response from the web service.</li></ul>
|
||||
<h3 class="p_Heading3"><span class="f_Heading3">Step 2. Place properties on the widget form</span></h3>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 0;">Add properties to the widget so that users can specify the ISO code of a country and view information about it resulting from processing a request to the web service. To do this:</p>
|
||||
<li style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">ISO-код страны</span> (<code><b>isocode</b></code>) — переменная с типом <a href="360009707032.html" class="topiclink">Строка (строка)</a>. В виджете в этом поле пользователи будут указывать ISO-код страны;</li><li style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Данные о стране </span>(<code><b>countryinfo</b></code>) — переменная с типом <a href="360009707032.html" class="topiclink">Строка (текст)</a>. После обработки запроса в веб-сервис в этом поле будет отображаться полная информация о стране; </li><li style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;"><span style="font-weight: bold;">Флаг страны</span> (<code><b>flag</b></code>) — переменная с типом <a href="360009707032.html#image" class="topiclink">Изображение (одно)</a>. В этом поле будет показываться изображение флага, полученное из ссылки на него в ответе от веб-сервиса.</li></ul>
|
||||
<h3 class="p_Heading3"><a id="step-2-placing-fields" class="hmanchor"></a><span class="f_Heading3">Шаг 2. Размещение свойств на форме виджета</span></h3>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">Добавьте свойства в виджет, чтобы пользователи могли указывать ISO-код стран и просматривать данные о ней, полученные в результате обработки запроса в веб-сервис. Для этого:</p>
|
||||
<ol style="list-style-type:decimal">
|
||||
<li value="1" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Click the <span style="font-weight: bold;">Template</span> tab and in the right sidebar, click <span style="font-weight: bold;">Properties</span>.</li><li value="2" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Drag and drop the created variables onto the modeling canvas.</li><li value="3" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">For the properties that display the query result, i.e., <span style="font-weight: bold;">Country information</span> and <span style="font-weight: bold;">Country flag</span>, we recommend that you enable the <span style="font-weight: bold;">Read only</span> option so that users cannot modify the resulting values.</li></ol>
|
||||
<h3 class="p_Heading3"><span class="f_Heading3">Step 3. Configure the server script</span></h3>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 0;">Write a server script that will handle the method from the web service, and configure it to run. To do this:</p>
|
||||
<li value="1" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Перейдите на вкладку <span style="font-weight: bold;">Шаблон</span> и на правой боковой панели нажмите <span style="font-weight: bold;">Свойства</span>. </li><li value="2" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Перетащите созданные переменные на поле для моделирования. </li><li value="3" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Для свойств, отображающих результат запроса — <span style="font-weight: bold;">Данные о стране</span> и <span style="font-weight: bold;">Флаг страны</span>, рекомендуем включить опцию <span style="font-weight: bold;">Только для чтения</span>, чтобы пользователи не могли изменять полученные значения.</li></ol>
|
||||
<h3 class="p_Heading3"><a id="step-3-script" class="hmanchor"></a><span class="f_Heading3">Шаг 3. Настройка серверного скрипта</span></h3>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">Задайте серверный скрипт, который будет обрабатывать метод из веб-сервиса, и настройте его запуск. Для этого:</p>
|
||||
<ol style="list-style-type:decimal">
|
||||
<li value="1" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">In the designer sidebar, click <span style="font-weight: bold;">Widgets</span>, find the <span style="color: #0000ff;"><a href="button_widget.html" class="topiclink">Button</a></span> widget and drag it to the modeling canvas, for example, place the button under the <span style="font-weight: bold;">ISO country code</span> string.</li><li value="2" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">In the window that opens, customize the display of the button and set its name, for example, <span style="font-weight: bold;">Get</span> <span style="font-weight: bold;">info</span>.</li><li value="3" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">In the <span style="font-weight: bold;">Executed script</span> field, select the <span style="font-weight: bold;">Server</span> option to add a script that is processed on the BRIX server. Click <span style="font-weight: bold;">Create</span> and specify the name of the script that will be run when the button is clicked, for example, <span style="font-weight: bold;">Show</span>.</li></ol>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 34px;"><img alt="soap-service-3" width="673" height="369" style="margin:0;width:673px;height:369px;border:none" src="soap-service-3.png"/></p>
|
||||
<li value="1" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">На боковой панели дизайнера нажмите <span style="font-weight: bold;">Виджеты</span>, найдите виджет <a href="button_widget.html" class="topiclink">Кнопка</a> и перетащите его на поле для моделирования, например, разместите кнопку под строкой <span style="font-weight: bold;">ISO-код страны</span>. </li><li value="2" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">В открывшемся окне настройте отображение кнопки и задайте её название, например, <span style="font-weight: bold;">Получить данные</span>.</li><li value="3" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">В поле <span style="font-weight: bold;">Выполняемый скрипт</span> выберите опцию <span style="font-weight: bold;">Сервер</span>, чтобы добавить скрипт, который обрабатывается на стороне сервера ELMA365. Нажмите <span style="font-weight: bold;">Создать</span> и укажите название скрипта, который будет запускаться при нажатии на кнопку, например, <span style="font-weight: bold;">Show</span>.</li></ol>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 36px;"><img alt="soap-service-3" width="797" height="413" style="margin:0;width:797px;height:413px;border:none" src="soap-service-3.png"/></p>
|
||||
<ol style="list-style-type:decimal">
|
||||
<li value="4" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Click the <span style="font-weight: bold;">Open</span> button that appears in the field to go to the <span style="font-weight: bold;">Scripts</span> tab and write the script:</li></ol>
|
||||
<p class="p_CodeExample" style="white-space: normal; page-break-inside: avoid;"><span class="f_CodeExample">async function Show(): Promise<</span><span class="f_CodeExample" style="font-weight: bold;">void</span><span class="f_CodeExample">> {</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Context.data.countryinfo = '';</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Context.data.flag = undefined;</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">if </span><span class="f_CodeExample">(!Context.data.isocode) {</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">return</span><span class="f_CodeExample">;</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">const </span><span class="f_CodeExample">mysCountryISOCode = Context.data.isocode;</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">try </span><span class="f_CodeExample">{</span><br />
|
||||
<span class="f_CodeExample">// Access to an external service created in the module</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">const </span><span class="f_CodeExample">countryinfoservice = Namespace.ws?.countryinfoservice();</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">if </span><span class="f_CodeExample">(countryinfoservice) {</span><br />
|
||||
<span class="f_CodeExample">// Call the method to retrieve complete country information from an external service</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">const </span><span class="f_CodeExample">result = await countryinfoservice.FullCountryInfo({</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">sCountryISOCode: mysCountryISOCode</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">});</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">if </span><span class="f_CodeExample">(result && result.data && result.data.FullCountryInfoResult) {</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">const </span><span class="f_CodeExample">countryInfo = result.data.FullCountryInfoResult;</span><br />
|
||||
<span class="f_CodeExample">// Check if languages and their properties are available before displaying them</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">const </span><span class="f_CodeExample">languages = countryInfo.Languages?.tLanguage</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">? countryInfo.Languages.tLanguage</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">.filter(lang => lang.sName && lang.sISOCode)</span><br />
|
||||
<span class="f_CodeExample">// Filter the result to include only those languages for which the service has a country name and ISO code</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">.map(lang => `${lang.sName} (${lang.sISOCode})`)</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">.join(", ")</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">: "Information on languages is not available";</span><br />
|
||||
<span class="f_CodeExample">// Generate the formatted result</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">const </span><span class="f_CodeExample">formattedResult = `</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Full country information with ISO Code "${mysCountryISOCode}":</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Name: ${countryInfo.sName}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Country code: ${countryInfo.sISOCode}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Capital: ${countryInfo.sCapitalCity}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Phone code: +${countryInfo.sPhoneCode}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Continent: ${countryInfo.sContinentCode}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Currency code: ${countryInfo.sCurrencyISOCode}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Country flag: ${countryInfo.sCountryFlag}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Languages: ${languages}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">`;</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Context.data.countryinfo += formattedResult;</span><br />
|
||||
<span class="f_CodeExample">// Upload flag image using the link received from the service</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">const </span><span class="f_CodeExample">newFlag = await Context.fields.flag.createFromLink(`flagOf${mysCountryISOCode}.jpg`, countryInfo.sCountryFlag!);</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">Context.data.flag = newFlag;</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">}</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">}</span><span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample" style="font-weight: bold;">catch </span><span class="f_CodeExample">(error) {</span><br />
|
||||
<span class="f_CodeExample" style="color: #ffffff;"> </span><span class="f_CodeExample">}</span><br />
|
||||
<li value="4" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Нажмите на появившуюся в поле кнопку <span style="font-weight: bold;">Открыть</span>, чтобы перейти на вкладку <span style="font-weight: bold;">Скрипты</span> и задать следующий скрипт: </li></ol>
|
||||
<p class="p_CodeExample" style="white-space: normal; page-break-inside: avoid; page-break-after: avoid;"><span class="f_CodeExample">async function Show(): Promise<void> {</span><br />
|
||||
<span class="f_CodeExample"> Context.data.countryinfo = '';</span><br />
|
||||
<span class="f_CodeExample"> Context.data.flag = undefined;</span><br />
|
||||
<span class="f_CodeExample"> if (!Context.data.isocode) {</span><br />
|
||||
<span class="f_CodeExample"> return;</span><br />
|
||||
<span class="f_CodeExample"> }</span><br />
|
||||
<span class="f_CodeExample"> const mysCountryISOCode = Context.data.isocode;</span><br />
|
||||
<span class="f_CodeExample"> try {</span><br />
|
||||
<span class="f_CodeExample">// Обращение к созданному в модуле внешнему сервису</span><br />
|
||||
<span class="f_CodeExample"> const countryinfoservice = Namespace.ws?.countryinfoservice();</span><br />
|
||||
<span class="f_CodeExample"> if (countryinfoservice) {</span><br />
|
||||
<span class="f_CodeExample">// Вызов метода получения полных данных по стране из внешнего сервиса</span><br />
|
||||
<span class="f_CodeExample"> const result = await countryinfoservice.FullCountryInfo({</span><br />
|
||||
<span class="f_CodeExample"> sCountryISOCode: mysCountryISOCode</span><br />
|
||||
<span class="f_CodeExample"> });</span><br />
|
||||
<span class="f_CodeExample"> if (result && result.data && result.data.FullCountryInfoResult) {</span><br />
|
||||
<span class="f_CodeExample"> const countryInfo = result.data.FullCountryInfoResult;</span><br />
|
||||
<span class="f_CodeExample">// Проверка наличия языков и их свойств перед отображением</span><br />
|
||||
<span class="f_CodeExample"> const languages = countryInfo.Languages?.tLanguage</span><br />
|
||||
<span class="f_CodeExample"> ? countryInfo.Languages.tLanguage</span><br />
|
||||
<span class="f_CodeExample"> .filter(lang => lang.sName && lang.sISOCode) </span><br />
|
||||
<span class="f_CodeExample">// Фильтрация результата, чтобы учесть только те языки, для которых в сервисе есть название страны и ISO-код</span><br />
|
||||
<span class="f_CodeExample"> .map(lang => `${lang.sName} (${lang.sISOCode})`)</span><br />
|
||||
<span class="f_CodeExample"> .join(", ")</span><br />
|
||||
<span class="f_CodeExample"> : "Информация о языках недоступна";</span><br />
|
||||
<span class="f_CodeExample">// Генерация форматированного результата</span><br />
|
||||
<span class="f_CodeExample"> const formattedResult = `</span><br />
|
||||
<span class="f_CodeExample"> Полная информация о стране с ISO Code "${mysCountryISOCode}":</span><br />
|
||||
<span class="f_CodeExample"> Название: ${countryInfo.sName}</span><br />
|
||||
<span class="f_CodeExample"> Код страны: ${countryInfo.sISOCode}</span><br />
|
||||
<span class="f_CodeExample"> Столица: ${countryInfo.sCapitalCity}</span><br />
|
||||
<span class="f_CodeExample"> Телефонный код: +${countryInfo.sPhoneCode}</span><br />
|
||||
<span class="f_CodeExample"> Континент: ${countryInfo.sContinentCode}</span><br />
|
||||
<span class="f_CodeExample"> Код валюты: ${countryInfo.sCurrencyISOCode}</span><br />
|
||||
<span class="f_CodeExample"> Флаг страны: ${countryInfo.sCountryFlag}</span><br />
|
||||
<span class="f_CodeExample"> Языки: ${languages}</span><br />
|
||||
<span class="f_CodeExample"> `;</span><br />
|
||||
<span class="f_CodeExample"> Context.data.countryinfo += formattedResult;</span><br />
|
||||
<span class="f_CodeExample">// Загрузка изображения флага по полученной из сервиса ссылке </span><br />
|
||||
<span class="f_CodeExample"> const newFlag = await Context.fields.flag.createFromLink(`flagOf${mysCountryISOCode}.jpg`, countryInfo.sCountryFlag!);</span><br />
|
||||
<span class="f_CodeExample"> Context.data.flag = newFlag;</span><br />
|
||||
<span class="f_CodeExample"> }</span><br />
|
||||
<span class="f_CodeExample"> }</span><br />
|
||||
<span class="f_CodeExample"> } catch (error) {</span><br />
|
||||
<span class="f_CodeExample"> }</span><br />
|
||||
<span class="f_CodeExample">}</span></p>
|
||||
<h3 class="p_Heading3"><span class="f_Heading3">Step 4. Publish the customized widget</span></h3>
|
||||
<p class="p_Normal">After customization, the widget in the interface designer may look like this:</p>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 0;"><img alt="soap-service-4" width="949" height="329" style="margin:0;width:949px;height:329px;border:none" src="soap-service-4.png"/></p>
|
||||
<p class="p_Normal">To make it available for use, click <span style="font-weight: bold;">Save </span>and<span style="font-weight: bold;"> Publish</span> in the top panel of the interface designer.</p>
|
||||
<h3 class="p_Heading3"><span class="f_Heading3">Step 5. Add the widget to a page</span></h3>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 0;">Once the widget is published, it can be placed on the system app pages and forms. To do this:</p>
|
||||
<h3 class="p_Heading3"><a id="step-4-piblish-widget" class="hmanchor"></a><span class="f_Heading3">Шаг 4. Публикация настроенного виджета</span></h3>
|
||||
<p style="margin: 0 0 11px 0;">После настройки виджет в дизайнере интерфейсов может выглядеть следующим образом:</p>
|
||||
<p style="margin: 0 0 11px 0;"><img alt="soap-service-4" width="991" height="363" style="margin:0;width:991px;height:363px;border:none" src="soap-service-4.png"/></p>
|
||||
<p style="margin: 0 0 11px 0;">Чтобы он стал доступен для использования, нажмите <span style="font-weight: bold;">Сохранить</span> и <span style="font-weight: bold;">Опубликовать </span>на верхней панели дизайнера интерфейсов.</p>
|
||||
<h3 class="p_Heading3"><a id="step-5-create-page" class="hmanchor"></a><span class="f_Heading3">Шаг 5. Добавление виджета на страницу</span></h3>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">После публикации виджета его можно размещать на страницах и формах приложений системы. Для этого:</p>
|
||||
<ol style="list-style-type:decimal">
|
||||
<li value="1" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Make sure that the custom module in which the widget is created is enabled. </li><li value="2" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Go to any workspace and <span style="color: #0000ff;"><a href="360009924451.html" class="topiclink">create a new page</a></span>.</li><li value="3" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Open the page in the interface designer.</li><li value="4" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">On the <span style="font-weight: bold;">Template</span> tab, in the list of widgets, find the <span style="font-weight: bold;">Country information</span> widget created in the module and drag it to the modeling canvas.</li><li value="5" style="text-align: justify; line-height: 1.20; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Save and publish the page.</li></ol>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 0;">On the ready page with the widget, users will be able to enter standardized ISO codes of countries and get full information about them from the web service.</p>
|
||||
<p style="text-align: justify; line-height: 1.20; margin: 0 0 11px 0;"><img alt="soap-service-5" width="833" height="454" style="margin:0;width:833px;height:454px;border:none" src="soap-service-5.png"/></p>
|
||||
<li value="1" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Убедитесь, что пользовательский модуль, в котором создан виджет, включён. </li><li value="2" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Перейдите в любой раздел и <a href="360009924451.html" class="topiclink">создайте новую страницу</a>.</li><li value="3" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Откройте страницу в дизайнере интерфейсов. </li><li value="4" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">На вкладке <span style="font-weight: bold;">Шаблон</span> в списке виджетов найдите созданный в модуле виджет <span style="font-weight: bold;">Данные страны</span> и перетащите его на поле для моделирования. </li><li value="5" style="line-height: 1.28; margin-top: 0; margin-right: 0; margin-bottom: 11px;">Сохраните и опубликуйте страницу.</li></ol>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;">На готовой странице с виджетом пользователи смогут вводить стандартизированные ISO-коды стран и получать полную информацию о них из веб-сервиса.</p>
|
||||
<p style="line-height: 1.28; margin: 0 0 11px 0;"><img alt="soap-service-5" width="1009" height="505" style="margin:0;width:1009px;height:505px;border:none" src="soap-service-5.png"/></p>
|
||||
|
||||
<div class="bottom-nav">
|
||||
|
||||
@ -225,7 +228,7 @@
|
||||
|
||||
</div>
|
||||
<!-- добавляет на страницу строку блок Была ли статья полезной? -->
|
||||
<div class="feedback" id="feedback"><div class="feedback-help"><span><b>Was this helpful?</b></span><form action="" method="POST" class="feedback-form" id="feedback-form"><div class="feedback__popup feedback__popup-response" id="feedback__popup_thx" style="display: none;">Thanks for your feedback!</div><div class="feedback__popup" id="feedback__popup_why" style="display: none;"><div class="feedback__popup-header">Please specify why:</div><input type="radio" name="category" id="bad_recommendation" value="bad_recommendation"><label for="bad_recommendation">Recommendations did not help me</label><input type="radio" name="category" id="difficult_text" value="difficult_text"><label for="difficult_text">Article is hard to understand</label><input type="radio" name="category" id="no_answer" value="no_answer"><label for="no_answer">Didn`t answer my question</label><input type="radio" name="category" id="bad_header" value="bad_header"><label for="bad_header">Content does not match the topic</label><input type="radio" name="category" id="other_reason" value="other_reason"><label for="other_reason">Other</label></div><div class="feedback__popup" id="feedback__popup-other" style="display: none;"><div class="feedback__popup-header">How we can improve it?</div><textarea class="feedback__textarea" name="other" id=""></textarea><input type="submit" class="feedback__other-btn" value="Submit"></div><div class="feedback-form__btn-group"><input type="radio" name="useful" id="feedback__useful_yes" value="true"><label for="feedback__useful_yes"><img src="like.svg" class="small-img" alt="like"><spanclass="feedback-form__btn-group_yes-btn">Yes</spanclass="feedback-form__btn-group_yes-btn"></label><input type="radio" name="useful" id="feedback__useful_no" value="false"><label for="feedback__useful_no"><img src="dislike.svg" class="small-img" alt="dislike"><spanclass="feedback-form__btn-group_no-btn">No</spanclass="feedback-form__btn-group_no-btn"></label></div><select name="category"><option disabled="">Please specify why</option><option value="bad_recommendation" selected="">Recommendations did not help me</option><option value="difficult_text">Article is hard to understand</option><option value="no_answer">Didn`t answer my question</option><option value="bad_header">Content does not match the topic</option><option value="other_reason">Other</option></select><input type="submit"></form></div><div class="found_typo"><p style="margin: 0px; margin-top: 16px !important;"><span><b>Found a typo?</b></span> Select it and press <i>Ctrl+Enter</i> to send us feedback</p></div></div>
|
||||
<div class="feedback-wrap"><div class="feedback" id="feedback"><span><b>Была ли статья полезной?</b></span><form action="" method="POST" class="feedback-form" id="feedback-form"><div class="feedback__popup feedback__popup-response" id="feedback__popup_thx">Спасибо за ваш отзыв!</div><div id="feedback-success-popup"><div class="wrap"><button type="button" class="feedback-popup-close">×</button><svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_212_2187)"><path d="M22 0.6875C10.2294 0.6875 0.6875 10.2294 0.6875 22C0.6875 33.7706 10.2294 43.3125 22 43.3125C33.7706 43.3125 43.3125 33.7706 43.3125 22C43.3125 10.2294 33.7706 0.6875 22 0.6875ZM22 40.5625C11.8023 40.5625 3.4375 32.3078 3.4375 22C3.4375 11.8024 11.6922 3.4375 22 3.4375C32.1977 3.4375 40.5625 11.6922 40.5625 22C40.5625 32.1976 32.3078 40.5625 22 40.5625ZM34.1713 16.933L18.6613 32.3186C18.257 32.7197 17.604 32.7171 17.203 32.3128L9.82283 24.873C9.42176 24.4686 9.42434 23.8157 9.82867 23.4146L10.5609 22.6884C10.9652 22.2873 11.6181 22.2899 12.0192 22.6942L17.9468 28.6697L31.9926 14.7366C32.3969 14.3356 33.0498 14.3382 33.4509 14.7425L34.1772 15.4747C34.5783 15.879 34.5757 16.532 34.1713 16.933Z" fill="#27AE60"></path></g><defs><clipPath id="clip0_212_2187"><rect width="44" height="44" fill="white"></rect></clipPath></defs></svg><p>Ваш отзыв успешно отправлен!</p><span>Спасибо за обратную связь.</span></div></div><div class="feedback__popup" id="feedback__popup_why"><button type="button" class="feedback-popup-close">×</button><div class="feedback__popup-header">Уточните, почему:</div><input type="radio" name="category" id="bad_recommendation" value="bad_recommendation"><label for="bad_recommendation">Рекомендации не помогли</label><input type="radio" name="category" id="difficult_text" value="difficult_text"><label for="difficult_text">Текст трудно понять</label><input type="radio" name="category" id="no_answer" value="no_answer"><label for="no_answer">Нет ответа на мой вопрос</label><input type="radio" name="category" id="bad_header" value="bad_header"><label for="bad_header">Содержание статьи не соответствует заголовку</label><input type="radio" name="category" id="other_reason" value="other_reason"><label for="other_reason">Другая причина</label></div><div class="feedback__popup" id="feedback__popup-other"><button type="button" class="feedback-popup-close">×</button> <div class="feedback__popup-header">Расскажите, что вам не понравилось в статье:</div><textarea class="feedback__textarea" name="other" id=""></textarea><input type="submit" class="feedback__other-btn" value="Отправить"></div><div class="feedback-form__btn-group"><input type="radio" name="useful" id="feedback__useful_yes" value="true"><label for="feedback__useful_yes"><img src="like.svg"/><span class="feedback-form__btn-group_yes-btn">Да</span></label><input type="radio" name="useful" id="feedback__useful_no" value="false"><label for="feedback__useful_no"><img src="dislike.svg"/><span class="feedback-form__btn-group_no-btn">Нет</span></label></div><select name="category"><option disabled>Выберите вариант</option><option value="bad_recommendation" selected>Рекомендации не помогли</option><option value="difficult_text">Текст трудно понять</option><option value="no_answer">Нет ответа на мой вопрос</option><option value="bad_header">Содержание статьи не соответствует заголовку</option><option value="other_reason">Другая причина</option></select><input type="submit"></form></div></div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
@ -233,7 +236,7 @@
|
||||
<input type="checkbox" />
|
||||
<div class="article__arrow"></div>
|
||||
<div class="table-of-contents elma365-right" id="toc2Content">
|
||||
<h3 class="h3-toc">In this topic</h3>
|
||||
<h3 class="h3-toc">В этой статье</h3>
|
||||
<nav id="toc2"></nav>
|
||||
</div>
|
||||
</aside>
|
||||
@ -244,30 +247,63 @@
|
||||
<div class="footer-container">
|
||||
<div class="footer-mobile">
|
||||
|
||||
<ul class="footer-mobile__list"><li><a href="https://brix365.com/en/" target="_blank">BRIX</a></li><li><a href="https://tssdk.brix365.com/en/latest/" target="_blank">SDK</a></li><li><a href="https://api.brix365.com/en/" target="_blank">API</a></li></ul><ul class="footer-mobile__list"><li><a href="https://brix365.com/en/help/platform/get-trial.html">Platform</a></li><li><a href="https://brix365.com/en/help/ecm/ecm-functions.html">ECM</a></li><li><a href="https://brix365.com/en/help/service/service-functions.html">Service</a></li><li><a href="https://brix365.com/en/help/projects/projects-functions.html">Projects</a></li></ul>
|
||||
<ul class="footer-mobile__list"><li><a href="https://api.elma365.com/ru/" target="_blank">API</a></li><li><a href="https://tssdk.elma365.com/" target="_blank">TS SDK</a></li><li><a href="https://community.elma365.com/" target="_blank">Community</a></li><li><a href="https://elma-academy.com/ru/elma365" target="_blank">Академия</a></li></ul><ul class="footer-mobile__list"><li><a href="https://elma365.com/ru/help/platform/get-trial.html">Платформа</a></li><li><a href="https://elma365.com/ru/help/ecm/ecm-functions.html">ECM</a></li><li><a href="https://elma365.com/ru/help/service/service-functions.html">Service</a></li><li><a href="https://elma365.com/ru/help/projects/projects-functions.html">Проекты</a></li></ul>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="footer-wrap">
|
||||
|
||||
<div><span class="mobile-question-popup">Send feedback</span><form method="POST" action class="question__popup question-xs" id="question__popup"><div class="question-wrap"><span class="close"></span><span class="title">Ask a question</span><label for="help_question" style="display: none;"></label><textarea name="help_question" id="help_question"></textarea><input type="submit" value="Send"></div></form><div class="hidden fade-in question-success-xs">Sent</div></div>
|
||||
|
||||
<div class="footer-flex-b">
|
||||
<span class="footer-copy">© 2025 BRIX</span>
|
||||
<ul class="footer-list">
|
||||
|
||||
<li class="footer-item">
|
||||
<a href="#" class="arrow-top" style="display: block;"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="container">
|
||||
<div class="footer-wrap">
|
||||
|
||||
<div><span class="mobile-question-popup">Отправить фидбэк</span><form method="POST" action class="question__popup question-xs" id="question__popup"><div class="question-wrap"><span class="close"></span><span class="title">Задать вопрос</span><label for="help_question" style="display: none;"></label><textarea name="help_question" id="help_question"></textarea><input type="submit" value="Отправить"></div></form><div class="hidden fade-in question-success-xs">Ваш фидбэк отправлен.</div></div>
|
||||
|
||||
<div class="footer-flex-b">
|
||||
<div class="footer-top">
|
||||
<span class="footer-copy">© 2025
|
||||
ELMA365
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
<a href="https://navigator.sk.ru/orn/1122971" target="_blank">
|
||||
<img src="sk-resident.svg" alt="sk icon" class="footer-img" width="117" height="34">
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="footer-line">
|
||||
|
||||
<div class="footer-line-copy">
|
||||
<span class="footer-copy">© 2025
|
||||
ELMA365
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ul class="footer-list">
|
||||
|
||||
<li class="footer-item"><a href="https://elma365.com/ru/" target="_blank" class="footer-link" style="color: #0D4A75;"><img src="browse.svg" alt="browse icon" class="footer-img">elma365.com</a></li><li class="footer-item"><a href="https://www.youtube.com/user/ELMABPM" target="_blank" class="footer-link"><img src="yt.svg" alt="youtube icon" class="footer-img"></a></li><li class="footer-item"><a href="https://vk.com/elma_bpm" target="_blank" class="footer-link"><img src="vk.svg" alt="vk icon" class="footer-img"></a></li><li class="footer-item"><a href="https://t.me/elmaday" target="_blank" class="footer-link"><img src="tg.svg" alt="telegram icon" class="footer-img"></a></li><li class="footer-item"><a href="https://dzen.ru/elma" target="_blank" class="footer-link"><img src="dzen.svg" alt="dzen icon" class="footer-img"></a></li>
|
||||
|
||||
|
||||
<li class="footer-item">
|
||||
<a href="https://navigator.sk.ru/orn/1122971" target="_blank">
|
||||
<img src="sk-resident.svg" alt="sk icon" class="footer-img" width="117" height="34">
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#" class="arrow-top"></a>
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
<!-- <script type="text/javascript" src="jquery1.min.js"></script>-->
|
||||
<iframe name="hmnavigation" style="display:none!important"></iframe>
|
||||
<script src="./jquery-ui.js"></script>
|
||||
<!--<script src="./jquery-ui.js"></script> -->
|
||||
<script src="./jquery-ui.min.js"></script>
|
||||
<!--script src="//cdn.jsdelivr.net/npm/featherlight@1.7.14/release/featherlight.min.js" type="text/javascript" charset="utf-8"></script-->
|
||||
<script src="./jquery.tocify.min.js"></script>
|
||||
<script src="./TypoReporter.min.js"></script>
|
||||
|
Reference in New Issue
Block a user