You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Brian M Dube <br...@gmail.com> on 2005/10/16 07:15:19 UTC

Custom HTML source

Hello,

Following the example in the documentation, I've added a custom
pipeline to support rendering existing HTML sources within the local
Forrest installation. The pattern match works and the HTML is skinned.
The problem is that I can't get the transformation to process the
intermediate file. Here is the relevant pipeline:

  <map:pipeline>
    <map:match pattern="/old/*.xml">
      <map:generate src="{project:content.xdocs}{uri}.html" type="html"/>
      <map:transform src="{project:resources.stylesheets}/fixoldhtml.xsl"/>
      <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
      <map:transform type="idgen"/>
      <map:serialize type="xml-document"/>
    </map:match>
  </map:pipeline>

fixoldhtml.xsl is the stylesheet I made to remove the navigational
markup from the old site, as the documentation describes. Any ideas?

Thanks,
Brian

Re: Custom HTML source

Posted by Brian M Dube <br...@gmail.com>.
On 10/16/05, Brian M Dube <br...@gmail.com> wrote:
> When I comment out
> the references to jtidy.properties in the core forrest.xmap and core
> sitemap.xmap, the local pipeline works, including the transformation.

I haven't been able to figure out why this is the case. I'll keep
looking. Thanks for the help getting the pipeline to work.

Brian

Re: Custom HTML source

Posted by Brian M Dube <br...@gmail.com>.
On 10/16/05, David Crossley <cr...@apache.org> wrote:
> Ross Gardler wrote:
> > Brian M Dube wrote:
> > >Ross Gardler wrote:
> > >>Brian M Dube wrote:
> > >>
> > >>>Following the example in the documentation, I've added a custom
> > >>>pipeline to support rendering existing HTML sources within the local
> > >>>Forrest installation. The pattern match works and the HTML is skinned.
> > >>>The problem is that I can't get the transformation to process the
> > >>>intermediate file. Here is the relevant pipeline:
> > >>>
> > >>> <map:pipeline>
> > >>>   <map:match pattern="/old/*.xml">
> > >>>     <map:generate src="{project:content.xdocs}{uri}.html" type="html"/>
> > >>>     <map:transform
> > >>>     src="{project:resources.stylesheets}/fixoldhtml.xsl"/>
> > >>>     <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
> > >>>     <map:transform type="idgen"/>
> > >>>     <map:serialize type="xml-document"/>
> > >>>   </map:match>
> > >>> </map:pipeline>
> > >>>
> > >>>fixoldhtml.xsl is the stylesheet I made to remove the navigational
> > >>>markup from the old site, as the documentation describes. Any ideas?
>
> Your Generator needs to be
> <map:generate src="{project:content.xdocs}/old/{1}.html" type="html"/>

Thanks. I think it's a mistake here
http://forrest.apache.org/docs_0_70/howto/howto-custom-html-source.html

> Ross' other comments are still relevant, about why
> you are redefining the Generator in the <compoents> section.

I have no components section in my local sitemap. When I comment out
the references to jtidy.properties in the core forrest.xmap and core
sitemap.xmap, the local pipeline works, including the transformation.

Brian

> > >>Your pipeline is not being processed. Let me ask a few questions to work
> > >>out why (I'll also say what the answers should be, in most circumstances).
> > >>
> > >>1) in what file have you placed the above pipeline?
> > >>2) where is your HTML source located?
> > >>3) what is the request you are making with your browser to retrieve this
> > >>document?
> > >
> > >Thanks for the reply.
> > >
> > >1) The pipeline is in SEEDED_SITE/src/documentation/sitemap.xmap
> > >2) The HTML is in SEEDED_SITE/src/documentation/content/xdocs/old
> > >3) The request is http://localhost:8888/old/about.html
> >
> > All good
> >
> > >I've changed the pattern from "/old/*.xml" to "old/*.xml" and I think
> > >the pipeline is being processed.
> >
> > Ahh, yes, I missed that on first reading.
> >
> > >In core.log I get "Cannot load
> > >configuration from WEB-INF/jtidy.properties"
> >
> > You are defining the HTML generator in your own sitemap? You only need
> > to do that if you want to provide your own configuration. If you remove
> > the HTML generator from the components section of your sitemap it will
> > use the one in the core of Forrest and will use the properties from
> > there (I think).
> >
> > If this doesn't work please post the sitemap snippet configuring your
> > html generator.
> >
> > > Thanks for looking into this.
> >
> > I'm off to bed now, will look again in the morning if the above does not
> > solve your problem.

