Re: Datasource notifications via nsIRDFXMLParser
Axel Hecht <[email protected]> Mon, 30 May 2005 09:31:49 +0200
| Newsgroups | gmane.comp.mozilla.devel.rdf |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Neil Stansbury wrote: > I am loading remote rdf into an In-Mem-DS with the > nsIRDFXMLParser.parseAsync() method where I pass the returned > nsIStreamListener into an nsIHttpChannel.asyncOpen() method: > > var nsIStreamListener = nsIRDFXMLParser.parseAsync( Ds, baseUri ); > > [...] > nsIHttpChannel.requestMethod = "GET"; > nsIHttpChannel.notificationCallbacks = nsIRequestor; > nsIHttpChannel.asyncOpen( nsIStreamListener, null ); > > My nsIProgressEventSink methods on the channel gets called fine, but I > need to get some form of "onEndLoad()" notification when the data has > been retrieved and parsed by the Ds. The only way I can see is by > wrapping the nsIStreamListener and forwarding the calls - but there must > be a better way?? No, this would be on nsIRDFXMLSink, which is only implemented by the rdf/xml datasource. Yes, parsing story is on my bug list. > I can't use a composite-ds's GetDataSource() (and thus sinkObserver) as > the request Uri has arguments encoded in it, and so generates a new ds > for each request. You only need the query hack for RDF datasources you get thru the RDFService. If you load by hand into an in-memory-datasource, you don't need that at all, as it doesn't RegisterDataSource. Axel