You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Rasik Pandey <rb...@gmail.com> on 2005/06/24 00:56:17 UTC

pagination in forrest 0.7

Hello,

I was wondering if there is a way to automatically split a "document"
into multiple pages based upon the number of "section"s in a
"document" and have this reflected in the menu, or better yet have a
page navigation header+footer around the body content.




Thanks,
Rus

Re: pagination in forrest 0.7

Posted by David Crossley <cr...@apache.org>.
Rasik Pandey wrote:
> 
> Thanks for that link. I have actually seen it before in my previous
> work with Cocoon, but have never actually used it. I plan on trying to
> get it integrated into my forrest environment early next week.
> 
> I guess this question is better for the forrest-dev list, but if you
> guys think this kind of functionality is interesting for larger use
> can you give me a overview of the process need to implement such a
> feature? I assume I would need to:
> 
> 1) have a new element or edit an existing element in the skinconf.xml
> file (+a schema change) to parameterize the behavior
> 2) editing a sitemap or plugging in a new paging.xmap into the forrest
> sitemap.xmap or one of its sub-sitemaps
> 3) edit the build.xml and properties to get this done and for testing
> the functionality?
> etc.

What is step 3? You should not need to touch the core of Forrest. 
This can probably be done in your project sitemap or perhaps as
a plugin.

-David

Re: pagination in forrest 0.7

Posted by Ross Gardler <rg...@apache.org>.
Rasik Pandey wrote:
> I guess this question is better for the forrest-dev list, but if you
> guys think this kind of functionality is interesting for larger use
> can you give me a overview of the process need to implement such a
> feature? I assume I would need to:
> 
> 1) have a new element or edit an existing element in the skinconf.xml
> file (+a schema change) to parameterize the behavior
> 2) editing a sitemap or plugging in a new paging.xmap into the forrest
> sitemap.xmap or one of its sub-sitemaps
> 3) edit the build.xml and properties to get this done and for testing
> the functionality?
> etc.

One of the very early versions of Forrest had pagination enabled, 
somehow, it was later turned off because of problems. I can'r remember 
exactly how it was implemented or why it was turned off.

A detailed search of the archives may turn somehitng up. My quick search 
unearthed this thread [1] which seems to discuss how to use the 
paginator in Forrest.

Don't be put off by the fact the first mail starts with the tutorial now 
in Cocoon docs, there is some forrest specific stuff at the end. Also, 
bear in mind this is three years ago now so positions of files may well 
have changed, the paginator may have been enhanced, even the function of 
files may have changed. We can help you get up to date on the dev list.

[1] http://marc.theaimsgroup.com/?t=102336939500003&r=1&w=

Ross

Re: pagination in forrest 0.7

Posted by Rasik Pandey <rb...@gmail.com>.
Hi David,

Thanks for that link. I have actually seen it before in my previous
work with Cocoon, but have never actually used it. I plan on trying to
get it integrated into my forrest environment early next week.

I guess this question is better for the forrest-dev list, but if you
guys think this kind of functionality is interesting for larger use
can you give me a overview of the process need to implement such a
feature? I assume I would need to:

1) have a new element or edit an existing element in the skinconf.xml
file (+a schema change) to parameterize the behavior
2) editing a sitemap or plugging in a new paging.xmap into the forrest
sitemap.xmap or one of its sub-sitemaps
3) edit the build.xml and properties to get this done and for testing
the functionality?
etc.

Regards,
Rus





On 6/23/05, David Crossley <cr...@apache.org> wrote:
> Rasik Pandey wrote:
> > Ross wrote:
> >
> > > If you mean having one document create x separate pages in the web site
> > > then you will need to create a custom skin and do your pagination in there.
> >
> > Yes that is what i was aiming to express.
> 
> Not sure if this will meet sure needs, but worth a try ...
> 
> Cocoon has a Paginator Transformer:
> http://cocoon.apache.org/2.1/howto/howto-paginator-transformer.html
> 
> Add that to your project sitemap.
> 
> -David
>

Re: pagination in forrest 0.7

Posted by David Crossley <cr...@apache.org>.
Rasik Pandey wrote:
> Ross wrote:
> 
> > If you mean having one document create x separate pages in the web site
> > then you will need to create a custom skin and do your pagination in there.
> 
> Yes that is what i was aiming to express.

Not sure if this will meet sure needs, but worth a try ...

Cocoon has a Paginator Transformer:
http://cocoon.apache.org/2.1/howto/howto-paginator-transformer.html

Add that to your project sitemap.

-David

Re: pagination in forrest 0.7

Posted by Rasik Pandey <rb...@gmail.com>.
Hi Ross,

> If you mean having one document create x separate pages in the web site
> then you will need to create a custom skin and do your pagination in there.

Yes that is what i was aiming to express.

> With respect to your "page navigation header+footer around the body
> content" do you mean a table of contents? See
> http://forrest.apache.org/docs_0_70/your-project.html for an example?

I am not sure if it is feasible or desirable for general forrest
usage, but basically I want to be able to, in skinconf.xml, do
something like:


<toc location="page" max-depth="1" min-sections="10"
max-sections="20"  page-navigation-location="menu | bodyHeaderFooter"/>

In this scenarios, if a document has more than 20 sections, let's say
60, then three html pages (with 20 toc entries) would be generated
with links to the other pages in the menu or in a body subHeader and
subFooter in a structure like:


-pageHeader
-menu4CurrentTab
-pageNavigationBodyHeader - PAGE 1 --> page 2 --> page 3
(upper-case=current page)
-TOC (20 items)
-Sections(20 items)
-pageNavigationBodyFooter - PAGE 1 --> page 2 --> page 3
-pageFooter

I would be glad to customize a skin or skins and contribute this work
if you find that it sounds useful to the larger community, but I would
need a little direction from you and maybe the other developers about
where and how to add such functionality.

Regards,
Rus

Re: pagination in forrest 0.7

Posted by Ross Gardler <rg...@apache.org>.
Rasik Pandey wrote:
> Hello,
> 
> I was wondering if there is a way to automatically split a "document"
> into multiple pages based upon the number of "section"s in a
> "document" and have this reflected in the menu, or better yet have a
> page navigation header+footer around the body content.

I'm not entirley sure what you mean, do you mean. There is no concept of 
pages (as in page 1, 2 and 3) in HTML documents. There is a page break 
feature in 0.7 that allows page breaks to be inserted into PDF 
documents, these can also be used in HTML documents, but again this only 
  makes sense if you are printing.

See http://forrest.apache.org/docs_0_70/faq.html#pageBreaks

If you mean having one document create x separate pages in the web site 
then you will need to create a custom skin and do your pagination in there.

With respect to your "page navigation header+footer around the body 
content" do you mean a table of contents? See 
http://forrest.apache.org/docs_0_70/your-project.html for an example?

Forrest can generate a TOC to any depth of headings and can be placed at 
the top of a document as in the above example or in the menu on the 
left. See skinconf.xml for how to configure the TOC.

By customising the skin you could make it appear elsewhere (like in the 
footer as well).


Ross