<project xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.richfaces.cdk.docs</groupId>
  <artifactId>guide-${translation}</artifactId>
  <version>4.0.0-SNAPSHOT</version>
  <packaging>jdocbook</packaging>
  <name>${bookname}-(${translation})</name>
  
  <parent>
    <groupId>org.richfaces.cdk</groupId>
    <artifactId>docs</artifactId>
    <version>4.0.0-SNAPSHOT</version>
  </parent>

  <properties>
    <translation>en-US</translation>
    <docname>Component_Development_Kit_Guide</docname>
    <bookname>Component Development Kit Guide</bookname>
  </properties> 

  <repositories>
    <repository>
      <id>jboss-public-repository-group</id>
      <name>JBoss Repository</name>
      <layout>default</layout>
      <url>https://repository.jboss.org/nexus/content/groups/public</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
  
  <pluginRepositories>
    <pluginRepository>
      <id>jboss-public-repository-group</id>
      <name>JBoss Repository</name>
      <layout>default</layout>
      <url>https://repository.jboss.org/nexus/content/groups/public</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>
  
  
  <profiles>

    <!-- mvn compile -->
    <profile>
      <id>all</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jboss.maven.plugins</groupId>
            <artifactId>maven-jdocbook-plugin</artifactId>
            <version>2.2.0</version>
            <extensions>true</extensions>
            <configuration>
              <formats>
                <format>
                  <formatName>pdf</formatName>
                  <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
                  <finalName>${docname}.pdf</finalName>
                </format>
                <format>
                  <formatName>html</formatName>
                  <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
                <format>
                  <formatName>html_single</formatName>
                  <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
              </formats>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- mvn compile -Phtml -->
    <profile>
      <id>html</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jboss.maven.plugins</groupId>
            <artifactId>maven-jdocbook-plugin</artifactId>
            <version>2.2.0</version>
            <extensions>true</extensions>
            <configuration>
              <formats>
                <format>
                  <formatName>html</formatName>
                  <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
              </formats>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- mvn compile -Phtml-single -->
    <profile>
      <id>html-single</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jboss.maven.plugins</groupId>
            <artifactId>maven-jdocbook-plugin</artifactId>
            <version>2.2.0</version>
            <extensions>true</extensions>
            <configuration>
              <formats>
                <format>
                  <formatName>html_single</formatName>
                  <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
              </formats>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- mvn compile -Ppdf -->
    <profile>
      <id>pdf</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jboss.maven.plugins</groupId>
            <artifactId>maven-jdocbook-plugin</artifactId>
            <version>2.2.0</version>
            <extensions>true</extensions>
            <configuration>
              <formats>
                <format>
                  <formatName>pdf</formatName>
                  <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
                  <finalName>${docname}.pdf</finalName>
                </format>
              </formats>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    
    <!-- mvn compile -Pdocs -->
    <!-- For compiling from parent pom.xml -->
    <profile>
      <id>docs</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jboss.maven.plugins</groupId>
            <artifactId>maven-jdocbook-plugin</artifactId>
            <version>2.2.0</version>
            <extensions>true</extensions>
            <configuration>
              <formats>
                <format>
                  <formatName>pdf</formatName>
                  <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
                  <finalName>${docname}.pdf</finalName>
                </format>
                <format>
                  <formatName>html</formatName>
                  <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
                <format>
                  <formatName>html_single</formatName>
                  <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
                  <finalName>index.html</finalName>
                </format>
              </formats>
              <imageResource>
                <directory>guide/${translation}</directory>
                <includes>
                  <include>images/*</include>
                </includes>
              </imageResource>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

  <build>
    <plugins>
      <plugin>
        <groupId>org.jboss.maven.plugins</groupId>
        <artifactId>maven-jdocbook-plugin</artifactId>
        <version>2.2.0</version>
        <extensions>true</extensions>
        <dependencies>
          <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jbossorg-docbook-xslt</artifactId>
            <version>1.1.0</version>
          </dependency>
          <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jbossorg-jdocbook-style</artifactId>
            <version>1.1.0</version>
            <type>jdocbook-style</type>
          </dependency>
        </dependencies>
        <configuration>
          <sourceDocumentName>${docname}.xml</sourceDocumentName>
          <sourceDirectory>.</sourceDirectory>
          <imageResource>
            <directory>${project.basedir}/${translation}</directory>
            <includes>
              <include>images/*</include>
            </includes>
          </imageResource>
          <options>
            <xincludeSupported>true</xincludeSupported>
            <xmlTransformerType>saxon</xmlTransformerType>
            <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
            <!--     could also locate the docbook dependency and inspect its version... -->
            <docbookVersion>1.72.0</docbookVersion>
            <transformerParameters>
              <property>
                <name>javax.xml.parsers.DocumentBuilderFactory</name>
                <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
              </property>
              <property>
                <name>javax.xml.parsers.SAXParserFactory</name>
                <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
              </property>
            </transformerParameters>
          </options>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

