Hi,

I'm the developer of JoSQL (http://josql.sf.net) and I've had a request from a user to extend the foreach directive to include JoSQL processing facilities.

Along the lines of:

#foreach( $mud in $mudsOnSpecial where $customer.hasPurchased($mud) order by 
$mud.price)

     <tr>
       <td>
         $flogger.getPromo( $mud )
       </td>
     </tr>

In essence to allow the collection to be filtered and ordered prior to being processed by the foreach directive. Alternatively it may be that I would add it via a custom directive.

To make this work though I have a couple of questions:

1. How do I make a new directive available to velocity? I am currently, for testing purposes, using the "ant docs" command to process a file that has the extended syntax in it. I have modified the "directive.properties" file to add my new
class, it is loaded and I've modified the value returned by the "getName" 
method of my class however when I then use the
directive in my test file it isn't being used.

2. How do I get the arguments for the directive from the Node? When I modify the Foreach class directly I find that only 4 child nodes are added to the Node, basically no more children are available after the "where" keyword. (To make argument
processing work I've modified the Parser.jjt file to allow for more args for 
the foreach directive).  How can I find
out what the arguments are and how can I get the parser to make them available? 
 They are available if I iterate through
the tokens associated with the Node.

Many thanks,

Gary




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to