You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by lt...@apache.org on 2005/09/20 06:58:40 UTC

svn commit: r290361 - in /maven/maven-1/plugins/trunk/xdoc: plugin.jelly plugin.properties src/plugin-resources/dtd/maven-xdoc-1.10.dtd src/plugin-resources/xsd/maven-navigation-1.10.xsd xdocs/changes.xml xdocs/goals.xml xdocs/properties.xml

Author: ltheussl
Date: Mon Sep 19 21:58:36 2005
New Revision: 290361

URL: http://svn.apache.org/viewcvs?rev=290361&view=rev
Log:
MPXDOC-87: Make xdoc:validate work

Modified:
    maven/maven-1/plugins/trunk/xdoc/plugin.jelly
    maven/maven-1/plugins/trunk/xdoc/plugin.properties
    maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/dtd/maven-xdoc-1.10.dtd
    maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/xsd/maven-navigation-1.10.xsd
    maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml
    maven/maven-1/plugins/trunk/xdoc/xdocs/goals.xml
    maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml

Modified: maven/maven-1/plugins/trunk/xdoc/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/plugin.jelly?rev=290361&r1=290360&r2=290361&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/xdoc/plugin.jelly Mon Sep 19 21:58:36 2005
@@ -30,6 +30,7 @@
   xmlns:ant="jelly:ant"
   xmlns:fmt="jelly:fmt"
   xmlns:doc="doc"
+  xmlns:plugin="plugin"
   xmlns:xdoc="jelly:org.apache.maven.xdoc.XdocTagLibrary">
 
   <j:new var="reports" className="java.util.ArrayList"/>
@@ -729,33 +730,84 @@
     </j:forEach>
   </goal>
 
+
   <!-- ================================================================== -->
-  <!-- V A L I D A T E  X D O C S                                         -->
+  <!-- V A L I D A T E    N A V I G A T I O N    F I L E                  -->
   <!-- ================================================================== -->
 
-  <!-- validate xdocs -->
-  <goal name="xdoc:validate" prereqs="pom:taglib"
-    description="Validate xdocs match the schema">
+  <goal name="xdoc:navigation-validate"
+    description="Validate navigation file">
+
+     <available
+        file="${maven.docs.src}/${maven.xdoc.navigation.file}"
+        property="navigationFile.available"/>
+
+    <j:if test="${navigationFile.available}">
+        <maven:get plugin="maven-xdoc-plugin" property="plugin" var="installedPlugin" />
+        <!-- Remove SNAPSHOT -->
+        <j:choose>
+          <j:when test="${installedPlugin.currentVersion.endsWith('-SNAPSHOT')}">
+            <j:set var="currentRelease" value="${installedPlugin.currentVersion.substring(0,pom.currentVersion.length()-9)}"/>
+          </j:when>
+          <j:otherwise>
+            <j:set var="currentRelease" value="${installedPlugin.currentVersion}"/>
+          </j:otherwise>
+        </j:choose>
+        <plugin:validate-xml
+            schema="${plugin.resources}/xsd/maven-navigation-${currentRelease}.xsd"
+            file="${maven.docs.src}/${maven.xdoc.navigation.file}"/>
+    </j:if>
+
+  </goal>
+
+    <!-- ================================================================== -->
+    <!-- V A L I D A T E  X D O C S                                         -->
+    <!-- ================================================================== -->
+
+    <!-- validate xdocs -->
+    <goal name="xdoc:validate" prereqs="xdoc:navigation-validate"
+        description="Validate xdocs match the schema">
 
     <available file="${maven.docs.src}" type="dir"
-      property="maven.docs.src.available"/>
+        property="maven.docs.src.available"/>
 
     <j:if test="${maven.docs.src.available}">
-      <fileScanner var="navFiles">
+      <fileScanner var="xmlFiles">
         <fileset dir="${maven.docs.src}">
           <patternset>
-            <include name="**/${maven.xdoc.navigation.file}"/>
+            <include name="**/*.xml"/>
+            <exclude name="**/${maven.xdoc.navigation.file}" />
+            <util:tokenize var="files" delim=",">${maven.xdoc.validate.exclude}</util:tokenize>
+            <j:forEach var="pattern" items="${files}">
+                <exclude name="${pattern}" />
+            </j:forEach>
+            <util:tokenize var="files" delim=",">${maven.xdoc.xml.copy}</util:tokenize>
+            <j:forEach var="pattern" items="${files}">
+                <exclude name="${pattern}" />
+            </j:forEach>
           </patternset>
         </fileset>
       </fileScanner>
