|
|
Subject: Re: Excluding files? - msg#00025
List: text.xml.forrest.user
Ross Gardler wrote:
Cameron McCormack wrote:
David Crossley:
Yes. See some examples in forrest/site-author/conf/cli.xconf
Not an "error". Doing 'forrest site' follows every link that it finds.
The Cocoon CLI (Command Line Interface) config enables the
powerful exclusion mechanism.
Ok. Is there a way to configure it so that if it follows a link it
doesnât know how to generate, but that file is in the content directory,
that it doesnât consider it an error?
I've done this on a few sites. There are three approaches (that I can
think of):
In the first, you provide a pipeline at the end of all other pipelines
that generates a "File not found" type XDoc. This pipeline will be the
final one processed and so will ensure a document is always returned. We
don't have one in the default distribution as this will hide build
errors that are really build errors, but it has the advantage of
covering all possible requests that are not matched by other pipelines.
Note that this first approach requires you to modify Forrests core
sitemaps and thus you will need to be careful when upgrading.
The second approach is to create a dummy file for each unmapped request.
This dummy file will say something like "This will be a dynamically
generated page in the live system". This works well, but requires you to
manage each page individually, however it requires no changes to the
core sitemaps. Note that you may need to add a pipeline to match special
request patterns that Forrest does not normally match (e.g. "*.cgi").
The final approach is a half way between the first two. Create a set of
pipelines in your project to match the requests affected by your issue.
these will need to be narrow enough to trap all known pages but allow
all others to pass through. The downside of this is that it can be
difficult to identify a suitable pattern (or set of patterns), I'd
recommend using the RE matcher for this unless you only have one or two
pages affected by this.
One important clarification is that when deploying the site you need to
ensure that the hosting environment does not serve the page Forrest
generates but serves the one intended, i.e. a CGI script.
Thorstens overlapping mail showed how to do the third approach I
describe. However, in his case he was providing the source documents, I
guess this is what you intended for the "*.java" request but not for the
"*.cgi". then again, my guess could have been wrong.
Ross
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: Excluding files?
Cameron McCormack wrote:
David Crossley:
Yes. See some examples in forrest/site-author/conf/cli.xconf
Not an "error". Doing 'forrest site' follows every link that it finds.
The Cocoon CLI (Command Line Interface) config enables the
powerful exclusion mechanism.
Ok. Is there a way to configure it so that if it follows a link it
doesnât know how to generate, but that file is in the content directory,
that it doesnât consider it an error?
I've done this on a few sites. There are three approaches (that I can
think of):
In the first, you provide a pipeline at the end of all other pipelines
that generates a "File not found" type XDoc. This pipeline will be the
final one processed and so will ensure a document is always returned. We
don't have one in the default distribution as this will hide build
errors that are really build errors, but it has the advantage of
covering all possible requests that are not matched by other pipelines.
Note that this first approach requires you to modify Forrests core
sitemaps and thus you will need to be careful when upgrading.
The second approach is to create a dummy file for each unmapped request.
This dummy file will say something like "This will be a dynamically
generated page in the live system". This works well, but requires you to
manage each page individually, however it requires no changes to the
core sitemaps. Note that you may need to add a pipeline to match special
request patterns that Forrest does not normally match (e.g. "*.cgi").
The final approach is a half way between the first two. Create a set of
pipelines in your project to match the requests affected by your issue.
these will need to be narrow enough to trap all known pages but allow
all others to pass through. The downside of this is that it can be
difficult to identify a suitable pattern (or set of patterns), I'd
recommend using the RE matcher for this unless you only have one or two
pages affected by this.
Ross
Next Message by Date:
click to view message preview
RE: SVG images not displayed in PDFs using Forrest version 0.8
Hi David,
>> Steve can you please try the example:
>> my-new-sample
>> forrest seed-sample
>> forrest run
>> http://localhost:8888/samples/linking.html#images
>> and the PDF.
>> Then try adding your example. Tell us what happens.
My results were the same as yours for version 0.8. Only two images are
shown in PDFs: item 4 in the first group and item 3 in the second group.
All the images are displayed in HTML.
When I added my own examples, <img src="images/anImage.png" alt="PNG
image"/> worked as desired (i.e. image displayed in HTML and PDF), but
<img src="images/anImage.svg alt="SVG image"/> caused an error message
to be shown (see below).
>> What is your localhost URI (i.e. the a@href) for the image
>> that works for you in 0.7 version?
The localhost URI of an image that does work in version 0.7 is
src="../images/anImage.svg"
I forgot to mention previously that I had added a new element called
<figurepdf>. I can't use SVGs with any effects or colour gradients in
PDFs due to some limitations in FOP. Therefore, I use the <figurepdf>
element to include SVG images without these effects in PDF only, and use
the <figure> element to include images with fancy effects in HTML. This
worked fine in version 0.7.
However, it seems version 0.8 completely ignores both the <figure> and
<figurepdf> elements when it generates the PDF (even though they are
included in document-to-fo.xsl). The only way to include an image in the
PDF is to use the <img> element. Now that I have changed the <figurepdf>
elements to <img> elements I get the following error message when I
execute the 'forrest' command (see attachment for the rest of the error
message):
""
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.batik.bridge.
UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/
w3c/dom/Element;)Lorg/apache/batik/util/UnitProcessor$Context;
at
org.apache.fop.image.analyser.SVGReader.loadImage(SVGReader.java:107)
...
""
So, am I right in thinking that the reason SVGs are not displayed in
PDFs has something to do with the Batik?
Also, why would Forrest ignore the <figure> element in PDFs? If you take
a look at http://localhost:8888/samples/sample.html#figure, the image is
not displayed in the PDF with the <figure> element, but if you change it
to an <img> element it is displayed. This is odd, as both 'figure' and
'img' are matched in the same template in document-to-fo.xsl:
"<xsl:template match="figure|img">"
Thanks for your help,
Steve
-----Original Message-----
From: David Crossley [mailto:crossley@xxxxxxxxxx]
Sent: 11 January 2007 04:32
To: user@xxxxxxxxxxxxxxxxxx
Subject: Re: SVG images not displayed in PDFs using Forrest version 0.8
Gav.... wrote:
>
> Anyway, just confirming, this is also the case with all images
> On the published forrest website, no images showing in PDFs.
> (png or svg)
Not "all" missing. There are some, e.g. in your-project.pdf
These seem to be PNGs relative to the document.
But yes, others are missing, e.g. in dtdx/document-v20.pdf
This seems to be consistent with FOR-635
https://issues.apache.org/jira/browse/FOR-635
> > From: Gav....
> > > From: Steve Odlind
> > >
> > > PNGs display fine in html and PDF (as long as they are in the
> > > resources/images directory).
> > >
> > > SVG images are not displayed in PDFs, regardless of the directory
they
> > > are in. I have tried resources/images and xdocs/images.
> >
> > Well, Having tested this again using
> > http://localhost:8888/samples/linking.pdf
> >
> > It seems you are correct, this wasn't the case before, I remember
some of
> > The images showing, now none of them are, not even png images appear
for
> > me On the above page. This is using skins 0.8-dev with only pdf
plugin.
Are you sure that you have followed the FAQ?
http://forrest.apache.org/faq.html#pdf_images
> > Perhaps something has changed to make FOR-635 even worse of an issue
than
> > It once was. This is a quick investigation, I'll look into it more.
I investigated this again today. In light of Steve's comments
tried the current examples on various past versions of Forrest.
The bad behaviour is consistent.
Steve can you please try the example:
cd my-new-sample
forrest seed-sample
forrest run
http://localhost:8888/samples/linking.html#images
and the PDF.
Then try adding your example. Tell us what happens.
I don't see any of the SVG generated PNGs in the PDF.
This is the same for me in various versions, see the comments
at https://issues.apache.org/jira/browse/FOR-635
What is your localhost URI (i.e. the a@href) for the image
that works for you in 0.7 version?
-David
errormessage.txt
Description: errormessage.txt
Previous Message by Thread:
click to view message preview
Re: Excluding files?
Cameron McCormack wrote:
David Crossley:
Yes. See some examples in forrest/site-author/conf/cli.xconf
Not an "error". Doing 'forrest site' follows every link that it finds.
The Cocoon CLI (Command Line Interface) config enables the
powerful exclusion mechanism.
Ok. Is there a way to configure it so that if it follows a link it
doesnât know how to generate, but that file is in the content directory,
that it doesnât consider it an error?
I've done this on a few sites. There are three approaches (that I can
think of):
In the first, you provide a pipeline at the end of all other pipelines
that generates a "File not found" type XDoc. This pipeline will be the
final one processed and so will ensure a document is always returned. We
don't have one in the default distribution as this will hide build
errors that are really build errors, but it has the advantage of
covering all possible requests that are not matched by other pipelines.
Note that this first approach requires you to modify Forrests core
sitemaps and thus you will need to be careful when upgrading.
The second approach is to create a dummy file for each unmapped request.
This dummy file will say something like "This will be a dynamically
generated page in the live system". This works well, but requires you to
manage each page individually, however it requires no changes to the
core sitemaps. Note that you may need to add a pipeline to match special
request patterns that Forrest does not normally match (e.g. "*.cgi").
The final approach is a half way between the first two. Create a set of
pipelines in your project to match the requests affected by your issue.
these will need to be narrow enough to trap all known pages but allow
all others to pass through. The downside of this is that it can be
difficult to identify a suitable pattern (or set of patterns), I'd
recommend using the RE matcher for this unless you only have one or two
pages affected by this.
Ross
Next Message by Thread:
click to view message preview
Make CGI script select the right item in the menu
Hi again.
Thanks to your help, Batikâs forrest-based site is now live:
http://xmlgraphics.apache.org/batik/
There is one more problem, though. When I select the Download link from
the menu, this goes to download.cgi (which is just the mirrors.cgi
script), but doesnât highlight the right menu item on the left.
Actually, none are highlighted and the submenus are collapsed. How can
I make it act more like any other page?
The site.xml contains:
<site xmlns="http://apache.org/forrest/linkmap/1.0"
label="Batik" href="" tab="home">
<project label="Project">
<index label="Overview" href="index.html"/>
â
<download label="Download" href="download.cgi"/>
â
Is there anything else I must do?
Thanks,
Cameron
--
Cameron McCormack, http://mcc.id.au/
xmpp:heycam@xxxxxxxxxx â ICQ 26955922 â MSN cam@xxxxxxxxx
|
|