servREC
(service in module tri
)
Specific I/O services for REC mode tables
This service also contains many of the common functions with servTBL directly accessed by the
support routines via the servREC. prefix.
Refer to Record Storage for a description of the record modes and to servCRUD for the API common functions.
Used internally for the retrieval and update methods to maintain the cache of Data Objects when they are organized as chunks. See Records Storage to understand 'chunks'.
oTP – {Object} –
The Table.props where the object array is store.
objs – {Object[]} –
The array of Data Objects to store.
chunk – {number} –
The chunk index relative to 0.
Used internally. The oCol type is assumed to be 'property'. The user is prompted to
name a unique property within the oCol properties array. When validated a key of the returned user value is created
of null value. Used to create key/value pairs within a column of type 'property'.
The validation cycle is used later to validate the value of a key/value pair.
oTP – {Object} –
The Table.props values where the column array is stored
oCol – {Object} –
The dynamic Col object
Used internally. Returns the Col object whose col property
matches the sCol parameter. Null is returned if not found.
oTP – {Object} –
The Table.props values where the column array is stored
sCol – {string} –
The column name to find
{Object}
– oCol The dynamic Col object if found or null if not found.
Gets the current editor for the current selected Data Object. In actuality this is the $scope pointer for the Edit Controller.
{Object}
– The standard or replacement Edit Controller used to edit the current Data Object.
Used internally. Returns the model name for a given column.
oCol – {Object} –
The dynamic Col object
{string}
– A 'ng-model=...' suitable for insertion into an HTML input element.
Used internally. For each Col object whose type property matches the sType col property the
related select method is called. The accumulated results are returned.
scope – {Object} –
The scope to use
schema – {Object} –
The related sub-schema to use.
sType – {string} –
The type to match against
{Object[]}
– The accumulated return values of the Col object select method
Used internally. Returns the array of Data Object rows within oObj that belong to oSchema.base.
Refer to the Deps.js source code as an example. Used to allow editing of an array of Data Object objects
belonging to a single Data Object object.
scope – {Object} –
The scope to use
oObj – {Object} –
The Data Object containing the rows.
oSchema – {Object} –
The related sub-schema to use.
{Object[]}
– The rows within oObj of property oSchema.base
Used internally. For each Col object whose type property matches the sType col property the
related select method is called. The accumulated results are returned.
scope – {Object} –
The scope to use
oTP – {Object} –
The Table.props values where the column array is stored
sType – {string} –
The type to match against
{Object[]}
– The accumulated return values of the Col object select method
Sets the current editor for the current selected Data Object.
ctrl – {Object} –
The standard or replacement Edit Controller used to edit the current Data Object.
Used internally to insert a record into the Data Object cache. If the oaa is null a new Data Object is inserted.
When bInter is true the saveRecords function is not invoked.
Used when several objects must be updated (such as a cheque renumbering pass) before persisting. Not supported in chunked mode.
See Record Storage to understand 'chunks'.
oTP – {Object} –
The Table.props cache where the object array is stored.
obj – {Object} –
The Data Object to insert.
oaa – {Object} –
The Object Access Address. A string or number determining the insert point. See Record Storage for a description of oaa.
bInter – {Boolean} –
When true the update is intermediate with more to follow. Therefore do not update invoke the saveRecords function.
Used when several objects must be updated (such as a cheque renumbering pass) before persisting.
Returns whether the service type combines the individual JSON objects into an array for storage and retrieval.
{Boolean}
– Always returns true.
Used internally. Returns the referenced value in Col oneOf related table based on the setting of
the Data Object column.
oObj – {Object} –
The Data Object
oCol – {Object} –
The dynamic Col object
oCol is assumed to have the oneOf property which points to another Table
{string}
– The mapped value
Used internally to cause updates to show correctly on the display by resetting the cache and mapped objects as well as a hidden input field that display screens can create dependencies against.
sig – {string} –
Caller id to aid diagnostics in the log file
oTP – {Object} –
The current Table.props where the cache is stored.
Used internally to refresh the Data Objects cache from the server.
oTP – {Object} –
The Table.props cache where the object array is stored.
Used internally. The oCol type is assumed to be 'property'. After confirming with the user through a prompt
the property within the oCol properties array of key sKey is removed.
The validation cycle is used later to validate the requirements of having a key/value pair for sKey.
oTP – {Object} –
The Table.props values where the column array is stored
oCol – {Object} –
The dynamic Col object
sKey – {string} –
The name of the property key value.
Used internally to persist reords to the localStorage cache and the data storage on the server.
oTP – {Object} –
The Table.props cache where the object array is stored.
oRecs – {Object} –
The Data Object array to insert.
sRecName – {string} –
The record name used as the third component of the object key.
sLSName – {string} –
The localStorage name. Null means there is no localStorage copy such as for User records.
bRfsh – {Boolean} –
When true the update is intermediate with more to follow. Therefore do not update invoke the saveRecords function.
Used when several objects must be updated (such as a cheque renumbering pass) before persisting.
Sets the servREC oCRUD pointer to crud so the servREC has access to the common routines. Required to prevent circular definitions.
crud – {Object} –
Pointer to servCRUD.
Used internally for the retrieval and update methods to maintain the cache of Data Objects.
oTP – {Object} –
The Table.props where the object array is stored.
objs – {Object[]} –
The array of Data Objects to store.
Used internally. If present the oCol showList value is returned. Otherwise true is returned.
oCol – {Object} –
The dynamic Col object
{Boolean}
– true is returned if the column should be shown in 'list' mode.