Configuration Examples: sMash Resource Model
This is what a sMash resource model looks like. Models describe resource attributes and optionally define collections and filter conditions. This is a model for a “person” which would correspond to an MDM Server TCRMPersonBObj. sMash provides GUI tools to create these models. For my MDM Server application in this environment, I’m creating one resource model for each enity of interest, e.g. person, contract,product, etc.
Models by intention present a simplified, flattened out view of the entity. That is, they won’t include all of the attributes or all of the nested object relationshipships. (MDM Server flattens out objects too, by the way. Look at the difference between a TCRMPersonSearchResultBObj and a TCRMPersonBObj.)
/app/resources/personModel.json:
{
“fields”: {
“FirstName”: {
“label”: “First Name”,
“required”: false,
“type”: “string”,
“description”: “”,
“default_value”: “”,
“max_length”: 50
},
“LastName”: {
“label”: “Last Name”,
“required”: false,
“type”: “string”,
“description”: “”,
“default_value”: “”,
“max_length”: 50
},
“Phone”: {
“label”: “Phone.Listing”,
“required”: true,
“type”: “string”,
“description”: “”,
“default_value”: “”,
“max_length”: 50
},
“SocSecNo”: {
“label”: “Soc Sec No”,
“required”: false,
“type”: “string”,
“description”: “”,
“default_value”: “”,
“max_length”: 50
},
/* …Attributes Omitted…*/
“id”: {
“label”: “Id”,
“required”: false,
“type”: “string”,
“description”: “”,
“default_value”: “”,
“max_length”: 50
}
},
“collections”: {
}
}