You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/11/26 22:48:46 UTC

svn commit: r1039572 - /myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib20.vm

Author: lu4242
Date: Fri Nov 26 21:48:46 2010
New Revision: 1039572

URL: http://svn.apache.org/viewvc?rev=1039572&view=rev
Log:
MYFACES-2962 Descriptions of components, attributes, etc. are missing in taglib.xml files generated by MyFaces Builder Plugin

Modified:
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib20.vm

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib20.vm
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib20.vm?rev=1039572&r1=1039571&r2=1039572&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib20.vm (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/resources/META-INF/facelets-taglib20.vm Fri Nov 26 21:48:46 2010
@@ -29,6 +29,74 @@
 
 $baseContent
 
+## ----------------------------- START MACROS -----------------------------
+##
+## -------------------------------
+## writeJSFProperty
+## -------------------------------
+##
+#macro (writeJSFProperty $property)
+#if (!$property.isTagExcluded())
+        <attribute>
+#if ($property.longDescription)
+           <description><![CDATA[$property.longDescription]]></description>
+#else
+           <description><![CDATA[]]></description>
+#end
+           <name>$property.jspName</name>
+#if ($property.isRequired())
+           <required>$property.isRequired()</required>
+#end
+#if ($property.isMethodExpression() || $property.isMethodBinding())
+#if ($property.getMethodBindingSignature())
+#set ($sig = $property.getMethodBindingSignature())
+           <method-signature>$sig.returnType myMethod( $sig.parameterTypesAsString )</method-signature>
+#end
+#elseif($property.deferredValueType)
+           <type>$property.deferredValueType</type>
+#elseif ($type == "String")
+           <type>java.lang.String</type>
+#else
+           <type>$property.className</type>
+#end
+        </attribute>
+#end
+#end
+##
+## -------------------------------
+## writeJSFAttribute
+## -------------------------------
+##
+#macro (writeJSFAttribute $attribute)
+#if (!$attribute.isTagExcluded())
+        <attribute>
+#if ($attribute.longDescription)
+           <description><![CDATA[$attribute.longDescription]]></description>
+#else
+           <description><![CDATA[]]></description>
+#end
+           <name>$attribute.jspName</name>
+#if ($attribute.isRequired())
+           <required>$attribute.isRequired()</required>
+#end
+#set ($type = $utils.getClassFromFullClass($attribute.className))
+#if ($type == "MethodExpression")
+           <method-signature>${attribute.deferredMethodSignature}</method-signature>
+#elseif ($type == "ValueExpression")
+#if($attribute.deferredValueType)
+           <type>$attribute.deferredValueType</type>
+#end
+#else
+#if ($attribute.className)         
+           <type>$attribute.className</type>
+#else
+           <type>java.lang.String</type>
+#end
+#end
+        </attribute>
+#end
+#end
+## ----------------------------- END MACROS -------------------------------
     <!-- Component Tags -->
 #set ($componentList = ${model.getComponents()})
 #foreach( $component in $componentList )
@@ -38,6 +106,11 @@ $baseContent
 ## Check if we don't have a facelet tag taking precedence over this description
 #if (! ${model.findFaceletTagByName($component.name)})
     <tag>
+#if ($component.longDescription)
+        <description><![CDATA[$component.longDescription]]></description>
+#else
+        <description><![CDATA[]]></description>
+#end    
         <tag-name>$utils.getTagName($component.name)</tag-name>
         <component>
             <component-type>$component.type</component-type>
@@ -50,6 +123,10 @@ $baseContent
             <handler-class>$component.tagHandler</handler-class>
 #end
         </component>
+#set ($attributeList = ${component.propertyList})
+#foreach( $attribute in $attributeList )
+#writeJSFProperty($attribute)
+#end        
     </tag>
 #end
 #end
@@ -65,6 +142,11 @@ $baseContent
 ## Check if we don't have a facelet tag taking precedence over this description
 #if (! ${model.findFaceletTagByName($component.name)}) 
     <tag>
+#if ($component.longDescription)
+        <description><![CDATA[$component.longDescription]]></description>
+#else
+        <description><![CDATA[]]></description>
+#end    
         <tag-name>$utils.getTagName($component.name)</tag-name>
         <converter>
             <converter-id>$component.converterId</converter-id>
@@ -72,6 +154,10 @@ $baseContent
             <handler-class>$component.tagHandler</handler-class>
 #end
         </converter>
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#writeJSFProperty($property)
+#end        
     </tag>
 #end
 #end
@@ -87,6 +173,11 @@ $baseContent
 ## Check if we don't have a facelet tag taking precedence over this description
 #if (! ${model.findFaceletTagByName($component.name)})
     <tag>
+#if ($component.longDescription)
+        <description><![CDATA[$component.longDescription]]></description>
+#else
+        <description><![CDATA[]]></description>
+#end    
         <tag-name>$utils.getTagName($component.name)</tag-name>
         <validator>
             <validator-id>$component.validatorId</validator-id>
@@ -94,6 +185,10 @@ $baseContent
             <handler-class>$component.tagHandler</handler-class>
 #end
         </validator>
+#set ($propertyList = ${component.propertyList})
+#foreach( $property in $propertyList )
+#writeJSFProperty($property)
+#end        
     </tag>
 #end
 #end
@@ -109,10 +204,19 @@ $baseContent
 ## Check if we don't have a facelet tag taking precedence over this description
 #if (! ${model.findFaceletTagByName($behavior.name)}) 
     <tag>
+#if ($behavior.longDescription)
+        <description><![CDATA[$behavior.longDescription]]></description>
+#else
+        <description><![CDATA[]]></description>
+#end    
         <tag-name>$utils.getTagName($behavior.name)</tag-name>
         <behavior>
             <behavior-id>$behavior.behaviorId</behavior-id>
         </behavior>
+#set ($propertyList = ${behavior.propertyList})
+#foreach( $property in $propertyList )
+#writeJSFProperty($property)
+#end        
     </tag>
 #end
 #end
@@ -127,8 +231,16 @@ $baseContent
 ## Check if we don't have a facelet tag taking precedence over this description
 #if (! ${model.findFaceletTagByName($tag.name)})
    <tag>
+#if ($tag.longDescription)
+        <description><![CDATA[$tag.longDescription]]></description>
+#else
+        <description><![CDATA[]]></description>
+#end    
       <tag-name>$utils.getTagName($tag.name)</tag-name>
       <handler-class>$tag.tagHandler</handler-class>
+#foreach( $attribute in $attributeList )
+#writeJSFAttribute($attribute)
+#end
    </tag>
 #end
 #end
@@ -141,6 +253,12 @@ $baseContent
 #if ($modelIds.contains($faceletTag.modelId) && ($faceletTag.name))
 #if ($utils.getTagPrefix($faceletTag.name) == $shortname)
    <tag>
+#if ($faceletTag.longDescription)
+        <description><![CDATA[$faceletTag.longDescription]]></description>
+#else
+        <description><![CDATA[]]></description>
+#end    
+
       <tag-name>$utils.getTagName($faceletTag.name)</tag-name>
 #if ($faceletTag.componentClass)
 #set ($component = ${model.findComponentByClassName($faceletTag.componentClass)})
@@ -168,6 +286,10 @@ $baseContent
 #else
     <handler-class>$faceletTag.className</handler-class>
 #end
+#set ($attributeList = ${tag.attributeList})
+#foreach( $attribute in $attributeList )
+#writeJSFAttribute($attribute)
+#end
    </tag>
 #end
 #end