Re: Custom HTML source

Posted by David Crossley <cr...@apache.org>.
Ross Gardler wrote:
> Brian M Dube wrote:
> >Ross Gardler wrote:
> >>Brian M Dube wrote:
> >>
> >>>Following the example in the documentation, I've added a custom
> >>>pipeline to support rendering existing HTML sources within the local
> >>>Forrest installation. The pattern match works and the HTML is skinned.
> >>>The problem is that I can't get the transformation to process the
> >>>intermediate file. Here is the relevant pipeline:
> >>>
> >>> <map:pipeline>
> >>>   <map:match pattern="/old/*.xml">
> >>>     <map:generate src="{project:content.xdocs}{uri}.html" type="html"/>
> >>>     <map:transform 
> >>>     src="{project:resources.stylesheets}/fixoldhtml.xsl"/>
> >>>     <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
> >>>     <map:transform type="idgen"/>
> >>>     <map:serialize type="xml-document"/>
> >>>   </map:match>
> >>> </map:pipeline>
> >>>
> >>>fixoldhtml.xsl is the stylesheet I made to remove the navigational
> >>>markup from the old site, as the documentation describes. Any ideas?

Your Generator needs to be
<map:generate src="{project:content.xdocs}/old/{1}.html" type="html"/>

Ross' other comments are still relevant, about why
you are redefining the Generator in the <compoents> section.
 
-David

> >>Your pipeline is not being processed. Let me ask a few questions to work
> >>out why (I'll also say what the answers should be, in most circumstances).
> >>
> >>1) in what file have you placed the above pipeline?
> >>2) where is your HTML source located?
> >>3) what is the request you are making with your browser to retrieve this
> >>document?
> >
> >Thanks for the reply.
> >
> >1) The pipeline is in SEEDED_SITE/src/documentation/sitemap.xmap
> >2) The HTML is in SEEDED_SITE/src/documentation/content/xdocs/old
> >3) The request is http://localhost:8888/old/about.html
> 
> All good
> 
> >I've changed the pattern from "/old/*.xml" to "old/*.xml" and I think
> >the pipeline is being processed. 
> 
> Ahh, yes, I missed that on first reading.
> 
> >In core.log I get "Cannot load
> >configuration from WEB-INF/jtidy.properties" 
> 
> You are defining the HTML generator in your own sitemap? You only need 
> to do that if you want to provide your own configuration. If you remove 
> the HTML generator from the components section of your sitemap it will 
> use the one in the core of Forrest and will use the properties from 
> there (I think).
> 
> If this doesn't work please post the sitemap snippet configuring your 
> html generator.
> 
> > Thanks for looking into this.
> 
> I'm off to bed now, will look again in the morning if the above does not 
> solve your problem.
> 
> Ross

Re: Custom HTML source

Posted by David Crossley <cr...@apache.org>.
Brian M Dube wrote:
> 
> I'm not defining the generator. The pipeline I referenced is the only
> thing in the sitemap.

I think that you are heading in the wrong direction.
Did you see my reply eariler today?

> Looking through the documentation again, I
> noticed the forrest.xmap I have does not define a resource named
> file-resolver. I'll look into this and possibly reinstall Forrest.

Also i don't know what you are referring to with
"file-resolver". There is no such thing in my
forrest sitemaps either.

Ah, your mention of "documentation" gave a hint.
http://forrest.apache.org/docs_0_70/howto/howto-custom-html-source.html
is probably out-of-date.

Also i think that that document is too complex
for what you need. It tries to explain everything.

As far i can can see you need a very simple pipeline.

-David

Re: Custom HTML source

