You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Sergey Missan <ad...@javable.com> on 2003/03/05 18:06:28 UTC

images in local dirs -- solved

Hello,

Sometime ago I requested to have images in local dirs, instead of
dumping them all into resources/images.

This tweak of sitemap seems to do the trick (but I don't know if this
is the best solution):

<!-- WARNING: See above: this target should not be made use of -->
            <map:match pattern="**/images/**.*">
               <map:read src="content/xdocs/{0}" mime-type="image/{3}" />
            </map:match>


Now, if I use <figure> like this

<figure width="402" height="226" src="images/jw-02-howto1.gif"
alt="Test." />

and place image file into the local image/ dir (i.e.
xdocs/subdir/images/), forrest correctly includes it.

This allows inclusion of images together with xml documents that use
them and leads to the more "manageable" site structure.

-- Sergey
 PS: what is the current situation with images in PDFs?



Re: images in local dirs -- solved

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jeff Turner wrote:
> Neither had I until now =)  Unfortunately 0.20.5rc2 doesn't work:
> 08:22:55.994 WARN!! GET /primer.pdf HTTP/1.1
> java.io.IOException: Broken pipe
...
> IIRC, the problem is that Batik closes the output stream, and a
> workaround needed to be put in Cocoon.
That's odd. I use FOP 0.20.5rc with SVG in Cocoon without such
problems. Well, I vaguely remember that Batik was upgraded, I'm
just too lazy to check whether this was before or after the RC
release.

> Anyway, with a patched Cocoon and CVS trunk FOP, images do appear, but
> there were various errors:
> 
> http://marc.theaimsgroup.com/?l=forrest-dev&m=104358488604302&q=p3
These errors are from a HEAD snapshot, not from the maintenance code.

J.Pietschmann


Re: images in local dirs -- solved

Posted by Jeff Turner <je...@apache.org>.
On Thu, Mar 06, 2003 at 02:28:47PM +0100, Jeremias Maerki wrote:
> 
> On 06.03.2003 14:14:30 Jeff Turner wrote:
> > >  PS: what is the current situation with images in PDFs?
> > 
> > There's two aspects:
> > 
> >  - Last I tried, FOP from CVS gave some NPEs when run with Forrest, and
> >    got alignments wrong, and this prevented us from using it.  Quite
> >    likely things have since improved.
> >  - To use the latest FOP, Forrest needs a hacked Cocoon jar.  When I
> >    tried to synch with the latest Cocoon a few days ago, performance fell
> >    by ~30% and various pages failed in odd ways, so I didn't commit.
> > 
> > In other words, I have my head in the sand hoping problems in FOP and
> > Cocoon will go away by the time I next try them.  For now, the only thing
> > to do is hand-generate the PDFs :/
> 
> If you're talking about "FOP from CVS" we need to separate the
> maintenance branch (where the current releases comes from) and the trunk
> (where the redesign happens). AFAIK the hacked Cocoon jar is only
> necessary for the redesigned FOP. If you used FOP 0.20.5rc2 
> (or from CVS tag "fop-0_20_2-maintain") I think it should work out of
> the box with Cocoon (though I haven't tried).

Neither had I until now =)  Unfortunately 0.20.5rc2 doesn't work:

08:22:55.994 WARN!! GET /primer.pdf HTTP/1.1
java.io.IOException: Broken pipe
        at java.net.SocketOutputStream.socketWrite(Native Method)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:91)
        at org.mortbay.http.NullableOutputStream.write(NullableOutputStream.java:119)
        at org.mortbay.http.BufferedOutputStream.bypassWrite(BufferedOutputStream.java:154)
        at org.mortbay.http.BufferedOutputStream.write(BufferedOutputStream.java:129)
        at org.mortbay.http.HttpOutputStream.write(HttpOutputStream.java:438)
        at org.mortbay.http.HttpOutputStream.write(HttpOutputStream.java:430)
        at org.mortbay.jetty.servlet.ServletOut.write(ServletOut.java:35)
        at org.apache.cocoon.components.notification.Notifier.notifyHTML(Notifier.java:142)
        at org.apache.cocoon.components.notification.Notifier.notify(Notifier.java:99)
        at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1190)

