camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r656934 - in /activemq/camel/trunk: apache-camel/ components/camel-spring/src/main/java/org/apache/camel/spring/ tooling/maven/ tooling/maven/camel-maven-plugin/ tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ tooling...
Date Fri, 16 May 2008 05:02:45 GMT
Author: hadrian
Date: Thu May 15 22:02:44 2008
New Revision: 656934

URL: http://svn.apache.org/viewvc?rev=656934&view=rev
Log:
CAMEL-11.  Refactored camel-maven-plugin.

Added:
    activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ConvertersMojo.java
      - copied, changed from r653488, activemq/camel/trunk/tooling/maven/maven-camel-converters/src/main/java/org/apache/camel/maven/ConvertersMojo.java
Removed:
    activemq/camel/trunk/tooling/maven/maven-camel-converters/
Modified:
    activemq/camel/trunk/apache-camel/pom.xml
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
    activemq/camel/trunk/tooling/maven/camel-maven-plugin/pom.xml
    activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
    activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
    activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/resources/camel-maven-plugin.properties
    activemq/camel/trunk/tooling/maven/pom.xml

Modified: activemq/camel/trunk/apache-camel/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/apache-camel/pom.xml?rev=656934&r1=656933&r2=656934&view=diff
==============================================================================
--- activemq/camel/trunk/apache-camel/pom.xml (original)
+++ activemq/camel/trunk/apache-camel/pom.xml Thu May 15 22:02:44 2008
@@ -418,21 +418,27 @@
           </execution>
         </executions>
       </plugin>
+    </plugins>
+  </build>
+  <reporting>
+    <plugins>
+      <!-- let's generate nice PNG / SVG diagrams from our routes -->
       <plugin>
         <groupId>org.apache.camel</groupId>
-        <artifactId>maven-camel-converters</artifactId>
-        <version>${project.version}</version>
-        <executions>
-          <execution>
-            <id>camel-converters</id>
-            <goals>
-              <goal>report</goal>
-            </goals>
-          </execution>
-        </executions>
+        <artifactId>camel-maven-plugin</artifactId>
+        <reportSets>
+          <reportSet>
+            <configuration/>
+            <reports>
+              <report>converters-report</report>
+              <report>goal2</report>
+            </reports>
+          </reportSet>
+        </reportSets>
       </plugin>
     </plugins>
-  </build>
+  </reporting>
+
   <profiles>
     <profile>
       <id>release</id>

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java?rev=656934&r1=656933&r2=656934&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
Thu May 15 22:02:44 2008
@@ -376,7 +376,6 @@
         }
 
         if (isAggregateDot()) {
-
             generateDot("aggregate", aggregateSpringCamelContext(applicationContext), 1);
         }
     }

Modified: activemq/camel/trunk/tooling/maven/camel-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/pom.xml?rev=656934&r1=656933&r2=656934&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/camel-maven-plugin/pom.xml (original)
+++ activemq/camel/trunk/tooling/maven/camel-maven-plugin/pom.xml Thu May 15 22:02:44 2008
@@ -32,6 +32,10 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
       <artifactId>camel-spring</artifactId>
     </dependency>
 
@@ -65,12 +69,12 @@
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-api</artifactId>
-      <version>2.0.2</version>
+      <version>2.0.9</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-impl</artifactId>
-      <version>2.0.2</version>
+      <version>2.0.4.1</version>
     </dependency>
 
 

Copied: activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ConvertersMojo.java
(from r653488, activemq/camel/trunk/tooling/maven/maven-camel-converters/src/main/java/org/apache/camel/maven/ConvertersMojo.java)
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ConvertersMojo.java?p2=activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ConvertersMojo.java&p1=activemq/camel/trunk/tooling/maven/maven-camel-converters/src/main/java/org/apache/camel/maven/ConvertersMojo.java&r1=653488&r2=656934&rev=656934&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/maven-camel-converters/src/main/java/org/apache/camel/maven/ConvertersMojo.java
(original)
+++ activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/ConvertersMojo.java
Thu May 15 22:02:44 2008
@@ -17,131 +17,515 @@
 package org.apache.camel.maven;
 
 import java.io.File;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
 import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
 import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
 
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ReportingTypeConverterLoader;
-import org.apache.camel.util.ReportingTypeConverterLoader.TypeMapping;
 import org.apache.camel.util.ReportingTypeConverterRegistry;