Posted by Brian M Dube <br...@gmail.com>.
On 10/16/05, Ross Gardler <rg...@apache.org> wrote:
> Brian M Dube wrote:
> > On 10/16/05, Ross Gardler <rg...@apache.org> wrote:
> >
> >>Brian M Dube wrote:
> >>
> >>>Hello,
> >>>
> >>>Following the example in the documentation, I've added a custom
> >>>pipeline to support rendering existing HTML sources within the local
> >>>Forrest installation. The pattern match works and the HTML is skinned.
> >>>The problem is that I can't get the transformation to process the
> >>>intermediate file. Here is the relevant pipeline:
> >>>
> >>>  <map:pipeline>
> >>>    <map:match pattern="/old/*.xml">
> >>>      <map:generate src="{project:content.xdocs}{uri}.html" type="html"/>
> >>>      <map:transform src="{project:resources.stylesheets}/fixoldhtml.xsl"/>
> >>>      <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
> >>>      <map:transform type="idgen"/>
> >>>      <map:serialize type="xml-document"/>
> >>>    </map:match>
> >>>  </map:pipeline>
> >>>
> >>>fixoldhtml.xsl is the stylesheet I made to remove the navigational
> >>>markup from the old site, as the documentation describes. Any ideas?
> >>
> >>Your pipeline is not being processed. Let me ask a few questions to work
> >>out why (I'll also say what the answers should be, in most circumstances).
> >>
> >>1) in what file have you placed the above pipeline?
> >>2) where is your HTML source located?
> >>3) what is the request you are making with your browser to retrieve this
> >>document?
> >
> >
> > Thanks for the reply.
> >
> > 1) The pipeline is in SEEDED_SITE/src/documentation/sitemap.xmap
> > 2) The HTML is in SEEDED_SITE/src/documentation/content/xdocs/old
> > 3) The request is http://localhost:8888/old/about.html
>
> All good
>
> > I've changed the pattern from "/old/*.xml" to "old/*.xml" and I think
> > the pipeline is being processed.
>
> Ahh, yes, I missed that on first reading.
>
> > In core.log I get "Cannot load
> > configuration from WEB-INF/jtidy.properties"
>
> You are defining the HTML generator in your own sitemap? You only need
> to do that if you want to provide your own configuration. If you remove
> the HTML generator from the components section of your sitemap it will
> use the one in the core of Forrest and will use the properties from
> there (I think).
>
> If this doesn't work please post the sitemap snippet configuring your
> html generator.
>
> >  Thanks for looking into this.
>
> I'm off to bed now, will look again in the morning if the above does not
> solve your problem.

I'm not defining the generator. The pipeline I referenced is the only
thing in the sitemap. Looking through the documentation again, I
noticed the forrest.xmap I have does not define a resource named
file-resolver. I'll look into this and possibly reinstall Forrest.

Brian

Re: Custom HTML source

Posted by Ross Gardler <rg...@apache.org>.
Brian M Dube wrote:
> On 10/16/05, Ross Gardler <rg...@apache.org> wrote:
> 
>>Brian M Dube wrote:
>>
>>>Hello,
>>>
>>>Following the example in the documentation, I've added a custom
>>>pipeline to support rendering existing HTML sources within the local
>>>Forrest installation. The pattern match works and the HTML is skinned.
>>>The problem is that I can't get the transformation to process the
>>>intermediate file. Here is the relevant pipeline:
>>>
>>>  <map:pipeline>
>>>    <map:match pattern="/old/*.xml">
>>>      <map:generate src="{project:content.xdocs}{uri}.html" type="html"/>
>>>      <map:transform src="{project:resources.stylesheets}/fixoldhtml.xsl"/>
>>>      <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
>>>      <map:transform type="idgen"/>
>>>      <map:serialize type="xml-document"/>
>>>    </map:match>
>>>  </map:pipeline>
>>>
>>>fixoldhtml.xsl is the stylesheet I made to remove the navigational
>>>markup from the old site, as the documentation describes. Any ideas?
>>
>>Your pipeline is not being processed. Let me ask a few questions to work
>>out why (I'll also say what the answers should be, in most circumstances).
>>
>>1) in what file have you placed the above pipeline?
>>2) where is your HTML source located?
>>3) what is the request you are making with your browser to retrieve this
>>document?
> 
> 
> Thanks for the reply.
> 
> 1) The pipeline is in SEEDED_SITE/src/documentation/sitemap.xmap
> 2) The HTML is in SEEDED_SITE/src/documentation/content/xdocs/old
> 3) The request is http://localhost:8888/old/about.html

All good

> I've changed the pattern from "/old/*.xml" to "old/*.xml" and I think
> the pipeline is being processed. 

Ahh, yes, I missed that on first reading.

> In core.log I get "Cannot load
> configuration from WEB-INF/jtidy.properties" 

You are defining the HTML generator in your own sitemap? You only need 
to do that if you want to provide your own configuration. If you remove 
the HTML generator from the components section of your sitemap it will 
use the one in the core of Forrest and will use the properties from 
there (I think).

If this doesn't work please post the sitemap snippet configuring your 
html generator.

