JSON Entity V1
JSON based entities are items which are stored as JSON. This is used in the history, in dynamic-entities in the DB and more.
Description
- As of now, it's using a envolope to package everything and includes a minimal header to ensure we know it's V1.
- It then contains an
Entity
node containing- various identification and description
- attributes / properties
- optional Entity Metadata
- optional Assets
Example
This example is an extract of the Config Content-Type to manage the SqlDataSource (will be releasen in 2sxc 9.8 with more help-text etc.):
{
"_": {
"V": 1
},
"Entity": {
"Id": 42900,
"Version": 6,
"Guid": "e8a702d2-eccd-4b0f-83bd-600d8a8449d9",
"Type": {
"Name": "DataPipeline",
"Id": "DataPipeline"
},
"Attributes": {
"String": {
"Description": {
"*": "Retrieve full list of all zones"
},
"Name": {
"*": "Zones"
},
"StreamsOut": {
"*": "ListContent,Default"
},
"StreamWiring": {
"*": "3cef3168-5fe8-4417-8ee0-c47642181a1e:Default>Out:Default"
},
"TestParameters": {
"*": "[Module:ModuleID]=6936"
}
},
"Boolean": {
"AllowEdit": {
"*": true
}
}
},
"Owner": "dnn:userid=1",
"Metadata": [
]
}
}
Format Explained
_
(header) mainly storing the version, in case we have to introduce a breaking change - see also format v1Entity
- this marks an entity - at the moment a json package should only have 1, but later it could contain moreId
- the identity as a numberGuid
- the identity guid as a stringType
- type information objectName
- the type nameId
- the type identity (Static Name) as a string. It's usually a guid, but special types can also use a specific string
Attributes
- the values of this entityString
- all the string values; optional, only exists if there are string values- [the field name] - an object containing languages/values, see JSON Values
- [more fields / languages / values]
- [the field name] - an object containing languages/values, see JSON Values
Boolean
- all the boolean values; optional, only exists if there are boelean valuesNumber
- all numbers; optional, only exists if there are number values- [more types]
Owner
a special string identifying the owner of this itemMetadata
(optional, array of more entities) - a list of Entities which further describe this Entity - see JSON Metadata V1- [item 1]
Id
Guid
- [more properties]
- [next items]
- [item 1]
For
object optional, metadata target reference - see JSON Metadata V1Assets
object optional for including template files in View-exports - see JSON Assets V1
All Attributes are Grouped by Type
Because JSON is itself a very loose data-format, and certain types like dates are not auto-detectable, we decided to have the type-specification as a first-class citizen in the format. This allows for automatic, reliable type-checking when materializing objects.
Values and Languages
👉 JSON Value (Multilanguage) V1
Metadata
👉 JSON Metadata V1
Read also
History
- Added in 2sxc 9.4
- Extended to support attachments so Views can include templates and icons in 2sxc ca. v11.10