You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Mark R. Diggory" <md...@latte.harvard.edu> on 2003/04/07 18:23:00 UTC

Trying to generate my own navigation.

I've been trying to generate my own navigation content using maven.xml 
Here's an example attached:

The problem arises that the default "namespace" conflicts for the 
navigation base tag "project" and the Maven "project" tag. I've tried to 
output escape this tag, place it in CDATA and try to map it to an 
alternate prefix, all of which cause the rest of the xdoc generation of 
the navigation to fail.

<*project* xmlns:j="jelly:core" xmlns:maven="jelly:maven" 
xmlns:ant="jelly:ant">
    <preGoal name="xdoc:transform">
       ...
       <j:file name="${basedir}/xdocs/navigation.xml" prettyPrint="true">
          <*project* name="MRD Projects" href="...">
             <title>Projects</title>
             <body>
                <menu name="Projects">
                    ...
                </menu>
             </body>
           </*project*>
	</j:file>
   </preGoal>

</*project*>

I'd like to be able to use a strategy like this because it is relatively 
simple in idea and doesn't require Velocity or other templating engines 
to generate the navigation.xml. Is there any solutions anyone might be 
able to point out to me here?

Note, this solution works great for all other kinds of xdoc generation 
because there are no tagname conflicts between those tag names and the 
"site" tag library. Maybe it would be logical to refactor the navigation 
xdoc structure to not have a *project* tag?

-Mark Diggory



Re: Trying to generate my own navigation.

Posted by "Mark R. Diggory" <md...@latte.harvard.edu>.
I think I found my own solution (two of them).

First solution:

1.) I placed the navigation generation code in to a new file 
"navigation.jelly"

2.) I included navigation.jelly into maven.xml inside the file tag.

3.) I forced the jelly:core taglibrary to map into the default 
prefix/namespace like this.

<?xml version="1.0"?>
<jelly xmlns="jelly:core" xmlns:maven="jelly:maven">

This effectively eliminated the *site* taglibrary from intercepting the 
project tag.


Second Solution:

I wrapped the *project* tag in maven.xml with a set of jelly tags with 
the defualt namespace = "jelly:core"

<*project* xmlns:j="jelly:core" xmlns:maven="jelly:maven"
  xmlns:ant="jelly:ant">
     <preGoal name="xdoc:transform">
        ...
        <j:file name="${basedir}/xdocs/navigation.xml" prettyPrint="true">
	<jelly xmlns="jelly:core">
           <*project* name="MRD Projects" href="...">
              <title>Projects</title>
              <body>
                 <menu name="Projects">
                     ...
                 </menu>
              </body>
            </*project*>
          </jelly>
      </j:file>
    </preGoal>
</*project*>

this accomplishes the same feat as in the external file only internal in 
maven.xml.

-Mark

Mark R. Diggory wrote:
> I've been trying to generate my own navigation content using maven.xml 
> Here's an example attached:
> 
> The problem arises that the default "namespace" conflicts for the 
> navigation base tag "project" and the Maven "project" tag. I've tried to 
> output escape this tag, place it in CDATA and try to map it to an 
> alternate prefix, all of which cause the rest of the xdoc generation of 
> the navigation to fail.
> 
> <*project* xmlns:j="jelly:core" xmlns:maven="jelly:maven" 
> xmlns:ant="jelly:ant">
>    <preGoal name="xdoc:transform">
>       ...
>       <j:file name="${basedir}/xdocs/navigation.xml" prettyPrint="true">
>          <*project* name="MRD Projects" href="...">
>             <title>Projects</title>
>             <body>
>                <menu name="Projects">
>                    ...
>                </menu>
>             </body>
>           </*project*>
>     </j:file>
>   </preGoal>
> 
> </*project*>
> 
> I'd like to be able to use a strategy like this because it is relatively 
> simple in idea and doesn't require Velocity or other templating engines 
> to generate the navigation.xml. Is there any solutions anyone might be 
> able to point out to me here?
> 
> Note, this solution works great for all other kinds of xdoc generation 
> because there are no tagname conflicts between those tag names and the 
> "site" tag library. Maybe it would be logical to refactor the navigation 
> xdoc structure to not have a *project* tag?
> 
> -Mark Diggory
> 
> 
> 
> ------------------------------------------------------------------------
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <project xmlns:j="jelly:core" xmlns:maven="jelly:maven" xmlns:ant="jelly:ant">
> 	<preGoal name="xdoc:transform">
> 		<maven:reactor basedir="${basedir}" includes="taglibraries/**/project.xml" postProcessing="true" ignoreFailures="false"/>
> 		<j:file name="${basedir}/xdocs/navigation.xml" prettyPrint="true">
> 			<project name="MRD Projects" href="http://repast-jellytag.sourceforge.net/">
> 				<title>Projects</title>
> 				<body>
> 					<menu name="Projects">
> 						<item name="Home" href="http://repast-jellytag.sourceforge.net/index.html"/>
> 						<item name="Downloads" href="http://sourceforge.net/project/showfiles.php?group_id=70964"/>
> 						<item name="Building" href="http://repast-jellytag.sourceforge.net/building.html"/>
> 						<item name="Tag Libraries" href="http://repast-jellytag.sourceforge.net/tags.html" collapse="true">
> 							<j:forEach items="${reactorProjects}" var="reactorProject">
> 								<item name="${reactorProject.name}" href="${reactorProject.url}/index.html" collapse="true">
> 									<item name="Tag Doc" href="${reactorProject.url}/tags.html"/>
> 									<item name="Java Doc" href="${reactorProject.url}/apidocs/index.html"/>
> 									<item name="Source XRef" href="${reactorProject.url}/xref/index.html"/>
> 									<item name="Source Repository" href="${reactorProject.repository.url}"/>
> 								</item>
> 							</j:forEach>
> 						</item>
> 					</menu>
> 				</body>
> 			</project>
> 		</j:file>
> 	</preGoal>
> </project>
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org