Index: src/main/webapp/application/engageConfig.json
===================================================================
--- src/main/webapp/application/engageConfig.json	(revision 8878)
+++ src/main/webapp/application/engageConfig.json	(working copy)
@@ -12,7 +12,8 @@
     "fluid.browseDemo.initBrowseDataFeed",
     "fluid.engageDemo.initEngageDemo",
     "fluid.kettleDemo.initCherryDemo",
-    "fluid.kettleDemo.initJSGIHandlerDemo"
+    "fluid.kettleDemo.initJSGIHandlerDemo",
+    "fluid.engageDemo.initDBChange"
 ],
 views: {
     all: "all",
Index: src/main/webapp/services/engageDemo/js/engageDemo.js
===================================================================
--- src/main/webapp/services/engageDemo/js/engageDemo.js	(revision 8878)
+++ src/main/webapp/services/engageDemo/js/engageDemo.js	(working copy)
@@ -1,37 +1,100 @@
-/*
-Copyright 2009 University of Cambridge
-Copyright 2009 University of Toronto
-
-Licensed under the Educational Community License (ECL), Version 2.0 or the New
-BSD license. You may not use this file except in compliance with one these
-Licenses.
-
-You may obtain a copy of the ECL 2.0 License and BSD License at
-https://source.fluidproject.org/svn/LICENSE.txt
-*/
-
-// Declare dependencies.
-/*global jQuery, fluid*/
-
-fluid = fluid || {};
-fluid.engageDemo = fluid.engageDemo || {};
-
-(function ($) {
-    
-    fluid.engageDemo.initEngageDemo = function (config, app) {
-        var handler = fluid.engage.mountRenderHandler({
-            config: config,
-            app: app,
-            target: "demo/",
-            source: "html/",
-            sourceMountRelative: "engageDemo"
-        });
-        
-        handler.registerProducer("index", function (context, env) {
-            return {};
-        });
-
-
-    };
-    
+/*
+Copyright 2009 University of Cambridge
+Copyright 2009 University of Toronto
+
+Licensed under the Educational Community License (ECL), Version 2.0 or the New
+BSD license. You may not use this file except in compliance with one these
+Licenses.
+
+You may obtain a copy of the ECL 2.0 License and BSD License at
+https://source.fluidproject.org/svn/LICENSE.txt
+*/
+
+// Declare dependencies.
+/*global jQuery, fluid*/
+
+fluid = fluid || {};
+fluid.engageDemo = fluid.engageDemo || {};
+
+(function ($) {
+
+  var dequote = /"([^"]*)"/;
+
+  fluid.couchHandler = function (URL) {
+      var that = {};
+      that.currentRevision = function(docID) {
+          var togo = {};
+          var complete = function(xhr, status) {
+              togo.status = status;
+              var etag = xhr.getResponseHeader("etag");
+              togo._rev = etag? dequote.exec(etag)[1] : undefined;
+          };
+          $.ajax({
+                url: URL + docID,
+                type: "HEAD",
+                async: false,
+                complete: complete
+            });
+          return togo;
+      };
+      that.write = function(docID, data) {
+          var togo;
+          var success = function (data, status) {
+              togo = {
+                data: JSON.parse(data.trim()),
+                status: status
+              };
+            };
+          var error = function (XMLHttpRequest, textStatus, errorThrown) {
+              togo = {
+                textStatus: textStatus
+              };
+            };
+         var rev = that.currentRevision(docID);
+         data._id = docID;
+         data._rev = rev._rev;
+         $.ajax({
+                url: URL + data._id,
+                type: "PUT",
+                contentType: "application/json",
+                data: JSON.stringify(data),
+                success: success,
+                dataType: "json",
+                async: false,
+                error: error
+            });
+          return togo;
+      };
+      return that; 
+  };
+  
+  var testCouchHandler = fluid.couchHandler("http://titan.atrc.utoronto.ca:5984/test_suite_db/");
+  
+	fluid.engageDemo.initDBChange = function (config, app) {
+		var testHandler = function (env) {	
+            var data = {test: "to POST IN DB"};
+            var response = testCouchHandler.write("dokkument_id", data);
+            return [200, {"Content-Type": "text/plain"}, JSON.stringify(response)];
+        };
+        
+        var acceptor = fluid.engage.makeAcceptorForResource("index", "json", testHandler);
+        fluid.engage.mountAcceptor(app, "demo", acceptor);
+	};
+	
+    fluid.engageDemo.initEngageDemo = function (config, app) {
+        var handler = fluid.engage.mountRenderHandler({
+            config: config,
+            app: app,
+            target: "demo/",
+            source: "html/",
+            sourceMountRelative: "engageDemo"
+        });
+        
+        handler.registerProducer("index", function (context, env) {
+            return {};
+        });
+
+
+    };
+    
 })(jQuery);
\ No newline at end of file
