[Zope-CVS] CVS: Packages/Moztop/moztop/content/lib - jsdav.js:1.10
Stephan Richter
srichter@cbu.edu
Thu, 27 Mar 2003 11:45:35 -0500
Update of /cvs-repository/Packages/Moztop/moztop/content/lib
In directory cvs.zope.org:/tmp/cvs-serv8065/moztop/content/lib
Modified Files:
jsdav.js
Log Message:
Worked on jsdav quiet a bit. We now have initial support for PROPFIND,
MKCOL, GET, HEAD, DELETE, COPY, and MOVE; all without proper error
handling. Still missing is PROPPATCH, LOCK and UNLOCK.
See the beginning of the lib for a more detailed status report.
=== Packages/Moztop/moztop/content/lib/jsdav.js 1.9 => 1.10 === (463/563 lines abridged)
--- Packages/Moztop/moztop/content/lib/jsdav.js:1.9 Wed Mar 26 05:57:13 2003
+++ Packages/Moztop/moztop/content/lib/jsdav.js Thu Mar 27 11:45:34 2003
@@ -13,6 +13,120 @@
******************************************************************************
WebDAV specific methods.
+Features:
+
+ PROPFIND
+
+ - Responses are received and parsed.
+
+ - propfind XML is completely generatable using object tree.
+
+ - Call made back to callback function.
+
+ MKCOL
+
+ - Creates new collection (folder/directory/container).
+
+ GET
+
+ - Returns the request text
+
+ HEAD
+
+ - Returns the request object, so that headers can be looked up individually.
+
+ DELETE
+
+ - Deletes resource on server and returns properly.
+
+ COPY
+
+ - Server copies objects.
+
+ - Depth, Overwrite Headers implemented.
+
+ MOVE
+
+ - Server moves objects.
+
+ - Depth, Overwrite Headers implemented.
+
+
+To do:
+
+ General:
+
+ - Need to document the various callback function parameters. Maybe provide
[-=- -=- -=- 463 lines omitted -=- -=- -=-]
+ if (sub.localName == 'status') {
+ this.status = sub.firstChild.nodeValue
+ }
+ if (sub.localName == 'prop') {
+ this.prop = new Prop();
+ this.prop.parseXML(sub);
+ }
+ }
+
+ },
+ createXML: function(parent, doc) {
+ }
+}
+
+
function Prop(ns) {
/* Implementation of prop XML Element.
@@ -497,6 +854,9 @@
}
Prop.prototype = {
+ getProperties: function() {
+ return this.properties;
+ },
addProperty: function(name) {
this.properties[this.properties.length] = name;
},
@@ -506,6 +866,13 @@
node.appendChild(doc.createElementNS(this.namespace,
this.properties[index]));
parent.appendChild(node);
+ },
+ parseXML: function(node) {
+ for (var index = 0; index < node.childNodes.length; index++) {
+ sub = node.childNodes[index];
+ if (sub.localName != null)
+ this.properties[this.properties.length] = sub.localName;
+ }
}
}
@@ -521,7 +888,6 @@
}
PropFind.prototype = {
-
addProp: function(prop) {
if ((this.allprop == false) && (this.propname == false))
this.props[this.props.length] = prop;