Ignore:
Timestamp:
03/05/14 22:44:48 (11 years ago)
Author:
hendrikvanantwerpen
Message:

Completed migration to API, without CouchDB proxy.

Move to API is now completed. The full API is password protected, a very
limited API is exposed for respondents, which works with secrets that
are passed in URLs.

Serverside the HTTPResult class was introduced, which is similar to
Promises, but specifically for HTTP. It carries a status code and
response and makes it easier to extract parts of async handling in
separate functions.

Fixed a bug in our schema (it seems optional attributes don't exist but
a required list does). Verification of our schema by grunt-tv4 didn't
work yet. Our schema is organized the wrong way (this is fixable),
but the json-schema schema has problems with simple types and $refs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/pages/sessions.js

    r443 r487  
    11define([
    2     'dojo/_base/declare',
     2    /*'dojo/_base/declare',
    33    'dojo/_base/lang',
    44    'dojo/date/stamp',
     
    77    '../app/Page',
    88    '../widgets/ObjectBox',
    9     'dojo/text!./templates/sessions.html'
     9    'dojo/text!./templates/sessions.html'*/
    1010],function(declare,lang,dateStamp,store,Router,Page,ObjectBox,template){
    11     return declare([Page],{
     11    /*return declare([Page],{
    1212        templateString: template,
    1313        templateActions: null,
     
    1818            this.templateActions = {
    1919                "Edit": function(obj){
    20                     Router.go('/session/'+store.getIdentity(obj));
     20                    Router.go('/session/'+obj.get('id'));
    2121                },
    2222                "Delete": lang.hitch(this,function(obj){
    23                     store.remove(store.getIdentity(obj),store.getRevision(obj))
     23                    obj.remove()
    2424                    .then(lang.hitch(this,function(){
    2525                        this._refresh();
     
    3030            this.sessionActions = {
    3131                "Facilitate": function(obj){
    32                     Router.go('run',{uid:store.getIdentity(obj)});
     32                    Router.go('run',{uid: obj.get('id')});
    3333                },
    3434                "Delete": lang.hitch(this,function(obj){
    35                     store.remove(store.getIdentity(obj),store.getRevision(obj))
     35                    obj.remove()
    3636                    .then(lang.hitch(this,function(){
    3737                        this._refresh();
     
    4848        },
    4949        _refreshByType: function(type,container,actions) {
     50            // FIXME
    5051            store.query("_design/default/_view/by_type",{key:type})
    5152            .forEach(lang.hitch(this,function(obj){
     
    6162        },
    6263        _publishSession: function(sessionTemplate) {
     64            // FIXME
    6365            var session = lang.clone(sessionTemplate);
    6466            delete session[store.idProperty];
     
    7375            }));
    7476        }
    75     });
     77    });*/
    7678});
Note: See TracChangeset for help on using the changeset viewer.