-
-      <j:forEach var="file" items="${navFiles.iterator()}">
-        <echo>Validating ${file}</echo>
-        <pom:validate validator="${maven.home}/maven-navigation-1.0.xsd"
-          projectDescriptor="${file}"/>
+      <maven:get plugin="maven-xdoc-plugin" property="plugin" var="installedPlugin" />
+      <!-- Remove SNAPSHOT -->
+        <j:choose>
+          <j:when test="${installedPlugin.currentVersion.endsWith('-SNAPSHOT')}">
+            <j:set var="currentRelease" value="${installedPlugin.currentVersion.substring(0,pom.currentVersion.length()-9)}"/>
+          </j:when>
+          <j:otherwise>
+            <j:set var="currentRelease" value="${installedPlugin.currentVersion}"/>
+          </j:otherwise>
+        </j:choose>
+      <j:forEach var="file" items="${xmlFiles.iterator()}">
+        <plugin:validate-xml
+            schema="${plugin.resources}/dtd/maven-xdoc-${currentRelease}.dtd"
+            file="${file}"/>
       </j:forEach>
     </j:if>
-  </goal>
+
+   </goal>
+
+
 
   <!-- ================================================================== -->
   <!-- C O P Y  R E S O U R C E S                                         -->

Modified: maven/maven-1/plugins/trunk/xdoc/plugin.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/plugin.properties?rev=290361&r1=290360&r2=290361&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/plugin.properties (original)
+++ maven/maven-1/plugins/trunk/xdoc/plugin.properties Mon Sep 19 21:58:36 2005
@@ -80,6 +80,10 @@
 # Files not copied unless skin is classic
 maven.xdoc.copy.excludes.classic=external-classic.png,help_logo.gif,icon_arrowfolderclosed1_sml.gif,icon_arrowwaste1_sml.gif,icon_arrowwaste2_sml.gif,icon_doc_lrg.gif,icon_doc_sml.gif,icon_error_lrg.gif,icon_folder_lrg.gif,icon_folder_sml.gif,icon_help_sml.gif,icon_info_lrg.gif,icon_members_lrg.gif,icon_sortdown.gif,icon_sortup.gif,icon_success_lrg.gif,icon_usergroups_lrg.gif,icon_arrowfolderopen2_sml.gif,icon_warning_lrg.gif,newwindow-classic.png,nw_maj_rond.gif,strich.gif,sw_maj_rond.gif,sw_med_rond.gif
 
+# List of xml files (or patterns) to exclude from validation
+# Note that navigation.xml and ${maven.xdoc.xml.copy} are included implicitly
+maven.xdoc.validate.exclude=changes.xml
+
 #
 # I18N Preferences
 #

Modified: maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/dtd/maven-xdoc-1.10.dtd
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/dtd/maven-xdoc-1.10.dtd?rev=290361&r1=290360&r2=290361&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/dtd/maven-xdoc-1.10.dtd (original)
+++ maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/dtd/maven-xdoc-1.10.dtd Mon Sep 19 21:58:36 2005
@@ -2,20 +2,25 @@
 <!ENTITY % XHTML SYSTEM "xhtml1-transitional.ent">
 %XHTML;
 <!ELEMENT document (properties, body)>
