You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2007/03/09 02:36:40 UTC

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...

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

Added:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/css/
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/css/doap.css
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/html/
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/html/doap-embedded.ft
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/resources/
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/resources/themes/
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/resources/themes/pelt.fv
Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/forrest.properties
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/status.xml

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/forrest.properties
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/forrest.properties?view=diff&rev=516256&r1=516255&r2=516256
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/forrest.properties (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/forrest.properties Thu Mar  8 17:36:39 2007
@@ -22,5 +22,4 @@
 
 # FIXME: FOR-785
 forrest.validate.skinconf=false
-
-project.required.plugins=org.apache.forrest.plugin.input.doap,org.apache.forrest.plugin.input.projectInfo
+project.required.plugins=org.apache.forrest.plugin.input.doap,org.apache.forrest.plugin.input.projectInfo,org.apache.forrest.plugin.internal.dispatcher,org.apache.forrest.themes.core,org.apache.forrest.plugin.output.inputModule

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/css/doap.css
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/css/doap.css?view=auto&rev=516256
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/css/doap.css (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/css/doap.css Thu Mar  8 17:36:39 2007
@@ -0,0 +1,77 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#solr {
+ background: #294563;
+ color:#CFDCED;
+ min-height:25px;
+ border-bottom: thick solid #002b3d;
+ padding:5px;
+}
+.solrSearch{
+ display:inline;
+ float:right;
+}
+.solrSearch form div{
+ display:inline;
+}
+.solrSearch form{
+ display:inline;
+}
+
+.solrSearch input {
+margin-top:2pt;
+ background: #4A6D8C;
+ border: thin inset #002b3d;
+ color:#fff;
+}
+ .solrSearch .submit input:hover{
+text-decoration: underline;
+ }
+.solrActionbar{
+ text-align:left;
+ font-family: verdana, helvetica, sans;
+ font-size: 8pt;
+ padding:5px;
+}
+#solr ul{
+ display:inline;
+ list-style:none;
+}
+#solr a {
+ color: #fff;
+ text-decoration: none;
+ font-weight: bold;
+ padding:2pt;
+ marrgin:2pt;
+ background: #4A6D8C;
+ border: thin solid #002b3d;
+}
+
+#solr a:visited {
+ font-weight: normal;
+}
+#solr a:hover {
+ text-decoration: underline;
+}
+#solr li:hover{
+ list-style:underline;
+}
+#solr li{
+ padding:2pt;
+ marrgin:2pt;
+ display:inline;
+}
\ No newline at end of file

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/html/doap-embedded.ft
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/html/doap-embedded.ft?view=auto&rev=516256
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/html/doap-embedded.ft (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/themes/common/html/doap-embedded.ft Thu Mar  8 17:36:39 2007
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<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
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/resources/themes/pelt.fv?view=auto&rev=516256
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/resources/themes/pelt.fv (added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/src/documentation/resources/themes/pelt.fv Thu Mar  8 17:36:39 2007
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<forrest:views xmlns:forrest="http://apache.org/forrest/templates/1.0" 
+  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+  <!-- The following variables are used to contact data models and/or contracts. -->
+  <jx:set var="contextPath" value="#{$cocoon/parameters/contextPath}"/>
+  <jx:set var="getRequest" value="#{$cocoon/parameters/getRequest}"/>
+  <jx:set var="getRequestExtension" value="#{$cocoon/parameters/getRequestExtension}" />
+  
+  <forrest:view type="fo" hooksXpath="/">
+    <jx:import uri="cocoon://prepare.tiles.common-fo"/>
+  </forrest:view>
+  
+  <!-- CSS View of the request e.g. index.dispatcher.css -->
+  <forrest:view type="css" hooksXpath="/">
+    <jx:import uri="cocoon://prepare.tiles.pelt-css"/>
+  </forrest:view>
+    
+  <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>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/status.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/status.xml?view=diff&rev=516256&r1=516255&r2=516256
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/status.xml (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/status.xml Thu Mar  8 17:36:39 2007
@@ -37,7 +37,14 @@
 
   <changes>
     <!-- Add new releases here -->
-    <release version="0.1" date="not-released">
+    <release version="0.1" date="not-released">
+      <action dev="RDG" type="add" context="code">
+        doap-embedded dispatcher template added. This allows DOAP files to
+        be embedded within an output HTML file.
+      </action>
+      <action dev="RDG" type="update" context="code">
+        Switch to Dispatcher.
+      </action>
       <action dev="RDG" type="add" context="admin">
         Initial plugin code.
       </action>



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


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>.
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