forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: Paginating Content
Date Thu, 06 Jun 2002 20:07:34 GMT
Piroumian Konstantin wrote:
> 
> Thanks for a very good explanation and the RT. You've sounded some of my
> doubts and added some more to think about.

Cool.

> To summarize the RT: the paginator is rather flexible, but it's not very
> well suited for documentation pagination. We have a few good options for
> documentation pagination and they are not yet implemented. Right?

Correct. I used the paginator for an image gallery and that was it. I
tried to make it more useful and flexible but it needs real life tests
on other use cases to really become one.

> The options are:
>         - use only top-level sections for pagination - already implemented,
> but not very useful for docs

Might be a first step worth trying, at least to show off pagination
capabilities.

>         - count sections/paragraphs - a little more advanced version of the
> first one

Yes, but it might become very tricky.

>         - count chars in some intellectual way - the best way, but not
> implemented, have some algorythmical issues and can require some additional
> analysis on word/sentence level, e.g. do not break a word on pagination,
> etc.

No, that's easy stuff. The problem is the fact that the paginator must
be able to distringuish between 'block-level' elements and
'inline-level' elements, for example, chunking at <p> and not at <em>
 
> The last two options require also to 're-well-form' the resulting XML, which
> can be also non trivial.

Yes, but please understand that even counting elements requires
re-well-forming, part of which is already implemented (even if I think
it's somewhat buggy and needs rethinking)

> Another thing that seems a little limiting to me (or maybe I read not very
> careful?) is the pagination rules are static. I can imagin a situation when
> we will need to use set some pagination params dynamically, e.g. the item
> count. Did I miss it or it's not there?

No it's not there and I strongly believe there is no need for this, at
least, not directly at the pagination level. Please, consider the
parallel with a stylesheet: you don't need a 'dynamic stylesheet', but
you could associate the src="" attribute with a Cocoon Source and have
it served as the result of a subpipeline. 
 
> Are there any solutions, ideas? We could use a Serializer - it's the only
> component that can output non-well-formed XML - but in that case we will
> end-up with a none well formed HTML.
> 
> So, my opinion on pagination is this: we need to count chars/words, break
> the page and re-well-form the result. Maybe something like a reverse
> Recorder (it can record SAX events and then can fire their end events when
> called) can be used to implement 're-well-form' feature?

The simplest way (and the most inefficient) would be to transform a
DOM/JDOM into another one and spit SAX events crawling it. But would
like it.

The best idea is to use an optimized storage mechanism for SAX events.
It's already implemented somewhat, you might want to take a look at the
code.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



Mime
View raw message