[Zope-CVS] CVS: Packages/Moztop/moztop/content/lib - datasourcemanager.js:1.11 sitesmanager.js:1.10

Stephan Richter srichter@cbu.edu
Sat, 22 Mar 2003 21:20:36 -0500


Update of /cvs-repository/Packages/Moztop/moztop/content/lib
In directory cvs.zope.org:/tmp/cvs-serv2432/moztop/content/lib

Modified Files:
	datasourcemanager.js sitesmanager.js 
Log Message:
Darn, I just found a *huge* bug (typo) in getDataSource. This fixed some 
other things, so that I was able to simplify some code.


=== Packages/Moztop/moztop/content/lib/datasourcemanager.js 1.10 => 1.11 ===
--- Packages/Moztop/moztop/content/lib/datasourcemanager.js:1.10	Sat Mar 22 20:33:58 2003
+++ Packages/Moztop/moztop/content/lib/datasourcemanager.js	Sat Mar 22 21:20:36 2003
@@ -127,7 +127,7 @@
     source = sources.getNext();
     while (sources.hasMoreElements()) {
 	source = sources.getNext();
-	if (source.uri == rdfurl) {
+	if (source.URI == rdfurl) {
 	    var ds = new RDFDataSource();
 	    ds.Init(source);
 	    return ds;


=== Packages/Moztop/moztop/content/lib/sitesmanager.js 1.9 => 1.10 ===
--- Packages/Moztop/moztop/content/lib/sitesmanager.js:1.9	Sat Mar 22 20:33:58 2003
+++ Packages/Moztop/moztop/content/lib/sitesmanager.js	Sat Mar 22 21:20:36 2003
@@ -83,34 +83,24 @@
     /* Called during startup to find needed sites, fetch RDF, and build
      tree */
     // Get the sites resource from the data source
-    sitesds = this.addDataSource(this.sitesurl);
+    sitesds = this.addDataSource(this.sitesurl, true);
     var sites_node = sitesds.getNode(this.sitesurn).getTarget(
 	this.subitemsprop);
     var sites = sites_node.getChildren();
 
     while (sites.hasMoreElements()) {
 	site = sites.getNext();
-	this.loadSite(site.getValue(), sitesds);
+	this.loadSite(site.getValue());
     }
     return true;
 }
 
 
-SitesManager.prototype.loadSite = function(rsdurl, sitesds) {
-    /* Load a site by grabbing its contents and types. 
-
-       Why do we allow an optional sitesds to be passed?
-       Rememeber async? During initialization we are not ensured that the
-       sites RDF data was already added to the tree, therefore we might
-       not be able to get to it using getDataSource(). Passing it explicitly
-       solves the problem during initialization.
-    */
+SitesManager.prototype.loadSite = function(rsdurl) {
+    /* Load a site by grabbing its contents and types. */
 
     // Allowing the Sites Manager namespace to be present in loadThisSite()
     sm = this;
-
-    if (!sitesds)
-	sitesds = sm.getDataSource(sm.sitesurl);
 
     function loadThisSite(error) {
 	if (request.statusText) {