Permalink
Browse files

last changes from web-5

  • Loading branch information...
lyle committed Oct 31, 2013
1 parent 52f3740 commit b012d8c99e8a18cf864c050a85333216ebd45e30
View
@@ -22,6 +22,21 @@ model.Coop = require('Model/Coop');
model.Coop.addAttribute("address", "relatedEntity", "Address", "Address");
model.Address.addAttribute("coops", "relatedEntities", "Coop", "address", {reversePath:true});
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
//model.Address.addAttribute("coop", "relatedEntity", "Coop", "address");
//model.Coop.address = new Attribute("relatedEntity", "Address", "Address");
View
@@ -1 +1 @@
-{ "toJSON": true, "dbInfo": [ { "name": "Model", "uuid": "32E5DCAF616B45D5B214447BD04C67BB" } ], "extraProperties": { "version": "1", "classes": { "Chicken": { "panelColor": "#548DD4", "panel": { "isOpen": "true", "pathVisible": true, "position": { "X": 20, "Y": 19 } } }, "Coop": { "panelColor": "#D88CFF", "panel": { "isOpen": "true", "pathVisible": true, "position": { "X": 326, "Y": 41 } } }, "Breed": { "panelColor": "#D7E3BC", "panel": { "isOpen": "true", "position": { "X": 35, "Y": 301 } } }, "Address": { "panelColor": "#fff", "panel": { "isOpen": "true", "position": { "X": 361, "Y": 383 }, "pathVisible": true } } }, "model": { "scriptMode": "manual", "workspaceLeft": 0, "workspaceTop": 0, "relationCurve": { "mode": 1, "run": true } } }, "dataClasses": [ { "name": "Chicken", "className": "Chicken", "collectionName": "Chickens", "scope": "public", "uuid": "077035E6691340C395FE707B73D62695", "attributes": [ { "name": "ID", "kind": "storage", "scope": "public", "uuid": "CEF76DE5D96944FBADA2FAC707C3D937", "unique": true, "autosequence": true, "type": "long", "primKey": true }, { "name": "name", "kind": "storage", "scope": "public", "uuid": "2E8F6CF570B94EE1B1D352C3B1C88490", "type": "string" }, { "name": "hatchDate", "kind": "storage", "scope": "public", "uuid": "268B1390B50E4869B87F728868020901", "type": "date", "simpleDate": false }, { "name": "coop", "kind": "relatedEntity", "scope": "public", "uuid": "50B14B3DEFC64D6CA480279E33EBF643", "type": "Coop", "path": "Coop" }, { "name": "age", "kind": "calculated", "scope": "public", "type": "long", "scriptKind": "javascript", "onGet": [ { "from": "model.Chicken.age.onGet", "userDefined": true } ], "onQuery": [ { "from": "model.Chicken.age.onQuery", "userDefined": true } ], "onSort": [ { "from": "model.Chicken.age.onSort", "userDefined": true } ] }, { "name": "gender", "kind": "storage", "scope": "public", "type": "string" }, { "name": "breed", "kind": "relatedEntity", "scope": "public", "type": "Breed", "path": "Breed" } ] }, { "name": "Coop", "className": "Coop", "collectionName": "Coops", "scope": "public", "uuid": "95995A60E60B43398E3061B2EFF91BE5", "attributes": [ { "name": "ID", "kind": "storage", "scope": "public", "uuid": "1B796474DF47463AAC7661003ED6D4EA", "unique": true, "autosequence": true, "type": "long", "primKey": true }, { "name": "name", "kind": "storage", "scope": "public", "uuid": "A5E7D323D63646FBA5C4026793361BED", "type": "string", "indexKind": "btree" }, { "name": "city", "kind": "storage", "scope": "public", "uuid": "56369282B8AF40CBB5A992E8E4ECA04C", "type": "string" }, { "name": "chickens", "kind": "relatedEntities", "scope": "public", "type": "Chickens", "reversePath": true, "path": "coop" }, { "name": "address", "kind": "relatedEntity", "scope": "public", "type": "Address", "path": "Address" } ], "methods": [ { "name": "generateCoops", "applyTo": "dataClass", "scope": "public", "from": "model.Coop.methods.generateCoops", "userDefined": true }, { "name": "generateCoopsWithWorker", "applyTo": "dataClass", "scope": "public", "from": "model.Coop.methods.generateCoopsWithWorker", "userDefined": true } ] } ], "type": []}
+{ "toJSON": true, "extraProperties": { "version": "1", "classes": { "Chicken": { "panelColor": "rgb(255, 255, 0)", "methVisible": "false", "panel": { "isOpen": "true", "pathVisible": true, "position": { "X": 494, "Y": 204 } } }, "Coop": { "panelColor": "rgb(184, 204, 228)", "methVisible": "false", "panel": { "isOpen": "true", "pathVisible": true, "position": { "X": 133, "Y": 93 } } }, "Breed": { "panelColor": "rgb(255, 192, 0)", "methVisible": "false", "panel": { "isOpen": "true", "pathVisible": true, "position": { "X": 151, "Y": 388 } } }, "Address": { "panelColor": "rgb(183, 221, 232)", "methVisible": "false", "panel": { "isOpen": "false", "pathVisible": true, "position": { "X": 56, "Y": 89 } } } }, "model": { "scriptMode": "manual", "workspaceLeft": 0, "workspaceTop": 0, "methodShowMode": "false", "relationCurve": { "mode": 1, "run": true } } }, "dataClasses": [ { "name": "Chicken", "className": "Chicken", "collectionName": "Chickens", "scope": "public", "uuid": "077035E6691340C395FE707B73D62695", "attributes": [ { "name": "ID", "kind": "storage", "scope": "public", "uuid": "CEF76DE5D96944FBADA2FAC707C3D937", "unique": true, "autosequence": true, "type": "long", "primKey": true }, { "name": "name", "kind": "storage", "scope": "public", "uuid": "2E8F6CF570B94EE1B1D352C3B1C88490", "type": "string" }, { "name": "hatchDate", "kind": "storage", "scope": "public", "uuid": "268B1390B50E4869B87F728868020901", "type": "date", "simpleDate": false }, { "name": "coop", "kind": "relatedEntity", "scope": "public", "uuid": "50B14B3DEFC64D6CA480279E33EBF643", "type": "Coop", "path": "Coop" }, { "name": "age", "kind": "calculated", "scope": "public", "type": "long", "scriptKind": "javascript", "onGet": [ { "from": "model.Chicken.age.onGet", "userDefined": true } ], "onQuery": [ { "from": "model.Chicken.age.onQuery", "userDefined": true } ], "onSort": [ { "from": "model.Chicken.age.onSort", "userDefined": true } ] }, { "name": "gender", "kind": "storage", "scope": "public", "type": "string" }, { "name": "breed", "kind": "relatedEntity", "scope": "public", "type": "Breed", "path": "Breed" } ] }, { "name": "Coop", "className": "Coop", "collectionName": "Coops", "scope": "public", "uuid": "95995A60E60B43398E3061B2EFF91BE5", "attributes": [ { "name": "ID", "kind": "storage", "scope": "public", "uuid": "1B796474DF47463AAC7661003ED6D4EA", "unique": true, "autosequence": true, "type": "long", "primKey": true }, { "name": "name", "kind": "storage", "scope": "public", "uuid": "A5E7D323D63646FBA5C4026793361BED", "type": "string", "indexKind": "btree" }, { "name": "city", "kind": "storage", "scope": "public", "uuid": "56369282B8AF40CBB5A992E8E4ECA04C", "type": "string" }, { "name": "chickens", "kind": "relatedEntities", "scope": "public", "type": "Chickens", "reversePath": true, "path": "coop" }, { "name": "address", "kind": "relatedEntity", "scope": "public", "type": "Address", "path": "Address" } ], "methods": [ { "name": "generateCoops", "applyTo": "dataClass", "scope": "public", "from": "model.Coop.methods.generateCoops", "userDefined": true }, { "name": "generateCoopsWithWorker", "applyTo": "dataClass", "scope": "public", "from": "model.Coop.methods.generateCoopsWithWorker", "userDefined": true } ] } ]}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1 @@
+<!DOCTYPE html><html> <head> <title>index</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="generator" content="Wakanda GUIDesigner" /> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> </head> <body> </body></html>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1 @@
+<!DOCTYPE html><html> <head> <title>Dojo Example - Static</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="generator" content="Wakanda GUIDesigner"/> <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> <meta name="wakanda-version" content="5 build 5.134039"/> <meta name="wakanda-build" content="5.134039"/> <meta name="WAF.config.modules" content="dataprovider"/> <meta name="WAF.config.loadJS" content="index.js"/> <meta name="WAF.catalog" content="Chicken,Breed,Coop"/> <meta id="waf-interface-css" name="WAF.config.loadCSS" content="styles/index.css"/> <meta id="waf-project-css" name="WAF.config.loadCSS" content="/application.css"/> <script type="text/javascript">dojoConfig = {parseOnLoad: true, baseUrl: "/js/dojo/"};</script> <script src="/js/dojo/dojo.js"></script> <link rel="stylesheet" href="/js/dojo/resources/dojo.css"/> <link rel="stylesheet" href="/js/dijit/themes/claro/claro.css"/> <link rel="stylesheet" href="/js/gridx/resources/claro/Gridx.css" /> <style type="text/css"> .side{width:420px; float:left;} #web5{position:absolute;left:10px;top:180px;} </style> </head> <body> <div class="content"> <div class="side"> <img src="images/side_chicken.png" width="417" height="461" alt="Side Chicken"> <img src="images/web5.png" width="100" id="web5" alt="Web5"> </div> <div id="grid"></div> </div> <script type="text/javascript" src="/waLib/WAF/Loader.js"></script> </body></html>
@@ -0,0 +1,48 @@
+
+// dojo.ready(function(){
+//var columns, store, grid
+WAF.onAfterInit = function() {
+ require([
+ "Wakanda",
+ "dojo/store/Memory",
+ "dgrid/OnDemandGrid",
+ "dojo/store/Observable"
+ ], function (Wakanda, Memory, OnDemandGrid, Observable) {
+ var chickens = [{name:"Little Bon", breed:"americana", alive:true},
+ {name:"Cim-Cha", breed:"silver lace", alive:true},
+ {name:"Lucy Left", breed:"whinedot", alive:false},
+ {name:"Crazy Break", breed:"silky", alive:true}];
+ var store = new Memory({data:chickens, idProperty: "name"});
+
+ observerable = new Observable(store);
+ // Create an instance of OnDemandGrid referencing the store
+ grid = new OnDemandGrid({
+ store: observerable,
+ columns: {
+ name: "Name",
+ breed: "Breed",
+ alive: {label:"alive", formatter:function(item){if(item){return "&#10003;"}else{return "x"}}}
+ }
+ }, "grid");
+ grid.startup();
+
+ });
+}
+
+function displayView(daView, chickenArray){
+ var tempResult ='<table class="chickenList"';
+ chickenArray.forEach(function(chicken){
+ //console.log(chicken.name)
+ tempResult +='<tr>'
+ tempResult +='<td>' + chicken.name + '</td>'
+ tempResult +='<td>'+ chicken.breed + '</td>'
+ tempResult +='</tr>'
+ });
+ daView.innerHTML = tempResult;
+}
+
+
+
+
+
+
@@ -0,0 +1 @@
+
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1 @@
+<!DOCTYPE html><html> <head> <title>Dojo Example - Wakanda</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="generator" content="Wakanda GUIDesigner"/> <meta http-equiv="X-UA-Compatible" content="IE=Edge"/> <meta name="wakanda-version" content="5 build 5.134039"/> <meta name="wakanda-build" content="5.134039"/> <meta name="WAF.config.modules" content="dataprovider"/> <meta name="WAF.config.loadJS" content="index.js"/> <meta name="WAF.catalog" content="Chicken,Breed,Coop"/> <meta id="waf-interface-css" name="WAF.config.loadCSS" content="styles/index.css"/> <meta id="waf-project-css" name="WAF.config.loadCSS" content="/application.css"/> <script type="text/javascript">dojoConfig = {parseOnLoad: true, baseUrl: "/js/dojo/"};</script> <script src="/js/dojo/dojo.js"></script> <link rel="stylesheet" href="/js/dojo/resources/dojo.css"/> <link rel="stylesheet" href="/js/dijit/themes/claro/claro.css"/> <link rel="stylesheet" href="/js/gridx/resources/claro/Gridx.css" /> <style type="text/css"> .side{width:420px; float:left;} #web5{position:absolute;left:10px;top:180px;} </style> </head> <body> <div class="content"> <div class="side"> <img src="images/side_chicken.png" width="417" height="461" alt="Side Chicken"> <img src="images/web5.png" width="100" id="web5" alt="Web5"> </div> <div id="grid"></div> </div> <script type="text/javascript" src="/waLib/WAF/Loader.js"></script> </body></html>
@@ -0,0 +1,78 @@
+WAF.onAfterInit = function() {
+ require([
+ "Wakanda",
+ "dojo/store/Memory",
+ "dgrid/OnDemandGrid",
+ "dojo/store/Observable",
+ "dgrid/OnDemandList"
+ ], function (Wakanda, Memory, OnDemandGrid, Observable, OnDemandList) {
+
+ chickenModel = new Wakanda({
+ target: "/rest/Chicken"
+ });
+ createGrid(chickenModel)
+
+ // chickenModel.query({gender:"female"}, {
+ // start: 10,
+ // count: 10
+ // }).then(function(results){
+ // chickens = results;
+ // store = new Memory({ data: chickens, idProperty:"ID" });
+ // createGrid(store)
+ // });
+
+ function createGrid(store){
+ observerable = new Observable(store);
+ // Create an instance of OnDemandGrid referencing the store
+ grid = new OnDemandGrid({
+ store: observerable,
+ minRowsPerPage: 10,
+ columns: {
+ name: "Name",
+ breed: {label:"Breed", formatter:function(breed){if(breed){return breed.name}else{return "-"}}},
+ age: "Weeks Old",
+ alive: {label:"alive", formatter:function(item){if(item){return "&#10003;"}else{return "x"}}}
+ }
+ }, "grid");
+ grid.startup();
+ }
+ // example refresh via chrome
+ //chickenModel.query({name:'Gw*'},{sort:[{attribute:'age'}],expand:["breed"]}).then(function(results){observerable.data = results;}).then(function(){grid.refresh()})
+
+ });
+
+
+
+
+// require(["dojo/store/Memory"],
+// function(Memory){
+// var chickens = [
+// {name:"Little Bon", breed:"americana", alive:true},
+// {name:"Cim-Cha", breed:"silver lace", alive:true},
+// {name:"Lucy Left", breed:"whinedot", alive:false},
+// {name:"Crazy Break", breed:"silky", alive:true}
+// ];
+// var employeeStore = new Memory({data:chickens, idProperty: "name"});
+// displayView(daView, employeeStore.query({alive:true}));
+// });
+
+
+}
+
+function displayView(daView, chickenArray){
+ var tempResult ='<table class="chickenList"';
+ chickenArray.forEach(function(chicken){
+ //console.log(chicken.name)
+ tempResult +='<tr>'
+ tempResult +='<td>' + chicken.name + '</td>'
+ tempResult +='<td>'+ chicken.breed + '</td>'
+ tempResult +='</tr>'
+ });
+ daView.innerHTML = tempResult;
+}
+
+
+
+
+
+
@@ -0,0 +1 @@
+
@@ -0,0 +1 @@
+<!DOCTYPE html><html> <head> <title>index</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="generator" content="Wakanda GUIDesigner" /> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta name="WAF.catalog" content="" /> </head> <body> </body></html>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit b012d8c

Please sign in to comment.