On Fri, 2006-05-05 at 16:28 +0100, Ross Gardler wrote:
> [EMAIL PROTECTED] wrote:
> > Automated build for cocoon-docs FAILED
> 
> ...
> 
> >      [java] X [0]                                     
> > 2.1/userdocs/widgets/javadoc:org.apache.cocoon.forms.formmodel.tree.TreeModel
> >  BROKEN: No pipeline matched request: 
> > 2.1/userdocs/widgets/javadoc:org.apache.cocoon.forms.formmodel.tree.TreeModel
> >      [java] X [0]                                     
> > 2.1/userdocs/widgets/javadoc:org.apache.cocoon.forms.formmodel.tree.Tree    
> >   BROKEN: No pipeline matched request: 
> > 2.1/userdocs/widgets/javadoc:org.apache.cocoon.forms.formmodel.tree.Tree
> >      [java] X [0]                                     
> > 2.1/userdocs/widgets/javadoc:org.apache.cocoon.forms.formmodel.tree.TreeWalker
> >         BROKEN: No pipeline matched request: 
> > 2.1/userdocs/widgets/javadoc:org.apache.cocoon.forms.formmodel.tree.TreeWalker
> 
> This looks like someone has used a javadoc: protocol in the source 
> files. Unfortunately, Daisy does not recognise
> 
> We can see which pages contain these broken links by lookig at:
> 
> http://forrest.zones.apache.org/ft/build/cocoon-docs/broken-links.xml
> 
> That leads us to:
> 
> http://forrest.zones.apache.org/ft/build/cocoon-docs/2.1/userdocs/widgets/widget_tree.html
> 
> from where we can get to the Daisy source page by following the edit 
> link at the bottom of the page:
> 
> http://cocoon.zones.apache.org/daisy/documentation/864/forms/widgets/739.html
> 
> In this document we can see that daisy is using a pseudo protocol of 
> "javadoc:". This protocol is not processed by Daisy when publiching the 
> XML version of the document, and Forrest knows nothing of this 
> pseudo-protocol.
> 
> However, all is not lost. I recall reading on the Daisy dev list that it 
> uses Forrests locationmap code to handle psuedo protocols like this. if 
> someone can point me at how this is done within Daisy I'll look at 
> making the forrest publication honour the protocol. Alternatively, we 
> need the XML source to contain the URI that this resolves to.

Oops! I knew there was some reason I couldn't use this feature yet, but
had forgotten about it.

Below is the information about how it is configured. If it would be too
inconvenient to add it to forrest right now, I can remove the usages of
"javadoc:" in the document itself (though its *very* handy).

The link transformer is configured like this:

    <map:transformer logger="sitemap.transformer.linkrewriter"
name="linkrewriter"
      pool-grow="2" pool-max="32" pool-min="2"
      src="org.apache.cocoon.transformation.LinkRewriterTransformer">
      <schemes>javadoc</schemes>
      <link-attrs>href</link-attrs>
    </map:transformer>

In cocoon.xconf this input module is defined:

    <component-instance name="javadoc"
      class="org.apache.forrest.locationmap.LocationMapModule"
      logger="sitemap.modules.locationmap">
      <file src="context://daisy/javadoc_locationmap.xml"/>
    </component-instance>

and the javadoc_locationmap.xml file is attached.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]                          [EMAIL PROTECTED]
<?xml version="1.0"?>
<locationmap xmlns="http://apache.org/forrest/locationmap/1.0";>

  <components>
    <matchers default="lm">
      <matcher 
        name="lm" 
        src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
      <matcher 
        name="regexp-lm" 
        src="org.apache.forrest.locationmap.RegexpLocationMapMatcher"/>
    </matchers>
  </components>

  <locator>

    <!-- Note: we're using the 'flow-attr' input module below to translates dots to slashes,
         though of course this is not at all related to flow attributes, we're just using
         the JXPath-support of that input module. Don't know if there's a nicer way to do
         this -->
    <match pattern="org.apache.cocoon.*">
      <location
        src="http://cocoon.apache.org/2.1/apidocs/{flow-attr:translate('{0}', '.', '/')}.html"/>
    </match>

    <match pattern="java.*">
      <location
        src="http://java.sun.com/j2se/1.5.0/docs/api/{flow-attr:translate('{0}', '.', '/')}.html"/>
    </match>

    <match pattern="javax.*">
      <location
        src="http://java.sun.com/j2se/1.5.0/docs/api/{flow-attr:translate('{0}', '.', '/')}.html"/>
    </match>

    <match pattern="org.w3c.dom.*">
      <location
        src="http://java.sun.com/j2se/1.5.0/docs/api/{flow-attr:translate('{0}', '.', '/')}.html"/>
    </match>

    <match pattern="org.xml.sax.*">
      <location
        src="http://java.sun.com/j2se/1.5.0/docs/api/{flow-attr:translate('{0}', '.', '/')}.html"/>
    </match>

  </locator>
</locationmap>