Documente Academic
Documente Profesional
Documente Cultură
• Model-View-Controller (MVC)
• Includes
HTTP DHTML/JavaScript
Web Server
Server-side Systems
Cards Activity
Saturday, July 11, 2009
Stages
Card Activity Dashboard
~$ palm-generate helloWorld
palm-package helloWorld
Create / Open
Mojo.Depot() - opens a depot with a name that matches or creates a new DB
Read
simpleGet() - returns object it retrieves if there’s a match
Update
simpleAdd()- adds or updates the value of the named object
Delete
removeAll() - removes the named depot and deletes associated data
Create / Open
var db = new Mojo.Depot({name:”dbName”, version:1, replace:false}, this.openOK.bind(this), this.openFail.bind(this));
Read
db.simpleGet(“myData”, this.getListOK.bind(this), this.getListFailed.bind(this));
Update
db.simpleAdd(“myData”, myDataContents, this.savedListOK.bind(this), this.savedListFailed.bind(this));
Delete
db.removeAll();
Read
db.simpleGet(“myData”, this.getListOK.bind(this), this.getListFailed.bind(this));
Update
db.simpleAdd(“myData”, myDataContents, this.savedListOK.bind(this), this.savedListFailed.bind(this));
Delete
db.removeAll();
FirstAssistant.prototype.openOk = function() {
Mojo.Log.info(“.....”,”Database opened”);
db.simpleGet(“myData”, this.getListOK.bind(this),
this.getListFailed.bind(this));
}
Create / Open
Mojo.Model.Cookie(id) - opens or creates cookie that matches the id
Read
get() - returns object it retrieves if there’s a match
Update
put()- adds or updates object with an optional date/time to expire
Delete
remove() - removes the cookie and it’s data
Create / Open
this.cookie = new Mojo.Model.Cookie(“Preferences”);
Read
var retrievedPrefs = this.cookie.get();
Update
this.cookie.put({ ...jsonKey: jsonValue ... });
Delete
this.cookie.remove();