couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r662261 [1/3] - in /incubator/couchdb/branches/runtimeconfig: ./ bin/ share/server/ share/www/script/ share/www/style/ src/couchdb/ src/fulltext/ src/mochiweb/
Date Sun, 01 Jun 2008 18:25:56 GMT
Author: jan
Date: Sun Jun  1 11:25:56 2008
New Revision: 662261

URL: http://svn.apache.org/viewvc?rev=662261&view=rev
Log:
Merged revisions 659808,659940,659988-659989,660007,660046,660049-660050,660136,660139-660140,660142,660166,660170,660176-660177,660183,660282,660315
via svnmerge from 
https://jan@svn.apache.org/repos/asf/incubator/couchdb/trunk

Add ini file writer.

Added:
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couchdb_config_writer.erl
Removed:
    incubator/couchdb/branches/runtimeconfig/src/fulltext/
Modified:
    incubator/couchdb/branches/runtimeconfig/   (props changed)
    incubator/couchdb/branches/runtimeconfig/LICENCE
    incubator/couchdb/branches/runtimeconfig/THANKS
    incubator/couchdb/branches/runtimeconfig/bin/couchdb.tpl.in
    incubator/couchdb/branches/runtimeconfig/share/server/main.js
    incubator/couchdb/branches/runtimeconfig/share/www/script/browse.js
    incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js
    incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.couch.js
    incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.js
    incubator/couchdb/branches/runtimeconfig/share/www/style/layout.css
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_config.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_db.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_doc.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_httpd.erl
    incubator/couchdb/branches/runtimeconfig/src/couchdb/couch_stream.erl
    incubator/couchdb/branches/runtimeconfig/src/mochiweb/Makefile.am
    incubator/couchdb/branches/runtimeconfig/src/mochiweb/mochiweb.erl
    incubator/couchdb/branches/runtimeconfig/src/mochiweb/mochiweb_request.erl
    incubator/couchdb/branches/runtimeconfig/src/mochiweb/mochiweb_util.erl

Propchange: incubator/couchdb/branches/runtimeconfig/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Jun  1 11:25:56 2008
@@ -1 +1 @@
-/incubator/couchdb/trunk:1-659771
+/incubator/couchdb/trunk:1-660594

Modified: incubator/couchdb/branches/runtimeconfig/LICENCE
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/LICENCE?rev=662261&r1=662260&r2=662261&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/LICENCE (original)
+++ incubator/couchdb/branches/runtimeconfig/LICENCE Sun Jun  1 11:25:56 2008
@@ -200,3 +200,104 @@
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
+
+
+===============================================================================
+
+The Apache CouchDB project includes a number of subcomponents
+with separate copyright notices and license terms. Your use of the
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+-------------------------------------------------------------------------------
+
+m4/ac_check_icu.m4:
+
+Copyright (c) 2005 Akos Maroy <darkeye@tyrell.hu>
+
+Copying and distribution of this file, with or without
+modification, are permitted in any medium without royalty provided
+the copyright notice and this notice are preserved.
+
+-------------------------------------------------------------------------------
+
+share/www/script/jquery.js:
+
+Copyright (c) 2008 John Resig, http://jquery.com/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-------------------------------------------------------------------------------
+
+share/www/script/json2.js:
+
+Public Domain
+
+No warranty expressed or implied. Use at your own risk.
+
+-------------------------------------------------------------------------------
+
+src/couchdb/cjson.erl:
+
+Copyright (c) 2006 Mochi Media, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-------------------------------------------------------------------------------
+
+src/mochiweb:
+
+Copyright (c) 2007 Mochi Media, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Modified: incubator/couchdb/branches/runtimeconfig/THANKS
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/THANKS?rev=662261&r1=662260&r2=662261&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/THANKS (original)
+++ incubator/couchdb/branches/runtimeconfig/THANKS Sun Jun  1 11:25:56 2008
@@ -6,6 +6,7 @@
 CouchDB by reporting problems, suggesting various improvements or submitting
 changes. A list of these people is included below.
 
+ * Chris Anderson <jchris@grabb.it>
  * William Beh <willbeh@gmail.com>
  * Benoit Chesneau <bchesneau@gmail.com>
  * Till Klampaeckel <till@klampaeckel.de>

Modified: incubator/couchdb/branches/runtimeconfig/bin/couchdb.tpl.in
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/bin/couchdb.tpl.in?rev=662261&r1=662260&r2=662261&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/bin/couchdb.tpl.in (original)
+++ incubator/couchdb/branches/runtimeconfig/bin/couchdb.tpl.in Sun Jun  1 11:25:56 2008
@@ -223,7 +223,7 @@
     command="`%ICU_CONFIG% --invoke` \
         %ERL% $interactive_option -smp auto -sasl errlog_type error \
         -pa %erlanglibdir%/couch-%version%/ebin \
-            %erlanglibdir%/mochiweb-r73/ebin \
+            %erlanglibdir%/mochiweb-r76/ebin \
         -eval \"application:load(inets)\" \
         -eval \"application:load(crypto)\" \
         -eval \"application:load(couch)\" \

Modified: incubator/couchdb/branches/runtimeconfig/share/server/main.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/server/main.js?rev=662261&r1=662260&r2=662261&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/server/main.js [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/server/main.js [utf-8] Sun Jun  1 11:25:56
2008
@@ -28,11 +28,16 @@
   return rv;
 }
 
+log = function(message) {
+  print(toJSON({log: toJSON(message)}));  
+}
+
 try {
   // if possible, use evalcx (not always available)
   sandbox = evalcx('');
   sandbox.emit = emit;
   sandbox.sum = sum;
+  sandbox.log = log;
 } catch (e) {}
 
 // Commands are in the form of json arrays:

