Building a GUI for a Translator Component in Lua
Contents
This describes how best to get started writing a custom GUI for your own Translator components using Iguana. I provide an example which you can download from here and run. The documentation below talks about different parts of the code and explains how it works.
Hello World Web Application
This part describes the basics in getting a simple web application written using the Translator in terms of mechanics of creating a From HTTP(S) channel, taking HTTP calls from and serving up data to a browser.
- Create a From HTTP component, this will receive the web calls that we use to implement the GUI.
- Hello world script, the shell of simple web app.
- Invoking the application
- Import an HTTP request from the logs
Fully Worked Example
Then load up this fully worked example zip Configure_Web_Example.zip Translator instance that you can import as an Iguana Translator instance. This leverages a variety of concepts which as described below:
- High level overview
- How the GUI looks
- The method table handler system for dispatching calls from the browser
- The templating system and using Google closure to compress the Javascript in production
- It uses HTTP basic authentication to put a username and password on the script, in this case “admin” and “password”
- It parses the IguanaConfiguration.xml file to get a list of channels with To Translator components and the associated unique GUID for each one
- Define a configuration file in XML which the GUI can load and save to
- JSON calls between Iguana and the GUI in Javascript
- Creating a link from the custom GUI into the channel being configured, this gives your users an easy way to visually see how the configuration is working
The potential really does exist to make for a very convenient high level work flow, but with a simplicity of being able to quickly ‘get under the hood’ to see what is happening when things go wrong.