Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter FourteenProject Functions (continued)

ProjectRegisterValidator Function

Overview

The ProjectRegisterValidator function allows a script to be hooked into a validator slot to validate a specific file type.

Syntax/Parameters

Syntax

string = ProjectRegisterValidator ( string type, [string script] );

Parameters

type

A string specifying the file type (see Section 6.10 File Types).

script

An optional string specifying script file name to run the hook. If the value is omitted, the calling script name will be used.

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure.

Remarks

The project validator will call either the validate_file() or validate_mapped_text() event handlers, depending on whether the file has been opened by the editor. If a validator already exists, calling this function will replace that validator’s hook.

Example

The following example is a subroutine that will load all document filenames, types, and descriptions into a table:

int main () {                                             // Main Entry (IDE)
    return ERROR_NONE;
    }                                                     // end default entry

int setup() {                                             // Called from Application Startup
    string              s1;

    s1 = GetApplicationExecuteFolder();                   // Application folder
    s1 += "Form ABS-EE\\ABS-EE XML Validate.ls";          // Set the validator
    ProjectRegisterValidator("FT_XML_ABS_AUTOLEASE", s1); // Auto Lease
    ProjectRegisterValidator("FT_XML_ABS_AUTOLOAN", s1);  // Auto Loan
    ProjectRegisterValidator("FT_XML_ABS_CMBS", s1);      // Commercial Mortgage
    ProjectRegisterValidator("FT_XML_ABS_DS", s1);        // Debt Securities
    ProjectRegisterValidator("FT_XML_ABS_RMBS", s1);      // Residential Mortgage
    return ERROR_NONE;                                    // Return value (does not matter)
    }                                                     // end setup

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL