You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Tim Williams <wi...@gmail.com> on 2005/09/03 23:50:48 UTC

Re: svn commit: r264872 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates: content-source-xml-link.ft content-xml-link.ft export-link.vt.xml

A couple questions on this one...
o) export-link-vt.xml 
- why is the filename xml instead of ft?  

o) It appears that the sitemap entry that might make this work may
have been committed to the resume plugin but not the views stuff?

The second one appears to be causing FOR-662.  I'll try to look more
into the second one tonight -- a simple cut-n-paste across xmap
entries from resume to views didn't work.

--tim

On 8/30/05, rgardler@apache.org <rg...@apache.org> wrote:
> Author: rgardler
> Date: Tue Aug 30 14:32:55 2005
> New Revision: 264872
> 
> URL: http://svn.apache.org/viewcvs?rev=264872&view=rev
> Log:
> Add a template to retrieve the source content from input plugins, use this in the export-link template
> 
> Added:
>     forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft
> Modified:
>     forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft
>     forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml
> 
> Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft
> URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft?rev=264872&view=auto
> ==============================================================================
> --- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft (added)
> +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft Tue Aug 30 14:32:55 2005
> @@ -0,0 +1,42 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +<!--
> +  Copyright 2002-2005 The Apache Software Foundation or its licensors,
> +  as applicable.
> +
> +  Licensed 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 name="content-source-xml-link" type="nugget"
> +    xmlns:forrest="http://apache.org/forrest/templates/1.0">
> +    <description>
> +      content-source-xml-link will output the XML link with image to the
> +      original source content of the document. Input plugins should provide
> +      the ability to retrieve the original source XML by making a request for
> +      *.source.xml, this contract provides a link to that file. If you want to
> +      provide a link to the XDoc format of the content use the
> +      content-xml-link template.
> +    </description>
> +    <usage><![CDATA[<forrest:contract name="content-source-xml-link"/>]]></usage>
> +    <forrest:template
> +  xmlns:forrest="http://apache.org/forrest/templates/1.0"
> +  format="xhtml" name="content-source-xml-link" inputFormat="xsl" body="true">
> +      <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> +                         <xsl:template name="content-source-xml-link-body">
> +          <a href="{$filename-noext}.source.xml" class="dida">
> +                             <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="Source XML - icon" />
> +                                               <span class="caption">Source XML</span>
> +          </a>
> +                         </xsl:template>
> +
> +                       </xsl:stylesheet>
> +       </forrest:template>
> +</forrest:contract>
> \ No newline at end of file
> 
> Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft
> URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft?rev=264872&r1=264871&r2=264872&view=diff
> ==============================================================================
> --- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft (original)
> +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft Tue Aug 30 14:32:55 2005
> @@ -18,7 +18,9 @@
>    <forrest:contract name="content-xml-link" type="nugget"
>      xmlns:forrest="http://apache.org/forrest/templates/1.0">
>      <description>
> -      content-xml-link will output the XML link with image to the content.
> +      content-xml-link will output an XML link with image to the content.
> +      This link will retrieve the content as an XDoc. If you want to
> +      retrieve the source use content-source-xml-link.ft.
>      </description>
>      <usage><![CDATA[<forrest:contract name="content-xml-link"/>]]></usage>
>      <forrest:template
> 
> Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml
> URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml?rev=264872&r1=264871&r2=264872&view=diff
> ==============================================================================
> --- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml (original)
> +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml Tue Aug 30 14:32:55 2005
> @@ -18,7 +18,7 @@
> 
>  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0" >
>    <forrest:hook name="export-link">
> -    <forrest:contract name="content-xml-link"/>
> +    <forrest:contract name="content-source-xml-link"/>
>      <forrest:contract name="content-pdf-link"/>
>    </forrest:hook>
>  </forrest:template>
> 
> 
>

Re: svn commit: r264872 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates: content-source-xml-link.ft content-xml-link.ft export-link.vt.xml

Posted by Ross Gardler <rg...@apache.org>.
Tim Williams wrote:
> o) It appears that the sitemap entry that might make this work may
> have been committed to the resume plugin but not the views stuff?
> 
> The second one appears to be causing FOR-662.  I'll try to look more
> into the second one tonight -- a simple cut-n-paste across xmap
> entries from resume to views didn't work.

I did add a match to forrest.xmap:

http://svn.apache.org/viewcvs.cgi/forrest/trunk/main/webapp/forrest.xmap?rev=264874&r1=240091&r2=264874&diff_format=h

I'm not able to test why, but my guess is that the match added in the 
above commit is never reached for some reason. It must be in the wrong 
place.

I'll check this out when I'm next able to focus on Forrest (may not be 
till Forrest Tuesday).

Ross

Re: svn commit: r264872 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates: content-source-xml-link.ft content-xml-link.ft export-link.vt.xml

Posted by Kevin <fo...@kegcl.demon.co.uk>.
On Sat, 2005-09-03 at 17:50 -0400, Tim Williams wrote:
> A couple questions on this one...
> o) export-link-vt.xml 
> - why is the filename xml instead of ft?

org.apache.forrest.plugin.internal.view/resources/views/default.fv

Has the answer:

<!-- You can group elements to a template and call it from any view.

Kevin

