 |
| | -- Main.gmurray71 - 23 Jul 2007
Main data model page | jMaki Homepage | jMaki Wiki | | | "action" : {"type" : "object","optional":true,
-
-
-
-
-
-
-
- "properties"
- {
- "topic"
- {"type" : "string", "optional" : true},
| |
< < | "message": {"type" : "string", "optional" : true} } | > > | "message": {"type" : ["string","object"],, "optional" : true} } | | | }
}
} |
| | -- Main.gmurray71 - 23 Jul 2007
Main data model page | jMaki Homepage | jMaki Wiki | | |
{
"description" : "jMaki Fisheye", | |
< < | "type":"object",
-
-
- "properties"
- { "items" : {
| | | "type" : "array",
"items" : {
"type" : "object", | | | }
}
} | |
< < | }
} | | |
(2.2) Property Descriptions |
| | -- Main.gmurray71 - 23 Jul 2007
Main data model page | jMaki Homepage | jMaki Wiki | | | "description" : "jMaki Fisheye",
"type":"object",
-
-
- "properties"
- {
| |
> > | "items" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"id" : {"type": "string", "optional":true,}, | | | "label" : {"type": "string"},
"iconSrc" : {"type": "string"},
"href" : {"type": "string","optional":true}, | |
< < | "action" : {"type" : "object", | > > | "action" : {"type" : "object","optional":true, | | |
-
-
-
-
- "properties"
- {
- "topic"
- {"type" : "string", "optional" : true},
| |
< < | "message": {"type" : "object", "optional" : true} | > > | "message": {"type" : "string", "optional" : true} }
}
} | | | }
}
} |
| | -- Main.gmurray71 - 23 Jul 2007
Main data model page | jMaki Homepage | jMaki Wiki | | | JSON schema format is | |
< < | [ | | | { | |
< < | "item" : {"menu" : {"type": "string"},
{"label" : {"type": "string"},
{"iconSrc" : {"type": "string"},
{"href" : {"type": "string","optional":true},
{"action" :
{"topic": {"type" : "string", "optional" : true}},
{"message": [{"type" : "string", "optional" : true},
{"type" : "object", "optional" : true}}], | > > | "description" : "jMaki Fisheye",
"type":"object",
-
-
- "properties"
- { "label" : {"type": "string"}, "iconSrc" : {"type": "string"}, "href" : {"type": "string","optional":true}, "action" : {"type" : "object",
-
- "properties"
- {
- "topic"
- {"type" : "string", "optional" : true}, "message": {"type" : "object", "optional" : true} } }
| | | }
} | |
< < | ] | | | |
| | -- Main.gmurray71 - 23 Jul 2007
Main data model page | jMaki Homepage | jMaki Wiki | | | obj ::= |
| |
> > | JSON schema format is
[
{
"item" : {"menu" : {"type": "string"},
{"label" : {"type": "string"},
{"iconSrc" : {"type": "string"},
{"href" : {"type": "string","optional":true},
{"action" :
{"topic": {"type" : "string", "optional" : true}},
{"message": [{"type" : "string", "optional" : true},
{"type" : "object", "optional" : true}}],
}
}
]
| | | (2.2) Property Descriptions |
| | -- Main.gmurray71 - 23 Jul 2007
Main data model page | jMaki Homepage | jMaki Wiki | | | {iconSrc:'menu1.jpg',label:'Menu1:Greg Murray:Ajax',action:{topic:'/jmaki/dcontainer',message:'menu1.jsp'}},
{iconSrc:'menu2.jpg',label:'Menu2:Carla Mott:Ajax',action:{topic:'/jmaki/dcontainer',message:'menu2.jsp'}},
{iconSrc:'menu3.jpg',label:'Menu3:Stacy David Thurston:href',href:'http://blogs.sun.com/tiger/'}, | |
< < | {iconSrc:'menu4.jpg',label:'Menu4:Rick Evans:glue.js',action:{topic:'/jmaki/glue',message:{id:'rick',href:'menu4.jsp'}}}, | > > | {iconSrc:'menu4.jpg',label:'Menu4:Rick Evans:glue.js',action:{topic:'/jmaki/glue',message:{id:'rick',url:'menu4.jsp'}}}, | | | {iconSrc:'menu3.jpg',label:'Menu5:Stacy David Thurston:href',href:'http://blogs.sun.com/tiger/'}
]"/>
<-- leftSidebar --> | | |
jmaki.debug = true;
jmaki.subscribe("/jmaki/glue", function(args) { | |
< < | jmaki.log("fisheye args.targetId="+args.targetId+" args.message.id="+args.message.id+" args.message.href="+args.message.href);
jmaki.publish("/jmaki/dcontainer", args.message.href); | > > | jmaki.log("fisheye args.targetId="+args.targetId+" args.message.id="+args.message.id+" args.message.href="+args.message.url);
jmaki.publish("/jmaki/dcontainer", args.message.url); | | | });
|
| | -- Main.gmurray71 - 23 Jul 2007 | |
< < | Main data model page | > > | Main data model page | jMaki Homepage | jMaki Wiki
| | | Fisheye Data Model | | | item ::= "menu:" "[" { | |
< < | action ::= "action:" "{" [] [ ] "}," | > > | action ::= "action:" "{" [] ] | []"}," | | | topic ::= "topic:" ,
message ::= "message:"
obj ::= | | | | (3) Event Handling | |
< < | This still needs alot of work and discussions are happening on the dev alias of the ajax project ajax.dev.java.net. | | | Events that trigger a payload to be published are: | | | ]
| |
> > | (5) Read Fisheye message values in a JavaScript program.
From the index.jsp:
<div class="main">
<div class="leftSidebar">
<a:widget name="dojo.fisheye"
args="{ orientation:'vertical'}"
value="[
{iconSrc:'menu1.jpg',label:'Menu1:Greg Murray:Ajax',action:{topic:'/jmaki/dcontainer',message:'menu1.jsp'}},
{iconSrc:'menu2.jpg',label:'Menu2:Carla Mott:Ajax',action:{topic:'/jmaki/dcontainer',message:'menu2.jsp'}},
{iconSrc:'menu3.jpg',label:'Menu3:Stacy David Thurston:href',href:'http://blogs.sun.com/tiger/'},
{iconSrc:'menu4.jpg',label:'Menu4:Rick Evans:glue.js',action:{topic:'/jmaki/glue',message:{id:'rick',href:'menu4.jsp'}}},
{iconSrc:'menu3.jpg',label:'Menu5:Stacy David Thurston:href',href:'http://blogs.sun.com/tiger/'}
]"/>
</div> <!-- leftSidebar -->
<div class="content" style="height:400px">
<h3>Biography Display for Ajax Link</h3>
<div style="margin: 10px 10px 10px 10px">
<a:widget name="jmaki.dcontainer" subscribe="/jmaki/dcontainer" />
</div>
</div> <!-- content -->
</div> <!-- main -->
In menu4 of the above Fisheye menu, use the following code in glue.js to echo the event values and publish the href to the jMaki dcontainer ("/jmaki/dcontainer").
From the glue.js:
jmaki.debug = true;
jmaki.subscribe("/jmaki/glue", function(args) {
jmaki.log("fisheye args.targetId="+args.targetId+" args.message.id="+args.message.id+" args.message.href="+args.message.href);
jmaki.publish("/jmaki/dcontainer", args.message.href);
});
|
| | -- Main.gmurray71 - 23 Jul 2007
Main data model page | | | The href property indicates that the string following the property is a URL and that navigation should go to that URL. | |
< < | The action property is used to provide the name of the page that is then published on the topic. If this property is present, a click on this node will cause the message to be published on the topic. There must be a listener (most likely a dcontainer) which actually loads the page but that is outside the scope of this model. | > > | The action property is used to provide the name of the page that is then published on the topic. If this property is present, a click on this node will cause the message to be published on the topic. There must be a listener (most likely a dcontainer) which actually loads the page but that is outside the scope of this model. Either topic or message or both must be supplied. | | | The topic property overrides the publish arg at the tag level for the particular item identified by label. |
| | -- Main.gmurray71 - 23 Jul 2007
Main data model page | | | item ::= "menu:" "[" { | |
< < | action ::= "action:" "{" [] "}," | > > | action ::= "action:" "{" [] [ ] "}," | | | topic ::= "topic:" ,
message ::= "message:"
obj ::= | |
| | -- Main.gmurray71 - 23 Jul 2007
Main data model page | | | (1.1) Examples
Below is an example using the new menu data model. Data passed to the menu widgets will be in JSON format as shown here. | |
< < | [ | > > |
[ | | | {
'action': {
-
-
-
- 'topic'
- '/foo',
| | |
(2) Data Model | |
< < | Following is the data model for FishEye? widgets | > > | Following is the data model for Fisheye widgets | | | |
|
< < | | | | -- Main.gmurray71 - 23 Jul 2007
Main data model page | | | Here is an example of the old format which will not be supported in jMaki 1.0 and beyond. | |
< < | items:[ | > > | [ | | | {iconSrc:'https://ajax.dev.java.net/images/blog_murray.jpg',caption:'You are here!'},
{iconSrc:'https://ajax.dev.java.net/images/chinnici.jpg',caption:'test3'},
{iconSrc:'https://ajax.dev.java.net/images/JayashriVisvanathan.jpg',caption:'test4'} |
|
< < | | | | -- Main.gmurray71 - 23 Jul 2007 | | | (1.1) Examples
Below is an example using the new menu data model. Data passed to the menu widgets will be in JSON format as shown here. | |
< < |
[
{ label:'Must Read',
menu: [
{ label:'Slashdot', href:'http://www.slashdot.org' },
{ label:'dev.java.net', menu: [
{label : 'jMaki',href: 'http://ajax.dev.java.net'},
{label : 'GlassFish', href: 'http://glassfish.dev.java.net'}
] }
] | > > | [
{
'action': {
'topic': '/foo',
'message': 'item 1' | | | }, | |
< < | { label:'Click me for fun!', action:{message: '/fun.jsp'}},
{ label:'Disabled!', disabled:true },
{ label:'Sun Microsystems', href: 'http://www.sun.com', action:{topic: '/my/topic',message:'http://www.sun.com'} },
{ label:'Oracle', href: 'http://www.oracle.com', action:{message:'http://www.oracle.com' }} | > > | 'iconSrc': 'https://ajax.dev.java.net/images/blog_murray.jpg',
'label': 'You are here!'
},
{
'iconSrc': 'https://ajax.dev.java.net/images/chinnici.jpg',
'label': 'test3'
},
{
'iconSrc': 'https://ajax.dev.java.net/images/JayashriVisvanathan.jpg',
'href': 'http://jmaki.com',
'label': 'test4'
} | | | ]
(2) Data Model | |
< < | Incorporating the feedback from the team here is the latest rev of the data model. We wanted to
add an action property which allows users to specify the message to publish and the topic to publish to.
If no topic is specified then the default topic is used. We want the message to be a string or JavaScript
object literal and this may need additional specification. Also we want to be able to specify CSS which
is passed through to the underlying widget. | > > | Following is the data model for FishEye? widgets | | | | |
< < | fishEye ::= "{" {- } "}"
| > > | fishEye ::= "[" {- } "]"
| | | item ::= "menu:" "[" { | |
< < | label ::= "{" "label:" , [ |
|