Build Your Own
How to Create an Extension for Kirix Strata
You can create an extension for Kirix Strata™ by packaging a script together with an XML file, called "info.xml." This XML file contains the information required to load and run the script as an extension in Strata.
Strata extensions are stored and distributed as ".kxt" files. These are simply .zip files with a .kxt file extension. To put together a new .kxt file, start by creating an empty .zip file and add your script files, info.xml and any other resources into it. Finally, change the file extension from ".zip" to ".kxt".
In order for an extension to work, your .kxt file must contain at least two items:
- info.xml - An XML file with the metadata for the extension. See an example of this type of file below.
In addition to these two required files, you can package additional resources in the .kxt file to use with your extension, such as:
- A bitmap file to display a graphic in Strata's Extension Manager.
- Other resource files that you would like to use, such as HTML templates, data files, etc.
After you've put together a .kxt file, you can add it to Strata by selecting Extensions from the Tools menu. An Extension Manager will appear; click the Add Extensions button to add your extension to the list. Going forward, every time Strata loads, it will automatically launch your extension and run the code you have in "main.js".
Putting Together a "Hello, World" Extension
To make a "Hello, world" extension, the first step is to create a script in Strata that displays the text "Hello, world". Fortunately, this involves just a few steps and a single line of code:
- Click New in the File menu, and select Script from the set of options
- Add the following line to the new script:
- Select Save from the File menu and then name the saved file "Hello_world"
At this point, you can press <Alt-Enter> to run this script; it should display an message box that says "Hello, world". If this works properly, select Save As External from the File menu and save this file as "main.js" on your local drive.
The next step is to create an "info.xml" file for the extension. To do this, open Notepad or another text editor and cut and paste the following text into it:
<description>Display a Hello World alert message.</description>
Next, save this file as "info.xml" in the same area where you put "main.js" (NOTE: if you use Notepad, be sure to change the "Save as type" option to "All Files", so that it saves as an XML file).
Finally, you just need to package everything together as a .kxt file:
- Create a .zip file on your local drive called "Hello_world.zip"
- Add "main.js" and "info.xml" to "Hello_world.zip"
- Change the name of "Hello_world.zip" to "Hello_world.kxt"
The "Hello, world" extension is now complete. To add this extension to Strata, select Extensions from the Tools menu, click Add Extensions and finally select the "Hello_world.kxt" file.
After adding "Hello_world.kxt" to the Extensions area in Strata, you can run it immediately by clicking the Start Now button. Additionally, after you close Strata, the next time you open it, this extension will run automatically. Of course, this gets old quickly, and so you can remove the extension from Strata by selecting Extensions from the Tools menu and clicking the Uninstall button for "Hello World".
For further information, including a scripting overview, sample scripts and API documentation, please see the Developer Resources section, which includes a more detailed example on creating your own "Hello World" application . In addition, you can use the Extension Wizard to package an extension, create sample script components and generate sample applications.
Also, please feel free to contact us or post a message on our support forums if you have any questions about scripting or extensions; we're happy to help!