ITPElementFactory

First, it is important to understand the way in which the class ITPElementFactory, of which the global variable itpelementfactory is an instance, constructs an object from a given info structure. The Xslt that produces the new output makes sure that each info structure has an attribute elementtype. Currently, there are 16 element types, one for each leave in the class hierarchy:

Element type

Description

page

The main page.

form

The main form

group

A group

submitbutton

A submit button

question_text

A text question

question_number

A numerical question

question_bool

A check box question

question_date

A date question

question_time

A time question

question_file

A file question

question_etbq

An editable text block question

question_ertb

An editable rich text block question

question_simplesingleselect

A single select question (no text blocks, no radio buttons)

question_radiosingleselect

A single select question (no text blocks, radio buttons)

question_simplemultiselect

A multi select question (no text blocks)

question_textblocksingleselect

A single select question (text blocks)

question_textblockmultiselect

A multi select question (text blocks)


Each class in the class hierarchy has an associated object type. Each class is registered with the global variable itpelementfactory by calling its function registerClass. Also, mappings between object types and element types can be registered, by calling the function registerMapping on itpelementfactory. For the general library this is done in the itpelementfactorymappings source. The combination of the two types of registration provides sufficient information for the class ITPElementFactory to construct an object from an info structure.