This page gives the reference of the Velosurf configuration file syntax.
Don't be confused here, 'entity' and 'attribute' are both used as XML concepts and velosurf concepts... The velosurf entity has a corresponding XML entity, the velosurf attribute has a corresponding XML entity, and both have XML attributes.
The configuration file follows this DTD.
In brief:
startup is executed when Velosurf is initialized.result XML attribute describes their resultThe following table describes the meaning of all XML attributes per XML entity.
| XML entity | XML attribute | syntax | default value | meaning |
| database | user | string | (required) | database account login |
| database | password | string | (required) | database account password |
| database | url | string | (required) | database URL |
| database | driver | java_class_name | (none) | database driver class - if not specified, Velosurf will try to deduce it from the database URL |
| database | schema | string | (none) | schema used, if any |
| database | read-only | yes | no | yes | entities default access mode, read-only or read-write |
| database | caching | none | soft | full | none | default caching method |
| database | case | sensitive | uppercase | lowercase | (driver-dependant) | case-sensivity policy used by Velosurf: sensitive, uppercase or lowercase(1) |
| database | reverse | none | partial | tables | full | full | degree of reverse engineering: in 'partial' mode, only the tables corresponding to entities listed in the configuration file are reverse engineered - in 'full' mode, all tables and foreign keys are reverse engineered |
| database | loglevel | trace | debug | info | warn | error | info | logging level, from the most verbose to the less verbose |
| database | min-connections | integer | 1 | the initial number of connections in the connection pool |
| database | max-connections | integer | 50 | the maximum number of connections in the connection pool |
| database | seed | string | database url | seed of the encryption engine random generator |
| entity | name | string | (required) | entity name; if it is the name of an existing table, the columns of the table will automatically become attributes of this entity |
| entity | table | string | entity name | use this attribute if the table name and the entity name are to be different |
| entity | read-only | yes | no | yes | access mode, read-only or read-write |
| entity | class | java_class_name | velosurf.context.Instance | java class used to map an instance of this entity |
| entity | caching | none | soft | full | (none) | caching method: none, soft (automatic with respect to memory) or full (only cleared on Entity.clearCache() calls) |
| entity | obfuscate | column [,column...] | (none) | columns that will be obfuscated |
| entity | localize | column [,column...] | (none) | columns that will be localized |
| attribute | name | string | (required) | attribute name, can overload an existing column |
| attribute | result | scalar | row[/entity] | rowset[/entity] | (none) | result type: scalar, single row or row set ; in the last two cases, the resulting entity can be specified, so that other attributes can be called on the result; in the first case (scalar), the engine will return the value found in the first column of the first row. |
| action | name | string | (required) | Action name. If present, the root startup action is performed when Velosurf is initialized. |
| constraint | column | string | (required) | name of this entity's column the constraint is to be applied to |
| constraint | type | integer | number | date | email | (none) | expected data type - short syntax |
| constraint | min-len | positive integer | (none) | minimum length - short syntax |
| constraint | max-len | positive integer | (none) | maximum length - short syntax |
| constraint | min | integer | (none) | minimum value (implies 'number' data type if none specified) - short syntax |
| constraint | max | integer | (none) | maximum value (implies 'number' data type if none specified) - short syntax |
| constraint | after | YYYYMMDD | (none) | data must be a date >= this value (implies 'date' type if none specified) - short syntax |
| constraint | before | YYYYMMDD | (none) | data must be a date <= this value (implies 'date' type if none specified) - short syntax |
| constraint | not-empty | true | false | false | data must not be null or empty - short syntax |
| constraint | not-null | true | false | false | data must not be null - short syntax |
| constraint | one-of | value[,value...] | false | data must be one of the supplied values - short syntax |
| constraint | reference | table.column | (none) | data must be present in table.column - short syntax |
| constraint | regex | pattern | (none) | data must follow the provided pattern - short syntax |
| integer | min | integer | (none) | minimum value - long syntax |
| integer | max | integer | (none) | maximum value - long syntax |
| integer | message | string | field {0}: '{1}' is not in the valid range | message to display when constraint fails |
| number | min | number | (none) | minimum value - long syntax |
| number | max | number | (none) | maximum value - long syntax |
| number | message | string | field {0}: '{1}' is not in the valid range | message to display when constraint fails |
| min-len | value | positive integer | (required) | minimum length - long syntax |
| min-len | message | string | field {0}: '{1}' is not in the valid range | message to display when constraint fails |
| max-len | value | positive integer | (required) | maximum length - long syntax |
| max-len | message | string | field {0}: '{1}' is not in the valid range | message to display when constraint fails |
| date | after | YYYYMMDD | (none) | data must be a date >= this value - long syntax |
| date | before | YYYYMMDD | (none) | data must be a date <= this value - long syntax |
| date | message | string | field {0}: '{1}' is not a valid date or is outside range | message to display when constraint fails |
| check-dns | true | false | false | whether to issue a DNS lookup query to check the validity of the email | |
| check-smtp | true | false | false | whether to issue an SMTP login to check the validity of the email | |
| message | string | field {0}: '{1}' is not a valid email | message to display when constraint fails | |
| not-null | message | string | field {0} cannot be null | message to display when constraint fails |
| not-empty | message | string | field {0} cannot be empty | message to display when constraint fails |
| one-of | message | string | field {0}: value '{1}' must be one of: value,... | message to display when constraint fails |
| value | specifies a value for the long syntax form of the <one-of> constraint (text content) | |||
| reference | foreign-key | table.column | (required) | data must be present in table.column - long syntax |
| reference | message | string | field {0}: value '{1}' not found in table.column | message to display when constraint fails |
| regex | pattern | string | (required) | data must follow the provided pattern - long syntax |
| regex | message | string | field {0}: value '{1}' is not valid | message to display when constraint fails |
(1) This case-sensivity parameter indicates the policy that Velosurf must follow with SQL keywords (tables and columns) when speaking with the relational database. It should mimic the behaviour the database engine has with its metadata tables, and the default is chosen depending on the database vendor when known (see DriverInfo.java). It is one of:
sensitive: It does not necessarily mean that the database is case-sensitive,
only that Velosurf won't issue any conversion.
uppercase: Entities and attributes are case-insensitive; all identifiers will be stored
internally and passed to the JDBC driver as uppercase strings
(references in templates and names in the configuration file are then case-insensitive).
lowercase: Same as above, lowercase.
velosurf.case Java system property.