Undefined Reference:- raise exception?

2005-11-18 Thread Daniel Burke
Hi, Is it possible to configure velocity to raise an exception if a variable is reference which is undefined at the parsing stage? I know you use quiet syntax to not output the variable name but I want to stop parsing the message. cheers Dan

Re: Undefined Reference:- raise exception?

2005-11-18 Thread Nathan Bubna
parsing? do you mean the merging stage? there's no context at the parsing stage. and if the latter, then yes, that should be doable. look in the developer's guide for the ReferenceInsertionEventHandler. On 11/18/05, Daniel Burke [EMAIL PROTECTED] wrote: Hi, Is it possible to configure

Re: Undefined Reference:- raise exception?

2005-11-18 Thread Daniel Burke
Sorry, merging. I had a look at that however I don't think that will address my issue. I want to throw an Exception if the value is null. However the interface method ReferenceInsertionEventHandler.referenceInsert is not defined as throwing an exception. I think at this stage I'm stuck. Anyone got

Re: [PATCH] TexenTask - Support for property and propertyset

2005-11-18 Thread Hilco Wijbenga
ant? I assume you mean maven? Or am I in the wrong source tree? Here's what I did: I created test/texen/templates/nested_elements.vm test/texen/compare/nested_elements.txt I updated test/texen/templates/Control.vm test/texen-classpath/jar-contents/Control.vm

Re: Undefined Reference:- raise exception?

2005-11-18 Thread Llewellyn Falco
Hey Daniel, Will I took a look at this earlier today, should have a patch in soon, I'll send a usable build later today. llewellyn. - Original Message - From: Daniel Burke [EMAIL PROTECTED] To: velocity-dev@jakarta.apache.org Sent: Friday, November 18, 2005 7:27 AM Subject:

Re: Undefined Reference:- raise exception?

2005-11-18 Thread Will Glass-Husain
I can think of two different methods... (1) Implement a ReferenceInsertionHandler. This has a method that receives the complete reference string (e.g. foo.bar.someMethod() ) and allows you to modify the result. The problem is that this will not be called for invalid references. (2) better

Re: [PATCH] TexenTask - Support for property and propertyset

2005-11-18 Thread Will Glass-Husain
Hi Hilco, Actually, the ant build is the standard build. The maven build is still experimental. (Though I thought it ran those tests). Basically, most of the tests are run via junit in one big TestSuite. But there's 3 or 4 that depend on ant (or depend on custom classpath settings).

svn commit: r345566 - in /jakarta/velocity/core/trunk/test/templates: compare/interpolation.cmp interpolation.vm

2005-11-18 Thread wglass
Author: wglass Date: Fri Nov 18 13:05:31 2005 New Revision: 345566 URL: http://svn.apache.org/viewcvs?rev=345566view=rev Log: check string interpolation with comments Modified: jakarta/velocity/core/trunk/test/templates/compare/interpolation.cmp

svn commit: r345571 - in /jakarta/velocity/core/trunk/src/test/org/apache/velocity/test: InfoTestCase.java misc/UberspectTestException.java

2005-11-18 Thread wglass
Author: wglass Date: Fri Nov 18 13:10:24 2005 New Revision: 345571 URL: http://svn.apache.org/viewcvs?rev=345571view=rev Log: minor tweaks-- fail on (unexpected) exception, add better message Modified: jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/InfoTestCase.java

svn commit: r345574 - in /jakarta/velocity/core/trunk/src/java/org/apache/velocity: app/event/implement/ context/ exception/ runtime/ runtime/directive/ runtime/log/ runtime/parser/

2005-11-18 Thread wglass
Author: wglass Date: Fri Nov 18 13:11:38 2005 New Revision: 345574 URL: http://svn.apache.org/viewcvs?rev=345574view=rev Log: fix imports Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/event/implement/PrintExceptions.java

Re: Undefined Reference:- raise exception?

