![]() Overview Installation VTL reference Configuration Java reference Velosurf FAQ |
VTL referencePlain keywords represent actual names of properties or methods, while keywords in italic stand for user variables and indicate their type. The r and w tags mean that an attribute is readable and/or writable (in the sense of the Velocity template language, i.e. an attribute is read by referencing it, and modified using the #set directive). All methods that take a 1. Database attributes and methods :$db.entity_name r : entity.
$db.root_attribute_name r : root attribute or root action. The value of an action is the number of affected rows.
$db.error r : last error message encountered. We generally know that an error has occured when one of the methods returns null or false.
2. Entity attributes and methods :$entity.order w : use this attribute to specify an order before issuing a #foreach directive on this entity. Reseted in every context. Pass it an empty string to reset it manually.
$entity.refine("sql-condition") : use this method to specify an additionnal SQL condition before issuing a #foreach directive on this entity. Can be called several times. Reseted in every context.
$entity.clearRefinement( ) : clear any refinement clauses for this entity
$entity.fetch(value) : returns the instance defined by the value of its unique primary key, or null otherwise.
The following entity methods are not advised in a MVC architecture. $entity.update(values_map) : update a row in this entity's table. Velosurf will ensure all key columns are specified, to avoid an accidental massive update.
$entity.delete(values_map) : delete a row from this entity's table. Velosurf will ensure all key columns are specified, to avoid an accidental massive delete.
$entity.insert(values_map) : insert a new row in this entity's table.
$entity.lastInsertID : last inserted ID, for entities with only one primary key column, autoincremented. 3. Attribute attributes and methods :Only multivalued attributes can be referenced from templates. Others are directly evaluated when referenced. 4. Action attributes and methods :An action has no attribute and no method. It is executed when referenced, and returns the number of affected rows. 5. Instance attributes and methods :$instance.entity r : the name of this instance's entity, or null if it's a generic instance.
$instance.column_name r,w : gives the scalar value of this column for this row, or sets its value. The writable form of the previous attribute, as long as the following methods, are not advised in a MVC architecture. $instance.update(values_map) : update the row of this instance, from passed values. Velosurf will ensure all key columns are specified, to avoid an accidental massive update. |