>  Thanks for looking into this.

I'm off to bed now, will look again in the morning if the above does not 
solve your problem.

Ross

Re: Custom HTML source

Posted by Brian M Dube <br...@gmail.com>.
On 10/16/05, Ross Gardler <rg...@apache.org> wrote:
> Brian M Dube wrote:
> > Hello,
> >
> > Following the example in the documentation, I've added a custom
> > pipeline to support rendering existing HTML sources within the local
> > Forrest installation. The pattern match works and the HTML is skinned.
> > The problem is that I can't get the transformation to process the
> > intermediate file. Here is the relevant pipeline:
> >
> >   <map:pipeline>
> >     <map:match pattern="/old/*.xml">
> >       <map:generate src="{project:content.xdocs}{uri}.html" type="html"/>
> >       <map:transform src="{project:resources.stylesheets}/fixoldhtml.xsl"/>
> >       <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
> >       <map:transform type="idgen"/>
> >       <map:serialize type="xml-document"/>
> >     </map:match>
> >   </map:pipeline>
> >
> > fixoldhtml.xsl is the stylesheet I made to remove the navigational
> > markup from the old site, as the documentation describes. Any ideas?
>
> Your pipeline is not being processed. Let me ask a few questions to work
> out why (I'll also say what the answers should be, in most circumstances).
>
> 1) in what file have you placed the above pipeline?
> 2) where is your HTML source located?
> 3) what is the request you are making with your browser to retrieve this
> document?

Thanks for the reply.

1) The pipeline is in SEEDED_SITE/src/documentation/sitemap.xmap
2) The HTML is in SEEDED_SITE/src/documentation/content/xdocs/old
3) The request is http://localhost:8888/old/about.html

I've changed the pattern from "/old/*.xml" to "old/*.xml" and I think
the pipeline is being processed. In core.log I get "Cannot load
configuration from WEB-INF/jtidy.properties" so I copied this file
from the Forrest installation to SEEDED_SITE/build/webapp/WEB-INF. I
still get that error in core.log. Thanks for looking into this.

Brian

Re: Custom HTML source

Posted by Ross Gardler <rg...@apache.org>.
Brian M Dube wrote:
> Hello,
> 
> Following the example in the documentation, I've added a custom
> pipeline to support rendering existing HTML sources within the local
> Forrest installation. The pattern match works and the HTML is skinned.
> The problem is that I can't get the transformation to process the
> intermediate file. Here is the relevant pipeline:
> 
>   <map:pipeline>
>     <map:match pattern="/old/*.xml">
>       <map:generate src="{project:content.xdocs}{uri}.html" type="html"/>
>       <map:transform src="{project:resources.stylesheets}/fixoldhtml.xsl"/>
>       <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
>       <map:transform type="idgen"/>
>       <map:serialize type="xml-document"/>
>     </map:match>
>   </map:pipeline>
> 
> fixoldhtml.xsl is the stylesheet I made to remove the navigational
> markup from the old site, as the documentation describes. Any ideas?

Your pipeline is not being processed. Let me ask a few questions to work 
out why (I'll also say what the answers should be, in most circumstances).

1) in what file have you placed the above pipeline?
2) where is your HTML source located?
3) what is the request you are making with your browser to retrieve this 
document?

Ross


Re: Custom HTML source

Posted by Brian M Dube <br...@gmail.com>.
On 10/16/05, Brian M Dube <br...@gmail.com> wrote:
> Hello,
>
> Following the example in the documentation, I've added a custom
> pipeline to support rendering existing HTML sources within the local
> Forrest installation. The pattern match works and the HTML is skinned.
> The problem is that I can't get the transformation to process the
> intermediate file. Here is the relevant pipeline:
>
>   <map:pipeline>
>     <map:match pattern="/old/*.xml">
>       <map:generate src="{project:content.xdocs}{uri}.html" type="html"/>
>       <map:transform src="{project:resources.stylesheets}/fixoldhtml.xsl"/>
>       <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
>       <map:transform type="idgen"/>
>       <map:serialize type="xml-document"/>
>     </map:match>
>   </map:pipeline>
>
> fixoldhtml.xsl is the stylesheet I made to remove the navigational
> markup from the old site, as the documentation describes. Any ideas?
>
> Thanks,
> Brian

I think the problem is the match pattern after all. I get the same
results when I delete the project sitemap. I'll continue modifying the
pattern to see what I get.

Brian