Modified: incubator/couchdb/branches/runtimeconfig/share/www/script/browse.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/script/browse.js?rev=662261&r1=662260&r2=662261&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/script/browse.js [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/script/browse.js [utf-8] Sun Jun  1
11:25:56 2008
@@ -40,10 +40,10 @@
     $(document.body).addClass("loading");
     $.couch.allDbs({
       success: function(dbs) {
-        if(dbs.length == 0) {
+        if (dbs.length == 0) {
           $(document.body).removeClass("loading");
         }
-        
+
         $.each(dbs, function(idx, dbName) {
           $("#databases tbody.content").append("<tr>" + 
             "<th><a href='database.html?" + encodeURIComponent(dbName) + "'>"
+
@@ -505,6 +505,19 @@
     _editKey(page.doc, row.find("th"), fieldName);
   }
 
+  var _sortFields = function(a, b) {
+    var a0 = a.charAt(0), b0 = b.charAt(0);
+    if (a0 == "_" && b0 != "_") {
+      return -1;
+    } else if (a0 != "_" && b0 == "_") {
+      return 1;
+    } else if (a == "_attachments" || b == "_attachments") {
+      return a0 == "_attachments" ? 1 : -1;
+    } else {
+      return a < b ? -1 : a != b ? 1 : 0;
+    }
+  }
+
   this.updateFieldListing = function() {
     $(document.body).addClass("loading");
     $("#fields tbody.content").empty();
@@ -517,16 +530,7 @@
         propNames.push(prop);
       }
       // Order properties alphabetically, but put internal fields first
-      propNames.sort(function(a, b) {
-        var a0 = a.charAt(0), b0 = b.charAt(0);
-        if (a0 == "_" && b0 != "_") {
-          return -1;
-        } else if (a0 != "_" && b0 == "_") {
-          return 1;
-        } else {
-          return a < b ? -1 : a != b ? 1 : 0;
-        }
-      });
+      propNames.sort(_sortFields);
       for (var pi = 0; pi < propNames.length; pi++) {
         _addRowForField(doc, propNames[pi]);
       }
@@ -609,20 +613,27 @@
   }
 
   function _addRowForField(doc, fieldName) {
-    var value = _renderValue(doc[fieldName]);
-    var row = $("<tr><th></th><td></td></tr>")
-      .find("th").append($("<b></b>").text(fieldName)).dblclick(function() {
-        _editKey(doc, this, $(this).text());
-      }).end()
-      .find("td").append(value).dblclick(function() {
-        _editValue(doc, this, $(this).prev("th").text());
-      }).end()
-      .appendTo("#fields tbody.content");
-    if (fieldName != "_id" && fieldName != "_rev") {
-      row.find("th, td").attr("title", "Double click to edit");
-      _initKey(doc, row, fieldName);
-      _initValue(value);
+    var row = $("<tr><th></th><td></td></tr>").find("th").append($("<b></b>").text(fieldName)).end();
+    if (fieldName == "_attachments") {
+      row
+        .find("td").append(_renderAttachmentList(doc[fieldName]));
+    } else {
+      var value = _renderValue(doc[fieldName]);
+      row
+        .find("th b").dblclick(function() {
+          _editKey(doc, this, $(this).text());
+        }).end()
+        .find("td").append(value).dblclick(function() {
+          _editValue(doc, this, $(this).prev("th").text());
+        }).end()
+        
+      if (fieldName != "_id" && fieldName != "_rev") {
+        row.find("th, td").attr("title", "Double click to edit");
+        _initKey(doc, row, fieldName);
+        _initValue(value);
+      }
     }
+    row.appendTo("#fields tbody.content");
     $("#fields tbody tr").removeClass("odd").filter(":odd").addClass("odd");
     return row;
   }
@@ -766,4 +777,31 @@
     }
   }
 
+  function _renderAttachmentList(attachments) {
+    var ul = $("<ul></ul>").addClass("attachments");
+    $.each(attachments, function(idx, attachment) {
+      _renderAttachmentItem(idx, attachment).appendTo(ul);
+    });
+    return ul;
+  }
+
+  function _renderAttachmentItem(name, attachment) {
+    var li = $("<li></li>");
+    $("<a href='' title='Download file' target='_top'></a>").text(name)
+      .attr("href", db.uri + encodeURIComponent(docId) + "/" + encodeURIComponent(name))
+      .wrapInner("<tt></tt>").appendTo(li);
+    $("<span>()</span>").text("" + prettyPrintSize(attachment.length) + 
+      ", " + attachment.content_type).addClass("info").appendTo(li);
+    _initAttachmentItem(name, attachment, li);
+    return li;
+  }
+
+  function _initAttachmentItem(name, attachment, li) {
+    $("<button type='button' class='delete' title='Delete attachment'></button>").click(function()
{
+      delete page.doc._attachments[name];
+      li.remove();
+      page.isDirty = true;
+    }).prependTo($("a", li));
+  }
+
 }

Modified: incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js?rev=662261&r1=662260&r2=662261&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/script/couch.js [utf-8] Sun Jun  1
11:25:56 2008
@@ -33,7 +33,7 @@
     if (req.status == 404)
       return false;
     var result = JSON.parse(req.responseText);
-    if (req.status != 202)
+    if (req.status != 200)
       throw result;
     return result;
   }
@@ -73,7 +73,7 @@
   this.deleteDoc = function(doc) {
     var req = request("DELETE", this.uri + encodeURIComponent(doc._id) + "?rev=" + doc._rev);
     var result = JSON.parse(req.responseText);
-    if (req.status != 202)
+    if (req.status != 200)
       throw result;
     doc._rev = result.rev; //record rev in input document
     doc._deleted = true;
@@ -218,6 +218,6 @@
       req.setRequestHeader(headerName, headers[headerName]);
     }
   }
-  req.send(options.body || null);
+  req.send(options.body || "");
   return req;
 }

Modified: incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.couch.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.couch.js?rev=662261&r1=662260&r2=662261&view=diff
==============================================================================
--- incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.couch.js [utf-8] (original)
+++ incubator/couchdb/branches/runtimeconfig/share/www/script/jquery.couch.js [utf-8] Sun
Jun  1 11:25:56 2008
@@ -20,8 +20,8 @@
         type: "GET", url: "/_all_dbs",
         complete: function(req) {
           var resp = $.httpData(req, "json");
-          if (req.status == 200 && options.success) {
-            options.success(resp);
+          if (req.status == 200) {
+            if (options.success) options.success(resp);
           } else if (options.error) {
             options.error(req.status, resp.error, resp.reason);
           } else {
@@ -40,11 +40,13 @@
         compact: function(options) {
           options = options || {};
           $.ajax({
-            type: "POST", url: this.uri + "_compact", dataType: "json",
+            type: "POST", url: this.uri + "_compact",
+            contentType: "application/json",
+            dataType: "json", data: "", processData: false, 
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              if (req.status == 202 && options.success) {
-                options.success(resp);
+              if (req.status == 202) {
+                if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -56,11 +58,12 @@
         create: function(options) {
           options = options || {};
           $.ajax({
-            type: "PUT", url: this.uri, dataType: "json",
+            type: "PUT", url: this.uri, contentType: "application/json",
+            dataType: "json", data: "", processData: false, 
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              if (req.status == 201 && options.success) {
-                options.success(resp);
+              if (req.status == 201) {
+                if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -75,8 +78,8 @@
             type: "DELETE", url: this.uri, dataType: "json",
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              if (req.status == 202 && options.success) {
-                options.success(resp);
+              if (req.status == 200) {
+                if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -91,8 +94,8 @@
             type: "GET", url: this.uri, dataType: "json",
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              if (req.status == 200 && options.success) {
-                options.success(resp);
+              if (req.status == 200) {
+                if (options.success) options.success(resp);
               } else  if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -109,8 +112,8 @@
             dataType: "json",
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              if (req.status == 200 && options.success) {
-                options.success(resp);
+              if (req.status == 200) {
+                if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -128,8 +131,8 @@
             dataType: "json",
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              if (req.status == 200 && options.success) {
-                options.success(resp);
+              if (req.status == 200) {
+                if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -149,14 +152,14 @@
           }
           $.ajax({
             type: method, url: uri + encodeOptions(options),
-            dataType: "json", data: toJSON(doc),
             contentType: "application/json",
+            dataType: "json", data: toJSON(doc),
             complete: function(req) {
               var resp = $.httpData(req, "json")
               doc._id = resp.id;
               doc._rev = resp.rev;
-              if (req.status == 201 && options.success) {
-                options.success(resp);
+              if (req.status == 201) {
+                if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -173,8 +176,8 @@
             dataType: "json",
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              if (req.status == 202 && options.success) {
-                options.success(resp);
+              if (req.status == 200) {
+                if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -201,8 +204,8 @@
             data: toJSON(body), dataType: "json",
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              if (req.status == 200 && options.success) {
-                options.success(resp);
+              if (req.status == 200) {
+                if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -218,8 +221,8 @@
             dataType: "json",
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              if (req.status == 200 && options.success) {
-                options.success(resp);
+              if (req.status == 200) {
+                if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);
               } else {
@@ -237,8 +240,8 @@
         type: "GET", url: "/", dataType: "json",
         complete: function(req) {
           var resp = $.httpData(req, "json");
-          if (req.status == 200 && options.success) {
-            options.success(resp);
+          if (req.status == 200) {
+            if (options.success) options.success(resp);
           } else if (options.error) {
             options.error(req.status, resp.error, resp.reason);
           } else {
@@ -256,8 +259,8 @@
         contentType: "application/json",
         complete: function(req) {
           var resp = $.httpData(req, "json");
-          if (req.status == 200 && options.success) {
-            options.success(resp);
+          if (req.status == 200) {
+            if (options.success) options.success(resp);
           } else if (options.error) {
             options.error(req.status, resp.error, resp.reason);
           } else {



Mime
View raw message