Add a parameter, <computeWadlPathFromDocbookPath>1</computeWadlPathFromDocbookPath>, to allow Jorge to preserve the dir structure of his wadl source in the target dir.
This commit is contained in:
		@@ -93,6 +93,16 @@ public abstract class PDFMojo extends AbstractFoMojo {
 | 
			
		||||
     */
 | 
			
		||||
    private String trimWadlUriCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Controls how the path to the wadl is calculated. If 0 or not set, then 
 | 
			
		||||
     * The xslts look for the normalized wadl in /generated-resources/xml/xslt/.
 | 
			
		||||
     * Otherwise, in /generated-resources/xml/xslt/path/to/docbook-src, e.g.
 | 
			
		||||
     * /generated-resources/xml/xslt/src/docbkx/foo.wadl
 | 
			
		||||
     *
 | 
			
		||||
     * @parameter expression="${generate-pdf.compute.wadl.path.from.docbook.path}" default-value="0"
 | 
			
		||||
     */
 | 
			
		||||
    private String computeWadlPathFromDocbookPath;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    protected void setImageDirectory (File imageDirectory) {
 | 
			
		||||
        this.imageDirectory = imageDirectory;
 | 
			
		||||
@@ -272,7 +282,8 @@ public abstract class PDFMojo extends AbstractFoMojo {
 | 
			
		||||
 | 
			
		||||
	transformer.setParameter("docbook.infile",sourceDocBook.getAbsolutePath());
 | 
			
		||||
	transformer.setParameter("source.directory",sourceDirectory);
 | 
			
		||||
 | 
			
		||||
	transformer.setParameter("compute.wadl.path.from.docbook.path",computeWadlPathFromDocbookPath);
 | 
			
		||||
	
 | 
			
		||||
        transformer.setParameter ("admon.graphics.path", imageDirectory.getAbsolutePath()+File.separator);
 | 
			
		||||
        transformer.setParameter ("callout.graphics.path", calloutDirectory.getAbsolutePath()+File.separator);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -110,6 +110,17 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo {
 | 
			
		||||
     */
 | 
			
		||||
    private String trimWadlUriCount;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Controls how the path to the wadl is calculated. If 0 or not set, then 
 | 
			
		||||
     * The xslts look for the normalized wadl in /generated-resources/xml/xslt/.
 | 
			
		||||
     * Otherwise, in /generated-resources/xml/xslt/path/to/docbook-src, e.g.
 | 
			
		||||
     * /generated-resources/xml/xslt/src/docbkx/foo.wadl
 | 
			
		||||
     *
 | 
			
		||||
     * @parameter expression="${generate-webhelp.compute.wadl.path.from.docbook.path}" default-value="0"
 | 
			
		||||
     */
 | 
			
		||||
    private String computeWadlPathFromDocbookPath;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * DOCUMENT ME!
 | 
			
		||||
   *
 | 
			
		||||
@@ -156,6 +167,7 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo {
 | 
			
		||||
   sourceDirectory = sourceDocBook.getParentFile();
 | 
			
		||||
   transformer.setParameter("docbook.infile",sourceDocBook.getAbsolutePath());
 | 
			
		||||
   transformer.setParameter("source.directory",sourceDirectory);
 | 
			
		||||
   transformer.setParameter("compute.wadl.path.from.docbook.path",computeWadlPathFromDocbookPath);
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,19 +8,10 @@
 | 
			
		||||
	<!-- <xsl:output indent="yes"/>    -->
 | 
			
		||||
 | 
			
		||||
	<xsl:param name="project.build.directory">../../target</xsl:param>
 | 
			
		||||
	<xsl:param name="docbook.infile"/>
 | 
			
		||||
	<xsl:param name="project.directory" select="substring-before($project.build.directory,'/target')"/>
 | 
			
		||||
	<xsl:param name="source.directory"/>
 | 
			
		||||
	<xsl:param name="docbook.partial.path">
 | 
			
		||||
	  <xsl:call-template name="getUrl">
 | 
			
		||||
	    <xsl:with-param name="path" select="substring-after($docbook.infile,$source.directory)"/>
 | 
			
		||||
	  </xsl:call-template>
 | 
			
		||||
	</xsl:param>
 | 
			
		||||
	<xsl:param name="docbook.partial.path.adjusted">
 | 
			
		||||
	  <xsl:choose>
 | 
			
		||||
	    <xsl:when test="$docbook.partial.path=''">/</xsl:when>
 | 
			
		||||
	    <xsl:otherwise><xsl:value-of select="$docbook.partial.path"/></xsl:otherwise>
 | 
			
		||||
	  </xsl:choose>
 | 
			
		||||
	</xsl:param>
 | 
			
		||||
	<xsl:param name="docbook.partial.path" select="concat(substring-after($source.directory,$project.directory),'/')"/>
 | 
			
		||||
	<xsl:param name="compute.wadl.path.from.docbook.path" select="'0'"/>
 | 
			
		||||
 | 
			
		||||
	<xsl:param name="trim.wadl.uri.count">0</xsl:param>
 | 
			
		||||
 | 
			
		||||
@@ -44,7 +35,7 @@
 | 
			
		||||
			<!-- 
 | 
			
		||||
			 Here we build a summary template for whole reference. 
 | 
			
		||||
  			 Combine the tables for a section into one big table
 | 
			
		||||
		    -->
 | 
			
		||||
			-->
 | 
			
		||||
			<informaltable rules="all">
 | 
			
		||||
				<col width="10%"/>
 | 
			
		||||
				<col width="40%"/>
 | 
			
		||||
@@ -141,22 +132,6 @@
 | 
			
		||||
	  <xsl:apply-templates
 | 
			
		||||
	      select="document(concat('file:///', $wadl.path))//wadl:resource[@id = $resourceId]/wadl:method[@rax:id = current()/@href]"
 | 
			
		||||
	      mode="method-rows"/>  
 | 
			
		||||
 | 
			
		||||
			<xsl:message>
 | 
			
		||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 | 
			
		||||
				<xsl:value-of
 | 
			
		||||
				    select="$wadl.path"
 | 
			
		||||
				/>
 | 
			
		||||
 | 
			
		||||
				.="<xsl:copy-of select="."/>"
 | 
			
		||||
				-----------------------------
 | 
			
		||||
				<xsl:apply-templates
 | 
			
		||||
				    select="document(concat('file:///', $wadl.path))//wadl:resource[@id = $resourceId]/wadl:method[@rax:id = current()/@href]"
 | 
			
		||||
				    mode="method-rows"/>  
 | 
			
		||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 | 
			
		||||
			</xsl:message>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	</xsl:template>
 | 
			
		||||
 | 
			
		||||
	<xsl:template match="wadl:resource" mode="preprocess">
 | 
			
		||||
@@ -477,19 +452,24 @@
 | 
			
		||||
					<xsl:with-param name="path" select="substring-before($path,'#')"/>
 | 
			
		||||
				</xsl:call-template>
 | 
			
		||||
			</xsl:when>
 | 
			
		||||
			<!-- <xsl:when test="contains($path,'\')"> -->
 | 
			
		||||
			<!-- 	<xsl:call-template name="wadlPath"> -->
 | 
			
		||||
			<!-- 		<xsl:with-param name="path" select="substring-after($path,'\')"/> -->
 | 
			
		||||
			<!-- 	</xsl:call-template> -->
 | 
			
		||||
			<!-- </xsl:when> -->
 | 
			
		||||
			<!-- <xsl:when test="contains($path,'/')"> -->
 | 
			
		||||
			<!-- 	<xsl:call-template name="wadlPath"> -->
 | 
			
		||||
			<!-- 		<xsl:with-param name="path" select="substring-after($path,'/')"/> -->
 | 
			
		||||
			<!-- 	</xsl:call-template> -->
 | 
			
		||||
			<!-- </xsl:when> -->
 | 
			
		||||
			<xsl:when test="$compute.wadl.path.from.docbook.path = '0' and contains($path,'\')">
 | 
			
		||||
				<xsl:call-template name="wadlPath">
 | 
			
		||||
					<xsl:with-param name="path" select="substring-after($path,'\')"/>
 | 
			
		||||
				</xsl:call-template>
 | 
			
		||||
			</xsl:when>
 | 
			
		||||
			<xsl:when test="$compute.wadl.path.from.docbook.path = '0' and contains($path,'/')">
 | 
			
		||||
				<xsl:call-template name="wadlPath">
 | 
			
		||||
					<xsl:with-param name="path" select="substring-after($path,'/')"/>
 | 
			
		||||
				</xsl:call-template>
 | 
			
		||||
			</xsl:when>
 | 
			
		||||
			<xsl:when test="$compute.wadl.path.from.docbook.path = '0'">
 | 
			
		||||
				<xsl:value-of
 | 
			
		||||
				    select="concat($project.build.directory, '/generated-resources/xml/xslt/',$path)"
 | 
			
		||||
				/>
 | 
			
		||||
			</xsl:when>
 | 
			
		||||
			<xsl:otherwise>
 | 
			
		||||
				<xsl:value-of
 | 
			
		||||
				    select="concat($project.build.directory, '/generated-resources/xml/xslt',$docbook.partial.path.adjusted,$path)"
 | 
			
		||||
				    select="concat($project.build.directory, '/generated-resources/xml/xslt',$docbook.partial.path,$path)"
 | 
			
		||||
				/>
 | 
			
		||||
			</xsl:otherwise>
 | 
			
		||||
		</xsl:choose>
 | 
			
		||||
@@ -517,19 +497,5 @@
 | 
			
		||||
			</xsl:otherwise>
 | 
			
		||||
		</xsl:choose>
 | 
			
		||||
	</xsl:template>
 | 
			
		||||
 | 
			
		||||
	<xsl:template name="getUrl">
 | 
			
		||||
	  <xsl:param name="path" />
 | 
			
		||||
	  <xsl:choose>
 | 
			
		||||
	    <xsl:when test="contains($path,'/')">
 | 
			
		||||
	      <xsl:value-of select="substring-before($path,'/')" />
 | 
			
		||||
	      <xsl:text>/</xsl:text>
 | 
			
		||||
	      <xsl:call-template name="getUrl">
 | 
			
		||||
		<xsl:with-param name="path" select="substring-after($path,'/')" />
 | 
			
		||||
	      </xsl:call-template>
 | 
			
		||||
	    </xsl:when>
 | 
			
		||||
	    <xsl:otherwise />
 | 
			
		||||
	  </xsl:choose>
 | 
			
		||||
	</xsl:template>
 | 
			
		||||
	
 | 
			
		||||
</xsl:stylesheet>
 | 
			
		||||
		Reference in New Issue
	
	Block a user