You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A prototype is just an instance of a model with some properties set to default values.
Purpose
The purpose of prototypes is to make it easier to create new instances of models, particularly through the DAO Controller GUI. Instead of the DAO Controller simply having a "Create" button, check if there are any prototypes for the "of" of the DAO (the model being stored in it) and add a dropdown to the create button that lets you create an instance with some of the properties set to default values.
For example: We could make a prototype of the foam.nanos.auth.User model where the group property is set to a default value of "business". This is a very simple prototype where only one property has a default value, but multiple properties could be set to default values.
Prototypes could also include custom views.
Implementation
Prototypes should be modelled and stored in prototypeDAO, which needs to be created. The model should have the following properties:
modelId
The model that this is a prototype of.
label
The label to display in the create dropdown.
prototype
An array of properties.
[optional] detailView
A view used in place of the normal DetailView for editing an instance.
The text was updated successfully, but these errors were encountered:
Definition
A prototype is just an instance of a model with some properties set to default values.
Purpose
The purpose of prototypes is to make it easier to create new instances of models, particularly through the DAO Controller GUI. Instead of the DAO Controller simply having a "Create" button, check if there are any prototypes for the "of" of the DAO (the model being stored in it) and add a dropdown to the create button that lets you create an instance with some of the properties set to default values.
For example: We could make a prototype of the
foam.nanos.auth.User
model where thegroup
property is set to a default value of "business". This is a very simple prototype where only one property has a default value, but multiple properties could be set to default values.Prototypes could also include custom views.
Implementation
Prototypes should be modelled and stored in
prototypeDAO
, which needs to be created. The model should have the following properties:modelId
The model that this is a prototype of.
label
The label to display in the create dropdown.
prototype
An array of properties.
[optional] detailView
A view used in place of the normal DetailView for editing an instance.
The text was updated successfully, but these errors were encountered: