You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by gr...@cox.net on 2007/02/08 15:08:56 UTC

Stop PDF Summary...

How do I turn off the summary that's being created above my table of contents in each of the page-level PDFs?  It appears to be generated by the PDF Outline XSLT in common skins (src\documentation\skins\common\xslt\fo\pdfoutline.xsl), but I'm not positive.  

I've been away from Forrest for a while and some other people have been maintaining the site; somewhere over the last year this summary started to generate, but I have no idea what they did to turn it on.

Thanks,
Greg

Re: Stop PDF Summary...

Posted by Thorsten Scherler <th...@apache.org>.
On Fri, 2007-02-09 at 20:44 +0000, Ross Gardler wrote:
> greg.vaco@cox.net wrote:
> > How do I turn off the summary that's being created above my table of contents in each of the page-level PDFs?  It appears to be generated by the PDF Outline XSLT in common skins (src\documentation\skins\common\xslt\fo\pdfoutline.xsl), but I'm not positive.  
> 
> You are correct in that pdfoutline.xsl generates the outline. This is 
> called from the root document-2-fo.xsl.
> 
> Currently there is no configuration option for removing this outline. 
> Adding one in is an easy job, just look at the way skinconf.xml values 
> are used elsewhere in document-2-fo.xsl. Of course, you could create 
> your own skin and provide your own XSL that does not call the outline. 
> But providing a patch to make it configurable would be well recieved here.
> 

In the dispatcher there are a couple of fo contract that you can edit.
This allows you to have different pdf outlines for your project on a
structurer base.

https://svn.apache.org/repos/asf/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/fo/

...but the dispatcher still is in the whiteboard so we do not yet
recommend the usage in production. However I am using it in a couple
projects with great success.

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java & XML                consulting, training and solutions


Re: Stop PDF Summary...

Posted by Ross Gardler <rg...@apache.org>.
On 19/06/07, David Crossley <cr...@apache.org> wrote:
> Yes we do have a default skinconf. The "skinconf.xml" Cocoon pipeline
> adds default values for all parameters. See main/webapp/sitemap.xmap
> and for example skins/pelt/skinconf.xsl
>
> For new parameters in the past, we have added them as optional
> to the skinconf DTD and give it a new version number and doctype
> Public Identifier. And new examples to main/fresh-site/

Ahhh..

Thanks for the heads up.

Ross

Re: Stop PDF Summary...

Posted by David Crossley <cr...@apache.org>.
Ross Gardler wrote:
> Patrick Ohly wrote:
> >Ross Gardler wrote:
> >>
> >> With respect to your question, if disable-toc is not present in the
> >> skinconf.xml file is it not set and so your test against it will
> >> always resolve to true:
> >>
> >> <xsl:if test="$disable-toc != 'true' and $toc-max-depth > 0">
> >
> >If that expression was true for an unset disable-toc, I would get the
> >TOC as desired, but it seems to evaluate to false although
> >"$disable-toc" is not equal to 'true'.
> 
> Ah, yes, of course. Rushing with my replies again. One would expect
> the above to work if the node was empty.
> 
> >> The way around this is to add the disable-toc parameter to the default 
> >skinconf.
> >
> >I agree that this make sense, but I don't like to force users to update
> >their skinconf to preserve the behavior they are used to.
> 
> Quite right. Again I was rushing. We have an override mechanism for
> forrest.properties, but not for skinconf.xml. In other words we have a
> default.forrest.properties, but not a default.skinconf.xml.

Yes we do have a default skinconf. The "skinconf.xml" Cocoon pipeline
adds default values for all parameters. See main/webapp/sitemap.xmap
and for example skins/pelt/skinconf.xsl

For new parameters in the past, we have added them as optional
to the skinconf DTD and give it a new version number and doctype
Public Identifier. And new examples to main/fresh-site/

-David

> >I found that
> >by adding string() like this I get the desired behavior:
> >  <xsl:variable name="disable-toc" 
> >  select="string(//skinconfig/pdf/disable-toc)"/>
> 
> Good to know. Thanks.
> 
> Ross

Re: Stop PDF Summary...

Posted by Ross Gardler <rg...@apache.org>.
On 18/06/07, Patrick Ohly <Pa...@gmx.de> wrote:
> On Mon, 2007-06-18 at 09:09 +0100, Ross Gardler wrote:
> > Can you please submit patches via our issue tracker [1].
>
> Okay, see https://issues.apache.org/jira/browse/FOR-355#action_12505910

Great stuff, thanks. Now someone will certainly apply your
modification as soon as they have time.

> > With respect to your question, if disable-toc is not present in the
> > skinconf.xml file is it not set and so your test against it will
> > always resolve to true:
> >
> > <xsl:if test="$disable-toc != 'true' and $toc-max-depth > 0">
>
> If that expression was true for an unset disable-toc, I would get the
> TOC as desired, but it seems to evaluate to false although
> "$disable-toc" is not equal to 'true'.

Ah, yes, of course. Rushing with my replies again. One would expect
the above to work if the node was empty.


> > The way around this is to add the disable-toc parameter to the default skinconf.
>
> I agree that this make sense, but I don't like to force users to update
> their skinconf to preserve the behavior they are used to.

Quite right. Again I was rushing. We have an override mechanism for
forrest.properties, but not for skinconf.xml. In other words we have a
default.forrest.properties, but not a default.skinconf.xml.

> I found that
> by adding string() like this I get the desired behavior:
>   <xsl:variable name="disable-toc" select="string(//skinconfig/pdf/disable-toc)"/>

Good to know. Thanks.

Ross

Re: Stop PDF Summary...

Posted by Patrick Ohly <Pa...@gmx.de>.
On Mon, 2007-06-18 at 09:09 +0100, Ross Gardler wrote:
> Can you please submit patches via our issue tracker [1].

Okay, see https://issues.apache.org/jira/browse/FOR-355#action_12505910

> With respect to your question, if disable-toc is not present in the
> skinconf.xml file is it not set and so your test against it will
> always resolve to true:
> 
> <xsl:if test="$disable-toc != 'true' and $toc-max-depth > 0">

If that expression was true for an unset disable-toc, I would get the
TOC as desired, but it seems to evaluate to false although
"$disable-toc" is not equal to 'true'.

> The way around this is to add the disable-toc parameter to the default skinconf.

I agree that this make sense, but I don't like to force users to update
their skinconf to preserve the behavior they are used to. I found that
by adding string() like this I get the desired behavior:
  <xsl:variable name="disable-toc" select="string(//skinconfig/pdf/disable-toc)"/>
  
The patch in Jira has that change.

-- 
Bye, Patrick Ohly
--  
Patrick.Ohly@gmx.de
http://www.estamos.de/

Re: Stop PDF Summary...

Posted by Ross Gardler <rg...@apache.org>.
On 17/06/07, Patrick Ohly <pa...@gmx.de> wrote:
> On Fr, 2007-02-09 at 20:44 +0000, Ross Gardler wrote:
> > greg.vaco@cox.net wrote:
> > > How do I turn off the summary that's being created above my table of
> > > contents in each of the page-level PDFs?  It appears to be generated
> > > by the PDF Outline XSLT in common skins (src\documentation\skins
> > > \common\xslt\fo\pdfoutline.xsl), but I'm not positive.
> >
> > You are correct in that pdfoutline.xsl generates the outline. This is
> > called from the root document-2-fo.xsl.
> >
> > Currently there is no configuration option for removing this outline.
> > Adding one in is an easy job, just look at the way skinconf.xml values
> > are used elsewhere in document-2-fo.xsl. Of course, you could create
> > your own skin and provide your own XSL that does not call the outline.
> > But providing a patch to make it configurable would be well recieved here.
>
> I also wanted to turn off the TOC, so I patched the 0.8
> main/webapp/skins/common/xslt/fo/document-to-fo.xsl - see attachement. I
> don't know where "forrest seed" takes the skinconf.xml from, so I didn't
> patch anything related to that. Here's what I added to my project's
> skinconf.xml:
>     ...
>     <!--
>       Disable the generation of the table of content on the first page
>       of the PDF. By default the TOC is generated.
>     -->
>     <disable-toc>true</disable-toc>
>   </pdf>
>
> There's one problem with the patch: if <disable-toc> is not set in
> skinconf.xml, then the TOC is disabled nevertheless. I'm not sure why;
> what is the xsl:variable "disable-toc" set to in that case?
>
> If <disable-toc> is present, then it works as expected: only "true"
> disables the TOC, any other string generates the TOC.

Thank you very much for your contribution, this is how Forrest will
grow and survive, but it also means your upgrade path in the future
will be greatly simplified.

Can you please submit patches via our issue tracker [1]. You need to
be loggged in to create an issue (see top right of screen). Things
tend to get lost in the mailing list whereas in the issue tracker we
get nags to remind us to apply patches.

With respect to your question, if disable-toc is not present in the
skinconf.xml file is it not set and so your test against it will
always resolve to true:

<xsl:if test="$disable-toc != 'true' and $toc-max-depth > 0">

The way around this is to add the disable-toc parameter to the default skinconf.

Ross



[1] http://issues.apache.org/jira/browse/FOR

Re: Stop PDF Summary...

Posted by Brian M Dube <bd...@apache.org>.
Patrick Ohly wrote:
> On Fr, 2007-02-09 at 20:44 +0000, Ross Gardler wrote:

>> Currently there is no configuration option for removing this outline. 
>> Adding one in is an easy job, just look at the way skinconf.xml values 
>> are used elsewhere in document-2-fo.xsl. Of course, you could create 
>> your own skin and provide your own XSL that does not call the outline. 
>> But providing a patch to make it configurable would be well recieved here.
> 
> I also wanted to turn off the TOC, so I patched the 0.8
> main/webapp/skins/common/xslt/fo/document-to-fo.xsl - see attachement.

Thank you for the contribution. Patches are easier to track when they 
are applied to Jira issues [1]. Create new issues when necessary and 
please indicate grant of license.

Brian

[1]
http://forrest.apache.org/issues.html

Re: Stop PDF Summary...

Posted by Patrick Ohly <pa...@gmx.de>.
On Fr, 2007-02-09 at 20:44 +0000, Ross Gardler wrote:
> greg.vaco@cox.net wrote:
> > How do I turn off the summary that's being created above my table of
> > contents in each of the page-level PDFs?  It appears to be generated
> > by the PDF Outline XSLT in common skins (src\documentation\skins
> > \common\xslt\fo\pdfoutline.xsl), but I'm not positive.  
> 
> You are correct in that pdfoutline.xsl generates the outline. This is 
> called from the root document-2-fo.xsl.
> 
> Currently there is no configuration option for removing this outline. 
> Adding one in is an easy job, just look at the way skinconf.xml values 
> are used elsewhere in document-2-fo.xsl. Of course, you could create 
> your own skin and provide your own XSL that does not call the outline. 
> But providing a patch to make it configurable would be well recieved here.

I also wanted to turn off the TOC, so I patched the 0.8
main/webapp/skins/common/xslt/fo/document-to-fo.xsl - see attachement. I
don't know where "forrest seed" takes the skinconf.xml from, so I didn't
patch anything related to that. Here's what I added to my project's
skinconf.xml:
    ...
    <!--
      Disable the generation of the table of content on the first page
      of the PDF. By default the TOC is generated.
    -->
    <disable-toc>true</disable-toc>
  </pdf>

There's one problem with the patch: if <disable-toc> is not set in
skinconf.xml, then the TOC is disabled nevertheless. I'm not sure why;
what is the xsl:variable "disable-toc" set to in that case?

If <disable-toc> is present, then it works as expected: only "true"
disables the TOC, any other string generates the TOC.

-- 
Bye, Patrick Ohly
--  
Patrick.Ohly@gmx.de
http://www.estamos.de/

Re: Stop PDF Summary...

Posted by Ross Gardler <rg...@apache.org>.
greg.vaco@cox.net wrote:
> How do I turn off the summary that's being created above my table of contents in each of the page-level PDFs?  It appears to be generated by the PDF Outline XSLT in common skins (src\documentation\skins\common\xslt\fo\pdfoutline.xsl), but I'm not positive.  

You are correct in that pdfoutline.xsl generates the outline. This is 
called from the root document-2-fo.xsl.

Currently there is no configuration option for removing this outline. 
Adding one in is an easy job, just look at the way skinconf.xml values 
are used elsewhere in document-2-fo.xsl. Of course, you could create 
your own skin and provide your own XSL that does not call the outline. 
But providing a patch to make it configurable would be well recieved here.

Ross