List Info

Thread: Node.get(Input|Output)Stream... why?




Node.get(Input|Output)Stream... why?
user name
2006-05-24 21:27:35
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-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

Node.get(Input|Output)Stream... why?
user name
2006-05-24 21:33:35
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/r
epos/public/yarep/trunk/src/examples/java/org/wyona/yarep/ex
amples

> 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-unsubscribelenya.apache.org
> For additional commands, e-mail: dev-helplenya.apache.org
>
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache
Lenya
http://www.wyona.com     
                http://lenya.apache.org
michael.wechnerwyona.com                        michiapache.org
+41 44 272 91 61


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

Node.get(Input|Output)Stream... why?
user name
2006-05-26 07:24:19
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/r
epos/public/yarep/trunk/src/examples/java/org/wyona/yarep/ex
amples 
> 
> 
>> 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.hartmannwyona.com                     andreasapache.org


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribelenya.apache.org
For additional commands, e-mail: dev-helplenya.apache.org

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )