The Source for Java Technology Collaboration


Main data model discussion page

jMaki Webtop Data Model

(1) Introduction

This wiki page is dedicated to discussing the jMaki Webtop data model.

(1.2) Examples

Below is an example using the new accordion data model.

{ "items" : [
        { "id":"google.map", "label":"Google Map",
          "description":"A dynamic map.",
          "include":"google-map.php",
          "iframe":true, "startHeight":300,
          "imgSrc":"resources/google/map/images/google-map.jpg"
         },
         {"id":"jmaki.flow",
             "label":"jMaki Flow",
             "description":"A configurable image widget.",
             "widget":{ "name" : "jmaki.flow",
              "value" : {
                  "items" : [ 
                  {"label" : "Golden Gate Bridge",
                   "target" : "_blank",
                   "id" : "bar",
                    "imgSrc" : "http://farm3.static.flickr.com/2272/2065478072_181ada2c05_m.jpg",
                    "href" : "http://www.flickr.com/photos/44399047@N00/2065478072/" },
                  {"label" : "Napa",
                   "id" : "mid",
                   "imgSrc" : "http://farm3.static.flickr.com/2175/2065473306_aa131a98c9_m.jpg",
                   "href" : "http://www.flickr.com/photos/44399047@N00/2065472818/in/set-72157603300403991/" },
                  {"label" : "Burning Man Statues",
                   "id" : "foo",
                   "imgSrc" : "http://farm1.static.flickr.com/70/175289967_5d0ca71c3a_m.jpg",
                   "href" : "http://www.flickr.com/photos/44399047@N00/175289967/in/set-72157594177809676/" }
                    ]
                    } },
                    "startHeight":280,
                    "imgSrc":"widgets/jmaki/flow/images/jmaki-flow.jpg"
              }
         ]
}

(2) Data Model

The model is similar to the previous model with a few added features. 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 that was specified by the publish property on the tag. We want the message to be a string or JavaScript object literal and this may need additional specification.

{
         "description" : "jMaki Webtop",
         "type":"object",
         "properties": { 
             "items" : {
                  "type" : "array",
                  "items" : { 
                        "type" : "object",
                        "properties" : {
                            "id" : { "type" : "string"},
                            "label" : { "type" : "string"},
                            "widget" : {
                                "description" : "An item",
                                "type" : "object",
                                "optional":true,
                                "properties" : {
                                    "name" : { "type" : "string"},
                                    "id" : { "type" : "string", "optional":true},
                                    "value" : { "type" : "object", "optional":true},
                                    "service" : { "type" : "string", "optional":true},
                                    "args" :  {"type" : "object", "optional":true},
                                    } 
                            },
                            "include" : { "type" : "string","optional":true},
                            "iframe" : { "type" : "boolean", "optional":true},
                            "description" : { "type" : "string"},
                            "startHeight" : { "type" : "number"},
                            "imgSrc" : { "type" : "string"}
                        }
                    }
                    
                }
        }
 }

(2.2) Property Descriptions (args)

debug Turn on webtop debuging with a true or false boolean

widgetDir Set the root diretory for the widgets.

useGears Set to false if using a database

(3.0) Events

Several events are fired in the accordion model. The table below describes the default events and payload published with each event.

(3.1) Publish Events

Event Payload Event
save widget id, topic name, targetId, message if it exists Published when a user resizes a column or changes the properties on a widget

(3.2) Subscribe Events

Event Payload
select widget id, targetId
resetColumns targetId, value (string which may include markup)
addFrame item (described in schema)
addLightBox include, content
hideLightBox targetId of lightbox to hide
showLightBox targetId of lightbox to show
hidePalette hide the palette
showPalette show the palette
autosave Save settings including widget values

TBD

-- Main.gmurray71 - 28 Apr 2008

Topic JMakiWebtopDataModel . { Edit | Ref-By | Printable | Diffs r4 < r3 < r2 < r1 | More }
 XML java.net RSS

Revision r4 - 30 Apr 2008 - 08:17:47 - Main.gmurray71
Parents: JMakiDataModels