You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Michael Ralston <mi...@ralston.id.au> on 2006/05/24 23:27:35 UTC
Node.get(Input|Output)Stream... why?
Andreas Hartmann wrote:
> You can implement a custom NodeFactory which returns custom Node objects.
> You don't even have to use sources but can implement arbitrary node
> classes, e.g. Node.getInputStream() and Node.getOutputStream() can
> use arbitrary files to store the content, depending on the source URI.
Why does a node have to use InputStream and OutputStream? I can
understand it is ideal for File IO, but if you were to implement a
different repository, would it be possible to create a RepositorySource
which returned XML documents directly to cocoon?
Michael R
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Node.get(Input|Output)Stream... why?
Posted by Andreas Hartmann <an...@apache.org>.
Michael Wechner wrote:
> Michael Ralston wrote:
>
>> Andreas Hartmann wrote:
>>
>>> You can implement a custom NodeFactory which returns custom Node
>>> objects.
>>> You don't even have to use sources but can implement arbitrary node
>>> classes, e.g. Node.getInputStream() and Node.getOutputStream() can
>>> use arbitrary files to store the content, depending on the source URI.
>>
>> Why does a node have to use InputStream and OutputStream? I can
>> understand it is ideal for File IO,
>
>
> well, I think Input/OutputStream is very generic and doesn't imply that
> the data
> needs to come from the FS.
I agree. On the level of the repository API, the framework shouldn't care
if it handles XML data or binary data. There were some discussions which
showed that the general opinion is that all kinds of data should be treated
in the same way.
> Also see
>
> https://svn.wyona.com/repos/public/yarep/trunk/src/examples/java/org/wyona/yarep/examples
>
>
>> but if you were to implement a different repository, would it be
>> possible to create a RepositorySource which returned XML documents
>> directly to cocoon?
>
>
> a utility class/method would certainly be handy
You can use for instance
DocumentHelper.readDocument(InputStream)
DocumentHelper.writeDocument(Document, OutputStream)
-- Andreas
--
Andreas Hartmann
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
andreas.hartmann@wyona.com andreas@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: Node.get(Input|Output)Stream... why?
Posted by Michael Wechner <mi...@wyona.com>.
Michael Ralston wrote:
> Andreas Hartmann wrote:
>
>> You can implement a custom NodeFactory which returns custom Node
>> objects.
>> You don't even have to use sources but can implement arbitrary node
>> classes, e.g. Node.getInputStream() and Node.getOutputStream() can
>> use arbitrary files to store the content, depending on the source URI.
>
> Why does a node have to use InputStream and OutputStream? I can
> understand it is ideal for File IO,
well, I think Input/OutputStream is very generic and doesn't imply that
the data
needs to come from the FS. Also see
https://svn.wyona.com/repos/public/yarep/trunk/src/examples/java/org/wyona/yarep/examples
> but if you were to implement a different repository, would it be
> possible to create a RepositorySource which returned XML documents
> directly to cocoon?
a utility class/method would certainly be handy
Michi
>
> Michael R
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
>
>
--
Michael Wechner
Wyona - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
michael.wechner@wyona.com michi@apache.org
+41 44 272 91 61
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org