11{
2- "name" : " _Channel-class" ,
3- "master" : false ,
4- "version" : " 1.0.0" ,
5- "description" : " Channel" ,
6- "schemas" : {
7- "104ad1f48518376" : {
8- "_id" : " 104ad1f48518376" ,
9- "_name" : " _Channel" ,
10- "_inherit" : [
11- " _Component"
12- ],
13- "_core" : true ,
14- "send" : " event" ,
15- "$systemInstalled" : " event" ,
16- "$systemResolved" : " event" ,
17- "$systemStarted" : " event" ,
18- "$systemStopped" : " event" ,
19- "$systemUninstalled" : " event"
20- }
21- },
22- "models" : {
23- "135c71078810af2" : {
24- "_id" : " 135c71078810af2" ,
25- "_name" : " _Channel" ,
26- "_core" : true ,
27- "send" : {
28- "params" : [
29- {
30- "name" : " message" ,
31- "type" : " message"
32- }
33- ]
34- },
35- "$systemInstalled" : {
36- "params" : [
37- {
38- "name" : " id" ,
39- "type" : " string" ,
40- "mandatory" : true ,
41- "default" : " "
42- }
43- ]
44- },
45- "$systemResolved" : {
46- "params" : [
47- {
48- "name" : " id" ,
49- "type" : " string" ,
50- "mandatory" : true ,
51- "default" : " "
52- }
53- ]
54- },
55- "$systemUninstalled" : {
56- "params" : [
57- {
58- "name" : " id" ,
59- "type" : " string" ,
60- "mandatory" : true ,
61- "default" : " "
62- }
63- ]
64- },
65- "$systemStarted" : {
66- "params" : [
67- {
68- "name" : " id" ,
69- "type" : " string" ,
70- "mandatory" : true ,
71- "default" : " "
72- }
73- ]
74- },
75- "$systemStopped" : {
76- "params" : [
77- {
78- "name" : " id" ,
79- "type" : " string" ,
80- "mandatory" : true ,
81- "default" : " "
82- }
83- ]
84- }
85- }
86- },
87- "behaviors" : {
88- "12e491859c13918" : {
89- "_id" : " 12e491859c13918" ,
90- "component" : " _Channel" ,
91- "state" : " $systemStarted" ,
92- "action" : " function $systemStarted(id) { \n var systems = null;\n \n if (id !== 'e89c617b6b15d24') {\n if (typeof document !== 'undefined') {\n systems = document.querySelectorAll('link[rel=system]');\n \n if ($state.get('runtime') && $state.get('runtime').state === 'ready') { \n } else {\n if (systems.length + 1 === $db._System.count()) {\n $component.get('runtime').ready();\n }\n }\n }\n }\n }" ,
93- "useCoreAPI" : true ,
94- "core" : true
2+ "name" : " _Channel-class" ,
3+ "master" : false ,
4+ "version" : " 1.0.0" ,
5+ "description" : " Channel" ,
6+ "schemas" : {
7+ "104ad1f48518376" : {
8+ "_id" : " 104ad1f48518376" ,
9+ "_name" : " _Channel" ,
10+ "_inherit" : [
11+ " _Component"
12+ ],
13+ "_core" : true ,
14+ "send" : " event" ,
15+ "$systemInstalled" : " event" ,
16+ "$systemResolved" : " event" ,
17+ "$systemStarted" : " event" ,
18+ "$systemStopped" : " event" ,
19+ "$systemUninstalled" : " event"
20+ }
9521 },
96- "1e9021bd4e1bc6e" : {
97- "_id" : " 1e9021bd4e1bc6e" ,
98- "component" : " _Channel" ,
99- "state" : " $systemInstalled" ,
100- "action": "function $systemInstalled(id) {\n var systems = null,\n dependencies = [],\n master = [],\n canStart = true;\n\n if (id !== 'e89c617b6b15d24') {\n // if all systems are installed\n systems = $db._System.find({});\n\n systems.forEach(function (system) {\n var sys = this.require(system._id);\n if (sys && sys.state && sys.state() === 'none') {\n canStart = false;\n }\n }.bind(this));\n\n // start all the systems\n if (canStart) {\n dependencies = $db._System.find({\n 'master': false\n });\n\n dependencies.forEach(function (dep) {\n var system = this.require(dep._id);\n channel = this.require('channel');\n\n if (system.state() === 'resolved') {\n system.state('starting');\n system.start();\n channel.$systemStarted(dep._id);\n system.state('active');\n }\n }.bind(this));\n\n master = $db._System.find({\n 'master': true\n });\n\n master.forEach(function (dep) {\n var system = this.require(dep._id);\n channel = this.require('channel');\n\n if (system && system.state && system.state() === 'resolved') {\n system.state('starting');\n system.start();\n channel.$systemStarted(dep._id);\n system.state('active');\n }\n }.bind(this));\n }\n }\n}",
101- "useCoreAPI" : true ,
102- "core" : true
103- }
104- },
105- "types" : {},
106- "components" : {
107- "_Channel" : {
108- "channel" : {
109- "_id" : " channel"
110- }
111- }
112- },
113- "_id" : " s16994193ac1f9ed"
114- }
22+ "models" : {
23+ "135c71078810af2" : {
24+ "_id" : " 135c71078810af2" ,
25+ "_name" : " _Channel" ,
26+ "_core" : true ,
27+ "send" : {
28+ "params" : [{
29+ "name" : " message" ,
30+ "type" : " message"
31+ }]
32+ },
33+ "$systemInstalled" : {
34+ "params" : [{
35+ "name" : " id" ,
36+ "type" : " string" ,
37+ "mandatory" : true ,
38+ "default" : " "
39+ }]
40+ },
41+ "$systemResolved" : {
42+ "params" : [{
43+ "name" : " id" ,
44+ "type" : " string" ,
45+ "mandatory" : true ,
46+ "default" : " "
47+ }]
48+ },
49+ "$systemUninstalled" : {
50+ "params" : [{
51+ "name" : " id" ,
52+ "type" : " string" ,
53+ "mandatory" : true ,
54+ "default" : " "
55+ }]
56+ },
57+ "$systemStarted" : {
58+ "params" : [{
59+ "name" : " id" ,
60+ "type" : " string" ,
61+ "mandatory" : true ,
62+ "default" : " "
63+ }]
64+ },
65+ "$systemStopped" : {
66+ "params" : [{
67+ "name" : " id" ,
68+ "type" : " string" ,
69+ "mandatory" : true ,
70+ "default" : " "
71+ }]
72+ }
73+ }
74+ },
75+ "behaviors" : {
76+ "12e491859c13918" : {
77+ "_id" : " 12e491859c13918" ,
78+ "component" : " _Channel" ,
79+ "state" : " $systemStarted" ,
80+ "action" : " function $systemStarted(id) { \n var systems = null;\n \n if (id !== 'e89c617b6b15d24') {\n if (typeof document !== 'undefined') {\n systems = document.querySelectorAll('link[rel=system]');\n \n if ($state.get('runtime') && $state.get('runtime').state === 'ready') { \n } else {\n if (systems.length + 1 === $db._System.count()) {\n $component.get('runtime').ready();\n }\n }\n }\n }\n }" ,
81+ "useCoreAPI" : true ,
82+ "core" : true
83+ },
84+ "1e9021bd4e1bc6e" : {
85+ "_id" : " 1e9021bd4e1bc6e" ,
86+ "component" : " _Channel" ,
87+ "state" : " $systemInstalled" ,
88+ "action": "function $systemInstalled(id) {\n var systems = null,\n dependencies = [],\n master = [],\n canStart = true;\n\n if (id !== 'e89c617b6b15d24') {\n // if all systems are installed\n systems = $db._System.find({});\n\n systems.forEach(function (system) {\n var sys = this.require(system._id);\n if (sys && sys.state && sys.state() === 'none') {\n canStart = false;\n }\n }.bind(this));\n\n // start all the systems\n if (canStart) {\n dependencies = $db._System.find({\n 'master': false\n });\n\n dependencies.forEach(function (dep) {\n var system = this.require(dep._id);\n channel = this.require('channel');\n\n if (system.state() === 'resolved') {\n system.state('starting');\n system.start();\n channel.$systemStarted(dep._id);\n system.state('active');\n }\n }.bind(this));\n\n master = $db._System.find({\n 'master': true\n });\n\n master.forEach(function (dep) {\n var system = this.require(dep._id);\n channel = this.require('channel');\n\n if (system && system.state && system.state() === 'resolved') {\n system.state('starting');\n system.start();\n channel.$systemStarted(dep._id);\n system.state('active');\n }\n }.bind(this));\n }\n }\n}",
89+ "useCoreAPI" : true ,
90+ "core" : true
91+ }
92+ },
93+ "types" : {},
94+ "components" : {
95+ "_Channel" : {
96+ "channel" : {
97+ "_id" : " channel"
98+ }
99+ }
100+ },
101+ "_id" : " s16994193ac1f9ed"
102+ }
0 commit comments