How to determine that element belongs to data source?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to determine that element belongs to data source?

Alexander Dyagilev
The code below works fine.

However, observer is called not only for global history elements,
displayed in Ctrl+H, but for some other elements.

So the problem is to determine that element belongs to
"NC:HistoryRoot" data store.

QUESTION: How to do this?


var histListener = {
 onAssert: function (dataSource, source, property, target) {
           //
           // HERE WE WILL GET NEW ELEMENTS FOR GLOBAL HISTORY
           //
 },
 QueryInterface: function (aIID) {
   if (!aIID.equals (Components.interfaces.nsISupports) && !aIID.equals (Components.interfaces.nsIRDFObserver))
      throw Components.result.NS_ERROR_NO_INTERFACE;
   return this;
 }
};

function ListenHistory() {
   // dsHistory is "rdf:history".
   dsHistory.AddObserver (histListener);
}

_______________________________________________
dev-tech-rdf mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-rdf