Re: logical stuff

2001-01-02 Thread Christoph Reck
here my 2c: 1) What do we do about determining if a reference is null in VTL? [snip] - use something like : #if( $foo == null ) +0, but make it uppercase NULL to reflect the constantness of it. [snip] - or #ifdefined( $foo ) or #ifdef( $foo ) This is trivially easy to do. but not

Re: Strange Exception with velocity

2001-04-17 Thread Christoph Reck
utsches Fernerkundungs Datenzentrum (DFD) DLR-DFD, Muenchner Strasse 20, D-82234 Wessling, Germany = Currenlty relocated to ESA-ESRIN === ESA ESRIN Tel: +39 06 941 80 589 c/o Christoph Reck (DLR) Fax: +39 06 941 80 512 Via Galileo Galilei

Re: AW: focus on an entry-field

2001-06-21 Thread Christoph Reck
The problem is probably that you used frames, and the frame the field is in does not have focus. Put the focus on the frame first using: window.focus(); I had the same problem and after I found this, the following code works (in a JavaScript block): // set focus either on password or

[PROPOSAL] XML Configuration

2001-10-15 Thread Christoph Reck
Please see the simple specification and examples at ftp://ftp.dfd.dlr.de/put/reck/XML_Configuration.html The sources are at ftp://ftp.dfd.dlr.de/put/reck/XmlConfig Please let me know if it is desireable that I prepare this for submission to the apache commons. :) Chirstoph Magnus

Re: DVSL tricks

2002-01-21 Thread Christoph Reck
. So, an admittedly cosmetic improvement would be to figure out how to grab those subproject names if they were child tag values, as I described above. I guess this is an xpath question. -- :) Christoph Reck -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail

Re: Quotation marks and CR in string literals?

2002-03-25 Thread Christoph Reck
=javascript:closeWindow()\n' + ' img src=$buttontext=Close+Window\n' + ' name=submit alt=Close Window border=0/a\n' + '/center\n' + '\n';\n' + document.open(); document.write(html); // -- /SCRIPT -- :) Christoph Reck -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED

Re: Quick Question.

2002-09-06 Thread Christoph . Reck
$Regexp.substitute('s/ /nbsp;nbsp;/g', $l_line)/ttbr$NL#* *##end#* *#br$NL#* *##end -- :) Christoph Reck -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]

Re: improvements (perhaps) to TemplateTool

2003-02-11 Thread Christoph . Reck
(); Thanks for this tip. Does this also apply to the standard VelocityEngine? geir -- :) Christoph Reck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: problems hooking event handlers in with EventCartridge

2003-06-30 Thread Christoph . Reck
one should be simple. -- :) Christoph Reck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: VelocityView index.vm question

2003-07-25 Thread Christoph . Reck
-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- :) Christoph Reck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Global Variable in vm files

2003-09-08 Thread Christoph . Reck
] For additional commands, e-mail: [EMAIL PROTECTED] -- :) Christoph Reck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Possible bug with macros that start with the word 'set'?

2003-09-08 Thread Christoph . Reck
who understand binary and those who don't. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- :) Christoph Reck

Re: Register a dynamically generated Velocimacro?

2004-06-25 Thread Christoph Reck
Hi, there is a RenderTool in the velocity tools subproject that you can reuse to do the Velocity.evalute(...) for you. Cheers, Christoph Kris Nuttycombe wrote: So, just to clarify, the tool I put into the context will invoke Velocity.evaluate(...) on the string containing the new macro? And I'll

Re: Documentation for Directive

2004-10-27 Thread Christoph Reck
Ben wrote: Where can I find more information about Velocity Directive? I would like to write one but so far it doesn't work... I would like to do something like this: #useSomething(/WEB-INF/file.xml) #doSomething(nodeA) #doSomething(nodeB) #end I created two directives, one for #useSomething (as

Re: Obfuscation and Velocity

2004-11-24 Thread Christoph Reck
Hi Yim, to my knowledge, you can tell the obfuscator to not touch specific classes/classNames/methods, which are part of the external API. Velicity uses java objects placed in the context under a specific keyName, which are then accessed in the template with the $keyName as a reference. $keyName

Re: Obfuscation and Velocity

2004-11-25 Thread Christoph Reck
it, probably it is the best to do it yourself as noted. Be warned, it won't be an easy task. If you find trouble with searializing the velocity classes, you might try to fix it and send patches or seek advice in the velocity-dev list. Carfield Yim wrote: Christoph Reck wrote: Hi Yim, [snip] You seem

Re: vm to return a binary file

2004-11-25 Thread Christoph Reck
the VelocitylayoutServlet, wher you have to instruct to skip the layout in such a case... If you wish an example of creating binary content with a servlet check the literature, servlets.com, or I can send you a servlet code that creates button+text images on the fly. -- :) Christoph Reck

Re: vm to return a binary file

