Documentation for class js_code (inherits from generic_acl):


Properties:

name type default params representant foreign foreign_prop position
id CO_INTEGER SEQUENCE READONLY=1;HIDDEN=1 0 0
version CO_INTEGER 0 READONLY=1;HIDDEN=1 0 0
deleted CO_INTEGER 0 READONLY=1;HIDDEN=1 0 0
inherits_acl CO_INTEGER 1 HIDDEN=1;READONLY=1 0 50
code CO_STRING '' ROWS=20;COLS=60 100 200

Methods:


method evaluate
description: This is one of the most important methods. It is responsible for evaluating all java script code. Method works like this: 1. reads code for given script if par_id==-2, no code is read from database However, libraries are still used as described below. 2. looks for //#uses: phrase 3. reads all names in uses: phrase 4. finds all libraries to include using select id from js_lib where name like from_uses_phrase 5. takes all ids from point 4 and reads all trees for this ids 6. creates one big string and passes it for execution REMARKS: there is no mechanism to detect repeated code in libs (will be in future) direct_code is used to pass code 'on fly' (not stored in database); prolog is executed before any libaries. it sould not depend on any libraries. libraries are used in code from database and direct_code (and library code is executed BEFORE database/direct code). CODE EXECUTION ORDER: prolog ("//#uses:..." in prolog is ignored) libraries (order???) direct_code OR code specified by par_id ("//#uses:..." describes libraries used) WARNING: If par_id is !=-2 (i.e. code is read from database AND direct_code is not NULL, then method behaviour is undefined and may change in the future versions. Library code fragments are evaluated separately; error messages are marked as follows: prolog <=> error in prolog code <=> error in submitted code (stored in database or direct) if NOT ASP asp <=> error in submitted code if evaluated as ASP library [] <=> error in library named , code fragment stored in js_code with id=
parameters:

par_area
type CO_STRING

par_class
type CO_STRING

par_id
type CO_INTEGER

prolog
type CO_STRING

asp
type CO_INTEGER

direct_code
type CO_STRING

direct_libs
type CO_STRING

in_params
type CO_POINTER

method_name
type CO_STRING

target_name
type CO_STRING


method createScript
description: Create new script TODO: precompile script
parameters:

par_area
type CO_STRING

par_class
type CO_STRING

par_id
type CO_INTEGER

code
type CO_STRING