Both single page and chunked output?

22 views
Skip to first unread message

Mark Craig

unread,
Jun 4, 2011, 5:40:58 AM6/4/11
to Docbkx Tools Users
Hello,

What's the right way to do both single page and chunked HTML output in
the same project?

I couldn't figure it out, so I hacked the AbstractHtmlMojo class
adding a configuration property called singlePage for use when
chunking, see below. If there's a standard way of generating both, I'd
rather do that.

Index: docbkx-maven-plugin/src/main/java/com/agilejava/docbkx/maven/
AbstractHtmlMojo.java
===================================================================
--- docbkx-maven-plugin/src/main/java/com/agilejava/docbkx/maven/
AbstractHtmlMojo.java (revision 232)
+++ docbkx-maven-plugin/src/main/java/com/agilejava/docbkx/maven/
AbstractHtmlMojo.java (working copy)
@@ -33,6 +33,14 @@
* @parameter default="false"
*/
private boolean chunkedOutput;
+
+ /**
+ * Indicates whether single page output should be generated when
+ * {@link #chunkedOutput} is true.
+ *
+ * @parameter default="false"
+ */
+ private boolean singlePage;

/**
* DOCUMENT ME!
@@ -56,6 +64,12 @@
public void execute() throws MojoExecutionException,
MojoFailureException {
setUseStandardOutput(!chunkedOutput);
super.execute();
+
+ if (chunkedOutput && singlePage) {
+ chunkedOutput = false;
+ setUseStandardOutput(true);
+ super.execute();
+ }
}

/**

Regards,
Mark

Mimil Mimil

unread,
Jun 7, 2011, 8:40:53 AM6/7/11
to docbkx-to...@googlegroups.com
Hello,

sorry for the delay, my dsl line is broken so i cannot do much opensource =)

Isn't what you are looking for is already supported using the power of maven (heritage of properties): @see "per execution configuration" and "shared configuration" in sample below:

<plugin>
       
<groupId>com.agilejava.docbkx</groupId>
       
<artifactId>docbkx-maven-plugin</artifactId>
       
<version>2.0.10-SNAPSHOT</version>
       
<executions>
         
<!-- -->
         
<execution>
           
<id>documentation chunked</id>
           
<phase>pre-site</phase>
           
<goals>
              <goal>generate-html</goal>

            </goals>
           
<configuration>
             
<!-- per execution configuration -->
             
<includes>book.xml</includes>
             
<draftMode>yes</draftMode>
<chunkedOutput>true</chunkedOutput>
            </configuration>
         
</execution>
<execution>
           
<id>documentation singlepage</id>
           
<phase>pre-site</phase>
           
<goals>
              <goal>generate-html</goal>

           
</goals>
           
<configuration>
             
<!-- per execution configuration -->
             
<draftMode>yes</draftMode>
           
</configuration>
         
</execution>
        </executions>
       
<configuration>
         
<!-- shared configuration -->

<includes>book.xml</includes>
         
<paperType>A4</paperType>
         
<fop1Extensions>1</fop1Extensions>

         
<foCustomization>src/docbkx-stylesheet/fo/docbook.xsl</foCustomization>
         
         
<customizationParameters>
           
<!-- additional XSLT parameters-->
           
<parameter>
             
<name>key</name>
             
<value>value</value>
           
</parameter>
         
</customizationParameters>
       
</configuration>
     
</plugin>

Cédric,



--
You received this message because you are subscribed to the Google Groups "Docbkx Tools Users" group.
To post to this group, send email to docbkx-to...@googlegroups.com.
To unsubscribe from this group, send email to docbkx-tools-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/docbkx-tools-users?hl=en.


Mark Craig

unread,
Jun 8, 2011, 12:33:39 PM6/8/11
to docbkx-to...@googlegroups.com
Thank you, Cédric, for helping me to think about it this way, with multiple executions for the same plugin. Works for me, and makes the pom.xml more readable at the same time.

Regards,
Mark
Reply all
Reply to author
Forward
0 new messages