Skip to content

JavaScript Editor ​

The JavaScript Editor is the built-in code editor used throughout OIE for writing filter rules, transformer steps, channel scripts, and code templates. It is built on the RSyntaxTextArea library and provides syntax highlighting, auto-completion, and other features to aid development.

Features ​

Syntax highlighting ​

The editor provides color-coded syntax highlighting for JavaScript, including OIE-specific keywords and variables such as msg, tmp, connectorMap, channelMap, logger, FileUtil, DateUtil, and map shorthand functions ($c, $g, $s, $r, etc.).

Auto-completion ​

Press Ctrl+Space to open the auto-completion popup. It provides suggestions for:

  • Built-in JavaScript functions and objects
  • OIE utility classes and methods (ChannelUtil, DateUtil, FileUtil, DatabaseConnectionFactory, SMTPConnectionFactory, etc.)
  • Variable map methods (channelMap.put, globalMap.get, etc.)
  • Code template functions available in the current context

Auto-completion can also be triggered automatically after typing certain characters (. by default). These settings are configurable under Code Editor Preferences.

Find and replace ​

Ctrl+F opens the Find / Replace dialog:

  • Find text / Replace with: Search and replace fields with history dropdowns
  • Direction: Forward or Backward
  • Wrap Search: Search wraps around the end of the file
  • Match Case: Toggle case sensitivity
  • Regular Expression: Use regular expressions for search patterns
  • Whole Word: Match whole words only

Code folding ​

Collapse and expand code blocks:

  • Click the fold icons in the gutter (left margin)
  • Collapse functions, if/else blocks, loops, and other block structures
  • Use the Folding submenu in the context menu or keyboard shortcuts to collapse/expand folds

Context menu ​

Right-click in the editor to access:

OptionDescription
Undo / RedoUndo/redo recent changes
Cut / Copy / Paste / DeleteStandard clipboard operations
Select AllSelect all code in the editor
Find/ReplaceOpen the find/replace dialog
Find NextFind the next occurrence
Clear Marked OccurrencesClear highlighted search results
FoldingSubmenu: Collapse Fold, Expand Fold, Collapse All Folds, Collapse All Comment Folds, Expand All Folds
DisplaySubmenu: Show Tab Lines, Show Whitespace, Show Line Endings, Wrap Lines
CodeSubmenu: Format Code, Toggle Comment
MacroSubmenu: Begin Macro, End Macro, Playback Macro
View User APIOpen the User API documentation

Keyboard shortcuts ​

Default shortcuts (on Windows/Linux):

ShortcutAction
Ctrl+SpaceOpen auto-completion popup
Ctrl+FFind and Replace
Ctrl+GFind Next
Ctrl+ZUndo
Ctrl+YRedo
Ctrl+/Toggle line comment
Ctrl+Shift+FFormat code
Ctrl+DDelete line
Ctrl+JJoin lines
Ctrl+[Go to matching bracket
Ctrl+ASelect all
Ctrl+-Collapse fold
Ctrl++Expand fold
TabIndent selected lines
Shift+TabUnindent selected lines

All keyboard shortcuts can be remapped under Settings > Administrator > Code Editor Preferences using the Shortcut Key Mappings table.

Reference list ​

Adjacent to the script editor, the Reference List panel provides quick access to categorized functions, code snippets, and variables. Use the Category dropdown to filter by category and the Filter field to search within the selected category.

Categories ​

  • Conversion Functions - Data format conversion helpers
  • Logging and Alerts - Logging and alert functions
  • Database Functions - Database connection and query helpers
  • Utility Functions - File I/O, routing, attachments, and other utilities
  • Date Functions - Date formatting and conversion
  • Message Functions - Message access and manipulation
  • Response Transformer - Response transformation helpers
  • Map Functions - Variable map operations
  • Channel Functions - Channel utility methods
  • Postprocessor Functions - Postprocessor-specific references
  • User Defined Code - User-created code templates (code type)
  • User Defined Functions - User-created code templates (function type)

Click an item to see its description, then drag it into the editor to insert the code.

Variables ​

Variables are included in the reference list alongside functions and code snippets. Which variables appear depends on the current script context. Examples include:

  • msg (inbound message in filter/transformer scripts), tmp (outbound template in filter/transformer scripts)
  • connectorMessage (in connector scripts)
  • message (completed message object in the postprocessor)
  • response, responseStatus, responseErrorMessage, responseStatusMessage (in response transformer scripts)
  • Map objects: connectorMap, channelMap, sourceMap, globalChannelMap, globalMap, configurationMap, responseMap
  • logger, router, alerts, replacer, contextFactory

Code editor preferences ​

Configure editor behavior in Settings > Administrator > Code Editor Preferences:

PreferenceDescription
Auto-Complete CharactersCharacters that trigger the auto-completion popup (default: .)
Include LettersIf enabled, auto-completion triggers after any letter is typed
Activation Delay (ms)Time to wait after typing a trigger character before showing the popup (default: 300 ms)
Shortcut Key MappingsTable of all remappable editor actions with their current keyboard shortcuts; double-click a shortcut to change it
Restore DefaultsReset all shortcut key mappings to their defaults