I'm creating an nsIRDFInferDataSource object as per the recommendation of Axel Hecht (see http://xrl.us/ei89 for the discussion) over on the XPFE mailing list. This was an awesome recommendation because my application is much cleaner as a result. However, I'm having some problems implementing the nsIRDFDataSource interface that I was hoping to get some help on.
I'm using my datasource to drive XUL templates (not in threads this time), and while it works to a point, I have some strange issues I'm unable to debug.
Basically, I create one instance of my datasource for each other RDF datasource I inspect. This I then add to the composite datasource bound to a XUL template, and then rebuild the tree. I can see from my debugging code that the XUL template requests all the appropriate statements from my datasource. However, when I add a second datasource to the composite, the XUL template only queries up to a point the required statements.
XUL code: http://xrl.us/ei9d JavaScript for the interface: http://xrl.us/ei9e JavaScript for the RDF datasource: http://xrl.us/ei9f Log of the debugging output: http://xrl.us/ei9g Screenshot showing the problem: http://xrl.us/ei9h
The problem is really exhibited near the very end of the log output. In the test, I load the first file (file:///home/nachbaur/foaf.rdf). This loads successfully. Then I load the second file (in this instance, file:///home/nachbaur/projects/scampclient/install.rdf). The XUL template processes the necessary statements, but when it gets to the point where it calls GetTarget on the "Watch", "StatementCount" and "DataSourceType" predicates, it queries against the first datasource in the composite (the foaf.rdf object) and not the second.
Does anyone have any ideas as to why this might be? I suppose I'm implementing my GetTarget method incorrectly, but I don't know what is wrong. I apologize in advance for the verbosity of the above URLs...if anyone would like clarification on anything, please let me know.
This stuff is designed to have one infer datasource working on the composite datasource, triggered by a infer="rdfinspector".
Now, what I think you're doing is giving each of your DSs in the composite ds its own infer DS, and of course, it will ask the first for a target from the template builder and bail there somewhere. Not really sure how to solve this, but this is still an xpfe question to me, and not a xpcom one.
Try a little more digging, I'm out for food.
Axel _______________________________________________ Mozilla-xpcom mailing list [email protected] http://mail.mozilla.org/listinfo/mozilla-xpcom
