Skip to content

Commit 6dff8cd

Browse files
committed
- update system-admin addon
- remove webType addon
1 parent 2aed0df commit 6dff8cd

File tree

13 files changed

+227
-255
lines changed

13 files changed

+227
-255
lines changed

addons/system-admin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"models":{"138a81fa1f16435":{"_id":"138a81fa1f16435","_name":"RuntimeAdmin","_inherit":["RuntimeComponent"],"_core":true,"start":{},"stop":{}},"135c71078810af2":{"_id":"135c71078810af2","_name":"RuntimeChannel","_inherit":["RuntimeComponent"],"sync":{},"loadSystem":{"params":[{"name":"system","type":"object"}]},"createSchema":{"params":[{"name":"id","type":"string"},{"name":"schema","type":"object"}]},"updateSchema":{"params":[{"name":"id","type":"string"},{"name":"schema","type":"object"}]},"deleteSchema":{"params":[{"name":"id","type":"string"}]},"createModel":{"params":[{"name":"id","type":"string"},{"name":"model","type":"object"}]},"updateModel":{"params":[{"name":"id","type":"string"},{"name":"model","type":"object"}]},"deleteModel":{"params":[{"name":"id","type":"string"}]},"createType":{"params":[{"name":"id","type":"string"},{"name":"type","type":"object"}]},"updateType":{"params":[{"name":"id","type":"string"},{"name":"type","type":"object"}]},"deleteType":{"params":[{"name":"id","type":"string"}]},"createComponent":{"params":[{"name":"collection","type":"string"},{"name":"component","type":"object"}]},"updateComponent":{"params":[{"name":"id","type":"string"},{"name":"collection","type":"string"},{"name":"component","type":"object"}]},"deleteComponent":{"params":[{"name":"id","type":"string"},{"name":"collection","type":"string"}]},"createBehavior":{"params":[{"name":"behavior","type":"object"}]},"updateBehavior":{"params":[{"name":"id","type":"string"},{"name":"behavior","type":"object"}]},"deleteBehavior":{"params":[{"name":"id","type":"string"}]}}},"schemas":{"10374180581a41f":{"_id":"10374180581a41f","_name":"RuntimeAdmin","_inherit":["RuntimeComponent"],"_core":true,"start":"method","stop":"method"},"104ad1f48518376":{"_id":"104ad1f48518376","_name":"RuntimeChannel","sync":"event","loadSystem":"event","createSchema":"event","updateSchema":"event","deleteSchema":"event","createModel":"event","updateModel":"event","deleteModel":"event","createType":"event","updateType":"event","deleteType":"event","createComponent":"event","updateComponent":"event","deleteComponent":"event","createBehavior":"event","updateBehavior":"event","deleteBehavior":"event"}},"types":{},"behaviors":{"1c00c107e01c9b3":{"_id":"1c00c107e01c9b3","component":"RuntimeAdmin","state":"start","action":"function start() {\n var RuntimeChannel = null,\n runtimeChannel = null;\n \n if (!this.require('channel-admin')) {\n RuntimeChannel = this.require('RuntimeChannel');\n runtimeChannel = new RuntimeChannel({\n '_id': 'channel-admin',\n '_core': true\n });\n \n runtimeChannel.on('send', function send(message) {\n localStorage.setItem('system-designer-message', JSON.stringify(message));\n });\n \n // schema change events\n runtimeChannel.on('createSchema', function createSchema(id, schema) {\n this.require('metamodel').schema(schema);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateSchema', function updateSchema(id, schema) {\n this.require('metamodel').type(schema);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteSchema', function deleteSchema(id) {\n $db.Runtime.remove({'_id': id});\n this.require('metamodel').create();\n }, true);\n \n // model change events\n runtimeChannel.on('createModel', function createModel(id, model) {\n this.require('metamodel').schema(model);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateModel', function updateModel(id, model) {\n this.require('metamodel').type(model);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteModel', function deleteModel(id) {\n $db['Runtime'].remove({'_id': id});\n this.require('metamodel').create();\n $component.removeFromMemory(id);\n }, true);\n \n // type change events\n runtimeChannel.on('createType', function createType(id, type) {\n this.require('metamodel').type(type);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateType', function updateType(id, type) {\n this.require('metamodel').type(type);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteType', function deleteType(id) {\n $db.RuntimeType.remove({'_id': id});\n this.require('metamodel').create();\n }, true);\n \n // component change events\n runtimeChannel.on('createComponent', function createComponent(model, component) {\n $db[model].insert(component);\n }, true);\n \n runtimeChannel.on('updateComponent', function updateComponent(id, collection, component) {\n $db[collection].update({'_id': id}, component);\n }, true);\n \n runtimeChannel.on('deleteComponent', function deleteComponent(id, collection) {\n $db[collection].remove({'_id': id});\n }, true);\n \n // behavior change events\n runtimeChannel.on('createBehavior', function createBehavior(component) {\n $db.RuntimeBehavior.insert(component);\n }, true);\n runtimeChannel.on('updateBehavior', function updateBehavior(id, behavior) {\n this.require(id).action(behavior.action);\n });\n runtimeChannel.on('deleteBehavior', function deleteBehavior(id) {\n $db.RuntimeBehavior.remove({'_id': id}); \n }, true);\n \n // System Designer event\n runtimeChannel.on('sync', function sync() {\n this.loadSystem(JSON.parse(this.require('db').system()));\n });\n\n window.addEventListener('storage', function (e) {\n if (e.key === 'system-designer-message') {\n $db.RuntimeMessage.insert(JSON.parse(e.newValue));\n }\n });\n \n this.require('logger').info('admin is started');\n } else {\n this.require('logger').info('admin is already started');\n }\n}","useCoreAPI":true,"core":true},"1d7151dd2d1558f":{"_id":"1d7151dd2d1558f","component":"RuntimeAdmin","state":"stop","action":"function stop() {\n}","useCoreAPI":true,"core":true}},"components":{"RuntimeAdmin":{"admin":{"_id":"admin","_core":true}}},"name":"system-admin","version":"0.4.0","description":"Runtime Component administration ","_id":"18ed81de331252c","master":false,"subsystem":false}
1+
{"models":{"138a81fa1f16435":{"_id":"138a81fa1f16435","_name":"RuntimeAdmin","_inherit":["RuntimeComponent"],"_core":true,"start":{}},"135c71078810af2":{"_id":"135c71078810af2","_name":"RuntimeChannel","_inherit":["RuntimeComponent"],"sync":{},"loadSystem":{"params":[{"name":"system","type":"object"}]},"createSchema":{"params":[{"name":"id","type":"string"},{"name":"schema","type":"object"}]},"updateSchema":{"params":[{"name":"id","type":"string"},{"name":"schema","type":"object"}]},"deleteSchema":{"params":[{"name":"id","type":"string"}]},"createModel":{"params":[{"name":"id","type":"string"},{"name":"model","type":"object"}]},"updateModel":{"params":[{"name":"id","type":"string"},{"name":"model","type":"object"}]},"deleteModel":{"params":[{"name":"id","type":"string"}]},"createType":{"params":[{"name":"id","type":"string"},{"name":"type","type":"object"}]},"updateType":{"params":[{"name":"id","type":"string"},{"name":"type","type":"object"}]},"deleteType":{"params":[{"name":"id","type":"string"}]},"createComponent":{"params":[{"name":"collection","type":"string"},{"name":"component","type":"object"}]},"updateComponent":{"params":[{"name":"id","type":"string"},{"name":"collection","type":"string"},{"name":"component","type":"object"}]},"deleteComponent":{"params":[{"name":"id","type":"string"},{"name":"collection","type":"string"}]},"createBehavior":{"params":[{"name":"behavior","type":"object"}]},"updateBehavior":{"params":[{"name":"id","type":"string"},{"name":"behavior","type":"object"}]},"deleteBehavior":{"params":[{"name":"id","type":"string"}]}}},"schemas":{"10374180581a41f":{"_id":"10374180581a41f","_name":"RuntimeAdmin","_inherit":["RuntimeComponent"],"_core":true,"start":"method"},"104ad1f48518376":{"_id":"104ad1f48518376","_name":"RuntimeChannel","sync":"event","loadSystem":"event","createSchema":"event","updateSchema":"event","deleteSchema":"event","createModel":"event","updateModel":"event","deleteModel":"event","createType":"event","updateType":"event","deleteType":"event","createComponent":"event","updateComponent":"event","deleteComponent":"event","createBehavior":"event","updateBehavior":"event","deleteBehavior":"event"}},"types":{},"behaviors":{"1c00c107e01c9b3":{"_id":"1c00c107e01c9b3","component":"RuntimeAdmin","state":"start","action":"function start() {\n var RuntimeChannel = null,\n runtimeChannel = null;\n \n if (!this.require('channel-admin')) {\n RuntimeChannel = this.require('RuntimeChannel');\n runtimeChannel = new RuntimeChannel({\n '_id': 'channel-admin',\n '_core': true\n });\n \n runtimeChannel.on('send', function send(message) {\n localStorage.setItem('system-designer-message', JSON.stringify(message));\n });\n \n // schema change events\n runtimeChannel.on('createSchema', function createSchema(id, schema) {\n this.require('metamodel').schema(schema);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateSchema', function updateSchema(id, schema) {\n this.require('metamodel').type(schema);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteSchema', function deleteSchema(id) {\n $db.Runtime.remove({'_id': id});\n this.require('metamodel').create();\n }, true);\n \n // model change events\n runtimeChannel.on('createModel', function createModel(id, model) {\n this.require('metamodel').schema(model);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateModel', function updateModel(id, model) {\n this.require('metamodel').type(model);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteModel', function deleteModel(id) {\n $db['Runtime'].remove({'_id': id});\n this.require('metamodel').create();\n $component.removeFromMemory(id);\n }, true);\n \n // type change events\n runtimeChannel.on('createType', function createType(id, type) {\n this.require('metamodel').type(type);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('updateType', function updateType(id, type) {\n this.require('metamodel').type(type);\n this.require('metamodel').create();\n }, true);\n \n runtimeChannel.on('deleteType', function deleteType(id) {\n $db.RuntimeType.remove({'_id': id});\n this.require('metamodel').create();\n }, true);\n \n // component change events\n runtimeChannel.on('createComponent', function createComponent(model, component) {\n $db[model].insert(component);\n }, true);\n \n runtimeChannel.on('updateComponent', function updateComponent(id, collection, component) {\n $db[collection].update({'_id': id}, component);\n }, true);\n \n runtimeChannel.on('deleteComponent', function deleteComponent(id, collection) {\n $db[collection].remove({'_id': id});\n }, true);\n \n // behavior change events\n runtimeChannel.on('createBehavior', function createBehavior(component) {\n $db.RuntimeBehavior.insert(component);\n }, true);\n runtimeChannel.on('updateBehavior', function updateBehavior(id, behavior) {\n this.require(id).action(behavior.action);\n });\n runtimeChannel.on('deleteBehavior', function deleteBehavior(id) {\n $db.RuntimeBehavior.remove({'_id': id}); \n }, true);\n \n // System Designer event\n runtimeChannel.on('sync', function sync() {\n this.loadSystem(JSON.parse(this.require('db').system()));\n });\n\n window.addEventListener('storage', function (e) {\n if (e.key === 'system-designer-message') {\n $db.RuntimeMessage.insert(JSON.parse(e.newValue));\n }\n });\n \n this.require('logger').info('admin is started');\n } else {\n this.require('logger').info('admin is already started');\n }\n}","useCoreAPI":true,"core":true}},"components":{"RuntimeAdmin":{"admin":{"_id":"admin","_core":true}}},"name":"system-admin","version":"0.5.0","description":"Runtime Component administration ","_id":"18ed81de331252c","master":false,"subsystem":false}

