36. qx.Class.define('foo.bar', {
extend: qx.core.Object,
properties: {
phrase: { // autogenerate setter and getter and ...
apply: '_applyPhrase' // fire on property modification (not init!) - return
// value is ignored
nullable: true, // can be null
event: 'someEvent' // default changeFoo - fires on property change
check: ['suit up', 'bazinga'], // check possible inserts, also could be defined as a
// function - works only in development!
transform: '_transformPhrase' // transform value - BEFORE check and apply
validate: qx.util.Validate.string // works in development and production
},
awesome: { init: false, check: 'Boolean' }
nerd: { init: false, check: 'Boolean' }
},
members: {
_transformPhrase: function(value) {
return value + '!';
}
_applyPhrase: function(value, old, name) {
if (value === 'suit up!') {
this.toggleAwesome('awesome');
} else if (value === 'bazinga!') {
this.toggleAwesome('nerd');
}
}
}
});
36
48. EASY REST CALLS
var description = {
index: { method: GET, url: /photos }
create: { method: POST, url: /photos }
show: { method: GET, url: /photos/:id }
update: { method: PUT, url: /photos/:id }
}
var photos = new qx.io.rest.Resource(description); //declaratively
photos.map('destroy', 'DELETE', '/photos/:id'); //programatically
photos.index(); // -- GET /photos
photos.show({id: 1}); // -- GET /photos/1
// success is fired when any request associated to resource receives a
response
photos.addListener(success, function(e) {
e.getAction(); // -- index or show
});
// indexSuccess is fired when the request associated to the index action
receives a response
photos.addListener(indexSuccess, function(e) {
e.getAction(); // -- index
});
48
50. HTML EDITOR
The html editor does have some issues. Just not to give the impression
that it would try to compete with more advanced editors like ckEditor,
etc., because it doesn't. Still fine for many products, though.
[Andreas Ecker]
50
52. ADVANCED BUILD TOOL
Penny:frontend singles$ ./generate.py list
Available jobs:
- api -- create api doc for the current library
- api-data -- create api doc json data files
- build
- clean -- remove local cache and generated .js files (source/build)
- distclean -- remove the cache and all generated artefacts of this library (source,
build, ...)
- fix -- normalize whitespace in .js files of the current library (tabs, eol, ...)
- info -- collects environment information like the qooxdoo version etc., and prints it out
- inspector -- create an inspector instance in the current library
- lint -- check the source code of the .js files of the current library
- migration -- migrate the .js files of the current library to the current qooxdoo version
- pretty
- profiling -- includer job, to activate profiling
- simulation-build -- (experimental) create a runner app for simulated interaction tests
- simulation-run -- (experimental) launches simulated interaction tests generated with
simulation-build
- source
- source-all -- create source version of current application, with all classes
- source-hybrid -- create a hybrid version (app classes as source files, others compiled)
- test -- create a test runner app for unit tests of the current library
- test-source -- create a test runner app for unit tests (source version) of the current
library
- translation -- create .po files for current library
52