2005-11-18 Thread Will Glass-Husain
Hi, I'm rethinking my earlier message. Definitely implement a custom ReferenceInsertionHandler. If the refererence is invalid then the value will be null. If you want to stop parsing, throw a custom defined Error instead of an exception. Velocity catches all Exceptions from both the

[jira] Updated: (VELOCITY-423) Report invalid references

2005-11-18 Thread Will Glass-Husain (JIRA)
[ http://issues.apache.org/jira/browse/VELOCITY-423?page=all ] Will Glass-Husain updated VELOCITY-423: --- Attachment: invalidreference.txt Report invalid references - Key: VELOCITY-423 URL:

[jira] Created: (VELOCITY-423) Report invalid references

2005-11-18 Thread Will Glass-Husain (JIRA)
Report invalid references - Key: VELOCITY-423 URL: http://issues.apache.org/jira/browse/VELOCITY-423 Project: Velocity Type: New Feature Components: Source Reporter: Will Glass-Husain Fix For: 1.5 Attachments:

Re: Undefined Reference:- raise exception?

2005-11-18 Thread Will Glass-Husain
Hi, I've coded an event handler (InvalidReferenceHandler) that implements this. It's in a patch file at http://issues.apache.org/jira/browse/VELOCITY-423 It can be configured to either parse the whole page and collect a list of invalid resources, or to throw a runtime exception upon

[jira] Commented: (VELOCITY-132) IllegalArgumentException while calling an overloaded method

2005-11-18 Thread Llewellyn Falco (JIRA)
[ http://issues.apache.org/jira/browse/VELOCITY-132?page=comments#action_12358041 ] Llewellyn Falco commented on VELOCITY-132: -- the following test breaks. package com.spun.util.velocity.tests; import junit.framework.TestCase; import

[jira] Updated: (VELOCITY-422) Add support for property and propertyset nested elements to TexenTask.

2005-11-18 Thread Hilco Wijbenga (JIRA)
[ http://issues.apache.org/jira/browse/VELOCITY-422?page=all ] Hilco Wijbenga updated VELOCITY-422: Attachment: texen.tar.bz2 The contents of the attached tarball is listed below. The patch itself (code documentation):

[jira] Commented: (VELOCITY-422) Add support for property and propertyset nested elements to TexenTask.

2005-11-18 Thread Will Glass-Husain (JIRA)
[ http://issues.apache.org/jira/browse/VELOCITY-422?page=comments#action_12358055 ] Will Glass-Husain commented on VELOCITY-422: Sounds very promising. Sorry to be obnoxious about this, but... Could you submit this as one diff? It's really

Re: Undefined Reference:- raise exception?

2005-11-18 Thread Will Glass-Husain
But in the uberspect you don't have access to the full reference string. Seems less useful. Maybe there's a different way. We could make a new event handler to be called upon invalid references. (as opposed to null references). Of course, this isn't a one versus other. The uberspect

[jira] Updated: (VELOCITY-422) Add support for property and propertyset nested elements to TexenTask.

2005-11-18 Thread Hilco Wijbenga (JIRA)
[ http://issues.apache.org/jira/browse/VELOCITY-422?page=all ] Hilco Wijbenga updated VELOCITY-422: Attachment: patch.txt I didn't realise diff could be used like this. Very nice! The attached file is exactly what you suggested: 'svn diff .' in the

[jira] Commented: (VELOCITY-422) Add support for property and propertyset nested elements to TexenTask.

2005-11-18 Thread Will Glass-Husain (JIRA)
[ http://issues.apache.org/jira/browse/VELOCITY-422?page=comments#action_12358057 ] Will Glass-Husain commented on VELOCITY-422: what is test.jar? It's very unusual to store a jar file in source control? Add support for property and

[jira] Commented: (VELOCITY-422) Add support for property and propertyset nested elements to TexenTask.

2005-11-18 Thread Will Glass-Husain (JIRA)
[ http://issues.apache.org/jira/browse/VELOCITY-422?page=comments#action_12358058 ] Will Glass-Husain commented on VELOCITY-422: never mind, I get it. Maybe we could have the ant script generate this. Add support for property and propertyset