【问题标题】:Generate Documentation for JSF 2 composite components [closed]为 JSF 2 复合组件生成文档 [关闭]
【发布时间】:2010-03-05 23:31:58
【问题描述】:

我正在寻找为自定义 JSF 2 复合组件库生成文档。复合组件不会在任何 faces-config.xml 文件中引用,而是复合组件的 .xhtml 文件存储在 META-INF/resources 中,并使用新的复合:接口标签来定义接口。

对于 JSP 标记库,可以使用 https://taglibrarydoc.dev.java.net/ 生成文档,我想知道我的 JSF 2 复合组件库是否有类似的东西。

【问题讨论】:

标签: jsf documentation facelets composite-component documentation-generation


【解决方案1】:

您可以使用OmniFaces Vdldoc 从您的<cc:interface> 标签(或taglib.xml 文件中的文档)生成文档。

假设您的复合组件位于/META-INF/resources/myLib 文件夹中。然后,您将需要在 META-INF 文件夹中的 myLib.taglib.xml 文件,如下所示:

<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>

(有关更完整的示例,请查看this question

您现在可以使用 Vdldoc 生成文档:

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

更新: 如果您的项目使用 maven,现在有 vdldoc-maven-plugin 可以轻松地将其集成到您的构建中。基本上只需将其添加到您的pom.xml&lt;reporting&gt; 部分:

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

然后运行mvn site 来生成文档。有关详细信息,请参阅插件主页。

【讨论】:

    【解决方案2】:

    rich-faces 组件开发包提供文档注释 http://community.jboss.org/wiki/RichFacesCDKannotations

    --kiran.kumar

    【讨论】:

    • 但这并不真正适用于 JSF 2 复合组件。
    猜你喜欢
    • 2013-11-10
    • 1970-01-01
    • 2012-10-02
    • 1970-01-01
    • 2015-08-09
    • 2012-10-16
    • 2011-09-14
    • 2011-09-28
    • 1970-01-01
    相关资源
    最近更新 更多