 |
| |
| META TOPICPARENT | name="JMaki" |
-- Main.carlavmott - 25 Jan 2008 | | | Using JSON schema to describe widget.json
{ | |
< < | "description" : "jMaki Widget Tooling Schema", | > > | "description" : "jMaki Widget.json", | | | "type":"object",
"properties": {
"name" : {"type" : "string"},
-
- "type"
- {"type" : "string"},
| |
< < |
-
- "version"
- {"type" : "number"},
- "jmakiVersion"
- {"type" : "number"},
| > > |
-
- "version"
- {"type" : "string"},
- "jmakiVersion"
- {"type" : "string"},
| | |
-
- "image"
- {"type" : "string"},
- "description"
- {"type" : "string"},
- "docs"
- {"type": "array",
| | | "jsDoc":{"type":"string", "optional" : true},
"usageDoc":{"type":"string"}
} | |
< < |
-
- "args"
- {"type": "array", "items":"object" },
- "value"
- {"type": "object",
| > > | },
-
- "args"
- {"type": "array", "optional":true },
- "value"
- {"type": "object", "optional":true,
| | | "properties": {
"type":{"type":"string"},
"required":{"type":"boolean"}, | | |
-
-
-
-
-
- "type"
- {"type": "object", "properties": { "id": {"type": "string"},
| |
< < | "lib": {"type":"array"},
"style":{"type":'array"}, | > > | "lib": {"type":"array", "optional":true},
"style":{"type":"array", "optional":true}, | | | "resources":{"type":"array"}
}
} | |
> > | } | | | }, | |
< < |
-
- topicInfo"
- {
| > > |
-
- "topicInfo"
- {
| | | "defaultPublish" : {"type": "string"},
-
-
-
- "defaultSubscribe"
- { "type": ["string" | "array"]},
- "commands"
- {"type": "object",
| | | "payload": {"type": "object",
"properties": {
-
-
-
-
-
-
-
- "targetId"
- {"type": "string" },
| |
< < | "value" : {"type" : "object", optional}
} | > > | "value" : {"type" : "object"} | | | }
},
"description": {"type":"string"}, |
| |
| META TOPICPARENT | name="JMaki" |
-- Main.carlavmott - 25 Jan 2008 | | |
Using JSON schema to describe widget.json | |
> > | {
"description" : "jMaki Widget Tooling Schema",
"type":"object",
"properties": { | | | "name" : {"type" : "string"},
"type": {"type" : "string"},
"version": {"type" : "number"},
"jmakiVersion": {"type" : "number"},
"image": {"type" : "string"},
"description": {"type" : "string"}, | |
< < | "docs": {"type": {[ | > > |
-
- "docs"
- {"type": "array",
- "items"
- "object",
- "properites"
- {
| | | "modelURL" : {"type":"string"}, | |
< < | "jsDoc":{"type":"string"},
"usageDoc":{"type":"string"}],
"args": {"type": "array", }, | > > | "jsDoc":{"type":"string", "optional" : true},
"usageDoc":{"type":"string"}
}
-
- "args"
- {"type": "array", "items":"object" },
| | | "value": {"type": "object",
-
- "properties"
- { "type":{"type":"string"},
| | | }
}
}, | |
> > |
-
- topicInfo"
- { "defaultPublish" : {"type": "string"},
-
- "defaultSubscribe"
- { "type": ["string" | "array"]},
- "commands"
- {"type": "object",
-
-
-
-
- "properties"
- {
-
- "name"
- {"type": "string" } } }, "payload": {"type": "object", "properties": {
- "targetId"
- {"type": "string" }, "value" : {"type" : "object", optional} } } }, "description": {"type":"string"}, "events" : {"type": "string" } } }
} | | | | |
< < | Using JSON schema to describe the pub/sub related properites: | | | | |
> > | The specific JSON schema for the topicInfo sections is | | | | |
< < | "topicInfo": { | > > | topicInfo": { | | | "defaultPublish" : {"type": "string"},
- "defaultSubscribe"
- { "type": ["string" | "array"]},
- "commands"
- {"type": "object",
| | | {"value": "removeChildren"}
]
} | |
> > | } | | | },
"payload": {"type": "object",
"properties": { | | | }
}
} | |
> > | } | | | |
| |
| META TOPICPARENT | name="JMaki" |
-- Main.carlavmott - 25 Jan 2008 | | | }
}
| |
< < | | > > | Using JSON schema to describe widget.json
"name" : {"type" : "string"},
"type": {"type" : "string"},
"version": {"type" : "number"},
"jmakiVersion": {"type" : "number"},
"image": {"type" : "string"},
"description": {"type" : "string"},
"docs": {"type": {[
"modelURL" : {"type":"string"},
"jsDoc":{"type":"string"},
"usageDoc":{"type":"string"}],
"args": {"type": "array", },
"value": {"type": "object",
"properties": {
"type":{"type":"string"},
"required":{"type":"boolean"},
"defaultValue":{"type":"object"}
}
},
"config":{"type": "object",
"properties": {
"type": {"type": "object",
"properties": {
"id": {"type": "string"},
"lib": {"type":"array"},
"style":{"type":'array"},
"resources":{"type":"array"}
}
}
},
| | | Using JSON schema to describe the pub/sub related properites:
"topicInfo": {
"defaultPublish" : {"type": "string"}, | |
< < |
- "defaultSubscribe"
- { "type": "string" | "type" : "array"},
| > > |
- "defaultSubscribe"
- { "type": ["string" | "array"]},
| | |
- "commands"
- {"type": "object",
-
-
- "properties"
- {
-
- "name"
- {"type": "string",
|
| |
| META TOPICPARENT | name="JMaki" |
-- Main.carlavmott - 25 Jan 2008 | | | {"value": "expandNode"},
{"value": "collapseNode"},
{"value": "removeNode"}, | |
> > | {"value": "expandAll"},
{"value": "collapseAll"},
{"value": "addNodes"}, | | | {"value": "removeChildren"}
]
}
},
"payload": {"type": "object",
"properties": { | |
< < | "targetId": {"type": "string" | "type" : "object"} | > > | "targetId": {"type": "string" },
"value" : {"type" : "object", optional}
} | | | }
},
"description": {"type":"string"}, |
| |
| META TOPICPARENT | name="JMaki" |
-- Main.carlavmott - 25 Jan 2008 | | |
-
-
-
-
-
- "name"
- {"type": "string",
-
- "options"
- [ {"value": "expandNode"},
| |
< < | {value": "collapseNode"},
{value": "removeNode"},
{value": "removeChildren"} | > > | {"value": "collapseNode"},
{"value": "removeNode"},
{"value": "removeChildren"} | | | ]
}
}, | | | "targetId": {"type": "string" | "type" : "object"}
}
}, | |
< < |
-
-
- "description"
- {"type":"string"}
| > > | "description": {"type":"string"},
"events" : {"type": "string",
"options" : [
-
-
-
-
-
-
-
-
-
- {"value"
- "onClick"}, {"value": "onCollapse"}, {"value": "onExpand"} ] } }
| | | }
\ No newline at end of file |
| |
| META TOPICPARENT | name="JMaki" |
| |
< < | | | | -- Main.carlavmott - 25 Jan 2008
This page describes the format of the widget.json file that is provided with the wrapped widgets. This file is read by tools such as NetBeans IDE and the widget documentation generator in the widget project (widgets.dev.java.net). Below is a sample of a widget.json file. | | |
-
-
-
- "properties"
- {
-
- "name"
- {"type": "string",
-
- "options"
- [
| |
< < | {"value": "expand"},
{value": "collapse:},
{value": "select"},
{value": "addNodes"} | > > | {"value": "expandNode"},
{value": "collapseNode"},
{value": "removeNode"},
{value": "removeChildren"} | | | ]
}
}, |
| |
| META TOPICPARENT | name="JMaki" |
| |
< < | | | | -- Main.carlavmott - 25 Jan 2008
This page describes the format of the widget.json file that is provided with the wrapped widgets. This file is read by tools such as NetBeans IDE and the widget documentation generator in the widget project (widgets.dev.java.net). Below is a sample of a widget.json file. | | | }
}
| |
> > | Using JSON schema to describe the pub/sub related properites:
"topicInfo": {
"defaultPublish" : {"type": "string"},
"defaultSubscribe": { "type": "string" | "type" : "array"},
"commands": {"type": "object",
"properties": {
"name": {"type": "string",
"options": [
{"value": "expand"},
{value": "collapse:},
{value": "select"},
{value": "addNodes"}
]
}
},
"payload": {"type": "object",
"properties": {
"targetId": {"type": "string" | "type" : "object"}
}
},
"description": {"type":"string"}
}
| | | \ No newline at end of file |
| |
| META TOPICPARENT | name="JMaki" |
| | |
| META TOPICPARENT | name="JMaki" |
| |
< < | | | | -- Main.carlavmott - 25 Jan 2008 | |
< < | | > > | This page describes the format of the widget.json file that is provided with the wrapped widgets. This file is read by tools such as NetBeans IDE and the widget documentation generator in the widget project (widgets.dev.java.net). Below is a sample of a widget.json file. | | | {
'name': 'Tree',
'type': 'yahoo', | | | configured.',
'docs' : [
'modelURL' : 'http://wiki.java.net/bin/view/Projects/jMakiTreeModel', | |
< < | 'jsDoc' : 'http://jmaki.dev.java.net/jsdoc/yahoo_button', | > > | 'jsDoc' : 'http://jmaki.dev.java.net/jsdoc/yahoo_tree | | | 'usageDoc' : 'docs/index.html'
],
'args': [ | | | ]
}
}
\ No newline at end of file | |
> > | |
|
> > |
| META TOPICPARENT | name="JMaki" |
-- Main.carlavmott - 25 Jan 2008
{
'name': 'Tree',
'type': 'yahoo',
'version': '1.0',
'jmakiVersion': '1.0',
'image': 'images/yahoo-tree.jpg',
'description': 'This widget is a dynamic tree that can easily be
configured.',
'docs' : [
'modelURL' : 'http://wiki.java.net/bin/view/Projects/jMakiTreeModel',
'jsDoc' : 'http://jmaki.dev.java.net/jsdoc/yahoo_button',
'usageDoc' : 'docs/index.html'
],
'args': [
],
'value': {'required':'true',
'type': 'OBJECT', 'defaultValue':{
-
-
- 'root':{id
- 'bar', 'title': 'Default Yahoo Tree Root Node',
- 'expanded'
- true,
- 'children'
- [ {'title':'Yahoo Node 1.1', 'onclick': {'url':'foo'}}, {'title':'Yahoo Node 1.2', 'children': [{'title':'Node 3.1'}]} ] } } }, 'config' : { 'type' : { 'id' : 'yahoo.tree', 'libs' : [ '../resources/libs/yahoo/v2.4.1/yahoo/yahoo-min.js', '../resources/libs/yahoo/v2.4.1/event/event-min.js', '../resources/libs/yahoo/v2.4.1/treeview/treeview-min.js' ], 'styles' : [
'../resources/libs/yahoo/v2.4.1/treeview/assets/skins/sam/treeview.css'
],
'resources' : [
'../resources/libs/yahoo/v2.4.1/treeview/assets'
]
}
},
'topicInfo': {
'defaultPublish' : '/jmaki/yahoo/tree',
'defaultSubscribe' : ['/jmaki/yahoo/tree', '/tree'],
'commands' : [
{'name' : 'expand',
'payload' : '{'targetId' : 'bar'}',
'description' : 'expand the node whose id is the same as targetId property'},
{ 'name' : 'collapse',
'description' : 'collapse tree whose id is the same as targetId property'},
{ 'name' : 'select',
'description' : 'select the node whose id is the same as targetId property'},
],
'events' : [
{'name' : 'onClick',
'description' : 'publish the value of the selected node'}
]
}
} |
|