[hibernate-commits] Hibernate SVN: r11701 - in trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook: gen and 4 other directories.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Fri Jun 22 16:55:40 EDT 2007
Author: steve.ebersole at jboss.com
Date: 2007-06-22 16:55:40 -0400 (Fri, 22 Jun 2007)
New Revision: 11701
Added:
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/RenderingException.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/XSLTException.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/BasicFormatHandler.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/FormatHandler.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/FormatHandlerFactory.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/PdfFormatHandler.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/util/Formatting.java
Removed:
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/render/
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/XSLTException.java
Modified:
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/AbstractDocBookMojo.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/GenerationMojo.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/Options.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/PackageMojo.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/ResourceMojo.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/TranslationDiffReport.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/TransformerFactory.java
trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/resolve/ExplicitUrnResolver.java
Log:
worked out install/deploy issues + attached artifacts
Modified: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/AbstractDocBookMojo.java
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/AbstractDocBookMojo.java 2007-06-22 19:39:47 UTC (rev 11700)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/AbstractDocBookMojo.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -16,27 +16,37 @@
package org.jboss.maven.plugin.docbook;
import java.io.File;
+import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.apache.maven.doxia.siterenderer.Renderer;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
-import org.jboss.maven.plugin.docbook.gen.render.Formatting;
-import org.jboss.maven.plugin.docbook.gen.render.RenderingException;
+import org.jboss.maven.plugin.docbook.gen.RenderingException;
+import org.jboss.maven.plugin.docbook.gen.XSLTException;
+import org.jboss.maven.plugin.docbook.gen.util.Formatting;
import org.jboss.maven.plugin.docbook.gen.util.StandardDocBookFormatSpecification;
-import org.jboss.maven.plugin.docbook.gen.xslt.XSLTException;
/**
* Basic support for the various DocBook mojos in this package. Mainly, we are
* defining common configuration attributes of the packaging.
- *
+ * <p/>
+ * todo : I'd much prefer to see the "partial artifact coord" stuff go away
+ * and use custom package types to convey this information. This frees the
+ * user from duplicate entry of the information.
+ *
* @author Steve Ebersole
*/
public abstract class AbstractDocBookMojo extends AbstractMojo {
- /**
+ public static final String PLUGIN_NAME = "jboss-docbook";
+
+ /**
* INTERNAL : The project being built
*
* @parameter expression="${project}"
@@ -75,6 +85,24 @@
protected ArchiverManager archiverManager;
/**
+ * INTERNAL : used in the translation diff report
+ *
+ * @parameter expression="${component.org.apache.maven.doxia.siterenderer.Renderer}"
+ * @required
+ * @readonly
+ */
+ protected Renderer siteRenderer;
+
+ /**
+ * INTERNAL : used during packaging to attach produced artifacts
+ *
+ * @parameter expression="${component.org.apache.maven.project.MavenProjectHelper}"
+ * @required
+ * @readonly
+ */
+ protected MavenProjectHelper projectHelper;
+
+ /**
* The name of the document (relative to sourceDirectory) which is the
* document to be rendered.
*
@@ -91,6 +119,27 @@
protected File sourceDirectory;
/**
+ * The directory containing local images
+ *
+ * @parameter expression="${basedir}/src/main/images"
+ */
+ protected File imagesDirectory;
+
+ /**
+ * The directory containing local css
+ *
+ * @parameter expression="${basedir}/src/main/css"
+ */
+ protected File cssDirectory;
+
+ /**
+ * The directory containing local fonts
+ *
+ * @parameter expression="${basedir}/src/main/fonts"
+ */
+ protected File fontsDirectory;
+
+ /**
* The directory where the output will be written.
*
* @parameter expression="${basedir}/target/docbook"
@@ -113,23 +162,49 @@
* The formats in which to perform rendering.
*
* @parameter
- * @required
+ * @required
*/
protected Format[] formats;
/**
+ * The artifactId of the master translation (unless, of course, this is the
+ * master translation). It is assumed that the master translation:<ol>
+ * <li>is part of the same groupId</li>
+ * <li>has its source defined as a dependency (classifier = source)</li>
+ * </ol>
+ *
+ * @parameter
+ */
+ protected String masterTranslationArtifactId;
+
+ /**
+ * Local path to the master translation to use for diff reporting.
+ *
+ * @parameter
+ */
+ protected File masterTranslationFile;
+
+ /**
+ * The relative path font configuration to use.
+ *
+ * @parameter
+ */
+ protected String fontConfig;
+
+ /**
* Configurable options
*
* @parameter
*/
protected Options options;
+
/**
* The override method to perform the actual processing of the
* mojo.
*
* @param formattings The fomattings configured for render
- * @throws RenderingException
+ * @throws org.jboss.maven.plugin.docbook.gen.RenderingException
* @throws XSLTException
*/
protected abstract void process(Formatting[] formattings) throws RenderingException, XSLTException;
@@ -153,4 +228,28 @@
}
return formattings;
}
+
+ protected static interface ArtifactProcessor {
+ public void process(org.apache.maven.artifact.Artifact artifact);
+ }
+
+ protected void processArtifacts(ArtifactProcessor processor) {
+ processProjectArtifacts( processor );
+ processPluginArtifacts( processor );
+ }
+
+ protected void processProjectArtifacts(ArtifactProcessor processor) {
+ processArtifacts( processor, projectArtifacts );
+ }
+
+ protected void processPluginArtifacts(ArtifactProcessor processor) {
+ processArtifacts( processor, pluginArtifacts );
+ }
+
+ private void processArtifacts(ArtifactProcessor processor, Collection artifacts) {
+ Iterator itr = artifacts.iterator();
+ while ( itr.hasNext() ) {
+ processor.process( ( org.apache.maven.artifact.Artifact ) itr.next() );
+ }
+ }
}
Modified: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/GenerationMojo.java
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/GenerationMojo.java 2007-06-22 19:39:47 UTC (rev 11700)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/GenerationMojo.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -18,10 +18,11 @@
import java.io.File;
import org.codehaus.plexus.util.FileUtils;
-import org.jboss.maven.plugin.docbook.gen.render.Formatting;
-import org.jboss.maven.plugin.docbook.gen.render.RendererFactory;
-import org.jboss.maven.plugin.docbook.gen.render.RenderingException;
-import org.jboss.maven.plugin.docbook.gen.xslt.XSLTException;
+import org.jboss.maven.plugin.docbook.gen.util.Formatting;
+import org.jboss.maven.plugin.docbook.gen.format.FormatHandlerFactory;
+import org.jboss.maven.plugin.docbook.gen.RenderingException;
+import org.jboss.maven.plugin.docbook.gen.XSLTException;
+import org.apache.maven.artifact.Artifact;
/**
* A DocBook plugin based on the excellent docbkx-maven-plugin, but which
@@ -50,17 +51,47 @@
FileUtils.mkdir( targetDirectory.getAbsolutePath() );
}
- RendererFactory rendererFactory = new RendererFactory(
+ if ( options.getDocbookVersion() == null ) {
+ processArtifacts(
+ new ArtifactProcessor() {
+ public void process(Artifact artifact) {
+ if ( "net.sf.docbook".equals( artifact.getGroupId() ) &&
+ "docbook".equals( artifact.getArtifactId() ) ) {
+ getLog().debug( "Found docbook version : " + artifact.getVersion() );
+ if ( options.getDocbookVersion() != null ) {
+ getLog().warn( "found multiple docbook versions" );
+ }
+ options.setDocbookVersion( artifact.getVersion() );
+ }
+ }
+ }
+ );
+ }
+
+ File fontConfigFile = null;
+ if ( fontConfig != null ) {
+ getLog().debug( "checking for fontConfig existence [" + fontConfig + "]" );
+ if ( stagingDirectory != null ) {
+ File tmp = new File( stagingDirectory, fontConfig );
+ if ( tmp.exists() ) {
+ getLog().info( "using font configuration : " + tmp.getAbsolutePath() );
+ fontConfigFile = tmp;
+ }
+ }
+ }
+
+ FormatHandlerFactory formatHandlerFactory = new FormatHandlerFactory(
options,
source,
targetDirectory,
stagingDirectory,
+ fontConfigFile,
project,
getLog()
);
for ( int i = 0; i < formattings.length; i++ ) {
- rendererFactory.buildRenderer( formattings[i] ).render( source );
+ formatHandlerFactory.buildFormatHandler( formattings[i] ).render( source );
}
}
Modified: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/Options.java
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/Options.java 2007-06-22 19:39:47 UTC (rev 11700)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/Options.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -28,12 +28,6 @@
private String xmlTransformerType;
private Properties transformerParameters;
private boolean useRelativeImageUris = true;
- // TODO : try as hard as I possibly can to remove this :(
- // this is gettable either from (1) VERSION (fm:project/fm:Version) or
- // (2) the dependencies making up the execution classpath
- //
- // In #1, it would require hand parsing :(, and #2 I've yet to actually
- // find a wsay to do this...
private String docbookVersion;
public Options() {
@@ -77,4 +71,8 @@
public String getDocbookVersion() {
return docbookVersion;
}
+
+ void setDocbookVersion(String docbookVersion) {
+ this.docbookVersion = docbookVersion;
+ }
}
Modified: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/PackageMojo.java
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/PackageMojo.java 2007-06-22 19:39:47 UTC (rev 11700)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/PackageMojo.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -15,13 +15,16 @@
*/
package org.jboss.maven.plugin.docbook;
-import org.jboss.maven.plugin.docbook.gen.render.Formatting;
-import org.jboss.maven.plugin.docbook.gen.render.RenderingException;
+import java.io.File;
+import org.jboss.maven.plugin.docbook.gen.util.Formatting;
+import org.jboss.maven.plugin.docbook.gen.RenderingException;
+import org.jboss.maven.plugin.docbook.gen.format.FormatHandlerFactory;
+
/**
* This mojo's purpose within the plugin/packaging is to bundle the individual
- * formats into deployable bundles. Note that some formats (PDF, e.g.) are
- * already in a deployable bundle.
+ * formats into deployable formats. Note that some formats (PDF, e.g.) are
+ * already deployable.
* <p/>
* After bundling, each bundle is then attached to the project
*
@@ -33,5 +36,21 @@
*/
public class PackageMojo extends AbstractDocBookMojo {
protected void process(Formatting[] formattings) throws RenderingException {
+ File source = new File( sourceDirectory, sourceDocumentName );
+ FormatHandlerFactory formatHandlerFactory = new FormatHandlerFactory(
+ options,
+ source,
+ targetDirectory,
+ stagingDirectory,
+ null,
+ project,
+ getLog()
+ );
+
+ project.getArtifact().setFile( project.getFile() );
+
+ for ( int i = 0; i < formattings.length; i++ ) {
+ formatHandlerFactory.buildFormatHandler( formattings[i] ).attachOutput( source, projectHelper );
+ }
}
}
Modified: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/ResourceMojo.java
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/ResourceMojo.java 2007-06-22 19:39:47 UTC (rev 11700)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/ResourceMojo.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -17,21 +17,18 @@
import java.io.File;
import java.io.IOException;
-import java.lang.reflect.Field;
-import java.util.List;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Iterator;
+import java.util.List;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.resources.ResourcesMojo;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
-import org.jboss.maven.plugin.docbook.gen.render.Formatting;
-import org.jboss.maven.plugin.docbook.gen.render.RenderingException;
-import org.jboss.maven.plugin.docbook.gen.xslt.XSLTException;
+import org.codehaus.plexus.util.FileUtils;
+import org.jboss.maven.plugin.docbook.gen.util.Formatting;
+import org.jboss.maven.plugin.docbook.gen.RenderingException;
+import org.jboss.maven.plugin.docbook.gen.XSLTException;
/**
* This mojo's purpose within the plugin/packaging is to process resources
@@ -49,78 +46,76 @@
protected void process(Formatting[] formattings) throws RenderingException, XSLTException {
processProjectResources();
- processDependencyResources( collectDocBookResourceDependentArtifacts() );
+ processDependencySupportArtifacts( collectDocBookSupportDependentArtifacts() );
}
- private Artifact[] collectDocBookResourceDependentArtifacts() {
- List artifacts = new ArrayList();
- addDocBookResourceArtifacts( artifacts, projectArtifacts );
- addDocBookResourceArtifacts( artifacts, pluginArtifacts );
- return ( Artifact[] ) artifacts.toArray( new Artifact[ artifacts.size() ] );
- }
+ // project local resources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- private void addDocBookResourceArtifacts(Collection target, Collection source) {
- Iterator itr = source.iterator();
- while ( itr.hasNext() ) {
- final Artifact artifact = ( Artifact ) itr.next();
- if ( "docbook-xslt".equals( artifact.getType() ) ||
- "docbook-resources".equals( artifact.getType() ) ) {
- target.add( artifact );
- }
- // temp...
- else if ( "docbook-xslt".equals( artifact.getArtifactId() ) ) {
- target.add( artifact );
- }
- }
+ private void processProjectResources() throws RenderingException {
+ copySource( imagesDirectory, new File( stagingDirectory, "images" ) );
+ copySource( cssDirectory, new File( stagingDirectory, "css" ) );
+ copySource( fontsDirectory, new File( stagingDirectory, "fonts" ) );
}
- private void processProjectResources() throws RenderingException {
- ResourcesMojo mavenResourcesMojo = new ResourcesMojo();
- injectMojoValue( mavenResourcesMojo, "outputDirectory", stagingDirectory.getAbsolutePath() );
- injectMojoValue( mavenResourcesMojo, "resources", project.getResources() );
- injectMojoValue( mavenResourcesMojo, "project", project );
- injectMojoValue( mavenResourcesMojo, "filters", project.getBuild().getFilters() );
- mavenResourcesMojo.setLog( getLog() );
- try {
- mavenResourcesMojo.execute();
+ private void copySource(File sourceDirectory, File targetDirectory)
+ throws RenderingException {
+ getLog().info( "attempting to copy directory : " + sourceDirectory.getAbsolutePath() );
+ if ( !sourceDirectory.exists() ) {
+ return;
}
- catch ( MojoExecutionException e ) {
- throw new RenderingException( "unable to process project resources" );
+ String[] list = sourceDirectory.list();
+ if ( list == null || list.length == 0 ) {
+ return;
}
- }
- private void injectMojoValue(ResourcesMojo mavenResourcesMojo, String name, Object value) throws RenderingException {
+ if ( !targetDirectory.exists() ) {
+ targetDirectory.mkdirs();
+ }
+
try {
- Field field = ResourcesMojo.class.getDeclaredField( name );
- if ( !field.isAccessible() ) {
- field.setAccessible( true );
- }
- field.set( mavenResourcesMojo, value );
+ FileUtils.copyDirectoryStructure( sourceDirectory, targetDirectory );
}
- catch ( NoSuchFieldException e ) {
- throw new RenderingException( "unable to locate mojo property field [" + name + "]", e );
+ catch ( IOException e ) {
+ throw new RenderingException( "unable to copy source directory [" + sourceDirectory.getAbsolutePath() + "]", e );
}
- catch ( IllegalAccessException e ) {
- throw new RenderingException( "unable to access property field to set value", e );
- }
}
- private void processDependencyResources(Artifact[] resources)
- throws RenderingException {
- for ( int i = 0; i < resources.length; i++ ) {
- processDependencyResource( resources[i].getFile(), stagingDirectory );
+
+ // dependency support resources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ private List collectDocBookSupportDependentArtifacts() {
+ final ArrayList rtn = new ArrayList();
+ processArtifacts(
+ new ArtifactProcessor() {
+ public void process(Artifact artifact) {
+ if ( "docbook-support".equals( artifact.getType() ) ) {
+ rtn.add( artifact );
+ }
+ }
+ }
+ );
+ return rtn;
+ }
+
+ private void processDependencySupportArtifacts(List artifacts) throws RenderingException {
+ Iterator itr = artifacts.iterator();
+ while ( itr.hasNext() ) {
+ final Artifact supportArtifact = ( Artifact ) itr.next();
+ processDependencySupportArtifact( supportArtifact.getFile(), stagingDirectory );
}
}
- protected void processDependencyResource(File file, File target) throws RenderingException {
+ protected void processDependencySupportArtifact(File file, File target) throws RenderingException {
getLog().info( "unpacking dependency resource [" + file.getAbsolutePath() + "] to staging-dir [" + target.getAbsolutePath() + "]" );
try {
target.mkdirs();
- UnArchiver unArchiver = archiverManager.getUnArchiver( file );
+// :(
+// UnArchiver unArchiver = archiverManager.getUnArchiver( file );
+ UnArchiver unArchiver = archiverManager.getUnArchiver( "jar" );
unArchiver.setSourceFile( file );
unArchiver.setDestDirectory( target );
- unArchiver.extract();
- }
+ unArchiver.extract();
+ }
catch ( NoSuchArchiverException e ) {
throw new RenderingException( "Unknown archiver type", e );
}
Modified: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/TranslationDiffReport.java
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/TranslationDiffReport.java 2007-06-22 19:39:47 UTC (rev 11700)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/TranslationDiffReport.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -17,22 +17,18 @@
import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
-import org.apache.maven.doxia.siterenderer.Renderer;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.reporting.AbstractMavenReport;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.reporting.MavenReport;
import org.apache.maven.reporting.MavenReportException;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.jboss.maven.plugin.docbook.revdiff.IndexReportGenerator;
-import org.jboss.maven.plugin.docbook.revdiff.DiffCreator;
-import org.jboss.maven.plugin.docbook.revdiff.TranslationReportGenerator;
+import org.jboss.maven.plugin.docbook.gen.util.Formatting;
+import org.jboss.maven.plugin.docbook.gen.RenderingException;
import org.jboss.maven.plugin.docbook.revdiff.Diff;
+import org.jboss.maven.plugin.docbook.revdiff.DiffCreator;
import org.jboss.maven.plugin.docbook.revdiff.GenerationException;
+import org.jboss.maven.plugin.docbook.revdiff.TranslationReportGenerator;
/**
* A plugin for generating a "translation diff" report across different
@@ -43,103 +39,46 @@
* forward if it is decided to move to the xliff format for translations.
*
* @goal diff
+ * @phase site
+ * @requiresDependencyResolution
*
* @author Christian Bauer
* @author Steve Ebersole
*/
-public class TranslationDiffReport extends AbstractMavenReport {
+public class TranslationDiffReport extends AbstractDocBookMojo implements MavenReport {
- // todo : this is currently hosed; it has not been updated for the new packaging-based scheme...
-
public static final String NAME = "translation-diff-report";
+ private File reportOutputDirectory;
- /**
- * The directory containing the translated DocBook sources.
- *
- * @parameter expression="${basedir}/src/main/docbook/translations"
- * @required
- */
- private File translationsDirectory;
+ private ResourceBundle getBundle(Locale locale) {
+ return ResourceBundle.getBundle( NAME, locale, this.getClass().getClassLoader() );
+ }
- /**
- * Directory where reports will go.
- *
- * @parameter expression="${project.reporting.outputDirectory}"
- * @required
- * @readonly
- */
- private File reportingDirectory;
+ private String buildReportFileName() {
+ return getOutputName() + ".html";
+ }
- /**
- * Which translation is considered the master.
- *
- * @parameter default-value="en"
- */
- private String masterTranslation;
+ // AbstractDocBookMojo impl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
- * (non master) translations to be included in the report.
+ * Copied nearly verbatim from {@link org.apache.maven.reporting.AbstractMavenReport#execute()}
*
- * @parameter
+ * {@inheritDoc}
*/
- private String[] translationIncludes;
-
- /**
- * Patternsets of sources (relative to translationsDirectory) to include
- * in reporting.
- *
- * @parameter
- */
- private String[] sourceIncludes;
-
- /**
- * A boolean, indicating if XInclude should be supported.
- *
- * @parameter default-value="false"
- */
- private boolean xincludeSupported;
-
- /**
- * Whether to build an aggregated report at the root, or build individual reports.
- *
- * @parameter expression="${aggregate}" default-value="false"
- */
- protected boolean aggregate;
-
- /**
- * @parameter expression="${project}"
- * @required
- * @readonly
- */
- private MavenProject project;
-
- private File reportOutputDirectory;
-
- /**
- * @parameter expression="${component.org.apache.maven.doxia.siterenderer.Renderer}"
- * @required
- * @readonly
- */
- private Renderer siteRenderer;
-
- protected Renderer getSiteRenderer() {
- return siteRenderer;
+ protected void process(Formatting[] formattings) throws RenderingException {
+ try {
+ generateReport( Locale.getDefault() );
+ }
+ catch (GenerationException t) {
+ throw new RenderingException( "An error has occurred in " + NAME + " report generation.", t );
+ }
}
- protected MavenProject getProject() {
- return project;
- }
- public String getCategoryName() {
- return CATEGORY_PROJECT_REPORTS;
- }
+ // MavenReport impl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- protected String getOutputDirectory() {
- return getReportOutputDirectory().getAbsolutePath();
- }
-
public String getOutputName() {
- return "index";
+ return NAME;
}
public String getName(Locale locale) {
@@ -150,22 +89,17 @@
return getBundle( locale ).getString( "report.description" );
}
- private ResourceBundle getBundle(Locale locale) {
- return ResourceBundle.getBundle( NAME, locale, this.getClass().getClassLoader() );
+ public String getCategoryName() {
+ return CATEGORY_PROJECT_REPORTS;
}
public void setReportOutputDirectory(File dir) {
- if ( NAME.equals( dir.getName() ) ) {
- this.reportOutputDirectory = dir;
- }
- else {
- this.reportOutputDirectory = new File( dir, NAME );
- }
+ this.reportOutputDirectory = dir;
}
public File getReportOutputDirectory() {
if ( reportOutputDirectory == null ) {
- reportOutputDirectory = new File( reportingDirectory, NAME );
+ reportOutputDirectory = new File( project.getReporting().getOutputDirectory() );
}
return reportOutputDirectory;
}
@@ -175,62 +109,69 @@
}
public boolean canGenerateReport() {
- return true;
+ return masterTranslationArtifactId != null ||
+ ( masterTranslationFile != null && masterTranslationFile.exists() );
}
- protected void executeReport(Locale locale) throws MavenReportException {
- getLog().debug( "starting docbook:diff goal execution [masterTranslation=" + masterTranslation + "]" );
-
- if ( ! translationsDirectory.exists() ) {
- getLog().debug( "translations directory [" + translationsDirectory.getAbsolutePath() + "] did not exist" );
- return;
+ public void generate(org.codehaus.doxia.sink.Sink sink, Locale locale) throws MavenReportException {
+ try {
+ generateReport( locale );
}
+ catch ( GenerationException e ) {
+ throw new MavenReportException( "error generating report", e );
+ }
+ }
- File masterTranslationDirectory = new File( translationsDirectory, masterTranslation );
- if ( ! masterTranslationDirectory.exists() ) {
- getLog().info( "master translation directory [" + masterTranslationDirectory.getAbsolutePath() + "] did not exist" );
+
+ // report generation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ private void generateReport(Locale locale) throws GenerationException {
+ getLog().debug( "starting " + PLUGIN_NAME + ":diff goal execution" );
+
+ if ( !canGenerateReport() ) {
+ getLog().info( "project is documentation master (or no master defined)" );
return;
}
- if ( translationIncludes == null || translationIncludes.length == 0 ) {
- // use all translations...
- ArrayList includes = new ArrayList();
- File[] subdirs = translationsDirectory.listFiles();
- for ( int i = 0; i < subdirs.length; i++ ) {
- includes.add( subdirs[i].getName() );
- }
- translationIncludes = ( String[] ) includes.toArray( new String[ includes.size() ] );
+ File master = masterTranslationFile;
+ if ( master == null ) {
+ MasterTranslationLocator locator = new MasterTranslationLocator();
+ processArtifacts( locator );
+ master = locator.located.getFile();
}
-
- if ( sourceIncludes == null || sourceIncludes.length == 0 ) {
- sourceIncludes = new String[] { "*.xml" };
+ if ( master == null ) {
+ throw new GenerationException( "unable to locate master source" );
}
- List reports = new ArrayList();
- for ( int i = 0; i < translationIncludes.length; i++ ) {
- if ( masterTranslation.equals( translationIncludes[i] ) ) {
- continue;
- }
- final File translationDirectory = new File( translationsDirectory, translationIncludes[i] );
- if ( ! translationDirectory.exists() ) {
- getLog().info( "translation directory [" + translationDirectory.getAbsolutePath() + "] did not exist" );
- continue;
- }
+ File translation = new File( sourceDirectory, sourceDocumentName );
- if ( generateTranslationReport( masterTranslationDirectory, translationDirectory, translationIncludes[i] ) ) {
- reports.add(
- new IndexReportGenerator.TranslationReportDescriptor(
- new Locale( translationIncludes[i] ),
- NAME + "/" + buildTranslationReportName( translationIncludes[i] )
- )
- );
+ getLog().debug( " master : " + master.getAbsolutePath() );
+ getLog().debug( " translation : " + translation.getAbsolutePath() );
+
+ File output = new File( getReportOutputDirectory(), buildReportFileName() );
+ prepReportFile( output );
+
+ DiffCreator diffCreator = new DiffCreator( options.isXincludeSupported(), getLog() );
+ Diff diff = diffCreator.findDiff( master, translation );
+
+ TranslationReportGenerator generator = new TranslationReportGenerator( sourceDirectory, getBundle( locale ), getLog() );
+ generator.generate( diff, output, locale.toString() );
+ }
+
+ class MasterTranslationLocator implements ArtifactProcessor {
+ private final String groupId = project.getGroupId();
+ private Artifact located;
+ public void process(Artifact artifact) {
+ if ( groupId.equals( artifact.getGroupId() ) && masterTranslationArtifactId.equals( artifact.getArtifactId() ) ) {
+ if ( located != null ) {
+ getLog().warn( "duplicate matching master found" );
+ }
+ located = artifact;
}
}
-
- new IndexReportGenerator( getBundle( locale ), getSink(), getLog() ).generate( reports );
}
- private void prepReportFile(File reportFile) throws MavenReportException {
+ private void prepReportFile(File reportFile) throws GenerationException {
if ( reportFile.exists() ) {
reportFile.delete();
}
@@ -239,58 +180,8 @@
reportFile.createNewFile();
}
catch ( IOException e ) {
- throw new MavenReportException( "unable to prep report file [" + reportFile.getAbsolutePath() + "]" );
+ throw new GenerationException( "unable to prep report file [" + reportFile.getAbsolutePath() + "]" );
}
}
}
-
- private String buildTranslationReportName(String translationName) {
- return "report-" + translationName + ".html";
- }
-
- private boolean generateTranslationReport(
- File masterTranslationDirectory,
- File translationDirectory,
- String translationName) throws MavenReportException {
- getLog().debug( "starting docbook:diff processing [translation=" + translationName + "]" );
-
- DirectoryScanner scanner = new DirectoryScanner();
- scanner.setBasedir( masterTranslationDirectory );
- scanner.setIncludes( sourceIncludes );
- scanner.scan();
- String[] masterSources = scanner.getIncludedFiles();
-
- scanner = new DirectoryScanner();
- scanner.setBasedir( translationDirectory );
- scanner.setIncludes( sourceIncludes );
- scanner.scan();
- String[] translationSources = scanner.getIncludedFiles();
-
- if ( ! Arrays.equals( masterSources, translationSources ) ) {
- getLog().warn( "includes returned different master and translation sets" );
- return false;
- }
-
- Locale locale = new Locale( translationName );
- File output = new File( getReportOutputDirectory(), buildTranslationReportName( translationName ) );
- prepReportFile( output );
-
- try {
- DiffCreator diffCreator = new DiffCreator( xincludeSupported, getLog() );
- TranslationReportGenerator generator = new TranslationReportGenerator( translationsDirectory, getBundle( locale ), getLog() );
-
- for ( int i = 0; i < masterSources.length; i++ ) {
- getLog().debug( "processing source [" + masterSources[i] + "]" );
- final File master = new File( masterTranslationDirectory, masterSources[i] );
- final File translation = new File( translationDirectory, translationSources[i] );
- final Diff diff = diffCreator.findDiff( master, translation );
- generator.generate( diff, output, locale.toString() );
- }
- }
- catch ( GenerationException e ) {
- throw new MavenReportException( "unable to generate report", e );
- }
- return true;
- }
-
}
Copied: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/RenderingException.java (from rev 11694, trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/render/RenderingException.java)
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/RenderingException.java (rev 0)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/RenderingException.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2007 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.jboss.maven.plugin.docbook.gen;
+
+/**
+ * Indicates issues performing rendering.
+ *
+ * @author Steve Ebersole
+ */
+public class RenderingException extends Exception {
+
+ public RenderingException(String message) {
+ super( message );
+ }
+
+ public RenderingException(String message, Throwable cause) {
+ super( message, cause );
+ }
+}
Copied: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/XSLTException.java (from rev 11694, trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/XSLTException.java)
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/XSLTException.java (rev 0)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/XSLTException.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2007 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.jboss.maven.plugin.docbook.gen;
+
+/**
+ * Indicates problems either building XSLT transformers or performing
+ * transformations.
+ *
+ * @author Steve Ebersole
+ */
+public class XSLTException extends Exception {
+
+ public XSLTException(String message) {
+ super( message );
+ }
+
+ public XSLTException(String message, Throwable cause) {
+ super( message, cause );
+ }
+}
Copied: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/BasicFormatHandler.java (from rev 11694, trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/render/BasicRenderer.java)
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/BasicFormatHandler.java (rev 0)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/BasicFormatHandler.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -0,0 +1,215 @@
+/*
+ * Copyright © 2007 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.jboss.maven.plugin.docbook.gen.format;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+
+import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProjectHelper;
+import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.jar.JarArchiver;
+import org.codehaus.plexus.util.FileUtils;
+import org.jboss.maven.plugin.docbook.gen.RenderingException;
+import org.jboss.maven.plugin.docbook.gen.XSLTException;
+import org.jboss.maven.plugin.docbook.gen.util.Formatting;
+import org.jboss.maven.plugin.docbook.gen.util.ResourceHelper;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+/**
+ * Provides basic support for renderers, mainly in the form of templating.
+ *
+ * @author Steve Ebersole
+ */
+public class BasicFormatHandler implements FormatHandler {
+ public static final String DTD_VALIDATION_FEATURE = "http://xml.org/sax/features/validation";
+ public static final String DTD_LOADING_FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
+
+ protected final FormatHandlerFactory factory;
+ protected final Formatting formatting;
+
+ public BasicFormatHandler(FormatHandlerFactory factory, Formatting formatting) {
+ this.factory = factory;
+ this.formatting = formatting;
+ }
+
+ public File prepareDirectory() throws RenderingException {
+ File target = new File( factory.getTargetDirectory(), formatting.getFormatName() );
+ if ( ! target.exists() ) {
+ FileUtils.mkdir( target.getAbsolutePath() );
+ }
+ if ( formatting.isImageCopyingRequired() ) {
+ if ( factory.getStagingDirectory().exists() ) {
+ File imageBase = new File( factory.getStagingDirectory(), "images" );
+ if ( imageBase.exists() ) {
+ try {
+ FileUtils.copyDirectoryStructure( imageBase, target );
+ }
+ catch ( IOException e ) {
+ throw new RenderingException( "unable to copy images", e );
+ }
+ }
+ }
+ }
+ return target;
+ }
+
+ public void attachOutput(File sourceFile, MavenProjectHelper projectHelper) throws RenderingException {
+ File rawOutputDir = new File( factory.getTargetDirectory(), formatting.getFormatName() );
+
+ String warName = factory.getMavenProject().getBuild().getFinalName() +
+ "-" + formatting.getFormatName() + ".war";
+ File war = new File( factory.getTargetDirectory(), warName );
+
+ JarArchiver archiver = new JarArchiver();
+ archiver.setDestFile( war );
+ try {
+ archiver.addDirectory( rawOutputDir );
+ archiver.createArchive();
+ }
+ catch ( IOException e ) {
+ throw new RenderingException( "Unable to create archive [" + war.getAbsolutePath() + "]", e );
+ }
+ catch ( ArchiverException e ) {
+ throw new RenderingException( "Unable to populate archive [" + war.getAbsolutePath() + "]", e );
+ }
+
+ projectHelper.attachArtifact( factory.getMavenProject(), "war", formatting.getFormatName(), war );
+ }
+
+ public final void render(File sourceFile) throws RenderingException, XSLTException {
+ getLog().debug( "starting formatting [" + formatting.getFormatName() + "]" );
+
+ File target = prepareTarget( prepareDirectory(), sourceFile );
+
+ Transformer transformer = buildTransformer( target );
+ Source transformationSource = buildSource( sourceFile );
+ Result transformationResult = buildResult( target );
+ try {
+ transformer.transform( transformationSource, transformationResult );
+ }
+ catch ( TransformerException e ) {
+ throw new XSLTException( "unable to perform transformation", e );
+ }
+ finally {
+ releaseResult( transformationResult );
+ }
+ }
+
+ private File prepareTarget(File directory, File sourceFile) throws RenderingException {
+ String targetFileName = deduceTargetFileName( sourceFile );
+ getLog().debug( "preparing target file [" + targetFileName + "]" );
+ File target = new File( directory, targetFileName );
+ if ( target.exists() ) {
+ if ( !target.delete() ) {
+ getLog().warn( "unable to clean up previous output file [" + target.getAbsolutePath() + "]" );
+ }
+ }
+ if ( !target.exists() ) {
+ try {
+ target.createNewFile();
+ }
+ catch ( IOException e ) {
+ throw new RenderingException( "unable to create output file [" + target.getAbsolutePath() + "]", e );
+ }
+ }
+ return target;
+ }
+
+ private String deduceTargetFileName(File source) {
+ return formatting.getNamingStrategy().deduceTargetFileName( source );
+ }
+
+ protected Transformer buildTransformer(File targetFile) throws RenderingException, XSLTException {
+ final URL transformationStylesheet = resolveTransformationStylesheet();
+ Transformer transformer = factory.getTransformerFactory()
+ .buildTransformer( formatting, transformationStylesheet );
+ if ( formatting.isImagePathSettingRequired() ) {
+ String imgSrcPath = factory.getStagingDirectory().getAbsolutePath() + "/images/";
+ getLog().debug( "setting 'img.src.path' [" + imgSrcPath + "]" );
+ transformer.setParameter( "img.src.path", imgSrcPath );
+ }
+ if ( factory.getOptions().isUseRelativeImageUris() ) {
+ getLog().debug( "enforcing retention of relative image URIs" );
+ transformer.setParameter( "keep.relative.image.uris", "0" );
+ }
+ if ( formatting.isDoingChunking() ) {
+ getLog().debug( "Chunking output." );
+ String rootFilename = targetFile.getName();
+ rootFilename = rootFilename.substring( 0, rootFilename.lastIndexOf( '.' ) );
+ transformer.setParameter( "root.filename", rootFilename );
+ transformer.setParameter( "base.dir", targetFile.getParent() + File.separator );
+ transformer.setParameter( "manifest.in.base.dir", "1" );
+ }
+ return transformer;
+ }
+
+ protected final URL resolveTransformationStylesheet() throws RenderingException {
+ return ResourceHelper.requireResource( formatting.getStylesheetResource() );
+ }
+
+ private Source buildSource(File sourceFile) throws RenderingException {
+ try {
+ EntityResolver resolver = factory.getCatalogResolver();
+ SAXParserFactory factory = createParserFactory();
+ XMLReader reader = factory.newSAXParser().getXMLReader();
+ reader.setEntityResolver( resolver );
+
+ // Disable DTD loading and validation
+ reader.setFeature( DTD_LOADING_FEATURE, false );
+ reader.setFeature( DTD_VALIDATION_FEATURE, false );
+
+ return new SAXSource( reader, new InputSource( sourceFile.getAbsolutePath() ) );
+ }
+ catch ( ParserConfigurationException e ) {
+ throw new RenderingException( "unable to build SAX Parser", e );
+ }
+ catch ( SAXException e ) {
+ throw new RenderingException( "unable to build SAX Parser", e );
+ }
+ }
+
+ protected final SAXParserFactory createParserFactory() {
+ SAXParserFactory parserFactory = new SAXParserFactoryImpl();
+ parserFactory.setXIncludeAware( factory.getOptions().isXincludeSupported() );
+ return parserFactory;
+ }
+
+ protected Result buildResult(File targetFile) throws RenderingException, XSLTException {
+ return new StreamResult( targetFile );
+ }
+
+ protected void releaseResult(Result transformationResult) {
+ // typically nothing to do...
+ }
+
+ protected Log getLog() {
+ return factory.getLog();
+ }
+}
Copied: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/FormatHandler.java (from rev 11694, trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/render/Renderer.java)
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/FormatHandler.java (rev 0)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/FormatHandler.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -0,0 +1,60 @@
+/*
+ * Copyright © 2007 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.jboss.maven.plugin.docbook.gen.format;
+
+import java.io.File;
+
+import org.apache.maven.project.MavenProjectHelper;
+import org.jboss.maven.plugin.docbook.gen.RenderingException;
+import org.jboss.maven.plugin.docbook.gen.XSLTException;
+
+/**
+ * Handles format-specific processing steps.
+ *
+ * @author Steve Ebersole
+ */
+public interface FormatHandler {
+ /**
+ * This is used during the prepare-resources phase to create and prepare
+ * the format specific output directory for rendering. Generally,
+ * preparation might mean copying any format-specific resources to the
+ * format output directory.
+ *
+ * @return The format output directory
+ * @throws RenderingException
+ */
+ public File prepareDirectory() throws RenderingException;
+
+ /**
+ * Performs the actual rendering or transforming of the DocBook sources into
+ * the respective output format.
+ *
+ * @param source The source DocBook file.
+ * @throws RenderingException Problem writing the output file(s).
+ * @throws XSLTException Problem performing XSL transformation.
+ */
+ public void render(File source) throws RenderingException, XSLTException;
+
+ /**
+ * Attaches the formatting output (after possibly bundling it into an archive)
+ * to the maven project.
+ *
+ * @param sourceFile The source DocBook file.
+ * @param projectHelper The project helper (used to attach produced artifact)
+ * @throws RenderingException
+ */
+ public void attachOutput(File sourceFile, MavenProjectHelper projectHelper) throws RenderingException;
+}
Copied: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/FormatHandlerFactory.java (from rev 11694, trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/render/RendererFactory.java)
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/FormatHandlerFactory.java (rev 0)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/FormatHandlerFactory.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -0,0 +1,132 @@
+/*
+ * Copyright © 2007 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.jboss.maven.plugin.docbook.gen.format;
+
+import java.io.File;
+
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.apache.xml.resolver.CatalogManager;
+import org.apache.xml.resolver.tools.CatalogResolver;
+import org.jboss.maven.plugin.docbook.Options;
+import org.jboss.maven.plugin.docbook.gen.util.StandardDocBookFormatSpecification;
+import org.jboss.maven.plugin.docbook.gen.util.TransformerType;
+import org.jboss.maven.plugin.docbook.gen.util.Formatting;
+import org.jboss.maven.plugin.docbook.gen.xslt.TransformerFactory;
+import org.jboss.maven.plugin.docbook.gen.XSLTException;
+import org.jboss.maven.plugin.docbook.gen.xslt.catalog.ExplicitCatalogManager;
+import org.jboss.maven.plugin.docbook.gen.xslt.catalog.ImplicitCatalogManager;
+import org.jboss.maven.plugin.docbook.gen.format.FormatHandler;
+import org.jboss.maven.plugin.docbook.gen.format.BasicFormatHandler;
+import org.jboss.maven.plugin.docbook.gen.format.PdfFormatHandler;
+
+/**
+ * Builds a renderer for the given format
+ *
+ * @author Steve Ebersole
+ */
+public class FormatHandlerFactory {
+ private final Options options;
+ private final File source;
+ private final File targetDirectory;
+ private final File stagingDirectory;
+ private final File fontConfig;
+ private final MavenProject mavenProject;
+ private final Log log;
+
+ private CatalogResolver catalogResolver;
+ private TransformerFactory transformerFactory;
+
+ public FormatHandlerFactory(
+ Options options,
+ File source,
+ File targetDirectory,
+ File stagingDirectory,
+ File fontConfig,
+ MavenProject mavenProject,
+ Log log) {
+ this.options = options;
+ this.source = source;
+ this.targetDirectory = targetDirectory;
+ this.stagingDirectory = stagingDirectory;
+ this.fontConfig = fontConfig;
+ this.mavenProject = mavenProject;
+ this.log = log;
+ }
+
+ public Options getOptions() {
+ return options;
+ }
+
+ public File getSource() {
+ return source;
+ }
+
+ public File getTargetDirectory() {
+ return targetDirectory;
+ }
+
+ public File getStagingDirectory() {
+ return stagingDirectory;
+ }
+
+ public File getFontConfig() {
+ return fontConfig;
+ }
+
+ public MavenProject getMavenProject() {
+ return mavenProject;
+ }
+
+ public Log getLog() {
+ return log;
+ }
+
+ public CatalogResolver getCatalogResolver() {
+ if ( catalogResolver == null ) {
+ CatalogManager catalogManager;
+ if ( options.getCatalogs() == null || options.getCatalogs().length == 0 ) {
+ catalogManager = new ImplicitCatalogManager();
+ }
+ else {
+ catalogManager = new ExplicitCatalogManager( options.getCatalogs() );
+ }
+ catalogResolver = new CatalogResolver( catalogManager );
+ }
+ return catalogResolver;
+ }
+
+ public TransformerFactory getTransformerFactory() {
+ if ( transformerFactory == null ) {
+ transformerFactory = new TransformerFactory(
+ TransformerType.parse( options.getXmlTransformerType() ),
+ options.getTransformerParameters(),
+ getCatalogResolver(),
+ options.getDocbookVersion()
+ );
+ }
+ return transformerFactory;
+ }
+
+ public FormatHandler buildFormatHandler(Formatting formatting) {
+ if ( formatting.getFormatName().equals( StandardDocBookFormatSpecification.PDF.getName() ) ) {
+ return new PdfFormatHandler( this, formatting );
+ }
+ else {
+ return new BasicFormatHandler( this, formatting );
+ }
+ }
+}
Copied: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/PdfFormatHandler.java (from rev 11694, trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/render/PdfRenderer.java)
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/PdfFormatHandler.java (rev 0)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/format/PdfFormatHandler.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -0,0 +1,176 @@
+/*
+ * Copyright © 2007 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.jboss.maven.plugin.docbook.gen.format;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import javax.xml.transform.Result;
+import javax.xml.transform.sax.SAXResult;
+
+import org.apache.avalon.framework.logger.Logger;
+import org.apache.fop.apps.Driver;
+import org.apache.fop.apps.FOPException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProjectHelper;
+import org.jboss.maven.plugin.docbook.gen.util.Formatting;
+import org.jboss.maven.plugin.docbook.gen.RenderingException;
+
+/**
+ * Special handling for pdf rendering
+ *
+ * @author Steve Ebersole
+ */
+public class PdfFormatHandler extends BasicFormatHandler {
+
+ public PdfFormatHandler(FormatHandlerFactory factory, Formatting formatting) {
+ super( factory, formatting );
+ }
+
+ protected Result buildResult(File targetFile) throws RenderingException {
+ getLog().info( "building formatting result [" + targetFile.getAbsolutePath() + "]" );
+ prepareFonts();
+ return new ResultImpl( targetFile );
+ }
+
+ private void prepareFonts() throws RenderingException {
+ // if fonts were specified, then prepare the FOP font metrics configuration
+ // : this is the piece that improved dramatically after fop-0.25,
+ // which unfortunately we are stuck with for other reasons :(
+ if ( factory.getFontConfig() != null ) {
+ org.apache.fop.configuration.Configuration.put( "fontBaseDir", new File( factory.getStagingDirectory(), "fonts" ) );
+ try {
+ new org.apache.fop.apps.Options( factory.getFontConfig() );
+ }
+ catch ( FOPException e ) {
+ throw new RenderingException( "unable to properly prepare FOP fonts", e );
+ }
+ org.apache.fop.configuration.Configuration.put( "fontBaseDir", new File( factory.getStagingDirectory(), "fonts" ) );
+ }
+ }
+
+ protected void releaseResult(Result transformationResult) {
+ ( ( ResultImpl ) transformationResult ).release();
+ }
+
+ private class ResultImpl extends SAXResult {
+ private OutputStream outputStream;
+
+ public ResultImpl(File targetFile) throws RenderingException {
+ Driver driver = new Driver();
+ driver.setLogger( new LoggingBridge( getLog() ) );
+ driver.setRenderer( Driver.RENDER_PDF );
+
+ try {
+ outputStream = new BufferedOutputStream( new FileOutputStream( targetFile ) );
+ driver.setOutputStream( outputStream );
+ setHandler( driver.getContentHandler() );
+ }
+ catch ( Throwable t ) {
+ throw new RenderingException( "error building transformation result [" + targetFile.getAbsolutePath() + "]", t );
+ }
+ }
+
+ private void release() {
+ try {
+ outputStream.flush();
+ outputStream.close();
+ }
+ catch ( IOException e ) {
+ getLog().warn( "error releasing I/O resources", e );
+ }
+ }
+ }
+
+ private static class LoggingBridge implements Logger {
+
+ private Log mavenLog;
+
+ public LoggingBridge(Log mavenLog) {
+ this.mavenLog = mavenLog;
+ }
+
+ public Logger getChildLogger(String arg0) {
+ return null;
+ }
+
+ public void debug(String arg0) {
+ mavenLog.debug( arg0 );
+ }
+
+ public void debug(String arg0, Throwable arg1) {
+ mavenLog.debug( arg0, arg1 );
+ }
+
+ // todo : info logging from FOP is excessively verbose...
+
+ public void info(String arg0) {
+ mavenLog.info( arg0 );
+ }
+
+ public void info(String arg0, Throwable arg1) {
+ mavenLog.info( arg0, arg1 );
+ }
+
+ public void warn(String arg0) {
+ mavenLog.warn( arg0 );
+ }
+
+ public void warn(String arg0, Throwable arg1) {
+ mavenLog.warn( arg0, arg1 );
+ }
+
+ public void error(String arg0) {
+ mavenLog.error( arg0 );
+ }
+
+ public void error(String arg0, Throwable arg1) {
+ mavenLog.error( arg0, arg1 );
+ }
+
+ public void fatalError(String arg0) {
+ mavenLog.error( arg0 );
+ }
+
+ public void fatalError(String arg0, Throwable arg1) {
+ mavenLog.error( arg0, arg1 );
+ }
+
+ public boolean isDebugEnabled() {
+ return mavenLog.isDebugEnabled();
+ }
+
+ public boolean isErrorEnabled() {
+ return mavenLog.isErrorEnabled();
+ }
+
+ public boolean isFatalErrorEnabled() {
+ return mavenLog.isErrorEnabled();
+ }
+
+ public boolean isInfoEnabled() {
+ return mavenLog.isInfoEnabled();
+ }
+
+ public boolean isWarnEnabled() {
+ return mavenLog.isWarnEnabled();
+ }
+
+ }
+
+}
Copied: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/util/Formatting.java (from rev 11694, trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/render/Formatting.java)
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/util/Formatting.java (rev 0)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/util/Formatting.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -0,0 +1,118 @@
+/*
+ * Copyright © 2007 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, v. 2.1. This program is distributed in the
+ * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details. You should have received a
+ * copy of the GNU Lesser General Public License, v.2.1 along with this
+ * distribution; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Red Hat Author(s): Steve Ebersole
+ */
+package org.jboss.maven.plugin.docbook.gen.util;
+
+import java.io.File;
+
+import org.codehaus.plexus.util.FileUtils;
+import org.jboss.maven.plugin.docbook.Format;
+import org.jboss.maven.plugin.docbook.gen.util.StandardDocBookFormatSpecification;
+
+/**
+ * Defined formatting information. Basically stuff to either pass into the xsl
+ * transformer or stuff needed to prepare for transformation.
+ *
+ * @author Steve Ebersole
+ */
+public class Formatting {
+ private final String formatName;
+ private final String stylesheetResource;
+ private final boolean imagePathSettingRequired;
+ private final boolean imageCopyingRequired;
+ private final boolean doingChunking;
+ private final StandardDocBookFormatSpecification standardDocBookSpec;
+ private final TargetNamingStrategy namingStrategy;
+
+ public Formatting(StandardDocBookFormatSpecification standardDocBookSpec, Format userSpec) {
+ // todo : there may not be a matching standard docbook format spec...
+ if ( ! standardDocBookSpec.getName().equals( userSpec.getFormatName() ) ) {
+ throw new IllegalArgumentException( "formatting type mismatch" );
+ }
+
+ this.standardDocBookSpec = standardDocBookSpec;
+ this.formatName = userSpec.getFormatName();
+
+ this.stylesheetResource = userSpec.getStylesheetResource() == null
+ ? standardDocBookSpec.getStylesheetResource()
+ : "/styles" + userSpec.getStylesheetResource();
+
+ this.imageCopyingRequired = userSpec.getImageCopyingRequired() == null
+ ? standardDocBookSpec.isImageCopyingRequired()
+ : userSpec.getImageCopyingRequired().booleanValue();
+
+ this.imagePathSettingRequired = userSpec.getImagePathSettingRequired() == null
+ ? standardDocBookSpec.isImagePathSettingRequired()
+ : userSpec.getImagePathSettingRequired().booleanValue();
+
+ this.doingChunking =userSpec.getDoingChunking() == null
+ ? standardDocBookSpec.isDoingChunking()
+ : userSpec.getDoingChunking().booleanValue();
+
+ this.namingStrategy = new TargetNamingStrategy( standardDocBookSpec, userSpec );
+ }
+
+ public String getFormatName() {
+ return formatName;
+ }
+
+ public StandardDocBookFormatSpecification getStandardDocBookSpec() {
+ return standardDocBookSpec;
+ }
+
+ public String getStylesheetResource() {
+ return stylesheetResource;
+ }
+
+ public boolean isImagePathSettingRequired() {
+ return imagePathSettingRequired;
+ }
+
+ public boolean isImageCopyingRequired() {
+ return imageCopyingRequired;
+ }
+
+ public boolean isDoingChunking() {
+ return doingChunking;
+ }
+
+ public TargetNamingStrategy getNamingStrategy() {
+ return namingStrategy;
+ }
+
+ public static class TargetNamingStrategy {
+ private String targetFileExtension;
+ private String finalName;
+
+ public TargetNamingStrategy(StandardDocBookFormatSpecification standardDocBookSpec, Format userSpec) {
+ if ( userSpec.getFinalName() != null ) {
+ this.targetFileExtension = null;
+ this.finalName = userSpec.getFinalName();
+ }
+ else {
+ this.targetFileExtension = userSpec.getTargetFileExtension() == null
+ ? standardDocBookSpec.getStandardFileExtension()
+ : userSpec.getTargetFileExtension();
+ this.finalName = null;
+ }
+ }
+
+ public String deduceTargetFileName(File source) {
+ return finalName == null
+ ? FileUtils.basename( source.getAbsolutePath() ) + targetFileExtension
+ : finalName;
+ }
+ }
+}
Modified: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/TransformerFactory.java
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/TransformerFactory.java 2007-06-22 19:39:47 UTC (rev 11700)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/TransformerFactory.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -29,7 +29,7 @@
import com.icl.saxon.Controller;
import org.apache.xml.resolver.tools.CatalogResolver;
-import org.jboss.maven.plugin.docbook.gen.render.Formatting;
+import org.jboss.maven.plugin.docbook.gen.util.Formatting;
import org.jboss.maven.plugin.docbook.gen.util.StandardDocBookFormatSpecification;
import org.jboss.maven.plugin.docbook.gen.util.NoOpWriter;
import org.jboss.maven.plugin.docbook.gen.util.ResourceHelper;
@@ -39,6 +39,7 @@
import org.jboss.maven.plugin.docbook.gen.xslt.resolve.RelativeJarUriResolver;
import org.jboss.maven.plugin.docbook.gen.xslt.resolve.ResolverChain;
import org.jboss.maven.plugin.docbook.gen.xslt.resolve.VersionResolver;
+import org.jboss.maven.plugin.docbook.gen.XSLTException;
/**
* A factory for {@link javax.xml.transform.Transformer} instances, configurable
Deleted: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/XSLTException.java
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/XSLTException.java 2007-06-22 19:39:47 UTC (rev 11700)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/XSLTException.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -1,33 +0,0 @@
-/*
- * Copyright © 2007 Red Hat Middleware, LLC. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, v. 2.1. This program is distributed in the
- * hope that it will be useful, but WITHOUT A WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details. You should have received a
- * copy of the GNU Lesser General Public License, v.2.1 along with this
- * distribution; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Red Hat Author(s): Steve Ebersole
- */
-package org.jboss.maven.plugin.docbook.gen.xslt;
-
-/**
- * Indicates problems either building XSLT transformers or performing
- * transformations.
- *
- * @author Steve Ebersole
- */
-public class XSLTException extends Exception {
-
- public XSLTException(String message) {
- super( message );
- }
-
- public XSLTException(String message, Throwable cause) {
- super( message, cause );
- }
-}
Modified: trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/resolve/ExplicitUrnResolver.java
===================================================================
--- trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/resolve/ExplicitUrnResolver.java 2007-06-22 19:39:47 UTC (rev 11700)
+++ trunk/sandbox/maven-poc/plugins/maven-jboss-docbook-plugin/src/main/java/org/jboss/maven/plugin/docbook/gen/xslt/resolve/ExplicitUrnResolver.java 2007-06-22 20:55:40 UTC (rev 11701)
@@ -22,7 +22,7 @@
import org.jboss.maven.plugin.docbook.gen.util.StandardDocBookFormatSpecification;
import org.jboss.maven.plugin.docbook.gen.util.ResourceHelper;
-import org.jboss.maven.plugin.docbook.gen.xslt.XSLTException;
+import org.jboss.maven.plugin.docbook.gen.XSLTException;
/**
* Resolves an explicit <tt>urn:docbook:stylesheet</tt> URN against the standard
More information about the hibernate-commits
mailing list