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 2006/03/16 02:56:49 UTC

Testing dispatcher

Hi,

Sorry for the cross-post. Perhaps the dev list was the wrong place to 
send this one.

I'm working to recreate a custom Forrest 0.7 skin with the 0.8-dev 
dispatcher.

I started by modifying the blank contract template to get some test 
output. I encounter the following error message:

---
dispatcherError: 500 - Internal server error
The contract "content" has thrown thrown an exception by resolving raw 
data from "cocoon://index.body.xml".

dispatcherErrorStack:
  org.xml.sax.SAXParseException: The markup in the document following 
the root element must be well-formed.
---

When I inspect the result of index.body.xml, I can see why it's 
complaining. The root element of the output is the empty tag 
<meta-data/>, followed by the content. In 0.7 the skin's 
document-to-html (or document2html) stylesheet inserted the meta-data 
tag; what's doing it now? Is the skin system still active when using the 
dispatcher? I'm not sure how the dispatcher interacts with skins. I 
don't have a skin set in forrest.properties for this test.

Thanks,
Brian

Re: Testing dispatcher

Posted by "Gav...." <br...@brightontown.com.au>.
Hi Brian,

----- Original Message ----- 
From: "Brian M Dube" <br...@gmail.com>
To: <us...@forrest.apache.org>
Sent: Thursday, March 16, 2006 9:56 AM
Subject: Testing dispatcher


> Hi,
>
> Sorry for the cross-post. Perhaps the dev list was the wrong place to send 
> this one.

I would say it is the right list as you are talking about 0.8-dev a work
in progress that most users would not have experience with just yet.
The delay in answering is just one of those 'everyone is busy' or away
periods I guess. Anyway ...

>
> I'm working to recreate a custom Forrest 0.7 skin with the 0.8-dev 
> dispatcher.
>
> I started by modifying the blank contract template to get some test 
> output. I encounter the following error message:
>
> ---
> dispatcherError: 500 - Internal server error
> The contract "content" has thrown thrown an exception by resolving raw 
> data from "cocoon://index.body.xml".
>
> dispatcherErrorStack:
>  org.xml.sax.SAXParseException: The markup in the document following the 
> root element must be well-formed.
> ---
>
> When I inspect the result of index.body.xml, I can see why it's 
> complaining. The root element of the output is the empty tag <meta-data/>, 
> followed by the content. In 0.7 the skin's document-to-html (or 
> document2html) stylesheet inserted the meta-data tag; what's doing it now? 
> Is the skin system still active when using the dispatcher? I'm not sure 
> how the dispatcher interacts with skins. I don't have a skin set in 
> forrest.properties for this test.

I would start by first of all, having a working dispatcher version
of seed-sample, once you know this works, then you and we know
that Forrest and the Dispatcher is set up correctly. Saying you started
with a 'blank contract template' leaves a lot of holes as to what dispatcher
preparation you did to get to that point.

I just looked at a index.body.xml of an unmodified pelt theme from 
seed-sample
and it looks just fine.

A great place to start is to follow 
http://forrest.apache.org/docs_0_80/howto/howto-dispatcher-quickstart.html - 
should get you up and running in no time. Once this is working
then you can set about creating your own 'theme' to replace your current 
skin.

I am guessing your problem above is you missed out a step in being 
dispatcher ready,
probably something to do with not applying the patch from 
https://issues.apache.org/jira/browse/FOR-796

To create your own theme, copy pelt.fv and the pelt theme directory and 
rename to your own, then make your changes. Apply the changes by replacing 
'project.theme=pelt' with 'project.theme=yourThemeName' , restart jetty and 
try again. When this works you can concentrate on altering your theme.fv and 
all its CSS and .ft files to suit you. You can copy any files from 
common/html into yourTheme/html and alter them there to be specific to your 
project, otherwise they fallback to common.
We are here to help at any stage of this if you need it.


>
> Thanks,
> Brian
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.2.4/282 - Release Date: 15/03/2006
> 



Re: Testing dispatcher

Posted by "Gav...." <br...@brightontown.com.au>.
Hi Brian,

----- Original Message ----- 
From: "Brian M Dube" <br...@gmail.com>
To: <us...@forrest.apache.org>
Sent: Thursday, March 16, 2006 9:56 AM
Subject: Testing dispatcher


> Hi,
>
> Sorry for the cross-post. Perhaps the dev list was the wrong place to send 
> this one.

I would say it is the right list as you are talking about 0.8-dev a work
in progress that most users would not have experience with just yet.
The delay in answering is just one of those 'everyone is busy' or away
periods I guess. Anyway ...

>
> I'm working to recreate a custom Forrest 0.7 skin with the 0.8-dev 
> dispatcher.
>
> I started by modifying the blank contract template to get some test 
> output. I encounter the following error message:
>
> ---
> dispatcherError: 500 - Internal server error
> The contract "content" has thrown thrown an exception by resolving raw 
> data from "cocoon://index.body.xml".
>
> dispatcherErrorStack:
>  org.xml.sax.SAXParseException: The markup in the document following the 
> root element must be well-formed.
> ---
>
> When I inspect the result of index.body.xml, I can see why it's 
> complaining. The root element of the output is the empty tag <meta-data/>, 
> followed by the content. In 0.7 the skin's document-to-html (or 
> document2html) stylesheet inserted the meta-data tag; what's doing it now? 
> Is the skin system still active when using the dispatcher? I'm not sure 
> how the dispatcher interacts with skins. I don't have a skin set in 
> forrest.properties for this test.

