Learning
Documentation
Community
Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / %ZEN.DataModel.DataModel
Private  Storage   

%ZEN.DataModel.DataModel


abstract class %ZEN.DataModel.DataModel extends
%RegisteredObject

This is the abstract base class used by all model classes within the Zen Model-View-Controller mechanism.
Subclasses of this class are used to implement the Model portion of the Zen Model-View-Controller mechanism.
A DataModel class provides a generic mechanism to take data values from one or more sources (such as from a persistent object, external database, or directly from a global) and place these values into the properties of the DataModel.

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 3 20


Summary


Properties
%id %seriesCount %seriesNames

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DeleteModel %DispatchClassMethod %DispatchGetModified %DispatchGetProperty
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%Extends %GetParameter %GetPropertyInfo %InvokeAction
%IsA %IsModified %IsReadOnly %New
%NormalizeObject %ObjectModified %OnDeleteModel %OnDeleteSource
%OnGetPropertyInfo %OnInvokeAction %OnLoadModel %OnNewSource
%OnOpenSource %OnSaveSource %OnStoreModel %OnSubmit
%OpenModel %OriginalNamespace %PackageName %RemoveFromSaveSet
%SaveModel %SerializeObject %SetModified %SubmitHandler
%ValidateObject

Subclasses
%DeepSee.ResultSet %ZEN.DataModel.ObjectDataModel Ens.MetricModel

Parameters


• parameter READONLYMODEL = 0;
If this parameter is true, then this is a read-only data model. Instances of this data model cannot be saved or deleted.

Properties


• property %id as %ZEN.Datatype.string(XMLPROJECTION="NONE") [ Transient ];
The ID value used to identify a specific instance of DataModel object.
The form and possible values of the ID are up the implementor of a specific DataModel class.
• property %seriesCount as %ZEN.Datatype.integer(XMLPROJECTION="NONE") [ InitialExpression = 1,Transient ];
Number of data series contained within the data model.
• property %seriesNames as %ZEN.Datatype.string(XMLPROJECTION="NONE") [ MultiDimensional,Transient ];
An array containing the display names for data series subscripted by series number (1-based).

Methods


• classmethod %DeleteModel(pID As %String) as %Status
Delete a given DataModel instance.
This is implemented by the subclasses of this class.
• classmethod %GetPropertyInfo(Output pList As %String, pExtended As %Boolean = 0, pContainer As %String = "") as %Status
Return a list describing the properties within this DataModel.
These are returned as an array of the form:
pList(propname) = seqno
seqno, if present, is the ordinal position of this control on the form.
If pExtended is true (1), then the array will include additional nodes for each property. This information is used to create dynamic forms for this model. The extra nodes may include:
pList(name,"%type") = suggested control type for dynaForm<.br> pList(name,"size") = size used for controls.
pList(name,"group") = id of group within dynaForm to place control.
pContainer is the name of the containing property if this data model is embedded in another data model object.
• final method %InvokeAction(pAction As %String, pData As %String) as %Status
Invoke a user-defined named action on this model object.
The actual work of perfoming the action is carried out by the %OnInvokeAction callback method.
• classmethod %IsReadOnly() as %Boolean
Returns whether this data model class is readonly.
• classmethod %OnDeleteModel(pID As %String) as %Status
This callback method is invoked when the DataModel is deleted. This is implemented by the subclasses of this class.
• classmethod %OnDeleteSource(pID As %String) as %Status
This callback method is called when the DataModel is deleted. If implemented, it is responsible for making the appropriate deletes against the data source.
• abstract classmethod %OnGetPropertyInfo(pIndex As %Integer, ByRef pList As %String, pExtended As %Boolean = 0) as %Status
This callback method, if present, is called by the %GetPropertyInfo method. This gives subclasses the opportunity to add additional property descriptions to the DataModel.
pIndex is the number of elements (plus one) already in the list. This should be used as a starting sequence number when adding new properties to the list.
• method %OnInvokeAction(pAction As %String, pData As %String) as %Status
Invoke a user-defined named action on this model object.
This is implemented by the subclasses of this class.
• method %OnLoadModel(pSource As %RegisteredObject) as %Status
This callback method does the actual work of loading values from the data source into this DataModel object.
• method %OnNewSource(Output pSC As %Status = $$$OK) as %RegisteredObject
This callback method is invoked when a DataModel needs a new instance. If implemented, it opens a new (unsaved) instance of the data source object used by the DataModel.
• method %OnOpenSource(pID As %String, pConcurrency As %Integer = -1, Output pSC As %Status = $$$OK) as %RegisteredObject
This callback method is invoked when a DataModel is opened. If implemented, it opens an instance of the data source object used by the DataModel.
• method %OnSaveSource(pSource As %RegisteredObject) as %Status
This callback method is called when the DataModel is saved. If implemented, it is responsible for saving changes to the data source.
• method %OnStoreModel(pSource As %RegisteredObject) as %Status
This callback method does the actual work of copying values from the DataModel to the data source.
• method %OnSubmit(pSubmit As %ZEN.Submit) as %Status
If defined, this callback is called when a form connected to this DataModel is submitted.
The contents of this DataModel will be filled in from the submitted values before this callback is invoked.
• classmethod %OpenModel(pID As %String, pConcurrency As %Integer = -1, Output pSC As %Status = $$$OK) as %RegisteredObject
Create an in-memory instance of a DataModel object and load data into it properties.
This is implemented by the subclasses of this class. The signature of this method is designed to match the %OpenId method of persistent classes.
• method %SaveModel() as %Status
Save the data in this instance of DataModel back to its original source, if possible.
This is implemented by the subclasses of this class.
• classmethod %SubmitHandler(pSubmit As %ZEN.Submit) as %Status
Internal method.
If a form connected to this DataModel is submitted, this method handles the server-side processing of the submit.