-<!ELEMENT properties (title, author)>
+<!ATTLIST document
+   xmlns CDATA #FIXED ""
+>
+<!ELEMENT properties (title, author*)>
 <!ELEMENT title (#PCDATA)>
 <!ELEMENT author (#PCDATA)>
 <!ATTLIST author
   email CDATA #REQUIRED
 >
-<!ELEMENT body (section)>
-<!ELEMENT section (subsection+)>
+<!ELEMENT body (section+)>
+<!ELEMENT section (subsection | p | ul | ol | source | div | table)+>
 <!ATTLIST section
   name CDATA #REQUIRED
+  id CDATA #IMPLIED
 >
-<!ELEMENT subsection (p | ul | source)+>
+<!ELEMENT subsection (p | ul | ol | source | div | table)+>
 <!ATTLIST subsection
   name CDATA #REQUIRED
+  id CDATA #IMPLIED
 >
 <!ELEMENT escapeXml ANY>
 <!ELEMENT source (#PCDATA | escapeXml)*>

Modified: maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/xsd/maven-navigation-1.10.xsd
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/xsd/maven-navigation-1.10.xsd?rev=290361&r1=290360&r2=290361&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/xsd/maven-navigation-1.10.xsd (original)
+++ maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/xsd/maven-navigation-1.10.xsd Mon Sep 19 21:58:36 2005
@@ -21,7 +21,6 @@
     <xs:complexType>
       <xs:sequence>
         <xs:element ref="title"/>
-        <xs:element ref="head" minOccurs="0"/>
         <xs:element ref="body"/>
       </xs:sequence>
       <xs:attribute name="name" type="xs:string"/>
@@ -36,16 +35,20 @@
       </xs:simpleContent>
     </xs:complexType>
   </xs:element>
-  <xs:element name="head"/>
   <xs:element name="body">
     <xs:complexType>
       <xs:sequence>
         <xs:element ref="breadcrumbs" minOccurs="0"/>
         <xs:element ref="links" minOccurs="0"/>
         <xs:element ref="menu" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="search" minOccurs="0"/>
+        <xs:element ref="powered-by" minOccurs="0"/>
+        <xs:element ref="footer" minOccurs="0"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>
+  <xs:element name="search"/>
+  <xs:element name="footer"/>
   <xs:element name="links">
     <xs:complexType>
       <xs:sequence>
@@ -70,6 +73,13 @@
       <xs:attribute name="key" type="xs:string"/>
       <!-- type is an optional entry that defines where the menu is destined for.
       	   Values - left-header (default), left-footer -->
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="powered-by">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="item" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
     </xs:complexType>
   </xs:element>
   <xs:element name="item">

Modified: maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml?rev=290361&r1=290360&r2=290361&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml Mon Sep 19 21:58:36 2005
@@ -27,6 +27,7 @@
   </properties>
   <body>
     <release version="1.10" date="in SVN">
+      <action dev="ltheussl" type="fix" issue="MPXDOC-87">Fix <code>xdoc:validate</code>.</action>
       <action dev="ltheussl" type="fix" issue="MPXDOC-106" due-to="Jerome Lacoste">One cannot call xdoc:copy-user-resources directly.</action>
       <action dev="ltheussl" type="add" issue="MPXDOC-126" due-to="Maarten Coene">Add support for more powered-by banners.</action>
       <action dev="ltheussl" type="add" issue="MPXDOC-80" due-to="Joerg Schaible">Support global theme.</action>

Modified: maven/maven-1/plugins/trunk/xdoc/xdocs/goals.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/xdocs/goals.xml?rev=290361&r1=290360&r2=290361&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/xdocs/goals.xml (original)
+++ maven/maven-1/plugins/trunk/xdoc/xdocs/goals.xml Mon Sep 19 21:58:36 2005
@@ -44,10 +44,15 @@
         </description>
       </goal>
       <goal>
-        <name>init-dvsl-tag</name>
+        <name>xdoc:validate</name>
         <description>
-           This goal defines the <code>DVSL</code> tag library for generating
-           documentation. A single tag <code>dvsl:dvsl</code> is defined.      
+           Validates the user xdoc documents.
+        </description>
+      </goal>
+      <goal>
+        <name>xdoc:navigation-validate</name>
+        <description>
+           Validates the navigation file ${maven.xdoc.navigation.file}.
         </description>
       </goal>
       <goal>
@@ -64,4 +69,4 @@
       </goal>
     </goals>      
   </body>
-</document>
\ No newline at end of file
+</document>

Modified: maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml?rev=290361&r1=290360&r2=290361&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml (original)
+++ maven/maven-1/plugins/trunk/xdoc/xdocs/properties.xml Mon Sep 19 21:58:36 2005
@@ -90,7 +90,18 @@
             Override this to get back some images you need in your site when
             using a non-classic theme.
           </td>
-        </tr>        
+        </tr>
+        <tr>
+          <td>maven.xdoc.validate.exclude</td>
+          <td>Yes</td>
+          <td>
+            A comma separated list of patterns to specify xml documents that
+            are to be excluded in <code>xdoc:validate</code>. This defaults to
+            <code>${maven.xdoc.navigation.file}</code>,
+            <code>${maven.xdoc.xml.copy}</code>,
+            <code>changes.xml</code>.
+          </td>
+        </tr>
       </table>
     </section>
     <section name="Localization Properties">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org