-
-import org.apache.maven.plugin.AbstractMojo;
+import org.apache.camel.util.ReportingTypeConverterLoader.TypeMapping;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.site.decoration.Body;
+import org.apache.maven.doxia.site.decoration.DecorationModel;
+import org.apache.maven.doxia.site.decoration.Skin;
+import org.apache.maven.doxia.siterenderer.Renderer;
+import org.apache.maven.doxia.siterenderer.RendererException;
+import org.apache.maven.doxia.siterenderer.SiteRenderingContext;
+import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.reporting.AbstractMavenReport;
+import org.apache.maven.reporting.MavenReportException;
 
 /**
- * Generate report of available type converstions.
- *
- * @goal report
- *
+ * Generate report of available type conversions.
+ * 
+ * @goal converters-report
+ * @requiresDependencyResolution runtime
  * @phase verify
  */
-public class ConvertersMojo
-    extends AbstractMojo {
-    private static final String LINE_SEPARATOR =
-        "-------------------------------------------------------------------------------\n";
+public class ConvertersMojo extends AbstractMavenReport {
+
+    static private final String WIKI_TYPECONVERER_URL = "http://activemq.apache.org/camel/type-converter.html";
+    static private final String CONVERTER_TYPE_STATIC = "org.apache.camel.impl.converter.StaticMethodTypeConverter";
+    static private final String CONVERTER_TYPE_INSTANCE = "org.apache.camel.impl.converter.InstanceMethodTypeConverter";
+    static private final String REPORT_METHOD_STATIC = "STATIC";
+    static private final String REPORT_METHOD_INSTANCE = "INSTANCE";
+    static private final String REPORT_METHOD_UNKNOWN = "UNKNOWN";
+
+    /**
+     * Base output directory for reports.
+     * 
+     * @parameter default-value="${project.build.directory}/site"
+     * @readonly
+     * @required
+     */
+    private File outputDirectory;
+
+    /**
+     * Reference to Maven 2 Project.
+     * 
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
     /**
-     * Base directory where all reports are written to.
-     *
-     * @parameter expression="${project.build.directory}/camel-reports"
+     * Doxia SiteRenderer.
+     * 
+     * @component
      */
-    private File reportsDirectory;
+    private Renderer renderer;
 
     /**
-     * Convenience parameter that allows you to disable report generation.
-     *
-     * @parameter expression="${generateReports}" default-value="true"
+     * Remote repositories which will be searched for source attachments.
+     * 
+     * @parameter expression="${project.remoteArtifactRepositories}"
+     * @required
+     * @readonly
      */
-    private boolean generateReports;
+    protected List remoteArtifactRepositories;
 
+    /**
+     * Local maven repository.
+     * 
+     * @parameter expression="${localRepository}"
+     * @required
+     * @readonly
+     */
+    protected ArtifactRepository localRepository;
+
+    /**
+     * The component that is used to resolve additional artifacts required.
+     * 
+     * @component
+     */
+    protected ArtifactResolver artifactResolver;
 
+    /**
+     * The component used for creating artifact instances.
+     * 
+     * @component
+     */
+    protected ArtifactFactory artifactFactory;
+
+    /**
+     * Gets resource bundle for given locale.
+     * 
+     * @param locale
+     *            locale
+     * @return resource bundle
+     */
+    protected ResourceBundle getBundle(final Locale locale) {
+        return ResourceBundle.getBundle("camel-maven-plugin", locale, this
+                .getClass().getClassLoader());
+    }
 
+    /**
+     * @param locale
+     *            report locale.
+     * @return report description.
+     * @see org.apache.maven.reporting.MavenReport#getDescription(Locale)
+     */
+    public String getDescription(final Locale locale) {
+        return getBundle(locale).getString("report.converters.description");
+    }
+
+    /**
+     * @see org.apache.maven.reporting.MavenReport#getName(Locale)
+     */
+    public String getName(final Locale locale) {
+        return getBundle(locale).getString("report.converters.name");
+    }
+
+    /**
+     * @see org.apache.maven.reporting.MavenReport#getOutputName()
+     */
+    public String getOutputName() {
+        return "camel-converters";
+    }
+
+    @Override
+    protected String getOutputDirectory() {
+        return outputDirectory.getAbsolutePath();
+    }
+
+    @Override
+    protected MavenProject getProject() {
+        return this.project;
+    }
+
+    @Override
+    protected Renderer getSiteRenderer() {
+        return renderer;
+    }
+
+    /**
+     * @see org.apache.maven.reporting.AbstractMavenReport#execute()
+     */
     public void execute() throws MojoExecutionException {
-        getLog().info("Camel report directory: " + reportsDirectory);
+        if (!canGenerateReport()) {
+            return;
+        }
 
-        ReportingTypeConverterLoader loader = new ReportingTypeConverterLoader();
-        ReportingTypeConverterRegistry registry = new ReportingTypeConverterRegistry();
         try {
+            DecorationModel model = new DecorationModel();
+            model.setBody(new Body());
+            Map<String, Object> attributes = new HashMap<String, Object>();
+            attributes.put("outputEncoding", "UTF-8");
+            attributes.put("project", project);
+            Locale locale = Locale.getDefault();
+
+            SiteRenderingContext siteContext = renderer.createContextForSkin(
+                    getSkinArtifactFile(model), attributes, model,
+                    getName(locale), locale);
+
+            RenderingContext context = new RenderingContext(
+                    getReportOutputDirectory(), getOutputName() + ".html");
+            SiteRendererSink sink = new SiteRendererSink(context);
+            generate(sink, locale);
+
+            Writer writer = new OutputStreamWriter(new FileOutputStream(
+                    new File(getReportOutputDirectory(), getOutputName()
+                            + ".html")), "UTF-8");
+
+            renderer.generateDocument(writer, sink, siteContext);
+            renderer.copyResources(siteContext, new File(project.getBasedir(),
+                    "src/site/resources"), outputDirectory);
+        } catch (IOException e) {
+            throw new MojoExecutionException("Error copying resources.", e);
+        } catch (RendererException e) {
+            throw new MojoExecutionException("Error while rendering report.", e);
+        } catch (MojoFailureException e) {
+            throw new MojoExecutionException(
+                    "Cannot find skin artifact for report.", e);
+        } catch (MavenReportException e) {
+            throw new MojoExecutionException("Error generating report.", e);
+        }
+    }
+
+    /**
+     * @see org.apache.maven.reporting.AbstractMavenReport#execute()
+     */
+    @Override
+    protected void executeReport(Locale locale) throws MavenReportException {
+
+        if (!createOutputDirectory(outputDirectory)) {
+            throw new MavenReportException("Failed to create report directory "
+                    + outputDirectory.getAbsolutePath());
+        }
+
+        ClassLoader oldClassLoader = Thread.currentThread()
+                .getContextClassLoader();
+        try {
+            // TODO: this badly needs some refactoring
+            // mojo.createClassLoader creates a URLClassLoader with whatever is
+            // in
+            // ${project.testClasspathElements}, reason why we don't see all
+            // converters
+            // in the report. First we need a list of classpath elements the
+            // user
+            // could customize via plugin configuration, and elements of that
+            // list
+            // be added to the URLClassLoader. This should also be factored out
+            // into
+            // a utility class.
+            // TODO: there is some interference with the site plugin that needs
+            // investigated.
+            List<?> list = project.getTestClasspathElements();
+            EmbeddedMojo mojo = new EmbeddedMojo();
+            mojo.setClasspathElements(list);
+            ClassLoader newClassLoader = mojo.createClassLoader(oldClassLoader);
+            Thread.currentThread().setContextClassLoader(newClassLoader);
+
+            ReportingTypeConverterLoader loader = new ReportingTypeConverterLoader();
+            ReportingTypeConverterRegistry registry = new ReportingTypeConverterRegistry();
             loader.load(registry);
+            getLog().error(
+                    "FOUND type mapping; count = "
+                            + loader.getTypeConversions().length);
 
             String[] errors = registry.getErrors();
             for (String error : errors) {
                 getLog().error(error);
             }
+
+            generateReport(getSink(), locale, loader.getTypeConversions());
         } catch (Exception e) {
-            throw new MojoExecutionException(e.getMessage());
+            throw new MavenReportException(
+                    "Failed to generate TypeConverters report", e);
+        } finally {
+            Thread.currentThread().setContextClassLoader(oldClassLoader);
         }
+    }
 
-        if (generateReports) {
-            generateReport(loader.getTypeConversions());
+    private boolean createOutputDirectory(final File outputDir) {
+        if (outputDir.exists()) {
+            if (!outputDir.isDirectory()) {
+                getLog().error(
+                        "File with same name already exists: "
+                                + outputDir.getAbsolutePath());
+                return false;
+            }
+        } else {
+            if (!outputDir.mkdirs()) {
+                getLog().error(
+                        "Cannot make output directory at: "
+                                + outputDir.getAbsolutePath());
+                return false;
+            }
         }
+        return true;
     }
 
-    protected void generateReport(TypeMapping[] mappings) throws MojoExecutionException {
+    private File getSkinArtifactFile(DecorationModel decoration)
+            throws MojoFailureException {
 
-        File f = reportsDirectory;
-        if (!f.exists()) {
-            f.mkdirs();
+        Skin skin = decoration.getSkin();
+        if (skin == null) {
+            skin = Skin.getDefaultSkin();
         }
 
-        File report = new File(f, "camel-converters.txt");
-        FileWriter fw = null;
+        String version = skin.getVersion();
+        Artifact artifact;
         try {
-            fw = new FileWriter(report);
+            if (version == null) {
+                version = Artifact.RELEASE_VERSION;
+            }
+
+            VersionRange versionSpec = VersionRange
+                    .createFromVersionSpec(version);
+            artifact = artifactFactory.createDependencyArtifact(skin
+                    .getGroupId(), skin.getArtifactId(), versionSpec, "jar",
+                    null, null);
+
+            artifactResolver.resolve(artifact, remoteArtifactRepositories,
+                    localRepository);
+            return artifact.getFile();
+        } catch (InvalidVersionSpecificationException e) {
+            throw new MojoFailureException("The skin version '" + version
+                    + "' is not valid: " + e.getMessage());
+        } catch (ArtifactResolutionException e) {
+            throw new MojoFailureException("Unable to fink skin: "
+                    + e.getMessage());
+        } catch (ArtifactNotFoundException e) {
+            throw new MojoFailureException("The skin does not exist: "
+                    + e.getMessage());
+        }
+    }
+
+    private String converterType(String converterClassName) {
+        if (CONVERTER_TYPE_STATIC.equals(converterClassName)) {
+            return REPORT_METHOD_STATIC;
+        } else if (CONVERTER_TYPE_INSTANCE.equals(converterClassName)) {
+            return REPORT_METHOD_INSTANCE;
+        } else {
+            return REPORT_METHOD_UNKNOWN;
+        }
+    }
 
-            fw.write("Camel Type Converter definitions\n");
-            fw.write(LINE_SEPARATOR);
+    private void generateReport(Sink sink, Locale locale, TypeMapping[] mappings)
+            throws MojoExecutionException {
+        beginReport(sink, locale);
+
+        Set<String> classes;
+        Map<String, Set<String>> packages = new TreeMap<String, Set<String>>();
+        Class<?> prevFrom = null;
+        Class<?> prevTo = null;
+
+        sink.table();
+        tableHeader(sink, locale);
+
+        for (TypeMapping mapping : mappings) {
+            boolean ignored = false;
+            Class<?> from = mapping.getFromType();
+            Class<?> to = mapping.getToType();
+            if (ObjectHelper.equal(from, prevFrom)
+                    && ObjectHelper.equal(to, prevTo)) {
+                ignored = true;
+            }
+            prevFrom = from;
+            prevTo = to;
+            Method method = mapping.getMethod();
+            Class<?> methodClass = method.getDeclaringClass();
+            String packageName = methodClass.getPackage().getName();
+            if (packages.containsKey(packageName)) {
+                classes = packages.get(packageName);
+            } else {
+                classes = new TreeSet<String>();
+                packages.put(packageName, classes);
+            }
+            classes.add(methodClass.getName());
 
-            Set<String> packages = new HashSet<String>();
-            Set<String> classes = new HashSet<String>();
+            if (ignored) {
+                sink.italic();
+                this.tableRow(sink, from.getSimpleName(), to.getSimpleName(),
+                        method.getName(), methodClass, mapping
+                                .getConverterType().getName());
+                sink.italic_();
+            } else {
+                this.tableRow(sink, from.getSimpleName(), to.getSimpleName(),
+                        method.getName(), methodClass, mapping
+                                .getConverterType().getName());
+            }
+        }
+        sink.table_();
 
-            StringBuffer buffer = new StringBuffer();
-            Class prevFrom = null;
-            Class prevTo = null;
-            for (TypeMapping mapping : mappings) {
-                boolean ignored = false;
-                Class from = mapping.getFromType();
-                Class to = mapping.getToType();
-                if (ObjectHelper.equal(from, prevFrom) && ObjectHelper.equal(to,
prevTo)) {
-
-                    ignored = true;
-                    buffer.append(" ");
-                }
-                prevFrom = from;
-                prevTo = to;
-                Method method = mapping.getMethod();
-                Class methodClass = method.getDeclaringClass();
-                packages.add(methodClass.getPackage().getName());
-                classes.add(methodClass.getName());
-
-                buffer.append(from.getSimpleName() + "=>" + to.getSimpleName());
-                buffer.append(" [" + mapping.getConverterType().getSimpleName());
-                buffer.append("(" + methodClass.getName() + "." + method.getName() + "())]");
-                if (ignored) {
-                    buffer.append(" - IGNORED replaced by conversion method above");
-                }
-
-                fw.write(buffer.toString() + "\n");
-                buffer.setLength(0);
-            }
-
-            String summary = "Found " + mappings.length + " type conversion methods in "
+ classes.size()
-                             + " classes from " + packages.size() + " packages.";
-            fw.write(LINE_SEPARATOR);
-            fw.write(summary + "\n");
-            getLog().info(summary);
-        } catch (IOException e) {
-            throw new MojoExecutionException("Error creating report file " + report, e);
-        } finally {
-            if (fw != null) {
-                try {
-                    fw.close();
-                } catch (IOException e) {
-                    // ignore
-                }
+        generatePackageReport(sink, packages);
+
+        endReport(sink);
+    }
+
+    private void generatePackageReport(Sink sink,
+            Map<String, Set<String>> packages) {
+        for (Map.Entry<String, Set<String>> entry : packages.entrySet()) {
+            sink.section2();
+            sink.sectionTitle2();
+            sink.text(entry.getKey());
+            sink.sectionTitle2_();
+            sink.list();
+            for (String clazz : entry.getValue()) {
+                sink.listItem();
+                sink.anchor(clazz);
+                sink.text(clazz);
+                sink.anchor_();
+                sink.listItem_();
             }
+            sink.list_();
+            sink.section2_();
         }
     }
+
+    private void beginReport(Sink sink, Locale locale) {
+        String title = getBundle(locale).getString(
+                "report.converters.report.title");
+        String header = getBundle(locale).getString(
+                "report.converters.report.header");
+        String intro = getBundle(locale).getString(
+                "report.converters.report.intro");
+        String seealso = getBundle(locale).getString(
+                "report.converters.report.seealso");
+
+        sink.head();
+        sink.title();
+        sink.text(title);
+        sink.title_();
+        sink.head_();
+
+        sink.body();
+
+        sink.section1();
+
+        sink.sectionTitle1();
+        sink.text(header);
+        sink.sectionTitle1_();
+
+        sink.paragraph();
+        sink.text(intro);
+        sink.paragraph_();
+        sink.paragraph();
+        sink.text(seealso);
+        sink.list();
+        sink.listItem();
+        sink.link(WIKI_TYPECONVERER_URL);
+        sink.text(WIKI_TYPECONVERER_URL);
+        sink.link_();
+        sink.listItem_();
+        sink.list_();
+        sink.paragraph_();
+    }
+
+    private void tableHeader(Sink sink, Locale locale) {
+        String caption = getBundle(locale).getString(
+                "report.converters.report.table.caption");
+        String head1 = getBundle(locale).getString(
+                "report.converters.report.table.head1");
+        String head2 = getBundle(locale).getString(
+                "report.converters.report.table.head2");
+        String head3 = getBundle(locale).getString(
+                "report.converters.report.table.head3");
+        String head4 = getBundle(locale).getString(
+                "report.converters.report.table.head4");
+        String head5 = getBundle(locale).getString(
+                "report.converters.report.table.head5");
+
+        sink.tableCaption();
+        sink.text(caption);
+        sink.tableCaption_();
+
+        sink.tableRow();
+        sink.tableHeaderCell();
+        sink.text(head1);
+        sink.tableHeaderCell_();
+        sink.tableHeaderCell();
+        sink.text(head2);
+        sink.tableHeaderCell_();
+        sink.tableHeaderCell();
+        sink.text(head3);
+        sink.tableHeaderCell_();
+        sink.tableHeaderCell();
+        sink.text(head4);
+        sink.tableHeaderCell_();
+        sink.tableHeaderCell();
+        sink.text(head5);
+        sink.tableHeaderCell_();
+        sink.tableRow();
+    }
+
+    private void tableRow(Sink sink, String from, String to, String method,
+            Class<?> clazz, String type) {
+
+        sink.tableRow();
+        sink.tableCell();
+        sink.text(from);
+        sink.tableCell_();
+        sink.tableCell();
+        sink.text(to);
+        sink.tableCell_();
+        sink.tableCell();
+        sink.text(method);
+        sink.tableCell_();
+        sink.tableCell();
+        sink.link(clazz.getName());
+        sink.text(clazz.getSimpleName());
+        sink.link_();
+        sink.tableCell_();
+        sink.tableCell();
+        sink.text(converterType(type));
+        sink.tableCell_();
+        sink.tableRow();
+    }
+
+    private void endReport(Sink sink) {
+        sink.section1_();
+
+        sink.body_();
+        sink.flush();
+        sink.close();
+    }
 }

Modified: activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java?rev=656934&r1=656933&r2=656934&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
(original)
+++ activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
Thu May 15 22:02:44 2008
@@ -152,14 +152,14 @@
      * @see org.apache.maven.reporting.MavenReport#getDescription(Locale)
      */
     public String getDescription(final Locale locale) {
-        return getBundle(locale).getString("report.description");
+        return getBundle(locale).getString("report.dot.description");
     }
 
     /**
      * @see org.apache.maven.reporting.MavenReport#getName(Locale)
      */
     public String getName(final Locale locale) {
-        return getBundle(locale).getString("report.name");
+        return getBundle(locale).getString("report.dot.name");
     }
 
     /**

Modified: activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java?rev=656934&r1=656933&r2=656934&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
(original)
+++ activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
Thu May 15 22:02:44 2008
@@ -206,7 +206,7 @@
         return (String[]) args.toArray(new String[0]);
     }
 
-    protected ClassLoader createClassLoader(ClassLoader parent) throws MalformedURLException
{
+    public ClassLoader createClassLoader(ClassLoader parent) throws MalformedURLException
{
         getLog().debug("Using classpath: " + classpathElements);
 
         int size = classpathElements.size();

Modified: activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/resources/camel-maven-plugin.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/resources/camel-maven-plugin.properties?rev=656934&r1=656933&r2=656934&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/resources/camel-maven-plugin.properties
(original)
+++ activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/resources/camel-maven-plugin.properties
Thu May 15 22:02:44 2008
@@ -15,5 +15,19 @@
 # specific language governing permissions and limitations
 # under the License.
 
-report.name = Camel EIP Diagram
-report.description = This report generates a graphical diagram of all the Enterprise Integration
Patterns in this project
\ No newline at end of file
+report.dot.name = Camel EIP Diagram
+report.dot.description = This report generates a graphical diagram of all the Enterprise
Integration Patterns in this project
+report.dot.header=Dot Report
+
+report.converters.name = Camel TypeConverter(s)
+report.converters.description = This report generates a list of available type converters.
+report.converters.report.title = Apache Camel TypeConverters
+report.converters.report.header = TypeConverter(s)
+report.converters.report.table.caption = TypeConverter Table
+report.converters.report.table.head1 = From
+report.converters.report.table.head2 = To
+report.converters.report.table.head3 = Method
+report.converters.report.table.head4 = Class
+report.converters.report.table.head5 = Type
+report.converters.report.intro = List of available TypeConverters for on-the-fly transformation
of Messages into another required format. 
+report.converters.report.seealso = See also: 

Modified: activemq/camel/trunk/tooling/maven/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/pom.xml?rev=656934&r1=656933&r2=656934&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/pom.xml (original)
+++ activemq/camel/trunk/tooling/maven/pom.xml Thu May 15 22:02:44 2008
@@ -34,7 +34,6 @@
   <modules>
     <module>camel-maven-plugin</module>
     <module>maven-html-to-pdf</module>
-    <module>maven-camel-converters</module>
   </modules>
 
   <dependencies>



Mime
View raw message