maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r385825 - in /maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer: DefaultSiteRenderer.java DocumentRenderer.java DoxiaDocumentRenderer.java Renderer.java
Date Tue, 14 Mar 2006 16:34:02 GMT
Author: brett
Date: Tue Mar 14 08:33:58 2006
New Revision: 385825

URL: http://svn.apache.org/viewcvs?rev=385825&view=rev
Log:
[MSITE-68] site:run now runs reports and category summary

Added:
    maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
  (with props)
    maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
  (with props)
Modified:
    maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
    maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java

Modified: maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java?rev=385825&r1=385824&r2=385825&view=diff
==============================================================================
--- maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
(original)
+++ maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
Tue Mar 14 08:33:58 2006
@@ -188,7 +188,7 @@
                     throw new RendererException( "Files '" + doc + "' clashes with existing
'" + originalDoc + "'" );
                 }
 
-                files.put( key, context );
+                files.put( key, new DoxiaDocumentRenderer( context ) );
             }
         }
     }
@@ -199,9 +199,9 @@
     {
         for ( Iterator i = docs.iterator(); i.hasNext(); )
         {
-            RenderingContext renderingContext = (RenderingContext) i.next();
+            DocumentRenderer docRenderer = (DocumentRenderer) i.next();
 
-            File outputFile = new File( outputDirectory, renderingContext.getOutputName()
);
+            File outputFile = new File( outputDirectory, docRenderer.getOutputName() );
 
             if ( !outputFile.getParentFile().exists() )
             {
@@ -212,7 +212,7 @@
 
             try
             {
-                renderDocument( writer, renderingContext, siteRenderingContext );
+                docRenderer.renderDocument( writer, this, siteRenderingContext );
             }
             finally
             {
@@ -221,11 +221,10 @@
         }
     }
 
-    public void renderDocument( Writer writer, RenderingContext renderingContext,
-                                SiteRenderingContext siteRenderingContext )
+    public void renderDocument( Writer writer, RenderingContext renderingContext, SiteRenderingContext
context )
         throws RendererException, FileNotFoundException
     {
-        SiteRendererSink sink = createSink( renderingContext );
+        SiteRendererSink sink = new SiteRendererSink( renderingContext );
 
         String fullPathDoc = new File( renderingContext.getBasedir(), renderingContext.getInputName()
).getPath();
 
@@ -235,7 +234,7 @@
 
             doxia.parse( reader, renderingContext.getParserId(), sink );
 
-            generateDocument( writer, sink, siteRenderingContext );
+            generateDocument( writer, sink, context );
         }
         catch ( ParserNotFoundException e )
         {
@@ -386,11 +385,6 @@
         {
             throw new RendererException( "Error while generating code.", e );
         }
-    }
-
-    public SiteRendererSink createSink( RenderingContext renderingContext )
-    {
-        return new SiteRendererSink( renderingContext );
     }
 
     public SiteRenderingContext createContextForSkin( File skinFile, Map attributes, DecorationModel
decoration,

Added: maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java?rev=385825&view=auto
==============================================================================
--- maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
(added)
+++ maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
Tue Mar 14 08:33:58 2006
@@ -0,0 +1,33 @@
+package org.apache.maven.doxia.siterenderer;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.FileNotFoundException;
+import java.io.Writer;
+
+/**
+ * Renders a page.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public interface DocumentRenderer
+{
+    void renderDocument( Writer writer, Renderer renderer, SiteRenderingContext siteRenderingContext
)
+        throws RendererException, FileNotFoundException;
+
+    String getOutputName();
+}

Propchange: maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DocumentRenderer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java?rev=385825&view=auto
==============================================================================
--- maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
(added)
+++ maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
Tue Mar 14 08:33:58 2006
@@ -0,0 +1,50 @@
+package org.apache.maven.doxia.siterenderer;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.doxia.module.xhtml.decoration.render.RenderingContext;
+
+import java.io.FileNotFoundException;
+import java.io.Writer;
+
+/**
+ * Renders a page with Doxia.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public class DoxiaDocumentRenderer
+    implements DocumentRenderer
+{
+    private RenderingContext renderingContext;
+
+    public DoxiaDocumentRenderer( RenderingContext renderingContext )
+    {
+        this.renderingContext = renderingContext;
+    }
+
+    public void renderDocument( Writer writer, Renderer renderer, SiteRenderingContext siteRenderingContext
)
+        throws RendererException, FileNotFoundException
+    {
+        renderer.renderDocument( writer, renderingContext, siteRenderingContext );
+    }
+
+    public String getOutputName()
+    {
+        return renderingContext.getOutputName();
+    }
+
+}

Propchange: maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DoxiaDocumentRenderer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
URL: http://svn.apache.org/viewcvs/maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java?rev=385825&r1=385824&r2=385825&view=diff
==============================================================================
--- maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
(original)
+++ maven/doxia/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/Renderer.java
Tue Mar 14 08:33:58 2006
@@ -47,9 +47,6 @@
     void generateDocument( Writer writer, SiteRendererSink sink, SiteRenderingContext siteRenderingContext
)
         throws RendererException;
 
-    SiteRendererSink createSink( RenderingContext renderingContext )
-        throws RendererException, IOException;
-
     SiteRenderingContext createContextForSkin( File skinFile, Map attributes, DecorationModel
decoration,
                                                String defaultWindowTitle, Locale locale )
         throws IOException;



Mime
View raw message