RT 5.0.7 Documentation

RT::Initialdata::JSON

NAME

RT::Initialdata::JSON - Support for JSON-format initialdata files

DESCRIPTION

RT supports pluggable parsers for initialdata in different source formats. This module supports JSON.

Perl-based initialdata files can contain not just data, but also Perl code that executes when they are processed. The JSON format is purely for data serialization and does not support code sections.

Files used with this handler must be UTF-8 encoded text containing a valid JSON structure. See http://json.org for JSON syntax specifications.

CanLoad($json)

This is called by base RT to determine if an initialdata file is whatever type is associated with this module. It must return true or false. Takes one arg, the content of the file to check.

Load($data, \@Var, ...)

This is the main routine called when initialdata file handlers are enabled. It is passed the file contents and refs to the arrays that will be populated from the file. If the file parsing fails, due to invalid JSON (generally indicating that the file is actually a Perl initialdata file), the sub will return false.

← Back to index