Home Applications xml-to-udl

xml-to-udl

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
4
1 reviews
0
Awards
272
Views
0
IPM installs
0
1
Details
Releases
Reviews
Issues
Pull requests
Videos
Articles
This app has a demo View
A tool to convert studio exports to ObjectScript sources.

What's new in this version

  • the image is now available on the GitHub registry - so there is no need to build the image locally
  • the docker container stops automatically after the conversion is finished
  • the README now includes a short demo video on how to use the tool

XML-to-UDL

A docker image that allows you to convert a InterSystems Studio export (.xml) into UDL format used by the InterSystems ObjectScript extension for VS Code and the atelier API (without using the IRIS Studio).

Prerequisites

Make sure you have Git and Docker Desktop installed. Windows users should use the PowerShell for executing the following docker commands (e.g. ${pwd} only works in the PowerShell).

Features

  • Docker container that starts a IRIS instance which converts a Studio export to sources and stops afterwards
  • generation of sources within seconds using only one command
  • preparation of the Studio export content for version control with Git
  • generation of folder hierarchy based on the class names
  • handling of the most common file types (for example ".cls", ".lut", ".hl7", ".inc", ".gbl").
  • convenient use in combination with the VS Code Extensions from InterSystems

Good to know

The tool was created based on our own project requirements and will be developed further as needed. Among other things, it creates a folder hierarchy based on the class name. So the class "App.TCPTestServiceRoutingRule" mentioned in the export is created as follows "src/App/TCPTestServiceRoutingRule.cls".

This results in a problem with a folder name "CON" because no folder with this name can be created on Windows machines. If this occurs, the tool ensures that the folder is renamed to "C0N". Please consider this behavior if your Studio export contains the path "CON" at any point.

Usage

Pull the image.

docker pull ghcr.io/hbtgmbh/xml-to-udl/converter:latest

Add a Studio export file (.xml) in any arbitary directory and add a folder named "src".

Replace <YOUR_STUDIO_EXPORT> with the filename of your export file and execute the following command in this directory.

docker run -v "${pwd}/<YOUR_STUDIO_EXPORT>.xml:/irisrun/export.xml" -v "${pwd}/src:/irisrun/udl-export" --rm ghcr.io/hbtgmbh/xml-to-udl/converter

After the conversion is finished you should now see the generated sources under "src".

Examples

You can find a sample studio export in this repository.
This export contains samples of the most common file types (for example ".cls", ".lut", ".hl7", ".inc", ".gbl").

It's a good practice to use this tool in combination with the ObjectScript Docker template. This template already provides a "src" directory. So you just need to clone/forke this template for your project, add the studio export to the root directory and execute:

docker run --rm -v "${pwd}/studio-export.xml:/irisrun/export.xml" -v "${pwd}/src:/irisrun/udl-export" xml-to-udl:latest

After generating the source files it's quite easy to use version control with Git and keep track of your changes during the project.
A short video that demonstrates this example is published in the xml-to-udl GitHub repository.

Read more
Made with
Version
1.0.107 Feb, 2023
ObjectScript quality test
Category
Developer Environment
Works with
InterSystems IRIS
First published
24 Jan, 2023
Last checked by moderator
27 Jun, 2023Works