2004-11-25 Thread Christoph Reck
. That code would be much appreciated. Could you also tell me to which directory I should compile my .class to? Ilan -Original Message- From: Christoph Reck [mailto:[EMAIL PROTECTED] Sent: 25 November 2004 04:17 To: Velocity Users List Subject: Re: vm to return a binary file Ilan Azbel wrote

Re: vm to return a binary file

2004-11-28 Thread Christoph . Reck
the VelocitylayoutServlet, wher you have to instruct to skip the layout in such a case... If you wish an example of creating binary content with a servlet check the literature, servlets.com, or I can send you a servlet code that creates button+text images on the fly. -- :) Christoph Reck

Re: unwanted whitespace

2004-12-08 Thread Christoph Reck
Hi Rob, (and everyone else trying to understand velocitys whitespace handling... Check the Wiki page http://wiki.apache.org/jakarta-velocity/VelocityWhitespaceGobbling on this subject. The so called VelocityWhitespaceGobbleChristophsWay should be called

Re: Chop output...

2005-01-17 Thread Christoph . Reck
PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- :) Christoph Reck - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Two macros calling one another

2005-01-18 Thread Christoph Reck
Hi, 1rst: reconsider your design; your example causes a infinite depth call tree and will end up in an OutOfMemoryException... Velocity has some guards in recursive parses (property: directive.parse.maxdepth = 10), but it does not look like it guards against deep macro calls. 2nd: You could

Re: Semi-workaround for the Whitespace gobbling problem

2005-02-07 Thread Christoph Reck
on the line of this thread... Sometimes I use the #*...*# spanning a line to allow for structured templates; also some macros help making the implicit formatting visible: ## #macro( print $text )$text#end ## #macro( println $text )$text #end ## #macro( testMacro )#* *##if ( some condition )#*

Re: best practice question

2005-03-02 Thread Christoph Reck
Hi, I remember having problems with the introspector when accessing static methods of a class itself. But somehow I cannot believe that it is causing problems when the class was instantiated. If you tested removing the static from the getter, and it still does not work: public String

Re: File format contains the fixed size s# with left padded 0, can we do this in Velocity?

2005-03-18 Thread Christoph Reck
You can also use plain VTL: #set( $id = $number ) #set( $len = $id.length() - 4 ) $id.substring($len) To simplify the use, you can create a macro for this: #macro( fourdigits $number )#* *##* #local( $id $len ) *##*-- optional directive, avoids polluting context *##set( $id =

Re: Embedding an temporary Picture into an Template

2005-03-23 Thread Christoph Reck
that there might be other solutions, you can re-ask on this thread. Cheers, :) Christoph Reck Michael Belz wrote: Hi, I'm trying to put a graphic into an Velocity Template (vm). The problem is that the servelt generated graphic should not be physically saved to an temporary folder on the server. It's

Re: Embedding an temporary Picture into an Template

2005-03-23 Thread Christoph . Reck
that there might be other solutions, you can re-ask on this thread. Cheers, :) Christoph Reck Michael Belz wrote: Hi, I'm trying to put a graphic into an Velocity Template (vm). The problem is that the servelt generated graphic should not be physically saved to an temporary folder on the server. It's

Re: How to convert string in int

2005-03-24 Thread Christoph Reck
Hi, have you tried the Integer class methods: ## create an integer instance to be used as a tool #set( $Integer = 0 ) ##... ## retrieve your number string #set( $countString = $!data.getRequest().getParameter(countRow) ) ## convert it to an Integer #set( $count = $Integer.parseInt($countString) )

Re: instanceof

2005-04-11 Thread Christoph Reck
. OTOH, some folks would consider it breaking MVC philosofy to use such code in templates. :) Christoph Reck The isA method works, but (at the moment) only checks the actual classname (not superclasses). Before I go about working this out, I just wondered if I had missed something crucial ... ? Cheers

Re: Template as *Stream* ?

2005-04-11 Thread Christoph Reck
/ViewRenderTool.html Best regards, -- Shinobu Best regards from me too, :) Christoph Reck Matthias Wessendorf wrote: Hi, I am testing Velocity and I have some templates on file. That works fine. However is there a possibility to use a *stream* something like a String ? getTemplate(Hello $name! Welcome to Velocity

Re: how to set null value

2005-05-02 Thread Christoph . Reck
The reson for not allowing a null in the context was the original implementation with a Hashtable backed context, which did not allow nulls. The original designers thought that other implementations should also be shielded from dealing with null values, eg. databases (also CORBA) often can't. Now

Re: Encoding Problem

2005-05-03 Thread Christoph Reck
to simply create your input file with ISO-8859-7, use Velocity.getTemplate(template file name, ISO-8859-7) and then write the output in UTF-8 and have the proper first line ?xml version=1.0 encoding=UTF-8 ? in the FOP file. Cheers, :) Christoph Reck Sandeep kamath wrote: Hi Daniel, I am using

Re: template string question

2005-06-01 Thread Christoph Reck
See the APIdoc for the String and java.util.regex.Pattern classes for more information. Cheers, :) Christoph Reck Liu, Teh P wrote: Hi All, I have a string TehpaoLiu Is it possible to just extract Tehpao from the above string in velocity? Any help will be appreciated. Thanks - tehpao

