1,007
edits
Line 85: | Line 85: | ||
== dataStoreInfo == | == dataStoreInfo == | ||
dataStoreInfo provides parameters for the initialization of a client-side SQLite database table. | dataStoreInfo provides parameters for the initialization of a client-side SQLite database table which will be used to store the events that your experiment records. It's basically a schema description, that is fed to an object-relational mapper built into the extension. | ||
Your Observer objects (see below) will get passed a Store object, and whenever they want to record an event, they'll pass an event object into {{{Store.storeEvent();}}}. The info you provide in {{{dataStoreInfo}}} determines how the properties of this event object get mapped to the columns in the database. | |||
{{{dataStoreInfo}}} must have the following properties (all required): | |||
* fileName: The name of the file where the SQLite database should be kept (inside the user's profile directory). It should be as descriptive as possible and end with ".sqlite". | * fileName: The name of the file where the SQLite database should be kept (inside the user's profile directory). It should be as descriptive as possible and end with ".sqlite". | ||
* tableName: The name of the database table to create inside this file. It should be descriptive and must not have spaces. | * tableName: The name of the database table to create inside this file. It should be descriptive and must not have spaces. | ||
* columns: An array of objects, each describing a single database column. The properties that each column object must specify are as follows: | * columns: An array of objects, each describing a single database column. The properties that each column object must specify are as follows: | ||
** property: | ** property: The | ||
** type | ** type | ||
** displayName: | ** displayName: | ||
** displayValue (optional): | ** displayValue (optional): | ||
** default (not yet implemented): | |||
=== How to store stuff in the data store === | |||
== webContent == | == webContent == | ||
== Observer == | == Observer == |
edits