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.

Location:
Dev/trunk/src/client/qed-client/model/classes
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/model/classes

    • Property svn:ignore set to

      ### begin grunt-svn-ignore managed ignores
      ### edits will be overwritten when grunt svn-ignore is run
      Question.js
      Response.js
      Survey.js
      SurveyRun.js
      ### end grunt-svn-ignore managed ignores
  • Dev/trunk/src/client/qed-client/model/classes/questions.js

    r486 r487  
    1 define(function(){
    2     return {
    3         create: function(){
    4             return { type:'Question' };
     1define([
     2    "./_Class",
     3    "dojo/_base/declare",
     4    "dojo/date/stamp"
     5], function(_Class, declare, stamp) {
     6
     7    var Questions = declare([_Class],{
     8        _collection: 'questions',
     9        _type: 'Question',
     10        create: function() {
     11            var obj = {
     12                type: this._type,
     13                categories: [],
     14                code: "",
     15                content: [],
     16                title: ""
     17            };
     18            return obj;
    519        },
    6         DisplayTitle: {
    7             get: function(q) {
    8                 return q.title || '';
     20        _deserialize: function(obj) {
     21            if (obj.publicationDate) {
     22                obj.publicationDate = stamp.fromISOString(obj.publicationDate);
    923            }
    1024        },
    11         Content: {
    12             get: function(q) {
    13                 return q.content || [];
    14             },
    15             set: function(q,content) {
    16                 q.content = content;
     25        _serialize: function(obj) {
     26            if (obj.publicationDate) {
     27                obj.publicationDate = stamp.toISOString(obj.publicationDate);
    1728            }
    1829        }
    19     };
     30    });
     31
     32    return new Questions();
     33
    2034});
Note: See TracChangeset for help on using the changeset viewer.