Re: ereg_replace

2005-06-07 Thread Christoph Reck
Allnoch Gerlinde wrote: Hello, i am looking for something like: #set ($thema = ereg_replace('# ', '', $thema)) #set ($thema = ereg_replace('# ', '', $thema)) #set ($thema = ereg_replace('#', '', $thema)) How is it possible to do this ? If you are running on a JDK 1.4 VM try: #set(

Re: for loops break?

2005-07-11 Thread Christoph Reck
(tm) in the nichglty builds? :) Christoph Reck Jean Francois Chamard wrote: Hi there, been using velocity for a while now. Is there a way to get out of a loop? Perhaps it has been asked but I found nothing on the subject (guide, wiki, ...). If there is, sorry about it. Is there a way to do

Re: Declaring local variables in macro

2005-07-21 Thread Christoph Reck
Look at the readme.txt of the contributed Local directive in: http://svn.apache.org/repos/asf/jakarta/velocity/core/trunk/contrib/temporary/localdirective/ :) Christoph Reck Antonius Ng wrote: Hi all, I would appreciate if anyone can advise me on how to declare a local variable in macro

Re: How to see if there is the end of the array

2005-07-22 Thread Christoph Reck
Checkout the IteratorTool which should address your request: http://jakarta.apache.org/velocity/tools/generic/ :) Christoph Reck Jean Francois Chamard wrote: Christoph's simplest solution works perfectly :) but if you want to separate each column with , and the last one with and... here

Re: How to see if there is the end of the array

2005-07-23 Thread Christoph . Reck
The simplest solution is to prefix the comma: #set( $sep = ) #foreach ($column in $column-detail-data) $sep${column.getChild(header).Text} #set( $sep = , ) #end This is fully independant of any counter and end of array. :) Christoph Reck Minor, Vitali wrote: Hallo

Re: Not able to have in the string

2005-07-29 Thread Christoph Reck
= href=javascript:tab('a1','a2','a3') ) might work with a nightly build... :) Christoph Reck Shailendra Kumar Vikas wrote: Hi All, I am trying to generate some HTML code from the velocity code . I need to build the HTML syntax and keep it in a string . I want to have a syntax like

Re: Comparing strings

2005-09-16 Thread Christoph Reck
Hi Steve, Steve O'Hara wrote: A while back I chastised someone for not using proper String comparison operators in their templates. I looked in the Velocity code and sure enough == operators are translated into equals. So I was looking a bit stupid. Somebody challenged me to come up with a

Re: Hacking Velocity

2005-09-16 Thread Christoph Reck
Ugh... this is a really complete example on how to hack a system if you have control of the velocity templates... To get it to work, you might insert some text outputs for debuging. I a project with the young velocity 1.0 I did something similar using a class with a parameterless constructor,

Re: Valid characters for value in VTL - urgent

2005-09-19 Thread Christoph Reck
Hi, Ravikanth L wrote: Hi All, I would like to know the valid characters that we can use for a value in VTL. I tried the following #set($var = My string with special chars##) Velocity defines a line-comment starting with the characters ## Also note that Velocity offers a feature called

Re: Valid characters for value in VTL - urgent

2005-09-19 Thread Christoph Reck
Hi Ravikanth, there is no such list of unallowed characthers in a string. Only the velocity syntax exists. Therefore up to Velocity 1.4, a string may not contain the quote character itself and a new-line character. Additionally you need care with the other symbols: \ $ # which have a meaning to

Re: Map.get(missingKey) doesnt return null.

2005-09-30 Thread Christoph Reck
Hi, Daniel Brownell wrote: Hi there, Thanks for the help on the Map of maps question. This question is related. Velocity is giving me values when I should be getting null. that is the current standard behaviour of #set, where it won't change the value when trying to set a null. In the

Re: What's the ideal syntax? Was: [ANN] Viento - WHY?

2005-10-10 Thread Christoph Reck
Hi, the whitespace issue has been debated quite a lot, and we have a consensus in this list that we will implement in the future a gobble-none and a gobble-structured form; latter, with your example: ## example of all whitespace being gobbled #if ($user.isAuthorized) #text(Hello) #else

Re: What's the ideal syntax? Was: [ANN] Viento - WHY?

2005-10-11 Thread Christoph Reck
community, and anyone who is interested can jump in and supply a patch. Personally, if someone reworks the parser to be non-whitespace-gobbling, I would be eager to then provide the structured template gobbling implementation patch! :) Christoph Reck Jonathan Revusky wrote: Christoph Reck wrote

Re: postscript

2005-11-03 Thread Christoph Reck
If you want to be flexible in generating PDF or PostScript, you might want to consider using FOP: http://xml.apache.org/fop/ Especially http://xmlgraphics.apache.org/fop/trunk/running.html And the specification at http://www.w3.org/TR/xsl/slice6.html#fo-section Otherwise you can generate