Les JSON d’action et de projet dans Epicraft

Edit me

Intro

An Epicraft project is described and stored as a JSON tree. Each node has an identifier and its own properties. Each action is (mainly) applied to a single node.

Library used to manage the tree: https://github.com/Epiconcept-Paris/nodetree-js

Action

{
	"meta": {
		"date": 1523281168324,
		"id": "rciupalohy1523281168324",
		"author": "toto"
	},
	"project": "chzjfsckgm1517405717197",
	"operator": "alter",
	"id": "qgqdylxhdi1523281159718",
	"type": "component",
	"parameters": {
		"attributes": {
			"label": "Un nouveau label"
		}
	}
}
Property What’s its use
meta Metadata (for example: the action identifier)
project Id of the related project
operator Type of change
id Id of the modified element
type Type of the modified element
parameters Contains changes, “attributes” and / or “position”

Structure.json

This is a complete description of the project represented as a tree.

Structure.json

Caution, there are unused nodes obsolete at the higher level: “variables”, “navigation”.

{
	"id": "cinuzwujjw1523286817148",
	"attrs": {
		"type": "project",
		"name": "Project de test"
	},
	"child": [
		{
			"id": "dicos",
			"attrs": {
				"type": "storage"
			},
			"child": []
		},
		{
			"id": "variables",
			"attrs": {
				"type": "storage"
			},
			"child": []
		},
		{
			"id": "pages",
			"attrs": {
				"type": "storage"
			},
			"child": [
				{
					"id": "pphxuucmjx1523286817154",
					"attrs": {
						"type": "component",
						"name": "Nouvelle Page",
						"varset": "varset_u0y1",
						"render-type": "form",
						"varsetLabel": "",
						"subtype": "page"
					},
					"child": []
				}
			]
		},
		{
			"id": "navigation",
			"attrs": {
				"type": "storage"
			},
			"child": []
		},
		{
			"id": "archives",
			"attrs": {
				"type": "storage"
			},
			"child": []
		},
		{
			"id": "resources",
			"attrs": {
				"type": "storage"
			},
			"child": []
		},
		{
			"id": "project_meta_node",
			"attrs": {
				"type": "meta",
				"updated_at": 1523286817156,
				"updated_by": ""
			},
			"child": []
		}
	]
}

Project

{
	"id": "chzjfsckgm1517405717197",
	"attrs": {
		"type": "project",
		"name": "another one"
	},
	"child": [...]
}

Dico

{
	"id": "gewmkfjgeh1521538330100",
	"attrs": {
		"type": "dico",
		"name": "yorn",
		"value": [
			{
				"id": "pkpvqtchzx1521538349014",
				"code": "yes",
				"label": "Yes"
			},
			{
				"id": "krpklgtndp1521538349014",
				"code": "no",
				"label": "NO"
			}
		]
	}
}

Page

{
	"id": "uzmgyioqzn1517405717202",
	"attrs": {
		"type": "component",
		"name": "Fiche patient",
		"varset": "patient",
		"render-type": "form",
		"varsetLabel": "",
		"subtype": "page"
	},
	"child": [...]
}

Archived variable

{
	"id": "rxggvvaghw1523282210162",
	"attrs": {
		"subtype": "textfield",
		"name": "patient_name",
		"label": "Nom du patient",
		"specificLabel": "",
		"render-type": "textfield",
		"length": "50",
		"defaultValue": "",
		"metadata": [],
		"belongToVarset": "patient",
		"type": "component"
	},
	"child": []
}