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/model/widgets/QuestionEditorToolkit.js

    r443 r487  
    11define([
    2     "../../store",
     2    "../classes/categories",
     3    "../classes/topics",
    34    "./CategoryListView",
    45    "dijit/_Container",
     
    1516    "require",
    1617    "dojo/text!./templates/QuestionEditorToolkit.html"
    17 ], function(store, CategoryListView, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button, ComboBox, declare, lang, Source, domConstruct, Memory, require, template) {
     18], function(categories, topics, CategoryListView, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button, ComboBox, declare, lang, Source, domConstruct, Memory, require, template) {
    1819    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
    1920
     
    107108            this.inherited(arguments);
    108109
    109             store.query("_design/questions/_view/all", {reduce:true, group:false, group_level:1})
    110             .forPairs(lang.hitch(this, function(value, key) {
    111                 this._categoryStore.put({ id: key[0] });
     110            categories.query().forEach(lang.hitch(this,function(cat){
     111                this._categoryStore.put({ id: cat });
    112112            }));
    113113
    114             store.query("_design/questions/_view/all_topics", {reduce:true, group:true})
    115             .forPairs(lang.hitch(this, function(value, key) {
    116                 this._topicStore.put({ id: key });
     114            topics.query().forEach(lang.hitch(this,function(topic){
     115                this._categoryStore.put({ id: topic });
    117116            }));
    118117        },
Note: See TracChangeset for help on using the changeset viewer.