> o) It appears that the sitemap entry that might make this work may
> have been committed to the resume plugin but not the views stuff?
> 
> The second one appears to be causing FOR-662.  I'll try to look more
> into the second one tonight -- a simple cut-n-paste across xmap
> entries from resume to views didn't work.
> 
> --tim
> 
> On 8/30/05, rgardler@apache.org <rg...@apache.org> wrote:
> > Author: rgardler
> > Date: Tue Aug 30 14:32:55 2005
> > New Revision: 264872
> > 
> > URL: http://svn.apache.org/viewcvs?rev=264872&view=rev
> > Log:
> > Add a template to retrieve the source content from input plugins, use this in the export-link template
> > 
> > Added:
> >     forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft
> > Modified:
> >     forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft
> >     forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml
> > 
> > Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft
> > URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft?rev=264872&view=auto
> > ==============================================================================
> > --- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft (added)
> > +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-source-xml-link.ft Tue Aug 30 14:32:55 2005
> > @@ -0,0 +1,42 @@
> > +<?xml version="1.0" encoding="UTF-8"?>
> > +<!--
> > +  Copyright 2002-2005 The Apache Software Foundation or its licensors,
> > +  as applicable.
> > +
> > +  Licensed 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 name="content-source-xml-link" type="nugget"
> > +    xmlns:forrest="http://apache.org/forrest/templates/1.0">
> > +    <description>
> > +      content-source-xml-link will output the XML link with image to the
> > +      original source content of the document. Input plugins should provide
> > +      the ability to retrieve the original source XML by making a request for
> > +      *.source.xml, this contract provides a link to that file. If you want to
> > +      provide a link to the XDoc format of the content use the
> > +      content-xml-link template.
> > +    </description>
> > +    <usage><![CDATA[<forrest:contract name="content-source-xml-link"/>]]></usage>
> > +    <forrest:template
> > +  xmlns:forrest="http://apache.org/forrest/templates/1.0"
> > +  format="xhtml" name="content-source-xml-link" inputFormat="xsl" body="true">
> > +      <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > +                         <xsl:template name="content-source-xml-link-body">
> > +          <a href="{$filename-noext}.source.xml" class="dida">
> > +                             <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="Source XML - icon" />
> > +                                               <span class="caption">Source XML</span>
> > +          </a>
> > +                         </xsl:template>
> > +
> > +                       </xsl:stylesheet>
> > +       </forrest:template>
> > +</forrest:contract>
> > \ No newline at end of file
> > 
> > Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft
> > URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft?rev=264872&r1=264871&r2=264872&view=diff
> > ==============================================================================
> > --- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft (original)
> > +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/content-xml-link.ft Tue Aug 30 14:32:55 2005
> > @@ -18,7 +18,9 @@
> >    <forrest:contract name="content-xml-link" type="nugget"
> >      xmlns:forrest="http://apache.org/forrest/templates/1.0">
> >      <description>
> > -      content-xml-link will output the XML link with image to the content.
> > +      content-xml-link will output an XML link with image to the content.
> > +      This link will retrieve the content as an XDoc. If you want to
> > +      retrieve the source use content-source-xml-link.ft.
> >      </description>
> >      <usage><![CDATA[<forrest:contract name="content-xml-link"/>]]></usage>
> >      <forrest:template
> > 
> > Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml
> > URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml?rev=264872&r1=264871&r2=264872&view=diff
> > ==============================================================================
> > --- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml (original)
> > +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates/export-link.vt.xml Tue Aug 30 14:32:55 2005
> > @@ -18,7 +18,7 @@
> > 
> >  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0" >
> >    <forrest:hook name="export-link">
> > -    <forrest:contract name="content-xml-link"/>
> > +    <forrest:contract name="content-source-xml-link"/>
> >      <forrest:contract name="content-pdf-link"/>
> >    </forrest:hook>
> >  </forrest:template>
> > 
> > 
> >


Re: svn commit: r264872 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates: content-source-xml-link.ft content-xml-link.ft export-link.vt.xml

Posted by Thorsten Scherler <th...@apache.org>.
On Sun, 2005-09-04 at 04:30 +0200, Thorsten Scherler wrote:

> You have been faster. ;-)

BTW it is really nice working with you, you pointed us again in the
right direction. Thanks. That is a good example for all of us to
follow. :)

Muchas gracias.
-- 
thorsten

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


Re: svn commit: r264872 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.viewHelper.xhtml/resources/templates: content-source-xml-link.ft content-xml-link.ft export-link.vt.xml

Posted by Thorsten Scherler <th...@apache.org>.
On Sat, 2005-09-03 at 17:50 -0400, Tim Williams wrote:
> A couple questions on this one...
> o) export-link-vt.xml 
> - why is the filename xml instead of ft?  
http://marc.theaimsgroup.com/?l=forrest-dev&m=112129152002511&w=2
export-link.vt.xml that is the same move like Ross *.source.xml. 
http://marc.theaimsgroup.com/?t=112548740800003&r=1&w=2
We need to really harmonize the file naming conventions for
forrest:views. :( 

> o) It appears that the sitemap entry that might make this work may
> have been committed to the resume plugin but not the views stuff?
> 
> The second one appears to be causing FOR-662.  I'll try to look more
> into the second one tonight -- a simple cut-n-paste across xmap
> entries from resume to views didn't work.
> 

The contract is broken because of the revision link provided by Ross. 

You have been faster. ;-)
My version was:
<!--Fixme: delete comment after review
          I have never seen the following before
          <map:serialize select="cocoon:/{1}.xml"/>
          I guess it should be -->
<map:generate src="cocoon:/{1}.xml" />

salu2
-- 
thorsten

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