addons/web.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"web","version":"0.1.0","description":"Add behaviors for web","_id":"133421d0c313d2d","schemas":{"12e211d4cd120a6":{"_id":"12e211d4cd120a6","_name":"Runtime","load":"method","ready":"event"}},"models":{"14c7c105b31a160":{"_id":"14c7c105b31a160","_name":"Runtime","load":{"params":[{"name":"url","type":"string"},{"name":"async","type":"boolean","mandatory":false,"default":true}]},"ready":{}}},"types":{},"behaviors":{"1aaee1e6311ff39":{"_id":"1aaee1e6311ff39","component":"runtime","state":"load","action":"function load(url, async) {\n var xhr = null,\n callbackLoad = null;\n xhr = new XMLHttpRequest();\n \n callbackLoad = function callbackLoad(system) {\n var sysId = $db.system(system),\n sys = $component.get(sysId),\n systems = document.querySelectorAll('link[rel=system]'),\n nbSubsystem = $db.RuntimeSystem.find({\n 'subsystem': true\n }); \n if (sys) {\n sys.main();\n } \n if (systems.length + 1 + nbSubsystem.length === $db.RuntimeSystem.count()) {\n $component.get('runtime').ready();\n }\n };\n \n if (async) {\n xhr.open('GET', url, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n callbackLoad(JSON.parse(xhr.response));\n }\n }\n };\n xhr.send(null);\n } else {\n xhr.open('GET', url, false);\n xhr.send(null);\n if (xhr.status === 200) {\n callbackLoad(JSON.parse(xhr.response));\n }\n }\n}","core":true,"useCoreAPI":true},"1f6001773a18791":{"_id":"1f6001773a18791","component":"e89c617b6b15d24","state":"main","action":"function main() {\n var subsystems = [],\n systems = [],\n system = null,\n scripts = [],\n script = null,\n pathToDesigner = '',\n logLevel = 'warn',\n i = 0,\n length = 0;\n \n subsystems = $db.RuntimeSystem.find({\n 'subsystem': true\n });\n subsystems.forEach(function (subsystem) {\n var subsystemId = subsystem._id;\n this.require(subsystemId).main();\n }, this); \n \n if (typeof document !== 'undefined') {\n systems = document.querySelectorAll('link[rel=system]');\n length = systems.length;\n \n // logger\n scripts = document.querySelectorAll('script[log]');\n if (scripts.length) {\n logLevel = scripts[0].getAttribute('log');\n this.require('logger').level(logLevel);\n }\n \n // systems\n for (i = 0; i < length; i++) {\n system = systems[i];\n \n if (system.getAttribute('async') === 'false') {\n this.require('runtime').load(system.href, false);\n } else {\n this.require('runtime').load(system.href, true);\n }\n }\n \n // admin\n scripts = document.querySelectorAll('script[designer]');\n if (scripts.length) {\n pathToDesigner = scripts[0].getAttribute('designer');\n this.require('admin').start(pathToDesigner);\n }\n \n // ready event\n if (length === 0) {\n this.require('runtime').ready();\n }\n }\n}","core":true,"useCoreAPI":true}},"components":{},"master":false,"subsystem":false}
1+
{"name":"web","version":"0.2.0","description":"Add behaviors for web","_id":"133421d0c313d2d","schemas":{"12e211d4cd120a6":{"_id":"12e211d4cd120a6","_name":"Runtime","load":"method","ready":"event"}},"models":{"14c7c105b31a160":{"_id":"14c7c105b31a160","_name":"Runtime","load":{"params":[{"name":"url","type":"string"},{"name":"async","type":"boolean","mandatory":false,"default":true}]},"ready":{}}},"types":{},"behaviors":{"1aaee1e6311ff39":{"_id":"1aaee1e6311ff39","component":"runtime","state":"load","action":"function load(url, async) {\n var xhr = null,\n callbackLoad = null;\n xhr = new XMLHttpRequest();\n \n callbackLoad = function callbackLoad(system) {\n var sysId = $db.system(system),\n sys = $component.get(sysId),\n systems = document.querySelectorAll('link[rel=system]'),\n nbSubsystem = $db.RuntimeSystem.find({\n 'subsystem': true\n }); \n if (sys) {\n sys.main();\n } \n if (systems.length + 1 + nbSubsystem.length === $db.RuntimeSystem.count()) {\n $component.get('runtime').ready();\n }\n };\n \n if (async) {\n xhr.open('GET', url, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n callbackLoad(JSON.parse(xhr.response));\n }\n }\n };\n xhr.send(null);\n } else {\n xhr.open('GET', url, false);\n xhr.send(null);\n if (xhr.status === 200) {\n callbackLoad(JSON.parse(xhr.response));\n }\n }\n}","core":true,"useCoreAPI":true},"1f6001773a18791":{"_id":"1f6001773a18791","component":"e89c617b6b15d24","state":"main","action":"function main() {\n var subsystems = [],\n systems = [],\n system = null,\n scripts = [],\n script = null,\n logLevel = 'warn',\n i = 0,\n length = 0;\n \n subsystems = $db.RuntimeSystem.find({\n 'subsystem': true\n });\n subsystems.forEach(function (subsystem) {\n var subsystemId = subsystem._id;\n this.require(subsystemId).main();\n }, this); \n \n if (typeof document !== 'undefined') {\n systems = document.querySelectorAll('link[rel=system]');\n length = systems.length;\n \n // logger\n scripts = document.querySelectorAll('script[log]');\n if (scripts.length) {\n logLevel = scripts[0].getAttribute('log');\n this.require('logger').level(logLevel);\n }\n \n // systems\n for (i = 0; i < length; i++) {\n system = systems[i];\n \n if (system.getAttribute('async') === 'false') {\n this.require('runtime').load(system.href, false);\n } else {\n this.require('runtime').load(system.href, true);\n }\n }\n \n // debug\n scripts = document.querySelectorAll('script[debug]');\n if (scripts.length) {\n this.require('admin').start();\n }\n \n // ready event\n if (length === 0) {\n this.require('runtime').ready();\n }\n }\n}","core":true,"useCoreAPI":true}},"components":{},"master":false,"subsystem":false}

0 commit comments

Comments
 (0)