You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2007/04/02 10:35:07 UTC
Re: DocumentManagerImpl assumes ByteStream content
Hi Michael,
Michael Ralston schrieb:
[...]
> I've got it working to the point that "Import example pages" works,
> but publishing a page to the live area does not. I've come across a
> problem with the DocumentManagerImpl which I think is caused by it
> assuming that all content is a Byte Stream.
>
> copy(SourceResolver resolver, InputStream sourceInputStream, Document
> destination)
> copyContent(Document sourceDocument, Document destinationDocument)
You could probably extend the DocumentManagerImpl and override
these methods.
> These two methods both use ByteArrayOutputStream to copy the contents
> of documents. My implementation based on a lenya snapshot from 6
> months ago, used Object.clone() to copy the content of a page, and
> then left it up to the implementation of that content to decide how to
> best clone its data. What do you think of this approach?
What would be the benefits in comparison with streams?
I guess you need the input and output streams anyway, or am I
missing something?
> Once again, I'd like to contribute my code as soon as possible. Should
> I wait until after the 1.4 release candidate? Or would it be
> appropriate to include it in modules-optional?
I think both options are OK.
Thanks for sharing your code and ideas!
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: DocumentManagerImpl assumes ByteStream content
Posted by Jörn Nettingsmeier <ne...@apache.org>.
Andreas Hartmann wrote:
> Hi Michael,
>
> Michael Ralston schrieb:
>> Once again, I'd like to contribute my code as soon as possible. Should
>> I wait until after the 1.4 release candidate? Or would it be
>> appropriate to include it in modules-optional?
>
> I think both options are OK.
imo modules-optional should not be subject to the pre-rc code freeze
anyways, and i'd very much like to see that code :)
just my .02 €
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: DocumentManagerImpl assumes ByteStream content
Posted by Andreas Hartmann <an...@apache.org>.
Michael Ralston schrieb:
> On 4/2/07, Andreas Hartmann <an...@apache.org> wrote:
>> > These two methods both use ByteArrayOutputStream to copy the contents
>> > of documents. My implementation based on a lenya snapshot from 6
>> > months ago, used Object.clone() to copy the content of a page, and
>> > then left it up to the implementation of that content to decide how to
>> > best clone its data. What do you think of this approach?
>>
>> What would be the benefits in comparison with streams?
>> I guess you need the input and output streams anyway, or am I
>> missing something?
>>
>
> My content implementation has a relational nature. My content does not
> have a getOutputStream method, as it is manipulated by a content
> specific interface (eg, setName, setDescription etc). My content does
> have a getInputStream method for generating content. I build my
> content procedurally as a org.w3c.dom.Document and then translate that
> into an inputStream.
Would it be very difficult to implement getOutputStream(), converting
the stream to a DOM and parsing this to get the relational data?
>From the performance POV this is certainly not a good idea, but IMO
we have to find a least common denominator for all repo implementations.
You can still provide your own DocumentManager if this isn't sufficient.
What do the others think?
-- Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: DocumentManagerImpl assumes ByteStream content
Posted by Michael Ralston <mi...@kcms.com.au>.
On 4/2/07, Andreas Hartmann <an...@apache.org> wrote:
> > These two methods both use ByteArrayOutputStream to copy the contents
> > of documents. My implementation based on a lenya snapshot from 6
> > months ago, used Object.clone() to copy the content of a page, and
> > then left it up to the implementation of that content to decide how to
> > best clone its data. What do you think of this approach?
>
> What would be the benefits in comparison with streams?
> I guess you need the input and output streams anyway, or am I
> missing something?
>
My content implementation has a relational nature. My content does not
have a getOutputStream method, as it is manipulated by a content
specific interface (eg, setName, setDescription etc). My content does
have a getInputStream method for generating content. I build my
content procedurally as a org.w3c.dom.Document and then translate that
into an inputStream.
Michael Ralston
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org