IIRC, the problem is that Batik closes the output stream, and a
workaround needed to be put in Cocoon.

Anyway, with a patched Cocoon and CVS trunk FOP, images do appear, but
there were various errors:

http://marc.theaimsgroup.com/?l=forrest-dev&m=104358488604302&q=p3

> Anyway, what exactly are the problems? Can you tell me how to reproduce
> them? Maybe I can help.

Thanks for the offer.  At some stage I'll find time to narrow down the
problem further, and then submit some decent bug reports.  Right now I am
in mortal combat with Cocoon..

--Jeff

> 
> Jeremias Maerki
> 

Re: images in local dirs -- solved

Posted by Jeremias Maerki <de...@greenmail.ch>.
On 06.03.2003 14:14:30 Jeff Turner wrote:
> >  PS: what is the current situation with images in PDFs?
> 
> There's two aspects:
> 
>  - Last I tried, FOP from CVS gave some NPEs when run with Forrest, and
>    got alignments wrong, and this prevented us from using it.  Quite
>    likely things have since improved.
>  - To use the latest FOP, Forrest needs a hacked Cocoon jar.  When I
>    tried to synch with the latest Cocoon a few days ago, performance fell
>    by ~30% and various pages failed in odd ways, so I didn't commit.
> 
> In other words, I have my head in the sand hoping problems in FOP and
> Cocoon will go away by the time I next try them.  For now, the only thing
> to do is hand-generate the PDFs :/

If you're talking about "FOP from CVS" we need to separate the
maintenance branch (where the current releases comes from) and the trunk
(where the redesign happens). AFAIK the hacked Cocoon jar is only
necessary for the redesigned FOP. If you used FOP 0.20.5rc2 
(or from CVS tag "fop-0_20_2-maintain") I think it should work out of
the box with Cocoon (though I haven't tried).

Anyway, what exactly are the problems? Can you tell me how to reproduce
them? Maybe I can help.


Jeremias Maerki


Re: images in local dirs -- solved

Posted by Jeff Turner <je...@apache.org>.
On Wed, Mar 05, 2003 at 01:06:28PM -0400, Sergey Missan wrote:
> Hello,
> 
> Sometime ago I requested to have images in local dirs, instead of
> dumping them all into resources/images.
> 
> This tweak of sitemap seems to do the trick (but I don't know if this
> is the best solution):
> 
> <!-- WARNING: See above: this target should not be made use of -->
>             <map:match pattern="**/images/**.*">
>                <map:read src="content/xdocs/{0}" mime-type="image/{3}" />
>             </map:match>
> 
> 
> Now, if I use <figure> like this
> 
> <figure width="402" height="226" src="images/jw-02-howto1.gif"
> alt="Test." />
> 
> and place image file into the local image/ dir (i.e.
> xdocs/subdir/images/), forrest correctly includes it.

Goodo

> This allows inclusion of images together with xml documents that use
> them and leads to the more "manageable" site structure.
>
> -- Sergey
>  PS: what is the current situation with images in PDFs?

There's two aspects:

 - Last I tried, FOP from CVS gave some NPEs when run with Forrest, and
   got alignments wrong, and this prevented us from using it.  Quite
   likely things have since improved.
 - To use the latest FOP, Forrest needs a hacked Cocoon jar.  When I
   tried to synch with the latest Cocoon a few days ago, performance fell
   by ~30% and various pages failed in odd ways, so I didn't commit.

In other words, I have my head in the sand hoping problems in FOP and
Cocoon will go away by the time I next try them.  For now, the only thing
to do is hand-generate the PDFs :/


--Jeff