Project Files

Project Manager

The Project Manager panel is used to manage the local and shared files in your project.

The Project Manager consists of three sections:

  1. Local dependencies: Lists local files used by your script
  2. Shared modules: Lists Lua modules used by your script
  3. Other files: Lists non-Lua shared files used by your script

If the Project Manager panel is hidden, click Show Project Manager:

Shared Modules [top]

Shared Lua modules are can be used by any script in the same Iguana instance. Shared modules are stored in the “shared” directory in Iguana’s working directory (<working dir>\edit\<iguana user>\shared).

Adding a Module

To add a module to your project:

  1. In the Project Manager panel, click the [+] link that is located next to the shared folder:
  2. Then choose to Add, Create or Upload a file from the dialog box:

Tip: You can also add an existing module to your script by adding a require'<existing-module>' function call.

For example, this code will add stringutil.lua to the shared folder in the Project Manager panel:

Be aware that require() does not create new modules, it will only add existing modules. If you try to add a new module you will get an error.

Using Modules in Scripts

To include a module in your script, use a require function call.

For example, if we add require 'stringutil' then we can use the capitalize() function:

When we comment it out we get an error:

Editing Modules

To view and edit the code in a module, in the shared folder, click on the name of the module.

For example, if you click on stringutil the module code is displayed:

Removing a module

To remove a module, position the cursor over the arrow next to the module name, and click Remove in the menu that appears:

Note: Removing a module does not delete the it from your system.

Other menu options

Three other menu options are available:

  • Get: Export the file
  • Replace: Import and replace the existing file
  • Change History: View Commit History for the file

Other Shared Files [top]

Other shared files can also be used by any script in the same Iguana instance. Other shared files are stored in the “other” directory in Iguana’s working directory (<working dir>\edit\<iguana user>\other).

Adding Files

To add a file to your project:

  1. In the Project Manager panel, click the [+] link that is located next to the other folder:
  2. Then choose to Add, Create or Upload a file from the dialog box:

Note: This is most commonly used for adding VMD files, used by hl7.parse{} to parse HL7 messages. You can also add other files like: gif, png, js, css etc.

Edit a File

To view or edit file text, in the other folder, click on the name of the file. Iguana can edit any text based file (like css, js, html, etc.), however it cannot edit binary files (like exe, png, gif, etc.).

For example, a javascript file might look something like this:

Removing Files

To remove a file, position the cursor over the arrow next to the file name, and click Remove in the menu that appears:

Note: Removing a file does not delete the it from your system.

Other menu options

Three other menu options are available:

  • Get: Export the file
  • Replace: Import and replace the existing file
  • Change History: View Commit History for the file

Tip: Try exporting a VMD file and opening it with Chameleon, this is useful if you want to examine or update a VMD file that your script is using.

Local Files [top]

Local files can only used by the script they are created in (they are not shared with other components). Local files can be any type of file (Lua modules or other files). Local files are stored in the component directory for your channel in Iguana’s working directory (<working dir>\edit\<iguana user>\<generated name for channel+component>).

Tip: Local files are really good for sandboxing, this is where you make a local copy of a shared file and use it to test changes, without affecting other channels.

It is also the best place for files that are specific to the project and should not be shared with other channels, for example functions implementing business logic specific to the channel, VMD (or DBS) files that are specific to the channel, etc.

Adding Files

To add a file to your project:

  1. In the Project Manager panel, click the [+] link that is located at the top next to the Project Name:
  2. Then choose to Create or Upload a file from the dialog box:

Edit a File

To view or edit a local module or text file text, click on the name of the file. Iguana can edit any text based file (like css, js, html, etc.), however it cannot edit binary files (like exe, png, gif, etc.).

For example, a local stringutil.lua with test code might look something like this:

Removing Files

To remove a file, position the cursor over the arrow next to the file name, and click Remove in the menu that appears:

Note: Removing a file does not delete the it from your system.

Other menu options

Three other menu options are available:

  • Get: Export the file
  • Replace: Import and replace the existing file
  • Change History: View Commit History for the file

Leave A Comment?