+1 sent from my Android phone
On Aug 10, 2010 2:27 AM, "Leonardo Uribe" <[email protected]> wrote: > Hi > > The change looks good, as long as old templates keep working. I remember > some issues related to velocity and maven site plugin, so we need first to > check if the change allows build myfaces core site (maven site plugin > requires velocity 1.4, but myfaces builder plugin requires velocity 1.5). > > regards, > > Leonardo Uribe > > 2010/8/9 Ali Ok <[email protected]> > >> Hi, >> >> Currently, we don't use Velocity macros in the templates for generating >> sources. At least we can use the macros defined in vm files, although there >> is an option for writing Java code for macros (which is less preferred). >> I've created https://issues.apache.org/jira/browse/MYFACES-2866 for this >> issue. >> >> So, for example, instead of >> >> <tag> >> >> ...... >> >> #set ($propertyList = ${component.propertyList}) >> #foreach( $property in $propertyList ) >> #if (!$property.isTagExcluded())* <attribute> >> #if ($property.longDescription) >> <description><![CDATA[$property.longDescription]]></description> >> ................ >> ................ >> </attribute> >> #end* >> #end >> </tag> >> >> we could've used >> >> <tag> >> >> .... >> >> #set ($propertyList = ${component.propertyList}) >> #foreach( $property in $propertyList ) >> #if (!$property.isTagExcluded()) >> *#writeProperty($property)* >> >> #end >> >> </tag> >> >> >> where writeProperty macro can be defined in vm file, as explained in >> http://velocity.apache.org/engine/devel/user-guide.html#Velocimacros >> >> Furthermore, to reuse the macros in different vm files, there is "parse" >> [1] directive. But myfaces-builder-plugin must migrate to Velocity 1.6 (see >> https://issues.apache.org/jira/browse/MYFACES-2867) to parse the macros in >> different vm files. >> >> I checked out the myfaces-build-plugin, applied the mentioned changes >> locally, used in generating sources of my GSoC project and worked >> flawlessly (not committed yet). >> >> Any concerns at first sight? >> >> [1] http://velocity.apache.org/engine/devel/user-guide.html#Parse >> >> <http://velocity.apache.org/engine/devel/user-guide.html#Parse>Thanks, >> Ali >> -- >> My Blog: http://blog.aliok.com.tr >> Twitter: http://twitter.com/aliok_tr >> >>
