[Zope-CVS] CVS: Packages/Moztop/moztop/content/lib - sitesmanager.js:1.4
Paul Everitt
paul@zope.com
Thu, 20 Mar 2003 17:39:38 -0500
Update of /cvs-repository/Packages/Moztop/moztop/content/lib
In directory cvs.zope.org:/tmp/cvs-serv24557
Modified Files:
sitesmanager.js
Log Message:
Removed virtual folder definitions, cleared up siteurn vs. contentsurl, works w/ local Apache.
=== Packages/Moztop/moztop/content/lib/sitesmanager.js 1.3 => 1.4 ===
--- Packages/Moztop/moztop/content/lib/sitesmanager.js:1.3 Thu Mar 20 14:30:50 2003
+++ Packages/Moztop/moztop/content/lib/sitesmanager.js Thu Mar 20 17:39:37 2003
@@ -1,3 +1,5 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
/*****************************************************************************
*
* Copyright (c) 2002, 2003 Zope Corporation and Contributors.
@@ -171,55 +173,36 @@
p.ds = ds;
// p.onreadystatechange = handleError;
p.onload = serializeResponse;
- p.open("GET", siteurl + "contents.rdf", false);
+ p.open("GET", siteurl + "/contents.rdf", false);
p.send(null);
}
-SitesManager.prototype.addSite = function(site_name, site_realm, site_url,
+SitesManager.prototype.addSite = function(site_name, siteurn, contentsurl,
site_username, site_password) {
/* The realm is used in URNs while the name is for the display */
var sc=this.ds.getNode("urn:moztop:sites")
.getTarget(this.subitemsprop);
- var newsite=this.ds.getNode("urn:moztop:sites:" + site_realm);
+ var newsite=this.ds.getNode(siteurn);
var siteres = this.ds.getNode("urn:moztop:resourcetypes:site");
sc.addChild(newsite);
// Now fill in the data for the new site
newsite.addTarget(this.titleprop, site_name);
- newsite.addTarget(this.urlprop, site_url);
+ newsite.addTarget(this.urlprop, contentsurl);
newsite.addTarget(this.usernameprop, site_username);
newsite.addTarget(this.passwordprop, site_password);
newsite.addTarget(this.resourcetypeprop, siteres);
// Prepare the area for pseudo-folders (Configurations, Content, etc.)
- var subitemsurn = "urn:moztop:sites:" + site_realm + ":subitems";
+
+ var subitemsurn = siteurn + ":subitems";
var subitems = this.ds.getNode(subitemsurn);
subitems.makeSeq();
newsite.addTarget(this.subitemsprop,subitems);
- /* Now add the virtual folders which arc to this.commontypesds */
- var vfs = new Array ('Views', 'Configurations', 'Content', 'Bundles',
- 'Packages');
- for (var i = 0; i < vfs.length; i++) {
-
- /* vf is the current virtual folder */
- var vf = vfs[i];
- var vfurn = "urn:moztop:sites:" + site_realm + ":" + vf.toLowerCase();
-
- /* Create a new node for this virtual folder and append to subitems */
- var newvf = this.ds.getNode(vfurn);
- subitems.addChild(newvf);
-
- // XXX: get rid of the following line
- newvf.addTarget(this.titleprop,vf);
-
- /* Fill in the rest of the info for the virtual folder */
- newvf.addTarget(this.resourcetypeprop,
- "urn:moztop:resourcetypes:" + vf.toLowerCase());
- }
/* Finally, create a site datasource and load the contents for this site */
id = this.sitedatasources.length
@@ -228,7 +211,9 @@
var ds = new RDFDataSource();
this.sitedatasources[id] = ds;
}
- this.retrieveSiteContents(site_url, ds);
+
+ dump("about to retrieve " + contentsurl);
+ this.retrieveSiteContents(contentsurl, ds);
this.ds.save();
return;