You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ross Gardler <rg...@apache.org> on 2007/03/09 02:43:08 UTC

Plugin supplied dispatcher templates (was Re: svn commit: r516256 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap: ./ resources/themes/ resources/themes/common/ resources/themes/common/css/ resources/themes/common/html/ src/documentation/resources/ src/documentation/res...)

rgardler@apache.org wrote:
> Author: rgardler
> Date: Thu Mar  8 17:36:39 2007
> New Revision: 516256
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=516256
> Log:
> - switch to using dispatch
> - add doap-embedded.ft

What the log message should have said is that this new ft does not work, 
and I do not know why. It may well be that I should have been in bed at 
least two hours ago, and a screaming child is stopping me from thinking, 
but just in case someone with fresh eyes can see the problem before I 
wake up...

> Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/html/doap-embedded.ft

...

> +<forrest:contract 
> +  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
> +  xmlns:forrest="http://apache.org/forrest/templates/1.0"
> +  name="doap-embedded">
> +  
> +  <description>
> +    <p>This template outputs html link elements for embedding DOAP files. </p>
> +    <p>The contract requires the locations of DOAP files to be passed in as parameters using the following syntax :</p>
> +    <source>&lt;doap url="<em>food.rdf</em>"&gt;</source>
> +    <ul>
> +      <li><strong>url</strong> attribute indicates the name location of the DOAP file.
> +     The <strong>url</strong> attribute is required.
> +      </li>      
> +    </ul>
> +  </description>
> +  
> +  <usage><![CDATA[<forrest:contract name="doap-embedded">
> +      <forrest:property name="doap-embedded-links">
> +        <doap url="foo.rdf"/>
> +        <doap url="foo.bar.xml"/>
> +        ...
> +      </forrest:property>
> +    </forrest:contract>]]></usage>
> +    
> +  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
> +    name="doap-embedded" inputFormat="xsl">
> +    <xsl:stylesheet version="1.1" 
> +      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> +      xmlns:forrest="http://apache.org/forrest/templates/1.0">
> +      
> +      <xsl:param name="doap-embedded-links"/>
> +      
> +      <xsl:template match="/">
> +        <forrest:content>
> +          <forrest:part xpath="/html/head">
> +            <xsl:apply-templates select="$doap-embedded-links"/>
> +          </forrest:part>
> +        </forrest:content>
> +      </xsl:template>
> +      
> +      <xsl:template match="doap[@url]">
> +      <link href="mydoap.rdf" type=""/>
> +        <link rel="meta" type="application/rdf+xml">
> +          <xsl:choose>
> +            <xsl:when test="@title">
> +              <xsl:attribute name="title">
> +                <xsl:value-of select="@title"/>
> +              </xsl:attribute>
> +            </xsl:when>
> +            <xsl:otherwise>
> +              <xsl:attribute name="title">DOAP</xsl:attribute>
> +            </xsl:otherwise>
> +          </xsl:choose>
> +          
> +          <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
> +        </link>
> +      </xsl:template>      
> +    </xsl:stylesheet>
> +  </forrest:template>
> +</forrest:contract>

...

> Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/resources/themes/pelt.fv
> +  <forrest:view type="html" hooksXpath="/html/body">
> +    <forrest:contract name="doap-embedded">
> +      <forrest:property name="doap-embedded-links">
> +        <doap url="doap.rdf"/>
> +      </forrest:property>
> +    </forrest:contract>
> +    
> +    <jx:import uri="cocoon://prepare.tiles.pelt-html"/>
> +  </forrest:view>
> +</forrest:views>

The result is:

dispatcherError: 500 - Internal server error
The contract "doap-embedded" has thrown an exception by resolving the 
implementation from "cocoon://resolve.contract.html.doap-embedded".

dispatcherErrorStack:
org.apache.forrest.dispatcher.DispatcherException: 500 - Internal server 
error
component: ContractBean
message:
Could not setup transformer in the contractBean.
Please check that the contract implementation is wellformed and valid!


---

Looking at the locationmap log I see that the doap-embedded.ft is not 
found, it resolves to noFT

Any ideas?

Ross

Ross

Re: Plugin supplied dispatcher templates (was Re: svn commit: r516256 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap: ./ resources/themes/ resources/themes/common/ resources/themes/common/css/ resources/themes/common/html/ src/documentation/resources/ src/documentation/res...)

Posted by Thorsten Scherler <th...@apache.org>.
On Fri, 2007-03-09 at 09:14 +0000, Ross Gardler wrote:
> Thorsten Scherler wrote:
> > On Fri, 2007-03-09 at 01:43 +0000, Ross Gardler wrote:
> > ...
> >> but just in case someone with fresh eyes can see the problem before I 
> >> wake up...
> > 
> > fixed.
> > 
> > http://forrest.apache.org/docs_0_80/howto/howto-buildPlugin.html#Dispatcher
> 
> Ah Ha!
> 
> I searched everywhere in the dispatcher docs for this, didn't expect to 
> find it in core docs. I'll put a cross reference in place.

Yeah, I once had the exact same problem (the subject ringed a bell) and
a grep gave me above link. Thanks to put the cross reference in place. I
agree that it will help.

However I think we should "Once Dispatcher becomes stable we will add
this matches to the default locationmap which is generated when you seed
a new plugin, but for now it must be done manually." do this now.

> 
> Thanks for your help.

You are welcome.

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


Re: Plugin supplied dispatcher templates (was Re: svn commit: r516256 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap: ./ resources/themes/ resources/themes/common/ resources/themes/common/css/ resources/themes/common/html/ src/documentation/resources/ src/documentation/res...)

Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> On Fri, 2007-03-09 at 01:43 +0000, Ross Gardler wrote:
> ...
>> but just in case someone with fresh eyes can see the problem before I 
>> wake up...
> 
> fixed.
> 
> http://forrest.apache.org/docs_0_80/howto/howto-buildPlugin.html#Dispatcher

Ah Ha!

I searched everywhere in the dispatcher docs for this, didn't expect to 
find it in core docs. I'll put a cross reference in place.

Thanks for your help.

Ross

Re: Plugin supplied dispatcher templates (was Re: svn commit: r516256 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap: ./ resources/themes/ resources/themes/common/ resources/themes/common/css/ resources/themes/common/html/ src/documentation/resources/ src/documentation/res...)

Posted by Thorsten Scherler <th...@apache.org>.
On Fri, 2007-03-09 at 01:43 +0000, Ross Gardler wrote:
...
> but just in case someone with fresh eyes can see the problem before I 
> wake up...

fixed.

http://forrest.apache.org/docs_0_80/howto/howto-buildPlugin.html#Dispatcher

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