Index: Dev/branches/rest-dojo-ui/client/index.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/index.html	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/index.html	(revision 417)
@@ -15,5 +15,5 @@
             </div>
         </div>
-        <div id="toaster" data-dojo-type="rft/ui/Notifications"></div>
+        <div id="toaster" data-dojo-type="rft/app/Notifications"></div>
     </body>
 </html>
Index: Dev/branches/rest-dojo-ui/client/rft/app/Notifications.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/app/Notifications.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/app/Notifications.js	(revision 417)
@@ -0,0 +1,7 @@
+define(['dojo/_base/declare','dojox/widget/Toaster'],
+function(declare,Toaster){
+    return declare([Toaster],{
+        positionDirection: "br-up",
+        duration: 1000
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/schema.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/schema.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/schema.js	(revision 417)
@@ -0,0 +1,137 @@
+define(['dojo/_base/lang'],function(lang){
+
+    /** Note on dojox.json.schema
+     * This implementation is not according to the version 03 of the json-schema
+     * draft. Differences:
+     * - doesn't support the 'required' property, but uses 'optional' (which is
+     *   false by default).
+     */
+
+    ////////////////////////////////////////
+    // Base schema types
+    //
+
+    var dateRe = "\\d{4}-\\d{2}-\\d{2}"; // YYYY-MM-DD
+    var timeRe = "\\d{2}:\\d{2}:\\d{2}"; // hh:mm:ss 
+    var datetimeRe = dateRe+"T"+timeRe+"Z"; // YYYY-MM-DDThh:mm:ssZ
+
+    function mixin(obj1,obj2) {
+        return lang.mixin({},obj1||{},obj2||{});
+    }
+    function mkType(base) {
+        return function(props) {
+            return mixin(base,props);
+        };
+    }
+
+    var nestring = mkType({ type:'string', minLength:1 });
+    var string = mkType({ type:'string' });
+    var integer = mkType({ type: 'integer' });
+    var boolean = mkType({ type: 'boolean' });
+    var pattern = function(p){
+        return mixin({
+            type: 'string',
+            pattern: p
+        });
+    };
+    var date = mkType(pattern(dateRe));
+    var time = mkType(pattern(timeRe));
+    var datetime = mkType(pattern(datetimeRe));
+    var array = function(items,props) {
+        return mixin({
+            type: 'array',
+            items: items
+        },props);
+    };
+    var object = function(properties,props) {
+        return mixin({
+            type: 'object',
+            properties: properties,
+            additionalProperties: false
+        },props);
+    };
+    var optional = mkType({ optional: true });
+
+    ////////////////////////////////////////
+    // Domain specific
+    //
+
+    var typedobject = function(type,properties,props) {
+        return object(mixin(properties,{
+            type: pattern(type)
+        }),props);
+    };
+
+    var dbobject = function(type,properties,props) {
+        return typedobject(type,mixin(properties,{
+            _id: nestring(optional()),
+            _rev: nestring(optional())
+        }),props);
+    };
+
+    ////////////////////////////////////////
+    // The QED schema
+    //
+
+    var schema = {type:[
+        dbobject('Question',{
+            code:nestring(),
+            title: nestring(),
+            description: string(optional()),
+            topic: string(optional()),
+            categories: array(nestring(),optional()),
+            content: array([
+                typedobject('Header',{
+                    content:string(optional())
+                }),
+                typedobject('Text',{
+                    content:string(optional())
+                }),
+                typedobject('Divider'),
+                typedobject('StringInput'),
+                typedobject('TextInput',{
+                    maxLength:integer()
+                }),
+                typedobject('IntegerInput',{
+                    min:integer(),
+                    max:integer(),
+                    step:integer()
+                }),
+                typedobject('MultipleChoiceInput',{
+                    multiple:boolean(),
+                    items:array(nestring())
+                })
+            ],optional()),
+            publicationDate:datetime(optional())
+        }),
+        dbobject('Survey',{
+            title: nestring(),
+            description: string(optional()),
+            questions: array(nestring(),optional()),
+            publicationDate:datetime(optional())
+        }),
+        dbobject('SurveyRun',{
+            description: string(optional()),
+            surveyId: nestring(),
+            publicationDate:datetime(optional()),
+            startDate:datetime(),
+            endDate:datetime(),
+            mode:{type:'string',enum:['open','closed']},
+            respondents: array(nestring(),optional()),
+            metadata:{type:'object',optional:true}
+        }),
+        dbobject('Session',{
+            title: nestring(),
+            description: string(optional()),
+            publicationDate: datetime(optional())
+        }),
+        dbobject('SessionTemplate',{
+            title: nestring(),
+            description: string(optional()),
+            publicationDate: datetime(optional()),
+            plannedDate: datetime(optional())
+        })
+    ]};
+
+    return schema;
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/AccountListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/AccountListView.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/AccountListView.js	(revision 417)
@@ -0,0 +1,42 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/dom-construct',
+    '../../widgets/LineWithActionsWidget',
+    '../../widgets/list/OrderedList'
+],function(
+    declare,
+    lang,
+    domConstruct,
+    LineWithActionsWidget,
+    OrderedList
+) {
+    return declare([OrderedList],{
+        baseClass: 'rftAccountListView',
+        type: 'account',
+
+        _createAvatarNode: function(item){
+            return domConstruct.create("div",{
+                'class': 'dragAvatar',
+                innerHTML: item.title
+            });
+        },
+        _createListNode: function(item) {
+            var w = new LineWithActionsWidget({
+                title: item.title,
+                'class': "green",
+                actions: {
+                    "Remove" : {
+                        callback: lang.hitch(this, 'removeItem', item),
+                        properties: {
+                            blockButton: false,
+                            icon: "Delete"
+                        }
+                    }
+                }
+            });
+            w.startup();
+            return w.domNode;
+        }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/CategoryListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/CategoryListView.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/CategoryListView.js	(revision 417)
@@ -0,0 +1,43 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    '../../widgets/LineWithActionsWidget',
+    '../../widgets/list/List'
+],function(
+    declare,
+    lang,
+    LineWithActionsWidget,
+    List
+) {
+    return declare([List],{
+        baseClass: 'rftLineListView',
+
+        _createAvatarNode: function(item) {
+            var node = document.createElement("div");
+            node.className = "dragAvatar";
+            node.innerHTML = item.title;
+            return node;
+        },
+
+        _createListNode: function(item) {
+            var w = new LineWithActionsWidget({
+                title: item,
+                'class': "orange",
+                actions: {
+                    "Remove" : {
+                        callback: lang.hitch(this, function() {
+                            this.removeItem(item, w);
+                        }),
+                        properties: {
+                            blockButton: false,
+                            icon: "Delete"
+                        }
+                    }
+                }
+            });
+            w.startup();
+            return w.domNode;
+        }
+
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionEditorPreview.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionEditorPreview.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionEditorPreview.js	(revision 417)
@@ -0,0 +1,36 @@
+define([
+    'dojo/_base/array',
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/dom-construct',
+    'dijit/registry',
+    './QuestionEditorPreviewItem',
+    '../../widgets/list/OrderedList'
+], function(array, declare, lang, domConstruct, registry, QuestionEditorPreviewItem, OrderedList) {
+    return declare([OrderedList], {
+        baseClass: 'surveyEditorPreview',
+        type: 'questionContent',
+        withHandles: true,
+
+        _createAvatarNode: function(item) {
+            return domConstruct.create("span",{
+                innerHTML: item.type || "Dragging!!!"
+            });
+        },
+        _createListNode: function(item) {
+            var previewItem = new QuestionEditorPreviewItem({
+                item: item
+            });
+            previewItem.on('close',lang.hitch(this,'removeItem',item));
+            previewItem.startup();
+            return previewItem.domNode;
+        },
+        getItems: function() {
+            return array.map(
+                this.source.getAllNodes(),
+                function(node){
+                    return registry.byNode(node).get('value');
+                },this);
+        }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionEditorPreviewItem.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionEditorPreviewItem.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionEditorPreviewItem.js	(revision 417)
@@ -0,0 +1,139 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/fx',
+    'dojo/_base/lang',
+    'dojo/dom-class',
+    'dojo/dom-geometry',
+    'dojo/on',
+    'dijit/_Container',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetBase',
+    'dijit/_WidgetsInTemplateMixin',
+    './QuestionWidgetFactory',
+    'dojo/text!./templates/QuestionEditorPreviewItem.html'
+], function(
+    declare,
+    fx,
+    lang,
+    domClass,
+    domGeom,
+    on,
+    _Container,
+    _TemplatedMixin,
+    _WidgetBase,
+    _WidgetsInTemplateMixin,
+    QuestionWidgetFactory,
+    template
+){
+    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
+        version: "full",
+        templateString: template,
+        baseClass: "surveyEditorPreviewItem",
+        previousContentHeight: 200,
+        item: null,
+        innerWidget: null,
+        foldDuration: [250, 250],
+        animation: null,
+        _editing: false,
+
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            this.foldButtonNode.onClick = lang.hitch(this, this.toggleFold);
+            this.removeButtonNode.onClick = lang.hitch(this, "onClose");
+            this.editButtonNode.onClick = lang.hitch(this, this.toggleEdit);
+            if (this.item) {
+                this._showViewWidget();
+            } else {
+                throw "No data supplied to create an innerWidget!";
+            }
+        },
+        _destroyInnerWidget: function() {
+            if ( this.innerWidget !== null ) {
+                this.innerWidget.destroyRecursive();
+            }
+        },
+        _showViewWidget: function() {
+            var factory = new QuestionWidgetFactory();
+            this.innerWidget = factory.createViewWidget( this.item );
+            if ( this.innerWidget !== null ) {
+                this.innerWidget.placeAt(this.containerNode);
+                this.innerWidget.startup();
+                this.innerWidget.set('readOnly',true);
+            }
+            this.titleNode.innerHTML = this.item.type+" [preview]";
+        },
+        _showEditWidget: function() {
+            var factory = new QuestionWidgetFactory();
+            this.innerWidget = factory.createEditWidget( this.item );
+            if ( this.innerWidget !== null ) {
+                this.innerWidget.placeAt(this.containerNode);
+                this.innerWidget.startup();
+            }
+            this.titleNode.innerHTML = this.item.type+" [editing]";
+        },
+        onClose: function() {},
+        _getValueAttr: function(value) {
+            return this.item;
+        },
+        _setValueAttr: function(value) {
+            this.item = value;
+            this._destroyInnerWidget();
+            if ( this._editing ) {
+                this._showEditWidget();
+            } else {
+                this._showViewWidget();
+            }
+        },
+        toggleEdit: function() {
+            if(this._editing) {
+                if ( this.innerWidget !== null ) {
+                    this.item = this.innerWidget.get('value');
+                }
+                this._destroyInnerWidget();
+                this._showViewWidget();
+                this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconAccept", "rftIconEdit");
+                this.editButtonNode.set("label", "Edit");
+            } else {
+                this._destroyInnerWidget();
+                this._showEditWidget();
+                this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconEdit", "rftIconAccept");
+                this.editButtonNode.set("label", "Done");
+            }
+            this._editing = !this._editing;
+        },
+        toggleFold: function() {
+            if (!this.animation) {
+                if (!domClass.contains(this.domNode, "fold")) {
+                    this.previousContentHeight = domGeom.getMarginBox(this.innerNode).h;
+                    this.animation = fx.animateProperty({
+                        node: this.innerNode,
+                        duration: this.foldDuration[0],
+                        properties: {
+                            height: 1                        
+                        },
+                        onEnd: lang.hitch(this, function(){
+                            domClass.add(this.domNode, "fold");
+                            this.animation = null;
+                        })
+                    }).play();
+                    this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowUp", "rftIconHalfArrowDown");
+                } else {
+                    this.animation = fx.animateProperty({
+                        node: this.innerNode,
+                        duration: this.foldDuration[1],
+                        properties: {
+                            height: this.previousContentHeight                
+                        },
+                        onEnd: lang.hitch(this, function(){
+                            domClass.remove(this.domNode, "fold");
+                            this.animation = null;
+                        })
+                    }).play();
+                    this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowDown", "rftIconHalfArrowUp");
+                }
+            }
+        }
+
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionEditorToolkit.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionEditorToolkit.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionEditorToolkit.js	(revision 417)
@@ -0,0 +1,166 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/dnd/Source',
+    'dojo/dom-construct',
+    'dojo/store/Memory',
+    'dijit/_Container',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetBase',
+    'dijit/_WidgetsInTemplateMixin',
+    'dijit/form/Button',
+    'dijit/form/ComboBox',
+    '../../store',
+    './CategoryListView',
+    'dojo/text!./templates/QuestionEditorToolkit.html'
+    ], function(declare, lang, Source, domConstruct, Memory, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button, ComboBox, store, CategoryListView, template) {
+        return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
+
+            templateString: template,
+            _list: null,
+            _categorySelect: null,
+            _categoryStore: null,
+            _topicSelect: null,
+            _topicStore: null,
+            _categories : null,
+
+            _contentItems: [
+                { type: "Header" },
+                { type: "Text" },
+                { type: "Image" },
+                { type: "ExternalMedia" },
+                { type: "Divider" }
+            ],
+            _inputsItems: [
+                { type: "StringInput" },
+                { type: "TextInput" },
+                { type: "IntegerInput" },
+                { type: "ScaleInput" },
+                { type: "MultipleChoiceInput" }
+            ],
+            _labelMap: {
+                "Header": "Header",
+                "Text": "Text",
+                "Image": "Image",
+                "ExternalMedia": "External media",
+                "Divider": "Divider",
+                "StringInput": "Text line",
+                "TextInput": "Free text",
+                "IntegerInput": "Integer number",
+                "ScaleInput": "Scale",
+                "MultipleChoiceInput": "Multiple choice"
+            },
+            _iconMap: {
+                "Header": "Header",
+                "Text": "TextBox",
+                "Image": "Image",
+                "ExternalMedia": "External",
+                "Divider": "Divider",
+                "StringInput": "Text",
+                "TextInput": "Text",
+                "IntegerInput": "Integer",
+                "ScaleInput": "Scale",
+                "MultipleChoiceInput": "MultipleChoice"
+            },
+
+            postCreate: function(){
+                this.inherited(arguments);
+                var creator = lang.hitch(this,"_creator");
+                this.contentSource = new Source(this.ToolkitContentSourceNode, {
+                    accept: [],
+                    copyOnly: true,
+                    selfAccept: false,
+                    singular: true,
+                    creator: creator
+                });
+                this.inputsSource = new Source(this.ToolkitInputsSourceNode, {
+                    accept: [],
+                    copyOnly: true,
+                    selfAccept: false,
+                    singular: true,
+                    creator: creator
+                });
+                this.contentSource.insertNodes(false, this._contentItems);
+                this.inputsSource.insertNodes(false, this._inputsItems);
+            },
+            _setValueAttr: function(question) {
+                this.propertiesForm.set('value', question);
+                this._categories = question.categories || [];
+                this._setupListView();
+                this._setupCategories();
+                this._setupTopic(question.topic);
+            },
+            _getValueAttr: function() {
+                var value = this.propertiesForm.get('value');
+                value.categories = this._categories;
+                return value;
+            },
+            onCategoryAdd: function() {
+                this._addCategory(this._categorySelect.get('displayedValue')); 
+                this._categorySelect.reset();
+            },
+            _creator: function(item, hint) {
+                var node;
+                if (hint == "avatar") {
+                    node = domConstruct.create('span',{
+                        innerHTML: this._labelMap[item.type] || item.type
+                    });
+                } else {
+                    var w = new Button({
+                        baseClass: "rftLargeButton",
+                        iconClass: "rftIcon rftIcon"+(this._iconMap[item.type]||"Unknown"),
+                        label: this._labelMap[item.type] || item.type,
+                        showLabel: true,
+                        'class': "newline"
+                    });
+                    node = w.domNode;
+                }
+                return {node: node, data: item, type: ["questionContent"]};
+            },
+            _setupListView: function() {
+                this._list = new CategoryListView( {
+                    removeCallback: lang.hitch(this, this._removeCategory)
+                }).placeAt(this.listNode);
+                this._list.startup();                
+                for (var category in this._categories) {
+                    this._list.appendItem(this._categories[category]);
+                }    
+            },
+            _setupCategories: function() {
+                this._categoryStore = new Memory({data: [] });
+                store.query("_design/questions/_view/all", {reduce:true, group:false, group_level:1})
+                .forPairs(lang.hitch(this, function(value, key) {
+                    this._categoryStore.put({ id: key[0] });
+                }));
+                this._categorySelect = new ComboBox( {
+                    name: "categories",
+                    store: this._categoryStore,
+                    searchAttr: "id"
+                }, this.categoriesBoxNode);
+                this._supportingWidgets.push(this._categorySelect);
+
+            },
+            _setupTopic: function(topic) {
+                this._topicStore = new Memory( {data: [] });
+                store.query("_design/questions/_view/all_topics", {reduce:true, group:true})
+                .forPairs(lang.hitch(this, function(value, key) {
+                    this._topicStore.put({ id: key });
+                }));
+                this._topicSelect = new ComboBox( {
+                    name: "topic",
+                    store: this._topicStore,
+                    searchAttr: "id",
+                    value: topic
+                }, this.topicBoxNode);
+                this._supportingWidgets.push(this._topicSelect);
+            },
+            _addCategory: function(item) {
+                this._categories.push(item);
+                this._list.appendItem(item);
+            },
+            _removeCategory: function(item) {
+                this._categories.splice(this._categories.indexOf(item), 1);
+            }
+
+        });
+    });
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionListView.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionListView.js	(revision 417)
@@ -0,0 +1,51 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/dom-construct',
+    '../../widgets/LineWithActionsWidget',
+    '../../widgets/list/OrderedList'
+],function(
+    declare,
+    lang,
+    domConstruct,
+    LineWithActionsWidget,
+    OrderedList
+){
+    return declare([OrderedList],{
+        baseClass: 'rftSurveyListView',
+        type: 'question',
+
+        _createAvatarNode: function(item){
+            return domConstruct.create("div",{
+                'class': 'dragAvatar',
+                innerHTML: item.title
+            });
+        },
+        _createListNode: function(item) {
+            var w = new LineWithActionsWidget({
+                title: item.title,
+                'class': "inheritBgColor",
+                actions: {
+                    "Remove" : {
+                        callback: lang.hitch(this, 'removeItem', item),
+                        properties: {
+                            blockButton: false,
+                            icon: "Delete",
+                            label: "Remove"
+                        }
+                    },
+                    "Info" : {
+                        callback: function(){ item.description && alert(item.description); },
+                        properties: {
+                            blockButton: false,
+                            icon: "Inspect",
+                            label: "Show info"
+                        }
+                    }
+                }
+            });
+            w.startup();
+            return w.domNode;
+        }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionWidget.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionWidget.js	(revision 417)
@@ -0,0 +1,74 @@
+define(['dojo/_base/declare','dojo/_base/lang','dojo/dom-construct','dijit/_WidgetBase',
+    'dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin',
+    'dojo/text!./templates/QuestionWidget.html','dijit/form/TextBox',
+    'dijit/form/Textarea','../../widgets/MultipleChoiceWidget'],
+    function(declare,lang,domConstruct,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString,TextBox,Textarea,MultipleChoiceWidget){
+        return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
+            templateString: templateString,
+            mode: 'view', // view || edit
+            name: '',
+            value: null,
+            _scale: null,
+            _widgetCache: null,
+            constructor: function() {
+                this.inherited(arguments);
+                this.value = {};
+                this._widgetCache = {};
+            },
+            postCreate: function() {
+                this._resetValue = this.value;
+                this.scaleSelector.set('disabled', this.mode == 'edit');
+            },
+            _setValueAttr: function(value) {
+                this.value = value;
+                this._onTypeChange(value.scale || 'string');
+                this.ourForm.set('value',value);
+            },
+            _getValueAttr: function() {
+                var value = this.ourForm.get('value');
+                lang.mixin(this.value,value);
+                return this.value;
+            },
+            _onTypeChange: function(scale) {
+                if ( this._scale == scale ) return;
+                this._scale = scale;
+                domConstruct.empty(this.scaleDetails);
+                var widget = this._getTypeWidget(scale);
+                widget && widget.placeAt(this.scaleDetails,'only');
+            },
+            _getTypeWidget: function(scale) {
+                var widget = this._widgetCache[scale];
+                if (!widget) {
+                    switch(scale) {
+                        case 'string':
+                            widget = new TextBox({
+                                name: 'answers',
+                                disabled: this.mode == 'view'
+                            });
+                            break;
+                        case 'text':
+                            widget = new Textarea({
+                                name: 'answers',
+                                disabled: this.mode == 'view',
+                                style: 'min-height: 120px'
+                            });
+                            break;
+                        case 'singleChoice':
+                        case 'multipleChoice':
+                            widget = new MultipleChoiceWidget({
+                                name: 'answers',
+                                mode: this.mode,
+                                allowMultiple: scale == 'multipleChoice'
+                            });
+                            break;
+                    }
+                    this._widgetCache[scale] = widget;
+                }
+                return widget;
+            },
+            reset: function() {
+                this.ourForm.reset();
+                this._setValueAttr(this._resetValue);
+            }
+        });
+    });
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionWidgetFactory.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionWidgetFactory.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/QuestionWidgetFactory.js	(revision 417)
@@ -0,0 +1,410 @@
+define([
+    'dojo/_base/array',
+    'dojo/_base/declare',
+    'dojo/_base/lang', 
+    'dojo/dom-construct', 
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetBase',
+    'dijit/_Container',
+    'dijit/form/Button',
+    'dijit/form/CheckBox',
+    'dijit/form/Form',
+    'dijit/form/NumberSpinner',
+    'dijit/form/RadioButton',
+    'dijit/form/Textarea',
+    'dijit/form/TextBox',
+    'dojox/layout/TableContainer',
+    '../../widgets/list/_EditableListMixin',
+    '../../widgets/list/OrderedList'
+],function(array, declare, lang, domConstruct, _TemplatedMixin, _WidgetBase, _Container, Button, CheckBox, Form, NumberSpinner, RadioButton, Textarea, TextBox, TableContainer, _EditableListMixin, OrderedList) {
+    var factory = declare(null, {
+        createViewWidget: function(/*Object*/options) {
+            // options: Object
+            //            type: "header", "text", textinput, etc.
+            //            other type specific fields
+            var fun = this['create'+options.type+'ViewWidget'];
+            var view = fun !== undefined ? fun(options) : null;
+            return view;
+        },
+        createEditWidget: function(/*Object*/options) {
+            var fun = this['create'+options.type+'EditWidget'];
+            var view = fun !== undefined ? fun() : null;
+            if(view)
+                view.set('value', options);
+            return view;
+        },
+
+        createHeaderViewWidget: function(options) {
+            return new HeaderView({
+                options: options
+            });
+        },
+        createHeaderEditWidget: function() {
+            return new HeaderEdit();
+        },
+
+        createTextViewWidget: function(options) {
+            return new TextView({
+                options: options
+            });
+        },
+        createTextEditWidget: function() {
+            return new TextEdit();
+        },
+
+        createDividerViewWidget: function(options) {
+            return new DividerView({
+                options: options
+            });
+        },
+
+        createStringInputViewWidget: function(options) {
+            return new StringInputView({
+                options: options
+            });
+        },
+        createStringInputEditWidget: function() {
+            return new StringInputEdit();
+        },
+
+        createTextInputViewWidget: function(options) {
+            return new TextInputView({
+                options: options
+            });
+        },
+        createTextInputEditWidget: function() {
+            return new TextInputEdit();
+        },
+
+        createIntegerInputViewWidget: function(options) {
+            return new IntegerInputView({
+                options: options
+            });
+        },
+        createIntegerInputEditWidget: function() {
+            return new IntegerInputEdit();
+        },
+
+        createMultipleChoiceInputViewWidget: function(options) {
+            return new MultipleChoiceInputView({
+                options: options
+            });
+        },
+        createMultipleChoiceInputEditWidget: function() {
+            return new MultipleChoiceInputEdit();
+        }
+    });
+
+    var DefaultEdit = declare([Form,_Container],{
+        type: null,
+        addChild: function(widget) {
+            domConstruct.create("label",{
+                innerHTML: widget.title || ''
+            },this.containerNode,'last');
+            this.inherited(arguments,[widget]);
+        },
+        _getValueAttr: function() {
+            var val = this.inherited(arguments);
+            val.type = this.type;
+            return val;
+        }
+    });
+
+    var HeaderView = declare([_WidgetBase], {
+        postCreate: function() {
+            this.domNode.innerHTML = "<h2>"+this.options.content+"</h2>";
+        }
+    });
+
+    var HeaderEdit = declare([DefaultEdit], {
+        type: 'Header',
+        postCreate: function() {
+            this.inherited(arguments);
+            this.addChild(new TextBox({
+                title: 'Content',
+                name: 'content'
+            }));
+        }
+    });
+
+    var TextView = declare([_WidgetBase], {
+        postCreate: function() {
+            this.domNode.innerHTML = "<p>"+this.options.content+"</p>";
+        }
+    });
+
+    var TextEdit = declare([DefaultEdit], {
+        type: 'Text',
+        postCreate: function() {
+            this.inherited(arguments);
+            this.addChild(new Textarea({
+                title: 'Content',
+                name: 'content'
+            }));
+        }
+    });
+
+    var DividerView = declare([_WidgetBase], {
+        postCreate: function() {
+            this.domNode.innerHTML = "<hr>";
+        }
+    });
+
+    var DefaultInputEdit = declare([DefaultEdit],{
+        postCreate: function() {
+            this.inherited(arguments);
+            this.addChild(new TextBox({
+                title: 'Text',
+                name: 'text'
+            }));
+        }
+    });
+
+    var StringInputView = declare([_WidgetBase, _Container],{
+        _textBox: null,
+        postCreate: function() {
+            this._textBox = new TextBox({
+                name: this.options.code || ''
+            });
+            this.addChild(this._textBox);
+            this._textBox.startup();
+        },
+        _setReadOnlyAttr: function(value) {
+            this._textBox.set('readOnly', value);
+        },
+        _getCodeAttr: function() {
+            return this.options.code;
+        },
+        _getValueAttr: function() {
+            return this._textBox.get('value') || "";
+        },
+        _setValueAttr: function(value) {
+            this._textBox.set('value',value || "");
+        }
+    });
+
+    var StringInputEdit = declare([DefaultInputEdit],{
+        type: 'StringInput'
+    });
+
+    var TextInputView = declare([_WidgetBase, _Container], {
+        _textArea: null,
+        postCreate: function() {
+            this._textArea = new Textarea({
+                name: this.options.code
+            });
+            this._textArea.set('maxLength', this.options.maxLength || 1000);
+            this._textArea.set('value', this.options.defaultValue || "");
+            this.addChild(this._textArea);
+            this._textArea.startup();
+        },
+        _getCodeAttr: function() {
+            return this.options.code;
+        },
+        _getValueAttr: function() {
+            return this._textArea.get('value');
+        },
+        _setReadOnlyAttr: function(value) {
+            this._textArea.set('readOnly', value);
+        }
+    });
+
+    var TextInputEdit = declare([DefaultInputEdit], {
+        type: 'TextInput',
+        postCreate: function() {
+            this.inherited(arguments);
+            this.addChild(new NumberSpinner({
+                name: 'maxLength',
+                title: "Maximum length",
+                constraints: {
+                    min: 0
+                }
+            }));
+        }
+    });
+
+    var IntegerInputView = declare([_WidgetBase, _Container], {
+        _numberInput: null,
+        postCreate: function() {
+            this._numberInput = new NumberSpinner({
+                name: this.options.code || '',
+                constraints: {
+                    min: this.options.min,
+                    max: this.options.max,
+                    smallDelta: this.options.step
+                }
+            });
+            this.addChild(this._numberInput);
+            this._numberInput.startup();
+        },
+        _getCodeAttr: function() {
+            return this.options.code;
+        },
+        _getValueAttr: function() {
+            return this._numberInput.get('value');
+        },
+        _setReadOnlyAttr: function(value) {
+            this._numberInput.set('readOnly', value);
+        }
+    });
+
+    var IntegerInputEdit = declare([DefaultInputEdit], {
+        type: 'IntegerInput',
+        postCreate: function() {
+            this.inherited(arguments);
+            this.addChild(new NumberSpinner({
+                title: "Minimum",
+                name: 'min'
+            }));
+            this.addChild(new NumberSpinner({
+                title: "Maximum",
+                name: 'max'
+            }));
+            this.addChild(new NumberSpinner({
+                title: "Step",
+                name: 'step'
+            }));
+        }
+    });
+
+    var MultipleChoiceInputView = declare([_WidgetBase, _Container], {
+        postCreate: function() {
+            var table = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
+
+            var ctor = this.options.multiple === true ? CheckBox : RadioButton;
+            array.forEach(this.options.items || [],function(item){
+                table.addChild(new ctor({
+                        name: this.options.code || '',
+                        title: item
+                }));
+            },this);
+
+            this.addChild(table);
+            table.startup();
+        },
+        _getCodeAttr: function() {
+            return this.options.code;
+        },
+        _getValueAttr: function() {
+            var checked = array.filter(this.getChildren(),function(child){
+                return child.get('checked');
+            });
+            if ( this.options.multiple ) {
+                return array.map(checked,function(child){
+                    return child.get('value');
+                });
+            } else {
+                return checked.length > 0 ? checked[0].get('value') : null;
+            }
+        },
+        _setReadOnlyAttr: function(value) {
+            array.forEach(this.getChildren(),function(child){
+                child.set('readOnly', value);
+            },this);
+        }
+    });
+
+    var MCOptionItem = declare([_WidgetBase,_TemplatedMixin,_Container],{
+        templateString: '<div><span class="dojoDndHandle">=</span></div>',
+        _textBox: null,
+        postCreate: function() {
+            this._textBox = new TextBox({});
+            this.addChild(this._textBox);
+            this._textBox.startup();
+
+            var del = new Button({
+                label: "X",
+                onClick: lang.hitch(this,'onDelete')
+            });
+            this.addChild(del);
+            del.startup();
+        },
+        _getValueAttr: function() {
+            return this._textBox.set('value');
+        },
+        _setValueAttr: function(value) {
+            this._textBox.set('value',value);
+        },
+        onDelete: function(){}
+    });
+
+    var MCOptionList = declare([OrderedList,_EditableListMixin],{
+        type: 'multipleChoiceOption',
+        withHandles: true,
+        _createAvatarNode: function(item){
+            return domConstruct.create("div",{
+                'class': 'dragAvatar',
+                innerHTML: item
+            });
+        },
+        _createListNode: function(item) {
+            var w = new MCOptionItem();
+            w.startup();
+            w.set('value',item);
+            w.on('delete',lang.hitch(this,'_onRemove',w));
+            return w.domNode;
+        },
+        _onRemove: function(w) {
+            w.destroyRecursive();
+            this.removeCallback && this.removeCallback(item);
+            this.source.sync();
+        }
+    });
+
+    var MultipleChoiceInputEdit = declare([_WidgetBase, _Container], {
+        _codeInput: null,
+        _multipleInput: null,
+        postCreate: function() {
+            var table = new TableContainer({ cols: 1, customClass: "labelsAndValues"} );
+
+            this._codeInput = new TextBox({
+                title: "Code"
+            });
+            table.addChild(this._codeInput);
+            this._codeInput.startup();
+
+            this._multipleInput = new CheckBox({
+                title: "Allow multiple"
+            });
+            table.addChild(this._multipleInput);
+            this._multipleInput.startup();
+
+            var add = new Button({
+                label: "Add",
+                onClick: lang.hitch(this,'_addOption',"")
+            });
+            table.addChild(add);
+            add.startup();
+
+            this._optionsList = new MCOptionList();
+            table.addChild(this._optionsList);
+            this._optionsList.startup();
+
+            this.addChild(table);
+            table.startup();
+        },
+
+        _addOption: function() {
+            this._optionsList.appendItems([""]);
+        },
+
+        _setValueAttr: function(value) {
+            this._codeInput.set('value', value.code || "");
+            this._multipleInput.set('checked', value.multiple);
+            this._optionsList.deleteItems();
+            this._optionsList.appendItems(value.items || []);
+        },
+        _getValueAttr: function() {
+            return {
+                type: "MultipleChoiceInput",
+                code: this._codeInput.get('value') || "",
+                multiple: this._multipleInput.get('checked'),
+                items: array.map(this._optionsList.getItems(),function(item){
+                    return item.get('value');
+                },this)
+            };
+        }
+    });
+
+    return factory;
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/SurveyFieldset.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/SurveyFieldset.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/SurveyFieldset.js	(revision 417)
@@ -0,0 +1,13 @@
+define([
+    'dojo/_base/declare',
+    'dijit/_Container',
+    'dijit/_WidgetBase',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetsInTemplateMixin',
+    'dojo/text!./templates/SurveyFieldset.html'
+],function(declare,_Container,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,template){
+    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+        templateString: template,
+        baseClass: "rftSurveyFieldset"
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/SurveyRunFieldset.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/SurveyRunFieldset.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/SurveyRunFieldset.js	(revision 417)
@@ -0,0 +1,13 @@
+define([
+    'dojo/_base/declare',
+    'dijit/_Container',
+    'dijit/_WidgetBase',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetsInTemplateMixin',
+    'dojo/text!./templates/SurveyRunFieldset.html'
+],function(declare,_Container,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,template){
+    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+        templateString: template,
+        baseClass: "rftSurveyRunFieldset"
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/TabbedQuestionBrowser.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/TabbedQuestionBrowser.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/TabbedQuestionBrowser.js	(revision 417)
@@ -0,0 +1,127 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/_base/window',
+    'dijit/layout/ContentPane',
+    'dijit/layout/TabContainer',
+    'dojox/widget/Standby',
+    '../../store',
+    '../../widgets/Selector',
+    'dojo/domReady!'
+],function(declare,lang,win,ContentPane,TabContainer,Standby,store,Selector){
+    return declare([TabContainer],{
+        tabPosition: 'left-h',
+        include: 'all',
+
+        selectedActions: null,
+        itemActions: null,
+
+        _dataMap: null,
+        _busyCount: 0,
+        constructor: function(){
+            this.inherited(arguments);
+            this._dataMap = {};
+        },
+        postCreate: function() {
+            this.inherited(arguments);
+            this._query = '_design/questions/_view/'+this.include;
+        },
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            this._busyWidget = new Standby({
+                target: this.domNode,
+                duration: 200
+            }).placeAt(win.body());
+            this._busyWidget.startup();
+            this.watch("selectedChildWidget",lang.hitch(this,function(name,oldTab,newTab){
+                this._fillCategoryTab(newTab.__category);
+            }));
+            store.query(this._query, {reduce:true,group:true,group_level:1})
+            .forPairs(lang.hitch(this,function(value,key){
+                this._createCategoryTab(key[0],value);
+            }));
+        },
+        _createCategoryTab: function(category,count) {
+            if (this._dataMap[category] === undefined) {
+                var categoryTab = new ContentPane({
+                    __category: category,
+                    title: (category || '[No category]')+" ("+count+")"
+                });
+                categoryTab.startup();
+                this._dataMap[category] = {
+                    _widget: categoryTab
+                };
+                this.addChild(categoryTab);
+            }
+        },
+        _fillCategoryTab: function(category) {
+            var categoryMap = this._dataMap[category];
+            if (!categoryMap._filled) {
+                this._busy();
+                categoryMap._filled = true;
+                store.query(this._query, {reduce:true,group:true,group_level:2,startkey:[category],endkey:[category,{}]})
+                .forPairs(lang.hitch(this,function(value,key){
+                    this._createTopicSelector(key[1],category,value);
+                })).then(lang.hitch(this,function(){
+                    this._done();
+                }));
+            }
+        },
+        _createTopicSelector: function(topic,category,count){
+            var categoryMap = this._dataMap[category];
+            if (categoryMap[topic] === undefined) {
+                var w = new Selector({
+                    __category: category,
+                    __topic: topic,
+                    title: (topic || '[No topic]')+" ("+count+")",
+                    selectedActions: this.selectedActions,
+                    itemActions: this.itemActions
+                }).placeAt(categoryMap._widget.containerNode);
+                w.startup();
+                categoryMap[topic] = {
+                    _widget: w
+                };
+                this._fillTopicSelector(topic,category);
+            }
+        },
+        _fillTopicSelector: function(topic,category) {
+            var categoryMap = this._dataMap[category];
+            var topicMap = categoryMap[topic];
+            if (!topicMap._filled) {
+                topicMap._filled = true;
+                this._busy();
+                store.query(this._query, {reduce:false,include_docs:true,key:[category,topic]})
+                .forEach(lang.hitch(this,function(value){
+                    var title;
+                    if ( this.include === 'all' ) {
+                        title = value.title+(value.publicationDate?' (published on '+value.publicationDate+')':' (unpublished)');
+                    }
+                    topicMap._widget.addItem(value,title);
+                })).then(lang.hitch(this,function(){
+                    this._done();
+                }));
+            }
+        },
+        _busy: function() {
+            if ( this._busyCount === 0 ) {
+                this._busyWidget.show();
+            }
+            this._busyCount++;
+        },
+        _done: function() {
+            if ( this._busyCount > 0 ) {
+                this._busyCount--;
+                if ( this._busyCount === 0 ) {
+                    this._busyWidget.hide();
+                }
+            } else {
+                console.warn('_done() was called more times than _busy().');
+            }
+        },
+        destroy: function() {
+            this._busyWidget.destroyRecursive();
+            this.inherited(arguments);
+        }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/QuestionEditorPreviewItem.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/QuestionEditorPreviewItem.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/QuestionEditorPreviewItem.html	(revision 417)
@@ -0,0 +1,15 @@
+<div>
+	<div class="topBorder inheritBgColor bg dojoDndHandle">
+		<span class="title" data-dojo-attach-point="titleNode">Default title</span>
+		<span class="floatRight" data-dojo-attach-point="buttonsNode">
+			<button class="trans bg inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-point="editButtonNode" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconEdit'">Edit</button>
+			<button class="trans bg inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-point="foldButtonNode" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconHalfArrowUp'">Fold</button>
+			<button class="trans bg inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-point="removeButtonNode" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconDelete'">Remove</button>
+		</span>
+	</div>
+	
+	<div class="surveyEditorPreviewItemInner" data-dojo-attach-point="innerNode">
+		<div class="surveyEditorPreviewItemContent" data-dojo-attach-point="containerNode">
+		</div>
+	</div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/QuestionEditorToolkit.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/QuestionEditorToolkit.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/QuestionEditorToolkit.html	(revision 417)
@@ -0,0 +1,31 @@
+<div>
+	<div data-dojo-type="dojox/widget/TitleGroup">
+		<div data-dojo-type="dijit/TitlePane" class="orange" data-dojo-props="open:true" title="Properties" data-dojo-props="iconClass:'rftIcon rftIconProperties'">
+            <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="propertiesForm">
+				<fieldset class="align">
+					<label>Title:</label><input data-dojo-type="dijit/form/TextBox" name="title"/>
+					<label>Code:</label><input data-dojo-type="dijit/form/TextBox" name= "code"/>
+					<label>Categories:</label>
+					<div data-dojo-attach-point="listNode" class="rftLineListView"></div> 
+					<div data-dojo-attach-point="categoriesBoxNode"></div>
+					<button class="inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onCategoryAdd" data-dojo-props="baseClass:'rftBlockButton', iconClass: 'rftIcon rftIconPlus'">Add</button><br>
+					<label>Topic:</label>
+					<div data-dojo-attach-point="topicBoxNode"></div>
+					<label>Description:</label><textarea data-dojo-type="dijit/form/Textarea" name="description"></textarea>
+				</fieldset>
+			</div>
+		</div>
+
+		<div data-dojo-type="dijit/TitlePane" title="Content" data-dojo-props="iconClass:'rftIcon rftIconPlus', open:false">
+			<div data-dojo-attach-point="ToolkitContentSourceNode">
+				
+			</div>
+		</div>
+
+		<div data-dojo-type="dijit/TitlePane" title="Inputs" data-dojo-props="iconClass:'rftIcon rftIconInput', open:false">
+			<div data-dojo-attach-point="ToolkitInputsSourceNode">
+				
+			</div>
+		</div>
+	</div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/QuestionWidget.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/QuestionWidget.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/QuestionWidget.html	(revision 417)
@@ -0,0 +1,23 @@
+<div>
+    <form data-dojo-type="dijit/form/Form" data-dojo-attach-point="ourForm">
+        <fieldset>
+            <label for="code" class="loginLabel">Code</label>
+            <input data-dojo-type="dijit/form/TextBox" name="code" type="text" class="loginInput" />
+            <label for="question" class="loginLabel">Title</label>
+            <input data-dojo-type="dijit/form/TextBox" name="title" type="text" class="loginInput" />
+            <label for="question" class="loginLabel">Description</label>
+            <input data-dojo-type="dijit/form/Textarea" name="description" type="text" class="loginInput"/>
+            <label for="category" class="loginLabel">Category</label>
+            <input data-dojo-type="dijit/form/TextBox" name="category" type="text" class="loginInput" />
+        </fieldset>
+        <fieldset>
+            <select data-dojo-type="dijit/form/Select" data-dojo-attach-point="scaleSelector" data-dojo-attach-event="onChange:_onTypeChange" name="scale">
+                <option value="string" selected>String</option>
+                <option value="text">Text</option>
+                <option value="singleChoice">Single choice</option>
+                <option value="multipleChoice">Multiple choice</option>
+            </select>
+            <div data-dojo-attach-point="scaleDetails"></div>
+        </fieldset>
+    </form>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/SurveyFieldset.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/SurveyFieldset.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/SurveyFieldset.html	(revision 417)
@@ -0,0 +1,6 @@
+<fieldset class="${baseClass}">
+    <label for="title">Title</label>
+    <input data-dojo-type="dijit/form/TextBox" name="title"/><br/>
+    <label for="description">Description</label>
+    <input data-dojo-type="dijit/form/Textarea" name="description"/><br/>
+</fieldset>
Index: Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/SurveyRunFieldset.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/SurveyRunFieldset.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/model/widgets/templates/SurveyRunFieldset.html	(revision 417)
@@ -0,0 +1,22 @@
+<fieldset class="${baseClass}">
+
+    <label for="mode" class="loginLabel">Description</label>
+    <textarea name="description" data-dojo-type="dijit/form/Textarea"></textarea>
+    <br>
+
+    <label for="startDate" class="loginLabel">Start date</label>
+    <input type="text" name="startDatetime" data-dojo-type="rft/widgets/DateTimeTextBox" />
+    <br>
+
+    <label for="endDate" class="loginLabel">End date</label>
+    <input type="text" name="endDatetime" data-dojo-type="rft/widgets/DateTimeTextBox" />
+    <br>
+
+    <label for="mode" class="loginLabel">Mode</label>
+    <select name="mode" data-dojo-type="dijit/form/Select">
+        <option value="open" selected="selected">Open</option>
+        <option value="closed">Closed</option>
+    </select>
+    <br>
+
+</fieldset>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/index.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/index.html	(revision 416)
+++ 	(revision )
@@ -1,37 +1,0 @@
-<div>
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
-        <h2>
-            <span class="rftIcon rftIconUser"></span>
-            <span class="headerText">Main Menu</span>
-        </h2>
-    </div>
-
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
-
-        <div class="rftIndexMenuBlock" title="Sessions">
-            <div class="rftIndexMenuMask">
-                <span class="rftIcon rftIconSession"></span><span class="label">Sessions</span>
-            </div>
-            <button data-dojo-attach-point="btnContentCreate" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'green twoHeight', iconClass: 'rftIcon rftIconPlus'">Create and edit</button>
-            <button data-dojo-attach-point="btnContentFacilitate" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'green twoHeight', iconClass: 'rftIcon rftIconForward'">Facilitate</button>
-        </div>
-
-        <div class="rftIndexMenuBlock" title="Content">
-            <div class="rftIndexMenuMask">
-                <span class="rftIcon rftIconInspect"></span><span class="label">Content</span>
-            </div>
-            <button data-dojo-attach-point="btnSurveys" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'blue oneHeight', iconClass: 'rftIcon rftIconSurvey'">Surveys</button>
-            <button data-dojo-attach-point="btnQuestions" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'orange oneHeight', iconClass: 'rftIcon rftIconQuestion'">Questions</button>
-            <button data-dojo-attach-point="btnApplications" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'purple oneHeight', iconClass: 'rftIcon rftIconApplication'">Applications</button>
-            <button data-dojo-attach-point="btnDashboards" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'red oneHeight', iconClass: 'rftIcon rftIconDashboard'">Dashboards</button>
-        </div>
-
-        <div class="rftIndexMenuBlock" title="results">
-            <div class="rftIndexMenuMask">
-                <span class="rftIcon rftIconGameData"></span><span class="label">Results</span>
-            </div>
-            <button data-dojo-attach-point="btnResults" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'blue fourHeight', iconClass: 'rftIcon rftIconGameData'">Results</button>
-        </div>
-    </div>
-
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/index.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/index.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/index.js	(revision 417)
@@ -3,5 +3,5 @@
     '../app/Router',
     '../app/Page',
-    'dojo/text!./index.html'
+    'dojo/text!./templates/index.html'
 ],function(declare,Router,Page,template){
     return declare([Page],{
Index: Dev/branches/rest-dojo-ui/client/rft/pages/question.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/question.html	(revision 416)
+++ 	(revision )
@@ -1,20 +1,0 @@
-<div class="orange">
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
-        <h2>
-            <span class="rftIcon rftIconSurvey"></span>
-            <span class="headerText"><span data-dojo-attach-point="titleNode">Question title</span> [Editing]</span>
-        </h2>
-    </div>
-    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'left', design:'headline'" style="width: 300px;">
-        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
-            <div data-dojo-attach-point="QuestionEditorToolkitNode"></div>
-        </div>
-        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
-            <button data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'" data-dojo-attach-event="onClick:_onDiscard">Discard</button>
-            <button data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'" data-dojo-attach-event="onClick:_onSave">Save and exit</button>
-        </div>
-    </div>
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
-        <div data-dojo-attach-point="QuestionEditorPreviewNode"></div>
-    </div>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/question.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/question.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/question.js	(revision 417)
@@ -8,7 +8,7 @@
     '../app/Router',
     '../app/Page',
-    '../ui/QuestionEditorPreview',
-    '../ui/QuestionEditorToolkit',
-    'dojo/text!./question.html'
+    '../model/widgets/QuestionEditorPreview',
+    '../model/widgets/QuestionEditorToolkit',
+    'dojo/text!./templates/question.html'
 ],function(declare, Deferred, event, lang, store, Content, Router, Page, QuestionEditorPreview, QuestionEditorToolkit, template){
     return declare([Page], {
Index: Dev/branches/rest-dojo-ui/client/rft/pages/questions.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/questions.html	(revision 416)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<div class="blue page_questions">
-
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
-        <h2>
-            <span class="rftIcon rftIconQuestion"></span>
-            <span class="headerText">Questions</span>
-        </h2>
-    </div>
-    
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
-        <div data-dojo-attach-point="questionBrowser"></div>
-    </div>
-
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'">
-        <div data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onNewQuestion" data-dojo-props="baseClass: 'rftLargeButton', iconClass:'rftIcon rftIconQuestion'">New question</div>
-    </div>
-
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/questions.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/questions.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/questions.js	(revision 417)
@@ -8,6 +8,6 @@
     '../app/Router',
     '../app/Page',
-    '../ui/TabbedQuestionBrowser',
-    'dojo/text!./questions.html'
+    '../model/widgets/TabbedQuestionBrowser',
+    'dojo/text!./templates/questions.html'
 ],function(declare,Deferred,event,lang,store,Content,Router,Page,TabbedQuestionBrowser,template) {
     return declare([Page],{
Index: Dev/branches/rest-dojo-ui/client/rft/pages/session.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/session.html	(revision 416)
+++ 	(revision )
@@ -1,55 +1,0 @@
-<div>
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
-        <h2>
-            <span class="rftIcon rftIconSurvey"></span>
-            <span data-dojo-attach-point="titleNode" class="headerText">Untitled</span><span class="headerText"> [editing]</span>
-        </h2>
-    </div>
-    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center'">
-        <div data-dojo-type="dijit/layout/TabContainer" class="green" data-dojo-props="tabPosition:'left-h',region:'center'">
-            <div data-dojo-type="dijit/layout/ContentPane" title="Properties">
-                <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="propertiesForm" data-dojo-attach-event="onSubmit:onSave">
-
-                    <h3>Basic</h3>
-                    <fieldset class="align">
-                        <label for="title">Title</label>
-                        <input type="text" name="title" data-dojo-type="dijit/form/TextBox" data-dojo-props="placeHolder: 'Enter title here'" />
-                        <br/>
-                        <label for="description">Description</label>
-                        <textarea name="description" rows="3" cols="54" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props="selectOnClick: true, placeHolder: 'Description shown in tooltips'"></textarea>
-                        <br/>
-                        <label for="plannedDate">Planned date</label>
-                        <input type="text" name="plannedDate" data-dojo-type="dijit/form/DateTextBox" required="required" />
-                    </fieldset>
-
-                    <h3>Accounts</h3>
-                    <fieldset class="align">
-                        <label for="accountSelector">Add new</label>
-                        <select data-dojo-attach-point="accountSelector"></select>
-                        <button data-dojo-attach-point="btnInvite" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onInvite" data-dojo-props="baseClass: 'rftBlockButton', class: 'green', iconClass: 'rftIcon rftIconPlus'">Invite</button>
-                        <br/><br/>
-                        
-                        <div data-dojo-attach-point="accountListNode" class="rftAccountListView">
-                        </div>
-                    </fieldset>
-
-                    <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onDiscard" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'">Discard changes</button>
-                    <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onSave" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'">Save changes</button>
-
-                </div>
-
-            </div>
-            <div data-dojo-type="dijit/layout/ContentPane" title="Design">
-                <div class="rftSessionObject green">
-                    <div class="rftIcon rftIconSurvey"></div>
-                    <label>Survey name</label>
-                </div>
-                <div class="rftSessionObject green">
-                    <div class="rftIcon rftIconSurvey"></div>
-                    <label>Survey name, this one is really long.</label>
-                </div>
-
-            </div>
-        </div>
-    </div>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/session.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/session.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/session.js	(revision 417)
@@ -9,7 +9,7 @@
     '../app/Page',
     '../app/Router',
-    '../ui/ThresholdFilteringSelect',
-    '../ui/lists/AccountListView',
-    'dojo/text!./session.html'
+    '../widgets/ThresholdFilteringSelect',
+    '../model/widgets/AccountListView',
+    'dojo/text!./templates/session.html'
 ],function(array,declare,Deferred,event,lang,search,store,Page,Router,ThresholdFilteringSelect,AccountListView,template){
     return declare([Page],{
Index: Dev/branches/rest-dojo-ui/client/rft/pages/sessions.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/sessions.html	(revision 416)
+++ 	(revision )
@@ -1,26 +1,0 @@
-<div class="page_sessions">
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
-        <h2>
-            <span class="rftIcon rftIconSession"></span>
-            <span class="headerText">Sessions</span>
-        </h2>
-    </div>
-    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center'">
-        <div data-dojo-attach-point="tabContainer" data-dojo-type="dijit/layout/TabContainer" class="green" data-dojo-props="tabPosition:'left-h',region:'center'">
-            <div data-dojo-type="dijit/layout/BorderContainer" title="Templates" data-dojo-attach-point="templatesTab">
-                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="containerTemplates">
-                </div>
-                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
-                    <div data-dojo-type="dijit/form/Button" data-dojo-props="region: 'bottom', baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconSessionTemplate'" data-dojo-attach-event="onClick:onAddSessionTemplate">Create new template</div>
-                </div>
-            </div>
-            <div data-dojo-type="dijit/layout/ContentPane" title="Sessions" data-dojo-attach-point="sessionsTab">
-                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="containerSessions">
-                </div>
-                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
-                    <!-- Buttons? -->
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/sessions.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/sessions.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/sessions.js	(revision 417)
@@ -6,6 +6,6 @@
     '../app/Router',
     '../app/Page',
-    '../ui/ObjectBox',
-    'dojo/text!./sessions.html'
+    '../widgets/ObjectBox',
+    'dojo/text!./templates/sessions.html'
 ],function(declare,lang,dateStamp,store,Router,Page,ObjectBox,template){
     return declare([Page],{
Index: Dev/branches/rest-dojo-ui/client/rft/pages/survey.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/survey.html	(revision 416)
+++ 	(revision )
@@ -1,58 +1,0 @@
-<div class="blue">
-
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
-        <h2>
-            <span class="rftIcon rftIconSurvey"></span>
-            <span class="headerText" data-dojo-attach-point="titleNode">Survey Editor</span>
-        </h2>
-    </div>
-    
-    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center'">
-        <div data-dojo-attach-point="questionBrowser"></div>
-    </div>
-    
-    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'right'" style="width: 300px">
-        <div data-dojo-attach-point="surveyListViewNode" class="rftSurveyListView">
-        </div>
-
-        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'">
-            <button data-dojo-type="dijit/form/Button"
-                    data-dojo-attach-event="onClick:_onShowProperties"
-                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconProperties'">
-                Properties</button>
-            <button data-dojo-type="dijit/form/Button"
-                    data-dojo-attach-event="onClick:_onSave"
-                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'">
-                Save Changes</button>
-            <button data-dojo-type="dijit/form/Button"
-                    data-dojo-attach-event="onClick:_onDiscard"
-                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'">
-                Discard changes</button>
-            <button data-dojo-type="dijit/form/Button"
-                    data-dojo-attach-event="onClick:_onShowPreview"
-                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconPreview'">
-                Preview</button>
-        </div>
-
-    <div data-dojo-type="dijit/Dialog"
-         title="Survey properties"
-         data-dojo-attach-point="propertiesDialog"
-         data-dojo-attach-event="onSubmit:_onPropertiesOk">
-
-        <div data-dojo-type="rft/ui/model/SurveyForm"
-              data-dojo-attach-point="propertiesForm"></div>
-            
-        <div>
-            <button data-dojo-type="dijit/form/Button"
-                    type="submit"
-                    data-dojo-attach-event="onClick:_onPropertiesOk">
-                OK</button>
-            <button data-dojo-type="dijit/form/Button"
-                    type="button"
-                    data-dojo-attach-event="onClick:_onPropertiesCancel">
-                Cancel</button>
-        </div>
-
-    </div>
-
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/survey.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/survey.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/survey.js	(revision 417)
@@ -8,7 +8,7 @@
     '../store',
     '../app/Page',
-    '../ui/lists/QuestionListView',
-    '../ui/TabbedQuestionBrowser',
-    'dojo/text!./survey.html'
+    '../model/widgets/QuestionListView',
+    '../model/widgets/TabbedQuestionBrowser',
+    'dojo/text!./templates/survey.html'
 ],function(array,declare,Deferred,event,lang,Router,store,Page,
          QuestionListView,TabbedQuestionBrowser,template){
@@ -81,5 +81,5 @@
         refresh: function() {
             this.titleNode.innerHTML = this.survey.title || "(set title in properties)";
-            this.propertiesForm.set('value',this.survey);
+            this.propertiesDialog.set('value',this.survey);
         },
         _onShowProperties: function(evt) {
@@ -88,5 +88,5 @@
         _onPropertiesOk: function(evt) {
             this.propertiesDialog.hide();
-            lang.mixin(this.survey, this.propertiesForm.get('value'));
+            lang.mixin(this.survey, this.propertiesDialog.get('value'));
             this.refresh();
             event.stop(evt);
@@ -95,5 +95,5 @@
         _onPropertiesCancel: function(evt) {
             this.propertiesDialog.hide();
-            this.propertiesForm.set('value',this.survey);
+            this.propertiesDialog.reset('value',this.survey);
             event.stop(evt);
             return false;
Index: Dev/branches/rest-dojo-ui/client/rft/pages/surveys.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/surveys.html	(revision 416)
+++ 	(revision )
@@ -1,47 +1,0 @@
-<div>
-
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
-        <h2>
-            <span class="rftIcon rftIconSurvey"></span>
-            <span class="headerText">Surveys</span>
-        </h2>
-    </div>
-
-    <div data-dojo-attach-point="tabContainer" data-dojo-type="dijit/layout/TabContainer" class="blue" data-dojo-props="tabPosition:'left-h',region:'center'">
-
-        <div data-dojo-type="dijit/layout/BorderContainer" title="Drafts" data-dojo-attach-point="draftsTab">
-            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="draftsContainer">
-            </div>
-            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
-            </div>
-        </div>
-
-        <div data-dojo-type="dijit/layout/BorderContainer" title="Published" data-dojo-attach-point="publishedTab">
-            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="publishedContainer">
-            </div>
-            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
-            </div>
-        </div>
-
-        <div data-dojo-type="dijit/layout/BorderContainer" title="Runs" data-dojo-attach-point="runsTab">
-            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="runsContainer">
-            </div>
-            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
-            </div>
-        </div>
-    </div>
-
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
-        <button data-dojo-type="dijit/form/Button" class="blue" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconNew'" data-dojo-attach-event="onClick:_onNewSurvey">New survey</button>
-    </div>
-
-    <div data-dojo-type="dijit/Dialog"
-         title="SurveyRun properties"
-         data-dojo-attach-point="surveyRunDialog">
-        <form data-dojo-type="rft/ui/model/SurveyRunForm" data-dojo-attach-point="surveyRunForm">
-            <button data-dojo-type="dijit/form/Button">OK</button>
-            <button data-dojo-type="dijit/form/Button">Cancel</button>
-        </form>
-    </div>
-
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js	(revision 417)
@@ -4,11 +4,12 @@
     'dojo/_base/lang',
     'dojo/when',
+    'rx/rx.dojo',
     '../store',
     '../app/Content',
     '../app/Page',
     '../app/Router',
-    '../ui/LineWithActionsWidget',
-    'dojo/text!./surveys.html'
-],function(array,declare,lang,when,store,Content,Page,Router,LineWithActionsWidget,template){
+    '../widgets/LineWithActionsWidget',
+    'dojo/text!./templates/surveys.html'
+],function(array,declare,lang,when,Rx,store,Content,Page,Router,LineWithActionsWidget,template){
     return declare([Page],{
         templateString: template,
@@ -47,5 +48,24 @@
         },
         _onRunSurvey:function(survey){
+            this.surveyRun = {
+                type: 'SurveyRun',
+                surveyId: store.getIdentity(survey),
+                publicationDate: store.timestamp()
+            };
+            this.surveyRunDialog.set('value',this.surveyRun);
             this.surveyRunDialog.show();
+        },
+        _onSurveyRunOk: function() {
+            var surveyRun = lang.mixin(lang.clone(this.surveyRun),this.surveyRunDialog.get('value'));
+            store.put(surveyRun)
+            .then(lang.hitch(this,function(){
+                this.surveyRunDialog.hide();
+                this.refreshRuns();
+            }),function(err){
+                Content.notify(err);
+            });
+        },
+        _onSurveyRunCancel: function() {
+            this.surveyRunDialog.hide();
         },
         refresh: function() {
@@ -131,5 +151,5 @@
                 array.forEach(surveyRuns,function(surveyRun){
                     var w = new LineWithActionsWidget({
-                        title: survey.title,
+                        title: surveyRun.title+" (from "+surveyRun.startDate+" to "+surveyRun.endDate+")",
                         actions:[{
                             callback: lang.hitch(this,'_onCloseRun',surveyRun),
Index: Dev/branches/rest-dojo-ui/client/rft/pages/templates/index.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/templates/index.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/templates/index.html	(revision 417)
@@ -0,0 +1,37 @@
+<div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconUser"></span>
+            <span class="headerText">Main Menu</span>
+        </h2>
+    </div>
+
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
+
+        <div class="rftIndexMenuBlock" title="Sessions">
+            <div class="rftIndexMenuMask">
+                <span class="rftIcon rftIconSession"></span><span class="label">Sessions</span>
+            </div>
+            <button data-dojo-attach-point="btnContentCreate" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'green twoHeight', iconClass: 'rftIcon rftIconPlus'">Create and edit</button>
+            <button data-dojo-attach-point="btnContentFacilitate" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'green twoHeight', iconClass: 'rftIcon rftIconForward'">Facilitate</button>
+        </div>
+
+        <div class="rftIndexMenuBlock" title="Content">
+            <div class="rftIndexMenuMask">
+                <span class="rftIcon rftIconInspect"></span><span class="label">Content</span>
+            </div>
+            <button data-dojo-attach-point="btnSurveys" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'blue oneHeight', iconClass: 'rftIcon rftIconSurvey'">Surveys</button>
+            <button data-dojo-attach-point="btnQuestions" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'orange oneHeight', iconClass: 'rftIcon rftIconQuestion'">Questions</button>
+            <button data-dojo-attach-point="btnApplications" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'purple oneHeight', iconClass: 'rftIcon rftIconApplication'">Applications</button>
+            <button data-dojo-attach-point="btnDashboards" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'red oneHeight', iconClass: 'rftIcon rftIconDashboard'">Dashboards</button>
+        </div>
+
+        <div class="rftIndexMenuBlock" title="results">
+            <div class="rftIndexMenuMask">
+                <span class="rftIcon rftIconGameData"></span><span class="label">Results</span>
+            </div>
+            <button data-dojo-attach-point="btnResults" data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftIndexMenuButton', class: 'blue fourHeight', iconClass: 'rftIcon rftIconGameData'">Results</button>
+        </div>
+    </div>
+
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/templates/question.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/templates/question.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/templates/question.html	(revision 417)
@@ -0,0 +1,20 @@
+<div class="orange">
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSurvey"></span>
+            <span class="headerText"><span data-dojo-attach-point="titleNode">Question title</span> [Editing]</span>
+        </h2>
+    </div>
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'left', design:'headline'" style="width: 300px;">
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
+            <div data-dojo-attach-point="QuestionEditorToolkitNode"></div>
+        </div>
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+            <button data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'" data-dojo-attach-event="onClick:_onDiscard">Discard</button>
+            <button data-dojo-type="dijit/form/Button" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'" data-dojo-attach-event="onClick:_onSave">Save and exit</button>
+        </div>
+    </div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
+        <div data-dojo-attach-point="QuestionEditorPreviewNode"></div>
+    </div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/templates/questions.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/templates/questions.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/templates/questions.html	(revision 417)
@@ -0,0 +1,18 @@
+<div class="blue page_questions">
+
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconQuestion"></span>
+            <span class="headerText">Questions</span>
+        </h2>
+    </div>
+    
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
+        <div data-dojo-attach-point="questionBrowser"></div>
+    </div>
+
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'">
+        <div data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onNewQuestion" data-dojo-props="baseClass: 'rftLargeButton', iconClass:'rftIcon rftIconQuestion'">New question</div>
+    </div>
+
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/templates/session.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/templates/session.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/templates/session.html	(revision 417)
@@ -0,0 +1,55 @@
+<div>
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSurvey"></span>
+            <span data-dojo-attach-point="titleNode" class="headerText">Untitled</span><span class="headerText"> [editing]</span>
+        </h2>
+    </div>
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center'">
+        <div data-dojo-type="dijit/layout/TabContainer" class="green" data-dojo-props="tabPosition:'left-h',region:'center'">
+            <div data-dojo-type="dijit/layout/ContentPane" title="Properties">
+                <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="propertiesForm" data-dojo-attach-event="onSubmit:onSave">
+
+                    <h3>Basic</h3>
+                    <fieldset class="align">
+                        <label for="title">Title</label>
+                        <input type="text" name="title" data-dojo-type="dijit/form/TextBox" data-dojo-props="placeHolder: 'Enter title here'" />
+                        <br/>
+                        <label for="description">Description</label>
+                        <textarea name="description" rows="3" cols="54" data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props="selectOnClick: true, placeHolder: 'Description shown in tooltips'"></textarea>
+                        <br/>
+                        <label for="plannedDate">Planned date</label>
+                        <input type="text" name="plannedDate" data-dojo-type="dijit/form/DateTextBox" required="required" />
+                    </fieldset>
+
+                    <h3>Accounts</h3>
+                    <fieldset class="align">
+                        <label for="accountSelector">Add new</label>
+                        <select data-dojo-attach-point="accountSelector"></select>
+                        <button data-dojo-attach-point="btnInvite" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onInvite" data-dojo-props="baseClass: 'rftBlockButton', class: 'green', iconClass: 'rftIcon rftIconPlus'">Invite</button>
+                        <br/><br/>
+                        
+                        <div data-dojo-attach-point="accountListNode" class="rftAccountListView">
+                        </div>
+                    </fieldset>
+
+                    <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onDiscard" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'">Discard changes</button>
+                    <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onSave" data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'">Save changes</button>
+
+                </div>
+
+            </div>
+            <div data-dojo-type="dijit/layout/ContentPane" title="Design">
+                <div class="rftSessionObject green">
+                    <div class="rftIcon rftIconSurvey"></div>
+                    <label>Survey name</label>
+                </div>
+                <div class="rftSessionObject green">
+                    <div class="rftIcon rftIconSurvey"></div>
+                    <label>Survey name, this one is really long.</label>
+                </div>
+
+            </div>
+        </div>
+    </div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/templates/sessions.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/templates/sessions.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/templates/sessions.html	(revision 417)
@@ -0,0 +1,26 @@
+<div class="page_sessions">
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSession"></span>
+            <span class="headerText">Sessions</span>
+        </h2>
+    </div>
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center'">
+        <div data-dojo-attach-point="tabContainer" data-dojo-type="dijit/layout/TabContainer" class="green" data-dojo-props="tabPosition:'left-h',region:'center'">
+            <div data-dojo-type="dijit/layout/BorderContainer" title="Templates" data-dojo-attach-point="templatesTab">
+                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="containerTemplates">
+                </div>
+                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
+                    <div data-dojo-type="dijit/form/Button" data-dojo-props="region: 'bottom', baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconSessionTemplate'" data-dojo-attach-event="onClick:onAddSessionTemplate">Create new template</div>
+                </div>
+            </div>
+            <div data-dojo-type="dijit/layout/ContentPane" title="Sessions" data-dojo-attach-point="sessionsTab">
+                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="containerSessions">
+                </div>
+                <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
+                    <!-- Buttons? -->
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/templates/survey.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/templates/survey.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/templates/survey.html	(revision 417)
@@ -0,0 +1,52 @@
+<div class="blue">
+
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSurvey"></span>
+            <span class="headerText" data-dojo-attach-point="titleNode">Survey Editor</span>
+        </h2>
+    </div>
+    
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'center'">
+        <div data-dojo-attach-point="questionBrowser"></div>
+    </div>
+    
+    <div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="region:'right'" style="width: 300px">
+        <div data-dojo-attach-point="surveyListViewNode" class="rftSurveyListView">
+        </div>
+
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'">
+            <button data-dojo-type="dijit/form/Button"
+                    data-dojo-attach-event="onClick:_onShowProperties"
+                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconProperties'">
+                Properties</button>
+            <button data-dojo-type="dijit/form/Button"
+                    data-dojo-attach-event="onClick:_onSave"
+                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconAccept'">
+                Save Changes</button>
+            <button data-dojo-type="dijit/form/Button"
+                    data-dojo-attach-event="onClick:_onDiscard"
+                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconCancel'">
+                Discard changes</button>
+            <button data-dojo-type="dijit/form/Button"
+                    data-dojo-attach-event="onClick:_onShowPreview"
+                    data-dojo-props="baseClass: 'rftLargeButton', iconClass: 'rftIcon rftIconPreview'">
+                Preview</button>
+        </div>
+
+    <div data-dojo-type="dijit/Dialog"
+         title="Survey properties"
+         data-dojo-attach-point="propertiesDialog"
+         data-dojo-attach-event="onSubmit:_onPropertiesOk">
+        <fieldset data-dojo-type="rft/model/widgets/SurveyFieldset"></fieldset>
+        <button data-dojo-type="dijit/form/Button"
+                type="submit"
+                data-dojo-attach-event="onClick:_onPropertiesOk">
+            OK</button>
+        <button data-dojo-type="dijit/form/Button"
+                type="button"
+                data-dojo-attach-event="onClick:_onPropertiesCancel">
+            Cancel</button>
+    </div>
+
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/templates/surveys.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/templates/surveys.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/templates/surveys.html	(revision 417)
@@ -0,0 +1,46 @@
+<div>
+
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSurvey"></span>
+            <span class="headerText">Surveys</span>
+        </h2>
+    </div>
+
+    <div data-dojo-attach-point="tabContainer" data-dojo-type="dijit/layout/TabContainer" class="blue" data-dojo-props="tabPosition:'left-h',region:'center'">
+
+        <div data-dojo-type="dijit/layout/BorderContainer" title="Drafts" data-dojo-attach-point="draftsTab">
+            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="draftsContainer">
+            </div>
+            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
+            </div>
+        </div>
+
+        <div data-dojo-type="dijit/layout/BorderContainer" title="Published" data-dojo-attach-point="publishedTab">
+            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="publishedContainer">
+            </div>
+            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
+            </div>
+        </div>
+
+        <div data-dojo-type="dijit/layout/BorderContainer" title="Runs" data-dojo-attach-point="runsTab">
+            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'" data-dojo-attach-point="runsContainer">
+            </div>
+            <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
+            </div>
+        </div>
+    </div>
+
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" style="height: 40px;">
+        <button data-dojo-type="dijit/form/Button" class="blue" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconNew'" data-dojo-attach-event="onClick:_onNewSurvey">New survey</button>
+    </div>
+
+    <div data-dojo-type="dijit/Dialog"
+         title="SurveyRun properties"
+         data-dojo-attach-point="surveyRunDialog">
+        <fieldset data-dojo-type="rft/model/widgets/SurveyRunFieldset"></fieldset>
+        <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:_onSurveyRunOk">OK</button>
+        <button data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:_onSurveyRunCancel">Cancel</button>
+    </div>
+
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/templates/viewSurvey.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/templates/viewSurvey.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/templates/viewSurvey.html	(revision 417)
@@ -0,0 +1,29 @@
+<div class="blue">
+
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
+        <h2>
+            <span class="rftIcon rftIconSurvey"></span>
+            <span class="headerText" data-dojo-attach-point="titleNode">Survey</span>
+        </h2>
+    </div>
+    
+    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'" data-dojo-attach-point="questionsPane">
+        <form data-dojo-type="dijit/form/Form" data-dojo-attach-point="questionsForm"
+              data-dojo-attach-event="onSubmit:_onSubmit"
+              style="overflow: auto">
+            <div data-dojo-attach-point="questionsAnchor"></div>
+        </form>
+    </div>
+    
+    <div data-dojo-attach-point="buttonsPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'">
+        <button data-dojo-type="dijit/form/Button"
+                type="submit"
+                data-dojo-attach-event="onClick:_onSubmit">
+            Submit</button>
+        <button data-dojo-type="dijit/form/Button"
+                type="button"
+                data-dojo-attach-event="onClick:_onCancel">
+            Cancel</button>
+    </div>
+
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.html	(revision 416)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<div class="blue">
-
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
-        <h2>
-            <span class="rftIcon rftIconSurvey"></span>
-            <span class="headerText" data-dojo-attach-point="titleNode">Survey</span>
-        </h2>
-    </div>
-    
-    <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'" data-dojo-attach-point="questionsPane">
-        <form data-dojo-type="dijit/form/Form" data-dojo-attach-point="questionsForm"
-              data-dojo-attach-event="onSubmit:_onSubmit"
-              style="overflow: auto">
-            <div data-dojo-attach-point="questionsAnchor"></div>
-        </form>
-    </div>
-    
-    <div data-dojo-attach-point="buttonsPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom'">
-        <button data-dojo-type="dijit/form/Button"
-                type="submit"
-                data-dojo-attach-event="onClick:_onSubmit">
-            Submit</button>
-        <button data-dojo-type="dijit/form/Button"
-                type="button"
-                data-dojo-attach-event="onClick:_onCancel">
-            Cancel</button>
-    </div>
-
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/pages/viewSurvey.js	(revision 417)
@@ -7,6 +7,6 @@
     '../store',
     '../app/Page',
-    '../ui/model/QuestionWidgetFactory',
-    'dojo/text!./viewSurvey.html'
+    '../model/widgets/QuestionWidgetFactory',
+    'dojo/text!./templates/viewSurvey.html'
 ],function(array,declare,Deferred,event,lang,store,Page,QuestionWidgetFactory,template){
     return declare([Page],{
Index: Dev/branches/rest-dojo-ui/client/rft/schema.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/schema.js	(revision 416)
+++ 	(revision )
@@ -1,136 +1,0 @@
-define(['dojo/_base/lang'],function(lang){
-
-    /** Note on dojox.json.schema
-     * This implementation is not according to the version 03 of the json-schema
-     * draft. Differences:
-     * - doesn't support the 'required' property, but uses 'optional' (which is
-     *   false by default).
-     */
-
-    ////////////////////////////////////////
-    // Base schema types
-    //
-
-    var dateRe = "\\d{4}-\\d{2}-\\d{2}"; // YYYY-MM-DD
-    var timeRe = "\\d{2}:\\d{2}:\\d{2}"; // hh:mm:ss 
-    var datetimeRe = dateRe+"T"+timeRe+"Z"; // YYYY-MM-DDThh:mm:ssZ
-
-    function mixin(obj1,obj2) {
-        return lang.mixin({},obj1||{},obj2||{});
-    }
-    function mkType(base) {
-        return function(props) {
-            return mixin(base,props);
-        };
-    }
-
-    var nestring = mkType({ type:'string', minLength:1 });
-    var string = mkType({ type:'string' });
-    var integer = mkType({ type: 'integer' });
-    var boolean = mkType({ type: 'boolean' });
-    var pattern = function(p){
-        return mixin({
-            type: 'string',
-            pattern: p
-        });
-    };
-    var date = mkType(pattern(dateRe));
-    var time = mkType(pattern(timeRe));
-    var datetime = mkType(pattern(datetimeRe));
-    var array = function(items,props) {
-        return mixin({
-            type: 'array',
-            items: items
-        },props);
-    };
-    var object = function(properties,props) {
-        return mixin({
-            type: 'object',
-            properties: properties,
-            additionalProperties: false
-        },props);
-    };
-    var optional = mkType({ optional: true });
-
-    ////////////////////////////////////////
-    // Domain specific
-    //
-
-    var typedobject = function(type,properties,props) {
-        return object(mixin(properties,{
-            type: pattern(type)
-        }),props);
-    };
-
-    var dbobject = function(type,properties,props) {
-        return typedobject(type,mixin(properties,{
-            _id: nestring(optional()),
-            _rev: nestring(optional())
-        }),props);
-    };
-
-    ////////////////////////////////////////
-    // The QED schema
-    //
-
-    var schema = {type:[
-        dbobject('Question',{
-            code:nestring(),
-            title: nestring(),
-            description: string(optional()),
-            topic: string(optional()),
-            categories: array(nestring(),optional()),
-            content: array([
-                typedobject('Header',{
-                    content:string(optional())
-                }),
-                typedobject('Text',{
-                    content:string(optional())
-                }),
-                typedobject('Divider'),
-                typedobject('StringInput'),
-                typedobject('TextInput',{
-                    maxLength:integer()
-                }),
-                typedobject('IntegerInput',{
-                    min:integer(),
-                    max:integer(),
-                    step:integer()
-                }),
-                typedobject('MultipleChoiceInput',{
-                    multiple:boolean(),
-                    items:array(nestring())
-                })
-            ],optional()),
-            publicationDate:datetime(optional())
-        }),
-        dbobject('Survey',{
-            title: nestring(),
-            description: string(optional()),
-            questions: array(nestring(),optional()),
-            publicationDate:datetime(optional())
-        }),
-        dbobject('SurveyRun',{
-            surveyId: nestring(),
-            publicationDate:datetime(optional()),
-            startDate:datetime(optional()),
-            endDate:datetime(optional()),
-            mode:{type:'string',enum:['open','closed']},
-            respondents: array(nestring(),optional()),
-            metadata:{type:'object'}
-        }),
-        dbobject('Session',{
-            title: nestring(),
-            description: string(optional()),
-            publicationDate: datetime(optional())
-        }),
-        dbobject('SessionTemplate',{
-            title: nestring(),
-            description: string(optional()),
-            publicationDate: datetime(optional()),
-            plannedDate: datetime(optional())
-        })
-    ]};
-
-    return schema;
-});
Index: Dev/branches/rest-dojo-ui/client/rft/stddeps.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/stddeps.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/stddeps.js	(revision 417)
@@ -25,18 +25,21 @@
     'dojox/grid/DataGrid',
 
-    'rft/ui/LineWithActionsWidget',
+    'rft/app/Notifications',
+
+    'rft/model/widgets/SurveyFieldset',
+    'rft/model/widgets/SurveyRunFieldset',
+    'rft/model/widgets/QuestionWidget',
+    'rft/model/widgets/AccountListView',
+
     'rft/ui/MainMenu',
     'rft/ui/MenuBarLink',
     'rft/ui/MenuLink',
-    'rft/ui/Notifications',
-    'rft/ui/ObjectBox',
-    'rft/ui/QuestionWidget',
-    'rft/ui/Selector',
-    'rft/ui/TitleGroup',
-    'rft/ui/generic/DateTimeTextBox',
-    'rft/ui/model/SurveyForm',
-    'rft/ui/model/SurveyRunForm',
-    'rft/ui/lists/AccountListView',
-    'rft/ui/lists/List',
-    'rft/ui/lists/OrderedList'
+
+    'rft/widgets/LineWithActionsWidget',
+    'rft/widgets/ObjectBox',
+    'rft/widgets/Selector',
+    'rft/widgets/TitleGroup',
+    'rft/widgets/DateTimeTextBox',
+    'rft/widgets/list/List',
+    'rft/widgets/list/OrderedList'
 ],function(){});
Index: Dev/branches/rest-dojo-ui/client/rft/store.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/store.js	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/store.js	(revision 417)
@@ -1,10 +1,12 @@
 define([
     'dojo/date/stamp',
+    'dojo/store/Cache',
+    'dojo/store/Memory',
     'dojox/json/schema',
-    './schema',
+    './model/schema',
     './store/CouchStore'
-],function(stamp,jsonSchema,schema,CouchStore){
+],function(stamp,Cache,Memory,jsonSchema,schema,CouchStore){
     
-    var store = new CouchStore({
+    var couchStore = new CouchStore({
         target: 'data/couch/',
         validate: function(object) {
@@ -18,4 +20,8 @@
         }
     });
+    var memoryStore = new Memory();
+    var cacheStore = new Cache(couchStore,memoryStore,{});
+
+    var store = cacheStore;
     store.formatDate = function(date){
         return stamp.toISOString(date,{zulu:true});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js	(revision 416)
+++ 	(revision )
@@ -1,84 +1,0 @@
-define(['dojo/_base/declare',
-    'dojo/_base/lang',
-    'dojo/on',
-    'dojo/dom',
-    'dojo/_base/event',
-    'dojo/dom-class',
-    'dijit/form/Button',
-    'dijit/_WidgetBase',
-    'dijit/_TemplatedMixin',
-    'dijit/_WidgetsInTemplateMixin',
-    'dojo/text!./templates/LineWithActionsWidget.html'
-],function(declare,lang,on,dom,event,domClass,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){
-    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
-        templateString: templateString,
-        baseClass: 'rftLineWithActions',
-        title: '',
-        selectable: false,
-        userObject: null,
-
-        actions: null,
-        postCreate: function() {
-            dom.setSelectable(this.domNode, false); // Text selection, has nothing to do with object selection!
-            on(this.domNode,'click',lang.hitch(this,'_onClick'));
-        },
-        startup: function() {
-            if ( this._started ){ return; }
-            this.inherited(arguments);
-            this._setupActions();
-            this.refresh();
-        },
-        _setupActions: function() {
-            if ( this.actions === null ) {
-                return;
-            }
-            for (var action in this.actions) {
-                var properties;
-                if (this.actions[action].properties.blockButton === true) {
-                    properties = lang.mixin({
-                        baseClass: 'rftBlockButton',
-                        label: "Default",
-                        iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
-                        title: this.actions[action].properties.tooltip,
-                        onClick: lang.hitch(this, function(action, e){
-                            action.callback && action.callback(e);
-                            event.stop(e);
-                            return false;
-                        }, this.actions[action])
-                    }, this.actions[action].properties);
-                    new Button(properties).placeAt(this.buttonsNode);
-                } else {
-                    properties = lang.mixin({
-                        baseClass: 'rftInlineButton',
-                        label: "Default",
-                        showLabel: false,
-                        iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
-                        title: this.actions[action].properties.tooltip,
-                        onClick: lang.hitch(this, function(action, e){
-                            action.callback && action.callback(e);
-                            event.stop(e);
-                            return false;
-                        }, this.actions[action])
-                    }, this.actions[action].properties);
-                    new Button(properties).placeAt(this.buttonsNode);
-                }
-            }
-        },
-        refresh: function() {
-            this.titleNode.innerHTML = this.title;
-        },
-        _onClick: function(e){
-            var preventDefault = this.onClick(e) === false;
-            if (preventDefault) {
-                event.stop(e);
-            }
-            return !preventDefault;
-        },
-        onClick: function(e) {
-        },
-        _setTitleAttr: function(value){
-            this.title = value;
-            this.refresh();
-        }
-    });
-});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/MultipleChoiceWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/MultipleChoiceWidget.js	(revision 416)
+++ 	(revision )
@@ -1,91 +1,0 @@
-define(['dojo/_base/declare','dojo/_base/array','dojo/_base/lang',
-    'dojo/dom-construct','dijit/registry','dijit/_WidgetBase',
-    'dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin','dijit/_Container',
-    'dojo/text!./templates/MultipleChoiceWidget.html',
-    'dijit/form/RadioButton','dijit/form/CheckBox','dijit/form/TextBox','dijit/form/Button'],
-    function(declare,array,lang,domConstruct,registry,_WidgetBase,_TemplatedMixin,
-        _WidgetsInTemplateMixin,_Container,
-        templateString,RadioButton,CheckBox,TextBox,Button){
-        return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
-            templateString: templateString,
-            multiple: true,
-            baseClass: 'rftMultipleChoiceWidget',
-            
-            allowMultiple: false,
-            name: '',
-            value: null,
-            
-            _widegtCache: null,
-            constuctor: function() {
-                this.inherited(arguments);
-                this.value = [];
-                this._widgetCache = {};
-            },
-            _setValueAttr: function(value) {
-                this.reset();
-                this.value = value;
-                array.forEach(this.value,lang.hitch(this,function(val){
-                    this._addRow(val);
-                }));
-            },
-            _getValueAttr: function() {
-                var value = [];
-                registry.findWidgets(this.domNode).forEach(function(w){
-                    w.isInstanceOf(TextBox) && value.push(w.get('value'));
-                });
-                this.value = value;
-                return value;
-            },
-            reset: function() {
-                this._removeWidgetsBelowNode(this.rows);
-                domConstruct.empty(this.rows);
-            },
-            _onAddRow: function() {
-                this._addRow();
-            },
-            _addRow: function(value,tagRow,pos) {
-                var row = domConstruct.create('div',{'class':'row'});
-                if ( this.allowMultiple ) {
-                    new CheckBox({
-                        name:this.name,
-                        'class':'rowBox',
-                        disabled: this.mode == 'edit'
-                    }).placeAt(row);
-                } else {
-                    new RadioButton({
-                        name:this.name,
-                        'class':'rowBox',
-                        disabled: this.mode == 'edit'
-                    }).placeAt(row);
-                }
-                new TextBox({
-                    name:this.name,
-                    value:value || '',
-                    'class':'rowText'
-                }).placeAt(row);
-                new Button({
-                    label:'-',
-                    'class':'rowBtn',
-                    onClick:lang.hitch(this,'_removeNodeWithWidgets',row)
-                }).placeAt(row);
-                new Button({
-                    label:'+',
-                    'class':'rowBtn',
-                    onClick:lang.hitch(this,'_addRow','',row,'before')
-                }).placeAt(row);
-                domConstruct.place(row,tagRow || this.rows,pos||'last');
-            },
-            _removeNodeWithWidgets: function(node) {
-                this._removeWidgetsBelowNode(node);
-                domConstruct.destroy(node);
-            },
-            _removeWidgetsBelowNode: function(node) {
-                registry.findWidgets(node).forEach(function(w){
-                    w.destroyRecursive();
-                });
-            },
-            _onRowChange: function(row) {
-                
-            }
-        });
-    });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/Notifications.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/Notifications.js	(revision 416)
+++ 	(revision )
@@ -1,7 +1,0 @@
-define(['dojo/_base/declare','dojo/_base/lang','dojox/widget/Toaster'],
-function(declare,lang,Toaster){
-    return declare([Toaster],{
-        positionDirection: "br-up",
-        duration: 1000
-    });
-});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js	(revision 416)
+++ 	(revision )
@@ -1,75 +1,0 @@
-define([
-    'dojo/_base/declare',
-    'dojo/_base/lang',
-    'dijit/_WidgetBase',
-    'dijit/_TemplatedMixin',
-    'dijit/_WidgetsInTemplateMixin',
-    'rft/ui/LineWithActionsWidget',
-    'dojo/text!./templates/ObjectBox.html'
-], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LineWithActionsWidget, template){
-    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
-        baseClass: "rftObjectBox",
-        templateString: template,
-        value: null,
-        actions: null,
-        startup: function() {
-            if ( this._started ){ return; }
-            this.inherited(arguments);
-            this.line1 = new LineWithActionsWidget({
-                actions: {
-                    "inspectIcon": {
-                        callback: lang.hitch(this, this._showInfoBox),
-                        properties: {
-                            blockButton: false,
-                            icon: "Inspect"
-                        }
-                    }
-                }
-            }).placeAt(this.line1Node);
-            this.line2 = new LineWithActionsWidget({
-            }).placeAt(this.line2Node);
-            var line3Actions = this._createLine3Actions();
-            this.line3 = new LineWithActionsWidget({
-                actions: line3Actions
-            }).placeAt(this.line3Node);
-            this.line1.startup();
-            this.line2.startup();
-            this.line3.startup();
-            this.inherited(arguments);
-        },
-        _createLine3Actions: function() {
-            var line3Actions = {};
-            for (var action in this.actions) {
-                line3Actions[action] = {
-                    callback: lang.hitch(this, function(callback){
-                        this.value && callback(this.value);
-                    }, this.actions[action]),
-                    properties: {
-                        blockButton: true,
-                        label: action,
-                        icon: action.charAt(0).toUpperCase()+action.slice(1)
-                    }
-                };
-            }
-            return line3Actions;
-        },
-        _showInfoBox: function() {
-            alert(this.value.description);
-        },
-        _setValueAttr: function(value) {
-            this.value = value;
-            this._refresh();
-        },
-        _getValueAttr: function(value) {
-            this.value = value;
-        },
-        _refresh: function() {
-            if ( this.value !== null ) {
-                this.iconNode.className = "rftIcon typeIcon rftIcon"+(this.value.type || '');
-                this.line1.set('title', this.value.title || '');
-                this.line2.set('title', this.value.subTitle || '');
-                this.line3.set('title', this.value.lowerTitle || '');
-            }
-        }
-    });
-});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js	(revision 416)
+++ 	(revision )
@@ -1,36 +1,0 @@
-define([
-    'dojo/_base/array',
-    'dojo/_base/declare',
-    'dojo/_base/lang',
-    'dojo/dom-construct',
-    'dijit/registry',
-    './QuestionEditorPreviewItem',
-    './lists/OrderedList'
-], function(array, declare, lang, domConstruct, registry, QuestionEditorPreviewItem, OrderedList) {
-    return declare([OrderedList], {
-        baseClass: 'surveyEditorPreview',
-        type: 'questionContent',
-        withHandles: true,
-
-        _createAvatarNode: function(item) {
-            return domConstruct.create("span",{
-                innerHTML: item.type || "Dragging!!!"
-            });
-        },
-        _createListNode: function(item) {
-            var previewItem = new QuestionEditorPreviewItem({
-                item: item
-            });
-            previewItem.on('close',lang.hitch(this,'removeItem',item));
-            previewItem.startup();
-            return previewItem.domNode;
-        },
-        getItems: function() {
-            return array.map(
-                this.source.getAllNodes(),
-                function(node){
-                    return registry.byNode(node).get('value');
-                },this);
-        }
-    });
-});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreviewItem.js	(revision 416)
+++ 	(revision )
@@ -1,139 +1,0 @@
-define([
-    'dojo/_base/declare',
-    'dojo/_base/fx',
-    'dojo/_base/lang',
-    'dojo/dom-class',
-    'dojo/dom-geometry',
-    'dojo/on',
-    'dijit/_Container',
-    'dijit/_TemplatedMixin',
-    'dijit/_WidgetBase',
-    'dijit/_WidgetsInTemplateMixin',
-    './model/QuestionWidgetFactory',
-    'dojo/text!./templates/QuestionEditorPreviewItem.html'
-], function(
-    declare,
-    fx,
-    lang,
-    domClass,
-    domGeom,
-    on,
-    _Container,
-    _TemplatedMixin,
-    _WidgetBase,
-    _WidgetsInTemplateMixin,
-    QuestionWidgetFactory,
-    template
-){
-    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
-        version: "full",
-        templateString: template,
-        baseClass: "surveyEditorPreviewItem",
-        previousContentHeight: 200,
-        item: null,
-        innerWidget: null,
-        foldDuration: [250, 250],
-        animation: null,
-        _editing: false,
-
-        startup: function() {
-            if ( this._started ){ return; }
-            this.inherited(arguments);
-            this.foldButtonNode.onClick = lang.hitch(this, this.toggleFold);
-            this.removeButtonNode.onClick = lang.hitch(this, "onClose");
-            this.editButtonNode.onClick = lang.hitch(this, this.toggleEdit);
-            if (this.item) {
-                this._showViewWidget();
-            } else {
-                throw "No data supplied to create an innerWidget!";
-            }
-        },
-        _destroyInnerWidget: function() {
-            if ( this.innerWidget !== null ) {
-                this.innerWidget.destroyRecursive();
-            }
-        },
-        _showViewWidget: function() {
-            var factory = new QuestionWidgetFactory();
-            this.innerWidget = factory.createViewWidget( this.item );
-            if ( this.innerWidget !== null ) {
-                this.innerWidget.placeAt(this.containerNode);
-                this.innerWidget.startup();
-                this.innerWidget.set('readOnly',true);
-            }
-            this.titleNode.innerHTML = this.item.type+" [preview]";
-        },
-        _showEditWidget: function() {
-            var factory = new QuestionWidgetFactory();
-            this.innerWidget = factory.createEditWidget( this.item );
-            if ( this.innerWidget !== null ) {
-                this.innerWidget.placeAt(this.containerNode);
-                this.innerWidget.startup();
-            }
-            this.titleNode.innerHTML = this.item.type+" [editing]";
-        },
-        onClose: function() {},
-        _getValueAttr: function(value) {
-            return this.item;
-        },
-        _setValueAttr: function(value) {
-            this.item = value;
-            this._destroyInnerWidget();
-            if ( this._editing ) {
-                this._showEditWidget();
-            } else {
-                this._showViewWidget();
-            }
-        },
-        toggleEdit: function() {
-            if(this._editing) {
-                if ( this.innerWidget !== null ) {
-                    this.item = this.innerWidget.get('value');
-                }
-                this._destroyInnerWidget();
-                this._showViewWidget();
-                this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconAccept", "rftIconEdit");
-                this.editButtonNode.set("label", "Edit");
-            } else {
-                this._destroyInnerWidget();
-                this._showEditWidget();
-                this.editButtonNode.iconNode.className = this.editButtonNode.iconNode.className.replace("rftIconEdit", "rftIconAccept");
-                this.editButtonNode.set("label", "Done");
-            }
-            this._editing = !this._editing;
-        },
-        toggleFold: function() {
-            if (!this.animation) {
-                if (!domClass.contains(this.domNode, "fold")) {
-                    this.previousContentHeight = domGeom.getMarginBox(this.innerNode).h;
-                    this.animation = fx.animateProperty({
-                        node: this.innerNode,
-                        duration: this.foldDuration[0],
-                        properties: {
-                            height: 1                        
-                        },
-                        onEnd: lang.hitch(this, function(){
-                            domClass.add(this.domNode, "fold");
-                            this.animation = null;
-                        })
-                    }).play();
-                    this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowUp", "rftIconHalfArrowDown");
-                } else {
-                    this.animation = fx.animateProperty({
-                        node: this.innerNode,
-                        duration: this.foldDuration[1],
-                        properties: {
-                            height: this.previousContentHeight                
-                        },
-                        onEnd: lang.hitch(this, function(){
-                            domClass.remove(this.domNode, "fold");
-                            this.animation = null;
-                        })
-                    }).play();
-                    this.foldButtonNode.iconNode.className = this.foldButtonNode.iconNode.className.replace("rftIconHalfArrowDown", "rftIconHalfArrowUp");
-                }
-            }
-        }
-
-    });
-});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorToolkit.js	(revision 416)
+++ 	(revision )
@@ -1,166 +1,0 @@
-define([
-    'dojo/_base/declare',
-    'dojo/_base/lang',
-    'dojo/dnd/Source',
-    'dojo/dom-construct',
-    'dojo/store/Memory',
-    'dijit/_Container',
-    'dijit/_TemplatedMixin',
-    'dijit/_WidgetBase',
-    'dijit/_WidgetsInTemplateMixin',
-    'dijit/form/Button',
-    'dijit/form/ComboBox',
-    '../store',
-    './lists/CategoryListView',
-    'dojo/text!./templates/QuestionEditorToolkit.html'
-    ], function(declare, lang, Source, domConstruct, Memory, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button, ComboBox, store, CategoryListView, template) {
-        return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
-
-            templateString: template,
-            _list: null,
-            _categorySelect: null,
-            _categoryStore: null,
-            _topicSelect: null,
-            _topicStore: null,
-            _categories : null,
-
-            _contentItems: [
-                { type: "Header" },
-                { type: "Text" },
-                { type: "Image" },
-                { type: "ExternalMedia" },
-                { type: "Divider" }
-            ],
-            _inputsItems: [
-                { type: "StringInput" },
-                { type: "TextInput" },
-                { type: "IntegerInput" },
-                { type: "ScaleInput" },
-                { type: "MultipleChoiceInput" }
-            ],
-            _labelMap: {
-                "Header": "Header",
-                "Text": "Text",
-                "Image": "Image",
-                "ExternalMedia": "External media",
-                "Divider": "Divider",
-                "StringInput": "Text line",
-                "TextInput": "Free text",
-                "IntegerInput": "Integer number",
-                "ScaleInput": "Scale",
-                "MultipleChoiceInput": "Multiple choice"
-            },
-            _iconMap: {
-                "Header": "Header",
-                "Text": "TextBox",
-                "Image": "Image",
-                "ExternalMedia": "External",
-                "Divider": "Divider",
-                "StringInput": "Text",
-                "TextInput": "Text",
-                "IntegerInput": "Integer",
-                "ScaleInput": "Scale",
-                "MultipleChoiceInput": "MultipleChoice"
-            },
-
-            postCreate: function(){
-                this.inherited(arguments);
-                var creator = lang.hitch(this,"_creator");
-                this.contentSource = new Source(this.ToolkitContentSourceNode, {
-                    accept: [],
-                    copyOnly: true,
-                    selfAccept: false,
-                    singular: true,
-                    creator: creator
-                });
-                this.inputsSource = new Source(this.ToolkitInputsSourceNode, {
-                    accept: [],
-                    copyOnly: true,
-                    selfAccept: false,
-                    singular: true,
-                    creator: creator
-                });
-                this.contentSource.insertNodes(false, this._contentItems);
-                this.inputsSource.insertNodes(false, this._inputsItems);
-            },
-            _setValueAttr: function(question) {
-                this.propertiesForm.set('value', question);
-                this._categories = question.categories || [];
-                this._setupListView();
-                this._setupCategories();
-                this._setupTopic(question.topic);
-            },
-            _getValueAttr: function() {
-                var value = this.propertiesForm.get('value');
-                value.categories = this._categories;
-                return value;
-            },
-            onCategoryAdd: function() {
-                this._addCategory(this._categorySelect.get('displayedValue')); 
-                this._categorySelect.reset();
-            },
-            _creator: function(item, hint) {
-                var node;
-                if (hint == "avatar") {
-                    node = domConstruct.create('span',{
-                        innerHTML: this._labelMap[item.type] || item.type
-                    });
-                } else {
-                    var w = new Button({
-                        baseClass: "rftLargeButton",
-                        iconClass: "rftIcon rftIcon"+(this._iconMap[item.type]||"Unknown"),
-                        label: this._labelMap[item.type] || item.type,
-                        showLabel: true,
-                        'class': "newline"
-                    });
-                    node = w.domNode;
-                }
-                return {node: node, data: item, type: ["questionContent"]};
-            },
-            _setupListView: function() {
-                this._list = new CategoryListView( {
-                    removeCallback: lang.hitch(this, this._removeCategory)
-                }).placeAt(this.listNode);
-                this._list.startup();                
-                for (var category in this._categories) {
-                    this._list.appendItem(this._categories[category]);
-                }    
-            },
-            _setupCategories: function() {
-                this._categoryStore = new Memory({data: [] });
-                store.query("_design/questions/_view/all", {reduce:true, group:false, group_level:1})
-                .forPairs(lang.hitch(this, function(value, key) {
-                    this._categoryStore.put({ id: key[0] });
-                }));
-                this._categorySelect = new ComboBox( {
-                    name: "categories",
-                    store: this._categoryStore,
-                    searchAttr: "id"
-                }, this.categoriesBoxNode);
-                this._supportingWidgets.push(this._categorySelect);
-
-            },
-            _setupTopic: function(topic) {
-                this._topicStore = new Memory( {data: [] });
-                store.query("_design/questions/_view/all_topics", {reduce:true, group:true})
-                .forPairs(lang.hitch(this, function(value, key) {
-                    this._topicStore.put({ id: key });
-                }));
-                this._topicSelect = new ComboBox( {
-                    name: "topic",
-                    store: this._topicStore,
-                    searchAttr: "id",
-                    value: topic
-                }, this.topicBoxNode);
-                this._supportingWidgets.push(this._topicSelect);
-            },
-            _addCategory: function(item) {
-                this._categories.push(item);
-                this._list.appendItem(item);
-            },
-            _removeCategory: function(item) {
-                this._categories.splice(this._categories.indexOf(item), 1);
-            }
-
-        });
-    });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/QuestionWidget.js	(revision 416)
+++ 	(revision )
@@ -1,74 +1,0 @@
-define(['dojo/_base/declare','dojo/_base/lang','dojo/dom-construct','dijit/_WidgetBase',
-    'dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin',
-    'dojo/text!./templates/QuestionWidget.html','dijit/form/TextBox',
-    'dijit/form/Textarea','./MultipleChoiceWidget'],
-    function(declare,lang,domConstruct,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString,TextBox,Textarea,MultipleChoiceWidget){
-        return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
-            templateString: templateString,
-            mode: 'view', // view || edit
-            name: '',
-            value: null,
-            _scale: null,
-            _widgetCache: null,
-            constructor: function() {
-                this.inherited(arguments);
-                this.value = {};
-                this._widgetCache = {};
-            },
-            postCreate: function() {
-                this._resetValue = this.value;
-                this.scaleSelector.set('disabled', this.mode == 'edit');
-            },
-            _setValueAttr: function(value) {
-                this.value = value;
-                this._onTypeChange(value.scale || 'string');
-                this.ourForm.set('value',value);
-            },
-            _getValueAttr: function() {
-                var value = this.ourForm.get('value');
-                lang.mixin(this.value,value);
-                return this.value;
-            },
-            _onTypeChange: function(scale) {
-                if ( this._scale == scale ) return;
-                this._scale = scale;
-                domConstruct.empty(this.scaleDetails);
-                var widget = this._getTypeWidget(scale);
-                widget && widget.placeAt(this.scaleDetails,'only');
-            },
-            _getTypeWidget: function(scale) {
-                var widget = this._widgetCache[scale];
-                if (!widget) {
-                    switch(scale) {
-                        case 'string':
-                            widget = new TextBox({
-                                name: 'answers',
-                                disabled: this.mode == 'view'
-                            });
-                            break;
-                        case 'text':
-                            widget = new Textarea({
-                                name: 'answers',
-                                disabled: this.mode == 'view',
-                                style: 'min-height: 120px'
-                            });
-                            break;
-                        case 'singleChoice':
-                        case 'multipleChoice':
-                            widget = new MultipleChoiceWidget({
-                                name: 'answers',
-                                mode: this.mode,
-                                allowMultiple: scale == 'multipleChoice'
-                            });
-                            break;
-                    }
-                    this._widgetCache[scale] = widget;
-                }
-                return widget;
-            },
-            reset: function() {
-                this.ourForm.reset();
-                this._setValueAttr(this._resetValue);
-            }
-        });
-    });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js	(revision 416)
+++ 	(revision )
@@ -1,178 +1,0 @@
-define([
-    'dojo/_base/array',
-    'dojo/_base/declare',
-    'dojo/_base/event',
-    'dojo/_base/lang',
-    'dojo/dom-class',
-    'dojo/fx',
-    'dojo/query',
-    'dijit/_Container',
-    'dijit/_TemplatedMixin',
-    'dijit/_WidgetBase',
-    'dijit/_WidgetsInTemplateMixin',
-    'dijit/registry',
-    './LineWithActionsWidget',
-    'dojo/text!./templates/Selector.html'
-],function(
-    baseArray,
-    declare,
-    event,
-    lang,
-    domClass,
-    fx,
-    query,
-    _Container,
-    _TemplatedMixin,
-    _WidgetBase,
-    _WidgetsInTemplateMixin,
-    registry,
-    LineWithActionsWidget,
-    templateString
-){
-    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
-        templateString: templateString,
-        baseClass: 'rftSelector',
-
-        title: "",
-        selectedActions: null,
-        itemActions: null,
-        // main selector action: Object
-        //    title:
-        //    description:
-        //    icon:
-
-        _folded: true,
-        _titleLine: null,
-        _selectorLine: null,
-        _selectedItem: null,
-
-        startup: function() {
-            if ( this._started ){ return; }
-            this.inherited(arguments);
-            domClass.add(this.selectedColorNode, "pending");
-
-            this._createTitleLine();
-            this._createSelectorLine();
-
-            fx.wipeOut({
-                node: this.optionsNode
-            }).play();
-        },
-        _createTitleLine: function() {
-            var actions = {};
-            var action = null;
-            if ( this.selectedActions !== null ) {
-                for (var actionName in this.selectedActions) {
-                    action = this.selectedActions[actionName];
-                    actions[actionName] = {
-                        callback: action.callback &&
-                                lang.hitch(this,this._onSelectedAction,
-                                        action.callback),
-                        properties: {
-                             blockButton: true,
-                             label: action.title || actionName,
-                             icon: action.icon,
-                             tooltip: action.description
-                         }
-
-                    };
-                }
-            }
-
-            this._titleLine = new LineWithActionsWidget({
-                title: this.title,
-                actions: actions
-            },this.titleNode);
-            this._titleLine.startup();
-        },
-        _createSelectorLine: function() {
-            this._selectorLine = new LineWithActionsWidget({
-                title: 'None',
-                actions: {
-                    "Toggle dropdown" : {
-                        callback: lang.hitch(this, this.onToggle),
-                        properties: {
-                            blockButton: true,
-                            showLabel: false,
-                            icon: "HalfArrowDown"
-                        }
-                    }
-                }
-            },this.selectedItemNode);
-            this._selectorLine.startup();
-            this._selectorLine.on('click',lang.hitch(this, this.onToggle));
-        },
-        _onSelect: function(item, widget) {
-            this._selectedItem = item;
-            this.onToggle();
-            this._selectorLine.set("title", item.title);
-            baseArray.forEach(this.optionsNode.childNodes, function(node){
-                var line = registry.byNode(node);
-                if (line) {
-                    if (line === widget) {
-                        domClass.add(line.domNode, "inheritBgColor light");
-                    } else {
-                        domClass.remove(line.domNode, "inheritBgColor light");
-                    }
-                }
-            }, this);
-            this.onSelect(item);
-        },
-        _onSelectedAction: function(callback) {
-            if (this._selectedItem && callback) {
-                callback(this._selectedItem);
-            }
-        },
-
-        onToggle: function(evt) {
-            if (this._folded) {
-                var downArrowIcon = query(".rftBlockButton .rftIconHalfArrowDown", this._selectorLine.buttonsNode)[0];
-                if (downArrowIcon){
-                    domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown");
-                }
-                fx.wipeIn({
-                    node: this.optionsNode
-                }).play();
-                this._folded = false;
-            } else {
-                var upArrowIcon = query(".rftBlockButton .rftIconHalfArrowUp", this._selectorLine.buttonsNode)[0];
-                if (upArrowIcon){
-                    domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp");
-                }
-                fx.wipeOut({
-                    node: this.optionsNode
-                }).play();
-                this._folded = true;
-            }
-            evt && event.stop(evt);
-            return false;
-        },
-
-        addItem: function(item,displayTitle) {
-            var actions = {};
-            var action;
-            if (this.itemActions) {
-                for (var actionName in this.itemActions) {
-                    action = this.itemActions[actionName];
-                    actions[actionName] = {
-                        callback: action.callback && lang.partial(action.callback,item),
-                        properties: {
-                            blockButton: false,
-                            showLabel: false,
-                            icon: action.icon + " black",
-                            tooltip: action.description
-                        }
-                    };
-                }
-            }
-            var w = new LineWithActionsWidget({
-                title: displayTitle || item.title,
-                actions: actions
-            }).placeAt(this.optionsNode);
-            w.startup();
-            w.on("click", lang.hitch(this, this._onSelect, item, w));
-        },
-
-        onSelect: function(item) {}
-    });
-});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/TabbedQuestionBrowser.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/TabbedQuestionBrowser.js	(revision 416)
+++ 	(revision )
@@ -1,127 +1,0 @@
-define([
-    'dojo/_base/declare',
-    'dojo/_base/lang',
-    'dojo/_base/window',
-    'dijit/layout/ContentPane',
-    'dijit/layout/TabContainer',
-    'dojox/widget/Standby',
-    'rft/store',
-    'rft/ui/Selector',
-    'dojo/domReady!'
-],function(declare,lang,win,ContentPane,TabContainer,Standby,store,Selector){
-    return declare([TabContainer],{
-        tabPosition: 'left-h',
-        include: 'all',
-
-        selectedActions: null,
-        itemActions: null,
-
-        _dataMap: null,
-        _busyCount: 0,
-        constructor: function(){
-            this.inherited(arguments);
-            this._dataMap = {};
-        },
-        postCreate: function() {
-            this.inherited(arguments);
-            this._query = '_design/questions/_view/'+this.include;
-        },
-        startup: function() {
-            if ( this._started ){ return; }
-            this.inherited(arguments);
-            this._busyWidget = new Standby({
-                target: this.domNode,
-                duration: 200
-            }).placeAt(win.body());
-            this._busyWidget.startup();
-            this.watch("selectedChildWidget",lang.hitch(this,function(name,oldTab,newTab){
-                this._fillCategoryTab(newTab.__category);
-            }));
-            store.query(this._query, {reduce:true,group:true,group_level:1})
-            .forPairs(lang.hitch(this,function(value,key){
-                this._createCategoryTab(key[0],value);
-            }));
-        },
-        _createCategoryTab: function(category,count) {
-            if (this._dataMap[category] === undefined) {
-                var categoryTab = new ContentPane({
-                    __category: category,
-                    title: (category || '[No category]')+" ("+count+")"
-                });
-                categoryTab.startup();
-                this._dataMap[category] = {
-                    _widget: categoryTab
-                };
-                this.addChild(categoryTab);
-            }
-        },
-        _fillCategoryTab: function(category) {
-            var categoryMap = this._dataMap[category];
-            if (!categoryMap._filled) {
-                this._busy();
-                categoryMap._filled = true;
-                store.query(this._query, {reduce:true,group:true,group_level:2,startkey:[category],endkey:[category,{}]})
-                .forPairs(lang.hitch(this,function(value,key){
-                    this._createTopicSelector(key[1],category,value);
-                })).then(lang.hitch(this,function(){
-                    this._done();
-                }));
-            }
-        },
-        _createTopicSelector: function(topic,category,count){
-            var categoryMap = this._dataMap[category];
-            if (categoryMap[topic] === undefined) {
-                var w = new Selector({
-                    __category: category,
-                    __topic: topic,
-                    title: (topic || '[No topic]')+" ("+count+")",
-                    selectedActions: this.selectedActions,
-                    itemActions: this.itemActions
-                }).placeAt(categoryMap._widget.containerNode);
-                w.startup();
-                categoryMap[topic] = {
-                    _widget: w
-                };
-                this._fillTopicSelector(topic,category);
-            }
-        },
-        _fillTopicSelector: function(topic,category) {
-            var categoryMap = this._dataMap[category];
-            var topicMap = categoryMap[topic];
-            if (!topicMap._filled) {
-                topicMap._filled = true;
-                this._busy();
-                store.query(this._query, {reduce:false,include_docs:true,key:[category,topic]})
-                .forEach(lang.hitch(this,function(value){
-                    var title;
-                    if ( this.include === 'all' ) {
-                        title = value.title+(value.publicationDate?' (published on '+value.publicationDate+')':' (unpublished)');
-                    }
-                    topicMap._widget.addItem(value,title);
-                })).then(lang.hitch(this,function(){
-                    this._done();
-                }));
-            }
-        },
-        _busy: function() {
-            if ( this._busyCount === 0 ) {
-                this._busyWidget.show();
-            }
-            this._busyCount++;
-        },
-        _done: function() {
-            if ( this._busyCount > 0 ) {
-                this._busyCount--;
-                if ( this._busyCount === 0 ) {
-                    this._busyWidget.hide();
-                }
-            } else {
-                console.warn('_done() was called more times than _busy().');
-            }
-        },
-        destroy: function() {
-            this._busyWidget.destroyRecursive();
-            this.inherited(arguments);
-        }
-    });
-});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/ThresholdFilteringSelect.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/ThresholdFilteringSelect.js	(revision 416)
+++ 	(revision )
@@ -1,18 +1,0 @@
-define([
-    'dojo/_base/declare',
-    'dijit/form/FilteringSelect'
-], function(declare, FilteringSelect) {
-    return declare(FilteringSelect, {
-         // custom min input character count to trigger search
-         minKeyCount: 3,
-
-         // override search method, count the input length
-         _startSearch: function (/*String*/key) {
-             if (!key || key.length < this.minKeyCount) {
-                 this.closeDropDown();
-                 return;
-             }
-             this.inherited(arguments);
-         }
-    });
-});
Index: Dev/branches/rest-dojo-ui/client/rft/ui/TitleGroup.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/TitleGroup.js	(revision 416)
+++ 	(revision )
@@ -1,11 +1,0 @@
-require(['dojo/_base/declare','dojo/_base/query','dijit/registry','dojox/widget/TitleGroup'],
-    function(declare,query,registry,TitleGroup){
-        return declare([TitleGroup],{
-            getChildren: function() {
-                return query("> .dijitTitlePane", this.domNode)
-                .map(function(node){
-                    return registry.byNode(node);
-                });
-            }
-        });
-    });
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/LineWithActionsWidget.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/LineWithActionsWidget.html	(revision 416)
+++ 	(revision )
@@ -1,4 +1,0 @@
-<div class="${baseClass}">
-    <span class="${baseClass}Title" data-dojo-attach-point="titleNode"></span>
-    <span class="${baseClass}Buttons dijitReset" data-dojo-attach-point="buttonsNode"></span>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/MultipleChoiceWidget.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/MultipleChoiceWidget.html	(revision 416)
+++ 	(revision )
@@ -1,7 +1,0 @@
-<div class="${baseClass}">
-    <div data-dojo-attach-point="rows">
-    </div>
-    <div data-dojo-attach-point="buttons" class="row">
-        <div><span class="rowBox"/><span class="rowText"/><span class="rowBtn"/><button data-dojo-type="dijit/form/Button" type="button" data-dojo-attach-event="onClick:_onAddRow" class="rowBtn">+</button></div>
-    </div>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/ObjectBox.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/ObjectBox.html	(revision 416)
+++ 	(revision )
@@ -1,6 +1,0 @@
-<div class="${baseClass}">
-    <div data-dojo-attach-point="iconNode"></div>
-    <div data-dojo-attach-point="line1Node"></div>
-    <div data-dojo-attach-point="line2Node"></div>
-    <div data-dojo-attach-point="line3Node"></div>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorPreviewItem.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorPreviewItem.html	(revision 416)
+++ 	(revision )
@@ -1,15 +1,0 @@
-<div>
-	<div class="topBorder inheritBgColor bg dojoDndHandle">
-		<span class="title" data-dojo-attach-point="titleNode">Default title</span>
-		<span class="floatRight" data-dojo-attach-point="buttonsNode">
-			<button class="trans bg inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-point="editButtonNode" data-dojo-props="baseClass: 'rftBlockButton', iconClass: 'rftIcon rftIconEdit'">Edit</button>
-			<button class="trans bg inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-point="foldButtonNode" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconHalfArrowUp'">Fold</button>
-			<button class="trans bg inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-point="removeButtonNode" data-dojo-props="baseClass: 'rftBlockButton', showLabel: false, iconClass: 'rftIcon rftIconDelete'">Remove</button>
-		</span>
-	</div>
-	
-	<div class="surveyEditorPreviewItemInner" data-dojo-attach-point="innerNode">
-		<div class="surveyEditorPreviewItemContent" data-dojo-attach-point="containerNode">
-		</div>
-	</div>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorToolkit.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionEditorToolkit.html	(revision 416)
+++ 	(revision )
@@ -1,31 +1,0 @@
-<div>
-	<div data-dojo-type="dojox/widget/TitleGroup">
-		<div data-dojo-type="dijit/TitlePane" class="orange" data-dojo-props="open:true" title="Properties" data-dojo-props="iconClass:'rftIcon rftIconProperties'">
-            <div data-dojo-type="dijit/form/Form" data-dojo-attach-point="propertiesForm">
-				<fieldset class="align">
-					<label>Title:</label><input data-dojo-type="dijit/form/TextBox" name="title"/>
-					<label>Code:</label><input data-dojo-type="dijit/form/TextBox" name= "code"/>
-					<label>Categories:</label>
-					<div data-dojo-attach-point="listNode" class="rftLineListView"></div> 
-					<div data-dojo-attach-point="categoriesBoxNode"></div>
-					<button class="inheritBgColor" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onClick:onCategoryAdd" data-dojo-props="baseClass:'rftBlockButton', iconClass: 'rftIcon rftIconPlus'">Add</button><br>
-					<label>Topic:</label>
-					<div data-dojo-attach-point="topicBoxNode"></div>
-					<label>Description:</label><textarea data-dojo-type="dijit/form/Textarea" name="description"></textarea>
-				</fieldset>
-			</div>
-		</div>
-
-		<div data-dojo-type="dijit/TitlePane" title="Content" data-dojo-props="iconClass:'rftIcon rftIconPlus', open:false">
-			<div data-dojo-attach-point="ToolkitContentSourceNode">
-				
-			</div>
-		</div>
-
-		<div data-dojo-type="dijit/TitlePane" title="Inputs" data-dojo-props="iconClass:'rftIcon rftIconInput', open:false">
-			<div data-dojo-attach-point="ToolkitInputsSourceNode">
-				
-			</div>
-		</div>
-	</div>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionWidget.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/QuestionWidget.html	(revision 416)
+++ 	(revision )
@@ -1,23 +1,0 @@
-<div>
-    <form data-dojo-type="dijit/form/Form" data-dojo-attach-point="ourForm">
-        <fieldset>
-            <label for="code" class="loginLabel">Code</label>
-            <input data-dojo-type="dijit/form/TextBox" name="code" type="text" class="loginInput" />
-            <label for="question" class="loginLabel">Title</label>
-            <input data-dojo-type="dijit/form/TextBox" name="title" type="text" class="loginInput" />
-            <label for="question" class="loginLabel">Description</label>
-            <input data-dojo-type="dijit/form/Textarea" name="description" type="text" class="loginInput"/>
-            <label for="category" class="loginLabel">Category</label>
-            <input data-dojo-type="dijit/form/TextBox" name="category" type="text" class="loginInput" />
-        </fieldset>
-        <fieldset>
-            <select data-dojo-type="dijit/form/Select" data-dojo-attach-point="scaleSelector" data-dojo-attach-event="onChange:_onTypeChange" name="scale">
-                <option value="string" selected>String</option>
-                <option value="text">Text</option>
-                <option value="singleChoice">Single choice</option>
-                <option value="multipleChoice">Multiple choice</option>
-            </select>
-            <div data-dojo-attach-point="scaleDetails"></div>
-        </fieldset>
-    </form>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/Selector.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/Selector.html	(revision 416)
+++ 	(revision )
@@ -1,10 +1,0 @@
-<div>
-    <div class="${baseClass}Category">
-        <div class="${baseClass}Title" data-dojo-attach-point="titleNode"></div>
-    </div>
-    <div class="${baseClass}Selected">
-        <div class="${baseClass}Indicator" data-dojo-attach-point="selectedColorNode"></div>
-        <div class="${baseClass}Item" data-dojo-attach-point="selectedItemNode"></div>
-    </div>
-    <div class="${baseClass}Options" data-dojo-attach-point="optionsNode"></div>
-</div>
Index: Dev/branches/rest-dojo-ui/client/rft/ui/templates/SessionBar.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/ui/templates/SessionBar.html	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/rft/ui/templates/SessionBar.html	(revision 417)
@@ -1,5 +1,5 @@
 <div class="${baseClass}">
     <span class="rftIcon rftIconSession" data-dojo-attach-point="iconNode"></span>
-    <div data-dojo-type="rft/ui/LineWithActionsWidget" data-dojo-attach-point="upperNode" data-dojo-props="actions: {'inspect':{callback: inspect, properties: {blockButton: true}}}"></div>
-    <div data-dojo-type="rft/ui/LineWithActionsWidget" data-dojo-attach-point="lowerNode"></div>
+    <div data-dojo-type="rft/widgets/LineWithActionsWidget" data-dojo-attach-point="upperNode" data-dojo-props="actions: {'inspect':{callback: inspect, properties: {blockButton: true}}}"></div>
+    <div data-dojo-type="rft/widgets/LineWithActionsWidget" data-dojo-attach-point="lowerNode"></div>
 </div>
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/DateTimeTextBox.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/DateTimeTextBox.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/DateTimeTextBox.js	(revision 417)
@@ -0,0 +1,22 @@
+define([
+    'dojo/_base/declare',
+    'dojo/on',
+    'dijit/_WidgetBase',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetsInTemplateMixin',
+    'dojo/text!./templates/DateTimeTextBox.html'
+],function(declare,on,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,template){
+    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin],{
+        templateString: template,
+        baseClass: "rftDateTimeTextBox",
+        _getValueAttr: function() {
+            var date = this.dateBox.get('value').getTime();
+            var time = this.timeBox.get('value').getTime();
+            return new Date(date+time);
+        },
+        _setValueAttr: function(value) {
+            this.dateBox.set('value',value);
+            this.timeBox.set('value',value);
+        }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/LineWithActionsWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/LineWithActionsWidget.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/LineWithActionsWidget.js	(revision 417)
@@ -0,0 +1,84 @@
+define(['dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/on',
+    'dojo/dom',
+    'dojo/_base/event',
+    'dojo/dom-class',
+    'dijit/form/Button',
+    'dijit/_WidgetBase',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetsInTemplateMixin',
+    'dojo/text!./templates/LineWithActionsWidget.html'
+],function(declare,lang,on,dom,event,domClass,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){
+    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{
+        templateString: templateString,
+        baseClass: 'rftLineWithActions',
+        title: '',
+        selectable: false,
+        userObject: null,
+
+        actions: null,
+        postCreate: function() {
+            dom.setSelectable(this.domNode, false); // Text selection, has nothing to do with object selection!
+            on(this.domNode,'click',lang.hitch(this,'_onClick'));
+        },
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            this._setupActions();
+            this.refresh();
+        },
+        _setupActions: function() {
+            if ( this.actions === null ) {
+                return;
+            }
+            for (var action in this.actions) {
+                var properties;
+                if (this.actions[action].properties.blockButton === true) {
+                    properties = lang.mixin({
+                        baseClass: 'rftBlockButton',
+                        label: "Default",
+                        iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
+                        title: this.actions[action].properties.tooltip,
+                        onClick: lang.hitch(this, function(action, e){
+                            action.callback && action.callback(e);
+                            event.stop(e);
+                            return false;
+                        }, this.actions[action])
+                    }, this.actions[action].properties);
+                    new Button(properties).placeAt(this.buttonsNode);
+                } else {
+                    properties = lang.mixin({
+                        baseClass: 'rftInlineButton',
+                        label: "Default",
+                        showLabel: false,
+                        iconClass: 'rftIcon rftIcon'+this.actions[action].properties.icon,
+                        title: this.actions[action].properties.tooltip,
+                        onClick: lang.hitch(this, function(action, e){
+                            action.callback && action.callback(e);
+                            event.stop(e);
+                            return false;
+                        }, this.actions[action])
+                    }, this.actions[action].properties);
+                    new Button(properties).placeAt(this.buttonsNode);
+                }
+            }
+        },
+        refresh: function() {
+            this.titleNode.innerHTML = this.title;
+        },
+        _onClick: function(e){
+            var preventDefault = this.onClick(e) === false;
+            if (preventDefault) {
+                event.stop(e);
+            }
+            return !preventDefault;
+        },
+        onClick: function(e) {
+        },
+        _setTitleAttr: function(value){
+            this.title = value;
+            this.refresh();
+        }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/MultipleChoiceWidget.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/MultipleChoiceWidget.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/MultipleChoiceWidget.js	(revision 417)
@@ -0,0 +1,91 @@
+define(['dojo/_base/declare','dojo/_base/array','dojo/_base/lang',
+    'dojo/dom-construct','dijit/registry','dijit/_WidgetBase',
+    'dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin','dijit/_Container',
+    'dojo/text!./templates/MultipleChoiceWidget.html',
+    'dijit/form/RadioButton','dijit/form/CheckBox','dijit/form/TextBox','dijit/form/Button'],
+    function(declare,array,lang,domConstruct,registry,_WidgetBase,_TemplatedMixin,
+        _WidgetsInTemplateMixin,_Container,
+        templateString,RadioButton,CheckBox,TextBox,Button){
+        return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+            templateString: templateString,
+            multiple: true,
+            baseClass: 'rftMultipleChoiceWidget',
+            
+            allowMultiple: false,
+            name: '',
+            value: null,
+            
+            _widgetCache: null,
+            constuctor: function() {
+                this.inherited(arguments);
+                this.value = [];
+                this._widgetCache = {};
+            },
+            _setValueAttr: function(value) {
+                this.reset();
+                this.value = value;
+                array.forEach(this.value,lang.hitch(this,function(val){
+                    this._addRow(val);
+                }));
+            },
+            _getValueAttr: function() {
+                var value = [];
+                registry.findWidgets(this.domNode).forEach(function(w){
+                    w.isInstanceOf(TextBox) && value.push(w.get('value'));
+                });
+                this.value = value;
+                return value;
+            },
+            reset: function() {
+                this._removeWidgetsBelowNode(this.rows);
+                domConstruct.empty(this.rows);
+            },
+            _onAddRow: function() {
+                this._addRow();
+            },
+            _addRow: function(value,tagRow,pos) {
+                var row = domConstruct.create('div',{'class':'row'});
+                if ( this.allowMultiple ) {
+                    new CheckBox({
+                        name:this.name,
+                        'class':'rowBox',
+                        disabled: this.mode == 'edit'
+                    }).placeAt(row);
+                } else {
+                    new RadioButton({
+                        name:this.name,
+                        'class':'rowBox',
+                        disabled: this.mode == 'edit'
+                    }).placeAt(row);
+                }
+                new TextBox({
+                    name:this.name,
+                    value:value || '',
+                    'class':'rowText'
+                }).placeAt(row);
+                new Button({
+                    label:'-',
+                    'class':'rowBtn',
+                    onClick:lang.hitch(this,'_removeNodeWithWidgets',row)
+                }).placeAt(row);
+                new Button({
+                    label:'+',
+                    'class':'rowBtn',
+                    onClick:lang.hitch(this,'_addRow','',row,'before')
+                }).placeAt(row);
+                domConstruct.place(row,tagRow || this.rows,pos||'last');
+            },
+            _removeNodeWithWidgets: function(node) {
+                this._removeWidgetsBelowNode(node);
+                domConstruct.destroy(node);
+            },
+            _removeWidgetsBelowNode: function(node) {
+                registry.findWidgets(node).forEach(function(w){
+                    w.destroyRecursive();
+                });
+            },
+            _onRowChange: function(row) {
+                
+            }
+        });
+    });
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/ObjectBox.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/ObjectBox.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/ObjectBox.js	(revision 417)
@@ -0,0 +1,75 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dijit/_WidgetBase',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetsInTemplateMixin',
+    './LineWithActionsWidget',
+    'dojo/text!./templates/ObjectBox.html'
+], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LineWithActionsWidget, template){
+    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
+        baseClass: "rftObjectBox",
+        templateString: template,
+        value: null,
+        actions: null,
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            this.line1 = new LineWithActionsWidget({
+                actions: {
+                    "inspectIcon": {
+                        callback: lang.hitch(this, this._showInfoBox),
+                        properties: {
+                            blockButton: false,
+                            icon: "Inspect"
+                        }
+                    }
+                }
+            }).placeAt(this.line1Node);
+            this.line2 = new LineWithActionsWidget({
+            }).placeAt(this.line2Node);
+            var line3Actions = this._createLine3Actions();
+            this.line3 = new LineWithActionsWidget({
+                actions: line3Actions
+            }).placeAt(this.line3Node);
+            this.line1.startup();
+            this.line2.startup();
+            this.line3.startup();
+            this.inherited(arguments);
+        },
+        _createLine3Actions: function() {
+            var line3Actions = {};
+            for (var action in this.actions) {
+                line3Actions[action] = {
+                    callback: lang.hitch(this, function(callback){
+                        this.value && callback(this.value);
+                    }, this.actions[action]),
+                    properties: {
+                        blockButton: true,
+                        label: action,
+                        icon: action.charAt(0).toUpperCase()+action.slice(1)
+                    }
+                };
+            }
+            return line3Actions;
+        },
+        _showInfoBox: function() {
+            alert(this.value.description);
+        },
+        _setValueAttr: function(value) {
+            this.value = value;
+            this._refresh();
+        },
+        _getValueAttr: function(value) {
+            this.value = value;
+        },
+        _refresh: function() {
+            if ( this.value !== null ) {
+                this.iconNode.className = "rftIcon typeIcon rftIcon"+(this.value.type || '');
+                this.line1.set('title', this.value.title || '');
+                this.line2.set('title', this.value.subTitle || '');
+                this.line3.set('title', this.value.lowerTitle || '');
+            }
+        }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/Selector.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/Selector.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/Selector.js	(revision 417)
@@ -0,0 +1,178 @@
+define([
+    'dojo/_base/array',
+    'dojo/_base/declare',
+    'dojo/_base/event',
+    'dojo/_base/lang',
+    'dojo/dom-class',
+    'dojo/fx',
+    'dojo/query',
+    'dijit/_Container',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetBase',
+    'dijit/_WidgetsInTemplateMixin',
+    'dijit/registry',
+    './LineWithActionsWidget',
+    'dojo/text!./templates/Selector.html'
+],function(
+    baseArray,
+    declare,
+    event,
+    lang,
+    domClass,
+    fx,
+    query,
+    _Container,
+    _TemplatedMixin,
+    _WidgetBase,
+    _WidgetsInTemplateMixin,
+    registry,
+    LineWithActionsWidget,
+    templateString
+){
+    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+        templateString: templateString,
+        baseClass: 'rftSelector',
+
+        title: "",
+        selectedActions: null,
+        itemActions: null,
+        // main selector action: Object
+        //    title:
+        //    description:
+        //    icon:
+
+        _folded: true,
+        _titleLine: null,
+        _selectorLine: null,
+        _selectedItem: null,
+
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+            domClass.add(this.selectedColorNode, "pending");
+
+            this._createTitleLine();
+            this._createSelectorLine();
+
+            fx.wipeOut({
+                node: this.optionsNode
+            }).play();
+        },
+        _createTitleLine: function() {
+            var actions = {};
+            var action = null;
+            if ( this.selectedActions !== null ) {
+                for (var actionName in this.selectedActions) {
+                    action = this.selectedActions[actionName];
+                    actions[actionName] = {
+                        callback: action.callback &&
+                                lang.hitch(this,this._onSelectedAction,
+                                        action.callback),
+                        properties: {
+                             blockButton: true,
+                             label: action.title || actionName,
+                             icon: action.icon,
+                             tooltip: action.description
+                         }
+
+                    };
+                }
+            }
+
+            this._titleLine = new LineWithActionsWidget({
+                title: this.title,
+                actions: actions
+            },this.titleNode);
+            this._titleLine.startup();
+        },
+        _createSelectorLine: function() {
+            this._selectorLine = new LineWithActionsWidget({
+                title: 'None',
+                actions: {
+                    "Toggle dropdown" : {
+                        callback: lang.hitch(this, this.onToggle),
+                        properties: {
+                            blockButton: true,
+                            showLabel: false,
+                            icon: "HalfArrowDown"
+                        }
+                    }
+                }
+            },this.selectedItemNode);
+            this._selectorLine.startup();
+            this._selectorLine.on('click',lang.hitch(this, this.onToggle));
+        },
+        _onSelect: function(item, widget) {
+            this._selectedItem = item;
+            this.onToggle();
+            this._selectorLine.set("title", item.title);
+            baseArray.forEach(this.optionsNode.childNodes, function(node){
+                var line = registry.byNode(node);
+                if (line) {
+                    if (line === widget) {
+                        domClass.add(line.domNode, "inheritBgColor light");
+                    } else {
+                        domClass.remove(line.domNode, "inheritBgColor light");
+                    }
+                }
+            }, this);
+            this.onSelect(item);
+        },
+        _onSelectedAction: function(callback) {
+            if (this._selectedItem && callback) {
+                callback(this._selectedItem);
+            }
+        },
+
+        onToggle: function(evt) {
+            if (this._folded) {
+                var downArrowIcon = query(".rftBlockButton .rftIconHalfArrowDown", this._selectorLine.buttonsNode)[0];
+                if (downArrowIcon){
+                    domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown");
+                }
+                fx.wipeIn({
+                    node: this.optionsNode
+                }).play();
+                this._folded = false;
+            } else {
+                var upArrowIcon = query(".rftBlockButton .rftIconHalfArrowUp", this._selectorLine.buttonsNode)[0];
+                if (upArrowIcon){
+                    domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp");
+                }
+                fx.wipeOut({
+                    node: this.optionsNode
+                }).play();
+                this._folded = true;
+            }
+            evt && event.stop(evt);
+            return false;
+        },
+
+        addItem: function(item,displayTitle) {
+            var actions = {};
+            var action;
+            if (this.itemActions) {
+                for (var actionName in this.itemActions) {
+                    action = this.itemActions[actionName];
+                    actions[actionName] = {
+                        callback: action.callback && lang.partial(action.callback,item),
+                        properties: {
+                            blockButton: false,
+                            showLabel: false,
+                            icon: action.icon + " black",
+                            tooltip: action.description
+                        }
+                    };
+                }
+            }
+            var w = new LineWithActionsWidget({
+                title: displayTitle || item.title,
+                actions: actions
+            }).placeAt(this.optionsNode);
+            w.startup();
+            w.on("click", lang.hitch(this, this._onSelect, item, w));
+        },
+
+        onSelect: function(item) {}
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/ThresholdFilteringSelect.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/ThresholdFilteringSelect.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/ThresholdFilteringSelect.js	(revision 417)
@@ -0,0 +1,18 @@
+define([
+    'dojo/_base/declare',
+    'dijit/form/FilteringSelect'
+], function(declare, FilteringSelect) {
+    return declare(FilteringSelect, {
+         // custom min input character count to trigger search
+         minKeyCount: 3,
+
+         // override search method, count the input length
+         _startSearch: function (/*String*/key) {
+             if (!key || key.length < this.minKeyCount) {
+                 this.closeDropDown();
+                 return;
+             }
+             this.inherited(arguments);
+         }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/TitleGroup.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/TitleGroup.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/TitleGroup.js	(revision 417)
@@ -0,0 +1,11 @@
+require(['dojo/_base/declare','dojo/_base/query','dijit/registry','dojox/widget/TitleGroup'],
+    function(declare,query,registry,TitleGroup){
+        return declare([TitleGroup],{
+            getChildren: function() {
+                return query("> .dijitTitlePane", this.domNode)
+                .map(function(node){
+                    return registry.byNode(node);
+                });
+            }
+        });
+    });
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/list/List.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/list/List.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/list/List.js	(revision 417)
@@ -0,0 +1,92 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/dnd/Source',
+    'dijit/_TemplatedMixin',
+    'dijit/_WidgetBase',
+    'dijit/_WidgetsInTemplateMixin',
+    'dijit/registry',
+    'dijit/layout/BorderContainer',
+    'dojo/text!./templates/List.html'
+],function(
+    declare,
+    lang,
+    Source,
+    _TemplatedMixin,
+    _WidgetBase,
+    _WidgetsInTemplateMixin,
+    registry,
+    BorderContainer,
+    templateString){
+    return declare([BorderContainer,_TemplatedMixin,_WidgetsInTemplateMixin],{
+        templateString: templateString,
+        baseClass: 'rftList',
+        removeCallback: null,
+        type: 'text',
+        withHandles: false,
+        source: null,
+
+        startup: function() {
+            if ( this._started ){ return; }
+            this.inherited(arguments);
+
+            if (this.title) {
+                this.titleNode.innerHTML = this.title;
+            }
+
+            this.source = new Source(this.sourceNode.domNode, {
+                accept: [this.type],
+                singular: true,
+                withHandles: this.withHandles,
+                creator: lang.hitch(this, this._createNode)
+            });
+        },
+
+        _createNode: function(item, hint) {
+            var node = hint === "avatar" ?
+                    this._createAvatarNode(item) : this._createListNode(item);
+            return node && {
+                node: node,
+                data: item,
+                type: this.type
+            };
+        },
+        _createListNode: function(item) {},
+        _createAvatarNode: function(item) {},
+
+        appendItem: function(item) {
+            this.source.insertNodes(false,[item]);
+        },
+        appendItems: function(items) {
+            this.source.insertNodes(false,items);
+        },
+
+        getItems: function() {
+            return this.source.getAllNodes()
+            .map(function(node){
+                return this.source.getItem(node.id).data;
+            },this);
+        },
+
+        deleteItems: function() {
+            this.source.getAllNodes()
+            .forEach(function(node){
+                registry.byNode(node).destroyRecursive();
+            });
+            this.source.sync();
+        },
+
+        removeItem: function(item){
+            this.source.getAllNodes()
+            .filter(lang.hitch(this,function(node){
+                return this.source.getItem(node.id).data === item;
+            }))
+            .forEach(lang.hitch(this,function(node){
+                registry.byNode(node).destroyRecursive();
+                this.removeCallback && this.removeCallback(item);
+            }));
+            this.source.sync();
+        }
+
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/list/MultipleChoiceListView.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/list/MultipleChoiceListView.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/list/MultipleChoiceListView.js	(revision 417)
@@ -0,0 +1,42 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dojo/dom-construct',
+    '../LineWithActionsWidget',
+    './OrderedList'
+],function(
+    declare,
+    lang,
+    domConstruct,
+    LineWithActionsWidget,
+    OrderedList
+    ) {
+    return declare([OrderedList],{
+        baseClass: 'rftMultipleChoiceListView',
+        type: 'multipleChoiceOption',
+
+        _createAvatarNode: function(item){
+            return domConstruct.create("div",{
+                'class': 'dragAvatar',
+                innerHTML: item.title
+            });
+        },
+        _createListNode: function(item) {
+            var w = new LineWithActionsWidget({
+                title: item.title,
+                'class': "orange",
+                actions: {
+                    "Remove" : {
+                        callback: lang.hitch(this, 'removeItem', item),
+                        properties: {
+                            blockButton: false,
+                            icon: "Delete"
+                        }
+                    }
+                }
+            });
+            w.startup();
+            return w.domNode;
+        }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/list/OrderedList.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/list/OrderedList.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/list/OrderedList.js	(revision 417)
@@ -0,0 +1,79 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dijit/form/Button',
+    './List',
+    'dojo/text!./templates/OrderedList.html'
+    ],function(
+        declare,
+        lang,
+        Button,
+        List,
+        templateString
+        ){
+        return declare([List],{
+            templateString: templateString,
+            baseClass: 'rftLineListView',
+
+            startup: function() {
+                if ( this._started ){ return; }
+                this.inherited(arguments);
+
+                new Button({
+                    label: "Move up",
+                    showLabel: false,
+                    iconClass: "rftIcon rftIconFullArrowUp",
+                    baseClass: "rftBlockButton",
+                    'class': "trans",
+                    onClick: lang.hitch(this, function() {
+                        this._moveSelectedItem("up");
+                    })
+                }, this.btnListMoveUp).startup();
+
+                new Button({
+                    label: "Move down",
+                    showLabel: false,
+                    iconClass: "rftIcon rftIconFullArrowDown",
+                    baseClass: "rftBlockButton",
+                    'class': "trans",
+                    onClick: lang.hitch(this, function() {
+                        this._moveSelectedItem("down");
+                    })
+                }, this.btnListMoveDown).startup();
+            },
+
+            _moveSelectedItem: function(dir) {
+                var node = this.source.getSelectedNodes()[0];
+                if (node) {
+                    if (dir === "up") {
+                        if (node.previousSibling) {
+                            return node.parentNode.insertBefore(node, node.previousSibling);
+                        } else {
+                            return false;
+                        }
+
+                    } else if (dir === "down") {
+                        if (node.nextSibling) {
+                            return node.parentNode.insertBefore(node.nextSibling, node);
+                        } else {
+                            return false;
+                        }
+                    } else {
+                        throw "Invalid move direction passed!";
+                    }
+                } else {
+                    return false;
+                }
+            },
+
+            insertItem: function(item) {
+                var anchor = this.source.getSelectedNodes()[0];
+                if (anchor) {
+                    this.source.insertNodes(false,[item], false, anchor);
+                } else {
+                    this.appendItem(item);
+                }
+            }
+
+        });
+    });
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/list/_EditableListMixin.js
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/list/_EditableListMixin.js	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/list/_EditableListMixin.js	(revision 417)
@@ -0,0 +1,16 @@
+define([
+    'dojo/_base/declare',
+    'dojo/_base/lang',
+    'dijit/registry'
+],function(declare,lang,registry){
+    return declare(null,{
+        getItems: function() {
+            return this.source.getAllNodes()
+            .map(function(node){
+                var value = registry.byId(node.id).get('value');
+                this.source.setItem(node.id, value)
+                return value;
+            },this);
+        }
+    });
+});
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/list/templates/List.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/list/templates/List.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/list/templates/List.html	(revision 417)
@@ -0,0 +1,10 @@
+<div>
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'top'">
+	        <h3 data-dojo-attach-point="titleNode"></h3>
+        </div>
+        <div data-dojo-type="dijit/layout/ContentPane"
+             data-dojo-props="region: 'center'"
+             data-dojo-attach-point="sourceNode"
+             class="${baseClass}Content">
+        </div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/list/templates/OrderedList.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/list/templates/OrderedList.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/list/templates/OrderedList.html	(revision 417)
@@ -0,0 +1,15 @@
+<div>
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'top'">
+	        <h3 data-dojo-attach-point="titleNode"></h3>
+        </div>
+        <div data-dojo-type="dijit/layout/ContentPane"
+             data-dojo-props="region: 'center'"
+             data-dojo-attach-point="sourceNode"
+             class="${baseClass}Content">
+        </div>
+        <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'bottom'" data-dojo-attach-point="buttonsNode">
+		    <span>Move selected: </span>
+		    <button data-dojo-attach-point="btnListMoveUp" ></button>
+		    <button data-dojo-attach-point="btnListMoveDown"></button>
+        </div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/templates/DateTimeTextBox.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/templates/DateTimeTextBox.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/templates/DateTimeTextBox.html	(revision 417)
@@ -0,0 +1,4 @@
+<div class="${baseClass}">
+    <div data-dojo-type="dijit/form/DateTextBox" data-dojo-attach-point="dateBox"></div>
+    <div data-dojo-type="dijit/form/TimeTextBox" data-dojo-attach-point="timeBox"></div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/templates/LineWithActionsWidget.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/templates/LineWithActionsWidget.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/templates/LineWithActionsWidget.html	(revision 417)
@@ -0,0 +1,4 @@
+<div class="${baseClass}">
+    <span class="${baseClass}Title" data-dojo-attach-point="titleNode"></span>
+    <span class="${baseClass}Buttons dijitReset" data-dojo-attach-point="buttonsNode"></span>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/templates/MultipleChoiceWidget.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/templates/MultipleChoiceWidget.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/templates/MultipleChoiceWidget.html	(revision 417)
@@ -0,0 +1,7 @@
+<div class="${baseClass}">
+    <div data-dojo-attach-point="rows">
+    </div>
+    <div data-dojo-attach-point="buttons" class="row">
+        <div><span class="rowBox"/><span class="rowText"/><span class="rowBtn"/><button data-dojo-type="dijit/form/Button" type="button" data-dojo-attach-event="onClick:_onAddRow" class="rowBtn">+</button></div>
+    </div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/templates/ObjectBox.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/templates/ObjectBox.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/templates/ObjectBox.html	(revision 417)
@@ -0,0 +1,6 @@
+<div class="${baseClass}">
+    <div data-dojo-attach-point="iconNode"></div>
+    <div data-dojo-attach-point="line1Node"></div>
+    <div data-dojo-attach-point="line2Node"></div>
+    <div data-dojo-attach-point="line3Node"></div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/rft/widgets/templates/Selector.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/rft/widgets/templates/Selector.html	(revision 417)
+++ Dev/branches/rest-dojo-ui/client/rft/widgets/templates/Selector.html	(revision 417)
@@ -0,0 +1,10 @@
+<div>
+    <div class="${baseClass}Category">
+        <div class="${baseClass}Title" data-dojo-attach-point="titleNode"></div>
+    </div>
+    <div class="${baseClass}Selected">
+        <div class="${baseClass}Indicator" data-dojo-attach-point="selectedColorNode"></div>
+        <div class="${baseClass}Item" data-dojo-attach-point="selectedItemNode"></div>
+    </div>
+    <div class="${baseClass}Options" data-dojo-attach-point="optionsNode"></div>
+</div>
Index: Dev/branches/rest-dojo-ui/client/view.html
===================================================================
--- Dev/branches/rest-dojo-ui/client/view.html	(revision 416)
+++ Dev/branches/rest-dojo-ui/client/view.html	(revision 417)
@@ -14,5 +14,5 @@
             </div>
         </div>
-        <div id="toaster" data-dojo-type="rft/ui/Notifications">
+        <div id="toaster" data-dojo-type="rft/app/Notifications">
         </div>
     </body>
