Author: evenisse
Date: Thu May 19 00:02:19 2005
New Revision: 170885
URL: http://svn.apache.org/viewcvs?rev=170885&view=rev
Log:
Add multipage support.
Added:
maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/AbstractMavenMultiPageReport.java
maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/sink/
maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/sink/SinkFactory.java
Added:
maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/AbstractMavenMultiPageReport.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/AbstractMavenMultiPageReport.java?rev=170885&view=auto
==============================================================================
---
maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/AbstractMavenMultiPageReport.java
(added)
+++
maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/AbstractMavenMultiPageReport.java
Thu May 19 00:02:19 2005
@@ -0,0 +1,72 @@
+package org.apache.maven.reporting;
+
+import java.io.InputStream;
+
+import org.apache.maven.reporting.sink.SinkFactory;
+import org.codehaus.doxia.sink.Sink;
+
+/*
+ * Copyright 2005 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.
+ */
+
+/**
+ * @author <a href="[EMAIL PROTECTED]">Emmanuel Venisse</a>
+ * @version $Id: MavenReport.java 163376 2005-02-23 00:06:06Z brett $
+ */
+public abstract class AbstractMavenMultiPageReport
+ extends AbstractMavenReport
+{
+ SinkFactory factory;
+
+ public void setSinkFactory( SinkFactory factory )
+ {
+ this.factory = factory;
+
+ if ( getFlavour() != null )
+ {
+ factory.setFlavour( getFlavour() );
+ }
+
+ if ( !useDefaultSiteDescriptor() )
+ {
+ factory.setSiteDescriptor( getSiteDescriptor() );
+ }
+ }
+ public SinkFactory getSinkFactory()
+ {
+ return factory;
+ }
+
+ public String getFlavour()
+ {
+ return null;
+ }
+
+ public InputStream getSiteDescriptor()
+ {
+ return null;
+ }
+
+ public boolean useDefaultSiteDescriptor()
+ {
+ return true;
+ }
+
+ public Sink getSink( String outputName )
+ throws Exception
+ {
+ return factory.getSink( outputName );
+ }
+}
\ No newline at end of file
Added:
maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/sink/SinkFactory.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/sink/SinkFactory.java?rev=170885&view=auto
==============================================================================
---
maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/sink/SinkFactory.java
(added)
+++
maven/components/trunk/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/sink/SinkFactory.java
Thu May 19 00:02:19 2005
@@ -0,0 +1,79 @@
+package org.apache.maven.reporting.sink;
+
+import java.io.File;
+import java.io.InputStream;
+
+import org.codehaus.doxia.sink.Sink;
+import org.codehaus.doxia.site.renderer.SiteRenderer;
+import org.codehaus.plexus.util.StringInputStream;
+
+/*
+ * Copyright 2005 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.
+ */
+
+/**
+ * @author <a href="[EMAIL PROTECTED]">Emmanuel Venisse</a>
+ * @version $Id: MavenReport.java 163376 2005-02-23 00:06:06Z brett $
+ */
+public class SinkFactory
+{
+ private String outputDirectory;
+
+ private String siteDirectory;
+
+ private SiteRenderer siteRenderer;
+
+ private InputStream siteDescriptor;
+
+ private String flavour;
+
+ public void setOutputDirectory( String outputDirectory )
+ {
+ this.outputDirectory = outputDirectory;
+ }
+
+ public void setSiteRenderer( SiteRenderer siteRenderer )
+ {
+ this.siteRenderer = siteRenderer;
+ }
+
+ public void setSiteDirectory( String siteDirectory )
+ {
+ this.siteDirectory = siteDirectory;
+ }
+
+ public void setFlavour( String flavour )
+ {
+ this.flavour = flavour;
+ }
+
+ public void setSiteDescriptor( InputStream siteDescriptor )
+ {
+ this.siteDescriptor = siteDescriptor;
+ }
+
+ public Sink getSink( String outputFileName )
+ throws Exception
+ {
+ InputStream descriptor = siteDescriptor;
+ if ( descriptor == null )
+ {
+ descriptor = new StringInputStream( "" );
+ }
+
+ return siteRenderer.createSink( new File( siteDirectory ),
siteDirectory, outputFileName, outputDirectory,
+ descriptor, flavour );
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]