You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Colin Paul Adams <co...@colina.demon.co.uk> on 2004/07/14 13:28:47 UTC
Accessing Berkeley DB XML documents
I wish to access an XML document stored within Berkeley DB XML (bdbxml).
The java interface to dbdxml ultimately returns a document as a
byte[], containing the text of the XML document, although the
interface is quite complicated, and is not at all SQL-like.
I am trying to work out the best way of approaching this.
One idea that occures to me is to use the ordinary file generator,
along with a SourceResolver to resolve URIs beginning with bdbxml:.
Does this sound like a sensible approach, and if so, how do I tell the
file generator to use the custom SourceResolver?
--
Colin Paul Adams
Preston Lancashire
Re: Accessing Berkeley DB XML documents
Posted by Colin Paul Adams <co...@colina.demon.co.uk>.
>>>>> "Vadim" == Vadim Gritsenko <va...@reverycodes.com> writes:
>> and if so, how do I tell the file generator to use the custom
>> SourceResolver?
>>
Vadim> Why do you need "custom SourceResolver"??? Just use the
Vadim> regular one. See any of other source implementations as an
Vadim> example.
Please point me to an example, as I have no idea what to look for.
--
Colin Paul Adams
Preston Lancashire
Re: Accessing Berkeley DB XML documents
Posted by Colin Paul Adams <co...@colina.demon.co.uk>.
>>>>> "Martin" == Martin Holz <ho...@fiz-chemie.de> writes:
Vadim> Why do you need "custom SourceResolver"??? Just use the
Vadim> regular one. See any of other source implementations as an
Vadim> example.
>> I've been looking at XMLDBSource and XMLDBSourceFactory.
>>
>> I guess there must be some way that cocoon knows to associate
>> the xmldb scheme with these, but I can't figure out what it is.
>> Nor what a SourceFactory is for.
Martin> Yes, look into cocoon.xconf. There is a section
Martin> "source-factories", which associates protocols with
Martin> SourceFactories. Whenever a source of certain type is
Martin> required, the coresponding's SourceFactory method
Martin> getSource() is called by the SourceResolver.
Thanks. it all makes sense now.
--
Colin Paul Adams
Preston Lancashire
Re: Accessing Berkeley DB XML documents
Posted by Martin Holz <ho...@fiz-chemie.de>.
Colin Paul Adams <co...@colina.demon.co.uk> writes:
> >>>>> "Vadim" == Vadim Gritsenko <va...@reverycodes.com> writes:
>
> >> and if so, how do I tell the file generator to use the custom
> >> SourceResolver?
> >>
>
> Vadim> Why do you need "custom SourceResolver"??? Just use the
> Vadim> regular one. See any of other source implementations as an
> Vadim> example.
>
> I've been looking at XMLDBSource and XMLDBSourceFactory.
>
> I guess there must be some way that cocoon knows to associate the
> xmldb scheme with these, but I can't figure out what it is.
> Nor what a SourceFactory is for.
Yes, look into cocoon.xconf. There is a section
"source-factories", which associates protocols with
SourceFactories. Whenever a source of certain
type is required, the coresponding's SourceFactory
method getSource() is called by the SourceResolver.
Martin
Re: Accessing Berkeley DB XML documents
Posted by Colin Paul Adams <co...@colina.demon.co.uk>.
>>>>> "Vadim" == Vadim Gritsenko <va...@reverycodes.com> writes:
>> and if so, how do I tell the file generator to use the custom
>> SourceResolver?
>>
Vadim> Why do you need "custom SourceResolver"??? Just use the
Vadim> regular one. See any of other source implementations as an
Vadim> example.
I've been looking at XMLDBSource and XMLDBSourceFactory.
I guess there must be some way that cocoon knows to associate the
xmldb scheme with these, but I can't figure out what it is.
Nor what a SourceFactory is for.
--
Colin Paul Adams
Preston Lancashire
Re: Accessing Berkeley DB XML documents
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Colin Paul Adams wrote:
>I wish to access an XML document stored within Berkeley DB XML (bdbxml).
>The java interface to dbdxml ultimately returns a document as a
>byte[], containing the text of the XML document, although the
>interface is quite complicated, and is not at all SQL-like.
>
>I am trying to work out the best way of approaching this.
>One idea that occures to me is to use the ordinary file generator,
>along with a SourceResolver to resolve URIs beginning with bdbxml:.
>
>Does this sound like a sensible approach,
>
Yes
> and if so, how do I tell the
>file generator to use the custom SourceResolver?
>
>
Why do you need "custom SourceResolver"??? Just use the regular one. See
any of other source implementations as an example.
Vadim