I would start by first of all, having a working dispatcher version
of seed-sample, once you know this works, then you and we know
that Forrest and the Dispatcher is set up correctly. Saying you started
with a 'blank contract template' leaves a lot of holes as to what dispatcher
preparation you did to get to that point.

I just looked at a index.body.xml of an unmodified pelt theme from 
seed-sample
and it looks just fine.

A great place to start is to follow 
http://forrest.apache.org/docs_0_80/howto/howto-dispatcher-quickstart.html - 
should get you up and running in no time. Once this is working
then you can set about creating your own 'theme' to replace your current 
skin.

I am guessing your problem above is you missed out a step in being 
dispatcher ready,
probably something to do with not applying the patch from 
https://issues.apache.org/jira/browse/FOR-796

To create your own theme, copy pelt.fv and the pelt theme directory and 
rename to your own, then make your changes. Apply the changes by replacing 
'project.theme=pelt' with 'project.theme=yourThemeName' , restart jetty and 
try again. When this works you can concentrate on altering your theme.fv and 
all its CSS and .ft files to suit you. You can copy any files from 
common/html into yourTheme/html and alter them there to be specific to your 
project, otherwise they fallback to common.
We are here to help at any stage of this if you need it.


>
> Thanks,
> Brian
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.2.4/282 - Release Date: 15/03/2006
> 



Re: Testing dispatcher

Posted by Thorsten Scherler <th...@apache.org>.
El mié, 15-03-2006 a las 19:56 -0600, Brian M Dube escribió:
> Hi,
> 
> Sorry for the cross-post. Perhaps the dev list was the wrong place to 
> send this one.
> 

Sorry, that this mail sliped through my radar. ;)

> I'm working to recreate a custom Forrest 0.7 skin with the 0.8-dev 
> dispatcher.

ok

> I started by modifying the blank contract template to get some test 
> output. 

How does the contract looks after you modified it?

BTW IMO the best way to start is using the master.ft.

> I encounter the following error message:
> 
> ---
> dispatcherError: 500 - Internal server error
> The contract "content" has thrown thrown an exception by resolving raw 
> data from "cocoon://index.body.xml".
> 

So your contract that is throwing an exception is called "content" and
was thrown by resolving the raw data.

> dispatcherErrorStack:
>   org.xml.sax.SAXParseException: The markup in the document following 
> the root element must be well-formed.
> ---
> 
> When I inspect the result of index.body.xml, I can see why it's 
> complaining. The root element of the output is the empty tag 
> <meta-data/>, followed by the content. 

Hmm, that is not right and should not be. I just tried with the
fresh-site and cannot reproduce the problem.

Which plugins are you using (the exact name in forrest.properties)? 
Did you implemented a custom <map:match pattern="**.body.xml"/>?
How does your index.xml looks like?

> In 0.7 the skin's 
> document-to-html (or document2html) stylesheet inserted the meta-data 
> tag; what's doing it now? 

The dispatcher uses its own document2html.xsl that is not connected
directly with the one from skins. 

You can find the match in 
org.apache.forrest.plugin.internal.dispatcher/dataModel.xmap
    <map:pipeline>
      <!-- HTML rendered from intermediate format -->
      <map:match pattern="**.body.xml">
        <map:generate src="cocoon:/{1}.source.rewritten.xml" />
        <map:transform src="{lm:dataModel-html-document-to-html.xsl}">
          <map:parameter name="path" value="{1}.html" />
        </map:transform>
        <map:serialize />
      </map:match>
    </map:pipeline>

Where {lm:dataModel-html-document-to-html.xsl} is defined in the
dispatcher locationmap.xml
    <match pattern="dataModel-html-**.xsl">
      <select type="exists">
        <location
src="{project:skins-dir}{project:theme}/xslt/html/{1}.xsl" />
        <location
src="{project:structurer}/resources/stylesheets/html/{1}.xsl"
          />
        <location

src="{defaults:structurer}/resources/stylesheets/html/{1}.xsl" />
      </select>
    </match>

Assuming you are not using your own implementation of
document-to-html.xsl the dispatcher uses 
org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/document-to-html.xsl
but there I do not see any match for meta-data, nor in the import
../common/xslt/html/document-to-html.xsl

> Is the skin system still active when using the 
> dispatcher? 

No. The dispatcher overrides skins.

> I'm not sure how the dispatcher interacts with skins. 

The interaction that may still exist till we solve 
http://issues.apache.org/jira/browse/FOR-808 are due to go but there
should be no interaction between skins and the dispatcher anymore.

> I 
> don't have a skin set in forrest.properties for this test.

That is perfectly alright.

> 
> Thanks,
> Brian

Welcome to the dispatcher Brain and thanks for testing. :)

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)