[Zope-CVS] CVS: Packages/Moztop/moztop/content - moztop.js:1.4

Paul Everitt paul@zope.com
Tue, 14 Jan 2003 12:09:36 -0500


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

Modified Files:
	moztop.js 
Log Message:
Since RDF won't ask for login, put in an XmlHttpRequest ping 
first.  Also, put button on toolbar to start "add folder".


=== Packages/Moztop/moztop/content/moztop.js 1.3 => 1.4 ===
--- Packages/Moztop/moztop/content/moztop.js:1.3	Mon Jan 13 21:43:44 2003
+++ Packages/Moztop/moztop/content/moztop.js	Tue Jan 14 12:09:03 2003
@@ -3,7 +3,7 @@
   .classes["@mozilla.org/rdf/rdf-service;1"]
   .getService(Components.interfaces.nsIRDFService);
 
-var contentsURL = "http://localhost:8080/@@contents.rdf"
+var contentsURL = "http://192.168.1.3:9080/@@contents.rdf"
 
 function startProgram() {
   initTaskList();
@@ -28,8 +28,21 @@
           'For more information see http://www.zope.org/')
 }
 
+function loginZopeServer (url) {
+  // This is a bogus function to initiate a request to the Zope 3 
+	// server, for no reason other than to generate a login dialog.  RDF 
+	// doesn't seem to do the right thing here.
+	
+	var p = new XMLHttpRequest();
+  p.open("GET", url, false);
+  p.send(null);
+	return;
+}
+
 /* Initialize the Explorer datasource */
 function initExplorer() {
+
+  loginZopeServer(contentsURL);  // Need to authenticate, bleh
   var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"]
                   .getService(Components.interfaces.nsIRDFService);
   var ds = rdf.GetDataSource(contentsURL);
@@ -50,6 +63,5 @@
     ds = ds.QueryInterface(
 	      Components.interfaces.nsIRDFRemoteDataSource);
     ds.Refresh(false);
-    alert('Updated!');
     tree.builder.rebuild();
 }