Additional services for MFT. Community article.
- Download and import Installer into any Interoperability-enabled namespace.
- Execute:
write $System.Status.GetErrorText(##class(MFT.Installer).Install())
- Register on Yandex.
- Create Yandex App.
- Check
Веб-сервисы - Set Redirect URI:
http://Host:Port/csp/sys/oauth2/OAuth2.Response.cls(https, if UseSSL = 1, for development you can set it tohttp://localhost:57772/csp/sys/oauth2/OAuth2.Response.cls) - Give disk access
Яндекс.Диск REST API - Get
ID,Pass
- Check
- Execute:
write $System.Status.GetErrorText(##class(MFT.Yandex).Install(Login, ID, Pass, Host, Port, UseSSL))- Login - your Yandex email
- Host, Port - same as a callback
- UseSSL - use SSL for callback? Your server needs to support https
- Open
http://Host:Port/csp/sys/sec/%25CSP.UI.Portal.MFT.ConnectionList.zen - Press
Get Access Tokenand complete authorization. - If everything went fine the Status would be Authorized.
- Execute:
write $System.Status.GetErrorText(##class(MFT.Yandex).ConfigureProduction(yandexSource, fileDestination, fileSource, yandexDestination))yandexSourceиfileDestination- Yandex.Disk folder to download files from, they are stored in a local destination folder.fileSourceиyandexDestination- local folder from which files are uploaded to Yandex.Disk.- Important: Yandex.Disk folder names should end with
/(i.e.outin a disk root would be/out/)
- Open production
MFT.Productionand start it. - Add file(s) to
yandexSourceandfileSourceto see how it works.
- Загрузить Installer в любую область с Interoperability.
- Выполнить:
write $System.Status.GetErrorText(##class(MFT.Installer).Install())
- Зарегистрироваться на Yandex.
- Создать Yandex App.
- Выбирать платформу
Веб-сервисы - Прописать Redirect URI:
http://Host:Port/csp/sys/oauth2/OAuth2.Response.cls(https, если UseSSL = 1, для разработки можно указатьhttp://localhost:57772/csp/sys/oauth2/OAuth2.Response.cls) - Дать все права на
Яндекс.Диск REST API - Записать
ID,Pass
- Выбирать платформу
- Выполнить:
write $System.Status.GetErrorText(##class(MFT.Yandex).Install(Login, ID, Pass, Host, Port, UseSSL))- Login - почта
- Host, Port - хост и порт коллбэка авторизации
- UseSSL - использовать ли SSL для коллбэка
- Открыть
http://Host:Port/csp/sys/sec/%25CSP.UI.Portal.MFT.ConnectionList.zen - Нажать
Get Access Token, авторизоваться. - Если всё хорошо, то Status будет Authorized.
- Выполнить:
write $System.Status.GetErrorText(##class(MFT.Yandex).ConfigureProduction(yandexSource, fileDestination, fileSource, yandexDestination))yandexSourceиfileDestination- папка Яндекс.Диска из которой скачиваются файлы и локальная папка в которую они записываютсяfileSourceиyandexDestination- локальная папка из которой скачиваются файлы и папка Яндекс.Диска в которую они записываются- Важно: папки Яндкс.Диска должны заканчиваться на
/(например папкаoutв корне диска будет/out/)
- Открыть продукцию
MFT.Productionи запустить её. - Добавить файл(ы) в
yandexSourceиfileSourceдля демонстрации работы.