General
- All objects are grouped in classes
- Every object can be identified using class name and id
- Each class has corresponding table in database
- Class consists of
- Fields
- Methods
- Events
- All fields are described in metadictinary
- type
- default place on the generic form
- parameters for generic form
- All methods are described in metadictinary
- parameters
- type (change|select)
- code (C|JavaScript)
- Methods can be defined using C or JavaScript (script methods)
- Methods are inherited from parents
- All events are described in metadictinary
- Events can be on_userAction or on_methodCall
- Events on_methodCall can be before or after, pe: on_before_update
- Events can be handled ONLY by scripts
- Root class is Generic
- Object methods of Generic class:
- get - returns one object (type select)
- update - updates one object (type change)
- delete - soft deletes one object (type change)
- undelete (type change)
- purge - permanent delete (type change)
- getRelatedTableData -- returns all data related to this objects for given relation
- Group methods of Generic class:
- select - returns Recordset of objects (type select)
- Class methods of Generic class:
- getSchema -- returns schema or meta definisions for this class (type select)
- getRelatedTables -- returns names and foreign_column_names of related tables
- Genric class fields:
- id
- deleted -- 1 for deleted 0 for not deleted
- version -- current object version number, used for conflict detection during updates
Layers of the system:
W1 -- client layer (DOM+HTML)
W2 -- application server layer (Apache + shared objects)
W3 -- database (PostgreSQL)
Rules regarding W1:
- Generaly code is compatible with DOM2 (this is the goal) and is preliminarly tested on Mozilla
- All clients have to implement these Protocol methods:
- show_error(string)
- co_refresh(recordSet)
- co_delete(recordSet)
- co_insert(recordSet)
- recordSet is Object created this way:
var o=new Object();
var o.class_name="class_name";
var