[Jslib] RDF refresh addition

Chuck Musser chuckie at well.com
Mon Dec 1 18:56:03 EST 2003

This patch to rdf.js allows users to call the 
nsIRDFRemoteDataSource.Refresh method from Javascript. I needed it 
because my application modifies a file-based datasource used to build a 
template-based XUL menu. Without a "refresh", the menu doesn't get updated.

The patch is crude--it's basically a cut and paste of the existing 
"flush" method, but it works for me. Someone who knows more about RDF 
might want to audit the new method and add appropriate error checking.

In the rdf subdirectory, do a "patch < rdfrefresh.patch"

-------------- next part --------------
--- rdf.js.orig	Mon Dec  1 18:28:42 2003
+++ rdf.js	Mon Dec  1 18:34:50 2003
@@ -303,6 +303,13 @@
+RDF.prototype.refresh = function(aBlocking)
+  if(this.isValid()) {
+    this.dsource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource).Refresh(aBlocking);
+  }
 jslibDebug('*** load: '+JS_RDF_FILE+' OK');

More information about the Jslib mailing list