Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate Documentation for JSF 2 composite components [closed]

I'm looking to generate documentation for a custom JSF 2 composite component library. The composite components are not referenced in any faces-config.xml file, but rather the .xhtml files for the composite components are stored in META-INF/resources and use the new composite:interface tag to define the interface.

For JSP tag libraries, documentation can be generated using https://taglibrarydoc.dev.java.net/ and I'm wondering if there is something similar for my JSF 2 composite component library.

like image 732
digitaljoel Avatar asked Mar 05 '10 23:03

digitaljoel


1 Answers

You can use OmniFaces Vdldoc to generate documentation from your <cc:interface> tags (or the documentation in taglib.xml files).

Say your composite components reside in the /META-INF/resources/myLib folder. You would then need a myLib.taglib.xml-file in the META-INF folder like this:

<facelet-taglib>
    <description>Your description</description>
    <namespace>http://example.com/myLib</namespace>
    <short-name>my</short-name>
    <composite-library-name>myLib</composite-library-name>
</facelet-taglib>

(For a more complete example, have a look at this question)

You can now use Vdldoc to generate your documentation:

java -jar vdldoc-2.1.jar myLib.taglib.xml

Update: If your project uses maven there is now vdldoc-maven-plugin to easily integrate it into your build. Basically just add it to the <reporting>-section of your pom.xml:

<reporting>
  <plugins>
    <plugin>
      <groupId>com.github.matinh.vdldoc</groupId>
      <artifactId>vdldoc-maven-plugin</artifactId>
      <version>2.0</version>
    </plugin>
  </plugins>
</reporting>

And run mvn site to generate the documentation. See the plugin's homepage for more details.

like image 174
Martin Höller Avatar answered Oct 07 '22 18:10

Martin Höller